allyhub 0.10.0 → 0.11.0

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 (357) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/commands/dev.js +2 -2
  3. package/dist/commands/frames/report.js +2 -0
  4. package/dist/commands/frames.js +11 -9
  5. package/dist/commands/render.js +2 -2
  6. package/dist/node_modules/@allyhub/3d-extension/dist/stage-routes.js +1 -1
  7. package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
  8. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  9. package/dist/node_modules/@allyhub/browser/dist/emoji.d.ts +29 -0
  10. package/dist/node_modules/@allyhub/browser/dist/emoji.js +57 -0
  11. package/dist/node_modules/@allyhub/browser/dist/picture.d.ts +18 -0
  12. package/dist/node_modules/@allyhub/browser/dist/picture.js +2 -0
  13. package/dist/node_modules/@allyhub/browser/package.json +9 -1
  14. package/dist/node_modules/@allyhub/build/dist/index.d.ts +1 -0
  15. package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
  16. package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +7 -0
  17. package/dist/node_modules/@allyhub/build/dist/made-notes.d.ts +9 -0
  18. package/dist/node_modules/@allyhub/build/dist/made-notes.js +2 -0
  19. package/dist/node_modules/@allyhub/build/dist/project-tool.d.ts +17 -0
  20. package/dist/node_modules/@allyhub/build/dist/stage-route.d.ts +7 -0
  21. package/dist/node_modules/@allyhub/build/package.json +1 -1
  22. package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
  23. package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
  24. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  25. package/dist/node_modules/@allyhub/check/package.json +1 -1
  26. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  27. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  28. package/dist/node_modules/@allyhub/components/package.json +1 -1
  29. package/dist/node_modules/@allyhub/dev-server/dist/exports.js +1 -1
  30. package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
  31. package/dist/node_modules/@allyhub/dev-server/dist/inputs.js +2 -0
  32. package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
  33. package/dist/node_modules/@allyhub/dev-server/dist/pages.js +2 -0
  34. package/dist/node_modules/@allyhub/dev-server/dist/ports.js +2 -0
  35. package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
  36. package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
  37. package/dist/node_modules/@allyhub/dev-server/dist/respond.js +2 -0
  38. package/dist/node_modules/@allyhub/dev-server/dist/reveal.js +1 -1
  39. package/dist/node_modules/@allyhub/dev-server/dist/routes.js +1 -1
  40. package/dist/node_modules/@allyhub/dev-server/dist/server.js +2 -2
  41. package/dist/node_modules/@allyhub/dev-server/dist/tools.js +1 -1
  42. package/dist/node_modules/@allyhub/dev-server/dist/watcher.js +1 -1
  43. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  44. package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +7 -0
  45. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  46. package/dist/node_modules/@allyhub/doc/dist/html.js +15 -59
  47. package/dist/node_modules/@allyhub/doc/dist/page.js +1 -1
  48. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  49. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  50. package/dist/node_modules/@allyhub/doc-extension/package.json +12 -14
  51. package/dist/node_modules/@allyhub/doc-print/dist/pages.js +5 -5
  52. package/dist/node_modules/@allyhub/doc-print/dist/print.js +10 -10
  53. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  54. package/dist/node_modules/@allyhub/export/package.json +1 -1
  55. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  56. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  57. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +20 -0
  58. package/dist/node_modules/@allyhub/formats/dist/note-shape.js +1 -1
  59. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  60. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  61. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  62. package/dist/node_modules/@allyhub/image-extension/dist/export.js +4 -1
  63. package/dist/node_modules/@allyhub/image-extension/package.json +1 -6
  64. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  65. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  66. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  67. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  68. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  69. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  70. package/dist/node_modules/@allyhub/linkedin-extension/LICENSE +241 -0
  71. package/dist/node_modules/@allyhub/linkedin-extension/dist/article-build.js +2 -0
  72. package/dist/node_modules/@allyhub/linkedin-extension/dist/article-kind.js +2 -0
  73. package/dist/node_modules/@allyhub/linkedin-extension/dist/build-plugins.js +2 -0
  74. package/dist/node_modules/@allyhub/linkedin-extension/dist/build.js +5 -0
  75. package/dist/node_modules/@allyhub/linkedin-extension/dist/media.js +2 -0
  76. package/dist/node_modules/@allyhub/linkedin-extension/dist/stage-module.js +82 -0
  77. package/dist/node_modules/@allyhub/linkedin-extension/dist/stage.js +2 -0
  78. package/dist/node_modules/@allyhub/linkedin-extension/dist/workspace.js +2 -0
  79. package/dist/node_modules/@allyhub/linkedin-extension/package.json +287 -0
  80. package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +12 -0
  81. package/dist/node_modules/@allyhub/linkedin-model/LICENSE +241 -0
  82. package/dist/node_modules/@allyhub/linkedin-model/dist/article-check.js +5 -0
  83. package/dist/node_modules/@allyhub/linkedin-model/dist/article.js +3 -0
  84. package/dist/node_modules/@allyhub/linkedin-model/dist/check.js +2 -0
  85. package/dist/node_modules/@allyhub/linkedin-model/dist/count.js +3 -0
  86. package/dist/node_modules/@allyhub/linkedin-model/dist/edit.js +3 -0
  87. package/dist/node_modules/@allyhub/linkedin-model/dist/html.js +19 -0
  88. package/dist/node_modules/@allyhub/linkedin-model/dist/index.js +2 -0
  89. package/dist/node_modules/@allyhub/linkedin-model/dist/limits.js +2 -0
  90. package/dist/node_modules/@allyhub/linkedin-model/dist/little.js +2 -0
  91. package/dist/node_modules/@allyhub/linkedin-model/dist/post.js +2 -0
  92. package/dist/node_modules/@allyhub/linkedin-model/dist/requests.js +2 -0
  93. package/dist/node_modules/@allyhub/linkedin-model/package.json +14 -0
  94. package/dist/node_modules/@allyhub/linkedin-view/LICENSE +241 -0
  95. package/dist/node_modules/@allyhub/linkedin-view/dist/article.js +2 -0
  96. package/dist/node_modules/@allyhub/linkedin-view/dist/fold.js +3 -0
  97. package/dist/node_modules/@allyhub/linkedin-view/dist/index.js +2 -0
  98. package/dist/node_modules/@allyhub/linkedin-view/dist/post.js +2 -0
  99. package/dist/node_modules/@allyhub/linkedin-view/dist/stage.js +2 -0
  100. package/dist/node_modules/@allyhub/linkedin-view/dist/text.js +2 -0
  101. package/dist/node_modules/@allyhub/linkedin-view/package.json +21 -0
  102. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +600 -0
  103. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  104. package/dist/node_modules/@allyhub/media/package.json +1 -1
  105. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  106. package/dist/node_modules/@allyhub/model/package.json +1 -1
  107. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  108. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +2 -0
  109. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -1
  110. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  111. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +14 -1
  112. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  113. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +12 -0
  114. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  115. package/dist/node_modules/@allyhub/project/package.json +1 -1
  116. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +8 -0
  117. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +4 -0
  118. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  119. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +6 -0
  120. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  121. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +61 -1
  122. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  123. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +0 -1
  124. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  125. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +41 -3
  126. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  127. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +17 -0
  128. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  129. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +7 -0
  130. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  131. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +12 -0
  132. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  133. package/dist/node_modules/@allyhub/protocol/package.json +1 -5
  134. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  135. package/dist/node_modules/@allyhub/render/dist/encode.js +1 -1
  136. package/dist/node_modules/@allyhub/render/dist/index.js +1 -1
  137. package/dist/node_modules/@allyhub/render/dist/render.js +2 -2
  138. package/dist/node_modules/@allyhub/render/package.json +1 -1
  139. package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
  140. package/dist/node_modules/@allyhub/report-extension/dist/build.js +2 -0
  141. package/dist/node_modules/@allyhub/report-extension/dist/check.js +3 -0
  142. package/dist/node_modules/@allyhub/report-extension/dist/cli/find.js +2 -0
  143. package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +5 -0
  144. package/dist/node_modules/@allyhub/report-extension/dist/cli/picture.js +2 -0
  145. package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
  146. package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
  147. package/dist/node_modules/@allyhub/report-extension/dist/page.js +21 -0
  148. package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +21 -0
  149. package/dist/node_modules/@allyhub/report-extension/dist/styles.js +5 -0
  150. package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
  151. package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
  152. package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
  153. package/dist/node_modules/@allyhub/report-extension/package.json +182 -0
  154. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +132 -0
  155. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.css +105 -0
  156. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +17 -0
  157. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/tokens.js +38 -0
  158. package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
  159. package/dist/node_modules/@allyhub/runtime/dist/player/player.js +1 -1
  160. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  161. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  162. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  163. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  164. package/dist/node_modules/@allyhub/scenery-host/dist/layer/index.js +1 -1
  165. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.d.ts +6 -0
  166. package/dist/node_modules/@allyhub/scenery-host/dist/viewer.js +1 -1
  167. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  168. package/dist/node_modules/@allyhub/sheet/dist/export.js +2 -4
  169. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  170. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  171. package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -6
  172. package/dist/node_modules/@allyhub/sheet-extension/package.json +3 -7
  173. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  174. package/dist/node_modules/@allyhub/slides-extension/dist/export.js +1 -1
  175. package/dist/node_modules/@allyhub/slides-extension/package.json +3 -16
  176. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  177. package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +1 -1
  178. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  179. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  180. package/dist/node_modules/@allyhub/stage-page/dist/install.js +1 -1
  181. package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.js +1 -1
  182. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  183. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +14 -14
  184. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  185. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  186. package/dist/node_modules/@allyhub/video-extension/dist/export.js +1 -1
  187. package/dist/node_modules/@allyhub/video-extension/package.json +2 -4
  188. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  189. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  190. package/dist/node_modules/@allyhub/website/package.json +1 -1
  191. package/dist/node_modules/@allyhub/website-extension/dist/preview.js +5 -5
  192. package/dist/node_modules/@allyhub/website-extension/dist/project-tools.js +2 -2
  193. package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
  194. package/dist/node_modules/@allyhub/x-extension/dist/build.js +4 -3
  195. package/dist/node_modules/@allyhub/x-extension/package.json +10 -12
  196. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  197. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  198. package/dist/package.json +12 -10
  199. package/dist/works.js +1 -1
  200. package/editor-web/assets/{abnfDiagram-WEYOIA3C-CjAmWsNR.js → abnfDiagram-WEYOIA3C-BKmMA6gn.js} +1 -1
  201. package/editor-web/assets/{architecture-WOLXFQ4H-DeeKhyhZ.js → architecture-WOLXFQ4H-BEFBgb4k.js} +1 -1
  202. package/editor-web/assets/{architectureDiagram-ZHVYKT53-b32qTaJg.js → architectureDiagram-ZHVYKT53-_u5YfCjY.js} +1 -1
  203. package/editor-web/assets/{arrow-up-L4YV_65f.js → arrow-up-B5rJbBv0.js} +1 -1
  204. package/editor-web/assets/article-BUmD3xtR.js +8 -0
  205. package/editor-web/assets/article-DNioBb3p.js +7 -0
  206. package/editor-web/assets/{audio-lines-BFcM7G2L.js → audio-lines-CzuzsGjI.js} +1 -1
  207. package/editor-web/assets/{blockDiagram-RJAE7QA3-BNbnMNmw.js → blockDiagram-RJAE7QA3-DybfaO3Z.js} +1 -1
  208. package/editor-web/assets/bookmark-Dsd3kHJJ.js +1 -0
  209. package/editor-web/assets/button-eGxLxbv9.js +41 -0
  210. package/editor-web/assets/{c4Diagram-XDPPPE54-BEuemvMw.js → c4Diagram-XDPPPE54-BfqLHB5i.js} +1 -1
  211. package/editor-web/assets/channel-TNPgFDrw.js +1 -0
  212. package/editor-web/assets/chart-C37xvZT2.js +1 -0
  213. package/editor-web/assets/chart-no-axes-column-BVkeF_Mr.js +1 -0
  214. package/editor-web/assets/{chunk-2E7WHVMD-Zb5nPx_e.js → chunk-2E7WHVMD-BVp1I_d0.js} +1 -1
  215. package/editor-web/assets/{chunk-4EMNKR2T-DSEM2reX.js → chunk-4EMNKR2T-CTdgWEMr.js} +1 -1
  216. package/editor-web/assets/{chunk-55XCU76K-BOZa_65H.js → chunk-55XCU76K-7pnsxeaP.js} +1 -1
  217. package/editor-web/assets/{chunk-7S6XSTFO-DeiGeVpB.js → chunk-7S6XSTFO-Dc0Dvkq7.js} +1 -1
  218. package/editor-web/assets/{chunk-AQDTSKZB-fPuQFBJc.js → chunk-AQDTSKZB-VAILIsfx.js} +1 -1
  219. package/editor-web/assets/{chunk-DSNLSHJZ-5vdnoak2.js → chunk-DSNLSHJZ-CUDx1Rv5.js} +1 -1
  220. package/editor-web/assets/{chunk-HAGFOTED-DFF2mZJ1.js → chunk-HAGFOTED-DAoEe-dJ.js} +1 -1
  221. package/editor-web/assets/{chunk-HNE4Q36P-g6-ZLbTg.js → chunk-HNE4Q36P-g0akya12.js} +1 -1
  222. package/editor-web/assets/{chunk-NQOKRVIF-o3hNcHMJ.js → chunk-NQOKRVIF-hTGjzXdJ.js} +1 -1
  223. package/editor-web/assets/{chunk-UHW7PFBP-BQiDI9dK.js → chunk-UHW7PFBP-BgLV8BIJ.js} +1 -1
  224. package/editor-web/assets/{chunk-VQ5W62QI-CJlMXWWz.js → chunk-VQ5W62QI-Bw19OOSD.js} +1 -1
  225. package/editor-web/assets/{chunk-WQQL4CDK-pNBU8dXv.js → chunk-WQQL4CDK-CMST9dyE.js} +1 -1
  226. package/editor-web/assets/{chunk-YZO67HFG-2x-BiWd-.js → chunk-YZO67HFG-Bbpu36XF.js} +1 -1
  227. package/editor-web/assets/{chunk-ZAUX2LTX-etFStEM8.js → chunk-ZAUX2LTX-C48Ri0Gs.js} +1 -1
  228. package/editor-web/assets/{chunk-ZCHMQSOR-B3AYRhIY.js → chunk-ZCHMQSOR-DN1g01Oe.js} +1 -1
  229. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-6y2yX0oq.js → classDiagram-v2-4MYWR3UA-U6jbPr2d.js} +1 -1
  230. package/editor-web/assets/{collaborator-LRd0hELn.js → collaborator-B1u2td9m.js} +1 -1
  231. package/editor-web/assets/{createLucideIcon-CPS-TrJJ.js → createLucideIcon-GFZ_fxLc.js} +1 -1
  232. package/editor-web/assets/{cynefin-EF2NZ3EQ-CX4BTQQe.js → cynefin-EF2NZ3EQ-gzkai_7-.js} +1 -1
  233. package/editor-web/assets/{cynefinDiagram-WF24UDRP-LbDkOTy3.js → cynefinDiagram-WF24UDRP-DtSekSr6.js} +1 -1
  234. package/editor-web/assets/{dagre-NK4GIZVX-wCKQk7hi.js → dagre-NK4GIZVX-CiUwYVT6.js} +1 -1
  235. package/editor-web/assets/{diagram-CBK3MWTC-a9fofQwk.js → diagram-CBK3MWTC-r9XHCV-k.js} +1 -1
  236. package/editor-web/assets/{diagram-I5XIIV2D-UCLZWch5.js → diagram-I5XIIV2D-DxVsDZ34.js} +1 -1
  237. package/editor-web/assets/{diagram-ODIL2UCW-CAEe88Lp.js → diagram-ODIL2UCW-B0eNQoHV.js} +1 -1
  238. package/editor-web/assets/{diagram-PFBEJUXE-Cp1o45bs.js → diagram-PFBEJUXE-C7f2MfJT.js} +1 -1
  239. package/editor-web/assets/{diagram-RJA3I4VV-c6OVxDyq.js → diagram-RJA3I4VV-CSXcnvct.js} +1 -1
  240. package/editor-web/assets/{diagram-TYUNFSNR-BVRWslDM.js → diagram-TYUNFSNR-DXzOD_ii.js} +1 -1
  241. package/editor-web/assets/dist-BGRwhCQO.js +1 -0
  242. package/editor-web/assets/{dist-DwGhfliS.js → dist-BW4X7BrF.js} +1 -1
  243. package/editor-web/assets/dist-BgDRE85b.js +2 -0
  244. package/editor-web/assets/dist-Blq5nJnU.js +24 -0
  245. package/editor-web/assets/dist-BuWaZ3Y4.js +274 -0
  246. package/editor-web/assets/dist-C1emZ9wX.js +37 -0
  247. package/editor-web/assets/dist-CC7OeU1e.js +6 -0
  248. package/editor-web/assets/{dist-j6ZLVcgf.js → dist-CX-fiPSn.js} +16 -16
  249. package/editor-web/assets/dist-C_VvG-_9.js +5 -0
  250. package/editor-web/assets/dist-Ce7HrBxv.js +3 -0
  251. package/editor-web/assets/dist-D2k6w-_a.js +1 -0
  252. package/editor-web/assets/dist-DDv_SbKw.js +84 -0
  253. package/editor-web/assets/dist-DEoEO4zs.js +1 -0
  254. package/editor-web/assets/dist-DlDxxPIP.js +16 -0
  255. package/editor-web/assets/dist-Gz6NDS0J.js +4 -0
  256. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-KdOTJgFu.js → ebnfDiagram-V4P3TTPT-Cs4YRvDD.js} +1 -1
  257. package/editor-web/assets/{elk-QONTBCTQ-Cmlrp7qB.js → elk-QONTBCTQ-Bh3LZ9WI.js} +1 -1
  258. package/editor-web/assets/{erDiagram-KYQIGQAA-CBM7-aQm.js → erDiagram-KYQIGQAA-C4vYTYXp.js} +1 -1
  259. package/editor-web/assets/{eventmodeling-K75KTNOO-CEoJkbuW.js → eventmodeling-K75KTNOO-BN1kkHWS.js} +1 -1
  260. package/editor-web/assets/flowDiagram-IUGLLWBU-B04NGsyi.js +1 -0
  261. package/editor-web/assets/{ganttDiagram-R7GPNTJY-D4S6ZSYD.js → ganttDiagram-R7GPNTJY-CA1LkkC5.js} +1 -1
  262. package/editor-web/assets/{gitGraph-VSP46ZUC-BvkL6RSh.js → gitGraph-VSP46ZUC-Dy5tA7dG.js} +1 -1
  263. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-lTGguloH.js → gitGraphDiagram-PDYL7XHY-hJIB8EkH.js} +1 -1
  264. package/editor-web/assets/{hint-BimUgJms.js → hint-B8JpEypy.js} +1 -1
  265. package/editor-web/assets/index-CgB5osVc.js +28 -0
  266. package/editor-web/assets/index-Daytem9N.css +2 -0
  267. package/editor-web/assets/{info-OHQRW6UA-DvKzqNvp.js → info-OHQRW6UA-DvzSf7rQ.js} +1 -1
  268. package/editor-web/assets/{infoDiagram-MVDRKAX5-D7hCpehs.js → infoDiagram-MVDRKAX5-BjIMm4Af.js} +1 -1
  269. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-Bg93sZQe.js → ishikawaDiagram-HPEHV2GE-Bpz71S40.js} +1 -1
  270. package/editor-web/assets/{italic-BQBwRTe8.js → italic-D10w8n6C.js} +1 -1
  271. package/editor-web/assets/{journeyDiagram-BOSHW7O7-CKm_KONJ.js → journeyDiagram-BOSHW7O7-DAB-pZjD.js} +1 -1
  272. package/editor-web/assets/{kanban-definition-FNSA4HC5-BKknnpTR.js → kanban-definition-FNSA4HC5-cYeyh3P6.js} +1 -1
  273. package/editor-web/assets/katex-5Z2zF-9g.js +257 -0
  274. package/editor-web/assets/link-BC5xK1-1.js +1 -0
  275. package/editor-web/assets/{mermaid-parser.core-BzqkDnqL.js → mermaid-parser.core-req5LE0X.js} +3 -3
  276. package/editor-web/assets/{mermaid.core-CEpvTOAe.js → mermaid.core-zFwZug4C.js} +4 -4
  277. package/editor-web/assets/{mindmap-definition-6OY57UG3-BJ0qG8Wi.js → mindmap-definition-6OY57UG3-TStWb7DG.js} +1 -1
  278. package/editor-web/assets/minus-DaWs5i8B.js +1 -0
  279. package/editor-web/assets/{packet-JDAUHWVQ-ew3kvyFm.js → packet-JDAUHWVQ-smFhVKcB.js} +1 -1
  280. package/editor-web/assets/palette-BIOudGkm.js +1 -0
  281. package/editor-web/assets/{pegDiagram-ECIUJNBX-DqUS2xit.js → pegDiagram-ECIUJNBX-DvSNRv0-.js} +1 -1
  282. package/editor-web/assets/{pie-XZMESJXO-DTIAMPGm.js → pie-XZMESJXO-qjaGsBZG.js} +1 -1
  283. package/editor-web/assets/{pieDiagram-GNMPY74T-DoKOE02-.js → pieDiagram-GNMPY74T-Dd9P-Pdc.js} +1 -1
  284. package/editor-web/assets/play-CrMmPghG.js +1 -0
  285. package/editor-web/assets/{progress-CPEbDOoN.js → progress-DE4C5_3x.js} +1 -1
  286. package/editor-web/assets/props-form-CsmDBqzy.js +1 -0
  287. package/editor-web/assets/{quadrantDiagram-D57K4MC3-DauOpYun.js → quadrantDiagram-D57K4MC3-h2IIKUUA.js} +1 -1
  288. package/editor-web/assets/{radar-ABXABTNO-BvMJXUU-.js → radar-ABXABTNO-DlVrSA1d.js} +1 -1
  289. package/editor-web/assets/{railroad-I3PHUGI6-D3jdJmhM.js → railroad-I3PHUGI6-nFbuLAtc.js} +1 -1
  290. package/editor-web/assets/{railroad-abnf-LNEFI6M7-Dm8ZpmPj.js → railroad-abnf-LNEFI6M7-Daj8h2iV.js} +1 -1
  291. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-oc0Du7Ag.js → railroad-ebnf-DWYD2UWJ-eYJyl5PH.js} +1 -1
  292. package/editor-web/assets/{railroad-peg-JR7BVNR7-CMrQL_7U.js → railroad-peg-JR7BVNR7-BTRhKZQq.js} +1 -1
  293. package/editor-web/assets/{railroadDiagram-Y72NRBL7-y99z0C7i.js → railroadDiagram-Y72NRBL7-CeLGUjdp.js} +1 -1
  294. package/editor-web/assets/{react-DztDSW4P.js → react-WA6wlt8S.js} +1 -1
  295. package/editor-web/assets/{repeat-2-DJi4LW5C.js → repeat-2-VQP1EVOZ.js} +1 -1
  296. package/editor-web/assets/{requirementDiagram-EQYSW5RA-jMr_uoF6.js → requirementDiagram-EQYSW5RA-Dmk9XRM5.js} +1 -1
  297. package/editor-web/assets/{row-ClBisiBs.js → row-BRlEWRrK.js} +1 -1
  298. package/editor-web/assets/{sankeyDiagram-SY24JHO5-DcUyx03Q.js → sankeyDiagram-SY24JHO5-Yn4zlrAM.js} +1 -1
  299. package/editor-web/assets/{schemas-68mjUjP5.js → schemas-VikZYZIK.js} +1 -1
  300. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-R4X8wRCd.js → sequenceDiagram-BLEHNHQU-BTRnp_PW.js} +1 -1
  301. package/editor-web/assets/{session-2u9U7koW.js → session-Do9AqS38.js} +1 -1
  302. package/editor-web/assets/{slides-BByblSSR.js → slides-diTEQ3C5.js} +1 -1
  303. package/editor-web/assets/{snapshots-C9KV-Y2_.js → snapshots-BUGlKQIB.js} +1 -1
  304. package/editor-web/assets/{sound-DExlNJbb.js → sound-Bj3o9_Fa.js} +1 -1
  305. package/editor-web/assets/split-CNU1RHcX.js +3 -0
  306. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-BqvXKbCA.js → stateDiagram-v2-A6IESKWZ-kstrRKv2.js} +1 -1
  307. package/editor-web/assets/{strikethrough-CyUBnGTl.js → strikethrough-CfXx6IYH.js} +1 -1
  308. package/editor-web/assets/{svg-lBRT-uhy.js → svg-Cx50MpxK.js} +1 -1
  309. package/editor-web/assets/{swatch-1c1uVn1z.js → swatch-WeJD41aW.js} +1 -1
  310. package/editor-web/assets/{swimlanes-B3ENRKFQ-hjTXIc6M.js → swimlanes-B3ENRKFQ-DaZsZkeP.js} +1 -1
  311. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-CBZAujYY.js +8 -0
  312. package/editor-web/assets/{switch-D0K-K8-C.js → switch-N0G_sbqt.js} +1 -1
  313. package/editor-web/assets/syntax-BVsgRJ4I.js +66 -0
  314. package/editor-web/assets/syntax-oWsKBWFw.js +1 -0
  315. package/editor-web/assets/table-B6hVZAMi.js +1 -0
  316. package/editor-web/assets/{tabs-CxxOnGLR.js → tabs-DIFDqj-l.js} +1 -1
  317. package/editor-web/assets/{textarea-Fu93tFO3.js → textarea-tEWvBY9p.js} +1 -1
  318. package/editor-web/assets/{timeline-definition-JXYKGLGB-BcSoN4Dq.js → timeline-definition-JXYKGLGB-CLCvY-Yf.js} +1 -1
  319. package/editor-web/assets/{trash-2-BAKAeziW.js → trash-2-BP6nqpg2.js} +1 -1
  320. package/editor-web/assets/{treeView-D4JQ5SDB-CsFN2jrc.js → treeView-D4JQ5SDB-BmN0gwdC.js} +1 -1
  321. package/editor-web/assets/{treemap-SAJKECNS-DP1eqXJ2.js → treemap-SAJKECNS-DN29G_E_.js} +1 -1
  322. package/editor-web/assets/{undo-2-DQ5CBmki.js → undo-2-CHR0nvWL.js} +1 -1
  323. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-BGxa0osF.js → usecaseDiagram-WPOLBNNX-DTRS54cB.js} +1 -1
  324. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-D2XhTF49.js → vennDiagram-Q3Y3IDCW-DAAc11Hx.js} +1 -1
  325. package/editor-web/assets/{video-CDbPX4Cr.js → video-BlvmR8BK.js} +1 -1
  326. package/editor-web/assets/{wardley-7MLQ67FV-DM3jMAbZ.js → wardley-7MLQ67FV-B-UYkmdB.js} +1 -1
  327. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-Bf-DaZEg.js → wardleyDiagram-IVAIDKWA-BmbwCaky.js} +1 -1
  328. package/editor-web/assets/words-D_4T9Adq.js +3 -0
  329. package/editor-web/assets/words-WgdEQdYP.js +2 -0
  330. package/editor-web/assets/{xychartDiagram-4URNHDU4-dp-mdcWd.js → xychartDiagram-4URNHDU4-ChAfAq1U.js} +1 -1
  331. package/editor-web/index.html +6 -6
  332. package/package.json +8 -2
  333. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +0 -337
  334. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +0 -2
  335. package/editor-web/assets/alt-DnBZJzEh.js +0 -4
  336. package/editor-web/assets/article-DLMjAdbP.js +0 -73
  337. package/editor-web/assets/button-Chk675Xu.js +0 -41
  338. package/editor-web/assets/channel-EzYq4r0d.js +0 -1
  339. package/editor-web/assets/chart-Be9Hj5GL.js +0 -1
  340. package/editor-web/assets/choice-BgmBh4yu.js +0 -1
  341. package/editor-web/assets/dist--KKyT5zP.js +0 -340
  342. package/editor-web/assets/dist-1k0MHB3i.js +0 -1
  343. package/editor-web/assets/dist-B9KHJqL5.js +0 -4
  344. package/editor-web/assets/dist-BbJyrhIY.js +0 -1
  345. package/editor-web/assets/dist-CJXCQxQM.js +0 -37
  346. package/editor-web/assets/dist-D9xQGwe9.js +0 -5
  347. package/editor-web/assets/dist-DFiLzbx8.js +0 -219
  348. package/editor-web/assets/dist-DIPV6xfF.js +0 -2
  349. package/editor-web/assets/dist-Dp-fQMtx.js +0 -6
  350. package/editor-web/assets/dist-Duw28VxJ.js +0 -16
  351. package/editor-web/assets/dist-OBE2IIYP.js +0 -24
  352. package/editor-web/assets/flowDiagram-IUGLLWBU-Xm2E2ib_.js +0 -1
  353. package/editor-web/assets/index-C-i_iuxN.js +0 -28
  354. package/editor-web/assets/index-Cxh_Shkm.css +0 -2
  355. package/editor-web/assets/minus-oPj1GxwA.js +0 -1
  356. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-BLfytmPY.js +0 -8
  357. package/editor-web/assets/syntax-Bih_jv7W.js +0 -1
@@ -1,219 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid.core-CEpvTOAe.js","./index-C-i_iuxN.js","./rolldown-runtime-COiEfhsA.js","./react-DztDSW4P.js","./jsx-runtime-DePvh3-m.js","./button-Chk675Xu.js","./createLucideIcon-CPS-TrJJ.js","./snapshots-C9KV-Y2_.js","./layout-SWqqA0yV.js","./index-Cxh_Shkm.css","./chunk-Y2CYZVJY-DsF7k-Jl.js","./d3-selection-COWvaQNI.js","./chunk-DSNLSHJZ-5vdnoak2.js","./chunk-YZO67HFG-2x-BiWd-.js","./chunk-7S6XSTFO-DeiGeVpB.js","./dist-DdXDFcej.js","./chunk-AQDTSKZB-fPuQFBJc.js","./chunk-DUW6YSOI-Dgx8z5s3.js","./chunk-UHW7PFBP-BQiDI9dK.js","./chunk-HAGFOTED-DFF2mZJ1.js","./chunk-J5ZVWO5B-oDCd-gWO.js","./rough.esm-Dy-Kn_BL.js","./chunk-ZAUX2LTX-etFStEM8.js","./chunk-WQQL4CDK-pNBU8dXv.js","./chunk-HNE4Q36P-g6-ZLbTg.js"])))=>i.map(i=>d[i]);
2
- import{i as e,t}from"./rolldown-runtime-COiEfhsA.js";import{a as n,c as r,f as i,l as a,o,s,u as c,v as l}from"./react-DztDSW4P.js";import{A as u,C as d,D as f,E as p,Et as m,F as h,I as g,L as _,M as v,N as y,O as b,P as x,S,St as C,T as w,Tt as T,_ as E,b as D,bt as O,c as k,d as A,f as j,g as M,gt as N,h as P,ht as F,j as I,k as L,l as R,m as z,mt as B,p as ee,s as te,u as ne,v as re,vt as ie,w as ae,wt as V,x as oe,y as se,yt as ce}from"./button-Chk675Xu.js";import{A as le,B as ue,J as de,P as fe,Q as pe,S as me,V as he,W as ge,Y as _e,et as ve,it as ye,tt as be,x as xe}from"./snapshots-C9KV-Y2_.js";import{n as Se,o as Ce}from"./slides-BByblSSR.js";import{_ as we,a as Te,b as H,c as Ee,g as De,i as Oe,r as ke,v as Ae,y as je}from"./chart-Be9Hj5GL.js";import{t as Me}from"./session-2u9U7koW.js";import{t as Ne}from"./jsx-runtime-DePvh3-m.js";import{t as Pe}from"./createLucideIcon-CPS-TrJJ.js";import{a as Fe,c as Ie,i as Le,l as Re,n as ze,o as Be,r as Ve,s as He,t as Ue}from"./choice-BgmBh4yu.js";import{S as We,_ as Ge,a as Ke,b as qe,y as Je}from"./dist-Dp-fQMtx.js";import{$ as Ye,A as Xe,B as Ze,D as Qe,E as $e,F as et,H as tt,I as nt,J as rt,L as it,M as at,N as ot,O as st,P as ct,R as lt,S as ut,T as dt,U as ft,V as pt,a as U,at as mt,b as ht,c as gt,d as _t,et as vt,f as yt,ft as bt,g as xt,gt as St,ht as Ct,i as wt,l as Tt,m as Et,mt as Dt,n as Ot,nt as kt,o as At,pt as jt,r as Mt,st as Nt,tt as Pt,u as Ft,ut as It,v as Lt,w as Rt,z as zt}from"./dist--KKyT5zP.js";import{A as Bt,D as Vt,O as Ht,a as Ut,i as Wt,k as Gt,n as Kt,o as qt,t as Jt}from"./dist-DIPV6xfF.js";import{a as Yt,c as Xt,i as Zt,l as Qt,n as $t,s as en,t as tn}from"./syntax-Bih_jv7W.js";import{t as nn}from"./minus-oPj1GxwA.js";import{t as rn}from"./repeat-2-DJi4LW5C.js";import{t as an}from"./trash-2-BAKAeziW.js";import{t as on}from"./switch-D0K-K8-C.js";import{i as sn,n as cn,r as ln,t as un}from"./hint-BimUgJms.js";import{$ as dn,D as fn,X as pn,Z as mn,_t as hn,a as gn,at as _n,d as vn,dt as yn,et as bn,ft as xn,g as Sn,it as Cn,l as wn,m as Tn,mt as En,n as Dn,o as On,p as kn,s as An,t as jn,tt as Mn,u as Nn,ut as Pn,v as Fn,vt as In}from"./index-C-i_iuxN.js";import{t as Ln}from"./row-ClBisiBs.js";import{t as Rn}from"./swatch-1c1uVn1z.js";import{A as zn,B as Bn,D as Vn,E as Hn,F as Un,H as Wn,I as Gn,P as Kn,R as qn,S as Jn,U as Yn,V as Xn,h as Zn,i as Qn,k as $n,n as er,p as tr,r as nr,t as rr,z as ir}from"./syntax-C0iPON60.js";import{t as ar}from"./svg-lBRT-uhy.js";import{l as or,n as sr,o as cr,t as lr}from"./textarea-Fu93tFO3.js";import{D as ur,E as dr,S as fr,T as pr,_ as mr,c as hr,d as gr,f as _r,g as vr,h as yr,k as br,l as xr,m as Sr,n as Cr,o as wr,s as Tr,t as Er,u as Dr,w as Or,y as kr}from"./dist-YW8hS4IM.js";var Ar=Pe(`a-large-small`,[[`path`,{d:`m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16`,key:`xik6mr`}],[`path`,{d:`M15.697 14h5.606`,key:`1stdlc`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]),jr=Pe(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Mr=Pe(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),Nr=Pe(`columns-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),Pr=Pe(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Fr=Pe(`heading-1`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]),Ir=Pe(`heading-2`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]),Lr=Pe(`heading-3`,[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]),Rr=Pe(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),zr=Pe(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),Br=Pe(`list-collapse`,[[`path`,{d:`M10 5h11`,key:`1hkqpe`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 19h11`,key:`14g2nv`}],[`path`,{d:`m3 10 3-3-3-3`,key:`i7pm08`}],[`path`,{d:`m3 20 3-3-3-3`,key:`20gx1n`}]]),Vr=Pe(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),Hr=Pe(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),Ur=Pe(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]),Wr=Pe(`notebook-text`,[[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,key:`1nb95v`}],[`path`,{d:`M9.5 8h5`,key:`11mslq`}],[`path`,{d:`M9.5 12H16`,key:`ktog6x`}],[`path`,{d:`M9.5 16H14`,key:`p1seyn`}]]),Gr=Pe(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),Kr=Pe(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),qr=Pe(`rectangle-horizontal`,[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`2`,key:`9lu3g6`}]]),Jr=Pe(`rectangle-vertical`,[[`rect`,{width:`12`,height:`20`,x:`6`,y:`2`,rx:`2`,key:`1oxtiu`}]]),Yr=Pe(`separator-horizontal`,[[`path`,{d:`m16 16-4 4-4-4`,key:`3dv8je`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`m8 8 4-4 4 4`,key:`2bscm2`}]]),Xr=Pe(`sheet`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`line`,{x1:`3`,x2:`21`,y1:`9`,y2:`9`,key:`1vqk6q`}],[`line`,{x1:`3`,x2:`21`,y1:`15`,y2:`15`,key:`o2sbyz`}],[`line`,{x1:`9`,x2:`9`,y1:`9`,y2:`21`,key:`1ib60c`}],[`line`,{x1:`15`,x2:`15`,y1:`9`,y2:`21`,key:`1n26ft`}]]),Zr=Pe(`square-code`,[[`path`,{d:`m10 9-3 3 3 3`,key:`1oro0q`}],[`path`,{d:`m14 15 3-3-3-3`,key:`bz13h7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),Qr=Pe(`superscript`,[[`path`,{d:`m4 19 8-8`,key:`hr47gm`}],[`path`,{d:`m12 19-8-8`,key:`1dhhmo`}],[`path`,{d:`M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06`,key:`1dfcux`}]]),$r=Pe(`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`}]]),ei=Pe(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),ti=Pe(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),W=e(l(),1),G=Ne();function ni(e,t,n){let r=t*Math.min(n,1-n),i=t=>{let i=(t+e/30)%12;return 255*(n-r*Math.max(-1,Math.min(i-3,9-i,1)))};return[i(0),i(8),i(4)]}function ri(e,t){if(e===void 0)return;let n=(t[e]??e).trim().toLowerCase(),r=/^#([0-9a-f])([0-9a-f])([0-9a-f])f?$/.exec(n);if(r)return r.slice(1).map(e=>e+e).join(``).toUpperCase();let i=/^#([0-9a-f]{6})([0-9a-f]{2})?$/.exec(n);if(i?.[1]!==void 0)return i[1].toUpperCase();let a=/^(rgb|hsl)a?\(([^)]*)\)$/.exec(n),[o=NaN,s=NaN,c=NaN]=(a?.[2]??``).split(/[\s,/]+/).filter(Boolean).map(Number.parseFloat);if(a&&![o,s,c].some(Number.isNaN))return(a[1]===`rgb`?[o,s,c]:ni(o,s/100,c/100)).map(e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,`0`)).join(``).toUpperCase()}var ii=[`#2A78D6`,`#EB6834`,`#1BAF7A`,`#EDA100`,`#E87BA4`,`#008300`],K={ink:`#1F1D1A`,lead:`#605B51`,leadSoft:`#847F72`,rule:`#EAE6DE`,ruleStrong:`#959083`,ruleMid:`#D6D1C6`,stone:`#F8F6F1`,stone2:`#EFECE5`,stone3:`#E4E0D7`,sheet:`#FFFFFF`},ai={good:`#448361`,bad:`#D44C47`,flat:K.lead},oi=e=>{let t=Number.parseInt(e.slice(1),16);return[t>>16&255,t>>8&255,t&255]};function si(e,t){let[n,r,i]=oi(e),a=0,o=1/0;return t.forEach((e,t)=>{let[s,c,l]=oi(e),u=2*(n-s)**2+4*(r-c)**2+3*(i-l)**2;u<o&&(o=u,a=t)}),a}function ci(e){let t=[...ii];if(e===void 0)return t;let n=si(e,t);return[e,...t.filter((e,t)=>t!==n)]}function li(e,t){let n=Number.parseInt(e.slice(1),16),r=e=>Math.round(255-(255-e)*t).toString(16).padStart(2,`0`);return`#${r(n>>16&255)}${r(n>>8&255)}${r(n&255)}`.toUpperCase()}function ui(e){let t=ci(e.accent),n=Object.fromEntries(Array.from({length:12},(e,n)=>{let r=t[n%t.length]??K.leadSoft;return[[`cScale${String(n)}`,li(r,.22)],[`cScaleLabel${String(n)}`,K.ink],[`cScalePeer${String(n)}`,li(r,.6)],[`cScaleInv${String(n)}`,li(r,.7)]]}).flat()),r=Object.fromEntries(t.map((e,t)=>[`pie${String(t+1)}`,e])),i=t[0]??ii[0];return{startOnLoad:!1,securityLevel:`strict`,htmlLabels:!1,fontFamily:e.font,theme:`base`,themeCSS:`.grid .tick line { stroke: ${K.rule}; } .grid .tick text { fill: ${K.lead}; } .grid path { stroke-width: 0; } .lineWrapper line, line.lineWrapper { stroke: ${K.leadSoft}; } .cluster-label text, .cluster-label tspan { font-weight: 600; }`,look:`classic`,layout:`dagre`,elk:{considerModelOrder:`NODES_AND_EDGES`,forceNodeModelOrder:!0,mergeEdges:!1},flowchart:{htmlLabels:!1,nodeSpacing:36,rankSpacing:44,padding:10,curve:`basis`},sequence:{actorMargin:40,width:120,height:44,boxMargin:8,messageFontSize:14,mirrorActors:!1},gantt:{barHeight:22,barGap:6,fontSize:12,sectionFontSize:12},themeVariables:{fontFamily:e.font,fontSize:`14px`,background:K.sheet,primaryColor:K.stone,primaryBorderColor:K.ruleMid,primaryTextColor:K.ink,secondaryColor:K.stone2,secondaryBorderColor:K.ruleMid,secondaryTextColor:K.ink,tertiaryColor:K.sheet,tertiaryBorderColor:K.rule,tertiaryTextColor:K.ink,mainBkg:K.stone,nodeBorder:K.ruleMid,clusterBkg:`#FCFBF8`,clusterBorder:K.rule,titleColor:K.ink,textColor:K.ink,lineColor:K.leadSoft,edgeLabelBackground:K.sheet,actorBkg:K.stone,actorBorder:K.ruleMid,actorTextColor:K.ink,actorLineColor:K.ruleMid,signalColor:K.lead,signalTextColor:K.ink,labelBoxBkgColor:K.stone,labelBoxBorderColor:K.ruleMid,noteBkgColor:`#FBF3DB`,noteBorderColor:`#E9D9A6`,noteTextColor:K.ink,sectionBkgColor:K.stone,altSectionBkgColor:K.sheet,sectionBkgColor2:K.stone,gridColor:K.rule,taskBkgColor:li(i,.35),taskBorderColor:li(i,.8),taskTextColor:K.ink,taskTextLightColor:K.ink,taskTextOutsideColor:K.ink,activeTaskBkgColor:li(i,.18),activeTaskBorderColor:li(i,.8),doneTaskBkgColor:K.stone2,doneTaskBorderColor:K.ruleMid,critBkgColor:li(`#D6403A`,.3),critBorderColor:`#D6403A`,...n,...r,pieStrokeColor:K.sheet,pieOuterStrokeColor:K.rule,pieTitleTextColor:K.ink,pieSectionTextColor:K.ink,pieLegendTextColor:K.ink}}}var di=[`apa`,`mla`,`gbt7714`];function fi(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.id==`string`):[]}function pi(e){let t=[],n;for(let r of e.split(`;`)){let e=/^\s*-?@([\w:.#$%&+?<>~/-]+)\s*(?:,\s*(.+?))?\s*$/u.exec(r);e?.[1]&&(t.push(e[1]),e[2]!==void 0&&(n=e[2]))}return{keys:t,...n===void 0?{}:{locator:n}}}function mi(e){let t=[],n=e=>{for(let n of e)if(n.cite!==void 0)for(let e of pi(n.cite).keys)t.includes(e)||t.push(e)};for(let t of ua(e))if(`content`in t&&n(t.content),t.type===`table`)for(let e of t.rows)for(let t of e)n(t);return t}var hi=e=>{let t=e.issued?.[`date-parts`]?.[0];return t?.[0]===void 0?e.issued?.literal??`n.d.`:String(t[0])},gi=e=>e!==void 0&&/[㐀-鿿]/u.test(e);function _i(e){if(e.literal!==void 0)return e.literal;let t=e.family??``;if(gi(t))return`${t}${e.given??``}`;let n=(e.given??``).split(/[\s.-]+/u).filter(e=>e!==``).map(e=>e.charAt(0).toUpperCase()).join(``);return n===``?t:`${t} ${n}`}function vi(e){if(e.literal!==void 0)return e.literal;if(gi(e.family))return`${e.family??``}${e.given??``}`;let t=(e.given??``).split(/[\s.]+/u).filter(e=>e!==``).map(e=>`${e.charAt(0).toUpperCase()}.`).join(` `);return t===``?e.family??``:`${e.family??``}, ${t}`}var yi=`\0`,bi=e=>`${yi}${e.replaceAll(yi,``)}${yi}`,xi=e=>e.split(yi).map((e,t)=>t%2==1?{text:e,italic:!0}:{text:e}).filter(e=>e.text!==``);function Si(e){return e.literal===void 0?gi(e.family)?`${e.family??``}${e.given??``}`:e.given===void 0||e.given===``?e.family??``:`${e.family??``}, ${e.given}`:e.literal}function Ci(e){return e.literal===void 0?gi(e.family)?`${e.family??``}${e.given??``}`:[e.given,e.family].filter(e=>e!==void 0&&e!==``).join(` `):e.literal}var wi=e=>e[`container-title`]!==void 0||[`article-journal`,`article-magazine`,`article-newspaper`,`chapter`,`webpage`,`post-weblog`,`paper-conference`].includes(e.type??``);function Ti(e){let t=e.author??e.editor??[],[n,r]=t,i=n===void 0?``:t.length===1?Si(n):t.length===2&&r!==void 0?`${Si(n)}, and ${Ci(r)}`:`${Si(n)}, et al`,a=i===``?``:i.endsWith(`.`)?`${i} `:`${i}. `,o=e.title??``,s=wi(e)?`“${o}.” `:`${bi(o)}. `,c=e.issued?.[`date-parts`]?.[0],l=c?.[0]===void 0?e.issued?.literal:String(c[0]),u=e.page===void 0?void 0:`${/[-–]/u.test(e.page)?`pp.`:`p.`} ${e.page.replace(`-`,`–`)}`,d=e[`container-title`],f=[d===void 0?void 0:bi(d),e.volume===void 0?void 0:`vol. ${String(e.volume)}`,e.issue===void 0?void 0:`no. ${String(e.issue)}`,e.publisher,l,u].filter(e=>e!==void 0&&e!==``),p=e.DOI===void 0?e.URL:`https://doi.org/${e.DOI}`,m=[...f,...p===void 0?[]:[p]];return`${a}${s}${m.length===0?``:`${m.join(`, `)}.`}`.trim()}var Ei={"article-journal":`J`,article:`J`,"article-magazine":`J`,book:`M`,chapter:`M`,"paper-conference":`C`,thesis:`D`,report:`R`,webpage:`EB/OL`,"post-weblog":`EB/OL`,patent:`P`,"article-newspaper":`N`,standard:`S`,dataset:`DS`};function Di(e,t,n){return xi(Oi(e,t,n))}function Oi(e,t,n){if(t===`mla`)return Ti(e);let r=e.author??e.editor??[];if(t===`gbt7714`){let t=gi(e.title)||r.some(e=>gi(e.family)),i=r.slice(0,3).map(_i),a=r.length>3?`${i.join(`, `)}, ${t?`等`:`et al`}`:i.join(`, `),o=Ei[e.type??``]??`Z`,s=e[`container-title`],c=e.volume===void 0?``:`, ${String(e.volume)}${e.issue===void 0?``:`(${String(e.issue)})`}`,l=e.page===void 0?``:`: ${e.page}`,u=s===void 0?[e[`publisher-place`],e.publisher].filter(e=>e!==void 0).join(`: `)+`${e.publisher===void 0?``:`, `}${hi(e)}${l}`:`${s}, ${hi(e)}${c}${l}`,d=e.DOI===void 0?e.URL===void 0?``:` ${e.URL}.`:` DOI: ${e.DOI}.`;return`${n===void 0?``:`[${String(n)}] `}${a===``?``:`${a}. `}${e.title??``}[${o}]. ${u}.${d}`}let i=r.map(vi),a=i.length<=1?i[0]??``:i.length<=20?`${i.slice(0,-1).join(`, `)}, & ${i.at(-1)??``}`:`${i.slice(0,19).join(`, `)}, … ${i.at(-1)??``}`,o=e[`container-title`],s=e.volume===void 0?``:`, ${bi(String(e.volume))}${e.issue===void 0?``:`(${String(e.issue)})`}`,c=e.page===void 0?``:`, ${e.page.replace(`-`,`–`)}`,l=o===void 0?e.publisher===void 0?``:` ${e.publisher}.`:` ${bi(o)}${s}${c}.`,u=e.DOI===void 0?e.URL===void 0?``:` ${e.URL}`:` https://doi.org/${e.DOI}`,d=a===``?``:a.endsWith(`.`)?`${a} `:`${a}. `,f=e.title??``;return`${d}(${hi(e)}). ${o===void 0?bi(f):f}.${l}${u}`}function ki(e,t,n){let r=new Map(t.map(e=>[e.id,e])),i=mi(e).flatMap(e=>{let t=r.get(e);return t===void 0?[]:[t]});return(n===`gbt7714`?i:[...i].sort((e,t)=>{let r=e=>(e.author?.[0]?.family??e.author?.[0]?.literal??e.title??``).toLowerCase();return r(e).localeCompare(r(t))||(n===`mla`?(e.title??``).localeCompare(t.title??``):hi(e).localeCompare(hi(t)))})).map((e,t)=>{let r=Di(e,n,n===`gbt7714`?t+1:void 0);return{item:e,n:t+1,text:r.map(e=>e.text).join(``),pieces:r}})}function Ai(e,t,n,r){let{keys:i,locator:a}=pi(e),o=new Map(t.map(e=>[e.id,e]));if(r===`gbt7714`){let t=i.map(e=>n.get(e));if(t.some(e=>e===void 0))return`[${e}]`;let r=[...new Set(t)].sort((e,t)=>e-t),o=[];for(let e=0;e<r.length;){let t=e;for(;t+1<r.length&&(r[t+1]??0)===(r[t]??0)+1;)t++;o.push(t-e>=2?`${String(r[e])}-${String(r[t])}`:r.slice(e,t+1).join(`, `)),e=t+1}return`[${o.join(`, `)}]${a===void 0?``:a.replace(/^p+\.\s*/u,``)}`}if(r===`mla`){let e=i.map(e=>{let t=o.get(e);if(t===void 0)return`@${e}`;let n=t.author??t.editor??[],r=e=>e===void 0?``:gi(e.family)?`${e.family??``}${e.given??``}`:e.family??e.literal??``;return n.length===0?wi(t)?`“${t.title??e}”`:t.title??e:n.length===1?r(n[0]):n.length===2?`${r(n[0])} and ${r(n[1])}`:`${r(n[0])} et al.`}),t=a?.replace(/^pp?\.\s*/u,``);return`(${e.join(`; `)}${t===void 0?``:` ${t}`})`}return`(${i.map(e=>{let t=o.get(e);if(t===void 0)return`@${e}`;let n=t.author??t.editor??[],r=e=>e===void 0?``:gi(e.family)?`${e.family??``}${e.given??``}`:e.family??e.literal??``;return`${n.length===0?t.title??e:n.length===1?r(n[0]):n.length===2?`${r(n[0])} & ${r(n[1])}`:`${r(n[0])} et al.`}, ${hi(t)}`}).join(`; `)}${a===void 0?``:`, ${a}`})`}var ji={a3:[297,420],a4:[210,297],a5:[148,210],b5:[176,250],letter:[215.9,279.4],legal:[215.9,355.6]},Mi=[`sans`,`serif`,`mono`,`times`,`song`,`hei`,`fangsong`,`kai`,`xiaobiaosong`],Ni={初号:42,小初:36,一号:26,小一:24,二号:22,小二:18,三号:16,小三:15,四号:14,小四:12,五号:10.5,小五:9,六号:7.5,小六:6.5,七号:5.5,八号:5},Pi=[`left`,`center`,`right`,`outside`,`inside`],Fi=[`apa`,`mla`,`report`,`memo`,`business-letter`],Ii={apa:{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:2,textIndent:3,paragraphSpacing:0,textAlign:`left`,title:{size:12,weight:`bold`,align:`center`},headings:{1:{size:12,weight:`bold`,align:`center`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`,italic:!0},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`,italic:!0},6:{size:12,weight:`bold`}},header:{right:`{page}`},footer:!1,citationStyle:`apa`},mla:{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:2,textIndent:3,paragraphSpacing:0,textAlign:`left`,title:{size:12,weight:`normal`,align:`center`},headings:{1:{size:12,weight:`bold`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`,italic:!0},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`},6:{size:12,weight:`bold`}},header:{right:`{page}`},footer:!1,citationStyle:`mla`},report:{size:10.5,lineHeight:1.2,paragraphSpacing:.7,title:{size:24,weight:`bold`},headings:{1:{size:18,weight:`bold`},2:{size:14,weight:`bold`,rule:!0},3:{size:11.5,weight:`bold`}}},memo:{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:1,textIndent:0,paragraphSpacing:1,textAlign:`left`,title:{size:12,weight:`bold`},headings:{1:{size:12,weight:`bold`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`,italic:!0},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`},6:{size:12,weight:`bold`}},header:!1,footer:{center:`{page}`}},"business-letter":{paper:`letter`,margins:25.4,font:`times`,size:12,lineHeight:1,textIndent:0,paragraphSpacing:1,textAlign:`left`,title:{size:12,weight:`bold`},headings:{1:{size:12,weight:`bold`},2:{size:12,weight:`bold`},3:{size:12,weight:`bold`},4:{size:12,weight:`bold`},5:{size:12,weight:`bold`},6:{size:12,weight:`bold`}},header:!1,footer:!1,pageNumbers:!1}},Li=e=>Ii[e];function Ri(e){if(e.preset===void 0)return e;let t=Ii[e.preset],n={...t.headings};for(let[r,i]of Object.entries(e.headings??{}))n[Number(r)]={...t.headings?.[Number(r)],...i};return{...t,...e,...t.title||e.title?{title:{...t.title,...e.title}}:{},...Object.keys(n).length>0?{headings:n}:{}}}var zi=e=>typeof e==`number`?e:Ni[e],Bi={paper:`letter`,margins:{top:18,right:20,bottom:18,left:20},size:11,lineHeight:1.15,textIndent:0,paragraphSpacing:.5,headingScale:{title:2.3,1:1.75,2:1.45,3:1.15,4:1,5:1,6:1},footer:{left:`{title}`,right:`{page} / {pages}`}},Vi=[`preset`,`paper`,`orientation`,`margins`,`font`,`size`,`line-height`,`text-indent`,`paragraph-spacing`,`text-align`,`grid`,`title`,`headings`,`header`,`footer`,`captions`,`bibliography`,`citation-style`,`accent`,`cover`,`cover-y`,`page-numbers`,`picture-dpi`],Hi=[`left`,`center`,`right`],Ui=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Wi=e=>typeof e==`number`&&Number.isFinite(e)&&e>0;function Gi(e){if(Wi(e))return e;if(typeof e==`string`){let t=e.trim();if(Object.hasOwn(Ni,t))return t;let n=/^(\d+(?:\.\d+)?)\s*pt$/u.exec(t);if(n)return Number(n[1])}}var Ki=`a size in pt (12) or a Chinese size (${Object.keys(Ni).join(`, `)})`;function qi(e,t,n){if(!Ui(e)){n(`${t} holds font, size, weight, align, italic and rule`);return}let r={};for(let[i,a]of Object.entries(e))if(i===`font`)Mi.includes(a)?r.font=a:n(`${t}'s font is ${Mi.join(`, `)}, not ${JSON.stringify(a)}`);else if(i===`size`){let e=Gi(a);e===void 0?n(`${t}'s size is ${Ki}`):r.size=e}else i===`weight`?a===`normal`||a===`bold`?r.weight=a:n(`${t}'s weight is normal or bold, not ${JSON.stringify(a)}`):i===`align`?Hi.includes(a)?r.align=a:n(`${t}'s align is left, center or right, not ${JSON.stringify(a)}`):i===`italic`?typeof a==`boolean`?r.italic=a:n(`${t}'s italic is true or false, not ${JSON.stringify(a)}`):i===`rule`?typeof a==`boolean`?r.rule=a:n(`${t}'s rule is true or false, not ${JSON.stringify(a)}`):n(`${t} holds font, size, weight, align, italic and rule: ${i} is not one of them`);return r}function Ji(e,t,n){if(e===!1)return!1;if(typeof e==`string`)return{center:e};if(!Ui(e)){n(`a page's ${t} is false, words, or words by place (${Pi.join(`, `)}) with a font and a size`);return}let r={};for(let[i,a]of Object.entries(e))if(i===`font`)Mi.includes(a)?r.font=a:n(`a page's ${t} font is ${Mi.join(`, `)}, not ${JSON.stringify(a)}`);else if(i===`size`){let e=Gi(a);e===void 0?n(`a page's ${t} size is ${Ki}`):r.size=e}else Pi.includes(i)?typeof a!=`string`&&typeof a!=`number`?n(`a page's ${t} ${i} is words`):r[i]=String(a):n(`a page's ${t} holds ${Pi.join(`, `)}, font and size: ${i} is not one of them`);return r}function Yi(e,t){let n={};for(let[r,i]of Object.entries(e))switch(r){case`preset`:Fi.includes(i)?n.preset=i:t(`a page's preset is ${Fi.join(` or `)}, not ${JSON.stringify(i)}`);break;case`paper`:{let e=typeof i==`string`?i.trim().toLowerCase():void 0;e!==void 0&&Object.hasOwn(ji,e)?n.paper=e:Array.isArray(i)&&i.length===2&&i.every(Wi)?n.paper=i:t(`a page's paper is ${Object.keys(ji).join(`, `)} or its width and height in mm ([210, 297]), not ${JSON.stringify(i)}`);break}case`orientation`:i===`portrait`||i===`landscape`?n.orientation=i:t(`a page's orientation is portrait or landscape, not ${JSON.stringify(i)}`);break;case`margins`:typeof i==`number`&&i>=0||Array.isArray(i)&&(i.length===2||i.length===4)&&i.every(e=>typeof e==`number`&&e>=0)?n.margins=i:t(`a page's margins are mm: one for all four, [top and bottom, sides], or [top, right, bottom, left]`);break;case`font`:Mi.includes(i)?n.font=i:t(`a page's font is ${Mi.join(`, `)}, not ${JSON.stringify(i)}`);break;case`size`:{let e=Gi(i);e===void 0?t(`a page's size is ${Ki}`):n.size=e;break}case`line-height`:Wi(i)?n.lineHeight=i:typeof i==`string`&&/^\d+(\.\d+)?pt$/u.test(i.trim())?n.lineHeight=i.trim():t(`a page's line-height is a multiple (1.5) or pt (28pt), not ${JSON.stringify(i)}`);break;case`text-indent`:typeof i==`number`&&i>=0?n.textIndent=i:t(`a page's text-indent is how many characters a paragraph's first line is set in (2)`);break;case`paragraph-spacing`:typeof i==`number`&&i>=0?n.paragraphSpacing=i:t(`a page's paragraph-spacing is the space between paragraphs in em (0.5)`);break;case`text-align`:i===`left`||i===`justify`?n.textAlign=i:t(`a page's text-align is left or justify, not ${JSON.stringify(i)}`);break;case`grid`:{let e=Ui(i)?i.chars:void 0,r=Ui(i)?i.lines:void 0;Ui(i)&&Object.keys(i).length===2&&Wi(e)&&Wi(r)&&Number.isInteger(e)&&Number.isInteger(r)?n.grid={chars:e,lines:r}:t(`a page's grid is { chars, lines }: characters to a line and lines to a page`);break}case`title`:{let e=qi(i,`the title`,t);e&&(n.title=e);break}case`headings`:{if(!Ui(i)){t(`a page's headings are by level: { 1: { font, size }, 2: … }`);break}let e={};for(let[n,r]of Object.entries(i)){let i=Number(n);if(!Number.isInteger(i)||i<1||i>6){t(`a heading's level is 1 to 6, not ${n}`);continue}let a=qi(r,`heading ${n}`,t);a&&(e[i]=a)}n.headings=e;break}case`header`:case`footer`:{let e=Ji(i,r,t);e!==void 0&&(n[r]=e);break}case`captions`:i===`numbered`||i===`plain`?n.captions=i:t(`a page's captions are numbered or plain, not ${JSON.stringify(i)}`);break;case`bibliography`:typeof i==`string`&&i.trim()!==``?n.bibliography=i.trim():t(`a page's bibliography is a CSL-JSON file's path`);break;case`citation-style`:di.includes(i)?n.citationStyle=i:t(`a page's citation-style is ${di.join(` or `)}, not ${JSON.stringify(i)}`);break;case`accent`:typeof i==`string`&&i.trim()!==``?n.accent=i.trim():t(`a page's accent is a colour`);break;case`cover`:typeof i==`string`&&i.trim()!==``?n.cover=i.trim():t(`a page's cover is a picture's path`);break;case`cover-y`:typeof i==`number`&&i>=0&&i<=100?n.coverY=i:t(`a cover's cover-y is 0 (its top) to 100 (its bottom), not ${JSON.stringify(i)}`);break;case`picture-dpi`:i===!1?n.pictureDpi=!1:typeof i==`number`&&i>=72&&i<=2400?n.pictureDpi=i:t(`a page's picture-dpi is 72 to 2400 (dots an inch of paper), or false to print pictures as they are, not ${JSON.stringify(i)}`);break;case`page-numbers`:i===!1?n.pageNumbers=!1:i!==!0&&t(`a page's page-numbers is true or false, not ${JSON.stringify(i)}`);break;default:t(`the front matter holds ${Vi.join(`, `)}: ${r} is not one of them`)}return n}var Xi=e=>({...e.font===void 0?{}:{font:e.font},...e.size===void 0?{}:{size:e.size},...e.weight===void 0?{}:{weight:e.weight},...e.align===void 0?{}:{align:e.align},...e.italic===void 0?{}:{italic:e.italic},...e.rule===void 0?{}:{rule:e.rule}}),Zi=e=>e===!1?!1:Object.keys(e).length===1&&e.center!==void 0?e.center:{...e},Qi=e=>/^[ab]\d$/u.test(e)?e.toUpperCase():`${e.charAt(0).toUpperCase()}${e.slice(1)}`;function $i(e){return{...e.preset===void 0?{}:{preset:e.preset},...e.paper===void 0?{}:{paper:typeof e.paper==`string`?Qi(e.paper):[...e.paper]},...e.orientation===void 0?{}:{orientation:e.orientation},...e.margins===void 0?{}:{margins:typeof e.margins==`number`?e.margins:[...e.margins]},...e.font===void 0?{}:{font:e.font},...e.size===void 0?{}:{size:e.size},...e.lineHeight===void 0?{}:{"line-height":e.lineHeight},...e.textIndent===void 0?{}:{"text-indent":e.textIndent},...e.paragraphSpacing===void 0?{}:{"paragraph-spacing":e.paragraphSpacing},...e.textAlign===void 0?{}:{"text-align":e.textAlign},...e.grid===void 0?{}:{grid:{...e.grid}},...e.title===void 0?{}:{title:Xi(e.title)},...e.headings===void 0?{}:{headings:Object.fromEntries(Object.entries(e.headings).map(([e,t])=>[e,Xi(t)]))},...e.header===void 0?{}:{header:Zi(e.header)},...e.footer===void 0?{}:{footer:Zi(e.footer)},...e.captions===void 0?{}:{captions:e.captions},...e.bibliography===void 0?{}:{bibliography:e.bibliography},...e.citationStyle===void 0?{}:{"citation-style":e.citationStyle},...e.accent===void 0?{}:{accent:e.accent},...e.cover===void 0?{}:{cover:e.cover},...e.cover===void 0||e.coverY===void 0?{}:{"cover-y":e.coverY},...e.pageNumbers===!1?{"page-numbers":!1}:{},...e.pictureDpi===void 0?{}:{"picture-dpi":e.pictureDpi}}}function ea(e){let t=e.delta?.trim().charAt(0),n=t===`+`||t===`↑`;return!n&&t!==`-`&&t!==`−`&&t!==`–`&&t!==`↓`?`flat`:n===(e.downIsGood===!0)?`bad`:`good`}var ta=[`value`,`percentage`,`category`,`series`],na=[`bold`,`italic`,`underline`,`strike`],ra=(e,t)=>e.note===void 0&&t.note===void 0&&e.cite===void 0&&t.cite===void 0&&e.href===t.href&&JSON.stringify(oa(e.styles))===JSON.stringify(oa(t.styles));function ia(e){let t=[],n=(e,n,r)=>{if(e===``)return;let i={text:e,styles:n,...r===void 0?{}:{href:r}},a=t.at(-1);a&&ra(a,i)?a.text+=e:t.push(i)};return e.forEach((r,i)=>{if(r.note!==void 0||r.cite!==void 0||r.text===``&&r.href!==void 0){t.push({...r});return}let{styles:a,href:o}=r,s=!a.code&&o===void 0&&na.some(e=>a[e])?/^(\s*)([\s\S]*?)(\s*)$/u.exec(r.text):null;if(!s){n(r.text,a,o);return}let[,c=``,l=``,u=``]=s,d={...a};delete d.bold,delete d.italic,delete d.underline,delete d.strike;let f=e[i-1]?.note!==void 0,p=e[i+1]?.note!==void 0;n(c,f?a:d,o),n(l,l===``?d:a,o),n(u,p?a:d,o)}),t}var aa=e=>e.length>0&&e.every(e=>typeof e==`object`&&!!e&&typeof e.text==`string`&&typeof e.styles==`object`);function oa(e){if(Array.isArray(e))return(aa(e)?ia(e):e).map(oa);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e).sort()){let r=e[n];r!==void 0&&(t[n]=oa(r))}return t}return e}var sa=e=>JSON.stringify(oa(e)),ca=(e,t)=>e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&sa(e)===sa(r)}),la=e=>e.type===`columns`?e.columns.flatMap(e=>e.blocks):`children`in e?e.children??[]:[];function*ua(e){for(let t of e)yield t,yield*ua(la(t))}function da(e){return fa(e).numbers}function fa(e){let t=new Map,n=new Set,r=new Set([...ua(e)].flatMap(e=>e.type===`note`?[e.label.toLowerCase()]:[])),i=e=>{for(let i of e){let e=i.note?.toLowerCase();e!==void 0&&r.has(e)&&!t.has(e)&&(t.set(e,t.size+1),n.add(i))}};for(let t of ua(e))if(t.type!==`note`&&(`content`in t&&i(t.content),t.type===`table`))for(let e of t.rows)for(let t of e)i(t);return{numbers:t,first:n}}var pa=e=>e.filter(e=>e.type!==`source`);function ma(e){let t=e.of.lastIndexOf(`#`),n=t<0?``:e.of.slice(t+1);return n!==``&&n!=="default"?n:((t<0?e.of:e.of.slice(0,t)).split(`/`).pop()??``).replace(/\.[^.]+$/u,``)}function ha(e){let t=e.width??720;return{name:e.of,props:{...e.props},width:t,height:e.height??Math.round(t*.5625),t:e.at??0}}var ga={gray:`#8B8A85`,brown:`#9A6B4B`,red:`#D6403A`,orange:`#EB6834`,yellow:`#EDA100`,green:`#1BAF7A`,blue:`#2A78D6`,purple:`#8A5CD6`,pink:`#E87BA4`},_a=K.lead,va={grid:K.rule,axis:K.ruleMid},ya={gap:80,overlap:-8},ba={size:10,title:13},xa=e=>{let t=ri(e,ga);return t===void 0?void 0:`#${t}`},Sa=.55;function Ca(e={},t=[]){let[n=ii[0],...r]=ci(e.accent===void 0?void 0:xa(e.accent)),i=[n,n,...r];t.slice(0,i.length).forEach((e,t)=>{let n=xa(e);n!==void 0&&(i[t]=n)}),t.length<2&&(i[1]=li(i[0]??n,Sa));let[a,o,s,c,l,u]=i;return{dk1:_a,lt1:`#FFFFFF`,dk2:`#37352F`,lt2:`#EFEFED`,accent1:a,accent2:o,accent3:s,accent4:c,accent5:l,accent6:u,hlink:a,folHlink:a}}var wa=new Set([`line`,`line-markers`,`scatter-lines`]),Ta={width:560,aspect:.6};function Ea(e,t=720){let n=e.kind!==void 0&&Oe(e.kind),r=e.width??(n?Math.min(t,Ta.width):t);return{width:r,height:e.height??Math.round(r*(n?Ta.aspect:.5625))}}function Da(e){let t=e.trim().replace(/,/gu,``);if(t===``)return null;let n=Number(t);return Number.isFinite(n)?n:void 0}function Oa(e,t){let n=Te(e.kind),r=e.labels,i=e.min!==void 0||e.max!==void 0||e.format!==void 0?{...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.format===void 0?{}:{format:e.format}}:void 0,a={...r===void 0?{}:{labels:{...r.includes(`value`)?{value:!0}:{},...r.includes(`percentage`)?{percentage:!0}:{},...r.includes(`category`)?{category:!0}:{},...r.includes(`series`)?{series:!0}:{},...e.format===void 0?{}:{format:e.format}}},...i===void 0?{}:{value_axis:i},...Oe(e.kind)?{vary_by_categories:!0}:{}};if(e.table===void 0)return e.data===void 0||e.categories===void 0?void 0:{type:e.kind,data:e.data,categories:e.categories,series:e.series??[],...a};let[o=[],...s]=e.table,c=Math.max(0,...e.table.map(e=>e.length)),l=(e,t)=>e[t]??``,u=e=>s.map((n,r)=>{let i=Da(l(n,e));return i===void 0?(t.push(`row ${String(r+1)} of its table: "${l(n,e)}" under ${l(o,e)||`column ${String(e+1)}`} is not a number`),null):i}),d=Array.from({length:Math.max(0,c-1)},(e,t)=>{let r=t+1;return{name:l(o,r)||`Series ${String(r)}`,values:u(r),...n?{x:u(0)}:{}}});if(d.length!==0)return{type:e.kind,...n?{}:{categories:s.map(e=>l(e,0))},series:d,...a}}function ka(e,t){if(e.legend!==`none`)return e.legend===void 0?Oe(e.kind)?`right`:t.series.length>1?`top`:void 0:e.legend}function Aa(e,t={}){let n=[],r=Oa(e,n);if(!r)return{problems:[...n,`it has no numbers to draw`]};let i=Be(r,{title:e.title,base:t.base??``,rows:e=>{let n=t.data?.(e);if(n===void 0)throw Error(`there is no such file or table`);return n},problem:e=>n.push(e)});if(!i)return{problems:n};let a=ka(e,i),o=Ca(t.page,e.colors),s=[o.accent1,o.accent2,o.accent3,o.accent4,o.accent5,o.accent6],c=e=>({rgb:s[e%s.length]??`#000000`}),l=i.series.length===1&&!Oe(e.kind)&&(e.colors?.length??0)>1?(e.colors??[]).map(xa):void 0,u=l!==void 0||Ee(i),d=Te(e.kind),f=e.table===void 0?e.categories:e.table[0]?.[0],p=i.series.length===1?i.series[0]?.name:void 0,m={gridline_color:{rgb:va.grid},line_color:{rgb:va.axis}},h=ke(e.kind),g=e.kind.endsWith(`-clustered`),_={...i,category_axis:{...m,...i.category_axis,...d&&f!==void 0&&f!==``?{title:f}:{}},value_axis:{...m,...i.value_axis,...d&&p!==void 0&&p!==``?{title:p}:{}},...h&&i.gap_width===void 0?{gap_width:ya.gap}:{},...g&&i.series.length>1&&i.overlap===void 0?{overlap:ya.overlap}:{},series:i.series.map((t,n)=>{let r=u||t.color!==void 0?t:{...t,color:c(n)};return e.smooth&&wa.has(e.kind)?{...r,smooth:!0}:r}),...l===void 0?{}:{vary_by_categories:!0},...u?{category_colors:i.categories.map((e,t)=>{let n=l?.[t%l.length];return n===void 0?c(l===void 0?t:0):{rgb:n}})}:{},...a===void 0?{}:{legend:a},font_size:ba.size,title_size:ba.title,font_color:{rgb:_a}};return a===void 0&&delete _.legend,{chart:_,problems:n}}function ja(e,t){if(e.alt!==void 0)return e.alt;let n=t?.series.map(e=>e.name).join(`, `)??``,r=[e.title,n].filter(e=>e!==void 0&&e!==``);return r.length>0?r.join(`: `):`Chart`}var Ma={ink:`#D4D3CF`,grid:`#3A3936`,axis:`#5C5B57`};function Na(e,t={}){let n=Aa(e,t),{problems:r}=n;if(!n.chart)return{problems:r};let i=e=>({...e,gridline_color:{rgb:Ma.grid},line_color:{rgb:Ma.axis}}),a=t.dark===!0?{...n.chart,font_color:{rgb:Ma.ink},value_axis:i(n.chart.value_axis),category_axis:i(n.chart.category_axis)}:n.chart,{width:o,height:s}=Ea(e,t.room);return{svg:ar(a,o,s,{colors:Ca(t.page,e.colors),paper:`none`,edge:`none`,...t.font===void 0?{}:{font:t.font},label:ja(e,a)}),problems:r}}function Pa(e,t=720){let n=e.columns.map(e=>e.width??1),r=n.reduce((e,t)=>e+t,0)||1,i=Math.max(0,t-32*(e.columns.length-1));return n.map(e=>Math.round(i*e/r))}function Fa(e){return e?{figure:`图`,table:`表`}:{figure:`Figure`,table:`Table`}}function Ia(e){switch(e.type){case`image`:case`component`:case`table`:return e.caption;case`chart`:return e.title;default:return}}function La(e){return e.type===`image`||e.type===`component`||e.type===`table`||e.type===`chart`?e.id:void 0}function Ra(e){let t=0,n=0;for(let r of ua(e))if(`content`in r)for(let e of r.content)t+=(e.text.match(/[㐀-鿿぀-ヿ]/gu)??[]).length,n+=(e.text.match(/[A-Za-z]+/gu)??[]).length;return t>n}function za(e,t={}){let n=new Map;if(Ri(t).captions===`plain`)return n;let r=Fa(Ra(e)),i={figure:0,table:0};for(let t of ua(e)){if(Ia(t)===void 0)continue;let e=t.type===`table`?`table`:`figure`;i[e]+=1,n.set(t,{kind:e,n:i[e],label:`${r[e]} ${String(i[e])}`})}return n}function Ba(e){try{return{html:jt.renderToString(e,{displayMode:!0,throwOnError:!0,output:`htmlAndMathml`,strict:`ignore`})}}catch(t){let n=t instanceof Error?t.message:String(t);return{html:jt.renderToString(e,{displayMode:!0,throwOnError:!1,output:`htmlAndMathml`,strict:`ignore`}),error:n}}}var Va={math:`math`,mermaid:`mermaid`},Ha=/^[+\-−–]?[$€£¥]?\s?\d[\d,.\s]*\s?(%|×|x|k|K|M|B|bn|pt|pp)?\*?$/u,Ua=/^([—–-]|n\/a|N\/A|NA)$/u,Wa=e=>e.map(e=>e.text).join(``).trim();function Ga(e){let t=e.head===void 0||e.head===`both`,n=e.head===`column`||e.head===`both`,r=t?e.rows.slice(1):e.rows,i=Math.max(0,...e.rows.map(e=>e.length)),a=new Set;for(let e=+!!n;e<i;e++){let t=r.map(t=>Wa(t[e]??[]));t.some(e=>Ha.test(e))&&t.every(e=>e===``||Ha.test(e)||Ua.test(e))&&a.add(e)}return a}function Ka(e){return e?.type===`heading`&&e.level===1&&e.toggle!==!0&&(e.children?.length??0)===0}function qa(e){let t=e[0];return Ka(t)?{title:t,body:e.slice(1)}:{title:void 0,body:[...e]}}function Ja(e){return Ka(e)?e.content.map(e=>e.text).join(``):``}function Ya(e,t){let n=t.replace(/\s+/g,` `).trim();if(n===``)return;if(Ka(e)&&Ja(e)===n)return e;let r=[{text:n,styles:{}}];return{type:`heading`,level:1,...Ka(e)&&e.look?{look:e.look}:{},content:r}}function Xa(e,t){return e?[e,...t]:[...t]}var Za={sans:`Carlito, Calibri, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif`,serif:`Caladea, Cambria, "Noto Serif SC", "Songti SC", Georgia, serif`,times:`Tinos, "Times New Roman", Times, "Noto Serif SC", serif`,mono:`Cousine, "Courier New", "Noto Sans SC", monospace`,song:`"Noto Serif SC", "Songti SC", SimSun, "宋体", serif`,hei:`"Noto Sans SC", "PingFang SC", SimHei, "黑体", sans-serif`,fangsong:`FangSong, STFangsong, "仿宋", "FangSong_GB2312", "Noto Serif SC", serif`,kai:`"LXGW WenKai", KaiTi, STKaiti, "楷体", "Noto Serif SC", serif`,xiaobiaosong:`"FZXiaoBiaoSong-B05S", "方正小标宋简体", "Noto Serif SC", "Songti SC", serif`};function Qa(e={}){let t=Ri(e).font??`sans`;return{text:Za[t],heading:Za[t],mono:Za.mono}}var $a=(e={})=>e.accent===void 0?void 0:xa(e.accent);function eo(e){let t=new Map,n=new Map;for(let r of ua(e)){if(r.type!==`heading`)continue;let e=r.content.map(e=>e.text).join(``).trim().toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,``).replace(/\s/gu,`-`),i=e===``?`section`:e,a=n.get(i)??0;n.set(i,a+1),t.set(r,a===0?i:`${i}-${String(a)}`)}return t}function to(e,t){let n=Math.min(...e),r=Math.max(...e)-n||1;return`<svg class="stat-trend" viewBox="0 0 100 24" preserveAspectRatio="none" aria-hidden="true"><path d="${e.map((t,i)=>[i/Math.max(1,e.length-1)*100,22-(t-n)/r*20]).map(([e,t],n)=>`${n===0?`M`:`L`}${(e??0).toFixed(1)} ${(t??0).toFixed(1)}`).join(` `)}" fill="none" stroke="${t}" stroke-width="1.5" vector-effect="non-scaling-stroke" stroke-linejoin="round" stroke-linecap="round"/></svg>`}`${K.ink}${K.lead}${K.leadSoft}${K.ruleStrong}${K.ink}${K.ink}${K.leadSoft}${K.ruleStrong}${K.ruleStrong}${K.lead}${K.stone2}${K.stone}${K.stone}${K.ruleMid}${K.ruleStrong}${K.ruleStrong}${K.ruleStrong}${K.stone3}${K.leadSoft}${K.rule}${K.ruleStrong}${K.rule}${K.sheet}${K.lead}${K.rule}${K.sheet}${K.lead}${K.ink}${K.stone}${K.ruleMid}${K.leadSoft}${K.lead}${K.rule}${K.lead}${K.leadSoft}${K.ruleMid}`,`${JSON.stringify(`\\p{RI}\\p{RI}|[#*0-9]\\uFE0F?\\u20E3|(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F)\\p{EMod}?(?:\\u200D(?:\\p{Emoji_Presentation}|\\p{Extended_Pictographic}\\uFE0F?)\\p{EMod}?)*`)}`;function no(){return{enter:{mdxFlowExpression:ro,mdxTextExpression:io},exit:{mdxFlowExpression:ao,mdxFlowExpressionChunk:oo,mdxTextExpression:ao,mdxTextExpressionChunk:oo}}}function ro(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function io(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function ao(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function oo(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}var so=`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`.split(`.`),co={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function lo(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function uo(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function fo(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function po(e){return fo(e)||lo(e)}var mo=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function ho(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?po:u===`decimal`?lo:uo;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&so.includes(y)&&(_=y,v=Wn(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&Wn(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):po(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(go(e))h(7,S),C=`�`;else if(e in co)h(6,S),C=co[e];else{let t=``;_o(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,mo[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function go(e){return e>=55296&&e<=57343||e>1114111}function _o(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}function vo(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new Zt("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new Zt(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new Zt("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=ho(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new Zt("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+Yn(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new Zt("Expected a closing tag for `"+S(r)+"` ("+Yn({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new Zt("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+Yn(t.end)+") or another opening tag after the start of `"+t.type+"` ("+Yn(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function yo(){return{enter:{mdxjsEsm:bo},exit:{mdxjsEsm:xo,mdxjsEsmData:So}}}function bo(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function xo(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function So(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function Co(){return[no(),vo(),yo()]}var wo={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},To={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},Eo={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},Do=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Oo=[12288,12288,65281,65376,65504,65510],ko=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Ao=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],jo=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101594,101631,101664,101760,101874,101888,102801,102816,102866,110576,110579,110581,110587,110589,110590,110592,110888,110898,110898,110928,110930,110933,110933,110948,110952,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127406,127406,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128729,128732,128735,128747,128748,128756,128764,128986,128986,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129734,129736,129736,129740,129757,129759,129771,129775,129786,131072,196605,196608,262141],Mo=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},No=19968,[Po,Fo]=Io(jo);function Io(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(No>=i&&No<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var Lo=e=>e<161||e>1114109?!1:Mo(Do,e),Ro=e=>e<12288||e>65510?!1:Mo(Oo,e),zo=e=>e<8361||e>65518?!1:Mo(ko,e),Bo=e=>e<32||e>10630?!1:Mo(Ao,e),Vo=e=>e>=Po&&e<=Fo?!0:e<4352||e>262141?!1:Mo(jo,e);function Ho(e){return Lo(e)?`ambiguous`:Ro(e)?`fullwidth`:zo(e)?`halfwidth`:Bo(e)?`narrow`:Vo(e)?`wide`:`neutral`}function Uo(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Wo(e){return Uo(e),Ho(e)}function Go(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function Ko(e){if(!e||e<4352)return!1;switch(Wo(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!Go(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999&&null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function qo(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function Jo(e){return e!==null&&e>=65024&&e<=65038}var Yo=Zo(/\p{P}|\p{S}/u),Xo=Zo(/\s/);function Zo(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function Qo(e){return!!(e&To.characterGroupWhitespace)}function $o(e){return(e&is.cjkPunctuation)===To.characterGroupPunctuation}function es(e){return!!(e&is.cjk)}function ts(e){return!!(e&is.cjkOrIvs)}function ns(e){return e===is.nonEmojiGeneralUseVS}function rs(e){return!!(e&is.spaceOrPunctuation)}var is;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(is||={});function as(e){if(e===wo.eof||Un(e)||Xo(e))return To.characterGroupWhitespace;let t=0;if(e>=4352){if(Jo(e))return is.nonEmojiGeneralUseVS;switch(Ko(e)){case null:return is.ivs;case!0:t|=is.cjk}}return Yo(e)&&(t|=To.characterGroupPunctuation),t}function os(e,t,n){if(!ns(e))return e;let r=t(),i=as(r);return!r||Qo(i)?e:qo(r,n)?is.cjkPunctuation:ss(i)}function ss(e){return e&~is.ivs}function cs(e){return!!(e&&e>=55296&&e<=56319)}function ls(e){return!!(e&&e>=56320&&e<=57343)}function us(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function ds(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var fs=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=ds(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function ps(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}var ms={name:`attention`,resolveAll:hs,tokenize:gs};function hs(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};_s(d,-c),_s(f,c),o={type:c>1?Eo.strongSequence:Eo.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?Eo.strongSequence:Eo.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?Eo.strongText:Eo.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?Eo.strong:Eo.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Bn(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Bn(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=Bn(l,Vn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Bn(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Bn(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Xn(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function gs(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=ls(a)?us(a,r(),i):a,s=as(o),c=new fs(o,r(),i),l=os(s,c.value.bind(c),o),u;return d;function d(t){return t===wo.asterisk||wo.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=as(cs(a)?ps(a,r(),i):a),d=$o(l),p=o===wo.asterisk||o===wo.underscore,m=d||Qo(l)||p,h=$o(c),g=a===wo.asterisk||a===wo.underscore,_=h||Qo(c)||g,v=ts(l),y=!_||h&&(m||v)||n.includes(a)&&a!==wo.asterisk&&a!==wo.underscore,b=!m||d&&(_||es(c))||n.includes(o)&&o!==wo.asterisk&&o!==wo.underscore;return s._open=!!(u===wo.asterisk?y:y&&(rs(l)||!b)),s._close=!!(u===wo.asterisk?b:b&&(rs(c)||!y)),t(a)}}function _s(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function vs(){return{text:{[wo.asterisk]:ms,[wo.underscore]:ms},insideSpan:{null:[ms]}}}var ys=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,31,4,33,15,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,7,0,259,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],bs=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,13,65,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,18,21,18,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,18,0,182,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],xs=`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-׉ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୓-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫰ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,Ss=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆ՘ՙՠ-ֈ֋֌א-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ₏-₟ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-꟝꟢꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩ꭬꭭ꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,Cs={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},ws=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,Ts={5:ws,"5module":ws+` export import`,6:ws+` const class extends export import super`},Es=/^in(stanceof)?$/,Ds=RegExp(`[`+Ss+`]`),Os=RegExp(`[`+Ss+xs+`]`);function ks(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function As(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Ds.test(String.fromCharCode(e)):t!==!1&&ks(e,bs)}function js(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Os.test(String.fromCharCode(e)):t===!1?!1:ks(e,bs)||ks(e,ys)}var Ms=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function Ns(e,t){return new Ms(e,{beforeExpr:!0,binop:t})}var Ps={beforeExpr:!0},Fs={startsExpr:!0},Is={};function Ls(e,t){return t===void 0&&(t={}),t.keyword=e,Is[e]=new Ms(e,t)}var q={num:new Ms(`num`,Fs),regexp:new Ms(`regexp`,Fs),string:new Ms(`string`,Fs),name:new Ms(`name`,Fs),privateId:new Ms(`privateId`,Fs),eof:new Ms(`eof`),bracketL:new Ms(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new Ms(`]`),braceL:new Ms(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new Ms(`}`),parenL:new Ms(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new Ms(`)`),comma:new Ms(`,`,Ps),semi:new Ms(`;`,Ps),colon:new Ms(`:`,Ps),dot:new Ms(`.`),question:new Ms(`?`,Ps),questionDot:new Ms(`?.`),arrow:new Ms(`=>`,Ps),template:new Ms(`template`),invalidTemplate:new Ms(`invalidTemplate`),ellipsis:new Ms(`...`,Ps),backQuote:new Ms("`",Fs),dollarBraceL:new Ms("${",{beforeExpr:!0,startsExpr:!0}),eq:new Ms(`=`,{beforeExpr:!0,isAssign:!0}),assign:new Ms(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new Ms(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Ms(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Ns(`||`,1),logicalAND:Ns(`&&`,2),bitwiseOR:Ns(`|`,3),bitwiseXOR:Ns(`^`,4),bitwiseAND:Ns(`&`,5),equality:Ns(`==/!=/===/!==`,6),relational:Ns(`</>/<=/>=`,7),bitShift:Ns(`<</>>/>>>`,8),plusMin:new Ms(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Ns(`%`,10),star:Ns(`*`,10),slash:Ns(`/`,10),starstar:new Ms(`**`,{beforeExpr:!0}),coalesce:Ns(`??`,1),_break:Ls(`break`),_case:Ls(`case`,Ps),_catch:Ls(`catch`),_continue:Ls(`continue`),_debugger:Ls(`debugger`),_default:Ls(`default`,Ps),_do:Ls(`do`,{isLoop:!0,beforeExpr:!0}),_else:Ls(`else`,Ps),_finally:Ls(`finally`),_for:Ls(`for`,{isLoop:!0}),_function:Ls(`function`,Fs),_if:Ls(`if`),_return:Ls(`return`,Ps),_switch:Ls(`switch`),_throw:Ls(`throw`,Ps),_try:Ls(`try`),_var:Ls(`var`),_const:Ls(`const`),_while:Ls(`while`,{isLoop:!0}),_with:Ls(`with`),_new:Ls(`new`,{beforeExpr:!0,startsExpr:!0}),_this:Ls(`this`,Fs),_super:Ls(`super`,Fs),_class:Ls(`class`,Fs),_extends:Ls(`extends`,Ps),_export:Ls(`export`),_import:Ls(`import`,Fs),_null:Ls(`null`,Fs),_true:Ls(`true`,Fs),_false:Ls(`false`,Fs),_in:Ls(`in`,{beforeExpr:!0,binop:7}),_instanceof:Ls(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:Ls(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Ls(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Ls(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},Rs=/\r\n?|\n|\u2028|\u2029/,zs=new RegExp(Rs.source,`g`);function Bs(e){return e===10||e===13||e===8232||e===8233}function Vs(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(Bs(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var Hs=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Us=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ws=Object.prototype,Gs=Ws.hasOwnProperty,Ks=Ws.toString,qs=Object.hasOwn||(function(e,t){return Gs.call(e,t)}),Js=Array.isArray||(function(e){return Ks.call(e)===`[object Array]`}),Ys=Object.create(null);function Xs(e){return Ys[e]||(Ys[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function Zs(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Qs=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,$s=function(e,t){this.line=e,this.column=t};$s.prototype.offset=function(e){return new $s(this.line,this.column+e)};var ec=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function tc(e,t){for(var n=1,r=0;;){var i=Vs(e,r,t);if(i<0)return new $s(n,t-r);++n,r=i}}var nc={ecmaVersion:null,sourceType:`script`,strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},rc=!1;function ic(e){var t={};for(var n in nc)t[n]=e&&qs(e,n)?e[n]:nc[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!rc&&typeof console==`object`&&console.warn&&(rc=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
3
- Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,e&&e.allowHashBang!=null||(t.allowHashBang=t.ecmaVersion>=14),Js(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(Js(t.onComment)&&(t.onComment=ac(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function ac(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new ec(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var oc=1,sc=2,cc=4,lc=8,uc=16,dc=32,fc=64,pc=128,mc=256,hc=512,gc=1024,_c=oc|sc|mc;function vc(e,t){return sc|(e?cc:0)|(t?lc:0)}var yc=0,bc=1,xc=2,Sc=3,Cc=4,wc=5,Tc=function(e,t,n){this.options=e=ic(e),this.sourceFile=e.sourceFile,this.keywords=Xs(Ts[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=Cs[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=Xs(r);var i=(r?r+` `:``)+Cs.strict;this.reservedWordsStrict=Xs(i),this.reservedWordsStrictBind=Xs(i+` `+Cs.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=n||0,this.curLine=1,e.startLocation?(this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line):n?(this.lineStart=this.input.lastIndexOf(`
4
- `,n-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(Rs).length)):this.lineStart=0,this.type=q.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?sc:oc),this.regexpState=null,this.privateNameStack=[]},Ec={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};Tc.prototype.parse=function(){var e=this,t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(t)})},Ec.inFunction.get=function(){return(this.currentVarScope().flags&sc)>0},Ec.inGenerator.get=function(){return(this.currentVarScope().flags&lc)>0},Ec.inAsync.get=function(){return(this.currentVarScope().flags&cc)>0},Ec.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(mc|hc))return!1;if(t&sc)return(t&cc)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Ec.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&oc)},Ec.allowSuper.get=function(){return(this.currentThisScope().flags&fc)>0||this.options.allowSuperOutsideMethod},Ec.allowDirectSuper.get=function(){return(this.currentThisScope().flags&pc)>0},Ec.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ec.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(mc|hc)||t&sc&&!(t&uc))return!0}return!1},Ec.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&gc||!this.inModule&&e&oc)},Ec.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&mc)>0},Tc.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},Tc.parse=function(e,t){return new this(t,e).parse()},Tc.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},Tc.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(Tc.prototype,Ec);var Dc=Tc.prototype,Oc=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Dc.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){Us.lastIndex=e,e+=Us.exec(this.input)[0].length;var t=Oc.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){Us.lastIndex=e+t[0].length;var n=Us.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||Rs.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`||i===`i`&&kc(this,r))}e+=t[0].length,Us.lastIndex=e,e+=Us.exec(this.input)[0].length,this.input[e]===`;`&&e++}};function kc(e,t){for(var n=t+1,r=Math.min(e.input.length,t+11);n<r;){var i=e.fullCharCodeAt(n);if(!js(i,!0))break;n+=i<=65535?1:2}return n===t+2&&e.input.slice(t,n)===`in`||n===t+10&&e.input.slice(t,n)===`instanceof`}Dc.eat=function(e){return this.type===e&&(this.next(),!0)},Dc.isContextual=function(e){return this.type===q.name&&this.value===e&&!this.containsEsc},Dc.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Dc.catchStackOverflow=function(e){try{return e()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,`Not enough stack space to parse input`);else throw e}},Dc.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Dc.canInsertSemicolon=function(){return this.type===q.eof||this.type===q.braceR||Rs.test(this.input.slice(this.lastTokEnd,this.start))},Dc.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Dc.semicolon=function(){!this.eat(q.semi)&&!this.insertSemicolon()&&this.unexpected()},Dc.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Dc.expect=function(e){this.eat(e)||this.unexpected()},Dc.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var Ac=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Dc.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},Dc.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},Dc.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},Dc.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var J=Tc.prototype;J.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==q.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var jc={kind:`loop`},Mc={kind:`switch`};J.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;Us.lastIndex=this.pos;var t=Us.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(As(r)){var i=n;do n+=r<=65535?1:2;while(js(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!Es.test(a))return!0}return!1},J.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;Us.lastIndex=this.pos;var e=Us.exec(this.input),t=this.pos+e[0].length,n;return!Rs.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(js(n=this.fullCharCodeAt(t+8))||n===92))},J.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;Us.lastIndex=this.pos;var n=Us.exec(this.input),r=this.pos+n[0].length;if(Rs.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||js(a=this.fullCharCodeAt(i))||a===92)return!1;Us.lastIndex=i;var o=Us.exec(this.input);if(r=i+o[0].length,o&&Rs.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!As(s)&&s!==92)return!1;var c=r;do r+=s<=65535?1:2;while(js(s=this.fullCharCodeAt(r)));if(s===92)return!0;var l=this.input.slice(c,r);if(Es.test(l))return!1;if(t&&!e&&l===`of`){Us.lastIndex=r;var u=Us.exec(this.input);if(r+=u[0].length,this.input.charCodeAt(r)!==61||(s=this.input.charCodeAt(r+1))===61||s===62)return!1}return!0},J.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},J.isUsing=function(e){return this.isUsingKeyword(!1,e)},J.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=q._var,a=`let`),r){case q._break:case q._continue:return this.parseBreakContinueStatement(i,r.keyword);case q._debugger:return this.parseDebuggerStatement(i);case q._do:return this.parseDoStatement(i);case q._for:return this.parseForStatement(i);case q._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case q._class:return e&&this.unexpected(),this.parseClass(i,!0);case q._if:return this.parseIfStatement(i);case q._return:return this.parseReturnStatement(i);case q._switch:return this.parseSwitchStatement(i);case q._throw:return this.parseThrowStatement(i);case q._try:return this.parseTryStatement(i);case q._const:case q._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case q._while:return this.parseWhileStatement(i);case q._with:return this.parseWithStatement(i);case q.braceL:return this.parseBlock(!0,i);case q.semi:return this.parseEmptyStatement(i);case q._export:case q._import:if(this.options.ecmaVersion>10&&r===q._import){Us.lastIndex=this.pos;var o=Us.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===q._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,`Using declaration is not allowed in single-statement positions`),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===q.name&&d.type===`Identifier`&&this.eat(q.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},J.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(q.semi)||this.insertSemicolon()?e.label=null:this.type===q.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},J.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},J.parseDoStatement=function(e){return this.next(),this.labels.push(jc),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(q._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(q.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},J.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(jc),this.enterScope(0),this.expect(q.parenL),this.type===q.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===q._var||this.type===q._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new Ac,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===q._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===q._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},J.parseForAfterInit=function(e,t,n){return(this.type===q._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.type===q._in?(t.kind!==`using`&&t.kind!==`await using`||t.declarations[0].init||this.raise(this.start,`Using declaration is not allowed in for-in loops`),this.options.ecmaVersion>=9&&n>-1&&this.unexpected(n)):this.options.ecmaVersion>=9&&(e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},J.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Pc|(n?0:Fc),!1,t)},J.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(q._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},J.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(q.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},J.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(q.braceL),this.labels.push(Mc),this.enterScope(gc);for(var t,n=!1;this.type!==q.braceR;)if(this.type===q._case||this.type===q._default){var r=this.type===q._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(q.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},J.parseThrowStatement=function(e){return this.next(),Rs.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var Nc=[];J.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?dc:0),this.checkLValPattern(e,t?Cc:xc),this.expect(q.parenR),e},J.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===q._catch){var t=this.startNode();this.next(),this.eat(q.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(q._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},J.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},J.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(jc),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},J.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},J.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},J.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===q._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},J.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},J.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(q.braceL),e&&this.enterScope(0);this.type!==q.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},J.parseFor=function(e,t){return e.init=t,this.expect(q.semi),e.test=this.type===q.semi?null:this.parseExpression(),this.expect(q.semi),e.update=this.type===q.parenR?null:this.parseExpression(),this.expect(q.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},J.parseForIn=function(e,t){var n=this.type===q._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(q.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},J.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(q.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===q._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==q._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&(!t||this.type!==q._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(q.comma))break}return e},J.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?bc:xc,!1)};var Pc=1,Fc=2,Ic=4;J.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===q.star&&t&Fc&&this.unexpected(),e.generator=this.eat(q.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Pc&&(e.id=t&Ic&&this.type!==q.name?null:this.parseIdent(),e.id&&!(t&Fc)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?bc:xc:Sc));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(vc(e.async,e.generator)),t&Pc||(e.id=this.type===q.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&Pc?`FunctionDeclaration`:`FunctionExpression`)},J.parseFunctionParams=function(e){this.expect(q.parenL),e.params=this.parseBindingList(q.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},J.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(q.braceL);this.type!==q.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Lc(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},J.parseClassElement=function(e){if(this.eat(q.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(q.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===q.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===q.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(q.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===q.parenL||o!==`method`||i||a){var l=!n.static&&Rc(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},J.isClassElementNameStart=function(){return this.type===q.name||this.type===q.privateId||this.type===q.num||this.type===q.string||this.type===q.bracketL||this.type.keyword},J.parseClassElementName=function(e){this.type===q.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},J.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Rc(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},J.parseClassField=function(e){return Rc(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Rc(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(q.eq)?(this.enterScope(hc|fc),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},J.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(mc|fc);this.type!==q.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},J.parseClassId=function(e,t){this.type===q.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,xc,!1)):(t===!0&&this.unexpected(),e.id=null)},J.parseClassSuper=function(e){e.superClass=this.eat(q._extends)?this.parseExprSubscripts(null,!1):null},J.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},J.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];qs(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Lc(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function Rc(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}J.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==q.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},J.parseExport=function(e,t){if(this.next(),this.eat(q.star))return this.parseExportAllDeclaration(e,t);if(this.eat(q._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==q.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},J.parseExportDeclaration=function(e){return this.parseStatement(null)},J.parseExportDefaultDeclaration=function(){var e;if(this.type===q._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Pc|Ic,!1,e)}if(this.type===q._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}var r=this.parseMaybeAssign();return this.semicolon(),r},J.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),qs(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},J.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},J.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},J.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},J.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},J.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(q.braceL);!this.eat(q.braceR);){if(n)n=!1;else if(this.expect(q.comma),this.afterTrailingComma(q.braceR))break;t.push(this.parseExportSpecifier(e))}return t},J.parseImport=function(e){return this.next(),this.type===q.string?(e.specifiers=Nc,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===q.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},J.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,xc),this.finishNode(e,`ImportSpecifier`)},J.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,xc),this.finishNode(e,`ImportDefaultSpecifier`)},J.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,xc),this.finishNode(e,`ImportNamespaceSpecifier`)},J.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===q.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(q.comma)))return e;if(this.type===q.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(q.braceL);!this.eat(q.braceR);){if(t)t=!1;else if(this.expect(q.comma),this.afterTrailingComma(q.braceR))break;e.push(this.parseImportSpecifier())}return e},J.parseWithClause=function(){var e=[];if(!this.eat(q._with))return e;this.expect(q.braceL);for(var t={},n=!0;!this.eat(q.braceR);){if(n)n=!1;else if(this.expect(q.comma),this.afterTrailingComma(q.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;qs(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},J.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===q.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(q.colon),this.type!==q.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},J.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===q.string){var e=this.parseLiteral(this.value);return Qs.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},J.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},J.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var zc=Tc.prototype;zc.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},zc.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},zc.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},zc.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==q.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},zc.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case q.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(q.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case q.braceL:return this.parseObj(!0)}return this.parseIdent()},zc.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(q.comma),t&&this.type===q.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===q.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===q.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},zc.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},zc.parseBindingListItem=function(e){return e},zc.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(q.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},zc.checkLValSimple=function(e,t,n){t===void 0&&(t=yc);var r=t!==yc;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===xc&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(qs(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==wc&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},zc.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=yc),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},zc.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=yc),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Bc=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},Vc={b_stat:new Bc(`{`,!1),b_expr:new Bc(`{`,!0),b_tmpl:new Bc("${",!1),p_stat:new Bc(`(`,!1),p_expr:new Bc(`(`,!0),q_tmpl:new Bc("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Bc(`function`,!1),f_expr:new Bc(`function`,!0),f_expr_gen:new Bc(`function`,!0,!1,null,!0),f_gen:new Bc(`function`,!1,!1,null,!0)},Hc=Tc.prototype;Hc.initialContext=function(){return[Vc.b_stat]},Hc.curContext=function(){return this.context[this.context.length-1]},Hc.braceIsBlock=function(e){var t=this.curContext();return t===Vc.f_expr||t===Vc.f_stat?!0:e===q.colon&&(t===Vc.b_stat||t===Vc.b_expr)?!t.isExpr:e===q._return||e===q.name&&this.exprAllowed?Rs.test(this.input.slice(this.lastTokEnd,this.start)):e===q._else||e===q.semi||e===q.eof||e===q.parenR||e===q.arrow?!0:e===q.braceL?t===Vc.b_stat:e===q._var||e===q._const||e===q.name?!1:!this.exprAllowed},Hc.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Hc.updateContext=function(e){var t,n=this.type;n.keyword&&e===q.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Hc.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},q.parenR.updateContext=q.braceR.updateContext=function(){if(this.context.length===1)this.exprAllowed=!0;else{var e=this.context.pop();e===Vc.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}},q.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Vc.b_stat:Vc.b_expr),this.exprAllowed=!0},q.dollarBraceL.updateContext=function(){this.context.push(Vc.b_tmpl),this.exprAllowed=!0},q.parenL.updateContext=function(e){var t=e===q._if||e===q._for||e===q._with||e===q._while;this.context.push(t?Vc.p_stat:Vc.p_expr),this.exprAllowed=!0},q.incDec.updateContext=function(){},q._function.updateContext=q._class.updateContext=function(e){e.beforeExpr&&e!==q._else&&(e!==q.semi||this.curContext()===Vc.p_stat)&&!(e===q._return&&Rs.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==q.colon&&e!==q.braceL||this.curContext()!==Vc.b_stat)?this.context.push(Vc.f_expr):this.context.push(Vc.f_stat),this.exprAllowed=!1},q.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},q.backQuote.updateContext=function(){this.curContext()===Vc.q_tmpl?this.context.pop():this.context.push(Vc.q_tmpl),this.exprAllowed=!1},q.star.updateContext=function(e){if(e===q._function){var t=this.context.length-1;this.context[t]===Vc.f_expr?this.context[t]=Vc.f_expr_gen:this.context[t]=Vc.f_gen}this.exprAllowed=!0},q.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==q.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Uc=Tc.prototype;Uc.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);else{i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}}},Uc.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var r=n.start,i=n.startLoc,a=n.parseMaybeAssign(e,t);if(n.type===q.comma){var o=n.startNodeAt(r,i);for(o.expressions=[a];n.eat(q.comma);)o.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(o,`SequenceExpression`)}return a})},Uc.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Ac,r=!0);var s=this.start,c=this.startLoc;(this.type===q.parenL||this.type===q.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===q.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=-1,t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),t.doubleProto>=l.start&&(t.doubleProto=-1)),this.type===q.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},Uc.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if((i.type!==`ArrowFunctionExpression`||i.start!==n)&&this.eat(q.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(q.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},Uc.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},Uc.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==q._in)&&a>r){var o=this.type===q.logicalOR||this.type===q.logicalAND,s=this.type===q.coalesce;s&&(a=q.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===q.coalesce||s&&(this.type===q.logicalOR||this.type===q.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},Uc.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},Uc.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===q.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&Wc(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Gc(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===q.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==q._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&(o.type!==`ArrowFunctionExpression`||o.start!==i)&&this.eat(q.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function Wc(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&Wc(e.expression)}function Gc(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Gc(e.expression)||e.type===`ParenthesizedExpression`&&Gc(e.expression)}Uc.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=-1,a=-1;e&&(i=e.doubleProto,a=e.shorthandAssign,e.doubleProto=e.shorthandAssign=-1);var o=this.parseExprAtom(e,t);if(o.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return o;var s=this.parseSubscripts(o,n,r,!1,t);return e&&(s.end>o.end&&(this.checkExpressionErrors(e,!0),e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),i>-1&&(e.doubleProto=i),a>-1&&(e.shorthandAssign=a)),s},Uc.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s.end===e.end||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s,a=!1}},Uc.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(q.arrow)},Uc.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},Uc.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(q.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(q.bracketL);if(l||c&&this.type!==q.parenL&&this.type!==q.backQuote||this.eat(q.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(q.bracketR)):u.property=this.type===q.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(q.parenL)){var d=new Ac,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(q.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===q.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},Uc.parseExprAtom=function(e,t,n){this.type===q.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case q._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===q.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==q.dot&&this.type!==q.bracketL&&this.type!==q.parenL&&this.unexpected(),this.finishNode(r,`Super`);case q._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case q.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(q._function))return this.overrideContext(Vc.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(q.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===q.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(q.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case q.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case q.num:case q.string:return this.parseLiteral(this.value);case q._null:case q._true:case q._false:return r=this.startNode(),r.value=this.type===q._null?null:this.type===q._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case q.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case q.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(q.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case q.braceL:return this.overrideContext(Vc.b_expr),this.parseObj(!1,e);case q._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case q._class:return this.parseClass(this.startNode(),!1);case q._new:return this.parseNew();case q.backQuote:return this.parseTemplate();case q._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},Uc.parseExprAtomDefault=function(){this.unexpected()},Uc.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===q.parenL&&!e)return this.parseDynamicImport(t);if(this.type===q.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}this.unexpected()},Uc.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(q.parenR)?e.options=null:(this.expect(q.comma),this.afterTrailingComma(q.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(q.parenR)||(this.expect(q.comma),this.afterTrailingComma(q.parenR)||this.unexpected())));else if(!this.eat(q.parenR)){var t=this.start;this.eat(q.comma)&&this.eat(q.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},Uc.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},Uc.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},Uc.parseParenExpression=function(){this.expect(q.parenL);var e=this.parseExpression();return this.expect(q.parenR),e},Uc.shouldParseArrow=function(e){return!this.canInsertSemicolon()},Uc.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new Ac,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==q.parenR;){if(l?l=!1:this.expect(q.comma),a&&this.afterTrailingComma(q.parenR,!0)){u=!0;break}if(this.type===q.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===q.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(q.parenR),e&&this.shouldParseArrow(c)&&this.eat(q.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},Uc.parseParenItem=function(e){return e},Uc.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Kc=[];Uc.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===q.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.callee.type===`Super`&&this.raiseRecoverable(r,`Invalid use of 'super'`),e.arguments=this.eat(q.parenL)?this.parseExprList(q.parenR,this.options.ecmaVersion>=8,!1):Kc,this.finishNode(e,`NewExpression`)},Uc.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===q.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
5
- `),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
6
- `),cooked:this.value},this.next(),n.tail=this.type===q.backQuote,this.finishNode(n,`TemplateElement`)},Uc.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===q.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(q.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(q.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},Uc.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===q.name||this.type===q.num||this.type===q.string||this.type===q.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===q.star)&&!Rs.test(this.input.slice(this.lastTokEnd,this.start))},Uc.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(q.braceR);){if(r)r=!1;else if(this.expect(q.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(q.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},Uc.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(q.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===q.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===q.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(q.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(q.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},Uc.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},Uc.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===q.colon&&this.unexpected(),this.eat(q.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===q.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==q.comma&&this.type!==q.braceR&&this.type!==q.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===q.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},Uc.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(q.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(q.bracketR),e.key;e.computed=!1}return e.key=this.type===q.num||this.type===q.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},Uc.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Uc.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(vc(t,r.generator)|fc|(n?pc:0)),this.expect(q.parenL),r.params=this.parseBindingList(q.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},Uc.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(vc(n,!1)|uc),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},Uc.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==q.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,wc),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},Uc.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},Uc.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,bc,t?null:n)}},Uc.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(q.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===q.comma?o=null:this.type===q.ellipsis?(o=this.parseSpread(r),r&&this.type===q.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},Uc.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&_c)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},Uc.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},Uc.parseIdentNode=function(){var e=this.startNode();return this.type===q.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,e.name!==`class`&&e.name!==`function`||this.lastTokEnd===this.lastTokStart+1&&this.input.charCodeAt(this.lastTokStart)===46||this.context.pop(),this.type=q.name):this.unexpected(),e},Uc.parsePrivateIdent=function(){var e=this.startNode();return this.type===q.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},Uc.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===q.semi||this.canInsertSemicolon()||this.type!==q.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(q.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},Uc.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var qc=Tc.prototype;qc.raise=function(e,t){var n=tc(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},qc.raiseRecoverable=qc.raise,qc.curPosition=function(){if(this.options.locations)return new $s(this.curLine,this.pos-this.lineStart)};var Jc=Tc.prototype,Yc=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};Jc.enterScope=function(e){this.scopeStack.push(new Yc(e))},Jc.exitScope=function(){this.scopeStack.pop()},Jc.treatFunctionsAsVarInScope=function(e){return e.flags&sc||!this.inModule&&e.flags&oc},Jc.declareName=function(e,t,n){var r=!1;if(t===xc){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&oc&&delete this.undefinedExports[e]}else if(t===Cc)this.currentScope().lexical.push(e);else if(t===Sc){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&dc&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&oc&&delete this.undefinedExports[e],s.flags&_c)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},Jc.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Jc.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Jc.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(_c|hc|mc))return t}},Jc.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(_c|hc|mc)&&!(t.flags&uc))return t}};var Xc=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new ec(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Zc=Tc.prototype;Zc.startNode=function(){return new Xc(this,this.start,this.startLoc)},Zc.startNodeAt=function(e,t){return new Xc(this,e,t)};function Qc(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}Zc.finishNode=function(e,t){return Qc.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Zc.finishNodeAt=function(e,t,n,r){return Qc.call(this,e,t,n,r)},Zc.copyNode=function(e){var t=new Xc(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var $c=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,el=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,tl=el+` Extended_Pictographic`,nl=tl,rl=nl+` EBase EComp EMod EPres ExtPict`,il=rl,al={9:el,10:tl,11:nl,12:rl,13:il,14:il},ol={9:``,10:``,11:``,12:``,13:``,14:`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`},sl=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,cl=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,ll=cl+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,ul=ll+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,dl=ul+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,fl=dl+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,pl={9:cl,10:ll,11:ul,12:dl,13:fl,14:fl+` `+$c},ml={};function hl(e){var t=ml[e]={binary:Xs(al[e]+` `+sl),binaryOfStrings:Xs(ol[e]),nonBinary:{General_Category:Xs(sl),Script:Xs(pl[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var gl=0,_l=[9,10,11,12,13,14];gl<_l.length;gl+=1){var vl=_l[gl];hl(vl)}var Y=Tc.prototype,yl=function(e,t){this.parent=e,this.base=t||this};yl.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},yl.prototype.sibling=function(){return new yl(this.parent,this.base)};var bl=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=ml[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};bl.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},bl.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},bl.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},bl.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},bl.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},bl.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},bl.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},bl.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},bl.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},Y.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function xl(e){for(var t in e)return!0;return!1}Y.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&xl(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Y.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},Y.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new yl(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},Y.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Y.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},Y.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Y.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},Y.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Y.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},Y.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Y.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Y.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},Y.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},Y.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&Sl(n);)t+=Zs(n),e.advance();return t};function Sl(e){return e===105||e===109||e===115}Y.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Y.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},Y.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Cl(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Cl(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Y.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!Cl(n);)e.advance();return e.pos!==t},Y.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124&&(e.advance(),!0)},Y.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n){if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`)}t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Y.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},Y.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Zs(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Zs(e.lastIntValue);return!0}return!1},Y.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),wl(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function wl(e){return As(e,!0)||e===36||e===95}Y.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),Tl(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function Tl(e){return js(e,!0)||e===36||e===95||e===8204||e===8205}Y.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},Y.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Y.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},Y.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Y.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Y.regexp_eatZero=function(e){return e.current()===48&&!Ll(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},Y.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},Y.regexp_eatControlLetter=function(e){var t=e.current();return El(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function El(e){return e>=65&&e<=90||e>=97&&e<=122}Y.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Dl(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function Dl(e){return e>=0&&e<=1114111}Y.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)&&(e.lastIntValue=t,e.advance(),!0)},Y.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Ol=0,kl=1,Al=2;Y.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(jl(t))return e.lastIntValue=-1,e.advance(),kl;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===Al&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return Ol};function jl(e){return e===100||e===68||e===115||e===83||e===119||e===87}Y.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),kl}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return Ol},Y.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){qs(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},Y.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return kl;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return Al;e.raise(`Invalid property name`)},Y.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;Ml(t=e.current());)e.lastStringValue+=Zs(t),e.advance();return e.lastStringValue!==``};function Ml(e){return El(e)||e===95}Y.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;Nl(t=e.current());)e.lastStringValue+=Zs(t),e.advance();return e.lastStringValue!==``};function Nl(e){return Ml(e)||Ll(e)}Y.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Y.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===Al&&e.raise(`Negated character class may contain strings`),!0}return!1},Y.regexp_classContents=function(e){return e.current()===93?kl:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),kl)},Y.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},Y.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Bl(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},Y.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Y.regexp_classSetExpression=function(e){var t=kl,n;if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e)){n===Al&&(t=Al);for(var r=e.pos;e.eatChars([38,38]);)e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))?n!==Al&&(t=kl):e.raise(`Invalid character in character class`);if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`)}for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===Al&&(t=Al)}},Y.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},Y.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?kl:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Y.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===Al&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},Y.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},Y.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Al&&(t=Al);return t},Y.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?kl:Al},Y.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&Pl(n)||Fl(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function Pl(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Fl(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}Y.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Il(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Il(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}Y.regexp_eatClassControlLetter=function(e){var t=e.current();return Ll(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},Y.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},Y.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Ll(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Ll(e){return e>=48&&e<=57}Y.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Rl(n=e.current());)e.lastIntValue=16*e.lastIntValue+zl(n),e.advance();return e.pos!==t};function Rl(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function zl(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}Y.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?t*64+n*8+e.lastIntValue:t*8+n}else e.lastIntValue=t;return!0}return!1},Y.regexp_eatOctalDigit=function(e){var t=e.current();return Bl(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Bl(e){return e>=48&&e<=55}Y.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Rl(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+zl(i),e.advance()}return!0};var Vl=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new ec(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Hl=Tc.prototype;Hl.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new Vl(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Hl.getToken=function(){return this.next(),new Vl(this)},typeof Symbol<`u`&&(Hl[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===q.eof,value:t}}}}),Hl.nextToken=function(){var e=this.curContext();if(e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(q.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Hl.readToken=function(e){return As(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Hl.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},Hl.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},Hl.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=Vs(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Hl.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Bs(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Hl.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&Hs.test(String.fromCharCode(e)))++this.pos;else break loop}}},Hl.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Hl.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(q.ellipsis)):(++this.pos,this.finishToken(q.dot))},Hl.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(q.assign,2):this.finishOp(q.slash,1)},Hl.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?q.star:q.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=q.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(q.assign,n+1):this.finishOp(r,n)},Hl.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(q.assign,3):this.finishOp(e===124?q.logicalOR:q.logicalAND,2):t===61?this.finishOp(q.assign,2):this.finishOp(e===124?q.bitwiseOR:q.bitwiseAND,1)},Hl.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(q.assign,2):this.finishOp(q.bitwiseXOR,1)},Hl.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Rs.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(q.incDec,2):t===61?this.finishOp(q.assign,2):this.finishOp(q.plusMin,1)},Hl.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(q.assign,n+1):this.finishOp(q.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(q.relational,n))},Hl.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(q.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(q.arrow)):this.finishOp(e===61?q.eq:q.prefix,1)},Hl.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(q.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(q.assign,3):this.finishOp(q.coalesce,2)}return this.finishOp(q.question,1)},Hl.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),As(t,!0)||t===92))return this.finishToken(q.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+Zs(t)+`'`)},Hl.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(q.parenL);case 41:return++this.pos,this.finishToken(q.parenR);case 59:return++this.pos,this.finishToken(q.semi);case 44:return++this.pos,this.finishToken(q.comma);case 91:return++this.pos,this.finishToken(q.bracketL);case 93:return++this.pos,this.finishToken(q.bracketR);case 123:return++this.pos,this.finishToken(q.braceL);case 125:return++this.pos,this.finishToken(q.braceR);case 58:return++this.pos,this.finishToken(q.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(q.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(q.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+Zs(e)+`'`)},Hl.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Hl.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(Rs.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new bl(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(q.regexp,{pattern:i,flags:o,value:c})},Hl.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95)i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;else{if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Ul(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function Wl(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Hl.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=Wl(this.input.slice(t,this.pos)),++this.pos):As(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(q.num,n)},Hl.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=Wl(this.input.slice(t,this.pos));return++this.pos,As(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(q.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),r!==69&&r!==101||n||(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),As(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=Ul(this.input.slice(t,this.pos),n);return this.finishToken(q.num,a)},Hl.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},Hl.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Bs(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(q.string,t)};var Gl={};Hl.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Gl)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Hl.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Gl;this.raise(e,t)},Hl.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===q.template||this.type===q.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(q.dollarBraceL)):(++this.pos,this.finishToken(q.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(q.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Bs(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
7
- `;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Hl.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(q.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
8
- `&&++this.pos;case`
9
- `:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,`Unterminated template`)},Hl.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
10
- `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Zs(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return Bs(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},Hl.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Hl.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(js(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?As:js)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=Zs(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Hl.readWord=function(){var e=this.readWord1(),t=q.name;return this.keywords.test(e)&&(t=Is[e]),this.finishToken(t,e)},Tc.acorn={Parser:Tc,version:`8.19.0`,defaultOptions:nc,Position:$s,SourceLocation:ec,getLineInfo:tc,Node:Xc,TokenType:Ms,tokTypes:q,keywordTypes:Is,TokContext:Bc,tokContexts:Vc,isIdentifierChar:js,isIdentifierStart:As,Token:Vl,isNewLine:Bs,lineBreak:Rs,lineBreakG:zs,nonASCIIwhitespace:Hs};var Kl=t(((e,t)=>{t.exports={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,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:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,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:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,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:`♦`}})),ql=t(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.acorn={}))})(n,(function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,31,4,33,15,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,7,0,259,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,481,1,61,4,4,5,9,7,3,6,31,3,149,2,12,2,9,1,3,0,33,1,1357,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,13,65,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,18,21,18,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,18,0,182,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,22,0,239,18,16,0,2,12,2,33,125,0,80,921,103,111,6,206,13,310,2314,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7386,37,33,96,114,14,913,15,50,7710,3,2,6,2,1,2,296,10,0,30,2,3,0,15,4,8,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,340,2,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,129,15,6,55,50,49,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4382,2,5773,3,7472,16,621,2467,541,1507,4938,6,8489,39815,11327],r=`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄ-׉ؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୓-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫰ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,i=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆ՘ՙՠ-ֈ֋֌א-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿ₏-₟ℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-꟝꟢꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩ꭬꭭ꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,a={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},o=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,s={5:o,"5module":o+` export import`,6:o+` const class extends export import super`},c=/^in(stanceof)?$/,l=RegExp(`[`+i+`]`),u=RegExp(`[`+i+r+`]`);function d(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function f(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&l.test(String.fromCharCode(e)):t!==!1&&d(e,n)}function p(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&u.test(String.fromCharCode(e)):r===!1?!1:d(e,n)||d(e,t)}var m=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},_={startsExpr:!0},v={};function y(e,t){return t===void 0&&(t={}),t.keyword=e,v[e]=new m(e,t)}var b={num:new m(`num`,_),regexp:new m(`regexp`,_),string:new m(`string`,_),name:new m(`name`,_),privateId:new m(`privateId`,_),eof:new m(`eof`),bracketL:new m(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new m(`]`),braceL:new m(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new m(`}`),parenL:new m(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new m(`)`),comma:new m(`,`,g),semi:new m(`;`,g),colon:new m(`:`,g),dot:new m(`.`),question:new m(`?`,g),questionDot:new m(`?.`),arrow:new m(`=>`,g),template:new m(`template`),invalidTemplate:new m(`invalidTemplate`),ellipsis:new m(`...`,g),backQuote:new m("`",_),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m(`=`,{beforeExpr:!0,isAssign:!0}),assign:new m(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new m(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h(`||`,1),logicalAND:h(`&&`,2),bitwiseOR:h(`|`,3),bitwiseXOR:h(`^`,4),bitwiseAND:h(`&`,5),equality:h(`==/!=/===/!==`,6),relational:h(`</>/<=/>=`,7),bitShift:h(`<</>>/>>>`,8),plusMin:new m(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h(`%`,10),star:h(`*`,10),slash:h(`/`,10),starstar:new m(`**`,{beforeExpr:!0}),coalesce:h(`??`,1),_break:y(`break`),_case:y(`case`,g),_catch:y(`catch`),_continue:y(`continue`),_debugger:y(`debugger`),_default:y(`default`,g),_do:y(`do`,{isLoop:!0,beforeExpr:!0}),_else:y(`else`,g),_finally:y(`finally`),_for:y(`for`,{isLoop:!0}),_function:y(`function`,_),_if:y(`if`),_return:y(`return`,g),_switch:y(`switch`),_throw:y(`throw`,g),_try:y(`try`),_var:y(`var`),_const:y(`const`),_while:y(`while`,{isLoop:!0}),_with:y(`with`),_new:y(`new`,{beforeExpr:!0,startsExpr:!0}),_this:y(`this`,_),_super:y(`super`,_),_class:y(`class`,_),_extends:y(`extends`,g),_export:y(`export`),_import:y(`import`,_),_null:y(`null`,_),_true:y(`true`,_),_false:y(`false`,_),_in:y(`in`,{beforeExpr:!0,binop:7}),_instanceof:y(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:y(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,S=new RegExp(x.source,`g`);function C(e){return e===10||e===13||e===8232||e===8233}function w(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(C(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var T=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,E=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,D=Object.prototype,O=D.hasOwnProperty,k=D.toString,A=Object.hasOwn||(function(e,t){return O.call(e,t)}),j=Array.isArray||(function(e){return k.call(e)===`[object Array]`}),M=Object.create(null);function N(e){return M[e]||(M[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function P(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var F=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,I=function(e,t){this.line=e,this.column=t};I.prototype.offset=function(e){return new I(this.line,this.column+e)};var L=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function R(e,t){for(var n=1,r=0;;){var i=w(e,r,t);if(i<0)return new I(n,t-r);++n,r=i}}var z={ecmaVersion:null,sourceType:`script`,strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},B=!1;function ee(e){var t={};for(var n in z)t[n]=e&&A(e,n)?e[n]:z[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!B&&typeof console==`object`&&console.warn&&(B=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
11
- Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,e&&e.allowHashBang!=null||(t.allowHashBang=t.ecmaVersion>=14),j(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(j(t.onComment)&&(t.onComment=te(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function te(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new L(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var ne=1,re=2,ie=4,ae=8,V=16,oe=32,se=64,ce=128,le=256,ue=512,de=1024,fe=ne|re|le;function pe(e,t){return re|(e?ie:0)|(t?ae:0)}var me=0,he=1,ge=2,_e=3,ve=4,ye=5,be=function(e,t,n){this.options=e=ee(e),this.sourceFile=e.sourceFile,this.keywords=N(s[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=a[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=N(r);var i=(r?r+` `:``)+a.strict;this.reservedWordsStrict=N(i),this.reservedWordsStrictBind=N(i+` `+a.strictBind),this.input=String(t),this.containsEsc=!1,this.pos=n||0,this.curLine=1,e.startLocation?(this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line):n?(this.lineStart=this.input.lastIndexOf(`
12
- `,n-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(x).length)):this.lineStart=0,this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||e.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?re:ne),this.regexpState=null,this.privateNameStack=[]},xe={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};be.prototype.parse=function(){var e=this,t=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(t)})},xe.inFunction.get=function(){return(this.currentVarScope().flags&re)>0},xe.inGenerator.get=function(){return(this.currentVarScope().flags&ae)>0},xe.inAsync.get=function(){return(this.currentVarScope().flags&ie)>0},xe.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(le|ue))return!1;if(t&re)return(t&ie)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},xe.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&ne)},xe.allowSuper.get=function(){return(this.currentThisScope().flags&se)>0||this.options.allowSuperOutsideMethod},xe.allowDirectSuper.get=function(){return(this.currentThisScope().flags&ce)>0},xe.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},xe.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(le|ue)||t&re&&!(t&V))return!0}return!1},xe.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&de||!this.inModule&&e&ne)},xe.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&le)>0},be.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},be.parse=function(e,t){return new this(t,e).parse()},be.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},be.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(be.prototype,xe);var Se=be.prototype,Ce=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Se.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){E.lastIndex=e,e+=E.exec(this.input)[0].length;var t=Ce.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){E.lastIndex=e+t[0].length;var n=E.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||x.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`||i===`i`&&we(this,r))}e+=t[0].length,E.lastIndex=e,e+=E.exec(this.input)[0].length,this.input[e]===`;`&&e++}};function we(e,t){for(var n=t+1,r=Math.min(e.input.length,t+11);n<r;){var i=e.fullCharCodeAt(n);if(!p(i,!0))break;n+=i<=65535?1:2}return n===t+2&&e.input.slice(t,n)===`in`||n===t+10&&e.input.slice(t,n)===`instanceof`}Se.eat=function(e){return this.type===e&&(this.next(),!0)},Se.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},Se.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Se.catchStackOverflow=function(e){try{return e()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,`Not enough stack space to parse input`);else throw e}},Se.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Se.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},Se.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Se.semicolon=function(){!this.eat(b.semi)&&!this.insertSemicolon()&&this.unexpected()},Se.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Se.expect=function(e){this.eat(e)||this.unexpected()},Se.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var Te=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Se.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},Se.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},Se.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},Se.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var H=be.prototype;H.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==b.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var Ee={kind:`loop`},De={kind:`switch`};H.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;E.lastIndex=this.pos;var t=E.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(f(r)){var i=n;do n+=r<=65535?1:2;while(p(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!c.test(a))return!0}return!1},H.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;E.lastIndex=this.pos;var e=E.exec(this.input),t=this.pos+e[0].length,n;return!x.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(p(n=this.fullCharCodeAt(t+8))||n===92))},H.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;E.lastIndex=this.pos;var n=E.exec(this.input),r=this.pos+n[0].length;if(x.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||p(a=this.fullCharCodeAt(i))||a===92)return!1;E.lastIndex=i;var o=E.exec(this.input);if(r=i+o[0].length,o&&x.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!f(s)&&s!==92)return!1;var l=r;do r+=s<=65535?1:2;while(p(s=this.fullCharCodeAt(r)));if(s===92)return!0;var u=this.input.slice(l,r);if(c.test(u))return!1;if(t&&!e&&u===`of`){E.lastIndex=r;var d=E.exec(this.input);if(r+=d[0].length,this.input.charCodeAt(r)!==61||(s=this.input.charCodeAt(r+1))===61||s===62)return!1}return!0},H.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},H.isUsing=function(e){return this.isUsingKeyword(!1,e)},H.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=b._var,a=`let`),r){case b._break:case b._continue:return this.parseBreakContinueStatement(i,r.keyword);case b._debugger:return this.parseDebuggerStatement(i);case b._do:return this.parseDoStatement(i);case b._for:return this.parseForStatement(i);case b._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(i,!0);case b._if:return this.parseIfStatement(i);case b._return:return this.parseReturnStatement(i);case b._switch:return this.parseSwitchStatement(i);case b._throw:return this.parseThrowStatement(i);case b._try:return this.parseTryStatement(i);case b._const:case b._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case b._while:return this.parseWhileStatement(i);case b._with:return this.parseWithStatement(i);case b.braceL:return this.parseBlock(!0,i);case b.semi:return this.parseEmptyStatement(i);case b._export:case b._import:if(this.options.ecmaVersion>10&&r===b._import){E.lastIndex=this.pos;var o=E.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===b._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),e&&this.raise(this.start,`Using declaration is not allowed in single-statement positions`),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===b.name&&d.type===`Identifier`&&this.eat(b.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},H.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type===b.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},H.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},H.parseDoStatement=function(e){return this.next(),this.labels.push(Ee),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(b._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},H.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(Ee),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===b._var||this.type===b._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new Te,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===b._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===b._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},H.parseForAfterInit=function(e,t,n){return(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.type===b._in?(t.kind!==`using`&&t.kind!==`await using`||t.declarations[0].init||this.raise(this.start,`Using declaration is not allowed in for-in loops`),this.options.ecmaVersion>=9&&n>-1&&this.unexpected(n)):this.options.ecmaVersion>=9&&(e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},H.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,ke|(n?0:Ae),!1,t)},H.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(b._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},H.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},H.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(De),this.enterScope(de);for(var t,n=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var r=this.type===b._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},H.parseThrowStatement=function(e){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var Oe=[];H.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?oe:0),this.checkLValPattern(e,t?ve:ge),this.expect(b.parenR),e},H.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();this.next(),this.eat(b.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},H.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},H.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ee),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},H.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},H.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},H.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===b._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},H.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},H.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},H.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},H.parseForIn=function(e,t){var n=this.type===b._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},H.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(b.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==b._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&(!t||this.type!==b._in&&!this.isContextual(`of`))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(b.comma))break}return e},H.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?he:ge,!1)};var ke=1,Ae=2,je=4;H.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===b.star&&t&Ae&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&ke&&(e.id=t&je&&this.type!==b.name?null:this.parseIdent(),e.id&&!(t&Ae)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?he:ge:_e));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(pe(e.async,e.generator)),t&ke||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&ke?`FunctionDeclaration`:`FunctionExpression`)},H.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},H.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(b.braceL);this.type!==b.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Me(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},H.parseClassElement=function(e){if(this.eat(b.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(b.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===b.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===b.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(b.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===b.parenL||o!==`method`||i||a){var l=!n.static&&Ne(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},H.isClassElementNameStart=function(){return this.type===b.name||this.type===b.privateId||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword},H.parseClassElementName=function(e){this.type===b.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},H.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Ne(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},H.parseClassField=function(e){return Ne(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Ne(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(b.eq)?(this.enterScope(ue|se),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},H.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(le|se);this.type!==b.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},H.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,ge,!1)):(t===!0&&this.unexpected(),e.id=null)},H.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts(null,!1):null},H.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},H.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];A(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Me(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function Ne(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}H.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},H.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.parseExportAllDeclaration(e,t);if(this.eat(b._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},H.parseExportDeclaration=function(e){return this.parseStatement(null)},H.parseExportDefaultDeclaration=function(){var e;if(this.type===b._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,ke|je,!1,e)}if(this.type===b._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}var r=this.parseMaybeAssign();return this.semicolon(),r},H.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),A(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},H.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},H.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},H.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},H.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},H.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(b.braceL);!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;t.push(this.parseExportSpecifier(e))}return t},H.parseImport=function(e){return this.next(),this.type===b.string?(e.specifiers=Oe,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===b.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},H.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,ge),this.finishNode(e,`ImportSpecifier`)},H.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,ge),this.finishNode(e,`ImportDefaultSpecifier`)},H.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,ge),this.finishNode(e,`ImportNamespaceSpecifier`)},H.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===b.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(b.comma)))return e;if(this.type===b.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(b.braceL);!this.eat(b.braceR);){if(t)t=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;e.push(this.parseImportSpecifier())}return e},H.parseWithClause=function(){var e=[];if(!this.eat(b._with))return e;this.expect(b.braceL);for(var t={},n=!0;!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;A(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},H.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(b.colon),this.type!==b.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},H.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===b.string){var e=this.parseLiteral(this.value);return F.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},H.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},H.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Pe=be.prototype;Pe.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Pe.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Pe.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Pe.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==b.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Pe.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case b.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(b.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case b.braceL:return this.parseObj(!0)}return this.parseIdent()},Pe.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(b.comma),t&&this.type===b.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===b.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},Pe.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Pe.parseBindingListItem=function(e){return e},Pe.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(b.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Pe.checkLValSimple=function(e,t,n){t===void 0&&(t=me);var r=t!==me;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===ge&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(A(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==ye&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Pe.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=me),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Pe.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=me),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Fe=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},Ie={b_stat:new Fe(`{`,!1),b_expr:new Fe(`{`,!0),b_tmpl:new Fe("${",!1),p_stat:new Fe(`(`,!1),p_expr:new Fe(`(`,!0),q_tmpl:new Fe("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Fe(`function`,!1),f_expr:new Fe(`function`,!0),f_expr_gen:new Fe(`function`,!0,!1,null,!0),f_gen:new Fe(`function`,!1,!1,null,!0)},Le=be.prototype;Le.initialContext=function(){return[Ie.b_stat]},Le.curContext=function(){return this.context[this.context.length-1]},Le.braceIsBlock=function(e){var t=this.curContext();return t===Ie.f_expr||t===Ie.f_stat?!0:e===b.colon&&(t===Ie.b_stat||t===Ie.b_expr)?!t.isExpr:e===b._return||e===b.name&&this.exprAllowed?x.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow?!0:e===b.braceL?t===Ie.b_stat:e===b._var||e===b._const||e===b.name?!1:!this.exprAllowed},Le.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Le.updateContext=function(e){var t,n=this.type;n.keyword&&e===b.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Le.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},b.parenR.updateContext=b.braceR.updateContext=function(){if(this.context.length===1)this.exprAllowed=!0;else{var e=this.context.pop();e===Ie.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr}},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?Ie.b_stat:Ie.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(Ie.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?Ie.p_stat:Ie.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){e.beforeExpr&&e!==b._else&&(e!==b.semi||this.curContext()===Ie.p_stat)&&!(e===b._return&&x.test(this.input.slice(this.lastTokEnd,this.start)))&&(e!==b.colon&&e!==b.braceL||this.curContext()!==Ie.b_stat)?this.context.push(Ie.f_expr):this.context.push(Ie.f_stat),this.exprAllowed=!1},b.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},b.backQuote.updateContext=function(){this.curContext()===Ie.q_tmpl?this.context.pop():this.context.push(Ie.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===Ie.f_expr?this.context[t]=Ie.f_expr_gen:this.context[t]=Ie.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var Re=be.prototype;Re.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6)i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);else{i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}}},Re.parseExpression=function(e,t){var n=this;return this.catchStackOverflow(function(){var r=n.start,i=n.startLoc,a=n.parseMaybeAssign(e,t);if(n.type===b.comma){var o=n.startNodeAt(r,i);for(o.expressions=[a];n.eat(b.comma);)o.expressions.push(n.parseMaybeAssign(e,t));return n.finishNode(o,`SequenceExpression`)}return a})},Re.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Te,r=!0);var s=this.start,c=this.startLoc;(this.type===b.parenL||this.type===b.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===b.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=-1,t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),t.doubleProto>=l.start&&(t.doubleProto=-1)),this.type===b.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}return r&&this.checkExpressionErrors(t,!0),i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},Re.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if((i.type!==`ArrowFunctionExpression`||i.start!==n)&&this.eat(b.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(b.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},Re.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},Re.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==b._in)&&a>r){var o=this.type===b.logicalOR||this.type===b.logicalAND,s=this.type===b.coalesce;s&&(a=b.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===b.coalesce||s&&(this.type===b.logicalOR||this.type===b.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},Re.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},Re.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===b.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&ze(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Be(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===b.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==b._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&(o.type!==`ArrowFunctionExpression`||o.start!==i)&&this.eat(b.starstar)){if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1)}else return o};function ze(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&ze(e.expression)}function Be(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Be(e.expression)||e.type===`ParenthesizedExpression`&&Be(e.expression)}Re.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=-1,a=-1;e&&(i=e.doubleProto,a=e.shorthandAssign,e.doubleProto=e.shorthandAssign=-1);var o=this.parseExprAtom(e,t);if(o.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return o;var s=this.parseSubscripts(o,n,r,!1,t);return e&&(s.end>o.end&&(this.checkExpressionErrors(e,!0),e.parenthesizedAssign>=s.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=s.start&&(e.parenthesizedBind=-1),e.trailingComma>=s.start&&(e.trailingComma=-1)),i>-1&&(e.doubleProto=i),a>-1&&(e.shorthandAssign=a)),s},Re.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s.end===e.end||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s,a=!1}},Re.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(b.arrow)},Re.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},Re.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(b.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(b.bracketL);if(l||c&&this.type!==b.parenL&&this.type!==b.backQuote||this.eat(b.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(b.bracketR)):u.property=this.type===b.privateId&&e.type!==`Super`?this.parsePrivateIdent():this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(b.parenL)){var d=new Te,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===b.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},Re.parseExprAtom=function(e,t,n){this.type===b.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===b.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(r,`Super`);case b._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case b.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(b._function))return this.overrideContext(Ie.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===b.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(b.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case b.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return r=this.startNode(),r.value=this.type===b._null?null:this.type===b._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case b.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case b.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case b.braceL:return this.overrideContext(Ie.b_expr),this.parseObj(!1,e);case b._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},Re.parseExprAtomDefault=function(){this.unexpected()},Re.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===b.parenL&&!e)return this.parseDynamicImport(t);if(this.type===b.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}this.unexpected()},Re.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(b.parenR)?e.options=null:(this.expect(b.comma),this.afterTrailingComma(b.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(b.parenR)||(this.expect(b.comma),this.afterTrailingComma(b.parenR)||this.unexpected())));else if(!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},Re.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},Re.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},Re.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},Re.shouldParseArrow=function(e){return!this.canInsertSemicolon()},Re.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new Te,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;){if(l?l=!1:this.expect(b.comma),a&&this.afterTrailingComma(b.parenR,!0)){u=!0;break}if(this.type===b.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}c.push(this.parseMaybeAssign(!1,d,this.parseParenItem))}var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(b.parenR),e&&this.shouldParseArrow(c)&&this.eat(b.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}return i},Re.parseParenItem=function(e){return e},Re.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Ve=[];Re.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===b.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),e.callee.type===`Super`&&this.raiseRecoverable(r,`Invalid use of 'super'`),e.arguments=this.eat(b.parenL)?this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):Ve,this.finishNode(e,`NewExpression`)},Re.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
13
- `),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
14
- `),cooked:this.value},this.next(),n.tail=this.type===b.backQuote,this.finishNode(n,`TemplateElement`)},Re.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===b.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(b.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(b.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},Re.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===b.name||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===b.star)&&!x.test(this.input.slice(this.lastTokEnd,this.start))},Re.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(b.braceR);){if(r)r=!1;else if(this.expect(b.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(b.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},Re.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(b.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===b.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(b.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(b.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},Re.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},Re.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===b.colon&&this.unexpected(),this.eat(b.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===b.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==b.comma&&this.type!==b.braceR&&this.type!==b.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===b.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},Re.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(b.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(b.bracketR),e.key;e.computed=!1}return e.key=this.type===b.num||this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},Re.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Re.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(pe(t,r.generator)|se|(n?ce:0)),this.expect(b.parenL),r.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},Re.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(pe(n,!1)|V),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},Re.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==b.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,ye),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},Re.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},Re.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,he,t?null:n)}},Re.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(b.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===b.comma?o=null:this.type===b.ellipsis?(o=this.parseSpread(r),r&&this.type===b.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},Re.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&fe)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},Re.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},Re.parseIdentNode=function(){var e=this.startNode();return this.type===b.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,e.name!==`class`&&e.name!==`function`||this.lastTokEnd===this.lastTokStart+1&&this.input.charCodeAt(this.lastTokStart)===46||this.context.pop(),this.type=b.name):this.unexpected(),e},Re.parsePrivateIdent=function(){var e=this.startNode();return this.type===b.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},Re.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===b.semi||this.canInsertSemicolon()||this.type!==b.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(b.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},Re.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var He=be.prototype;He.raise=function(e,t){var n=R(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},He.raiseRecoverable=He.raise,He.curPosition=function(){if(this.options.locations)return new I(this.curLine,this.pos-this.lineStart)};var Ue=be.prototype,We=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};Ue.enterScope=function(e){this.scopeStack.push(new We(e))},Ue.exitScope=function(){this.scopeStack.pop()},Ue.treatFunctionsAsVarInScope=function(e){return e.flags&re||!this.inModule&&e.flags&ne},Ue.declareName=function(e,t,n){var r=!1;if(t===ge){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&ne&&delete this.undefinedExports[e]}else if(t===ve)this.currentScope().lexical.push(e);else if(t===_e){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&oe&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&ne&&delete this.undefinedExports[e],s.flags&fe)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},Ue.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},Ue.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Ue.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(fe|ue|le))return t}},Ue.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(fe|ue|le)&&!(t.flags&V))return t}};var Ge=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new L(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},Ke=be.prototype;Ke.startNode=function(){return new Ge(this,this.start,this.startLoc)},Ke.startNodeAt=function(e,t){return new Ge(this,e,t)};function qe(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}Ke.finishNode=function(e,t){return qe.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},Ke.finishNodeAt=function(e,t,n,r){return qe.call(this,e,t,n,r)},Ke.copyNode=function(e){var t=new Ge(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var Je=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,Ye=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,Xe=Ye+` Extended_Pictographic`,Ze=Xe,Qe=Ze+` EBase EComp EMod EPres ExtPict`,$e=Qe,et={9:Ye,10:Xe,11:Ze,12:Qe,13:$e,14:$e},tt={9:``,10:``,11:``,12:``,13:``,14:`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`},nt=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,rt=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,it=rt+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,at=it+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,ot=at+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,st=ot+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,ct={9:rt,10:it,11:at,12:ot,13:st,14:st+` `+Je},lt={};function ut(e){var t=lt[e]={binary:N(et[e]+` `+nt),binaryOfStrings:N(tt[e]),nonBinary:{General_Category:N(nt),Script:N(ct[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var dt=0,ft=[9,10,11,12,13,14];dt<ft.length;dt+=1){var pt=ft[dt];ut(pt)}var U=be.prototype,mt=function(e,t){this.parent=e,this.base=t||this};mt.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},mt.prototype.sibling=function(){return new mt(this.parent,this.base)};var ht=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=lt[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};ht.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},ht.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},ht.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},ht.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},ht.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},ht.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},ht.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},ht.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e&&(this.advance(t),!0)},ht.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},U.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function gt(e){for(var t in e)return!0;return!1}U.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&gt(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},U.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},U.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new mt(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},U.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},U.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},U.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},U.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},U.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},U.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},U.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},U.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},U.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},U.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},U.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&_t(n);)t+=P(n),e.advance();return t};function _t(e){return e===105||e===109||e===115}U.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},U.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},U.regexp_eatSyntaxCharacter=function(e){var t=e.current();return vt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function vt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}U.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!vt(n);)e.advance();return e.pos!==t},U.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124&&(e.advance(),!0)},U.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n){if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`)}t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},U.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},U.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=P(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=P(e.lastIntValue);return!0}return!1},U.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),yt(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function yt(e){return f(e,!0)||e===36||e===95}U.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),bt(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function bt(e){return p(e,!0)||e===36||e===95||e===8204||e===8205}U.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},U.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},U.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},U.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},U.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},U.regexp_eatZero=function(e){return e.current()===48&&!Mt(e.lookahead())&&(e.lastIntValue=0,e.advance(),!0)},U.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114&&(e.lastIntValue=13,e.advance(),!0)},U.regexp_eatControlLetter=function(e){var t=e.current();return xt(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function xt(e){return e>=65&&e<=90||e>=97&&e<=122}U.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&St(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function St(e){return e>=0&&e<=1114111}U.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)&&(e.lastIntValue=t,e.advance(),!0)},U.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var Ct=0,wt=1,Tt=2;U.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Et(t))return e.lastIntValue=-1,e.advance(),wt;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===Tt&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return Ct};function Et(e){return e===100||e===68||e===115||e===83||e===119||e===87}U.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),wt}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return Ct},U.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){A(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},U.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return wt;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return Tt;e.raise(`Invalid property name`)},U.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;Dt(t=e.current());)e.lastStringValue+=P(t),e.advance();return e.lastStringValue!==``};function Dt(e){return xt(e)||e===95}U.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;Ot(t=e.current());)e.lastStringValue+=P(t),e.advance();return e.lastStringValue!==``};function Ot(e){return Dt(e)||Mt(e)}U.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},U.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===Tt&&e.raise(`Negated character class may contain strings`),!0}return!1},U.regexp_classContents=function(e){return e.current()===93?wt:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),wt)},U.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},U.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||Ft(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r!==93&&(e.lastIntValue=r,e.advance(),!0)},U.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},U.regexp_classSetExpression=function(e){var t=wt,n;if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e)){n===Tt&&(t=Tt);for(var r=e.pos;e.eatChars([38,38]);)e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))?n!==Tt&&(t=wt):e.raise(`Invalid character in character class`);if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`)}for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===Tt&&(t=Tt)}},U.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},U.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?wt:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},U.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===Tt&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},U.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},U.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===Tt&&(t=Tt);return t},U.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?wt:Tt},U.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&kt(n)||At(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function kt(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function At(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}U.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return jt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function jt(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}U.regexp_eatClassControlLetter=function(e){var t=e.current();return Mt(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},U.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},U.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Mt(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function Mt(e){return e>=48&&e<=57}U.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;Nt(n=e.current());)e.lastIntValue=16*e.lastIntValue+Pt(n),e.advance();return e.pos!==t};function Nt(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Pt(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}U.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;e.lastIntValue=t<=3&&this.regexp_eatOctalDigit(e)?t*64+n*8+e.lastIntValue:t*8+n}else e.lastIntValue=t;return!0}return!1},U.regexp_eatOctalDigit=function(e){var t=e.current();return Ft(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function Ft(e){return e>=48&&e<=55}U.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!Nt(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+Pt(i),e.advance()}return!0};var It=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new L(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},Lt=be.prototype;Lt.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new It(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},Lt.getToken=function(){return this.next(),new It(this)},typeof Symbol<`u`&&(Lt[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===b.eof,value:t}}}}),Lt.nextToken=function(){var e=this.curContext();if(e&&e.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(b.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},Lt.readToken=function(e){return f(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},Lt.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},Lt.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},Lt.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=w(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},Lt.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!C(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},Lt.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&T.test(String.fromCharCode(e)))++this.pos;else break loop}}},Lt.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},Lt.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(b.ellipsis)):(++this.pos,this.finishToken(b.dot))},Lt.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(b.assign,2):this.finishOp(b.slash,1)},Lt.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?b.star:b.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=b.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(b.assign,n+1):this.finishOp(r,n)},Lt.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(e===124?b.logicalOR:b.logicalAND,2):t===61?this.finishOp(b.assign,2):this.finishOp(e===124?b.bitwiseOR:b.bitwiseAND,1)},Lt.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(b.assign,2):this.finishOp(b.bitwiseXOR,1)},Lt.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||x.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(b.incDec,2):t===61?this.finishOp(b.assign,2):this.finishOp(b.plusMin,1)},Lt.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(b.assign,n+1):this.finishOp(b.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(b.relational,n))},Lt.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(b.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(b.arrow)):this.finishOp(e===61?b.eq:b.prefix,1)},Lt.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(b.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(b.assign,3):this.finishOp(b.coalesce,2)}return this.finishOp(b.question,1)},Lt.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),f(t,!0)||t===92))return this.finishToken(b.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+P(t)+`'`)},Lt.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(b.parenL);case 41:return++this.pos,this.finishToken(b.parenR);case 59:return++this.pos,this.finishToken(b.semi);case 44:return++this.pos,this.finishToken(b.comma);case 91:return++this.pos,this.finishToken(b.bracketL);case 93:return++this.pos,this.finishToken(b.bracketR);case 123:return++this.pos,this.finishToken(b.braceL);case 125:return++this.pos,this.finishToken(b.braceR);case 58:return++this.pos,this.finishToken(b.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(b.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(b.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+P(e)+`'`)},Lt.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},Lt.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(x.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new ht(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(b.regexp,{pattern:i,flags:o,value:c})},Lt.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95)i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;else{if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Rt(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function zt(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}Lt.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=zt(this.input.slice(t,this.pos)),++this.pos):f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,n)},Lt.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=zt(this.input.slice(t,this.pos));return++this.pos,f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(b.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),r!==69&&r!==101||n||(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),f(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=Rt(this.input.slice(t,this.pos),n);return this.finishToken(b.num,a)},Lt.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},Lt.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(C(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(b.string,t)};var Bt={};Lt.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Bt)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},Lt.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Bt;this.raise(e,t)},Lt.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===b.template||this.type===b.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(b.dollarBraceL)):(++this.pos,this.finishToken(b.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(b.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(C(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
15
- `;break;default:e+=String.fromCharCode(n)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},Lt.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(b.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
16
- `&&++this.pos;case`
17
- `:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,`Unterminated template`)},Lt.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
18
- `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return P(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return C(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},Lt.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},Lt.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(p(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?f:p)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=P(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},Lt.readWord=function(){var e=this.readWord1(),t=b.name;return this.keywords.test(e)&&(t=v[e]),this.finishToken(t,e)};var Vt=`8.19.0`;be.acorn={Parser:be,version:Vt,defaultOptions:z,Position:I,SourceLocation:L,getLineInfo:R,Node:Ge,TokenType:m,tokTypes:b,keywordTypes:v,TokContext:Fe,tokContexts:Ie,isIdentifierChar:p,isIdentifierStart:f,Token:It,isNewLine:C,lineBreak:x,lineBreakG:S,nonASCIIwhitespace:T};function Ht(e,t){return be.parse(e,t)}function Ut(e,t,n){return be.parseExpressionAt(e,t,n)}function Wt(e,t){return be.tokenizer(e,t)}e.Node=Ge,e.Parser=be,e.Position=I,e.SourceLocation=L,e.TokContext=Fe,e.Token=It,e.TokenType=m,e.defaultOptions=z,e.getLineInfo=R,e.isIdentifierChar=p,e.isIdentifierStart=f,e.isNewLine=C,e.keywordTypes=v,e.lineBreak=x,e.lineBreakG=S,e.nonASCIIwhitespace=T,e.parse=Ht,e.parseExpressionAt=Ut,e.tokContexts=Ie,e.tokTypes=b,e.tokenizer=Wt,e.version=Vt}))})),Jl=t(((e,t)=>{var n=Kl(),r=/^[\da-fA-F]+$/,i=/^\d+$/,a=new WeakMap;function o(e){e=e.Parser.acorn||e;let t=a.get(e);if(!t){let n=e.tokTypes,r=e.TokContext,i=e.TokenType,o=new r(`<tag`,!1),s=new r(`</tag`,!1),c=new r(`<tag>...</tag>`,!0,!0),l={tc_oTag:o,tc_cTag:s,tc_expr:c},u={jsxName:new i(`jsxName`),jsxText:new i(`jsxText`,{beforeExpr:!0}),jsxTagStart:new i(`jsxTagStart`,{startsExpr:!0}),jsxTagEnd:new i(`jsxTagEnd`)};u.jsxTagStart.updateContext=function(){this.context.push(c),this.context.push(o),this.exprAllowed=!1},u.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===o&&e===n.slash||t===s?(this.context.pop(),this.exprAllowed=this.curContext()===c):this.exprAllowed=!0},t={tokContexts:l,tokTypes:u},a.set(e,t)}return t}function s(e){if(!e)return e;if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return s(e.object)+`.`+s(e.property)}t.exports=function(e){return e||={},function(t){return c({allowNamespaces:e.allowNamespaces!==!1,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}},Object.defineProperty(t.exports,"tokTypes",{get:function(){return o(ql()).tokTypes},configurable:!0,enumerable:!0});function c(e,t){let a=t.acorn||ql(),c=o(a),l=a.tokTypes,u=c.tokTypes,d=a.tokContexts,f=c.tokContexts.tc_oTag,p=c.tokContexts.tc_cTag,m=c.tokContexts.tc_expr,h=a.isNewLine,g=a.isIdentifierStart,_=a.isIdentifierChar;return class extends t{static get acornJsx(){return c}jsx_readToken(){let e=``,t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated JSX contents`);let n=this.input.charCodeAt(this.pos);switch(n){case 60:case 123:return this.pos===this.start?n===60&&this.exprAllowed?(++this.pos,this.finishToken(u.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.pos),this.finishToken(u.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(n===62?`&gt;`:`&rbrace;`)+'` or `{"'+this.input[this.pos]+'"}`?');default:h(n)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t=this.input.charCodeAt(this.pos),n;return++this.pos,t===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,n=e?`
19
- `:`\r
20
- `):n=String.fromCharCode(t),this.options.locations&&(++this.curLine,this.lineStart=this.pos),n}jsx_readString(e){let t=``,n=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);let r=this.input.charCodeAt(this.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):h(r)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!1),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(l.string,t)}jsx_readEntity(){let e=``,t=0,a,o=this.input[this.pos];o!==`&`&&this.raise(this.pos,`Entity must start with an ampersand`);let s=++this.pos;for(;this.pos<this.input.length&&t++<10;){if(o=this.input[this.pos++],o===`;`){e[0]===`#`?e[1]===`x`?(e=e.substr(2),r.test(e)&&(a=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),i.test(e)&&(a=String.fromCharCode(parseInt(e,10)))):a=n[e];break}e+=o}return a||(this.pos=s,`&`)}jsx_readWord(){let e,t=this.pos;do e=this.input.charCodeAt(++this.pos);while(_(e)||e===45);return this.finishToken(u.jsxName,this.input.slice(t,this.pos))}jsx_parseIdentifier(){let e=this.startNode();return this.type===u.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsx_parseNamespacedName(){let t=this.start,n=this.startLoc,r=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(l.colon))return r;var i=this.startNodeAt(t,n);return i.namespace=r,i.name=this.jsx_parseIdentifier(),this.finishNode(i,`JSXNamespacedName`)}jsx_parseElementName(){if(this.type===u.jsxTagEnd)return``;let t=this.start,n=this.startLoc,r=this.jsx_parseNamespacedName();for(this.type===l.dot&&r.type===`JSXNamespacedName`&&!e.allowNamespacedObjects&&this.unexpected();this.eat(l.dot);){let e=this.startNodeAt(t,n);e.object=r,e.property=this.jsx_parseIdentifier(),r=this.finishNode(e,`JSXMemberExpression`)}return r}jsx_parseAttributeValue(){switch(this.type){case l.braceL:let e=this.jsx_parseExpressionContainer();return e.expression.type===`JSXEmptyExpression`&&this.raise(e.start,`JSX attributes must only be assigned a non-empty expression`),e;case u.jsxTagStart:case l.string:return this.parseExprAtom();default:this.raise(this.start,`JSX value should be either an expression or a quoted JSX text`)}}jsx_parseEmptyExpression(){let e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.start,this.startLoc)}jsx_parseExpressionContainer(){let e=this.startNode();return this.next(),e.expression=this.type===l.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(l.braceR),this.finishNode(e,`JSXExpressionContainer`)}jsx_parseAttribute(){let e=this.startNode();return this.eat(l.braceL)?(this.expect(l.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(l.braceR),this.finishNode(e,`JSXSpreadAttribute`)):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(l.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,`JSXAttribute`))}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t);n.attributes=[];let r=this.jsx_parseElementName();for(r&&(n.name=r);this.type!==l.slash&&this.type!==u.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(l.slash),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXOpeningElement`:`JSXOpeningFragment`)}jsx_parseClosingElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();return r&&(n.name=r),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXClosingElement`:`JSXClosingFragment`)}jsx_parseElementAt(e,t){let n=this.startNodeAt(e,t),r=[],i=this.jsx_parseOpeningElementAt(e,t),a=null;if(!i.selfClosing){contents:for(;;)switch(this.type){case u.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(l.slash)){a=this.jsx_parseClosingElementAt(e,t);break contents}r.push(this.jsx_parseElementAt(e,t));break;case u.jsxText:r.push(this.parseExprAtom());break;case l.braceL:r.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}s(a.name)!==s(i.name)&&this.raise(a.start,`Expected corresponding JSX closing tag for <`+s(i.name)+`>`)}let o=i.name?`Element`:`Fragment`;return n[`opening`+o]=i,n[`closing`+o]=a,n.children=r,this.type===l.relational&&this.value===`<`&&this.raise(this.start,`Adjacent JSX elements must be wrapped in an enclosing tag`),this.finishNode(n,`JSX`+o)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type=`JSXText`,e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}parseExprAtom(e){return this.type===u.jsxText?this.jsx_parseText():this.type===u.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(e)}readToken(e){let t=this.curContext();if(t===m)return this.jsx_readToken();if(t===f||t===p){if(g(e))return this.jsx_readWord();if(e==62)return++this.pos,this.finishToken(u.jsxTagEnd);if((e===34||e===39)&&t==f)return this.jsx_readString(e)}return e===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(u.jsxTagStart)):super.readToken(e)}updateContext(e){if(this.type==l.braceL){var t=this.curContext();t==f?this.context.push(d.b_expr):t==m?this.context.push(d.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else if(this.type===l.slash&&e===u.jsxTagStart)this.context.length-=2,this.context.push(p),this.exprAllowed=!1;else return super.updateContext(e)}}}}));function Yl(e){return e}var Xl={}.hasOwnProperty,Zl=Symbol(`continue`),Ql=Symbol(`exit`),$l=Symbol(`skip`);function eu(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return nu(e)&&(s.displayName=`node (`+Yl(e.type)+`)`),s;function s(){let s=n?tu(n(e,t,a,o)):[];if(s[0]===Ql)return s;if(s[0]!==$l){let t;for(t in e)if(Xl.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(nu(r)){let e=i(r,t,a,n)();if(e[0]===Ql)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(nu(r)){let e=i(r,t,void 0,n)();if(e[0]===Ql)return e}}}return r?tu(r(e,t,a,o)):s}}}function tu(e){return Array.isArray(e)?e:typeof e==`number`?[Zl,e]:[e]}function nu(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function ru(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=au(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&iu(m);if(g&&!t.allowEmpty)throw new Zt(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g){if(iu(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}}if(u){if(u.comments=a,eu(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=ou(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function iu(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function au(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=su(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function ou(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function su(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
21
- `;break;case-3:a=`\r
22
- `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function cu(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=lu(n.start,r[0]||t.start),a=lu(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function lu(e,t){if(e&&typeof e==`object`){let n=`line`in e?uu(e.line):void 0,r=`column`in e?uu(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:uu(t)}}}function uu(e){return typeof e==`number`&&e>-1?e:void 0}var du=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,fu=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,pu=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,mu=`#unexpected-type-in-code-expected-an-object-spread-spread`,hu=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,gu=`#could-not-parse-expression-with-acorn`;function _u(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new Zt("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=du+fu,e}if(Kn(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?vu.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||Kn(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new Zt("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=du+pu,e}return Gn(t)?$n(e,_,`linePrefix`,3)(t):_(t)}}function vu(e,t,n,r,i,a,o){let s=ru(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=cu(e),n=new Zt("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=du+mu,n}if(e.expression.properties[1]){let t=cu(e.expression.properties[1]),n=new Zt(`Unexpected extra content in spread: only a single spread is supported`,{place:t.start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw n.url=du+hu,n}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=cu(e.expression.properties[0]),n=new Zt("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=du+mu,n}}if(s.error){let e=new Zt(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=du+gu,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function yu(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return _u.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return Gn(t)?$n(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||Kn(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return _u.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var bu=`https://github.com/micromark/micromark-extension-mdx-jsx`;function xu(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j){let M=this,N,P;return F;function F(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),I}function I(e){return Un(e)?n(e):(N=L,ve(e))}function L(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),N=R,ve;if(t===62)return _e(t);if(t!==null&&t>=0&&en(t))return e.enter(d),e.enter(f),e.consume(t),z;xe(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function R(t){if(t===62)return _e(t);if(t!==null&&t>=0&&en(t))return e.enter(d),e.enter(f),e.consume(t),z;xe(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function z(t){if(t!==null&&t>=0&&Yt(t,{jsx:!0}))return e.consume(t),z;if(t===46||t===47||t===58||t===62||t===123||Un(t)||qn(t))return e.exit(f),N=B,ve(t);xe(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function B(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=ee,ve;if(t===58)return e.enter(h),e.consume(t),e.exit(h),N=re,ve;if(t===47||t===62||t===123||t!==null&&t>=0&&en(t))return e.exit(d),V(t);xe(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ee(t){if(t!==null&&t>=0&&en(t))return e.enter(m),e.consume(t),te;xe(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function te(t){if(t!==null&&t>=0&&Yt(t,{jsx:!0}))return e.consume(t),te;if(t===46||t===47||t===62||t===123||Un(t)||qn(t))return e.exit(m),N=ne,ve(t);xe(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ne(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),N=ee,ve;if(t===47||t===62||t===123||t!==null&&t>=0&&en(t))return e.exit(d),V(t);xe(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function re(t){if(t!==null&&t>=0&&en(t))return e.enter(g),e.consume(t),ie;xe(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function ie(t){if(t!==null&&t>=0&&Yt(t,{jsx:!0}))return e.consume(t),ie;if(t===47||t===62||t===123||Un(t)||qn(t))return e.exit(g),N=ae,ve(t);xe(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ae(t){if(t===47||t===62||t===123||t!==null&&t>=0&&en(t))return e.exit(d),V(t);xe(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function V(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),N=ge,ve;if(t===62)return _e(t);if(t===123)return _u.call(M,e,oe,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&en(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),se;xe(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function oe(e){return N=V,ve(e)}function se(t){if(t!==null&&t>=0&&Yt(t,{jsx:!0}))return e.consume(t),se;if(t===47||t===58||t===61||t===62||t===123||Un(t)||qn(t))return e.exit(S),N=ce,ve(t);xe(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function ce(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),N=le,ve;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),N=fe,ve;if(t===47||t===62||t===123||Un(t)||qn(t)||t!==null&&t>=0&&en(t))return e.exit(x),e.exit(b),N=V,ve(t);xe(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function le(t){if(t!==null&&t>=0&&en(t))return e.enter(w),e.consume(t),ue;xe(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ue(t){if(t!==null&&t>=0&&Yt(t,{jsx:!0}))return e.consume(t),ue;if(t===47||t===61||t===62||t===123||Un(t)||qn(t))return e.exit(w),e.exit(x),N=de,ve(t);xe(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function de(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),N=fe,ve;if(t===47||t===62||t===123||t!==null&&t>=0&&en(t))return e.exit(b),V(t);xe(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function fe(t){if(t===34||t===39)return e.enter(E),e.enter(D),e.consume(t),e.exit(D),P=t,me;if(t===123)return _u.call(M,e,pe,k,A,j,r,i,a,!1,!1,o)(t);xe(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function pe(t){return e.exit(b),N=V,ve(t)}function me(t){return t===null&&xe(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(P)+"`"),t===P?(e.enter(D),e.consume(t),e.exit(D),e.exit(E),e.exit(b),P=void 0,N=V,ve):Kn(t)?(N=me,ve(t)):(e.enter(O),he(t))}function he(t){return t===null||t===P||Kn(t)?(e.exit(O),me(t)):(e.consume(t),he)}function ge(e){if(e===62)return _e(e);xe(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function _e(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function ve(t){return Kn(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),be):Gn(t)||qn(t)?(e.enter(`esWhitespace`),ye(t)):N(t)}function ye(t){return Kn(t)?(e.exit(`esWhitespace`),ve(t)):Gn(t)||qn(t)?(e.consume(t),ye):(e.exit(`esWhitespace`),N(t))}function be(e){if(!o&&M.parser.lazy[M.now().line]){let e=new Zt("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",M.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=bu+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return ve(e)}function xe(e,t,n){let r=new Zt(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+Su(e)+`)`)+` `+t+`, expected `+n,M.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=bu+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function Su(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function Cu(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return xu.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function wu(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return xu.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return Gn(e)?$n(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||Kn(e)?r(e):i(e)}}}function Tu(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:wu(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:Cu(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}var Eu=e(Jl(),1);function Du(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}var Ou={tokenize:Mu,partial:!0},ku=`https://github.com/micromark/micromark-extension-mdxjs-esm`,Au=new Set([`ExportAllDeclaration`,`ExportDefaultDeclaration`,`ExportNamedDeclaration`,`ImportDeclaration`]);function ju(e){let t={tokenize:i,concrete:!0};if(!e||!e.acorn||!e.acorn.parse)throw Error("Expected an `acorn` instance passed in as `options.acorn`");let n=e.acorn,r=Object.assign({ecmaVersion:2024,sourceType:`module`},e.acornOptions,{locations:!0});return{flow:{101:t,105:t}};function i(t,i,a){let o=this,s=o.parser.definedModuleSpecifiers||(o.parser.definedModuleSpecifiers=[]),c=this.events.length+1,l=``;return o.interrupt?a:u;function u(e){return o.now().column>1?a(e):(t.enter(`mdxjsEsm`),t.enter(`mdxjsEsmData`),t.consume(e),l+=String.fromCharCode(e),d)}function d(e){return zn(e)?(t.consume(e),l+=String.fromCharCode(e),d):(l===`import`||l===`export`)&&e===32?(t.consume(e),f):a(e)}function f(e){return e===null||Kn(e)?(t.exit(`mdxjsEsmData`),p(e)):(t.consume(e),f)}function p(e){return e===null?h(e):Kn(e)?t.check(Ou,h,m)(e):(t.enter(`mdxjsEsmData`),f(e))}function m(e){return t.enter(`lineEnding`),t.consume(e),t.exit(`lineEnding`),p}function h(a){let l=ru(o.events.slice(c),{acorn:n,acornOptions:r,tokenTypes:[`mdxjsEsmData`],prefix:s.length>0?`var `+s.join(`,`)+`
23
- `:``});if(l.error){if(a!==null&&l.swallow)return m(a);let e=new Zt(`Could not parse import/exports with acorn`,{cause:l.error,place:{line:l.error.loc.line,column:l.error.loc.column+1,offset:l.error.pos},ruleId:`acorn`,source:`micromark-extension-mdxjs-esm`});throw e.url=ku+`#could-not-parse-importexports-with-acorn`,e}s.length>0&&l.estree.body.shift();let u=-1;for(;++u<l.estree.body.length;){let e=l.estree.body[u];if(!Au.has(e.type)){let t=new Zt("Unexpected `"+e.type+"` in code: only import/exports are supported",{place:cu(e),ruleId:`non-esm`,source:`micromark-extension-mdxjs-esm`});throw t.url=ku+`#unexpected-type-in-code-only-importexports-are-supported`,t}if(e.type===`ImportDeclaration`&&!o.interrupt){let t=-1;for(;++t<e.specifiers.length;){let n=e.specifiers[t];s.push(n.local.name)}}}return Object.assign(t.exit(`mdxjsEsm`),e.addResult?{estree:l.estree}:void 0),i(a)}}}function Mu(e,t,n){return r;function r(r){return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),e.attempt(Hn,t,n)}}function Nu(e){let t=Object.assign({acorn:Tc.extend((0,Eu.default)()),acornOptions:{ecmaVersion:2024,sourceType:`module`},addResult:!0},e);return ir([ju(t),yu(t),Tu(t),Du()])}var Pu=`Block`,Fu=`Callout`,Iu=`Table`,Lu=`Component`,Ru=[`of`,`width`,`height`,`at`,`alt`,`title`,`align`,`id`],zu=`PageBreak`,Bu=`Card`,Vu=`Stats`,Hu=`Stat`,Uu=[`label`,`value`,`delta`,`note`,`down-is-good`,`trend`],Wu=`Columns`,Gu=`Column`,Ku=`Chart`,qu=[`type`,`title`,`data`,`categories`,`series`,`legend`,`labels`,`format`,`min`,`max`,`colors`,`smooth`,`width`,`height`,`alt`,`id`],Ju=`Bibliography`,Yu=`TableOfContents`,Xu=e=>e.split(`,`).map(e=>e.trim()).filter(e=>e!==``),Zu=new Set([`center`,`right`,`justify`]),Qu=(e,t)=>{let n=t.position?.start.offset,r=t.position?.end.offset;return n===void 0||r===void 0?``:e.source.slice(n,r)};function $u(e,t,n){let r=t.position?.start;e.problems.push({message:n,...r?{line:r.line,column:r.column}:{}})}var ed=(e,t)=>e.bold===t.bold&&e.italic===t.italic&&e.underline===t.underline&&e.strike===t.strike&&e.code===t.code&&e.color===t.color&&e.background===t.background&&e.tag===t.tag;function td(e,t,n,r){if(t===``)return;let i=e.at(-1);i&&i.note===void 0&&i.cite===void 0&&i.href===r&&ed(i.styles,n)?i.text+=t:e.push({text:t,styles:{...n},...r===void 0?{}:{href:r}})}function nd(e,t,n){let r=new Map;for(let i of t.attributes)i.type!==`mdxJsxAttribute`||!n.includes(i.name)?$u(e,t,`<${t.name??``}> takes ${n.join(`, `)}: ${i.type===`mdxJsxAttribute`?i.name:`{…}`} is not one of them`):i.value===null||i.value===void 0?r.set(i.name,``):typeof i.value==`string`?r.set(i.name,i.value):$u(e,t,`${i.name} of <${t.name??``}> is a plain string`);return r}function rd(e,t,n){switch(t.name){case`u`:return{...n,underline:!0};case`strong`:case`b`:return{...n,bold:!0};case`em`:case`i`:return{...n,italic:!0};case`del`:case`s`:return{...n,strike:!0};case`code`:return{...n,code:!0};case`Tag`:{let r=nd(e,t,[`color`]).get(`color`);return{...n,tag:r===void 0||r===``?`gray`:r}}case`span`:{let r=nd(e,t,[`color`,`bg`]),i=r.get(`color`),a=r.get(`bg`);return{...n,...i?{color:i}:{},...a?{background:a}:{}}}default:return}}function id(e,t,n,r,i){for(let a of t)switch(a.type){case`text`:for(let[,t]of a.value.matchAll(/\[\^([^\]\s]+)\]/gu))$u(e,a,`the footnote [^${t??``}] has no note: write [^${t??``}]: … on a line of its own`);for(let e of a.value.replace(/\r?\n/g,` `).split(/(\[-?@[^\]]+\])/u)){if(e===``)continue;let t=/^\[(-?@[^\]]+)\]$/u.exec(e)?.[1];t!==void 0&&pi(t).keys.length>0?i.push({text:e,styles:{...n},cite:t}):td(i,e,n,r)}break;case`strong`:id(e,a.children,{...n,bold:!0},r,i);break;case`emphasis`:id(e,a.children,{...n,italic:!0},r,i);break;case`delete`:id(e,a.children,{...n,strike:!0},r,i);break;case`inlineCode`:td(i,a.value,{...n,code:!0},r);break;case`break`:td(i,`
24
- `,n,r);break;case`link`:a.children.length===0?i.push({text:``,styles:{...n},href:a.url}):id(e,a.children,n,a.url,i);break;case`footnoteReference`:{let e=a.label??a.identifier;i.push({text:e,styles:{...n},...r===void 0?{}:{href:r},note:e});break}case`mdxJsxTextElement`:{if(a.name===`br`){td(i,`
25
- `,n,r);break}let t=rd(e,a,n);if(t){id(e,a.children,t,r,i);break}$u(e,a,`<${a.name??``}> inside a line is not drawn: a tag the doc's code draws goes on lines of its own`),td(i,Qu(e,a),n,r);break}case`mdxTextExpression`:$u(e,a,`{…} in a line is not drawn: write \\{ for a brace`),td(i,Qu(e,a),n,r);break;default:$u(e,a,`${a.type} is not drawn in a doc`),td(i,Qu(e,a),n,r)}}function ad(e,t){let n=[];return id(e,t,{},void 0,n),n}var od=e=>e?.type===`mdxJsxFlowElement`&&e.name===`br`&&e.children.length===0;function sd(e,t){let[n,...r]=t;if(n?.type===`paragraph`){let t=ad(e,n.children);return{content:t.length===1&&t[0]?.text===`
26
- `&&Object.keys(t[0].styles).length===0?[]:t,under:Cd(e,r)}}return od(n)?{content:[],under:Cd(e,r)}:{content:[],under:Cd(e,t)}}var cd=(e,t)=>t.length>0?{...e,children:t}:e;function ld(e,t,n,r){let{content:i,under:a}=sd(e,t.children);return typeof t.checked==`boolean`?cd({type:`check`,checked:t.checked,content:i},a):cd(n?{type:`numbered`,...r===void 0||r===1?{}:{start:r},content:i}:{type:`bullet`,content:i},a)}function ud(e,t){return t.children.map(t=>ad(e,t.children))}function dd(e,t){return t?{[e]:t}:{}}function fd(e,t){let n=nd(e,t,[`align`,`color`,`bg`,`toggle`]),r=Cd(e,t.children),[i,...a]=r;if(i===void 0)return $u(e,t,`<${Pu}> holds a block: this one is empty`),[];if(i.type===`embed`||i.type===`source`)return $u(e,t,`<${Pu}> holds a block of the doc's own, not a tag or an import`),r;let o=n.get(`align`);o!==void 0&&!Zu.has(o)&&$u(e,t,`align is center, right or justify, not "${o}"`);let s={...o!==void 0&&Zu.has(o)?{align:o}:{},...dd(`color`,n.get(`color`)),...dd(`background`,n.get(`bg`))},c=i;if(n.has(`toggle`)&&(c.type===`heading`?c={...c,toggle:!0}:c.type===`paragraph`?c={type:`toggle`,content:c.content}:$u(e,t,`toggle is for a heading or a line of text`)),Object.keys(s).length>0&&(`content`in c?c={...c,look:s}:$u(e,t,`a ${c.type} has no look to set`)),a.length>0){if(`content`in c)c={...c,children:[...c.children??[],...a]};else return $u(e,t,`a ${c.type} holds no blocks under it`),[c,...a]}return[c]}function pd(e,t){let n=nd(e,t,[`icon`,`color`,`bg`]),{content:r,under:i}=sd(e,t.children),a={...dd(`color`,n.get(`color`)),...dd(`background`,n.get(`bg`))};return[cd({type:`callout`,...dd(`icon`,n.get(`icon`)),...Object.keys(a).length>0?{look:a}:{},content:r},i)]}function md(e,t){let n=nd(e,t,[`title`,`subtitle`]),r=Cd(e,t.children);return[cd({type:`card`,...dd(`title`,n.get(`title`)),...dd(`subtitle`,n.get(`subtitle`))},r)]}function hd(e,t){nd(e,t,[]);let n=[];for(let r of t.children){if(r.type!==`mdxJsxFlowElement`||r.name!==`Stat`||r.children.length>0)return $u(e,r,`<${Vu}> holds <${Hu} label="…" value="…" />s, one to a line`),[];let t=nd(e,r,Uu),i=t.get(`label`),a=t.get(`value`);if(a===void 0||i===void 0)return $u(e,r,`a <${Hu}> has a label and a value`),[];let o=t.get(`trend`),s=o?.split(`,`).map(e=>Number(e.trim()));if(s!==void 0&&!s.every(e=>Number.isFinite(e)))return $u(e,r,`a stat's trend is numbers, oldest first, comma-separated ("12,15,14,19"), not "${o??``}"`),[];n.push({label:i,value:a,...dd(`delta`,t.get(`delta`)),...dd(`note`,t.get(`note`)),...t.has(`down-is-good`)&&t.get(`down-is-good`)!==`false`?{downIsGood:!0}:{},...s===void 0||s.length<2?{}:{trend:s}})}return n.length===0?($u(e,t,`<${Vu}> holds one <${Hu} /> or more`),[]):[{type:`stats`,stats:n}]}function gd(e,t){let n=nd(e,t,[`src`,`alt`,`title`,`width`,`align`,`id`]),r=n.get(`src`);if(!r)return $u(e,t,`<img> names its picture: src is missing`),[];let i=Number(n.get(`width`)),a=n.get(`align`);return a!==void 0&&a!==`center`&&a!==`right`&&$u(e,t,`a picture's align is center or right, not "${a}"`),[{type:`image`,src:r,...dd(`alt`,n.get(`alt`)),...dd(`caption`,n.get(`title`)),...Number.isFinite(i)&&i>0?{width:Math.round(i)}:{},...a===`center`||a===`right`?{align:a}:{},...dd(`id`,n.get(`id`))}]}function _d(e,t){if(t.children.length>0)return $u(e,t,`<${Lu}> holds nothing: its props are its attributes`),[];let n=new Map,r={};for(let i of t.attributes){if(i.type!==`mdxJsxAttribute`){$u(e,t,`<${Lu}>'s attributes are plain strings, not {…}`);continue}let a=i.value===null||i.value===void 0?``:typeof i.value==`string`?i.value:void 0;a===void 0?$u(e,t,`${i.name} of <${Lu}> is a plain string`):Ru.includes(i.name)?n.set(i.name,a):r[i.name]=a}let i=n.get(`of`)??``;if(i.trim()===``)return $u(e,t,`<${Lu}> names its component: of is missing (of="../ui.ts#Dialog")`),[];let a=r=>{let i=n.get(r);if(i===void 0)return;let a=Number(i);if(Number.isFinite(a)&&a>0)return Math.round(a);$u(e,t,`${r} of <${Lu}> is a number of pixels, not "${i}"`)},o=a(`width`),s=a(`height`),c=n.get(`at`),l=c===void 0?void 0:Number(c);l!==void 0&&!(Number.isFinite(l)&&l>=0)&&$u(e,t,`at of <${Lu}> is seconds, 0 or more, not "${c??``}"`);let u=n.get(`align`);return u!==void 0&&u!==`center`&&u!==`right`&&$u(e,t,`a component's align is center or right, not "${u}"`),[{type:`component`,of:i,...o===void 0?{}:{width:o},...s===void 0?{}:{height:s},...l!==void 0&&Number.isFinite(l)&&l>=0?{at:l}:{},...dd(`alt`,n.get(`alt`)),...dd(`caption`,n.get(`title`)),...u===`center`||u===`right`?{align:u}:{},...dd(`id`,n.get(`id`)),props:r}]}function vd(e,t){let n=nd(e,t,qu),r=n=>{$u(e,t,n)},i=n.get(`type`);if(i===void 0||i===``)return r(`<${Ku}> says what it is drawn as: type is missing (${Ce.join(`, `)})`),[];if(!Ce.includes(i))return r(`a chart's type is ${Ce.join(`, `)}, not "${i}"`),[];let[a,...o]=t.children;if(o.length>0||a!==void 0&&a.type!==`table`)return r(`<${Ku}> holds one table: its numbers`),[];let s=a?.type===`table`?a.children.map(t=>t.children.map(t=>ad(e,t.children).map(e=>e.text).join(``).trim())):void 0,c=n.get(`data`),l=n.get(`categories`),u=n.get(`series`);if(s!==void 0&&c!==void 0)return r(`a chart's numbers are its table or the file data names, not both`),[];if(s===void 0&&(c===void 0||c===``))return r(`<${Ku}> has numbers: a table inside it, or data="…" naming a file of them`),[];if(s!==void 0){(l!==void 0||u!==void 0)&&r(`categories and series name a file's columns: a chart's own table has its series in its head row and its categories in its first column`);let e=Math.min(...s.map(e=>e.length));(s.length<2||e<2)&&r(`a chart's table has a head row and a row of numbers, a column of categories and a column of numbers`)}else(l===void 0||l===``)&&r(`with data, categories names the column of the categories`),(u===void 0||Xu(u).length===0)&&r(`with data, series names the columns of the numbers (series="revenue,cost")`);let d=n.get(`legend`),f=[...Se,`none`];d!==void 0&&!f.includes(d)&&r(`a chart's legend is ${f.join(`, `)}, not "${d}"`);let p=n.get(`labels`),m=p===void 0?void 0:p===``?[`value`]:Xu(p),h=m?.filter(e=>!ta.includes(e));h?.length&&r(`a chart's labels are ${ta.join(`, `)}, not ${h.map(e=>`"${e}"`).join(`, `)}`);let g=(e,t)=>{let i=n.get(e);if(i===void 0)return;let a=Number(i);if(i.trim()!==``&&Number.isFinite(a)&&(!t||a>0))return t?Math.round(a):a;r(`${e} of <${Ku}> is ${t?`a number of pixels`:`a number`}, not "${i}"`)},_=g(`min`,!1),v=g(`max`,!1),y=g(`width`,!0),b=g(`height`,!0),x=n.get(`colors`);return[{type:`chart`,kind:i,...dd(`title`,n.get(`title`)),...s===void 0?{}:{table:s},...c===void 0||c===``?{}:{data:c},...s===void 0?dd(`categories`,l):{},...s===void 0&&u!==void 0&&Xu(u).length>0?{series:Xu(u)}:{},...d!==void 0&&f.includes(d)?{legend:d}:{},...m!==void 0&&!h?.length?{labels:m}:{},...dd(`format`,n.get(`format`)),..._===void 0?{}:{min:_},...v===void 0?{}:{max:v},...x!==void 0&&Xu(x).length>0?{colors:Xu(x)}:{},...n.has(`smooth`)&&n.get(`smooth`)!==`false`?{smooth:!0}:{},...y===void 0?{}:{width:y},...b===void 0?{}:{height:b},...dd(`alt`,n.get(`alt`)),...dd(`id`,n.get(`id`))}]}function yd(e,t){nd(e,t,[]);let n=[];for(let r of t.children){if(r.type!==`mdxJsxFlowElement`||r.name!==`Column`)return $u(e,r,`<${Wu}> holds <${Gu}>s, each around its blocks`),[];let t=nd(e,r,[`width`]).get(`width`),i=t===void 0?void 0:Number(t);t!==void 0&&!(Number.isFinite(i)&&(i??0)>0)&&$u(e,r,`a column's width is a share against the others' (1, 2, 0.5), not "${t}"`);let a=Cd(e,r.children);if(a.some(e=>e.type===`columns`))return $u(e,r,`a <${Gu}> holds no <${Wu}>`),[];n.push({...i!==void 0&&Number.isFinite(i)&&i>0&&i!==1?{width:i}:{},blocks:a})}return n.length<2?($u(e,t,`<${Wu}> holds two or more <${Gu}>s`),[]):[{type:`columns`,columns:n}]}function bd(e,t){let n=nd(e,t,[`widths`,`head`,`caption`,`id`]),r=Cd(e,t.children),[i,...a]=r;if(i?.type!==`table`||a.length>0)return $u(e,t,`<${Iu}> holds one table`),r;let o=n.get(`head`);o!==void 0&&![`none`,`column`,`both`,`row`].includes(o)&&$u(e,t,`a table's head is none, row, column or both, not "${o}"`);let s=n.get(`widths`)?.split(`,`).map(e=>{let t=Number(e.trim());return e.trim()!==``&&Number.isFinite(t)&&t>0?Math.round(t):null});return[{...i,...o===`none`||o===`column`||o===`both`?{head:o}:{},...s?.some(e=>e!==null)?{widths:s}:{},...dd(`caption`,n.get(`caption`)),...dd(`id`,n.get(`id`))}]}function xd(e,t){switch(t.type){case`paragraph`:{let n=t.children.length===1?t.children[0]:void 0;if(n?.type===`image`)return[{type:`image`,src:n.url,...n.alt?{alt:n.alt}:{},...n.title?{caption:n.title}:{}}];let r=ad(e,t.children),i=r.map(e=>e.text).join(``).trim();return i.startsWith(`$$`)&&i.endsWith(`$$`)&&i.length>4&&$u(e,t,"$$ is not drawn in a doc: an equation is a ```math code block"),[{type:`paragraph`,content:r}]}case`heading`:return[{type:`heading`,level:t.depth,content:ad(e,t.children)}];case`list`:{let n=t.ordered===!0;return t.children.map((r,i)=>ld(e,r,n,i===0&&n?t.start??void 0:void 0))}case`blockquote`:{let{content:n,under:r}=sd(e,t.children);return[cd({type:`quote`,content:n},r)]}case`code`:return[{type:`code`,...t.lang?{language:t.lang}:{},code:t.value}];case`table`:return[{type:`table`,rows:t.children.map(t=>ud(e,t))}];case`thematicBreak`:return[{type:`divider`}];case`mdxJsxFlowElement`:{let n=n=>n.length>0?n:[{type:`embed`,source:Qu(e,t)}];if(t.name===`Block`)return n(fd(e,t));if(t.name===`Table`)return bd(e,t);if(t.name===`Callout`)return pd(e,t);if(t.name===`Component`)return n(_d(e,t));if(t.name===`Chart`)return n(vd(e,t));if(t.name===`Columns`)return n(yd(e,t));if(t.name===`Card`)return n(md(e,t));if(t.name===`Stats`)return n(hd(e,t));if(t.name===`Stat`)return $u(e,t,`a <${Hu} /> stands inside <${Vu}>`),n([]);if(t.name===`PageBreak`){let r=nd(e,t,[`orientation`]).get(`orientation`);return t.children.length>0?($u(e,t,`<${zu} /> holds nothing`),n([])):r!==void 0&&r!==`portrait`&&r!==`landscape`?($u(e,t,`a page break's orientation is portrait or landscape, not "${r}"`),n([])):[{type:`pagebreak`,...r===void 0?{}:{orientation:r}}]}if(t.name===`Bibliography`)return t.attributes.length>0||t.children.length>0?($u(e,t,`<${Ju} /> takes nothing`),n([])):[{type:`bibliography`}];if(t.name===`TableOfContents`){let r=nd(e,t,[`levels`,`title`]),i=r.get(`levels`),a=r.get(`title`),o=i===void 0?void 0:Number(i);return t.children.length>0||o!==void 0&&!(Number.isInteger(o)&&o>=1&&o<=6)?($u(e,t,`<${Yu} /> holds nothing, and its levels are 1 to 6 (the deepest heading it lists)`),n([])):[{type:`toc`,...o===void 0?{}:{levels:o},...a===void 0?{}:{title:a}}]}return t.name===`Column`?($u(e,t,`a <${Gu}> stands inside <${Wu}>`),n([])):t.name===`img`&&t.children.length===0?n(gd(e,t)):od(t)?[{type:`paragraph`,content:[]}]:[{type:`embed`,source:Qu(e,t)}]}case`footnoteDefinition`:{let{content:n,under:r}=sd(e,t.children);return[cd({type:`note`,label:t.label??t.identifier,content:n},r)]}case`mdxjsEsm`:case`definition`:return[{type:`source`,source:Qu(e,t)}];case`mdxFlowExpression`:return $u(e,t,`{…} on its own is not drawn in a doc`),[{type:`source`,source:Qu(e,t)}];default:return $u(e,t,`${t.type} is not drawn in a doc`),[{type:`source`,source:Qu(e,t)}]}}function Sd(e,t){return t.map((n,r)=>{let i=xd(e,n),a=t[r-1],o=i[0];return n.type===`list`&&n.ordered===!0&&a?.type===`list`&&a.ordered===!0&&o?.type===`numbered`&&o.start===void 0&&(i[0]={...o,start:n.start??1}),i})}function Cd(e,t){return Sd(e,t).flat()}function wd(e){let t={source:e,problems:[]},n;try{n=Jn(e,{extensions:[bt(),Nu(),nr(),rr(),er(),tn(),vs()],mdastExtensions:[It(),Co(),Zn(),Qn(),tr(),$t()]})}catch(t){let n=t;return{source:e,blocks:[],segments:[],page:{},problems:[{message:n.reason??n.message??`The file is not MDX`,...typeof n.line==`number`?{line:n.line}:{},...typeof n.column==`number`?{column:n.column}:{}}]}}let[r]=n.children,i=r?.type===`yaml`?r:void 0,a=i?n.children.slice(1):n.children,o=i?Td(t,i):{},s=[],c=Sd(t,a);a.forEach((e,t)=>{let n=e.position?.start.offset,r=e.position?.end.offset;n!==void 0&&r!==void 0&&s.push({start:n,end:r,blocks:c[t]??[]})});let l=i?.position?.start.offset,u=i?.position?.end.offset;return{source:e,blocks:s.flatMap(e=>e.blocks),segments:s,problems:t.problems,page:o,...l===void 0||u===void 0?{}:{frontMatter:{start:l,end:u}}}}function Td(e,t){let n;try{n=sr(t.value)}catch(n){return $u(e,t,`the front matter is not YAML: ${n instanceof Error?n.message:String(n)}`),{}}return n==null?{}:typeof n!=`object`||Array.isArray(n)?($u(e,t,`the front matter holds keys: ${Vi.join(`, `)}`),{}):Yi(n,n=>{$u(e,t,n)})}var Ed=[`link`,`span`,`tag`,`underline`,`bold`,`italic`,`strike`,`code`];function Dd(e,t){switch(t){case`link`:return e.href;case`tag`:return e.styles.tag;case`span`:return e.styles.color!==void 0||e.styles.background!==void 0?`${e.styles.color??``}\n${e.styles.background??``}`:void 0;default:return e.styles[t]?`on`:void 0}}var Od=(e,t)=>t===void 0?``:` ${e}="${t.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`)}"`,kd=e=>e!==void 0&&/[\p{L}\p{N}]/u.test(e);function Ad(e,t,n=t){let r=``,i=Array.from(e);return i.forEach((e,a)=>{let o=i[a-1],s=i[a+1];switch(e){case`\\`:case`*`:case"`":case`[`:case`]`:case`<`:case`>`:case`{`:case`}`:case`~`:r+=`\\${e}`;break;case`_`:r+=kd(o)&&kd(s)?e:`\\${e}`;break;case`&`:r+=/^&(#\d+|#x[0-9a-f]+|[a-z][a-z0-9]*);/i.test(i.slice(a,a+34).join(``))?`&amp;`:e;break;case`|`:r+=t?`\\|`:e;break;case`!`:r+=s===void 0?`\\!`:e;break;case`
27
- `:r+=n?`<br />`:`\\
28
- `;break;default:r+=e}}),r}function jd(e){let t=Math.max(0,...(e.match(/`+/g)??[]).map(e=>e.length)),n="`".repeat(t+1),r=e.startsWith("`")||e.endsWith("`")||e.startsWith(` `)&&e.endsWith(` `)&&e.trim()!==``?` `:``;return`${n}${r}${e}${r}${n}`}var Md={bold:`**`,italic:`*`,strike:`~~`},Nd={underline:`u`,bold:`strong`,italic:`em`,strike:`del`,code:`code`};function Pd(e,t){let n=``,r=0,i=!0;for(;r<e.length;){let a=e[r];if(a===void 0)break;if(a.note!==void 0||a.cite!==void 0){n+=a.note===void 0?`[${a.cite??``}]`:`[^${a.note}]`,i=!1,r++;continue}let o=Ed.find(e=>!t.used.has(e)&&Dd(a,e)!==void 0);if(o===void 0){n+=Ad(a.text,t.inTable,t.oneLine),i=!0,r++;continue}let s=Dd(a,o),c=r+1;for(;c<e.length;){let n=e[c];if(n===void 0||Dd(n,o)!==s||o===`code`&&Ed.some(e=>e!==`code`&&!t.used.has(e)&&Dd(n,e)!==void 0))break;c++}let l=e.slice(r,c),u=new Set([...t.used,o]),d=l.map(e=>e.text).join(``),f=e[c],p=f===void 0||Ed.every(e=>t.used.has(e)||Dd(f,e)===void 0);if(o===`code`)n+=d.includes(`
29
- `)||t.inTable&&d.includes(`|`)?`<code>${Ad(d,t.inTable,t.oneLine)}</code>`:jd(d);else if(o===`link`){let e=Pd(l,{...t,used:u}),r=(s??``).replace(/[\s<>\\]/g,e=>encodeURIComponent(e)),i=Fd(r)?r:r.replace(/[()]/g,`\\$&`);n+=`[${e}](${i})`}else if(o===`tag`){let e=Pd(l,{...t,used:u});n+=`<Tag${Od(`color`,s)}>${e}</Tag>`}else if(o===`span`){let e=Pd(l,{...t,used:u}),r=l[0];n+=`<span${Od(`color`,r?.styles.color)}${Od(`bg`,r?.styles.background)}>${e}</span>`}else{let a=Pd(l,{...t,used:u}),s=Md[o],f=Array.from(d),m=r===0&&c===e.length,h=t.used.has(`bold`)||t.used.has(`italic`)||t.used.has(`strike`),g=e=>e!==void 0&&Ed.every(t=>u.has(t)||Dd(e,t)===void 0),_=o===`bold`&&l.every(e=>e.styles.italic===!0&&Ed.every(t=>t===`italic`||u.has(t)||Dd(e,t)===void 0)),v=s!==void 0&&kd(f[0])&&kd(f.at(-1))&&!d.includes(`
30
- `)&&i&&p&&(!h||m&&o===`italic`&&t.used.has(`bold`))&&(g(l[0])&&g(l.at(-1))||_);n+=v?`${s}${a}${s}`:`<${Nd[o]}>${a}</${Nd[o]}>`}i=!1,r=c}return n}function Fd(e){let t=0;for(let n of e)if(n===`(`)t+=1;else if(n===`)`&&--t<0)return!1;return t===0}function Id(e){if(/^[ \t]/.test(e)||/^(import|export)(\s|$)/.test(e))return`&#x${e.charCodeAt(0).toString(16)};${e.slice(1)}`;if(/^(#{1,6}(\s|$)|[-+](\s|$)|[=-]+\s*$|[|:\-\s]*-[|:\-\s]*$)/.test(e))return`\\${e}`;let t=/^(\d{1,9})([.)])(\s|$)/.exec(e);return t?.[1]===void 0?e:`${t[1]}\\${e.slice(t[1].length)}`}function Ld(e,t=!1,n=t){let r=Pd(e.filter(e=>e.text!==``||e.href!==void 0).map((e,t,n)=>{if(e.note===void 0)return e;let r=n.slice(0,t).findLast(e=>e.note===void 0);return r===void 0?e:{...e,styles:{...r.styles},...r.href===void 0?{}:{href:r.href}}}),{inTable:t,oneLine:n,used:new Set}),i=e=>e.replace(/ +$/,``).replace(/^ +/,e=>`&#x20;`.repeat(e.length));return n?i(r):r.split(`
31
- `).map(e=>Id(i(e))).join(`
32
- `)}var Rd=(e,t)=>e.split(`
33
- `).map((e,n)=>n===0||e===``?e:`${t}${e}`).join(`
34
- `),zd=e=>e.type===`bullet`||e.type===`numbered`||e.type===`check`,Bd=e=>`${Od(`align`,e?.align)}${Od(`color`,e?.color)}${Od(`bg`,e?.background)}`,Vd=e=>e!==void 0&&Object.keys(e).length>0;function Hd(e){return!(`content`in e)||e.type===`callout`?!1:Vd(e.look)||e.type===`toggle`||e.type===`heading`&&e.toggle?!0:(e.type===`paragraph`||e.type===`heading`)&&(e.children?.length??0)>0}function Ud(e){let t=Math.max(2,...(e.match(/^\s*`{3,}/gm)??[]).map(e=>e.trim().length));return"`".repeat(t+1)}function Wd(e,t,n){let r=e.type===`numbered`?`${String(t)}${n} `:e.type===`check`?`- [${e.checked?`x`:` `}] `:`- `,i=` `.repeat(e.type===`numbered`?r.length:2),a=e.children??[],o=Ld(e.content)||(e.type===`check`&&(e.children??[]).length===0?`<br />`:``);if(a.length===0)return`${r}${Rd(o,i)}`.trimEnd();let s=o===``?`<br />`:o,[c]=a,l=c!==void 0&&zd(c)&&Ld(c.content)!==``&&(c.type!==`numbered`||(c.start??1)===1),u=a.every(zd)&&o!==``&&l;return`${r}${Rd(s,i)}${u?`
35
- `:`
36
-
37
- `}${i}${Rd(Zd(a),i)}`}function Gd(e){switch(e.type){case`paragraph`:{let t=Ld(e.content);return t===``?`<br />`:t}case`heading`:return`${`#`.repeat(e.level)} ${Ld(e.content,!1,!0).replace(/(^| )(#+)$/,`$1\\$2`)}`.trimEnd();case`toggle`:return Ld(e.content)||`<br />`;case`quote`:{let t=Ld(e.content);return(e.children?.length?[t===``?`<br />`:t,Zd(e.children)]:[t]).join(`
38
-
39
- `).split(`
40
- `).map(e=>e===``?`>`:`> ${e}`).join(`
41
- `)}case`callout`:{let t=Ld(e.content),n=[t===``?`<br />`:t,...e.children?.length?[Zd(e.children)]:[]].join(`
42
-
43
- `);return`<${Fu}${Od(`icon`,e.icon)}${Od(`color`,e.look?.color)}${Od(`bg`,e.look?.background)}>\n\n${n}\n\n</${Fu}>`}case`card`:{let t=e.children?.length?Zd(e.children):``;return`<${Bu}${Od(`title`,e.title)}${Od(`subtitle`,e.subtitle)}>\n\n${t===``?`<br />`:t}\n\n</${Bu}>`}case`stats`:return[`<${Vu}>`,...e.stats.map(e=>`<${Hu}${Od(`label`,e.label)}${Od(`value`,e.value)}${Od(`delta`,e.delta)}${Od(`note`,e.note)}${e.downIsGood?` down-is-good`:``}${Od(`trend`,e.trend?.join(`,`))} />`),`</${Vu}>`].join(`
44
- `);case`code`:{let t=Ud(e.code);return`${t}${e.language??``}\n${e.code}\n${t}`}case`image`:{let t=e.src.replace(/[\s()<>\\]/g,e=>encodeURIComponent(e));if(e.width!==void 0||e.align!==void 0||e.id!==void 0)return`<img${Od(`src`,e.src)}${Od(`alt`,e.alt)}${Od(`title`,e.caption)}${Od(`width`,e.width===void 0?void 0:String(e.width))}${Od(`align`,e.align)}${Od(`id`,e.id)} />`;let n=e.caption===void 0?``:` "${e.caption.replace(/["\\]/g,`\\$&`)}"`;return`![${Ad(e.alt??``,!1)}](${t}${n})`}case`table`:{let t=Math.max(1,...e.rows.map(e=>e.length)),n=e=>`| ${Array.from({length:t},(t,n)=>Ld(e[n]??[],!0)).join(` | `)} |`,[r,...i]=e.rows,a=[n(r??[]),`| ${Array.from({length:t},()=>`---`).join(` | `)} |`,...i.map(n)].join(`
45
- `),o=e.widths?.some(e=>e!==null)?e.widths.map(e=>e===null?``:String(e)).join(`,`):void 0;return o===void 0&&e.head===void 0&&e.caption===void 0&&e.id===void 0?a:`<${Iu}${Od(`widths`,o)}${Od(`head`,e.head)}${Od(`caption`,e.caption)}${Od(`id`,e.id)}>\n\n${a}\n\n</${Iu}>`}case`divider`:return`---`;case`component`:{let t=e=>e===void 0?void 0:String(e),n=Object.entries(e.props).map(([e,t])=>Od(e,t)).join(``);return`<${Lu}${Od(`of`,e.of)}${Od(`width`,t(e.width))}${Od(`height`,t(e.height))}${Od(`at`,t(e.at))}${n}${Od(`alt`,e.alt)}${Od(`title`,e.caption)}${Od(`align`,e.align)}${Od(`id`,e.id)} />`}case`chart`:return Kd(e);case`pagebreak`:return`<${zu}${Od(`orientation`,e.orientation)} />`;case`bibliography`:return`<${Ju} />`;case`toc`:return`<${Yu}${Od(`levels`,e.levels===void 0?void 0:String(e.levels))}${Od(`title`,e.title)} />`;case`note`:{let t=Ld(e.content)||`<br />`,n=e.children?.length?`\n\n${Zd(e.children).split(`
46
- `).map(e=>e===``?e:` ${e}`).join(`
47
- `)}`:``;return`[^${e.label}]: ${Rd(t,` `)}${n}`}case`columns`:return[`<${Wu}>`,...e.columns.map(e=>{let t=Zd(e.blocks);return`<${Gu}${Od(`width`,e.width===void 0?void 0:String(e.width))}>\n\n${t===``?`<br />`:t}\n\n</${Gu}>`}),`</${Wu}>`].join(`
48
-
49
- `);case`embed`:case`source`:return e.source}}function Kd(e){let t=e=>e===void 0?void 0:String(e),n=e=>e===void 0?void 0:e.join(`,`),r=e.labels?.length===1&&e.labels[0]===`value`?` labels`:Od(`labels`,n(e.labels)),i=[Od(`type`,e.kind),Od(`title`,e.title),Od(`data`,e.data),Od(`categories`,e.categories),Od(`series`,n(e.series)),Od(`legend`,e.legend),r,Od(`format`,e.format),Od(`min`,t(e.min)),Od(`max`,t(e.max)),Od(`colors`,n(e.colors)),e.smooth?` smooth`:``,Od(`width`,t(e.width)),Od(`height`,t(e.height)),Od(`alt`,e.alt),Od(`id`,e.id)].join(``);if(e.table===void 0)return`<${Ku}${i} />`;let a=Math.max(1,...e.table.map(e=>e.length)),o=e=>`| ${Array.from({length:a},(t,n)=>Ad(e[n]??``,!0)).join(` | `)} |`,[s,...c]=e.table;return`<${Ku}${i}>\n\n${[o(s??[]),`| ${Array.from({length:a},()=>`---`).join(` | `)} |`,...c.map(o)].join(`
50
- `)}\n\n</${Ku}>`}function qd(e){let t=$i(e);if(Object.keys(t).length===0)return``;let n=new cr(t);return or(n,{Seq:(e,t)=>{t.flow=!0},Map:(e,t,n)=>{n.length>1&&(t.flow=!0)}}),n.toString({lineWidth:0}).trimEnd()}function Jd(e,t){let n=qd(t),r=n===``?``:`---\n${n}\n---`,i=e.frontMatter;if(i===void 0){if(r===``)return e.source;let t=e.source.replace(/^\s+/u,``);return t===``?`${r}\n`:`${r}\n\n${t}`}let a=e.source.slice(i.end).replace(/^\s+/u,``);return r===``?a:a===``?`${r}\n`:`${r}\n\n${a}`}function Yd(e){let t=e.type===`toggle`||e.type===`heading`&&e.toggle,{children:n}=e,r={...e};delete r.look,delete r.children;let i=r.type===`toggle`?{type:`paragraph`,content:r.content}:r.type===`heading`?{type:`heading`,level:r.level,content:r.content}:r,a=zd(i)||i.type===`quote`?Zd([{...i,...n?{children:n}:{}}]):Zd([i,...n??[]]);return`<${Pu}${Bd(e.look)}${t?` toggle`:``}>\n\n${a}\n\n</${Pu}>`}function Xd(e,t){return zd(e)&&zd(t)&&!Hd(e)&&!Hd(t)&&e.type===`numbered`==(t.type===`numbered`)&&(t.type!==`numbered`||t.start===void 0)}function Zd(e){let t=[],n=0,r;for(;n<e.length;){let i=e[n];if(i===void 0)break;if(Hd(i)){t.push(Yd(i)),r=void 0,n++;continue}if(!zd(i)){t.push(n===0&&i.type===`divider`?`***`:Gd(i)),r=void 0,n++;continue}let a=i.type===`numbered`,o=i.type===`numbered`?i.start??1:1,s=a&&r===`.`?`)`:`.`,c=[],l=n;for(;l<e.length;){let t=e[l];if(t===void 0||!zd(t)||Hd(t)||t.type===`numbered`!==a||l>n&&!Xd(i,t))break;c.push(Wd(t,o+(l-n),s)),l++}let u=c.some(e=>e.includes(`
51
-
52
- `));t.push(c.join(u?`
53
-
54
- `:`
55
- `)),r=a?s:void 0,n=l}return t.join(`
56
-
57
- `)}function Qd(e,t){let n=t.map(sa),r=e.segments.map(e=>({...e,keys:e.blocks.map(sa)})),i=r.length,a=n.length,o=(e,t)=>{let i=r[e]?.keys??[];return i.length>0&&t+i.length<=a&&i.every((e,r)=>n[t+r]===e)},s=Array.from({length:i+1},()=>Array(a+1).fill(0)),c=(e,t)=>s[e]?.[t]??0;for(let e=i-1;e>=0;e--)for(let t=a;t>=0;t--){let n=r[e]?.keys.length??0,i=Math.max(c(e+1,t),t<a?c(e,t+1):0);o(e,t)&&(i=Math.max(i,n+c(e+1,t+n)));let l=s[e];l&&(l[t]=i)}let l=[],u=0,d=0,f=[],p=()=>{f.length>0&&l.push({blocks:f}),f=[]};for(;u<i||d<a;){let e=r[u]?.keys.length??0;if(u<i&&o(u,d)&&c(u,d)===e+c(u+1,d+e))p(),l.push({kept:u}),d+=e,u++;else if(u<i&&c(u,d)===c(u+1,d))u++;else{let e=t[d];e&&f.push(e),d++}}p();let m=e.source,h=e=>{let t=r[e];return t!==void 0&&!m.slice(t.start,t.end).includes(`
58
-
59
- `)};for(let e=0;e<l.length;e++){let t=l[e];if(!t||!(`kept`in t))continue;let n=r[t.kept]?.blocks??[],i=n[0],a=n.at(-1),o=l[e-1],s=l[e+1],c=o&&`blocks`in o?o.blocks.at(-1):void 0,u=s&&`blocks`in s?s.blocks[0]:void 0,d=c!==void 0&&i!==void 0&&Xd(c,i),f=u!==void 0&&a!==void 0&&Xd(a,u);(d||f)&&h(t.kept)&&(l[e]={blocks:[...n]})}for(let e=l.length-1;e>0;e--){let t=l[e],n=l[e-1];t&&n&&`blocks`in t&&`blocks`in n&&(n.blocks.push(...t.blocks),l.splice(e,1))}let g=r[0],_=r.at(-1),v=g?m.slice(0,g.start):e.frontMatter?`${m.slice(0,e.frontMatter.end)}\n\n`:``,y=_?m.slice(_.end):m===``?``:`
60
- `,b=v,x;return l.forEach((e,t)=>{if(t>0){let n=l[t-1],i=`kept`in e&&n&&`kept`in n&&x!==void 0&&e.kept===x+1?m.slice(r[x]?.end??0,r[e.kept]?.start??0):`
61
-
62
- `;b+=i}if(`kept`in e){let t=r[e.kept];t&&(b+=m.slice(t.start,t.end)),x=e.kept}else b+=Zd(e.blocks),x=void 0}),l.length===0&&e.frontMatter!==void 0?`${m.slice(0,e.frontMatter.end)}\n`:(e.frontMatter===void 0&&t[0]?.type===`divider`&&(b=b.replace(/^---[ \t]*(?=\n|$)/u,`***`)),b+(y===``&&b!==``?`
63
- `:y))}var $d={ground:`#ECE3CC`,ink:`#2F4A2E`,middle:`#5E7D3A`,soft:`#F6F0E0`,notes:[`#C4683A`,`#6F8FAE`,`#6B5A7A`,`#D9A93A`],tone:`#C4683A`},ef={ground:`#E6D8BB`,ink:`#1F3B63`,middle:`#4A6F96`,soft:`#F4ECDB`,notes:[`#1F3B63`,`#4A6F96`,`#8FB3D9`,`#B7A27C`],tone:`#8FB3D9`},tf={ground:`#E8E2D2`,ink:`#3E3A4C`,middle:`#7F7B9C`,soft:`#F4F0E6`,notes:[`#B9776A`,`#6B8AA6`,`#7D9474`,`#D2A874`],tone:`#A85F55`},nf={ground:`#DDE6E2`,ink:`#22303B`,middle:`#5B8299`,soft:`#EEF3F0`,notes:[`#5F8A6A`,`#3F6F9A`,`#9A5A40`,`#C4A066`],tone:`#C4A066`},rf=[`dots`,`scales`,`bay`,`stacks`,`steam`,`dusk`,`lake`],af=1800,of=600,sf=`width="${String(af)}" height="${String(of)}"`,X=e=>String(Math.round(e*10)/10),cf=e=>String(Math.round(e));function lf(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let e=t;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}function uf(e,t){let n=e[Math.min(e.length-1,Math.floor(t*e.length))];if(n===void 0)throw Error(`An empty list.`);return n}function df(e,t){return`<linearGradient id="${e}" x1="0" y1="0" x2="0" y2="1">${t.map(([e,t,n])=>`<stop offset="${X(e)}" stop-color="${t}"${n===void 0?``:` stop-opacity="${X(n)}"`}/>`).join(``)}</linearGradient>`}var ff=`<filter id="grain" x="0" y="0" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency=".75" numOctaves="2" seed="3" stitchTiles="stitch"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0 0 0 -.18"/></filter>`,pf=`<rect ${sf} filter="url(#grain)" opacity=".5"/>`;function mf(e,t,n=.012){return`<filter id="${e}" x="-5%" y="-5%" width="110%" height="110%"><feTurbulence type="fractalNoise" baseFrequency="${String(n)}" numOctaves="3" seed="7"/><feDisplacementMap in="SourceGraphic" scale="${String(t)}" xChannelSelector="R" yChannelSelector="G"/></filter>`}function hf(e,t){return`<filter id="${e}" x="-50%" y="-50%" width="200%" height="200%"><feGaussianBlur stdDeviation="${String(t)}"/></filter>`}function gf(e,t){return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${String(af)} ${String(of)}" preserveAspectRatio="xMidYMid slice"><defs>${ff}${e}</defs>${t}${pf}</svg>`}var _f=class{by=new Map;add(e,t){this.by.set(e,`${this.by.get(e)??``}${t}`)}draw(e){let t=``;for(let[n,r]of this.by)t+=`<path d="${r}" stroke="${n}" stroke-width="${X(e)}" stroke-linecap="round" fill="none"/>`;return t}};function vf(e,t,n){let r=(e,t)=>Number.parseInt(e.slice(1+t*2,3+t*2),16);return`#${[0,1,2].map(i=>Math.round(r(e,i)+(r(t,i)-r(e,i))*n).toString(16).padStart(2,`0`)).join(``)}`}function yf(e,t,n,r){let i=``;for(let a=-20;a<=1820;a+=12){let o=e-t*(Math.sin(a*n+r)*.55+Math.sin(a*n*2.3+r*1.7)*.3+Math.sin(a*n*5.9+r*.6)*.12);i+=`${i===``?`M`:`L`}${cf(a)} ${cf(o)}`}return`${i}L1820 620L-20 620Z`}function bf(){let e=$d,t=lf(1884),n={base:`#E7E3CF`,own:[e.soft,e.ground,`#E9DDB0`,`#F1E7C6`],other:[`#BCCAD6`,`#CFC6DA`]},r={base:`#AEBBC8`,own:[`#94A9C0`,e.notes[1],`#C3CFDA`,e.soft],other:[`#E2C27E`,`#C99FB8`]},i={base:`#97A350`,own:[`#A6B262`,`#C6B65A`,e.notes[3],`#93A752`,`#D8B85A`],other:[e.notes[0],`#E09A68`]},a={base:`#34463E`,own:[e.ink,`#3E3A4C`,`#3B5848`,`#46506A`],other:[e.notes[2],e.notes[1],`#8C6A8E`]},o={base:`#3E5836`,own:[e.ink,`#46633A`,`#3B5848`,`#55703F`],other:[e.notes[2],e.notes[1]]},s={base:`#2F3A30`,own:[e.ink,`#2B3530`,`#3E3A4C`],other:[e.notes[2],`#4E4466`]},c={base:`#3A3550`,own:[`#3E3A4C`,`#4E4466`,`#2F3A4A`,`#5A4E74`],other:[e.notes[1],`#8C6A8E`]},l={base:`#4E4466`,own:[e.notes[2],`#5A4E74`,`#3E3A4C`,`#6E5E86`],other:[`#8C6A8E`]},u=e=>228+Math.sin(e/210)*5+Math.sin(e/47)*3,d=e=>300+Math.sin(e/260)*12+Math.sin(e/61)*4,f=e=>336+e*.17+Math.sin(e/140)*14,p=[[150,.05],[420,-.04],[1540,.06],[1720,-.03]],m=(e,t)=>t<470&&p.some(([n,r])=>Math.abs(e-(n+(t-400)*r))<8+Math.max(0,Math.min(1,t/420))*12),h=(e,t)=>p.some(([n])=>((e-n)/230)**2+((t-40)/150)**2<1+Math.sin(e/23+t/31)*.12),g=1180,_=(e,t)=>t>316&&t<414&&Math.abs(e-g-(t-316)*.08)<20+(t-316)*.2||((e-g-36)/26)**2+((t-344)/28)**2<1||((e-g)/18)**2+((t-298)/30)**2<1||((e-g+3)/13)**2+((t-258)/15)**2<1,v=(e,t)=>t<240&&((e-g+16)/78)**2+((t-240)/52)**2<1,y=(e,t)=>v(e,t)?l:_(e,t)?c:m(e,t)?s:h(e,t)?o:t<u(e)?n:t<d(e)?r:t>f(e)?a:i,b=new _f;for(let e=4;e<of;e+=15*.82)for(let i=4+t()*15;i<af;i+=15*(.8+t()*.4)){let a=i+(t()-.5)*15*.5,o=e+(t()-.5)*15*.5,s=y(a,o);if((s===n||s===r)&&t()<.3)continue;let c=t()<.72?uf(s.own,t()):uf(s.other,t()),l=(t()-.5)*1.6;b.add(c,`M${cf(a)} ${cf(o)}l${cf(Math.cos(l)*4)} ${cf(Math.sin(l)*4)}`)}let x=e=>Array.from({length:37},(t,n)=>`L${cf(n*50)} ${cf(e(n*50))}`).join(``);return gf(``,`${`<rect ${sf} fill="${n.base}"/><path d="M0 600L0 ${cf(u(0))}${x(u)}L1800 600Z" fill="${r.base}"/><path d="M0 600L0 ${cf(d(0))}${x(d)}L1800 600Z" fill="${i.base}"/><path d="M0 600L0 ${cf(f(0))}${x(f)}L1800 600Z" fill="${a.base}"/>`}${b.draw(9)}`)}function xf(){let e=ef,[,,t,n]=e.notes,r=(t,n,r,i)=>`<g id="${t}"><circle r="110" fill="${n}" stroke="${e.ink}" stroke-width="3.6"/>${[.8,.62,.44,.26].map((e,t)=>`<circle r="${X(110*e)}" fill="none" stroke="${t===3?i:r}" stroke-width="${t===3?`4.4`:`3.4`}"/>`).join(``)}</g>`,i=``,a=0;for(let e=432;e<710;e+=55,a++)for(let t=a%2==0?0:110;t<2020;t+=220)i+=`<use href="#${a%4==2?`b`:`a`}" x="${X(t)}" y="${X(e)}"/>`;let o=``;for(let e=1;e<6;e++){let t=-96+e*32;o+=`M${X(t)} -206Q${X(t+14)} -112 ${X(t)} -24`}let s=`<g transform="translate(1250 ${X(346.2)}) scale(.62) rotate(-3)" stroke="${e.ink}" stroke-linejoin="round"><path d="M-96 -206H96Q124 -112 96 -24H-96Q-68 -112 -96 -206Z" fill="${vf(e.soft,n,.3)}" stroke-width="4.6"/><path d="${o}" fill="none" stroke-width="3.4"/><g fill="${e.ink}"><path d="M-210 -26L-170 -6H150L232 -58L218 4Q160 30 40 30H-150Q-196 12 -210 -26Z"/><path d="M-4 -234H4V-6H-4Z"/><path d="M-110 -214H110" stroke-width="8"/></g></g>`;return gf(`${r(`a`,e.soft,e.middle,n)}${r(`b`,t,e.ink,e.soft)}${df(`bokashi`,[[0,e.ink],[.22,e.middle],[.5,vf(e.tone,e.soft,.5)],[.62,e.soft]])}${mf(`cut`,3,.04)}`,`<rect ${sf} fill="url(#bokashi)"/><g filter="url(#cut)">${s}${i}</g>`)}function Sf(){let e=ef,t=lf(1857),n=new _f;for(let r=0;r<22;r++){let i=r/21,a=342+i**1.6*250,o=10+i*34,s=o*(1.6+t()*.6);for(let r=-t()*s;r<af;r+=s)n.add(i<.35?e.soft:i<.7?e.tone:e.middle,`M${cf(r)} ${cf(a+(t()-.5)*4)}h${cf(o)}`)}let r=(t,n,r)=>`<path d="M${X(t)} ${X(n)}l${X(r*.1)} ${X(-r)}l${X(r*.55)} ${X(r*.12)}l${X(-r*.05)} ${X(r*.88)}Z" fill="${e.soft}"/><path d="M${X(t-r*.2)} ${X(n)}h${X(r*1.1)}l${X(-r*.15)} ${X(r*.14)}h${X(-r*.8)}Z" fill="${e.ink}"/>`,i=(e,t,n)=>{let r=`M${X(e-n/2)} ${X(t)}`;for(let i=0;i<6;i++){let a=e-n/2+i*n/6;r+=`Q${X(a+n/12)} ${X(t-n*(.16+.08*Math.sin(i*1.7)))} ${X(a+n/6)} ${X(t)}`}return`${r}Q${X(e)} ${X(t+n*.08)} ${X(e-n/2)} ${X(t)}Z`},a=`<path d="M-20 600 C 40 470 90 380 150 300 C 200 236 280 196 380 178 L 386 192 C 300 210 228 252 186 318 C 140 390 104 480 70 600 Z"/>
64
- <path d="M170 300 C 230 290 300 300 360 330 L 352 340 C 296 314 236 306 176 314 Z"/>
65
- <path d="M250 214 C 300 170 360 150 420 150 L 420 162 C 364 164 310 182 262 222 Z"/>
66
- <path d="${i(370,168,170)}${i(440,146,120)}${i(300,236,150)}${i(380,332,150)}${i(110,262,190)}${i(60,380,160)}${i(200,168,120)}"/>`;return gf(`${df(`sky`,[[0,e.ink],[.24,e.middle],[.5,e.ground],[.56,e.soft]])}${df(`sea`,[[0,e.tone],[.35,e.middle],[.8,e.ink]])}${mf(`block`,3,.03)}`,`<rect ${sf} fill="url(#sky)"/>
67
- <rect y="330" width="${String(af)}" height="270" fill="url(#sea)"/>
68
- <g filter="url(#block)">
69
- <path d="M1040 334 L1250 210 Q1270 200 1290 210 L1500 334 Z" fill="${e.middle}"/>
70
- <path d="M1196 242 L1250 210 Q1270 200 1290 210 L1344 242 L1322 238 L1304 252 L1286 236 L1268 254 L1250 238 L1232 252 L1216 238 Z" fill="#FFFDF6"/>
71
- <path d="M560 336 C 700 324 860 326 1000 334 L 1000 340 L 560 340 Z" fill="${e.ink}" opacity=".75"/>
72
- ${r(760,352,34)}${r(850,348,22)}${r(1560,352,28)}
73
- ${n.draw(3)}
74
- <g fill="${e.ground}"><rect x="440" y="250" width="560" height="24" rx="12"/><rect x="620" y="284" width="380" height="18" rx="9"/><rect x="1420" y="262" width="440" height="22" rx="11"/><rect x="1180" y="140" width="680" height="20" rx="10"/></g>
75
- <g fill="#13263F">${a}</g>
76
- </g>`)}function Cf(){let e=tf,t=lf(1891),n=(e,t,n)=>{let r=`M${X(e-n)} ${X(t)}C${X(e-n*1.04)} ${X(t-n*.35)} ${X(e-n*1.12)} ${X(t-n*.7)} ${X(e-n*1.08)} ${X(t-n*.86)}C${X(e-n*.92)} ${X(t-n*1.4)} ${X(e-n*.42)} ${X(t-n*2.08)} ${X(e-n*.04)} ${X(t-n*2.16)}`,i=`${r}Q${X(e+n*.04)} ${X(t-n*2.2)} ${X(e+n*.12)} ${X(t-n*2.16)}C${X(e+n*.5)} ${X(t-n*2.06)} ${X(e+n*.96)} ${X(t-n*1.4)} ${X(e+n*1.1)} ${X(t-n*.86)}C${X(e+n*1.14)} ${X(t-n*.7)} ${X(e+n*1.04)} ${X(t-n*.35)} ${X(e+n)} ${X(t)}Z`,a=`shade${cf(e)}`;return`<path d="M${X(e)} ${X(t+n*.02)}L${X(e+n*5)} ${X(t+n*.12)}Q${X(e+n*5.2)} ${X(t+n*.22)} ${X(e+n*4.8)} ${X(t+n*.3)}L${X(e-n*.7)} ${X(t+n*.22)}Z" fill="#6A62A0" opacity=".6" filter="url(#soft)"/>
77
- <clipPath id="${a}"><path d="M${X(e+n*.2)} ${X(t-n*2.3)}Q${X(e-n*.25)} ${X(t-n)} ${X(e+n*.05)} ${X(t+n*.1)}H${X(e+n*1.3)}V${X(t-n*2.3)}Z"/></clipPath>
78
- <g filter="url(#dab)">
79
- <path d="${i}" fill="#B07468"/>
80
- <path d="${i}" fill="#55508A" opacity=".55" clip-path="url(#${a})"/>
81
- <path d="${r}" stroke="#F0A860" stroke-width="${X(n*.13)}" fill="none" stroke-linecap="round"/>
82
- </g>`},r=new _f;for(let n=0;n<1800;n++){let n=t()*af,i=t()*of,a=i<150?[`#8E86A4`,`#A08AA0`,e.middle,`#B49AA4`]:i<270?[e.notes[0],`#C98B78`,`#D9A88A`,`#B9A0B0`]:i<318?[`#E7C996`,`#F0D9AE`,e.notes[3],`#DDB792`]:i<352?[`#9C93AE`,e.middle,`#A79AB0`]:[`#C9A877`,`#B9A06E`,`#9DA578`,e.notes[2],`#D7B680`,`#A48FA6`],o=8+t()*14;r.add(uf(a,t()),`M${cf(n)} ${cf(i)}l${cf(o)} ${cf((t()-.5)*3)}`)}let i=`M-20 360`;for(let e=-20;e<=1840;e+=60)i+=`L${cf(e)} ${cf(328-Math.sin(e/300)*10-t()*8)}`;return i+=`L1840 362Z`,gf(`${df(`sky`,[[0,`#8F87A6`],[.32,e.notes[0]],[.5,`#E9C995`],[.56,`#EED7A8`]])}${df(`field`,[[0,`#CFAE7A`],[1,`#8F9670`]])}<radialGradient id="sun" cx=".16" cy=".5" r=".32"><stop offset="0" stop-color="#FBEBC4"/><stop offset="1" stop-color="#FBEBC4" stop-opacity="0"/></radialGradient>${mf(`paint`,8,.02)}${mf(`dab`,7,.09)}${hf(`soft`,5)}`,`<rect ${sf} fill="url(#sky)"/><rect y="350" width="${String(af)}" height="250" fill="url(#field)"/>
83
- <g filter="url(#paint)">
84
- <rect ${sf} fill="url(#sky)"/>
85
- <rect y="350" width="${String(af)}" height="250" fill="url(#field)"/>
86
- <path d="${i}" fill="#9A92AE"/>
87
- <g opacity=".55">${r.draw(6)}</g>
88
- <rect ${sf} fill="url(#sun)"/>
89
- </g>
90
- ${n(1040,452,72)}${n(1350,408,40)}`)}function wf(){let e=nf,[,t,n,r]=e.notes,i=lf(1877),a={x:900,y:70},o=``;for(let e=-9;e<=9;e++){let t=a.x+e*110,n=a.y+Math.abs(e)*((300-a.y)/9);o+=`M${cf(t)} ${cf(n)}V${cf(n-140)}`}let s=(t,n)=>{let r=``;for(let e=0;e<8;e++){let i=e*Math.PI/4;r+=`M${X(t)} ${X(432-n)}l${X(Math.cos(i)*n*.86)} ${X(Math.sin(i)*n*.86)}`}return`<circle cx="${X(t)}" cy="${X(432-n)}" r="${X(n)}" fill="none" stroke="${e.ink}" stroke-width="9"/><path d="${r}" stroke="${e.ink}" stroke-width="4"/><circle cx="${X(t)}" cy="${X(432-n)}" r="${X(n*.18)}" fill="${e.ink}"/>`},c=[560,676],l=``,u=``;for(let t=0;t<34;t++){let n=((t+i())/34)**1.3,r=446+n*900+(i()-.5)*60*(1+n),a=246-Math.sqrt(n)*90+n*40+(i()-.5)*40*(1+n),o=34+n*120+i()*30,s=26+n*46+i()*16;u+=`<ellipse cx="${X(r+14)}" cy="${X(a+s*.5)}" rx="${X(o*.9)}" ry="${X(s*.6)}"/>`,l+=`<ellipse cx="${X(r)}" cy="${X(a)}" rx="${X(o)}" ry="${X(s)}" fill="${uf([e.soft,`#FFFFFF`,e.ground],i())}" opacity="${X(.95-n*.5)}"/>`}return gf(`${df(`lazare-air`,[[0,vf(e.middle,e.ink,.25)],[.5,vf(e.middle,e.soft,.55)],[.72,e.soft],[1,e.ground]])}${hf(`lazare-steam`,16)}${hf(`lazare-far`,6)}${mf(`lazare-paint`,6,.015)}`,`<rect ${sf} fill="url(#lazare-air)"/>
91
- <g filter="url(#lazare-far)" opacity=".55"><path d="M520 426V330H600V300H660V318H740V286H800V310H880V276H930V300H1010V322H1090V296H1150V330H1240V426Z" fill="${vf(e.middle,e.soft,.45)}"/></g>
92
- <g filter="url(#lazare-paint)">
93
- <path d="M-20 300 L${String(a.x)} ${String(a.y)} L1820 300 V-20 H-20 Z" fill="${vf(e.middle,e.ink,.35)}" opacity=".55"/>
94
- <path d="${o}" stroke="${e.ink}" stroke-width="3" opacity=".3"/>
95
- <path d="M-20 300 L${String(a.x)} ${String(a.y)} L1820 300" stroke="${e.ink}" stroke-width="9" fill="none" opacity=".7"/>
96
- <path d="M-20 292 H1820" stroke="${e.ink}" stroke-width="4" opacity=".4"/>
97
- <rect x="-20" y="432" width="1840" height="208" fill="${vf(e.middle,e.ink,.45)}"/>
98
- <path d="M-20 434 H1820" stroke="${e.ink}" stroke-width="6"/>
99
- <path d="M-20 472 H1820" stroke="${vf(e.middle,e.soft,.4)}" stroke-width="3" opacity=".6"/>
100
- <path d="M1300 432 V352 H1720 V432 Z" fill="${vf(e.middle,e.ink,.5)}" opacity=".55"/>
101
- <path d="M1320 368 H1700" stroke="${e.soft}" stroke-width="10" stroke-dasharray="34 18" opacity=".35"/>
102
- <path d="M856 404 V318 H1010 V404 Z" fill="${vf(e.ink,t,.2)}"/>
103
- <path d="M370 388 H1020 V404 H370 Z" fill="${e.ink}"/>
104
- <path d="M420 322 H740 V388 H420 Z" fill="${vf(e.ink,t,.35)}"/>
105
- <path d="M420 338 H740" stroke="${r}" stroke-width="3" opacity=".7"/>
106
- <path d="M420 322 Q382 324 382 355 Q382 386 420 388 Z" fill="${e.ink}"/>
107
- <path d="M430 322 V276 H424 V264 H466 V276 H460 V322 Z" fill="${e.ink}"/>
108
- <path d="M560 322 Q560 296 584 296 Q608 296 608 322 Z" fill="${r}"/>
109
- <path d="M732 398 V270 H842 V398 Z" fill="${vf(e.ink,t,.2)}"/>
110
- <path d="M720 270 H854 V258 H720 Z" fill="${e.ink}"/>
111
- <rect x="756" y="290" width="60" height="44" rx="4" fill="${vf(e.soft,r,.25)}" opacity=".85"/>
112
- <rect x="362" y="378" width="22" height="26" fill="${n}"/>
113
- ${s(452,30)}${c.map(e=>s(e,46)).join(``)}${s(900,26)}${s(970,26)}
114
- <path d="M${X(c[0]??0)} 402 H${X(c[1]??0)}" stroke="${r}" stroke-width="8" stroke-linecap="round"/>
115
- </g>
116
- <g filter="url(#lazare-steam)"><g fill="${vf(e.middle,e.ink,.2)}" opacity=".35">${u}</g>${l}</g>`)}function Tf(){let e=tf,[t,,,n]=e.notes,r=[{base:352,amp:46,f:.0042,phase:.6,fill:vf(t,e.middle,.45)},{base:388,amp:52,f:.0055,phase:2.1,fill:e.middle},{base:428,amp:48,f:.0071,phase:4,fill:vf(e.middle,e.ink,.55)},{base:486,amp:40,f:.0093,phase:1.2,fill:e.ink}];return gf(`${df(`dusk-sky`,[[0,vf(e.tone,t,.35)],[.36,vf(t,n,.25)],[.56,n],[.68,vf(n,e.soft,.6)]])}<radialGradient id="dusk-glow" cx="1140" cy="328" r="440" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="${e.soft}" stop-opacity=".85"/><stop offset=".25" stop-color="${n}" stop-opacity=".45"/><stop offset="1" stop-color="${n}" stop-opacity="0"/></radialGradient>${hf(`dusk-mist`,14)}${mf(`dusk-cut`,4,.03)}`,`<rect ${sf} fill="url(#dusk-sky)"/><rect ${sf} fill="url(#dusk-glow)"/>
117
- <circle cx="1140" cy="328" r="66" fill="${e.soft}"/>
118
- <g filter="url(#dusk-cut)">${r.map((t,n)=>`<path d="${yf(t.base,t.amp,t.f,t.phase)}" fill="${t.fill}"/>${n<r.length-1?`<rect y="${String(t.base+4)}" width="${String(af)}" height="26" fill="${e.soft}" opacity=".16" filter="url(#dusk-mist)"/>`:``}`).join(``)}</g>`)}function Ef(){let e=ef,t=lf(1833),n=[{base:330,amp:40,f:.0038,phase:1.4,fill:vf(e.tone,e.middle,.35)},{base:372,amp:46,f:.0052,phase:3.3,fill:vf(e.tone,e.middle,.8)},{base:418,amp:36,f:.0069,phase:.4,fill:vf(e.middle,e.ink,.45)}],r=new _f;for(let n=0;n<64;n++){let n=t(),i=468+n*124,a=t()<.7,o=a?640+(t()-.5)*(90+n*220):t()*af,s=(a?24:40)+t()*(a?70:90);r.add(a?e.soft:vf(e.tone,e.soft,.5),`M${cf(o-s/2)} ${cf(i)}h${cf(s)}`)}let i=``;for(let e=0;e<7;e++){let n=1060+e*52+(t()-.5)*16,r=214+Math.abs(e-2)*16+(t()-.5)*8,a=15-Math.abs(e-2)*1.2;i+=`M${X(n-a)} ${X(r-a*.3)}Q${X(n-a*.45)} ${X(r-a*.5)} ${X(n)} ${X(r)}Q${X(n+a*.45)} ${X(r-a*.5)} ${X(n+a)} ${X(r-a*.3)}`}return gf(`${df(`lake-sky`,[[0,e.tone],[.55,vf(e.tone,e.soft,.7)],[.74,e.soft]])}${df(`lake-water`,[[0,vf(e.middle,e.ink,.35)],[1,e.ink]])}<radialGradient id="lake-glow" cx="640" cy="318" r="380" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="${e.soft}" stop-opacity=".95"/><stop offset=".3" stop-color="${vf(e.soft,e.notes[3],.3)}" stop-opacity=".45"/><stop offset="1" stop-color="${e.soft}" stop-opacity="0"/></radialGradient>${hf(`lake-mist`,16)}${mf(`lake-cut`,4,.03)}`,`<rect ${sf} fill="url(#lake-sky)"/><rect ${sf} fill="url(#lake-glow)"/>
119
- <g filter="url(#lake-cut)">${n.map(t=>`<path d="${yf(t.base,t.amp,t.f,t.phase)}" fill="${t.fill}"/><rect y="${String(t.base+6)}" width="${String(af)}" height="24" fill="${e.soft}" opacity=".18" filter="url(#lake-mist)"/>`).join(``)}
120
- <rect y="452" width="${String(af)}" height="148" fill="url(#lake-water)"/></g>
121
- <g opacity=".5">${r.draw(3)}</g>
122
- <path d="${i}" fill="none" stroke="${e.ink}" stroke-width="3.4" stroke-linecap="round" opacity=".8"/>`)}var Df={dots:bf,scales:xf,bay:Sf,stacks:Cf,steam:wf,dusk:Tf,lake:Ef},Of=new Map;function kf(e){let t=Of.get(e);return t===void 0&&(t=Df[e](),Of.set(e,t)),t}function Af(e){return`cover-${e}.svg`}var jf={slash_menu:{heading:{title:`Heading 1`,subtext:`Top-level heading`,aliases:[`h`,`heading1`,`h1`],group:`Headings`},heading_2:{title:`Heading 2`,subtext:`Key section heading`,aliases:[`h2`,`heading2`,`subheading`],group:`Headings`},heading_3:{title:`Heading 3`,subtext:`Subsection and group heading`,aliases:[`h3`,`heading3`,`subheading`],group:`Headings`},heading_4:{title:`Heading 4`,subtext:`Minor subsection heading`,aliases:[`h4`,`heading4`,`subheading4`],group:`Subheadings`},heading_5:{title:`Heading 5`,subtext:`Small subsection heading`,aliases:[`h5`,`heading5`,`subheading5`],group:`Subheadings`},heading_6:{title:`Heading 6`,subtext:`Lowest-level heading`,aliases:[`h6`,`heading6`,`subheading6`],group:`Subheadings`},toggle_heading:{title:`Toggle Heading 1`,subtext:`Toggleable top-level heading`,aliases:[`h`,`heading1`,`h1`,`collapsable`],group:`Subheadings`},toggle_heading_2:{title:`Toggle Heading 2`,subtext:`Toggleable key section heading`,aliases:[`h2`,`heading2`,`subheading`,`collapsable`],group:`Subheadings`},toggle_heading_3:{title:`Toggle Heading 3`,subtext:`Toggleable subsection and group heading`,aliases:[`h3`,`heading3`,`subheading`,`collapsable`],group:`Subheadings`},quote:{title:`Quote`,subtext:`Quote or excerpt`,aliases:[`quotation`,`blockquote`,`bq`],group:`Basic blocks`},toggle_list:{title:`Toggle List`,subtext:`List with hideable sub-items`,aliases:[`li`,`list`,`toggleList`,`toggle list`,`collapsable list`],group:`Basic blocks`},numbered_list:{title:`Numbered List`,subtext:`List with ordered items`,aliases:[`ol`,`li`,`list`,`numberedlist`,`numbered list`],group:`Basic blocks`},bullet_list:{title:`Bullet List`,subtext:`List with unordered items`,aliases:[`ul`,`li`,`list`,`bulletlist`,`bullet list`],group:`Basic blocks`},check_list:{title:`Check List`,subtext:`List with checkboxes`,aliases:[`ul`,`li`,`list`,`checklist`,`check list`,`checked list`,`checkbox`],group:`Basic blocks`},paragraph:{title:`Paragraph`,subtext:`The body of your document`,aliases:[`p`,`paragraph`],group:`Basic blocks`},code_block:{title:`Code Block`,subtext:`Code block with syntax highlighting`,aliases:[`code`,`pre`],group:`Basic blocks`},page_break:{title:`Page Break`,subtext:`Page separator`,aliases:[`page`,`break`,`separator`],group:`Basic blocks`},table:{title:`Table`,subtext:`Table with editable cells`,aliases:[`table`],group:`Advanced`},image:{title:`Image`,subtext:`Resizable image with caption`,aliases:[`image`,`imageUpload`,`upload`,`img`,`picture`,`media`,`url`],group:`Media`},video:{title:`Video`,subtext:`Resizable video with caption`,aliases:[`video`,`videoUpload`,`upload`,`mp4`,`film`,`media`,`url`],group:`Media`},audio:{title:`Audio`,subtext:`Embedded audio with caption`,aliases:[`audio`,`audioUpload`,`upload`,`mp3`,`sound`,`media`,`url`],group:`Media`},file:{title:`File`,subtext:`Embedded file`,aliases:[`file`,`upload`,`embed`,`media`,`url`],group:`Media`},emoji:{title:`Emoji`,subtext:`Search for and insert an emoji`,aliases:[`emoji`,`emote`,`emotion`,`face`],group:`Others`},divider:{title:`Divider`,subtext:`Visually divide blocks`,aliases:[`divider`,`hr`,`line`,`horizontal rule`],group:`Basic blocks`}},placeholders:{default:`Enter text or type '/' for commands`,heading:`Heading`,toggleListItem:`Toggle`,bulletListItem:`List`,numberedListItem:`List`,checkListItem:`List`,emptyDocument:void 0,new_comment:`Write a comment...`,edit_comment:`Edit comment...`,comment_reply:`Add comment...`},file_blocks:{add_button_text:{image:`Add image`,video:`Add video`,audio:`Add audio`,file:`Add file`}},toggle_blocks:{add_block_button:`Empty toggle. Click to add a block.`,toggle_button:`Expand or collapse`},code_block:{add_source_button_text:`Add source code`,ok_button_text:`OK`},side_menu:{add_block_label:`Add block`,drag_handle_label:`Open block menu`},drag_handle:{delete_menuitem:`Delete`,colors_menuitem:`Colors`,header_row_menuitem:`Header row`,header_column_menuitem:`Header column`},table_handle:{delete_column_menuitem:`Delete column`,delete_row_menuitem:`Delete row`,add_left_menuitem:`Add column left`,add_right_menuitem:`Add column right`,add_above_menuitem:`Add row above`,add_below_menuitem:`Add row below`,split_cell_menuitem:`Split cell`,merge_cells_menuitem:`Merge cells`,background_color_menuitem:`Background color`},suggestion_menu:{no_items_title:`No items found`},color_picker:{text_title:`Text`,background_title:`Background`,colors:{default:`Auto`,gray:`Gray`,brown:`Brown`,red:`Red`,orange:`Orange`,yellow:`Yellow`,green:`Green`,blue:`Blue`,purple:`Purple`,pink:`Pink`}},formatting_toolbar:{bold:{tooltip:`Bold`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Italic`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Underline`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Strike`,secondary_tooltip:`Mod+Shift+S`},code:{tooltip:`Code`,secondary_tooltip:``},colors:{tooltip:`Colors`},link:{tooltip:`Create link`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Edit caption`,input_placeholder:`Edit caption`},file_replace:{tooltip:{image:`Replace image`,video:`Replace video`,audio:`Replace audio`,file:`Replace file`}},file_rename:{tooltip:{image:`Rename image`,video:`Rename video`,audio:`Rename audio`,file:`Rename file`},input_placeholder:{image:`Rename image`,video:`Rename video`,audio:`Rename audio`,file:`Rename file`}},file_download:{tooltip:{image:`Download image`,video:`Download video`,audio:`Download audio`,file:`Download file`}},file_delete:{tooltip:{image:`Delete image`,video:`Delete video`,audio:`Delete audio`,file:`Delete file`}},file_preview_toggle:{tooltip:`Toggle preview`},nest:{tooltip:`Nest block`,secondary_tooltip:`Tab`},unnest:{tooltip:`Unnest block`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Align text left`},align_center:{tooltip:`Align text center`},align_right:{tooltip:`Align text right`},align_justify:{tooltip:`Justify text`},table_cell_merge:{tooltip:`Merge cells`},comment:{tooltip:`Add comment`}},file_panel:{upload:{title:`Upload`,file_placeholder:{image:`Upload image`,video:`Upload video`,audio:`Upload audio`,file:`Upload file`},upload_error:`Error: Upload failed`},embed:{title:`Embed`,embed_button:{image:`Embed image`,video:`Embed video`,audio:`Embed audio`,file:`Embed file`},url_placeholder:`Enter URL`}},link_toolbar:{delete:{tooltip:`Remove link`},edit:{text:`Edit link`,tooltip:`Edit`},open:{tooltip:`Open in new tab`},form:{title_placeholder:`Edit title`,url_placeholder:`Edit URL`}},comments:{edited:`edited`,save_button_text:`Save`,cancel_button_text:`Cancel`,deleted_reference_text:`Original content deleted`,discard_pending_comment:`Are you sure you want to discard this comment?`,actions:{add_reaction:`Add reaction`,resolve:`Resolve`,reopen:`Re-open`,edit_comment:`Edit comment`,delete_comment:`Delete comment`,more_actions:`More actions`},reactions:{reacted_by:`Reacted by`},sidebar:{marked_as_resolved:`Marked as resolved`,more_replies:e=>`${e} more replies`}},suggestion_changes:{formatting_change:`Formatting Change`,deleted:`Deleted`,inserted:`Inserted`,inserted_by:e=>`Inserted by: ${e}`,deleted_by:e=>`Deleted by: ${e}`,changed:`Changed`,changed_by:e=>`Changed by: ${e}`,formatting_change_by:(e,t)=>`Formatting change (${e}) by: ${t}`},versioning:{start_of_document:`Start of document`,compare_since_beginning_menuitem:`Compare since beginning`,title:`History`,close:`Close`,show_named_only:`Show named versions only`,show_all:`Show all versions`,comparison_on:`Turn on comparison`,comparison_off:`Turn off comparison`,versions_list:`Versions`,empty:`No versions yet`,empty_named_only:`No named versions`,current_version:`Current version`,before_restore:`Before restore`,comparing_to:`Comparing to`,restored_from:e=>`Restored from ${e}`,more_actions:`More actions`,version_name_input:`Version name`,name_version_menuitem:`Name this version`,rename_menuitem:`Rename`,compare_with_menuitem:`Compare with this version`,restore_menuitem:`Restore`,delete_menuitem:`Delete`,action_failed:`Something went wrong. Please try again.`,history_load_failed:`Failed to load version history`},exporter:{open_file:`Open file`,open_video_file:`Open video`,open_audio_file:`Open audio`},generic:{loading:`Loading...`,load_more:`Load more`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}},Mf={en:jf,"zh-cn":{slash_menu:{heading:{title:`一级标题`,subtext:`用于顶级标题`,aliases:[`h`,`heading1`,`h1`,`标题`,`一级标题`],group:`标题`},heading_2:{title:`二级标题`,subtext:`用于关键部分`,aliases:[`h2`,`heading2`,`subheading`,`标题`,`二级标题`,`副标题`],group:`标题`},heading_3:{title:`三级标题`,subtext:`用于小节和分组标题`,aliases:[`h3`,`heading3`,`subheading`,`标题`,`三级标题`],group:`标题`},heading_4:{title:`四级标题`,subtext:`用于较小的子节标题`,aliases:[`h4`,`heading4`,`subheading4`,`四级标题`],group:`副标题`},heading_5:{title:`五级标题`,subtext:`用于较小的子节标题`,aliases:[`h5`,`heading5`,`subheading5`,`五级标题`],group:`副标题`},heading_6:{title:`六级标题`,subtext:`用于最低层级的标题`,aliases:[`h6`,`heading6`,`subheading6`,`六级标题`],group:`副标题`},toggle_heading:{title:`可折叠一级标题`,subtext:`可折叠的顶级标题`,aliases:[`h`,`heading1`,`h1`,`标题`,`一级标题`,`折叠`],group:`副标题`},toggle_heading_2:{title:`可折叠二级标题`,subtext:`可折叠的关键部分标题`,aliases:[`h2`,`heading2`,`subheading`,`标题`,`二级标题`,`副标题`,`折叠`],group:`副标题`},toggle_heading_3:{title:`可折叠三级标题`,subtext:`可折叠的小节和分组标题`,aliases:[`h3`,`heading3`,`subheading`,`标题`,`三级标题`,`折叠`],group:`副标题`},quote:{title:`引用`,subtext:`引用或摘录`,aliases:[`quotation`,`blockquote`,`bq`],group:`基本块`},numbered_list:{title:`有序列表`,subtext:`用于显示有序列表`,aliases:[`ol`,`li`,`list`,`numberedlist`,`numbered list`,`列表`,`有序列表`],group:`基础`},bullet_list:{title:`无序列表`,subtext:`用于显示无序列表`,aliases:[`ul`,`li`,`list`,`bulletlist`,`bullet list`,`列表`,`无序列表`],group:`基础`},check_list:{title:`检查清单`,subtext:`用于显示带有复选框的列表`,aliases:[`ul`,`li`,`checklist`,`checked list`,`列表`,`检查清单`,`勾选列表`,`复选框`],group:`基础`},toggle_list:{title:`可折叠列表`,subtext:`带有可隐藏子项的列表`,aliases:[`li`,`列表`,`可折叠列表`,`折叠列表`],group:`基础`},paragraph:{title:`段落`,subtext:`用于文档正文`,aliases:[`p`,`paragraph`,`text`,`正文`],group:`基础`},code_block:{title:`代码块`,subtext:`用于显示带有语法高亮的代码块`,aliases:[`code`,`pre`,`代码`,`预格式`],group:`基础`},page_break:{title:`分页符`,subtext:`页面分隔符`,aliases:[`page`,`break`,`separator`,`分页`,`分隔符`],group:`基础`},table:{title:`表格`,subtext:`使用表格`,aliases:[`table`,`表格`],group:`高级功能`},image:{title:`图片`,subtext:`插入图片`,aliases:[`图片`,`上传图片`,`上传`,`image`,`img`,`相册`,`媒体`,`url`],group:`媒体`},video:{title:`视频`,subtext:`插入视频`,aliases:[`视频`,`视频上传`,`上传`,`video`,`mp4`,`电影`,`媒体`,`url`,`驱动`,`dropbox`],group:`媒体`},audio:{title:`音频`,subtext:`插入音频`,aliases:[`音频`,`音频上传`,`上传`,`audio`,`mp3`,`声音`,`媒体`,`url`,`驱动`,`dropbox`],group:`媒体`},file:{title:`文件`,subtext:`插入文件`,aliases:[`文件`,`上传`,`file`,`嵌入`,`媒体`,`url`],group:`媒体`},emoji:{title:`表情符号`,subtext:`用于插入表情符号`,aliases:[`表情符号`,`emoji`,`face`,`emote`,`表情`,`表情表达`,`表情`],group:`其他`},divider:{title:`分隔线`,subtext:`分隔线区块`,aliases:[`divider`,`hr`,`horizontal rule`],group:`基础区块`}},placeholders:{default:`输入 '/' 以使用命令`,heading:`标题`,toggleListItem:`切换`,bulletListItem:`列表`,numberedListItem:`列表`,checkListItem:`列表`,new_comment:`写评论...`,edit_comment:`编辑评论...`,comment_reply:`添加评论...`},file_blocks:{add_button_text:{image:`添加图片`,video:`添加视频`,audio:`添加音频`,file:`添加文件`}},toggle_blocks:{add_block_button:`空的切换区。点击添加区块。`,toggle_button:`展开或收起`},code_block:{add_source_button_text:`添加源代码`,ok_button_text:`确定`},side_menu:{add_block_label:`添加块`,drag_handle_label:`打开菜单`},drag_handle:{delete_menuitem:`删除`,colors_menuitem:`颜色`,header_row_menuitem:`行标题`,header_column_menuitem:`列标题`},table_handle:{delete_column_menuitem:`删除列`,delete_row_menuitem:`删除行`,add_left_menuitem:`左侧添加列`,add_right_menuitem:`右侧添加列`,add_above_menuitem:`上方添加行`,add_below_menuitem:`下方添加行`,split_cell_menuitem:`拆分单元格`,merge_cells_menuitem:`合并单元格`,background_color_menuitem:`背景色`},suggestion_menu:{no_items_title:`无匹配项`},color_picker:{text_title:`文本`,background_title:`背景色`,colors:{default:`自动`,gray:`灰色`,brown:`棕色`,red:`红色`,orange:`橙色`,yellow:`黄色`,green:`绿色`,blue:`蓝色`,purple:`紫色`,pink:`粉色`}},formatting_toolbar:{bold:{tooltip:`加粗`,secondary_tooltip:`Mod+B`},italic:{tooltip:`斜体`,secondary_tooltip:`Mod+I`},underline:{tooltip:`下划线`,secondary_tooltip:`Mod+U`},strike:{tooltip:`删除线`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`代码标记`,secondary_tooltip:``},colors:{tooltip:`颜色`},link:{tooltip:`添加链接`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`编辑标题`,input_placeholder:`编辑标题`},file_replace:{tooltip:{image:`替换图片`,video:`替换视频`,audio:`替换音频`,file:`替换文件`}},file_rename:{tooltip:{image:`重命名图片`,video:`重命名视频`,audio:`重命名音频`,file:`重命名文件`},input_placeholder:{image:`重命名图片`,video:`重命名视频`,audio:`重命名音频`,file:`重命名文件`}},file_download:{tooltip:{image:`下载图片`,video:`下载视频`,audio:`下载音频`,file:`下载文件`}},file_delete:{tooltip:{image:`删除图片`,video:`删除视频`,audio:`删除音频`,file:`删除文件`}},file_preview_toggle:{tooltip:`切换预览`},nest:{tooltip:`嵌套`,secondary_tooltip:`Tab`},unnest:{tooltip:`取消嵌套`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`左对齐`},align_center:{tooltip:`居中`},align_right:{tooltip:`右对齐`},align_justify:{tooltip:`文本对齐`},table_cell_merge:{tooltip:`合并单元格`},comment:{tooltip:`添加评论`}},file_panel:{upload:{title:`上传`,file_placeholder:{image:`上传图片`,video:`上传视频`,audio:`上传音频`,file:`上传文件`},upload_error:`Error:上传失败`},embed:{title:`嵌入`,embed_button:{image:`嵌入图片`,video:`嵌入视频`,audio:`嵌入音频`,file:`嵌入文件`},url_placeholder:`输入图片地址`}},link_toolbar:{delete:{tooltip:`清除链接`},edit:{text:`编辑链接`,tooltip:`编辑`},open:{tooltip:`新窗口打开`},form:{title_placeholder:`编辑标题`,url_placeholder:`编辑链接地址`}},comments:{edited:`已编辑`,save_button_text:`保存`,cancel_button_text:`取消`,deleted_reference_text:`原始内容已删除`,discard_pending_comment:`确定要放弃此评论吗?`,actions:{add_reaction:`添加反应`,resolve:`解决`,reopen:`重新打开`,edit_comment:`编辑评论`,delete_comment:`删除评论`,more_actions:`更多操作`},reactions:{reacted_by:`已回应`},sidebar:{marked_as_resolved:`标记为已解决`,more_replies:e=>`还有 ${e} 条回复`}},suggestion_changes:{formatting_change:`格式更改`,deleted:`已删除`,inserted:`已插入`,inserted_by:e=>`插入者:${e}`,deleted_by:e=>`删除者:${e}`,changed:`已更改`,changed_by:e=>`更改者:${e}`,formatting_change_by:(e,t)=>`格式更改(${e}),更改者:${t}`},versioning:{start_of_document:`文档开始`,compare_since_beginning_menuitem:`从头开始比较`,title:`历史记录`,close:`关闭`,show_named_only:`仅显示已命名的版本`,show_all:`显示所有版本`,comparison_on:`开启对比`,comparison_off:`关闭对比`,versions_list:`版本`,empty:`暂无版本`,empty_named_only:`暂无命名版本`,current_version:`当前版本`,before_restore:`恢复前`,comparing_to:`对比对象`,restored_from:e=>`恢复自 ${e}`,more_actions:`更多操作`,version_name_input:`版本名称`,name_version_menuitem:`命名此版本`,rename_menuitem:`重命名`,compare_with_menuitem:`与此版本对比`,restore_menuitem:`恢复`,delete_menuitem:`删除`,action_failed:`出错了,请重试。`,history_load_failed:`无法加载版本历史记录`},exporter:{open_file:`打开文件`,open_video_file:`打开视频`,open_audio_file:`打开音频`},generic:{loading:`加载中...`,load_more:`加载更多`,ctrl_shortcut:`Ctrl`,form_submit:`确定`}},"zh-tw":{slash_menu:{heading:{title:`一級標題`,subtext:`用於頂級標題`,aliases:[`h`,`heading1`,`h1`,`標題`,`一級標題`],group:`標題`},heading_2:{title:`二級標題`,subtext:`用於關鍵部分`,aliases:[`h2`,`heading2`,`subheading`,`標題`,`二級標題`,`副標題`],group:`標題`},heading_3:{title:`三級標題`,subtext:`用於小節和分組標題`,aliases:[`h3`,`heading3`,`subheading`,`標題`,`三級標題`],group:`標題`},heading_4:{title:`四級標題`,subtext:`用於小節和分組標題`,aliases:[`h4`,`heading4`,`subheading`,`標題`,`四級標題`],group:`副標題`},heading_5:{title:`五級標題`,subtext:`用於小節和分組標題`,aliases:[`h5`,`heading5`,`subheading`,`標題`,`五級標題`],group:`副標題`},heading_6:{title:`六級標題`,subtext:`用於小節和分組標題`,aliases:[`h6`,`heading6`,`subheading`,`標題`,`六級標題`],group:`副標題`},toggle_heading:{title:`可摺疊一級標題`,subtext:`可摺疊的頂級標題`,aliases:[`h`,`heading1`,`h1`,`標題`,`一級標題`,`摺疊`],group:`副標題`},toggle_heading_2:{title:`可摺疊二級標題`,subtext:`可摺疊的關鍵部分標題`,aliases:[`h2`,`heading2`,`subheading`,`標題`,`二級標題`,`副標題`,`摺疊`],group:`副標題`},toggle_heading_3:{title:`可摺疊三級標題`,subtext:`可摺疊的小節和分組標題`,aliases:[`h3`,`heading3`,`subheading`,`標題`,`三級標題`,`摺疊`],group:`副標題`},quote:{title:`引用`,subtext:`引用或摘錄`,aliases:[`quotation`,`blockquote`,`bq`],group:`基本區塊`},numbered_list:{title:`有序列表`,subtext:`用於顯示有序列表`,aliases:[`ol`,`li`,`list`,`numberedlist`,`numbered list`,`列表`,`有序列表`],group:`基礎`},bullet_list:{title:`無序列表`,subtext:`用於顯示無序列表`,aliases:[`ul`,`li`,`list`,`bulletlist`,`bullet list`,`列表`,`無序列表`],group:`基礎`},check_list:{title:`檢查清單`,subtext:`用於顯示帶有核取方塊的列表`,aliases:[`ul`,`li`,`checklist`,`checked list`,`列表`,`檢查清單`,`勾選列表`,`核取方塊`],group:`基礎`},toggle_list:{title:`可摺疊列表`,subtext:`帶有可隱藏子項的列表`,aliases:[`li`,`列表`,`可摺疊列表`,`摺疊列表`],group:`基礎`},paragraph:{title:`段落`,subtext:`用於文件正文`,aliases:[`p`,`paragraph`,`text`,`正文`],group:`基礎`},code_block:{title:`程式碼區塊`,subtext:`用於顯示帶有語法標記的程式碼區塊`,aliases:[`code`,`pre`,`程式碼`,`預格式`],group:`基礎`},page_break:{title:`分頁符`,subtext:`頁面分隔符`,aliases:[`page`,`break`,`separator`,`分頁`,`分隔符`],group:`基礎`},table:{title:`表格`,subtext:`使用表格`,aliases:[`table`,`表格`],group:`進階功能`},image:{title:`圖片`,subtext:`插入圖片`,aliases:[`圖片`,`上傳圖片`,`上傳`,`image`,`img`,`相簿`,`媒體`,`url`],group:`媒體`},video:{title:`影片`,subtext:`插入影片`,aliases:[`影片`,`影片上傳`,`上傳`,`video`,`mp4`,`電影`,`媒體`,`url`,`雲端硬碟`,`dropbox`],group:`媒體`},audio:{title:`音訊`,subtext:`插入音訊`,aliases:[`音訊`,`音訊上傳`,`上傳`,`audio`,`mp3`,`聲音`,`媒體`,`url`,`雲端硬碟`,`dropbox`],group:`媒體`},file:{title:`檔案`,subtext:`插入檔案`,aliases:[`檔案`,`上傳`,`file`,`嵌入`,`媒體`,`url`],group:`媒體`},emoji:{title:`表情符號`,subtext:`用於插入表情符號`,aliases:[`表情符號`,`emoji`,`face`,`emote`,`表情`,`表情表達`,`表情`],group:`其他`},divider:{title:`分隔線`,subtext:`分隔線區塊`,aliases:[`divider`,`hr`,`horizontal rule`],group:`基礎區塊`}},placeholders:{default:`輸入 '/' 以使用指令`,heading:`標題`,toggleListItem:`切換`,bulletListItem:`列表`,numberedListItem:`列表`,checkListItem:`列表`,new_comment:`撰寫評論...`,edit_comment:`編輯評論...`,comment_reply:`新增評論...`},file_blocks:{add_button_text:{image:`新增圖片`,video:`新增影片`,audio:`新增音訊`,file:`新增檔案`}},toggle_blocks:{add_block_button:`空的切換區。點擊新增區塊。`,toggle_button:`展開或收合`},code_block:{add_source_button_text:`新增原始碼`,ok_button_text:`確定`},side_menu:{add_block_label:`新增區塊`,drag_handle_label:`開啟選單`},drag_handle:{delete_menuitem:`刪除`,colors_menuitem:`顏色`,header_row_menuitem:`列標題`,header_column_menuitem:`欄標題`},table_handle:{delete_column_menuitem:`刪除欄`,delete_row_menuitem:`刪除列`,add_left_menuitem:`左側新增欄`,add_right_menuitem:`右側新增欄`,add_above_menuitem:`上方新增列`,add_below_menuitem:`下方新增列`,split_cell_menuitem:`分割儲存格`,merge_cells_menuitem:`合併儲存格`,background_color_menuitem:`背景色`},suggestion_menu:{no_items_title:`無相符項目`},color_picker:{text_title:`文字`,background_title:`背景色`,colors:{default:`自動`,gray:`灰色`,brown:`棕色`,red:`紅色`,orange:`橙色`,yellow:`黃色`,green:`綠色`,blue:`藍色`,purple:`紫色`,pink:`粉色`}},formatting_toolbar:{bold:{tooltip:`粗體`,secondary_tooltip:`Mod+B`},italic:{tooltip:`斜體`,secondary_tooltip:`Mod+I`},underline:{tooltip:`底線`,secondary_tooltip:`Mod+U`},strike:{tooltip:`刪除線`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`程式碼標記`,secondary_tooltip:``},colors:{tooltip:`顏色`},link:{tooltip:`新增連結`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`編輯標題`,input_placeholder:`編輯標題`},file_replace:{tooltip:{image:`替換圖片`,video:`替換影片`,audio:`替換音訊`,file:`替換檔案`}},file_rename:{tooltip:{image:`重新命名圖片`,video:`重新命名影片`,audio:`重新命名音訊`,file:`重新命名檔案`},input_placeholder:{image:`重新命名圖片`,video:`重新命名影片`,audio:`重新命名音訊`,file:`重新命名檔案`}},file_download:{tooltip:{image:`下載圖片`,video:`下載影片`,audio:`下載音訊`,file:`下載檔案`}},file_delete:{tooltip:{image:`刪除圖片`,video:`刪除影片`,audio:`刪除音訊`,file:`刪除檔案`}},file_preview_toggle:{tooltip:`切換預覽`},nest:{tooltip:`巢狀`,secondary_tooltip:`Tab`},unnest:{tooltip:`取消巢狀`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`靠左對齊`},align_center:{tooltip:`置中`},align_right:{tooltip:`靠右對齊`},align_justify:{tooltip:`兩端對齊`},table_cell_merge:{tooltip:`合併儲存格`},comment:{tooltip:`新增評論`}},file_panel:{upload:{title:`上傳`,file_placeholder:{image:`上傳圖片`,video:`上傳影片`,audio:`上傳音訊`,file:`上傳檔案`},upload_error:`錯誤:上傳失敗`},embed:{title:`嵌入`,embed_button:{image:`嵌入圖片`,video:`嵌入影片`,audio:`嵌入音訊`,file:`嵌入檔案`},url_placeholder:`輸入圖片網址`}},link_toolbar:{delete:{tooltip:`清除連結`},edit:{text:`編輯連結`,tooltip:`編輯`},open:{tooltip:`在新視窗開啟`},form:{title_placeholder:`編輯標題`,url_placeholder:`編輯連結網址`}},comments:{edited:`已編輯`,save_button_text:`儲存`,cancel_button_text:`取消`,deleted_reference_text:`原始內容已刪除`,discard_pending_comment:`確定要捨棄此評論嗎?`,actions:{add_reaction:`新增回應`,resolve:`解決`,reopen:`重新開啟`,edit_comment:`編輯評論`,delete_comment:`刪除評論`,more_actions:`更多操作`},reactions:{reacted_by:`已回應`},sidebar:{marked_as_resolved:`標記為已解決`,more_replies:e=>`還有 ${e} 則回覆`}},suggestion_changes:{formatting_change:`格式變更`,deleted:`已刪除`,inserted:`已插入`,inserted_by:e=>`插入者:${e}`,deleted_by:e=>`刪除者:${e}`,changed:`已變更`,changed_by:e=>`變更者:${e}`,formatting_change_by:(e,t)=>`格式變更(${e}),變更者:${t}`},versioning:{start_of_document:`文件開始`,compare_since_beginning_menuitem:`從頭開始比較`,title:`版本紀錄`,close:`關閉`,show_named_only:`僅顯示已命名的版本`,show_all:`顯示所有版本`,comparison_on:`開啟比較`,comparison_off:`關閉比較`,versions_list:`版本`,empty:`尚無版本`,empty_named_only:`尚無命名版本`,current_version:`目前版本`,before_restore:`還原前`,comparing_to:`比較對象`,restored_from:e=>`已從 ${e} 還原`,more_actions:`更多操作`,version_name_input:`版本名稱`,name_version_menuitem:`為此版本命名`,rename_menuitem:`重新命名`,compare_with_menuitem:`與此版本比較`,restore_menuitem:`還原`,delete_menuitem:`刪除`,action_failed:`發生錯誤,請再試一次。`,history_load_failed:`無法載入版本歷史記錄`},exporter:{open_file:`開啟檔案`,open_video_file:`開啟影片`,open_audio_file:`開啟音訊`},generic:{loading:`載入中...`,load_more:`載入更多`,ctrl_shortcut:`Ctrl`,form_submit:`確定`}},ja:{slash_menu:{heading:{title:`見出し1`,subtext:`トップレベルの見出しに使用`,aliases:[`h`,`見出し1`,`h1`,`大見出し`],group:`見出し`},heading_2:{title:`見出し2`,subtext:`重要なセクションに使用`,aliases:[`h2`,`見出し2`,`subheading`,`中見出し`],group:`見出し`},heading_3:{title:`見出し3`,subtext:`セクションやグループの見出しに使用`,aliases:[`h3`,`見出し3`,`subheading`,`小見出し`],group:`見出し`},heading_4:{title:`見出し4`,subtext:`小さなサブセクションの見出しに使用`,aliases:[`h4`,`見出し4`,`subheading4`,`小見出し4`],group:`サブ見出し`},heading_5:{title:`見出し5`,subtext:`小さなサブセクションの見出しに使用`,aliases:[`h5`,`見出し5`,`subheading5`,`小見出し5`],group:`サブ見出し`},heading_6:{title:`見出し6`,subtext:`最下位レベルの見出しに使用`,aliases:[`h6`,`見出し6`,`subheading6`,`小見出し6`],group:`サブ見出し`},toggle_heading:{title:`折りたたみ見出し1`,subtext:`内容の表示/非表示が切り替え可能なトップレベルの見出し`,aliases:[`h`,`見出し1`,`h1`,`大見出し`,`折りたたみ`,`トグル`],group:`サブ見出し`},toggle_heading_2:{title:`折りたたみ見出し2`,subtext:`内容の表示/非表示が切り替え可能な重要なセクションの見出し`,aliases:[`h2`,`見出し2`,`subheading`,`中見出し`,`折りたたみ`,`トグル`],group:`サブ見出し`},toggle_heading_3:{title:`折りたたみ見出し3`,subtext:`内容の表示/非表示が切り替え可能なセクションやグループの見出し`,aliases:[`h3`,`見出し3`,`subheading`,`小見出し`,`折りたたみ`,`トグル`],group:`サブ見出し`},quote:{title:`引用`,subtext:`引用または抜粋`,aliases:[`quotation`,`blockquote`,`bq`],group:`基本ブロック`},numbered_list:{title:`番号付リスト`,subtext:`番号付リストを表示するために使用`,aliases:[`ol`,`li`,`numberedlist`,`numbered list`,`リスト`,`番号付リスト`,`番号 リスト`],group:`基本ブロック`},bullet_list:{title:`箇条書き`,subtext:`箇条書きを表示するために使用`,aliases:[`ul`,`li`,`bulletlist`,`bullet list`,`リスト`,`箇条書きリスト`],group:`基本ブロック`},check_list:{title:`チェックリスト`,subtext:`チェックボックス付きリストを表示するために使用されます`,aliases:[`ul`,`li`,`list`,`checklist`,`checked list`,`リスト`,`チェックリスト`,`チェックされたリスト`],group:`基本ブロック`},toggle_list:{title:`折りたたみリスト`,subtext:`サブ項目を非表示にできるリスト`,aliases:[`li`,`リスト`,`折りたたみリスト`,`トグルリスト`,`折りたたみリスト`],group:`基本ブロック`},paragraph:{title:`標準テキスト`,subtext:`本文に使用`,aliases:[`p`,`paragraph`,`標準テキスト`],group:`基本ブロック`},code_block:{title:`コードブロック`,subtext:`シンタックスハイライト付きのコードブロック`,aliases:[`code`,`pre`,`コード`,`コードブロック`],group:`基本ブロック`},page_break:{title:`改ページ`,subtext:`ページ区切り`,aliases:[`page`,`break`,`separator`,`改ページ`,`区切り`],group:`基本ブロック`},table:{title:`表`,subtext:`表に使用`,aliases:[`table`,`表`,`テーブル`],group:`高度なブロック`},image:{title:`画像`,subtext:`画像を挿入`,aliases:[`image`,`imageUpload`,`upload`,`img`,`picture`,`media`,`url`,`画像`],group:`メディア`},video:{title:`ビデオ`,subtext:`ビデオを挿入`,aliases:[`video`,`videoUpload`,`upload`,`mp4`,`film`,`media`,`url`,`ビデオ`],group:`メディア`},audio:{title:`オーディオ`,subtext:`オーディオを挿入`,aliases:[`audio`,`audioUpload`,`upload`,`mp3`,`sound`,`media`,`url`,`オーディオ`],group:`メディア`},file:{title:`ファイル`,subtext:`ファイルを挿入`,aliases:[`file`,`upload`,`embed`,`media`,`url`,`ファイル`],group:`メディア`},emoji:{title:`絵文字`,subtext:`絵文字を挿入するために使用します`,aliases:[`絵文字`,`顔文字`,`感情表現`,`顔`],group:`その他`},divider:{title:`区切り`,subtext:`区切りを表示するために使用`,aliases:[`divider`,`hr`,`horizontal rule`],group:`基本ブロック`}},placeholders:{default:`テキストを入力するか'/' を入力してコマンド選択`,heading:`見出し`,toggleListItem:`トグル`,bulletListItem:`リストを追加`,numberedListItem:`リストを追加`,checkListItem:`リストを追加`,new_comment:`コメントを書く...`,edit_comment:`コメントを編集...`,comment_reply:`コメントを追加...`},file_blocks:{add_button_text:{image:`画像を追加`,video:`ビデオを追加`,audio:`オーディオを追加`,file:`ファイルを追加`}},toggle_blocks:{add_block_button:`空のトグルです。クリックしてブロックを追加。`,toggle_button:`展開または折りたたみ`},code_block:{add_source_button_text:`ソースコードを追加`,ok_button_text:`OK`},side_menu:{add_block_label:`ブロックを追加`,drag_handle_label:`ブロックメニュー`},drag_handle:{delete_menuitem:`削除`,colors_menuitem:`色を変更`,header_row_menuitem:`行の見出し`,header_column_menuitem:`列の見出し`},table_handle:{delete_column_menuitem:`列を削除`,delete_row_menuitem:`行を削除`,add_left_menuitem:`左に列を追加`,add_right_menuitem:`右に列を追加`,add_above_menuitem:`上に行を追加`,add_below_menuitem:`下に行を追加`,split_cell_menuitem:`セルを分割`,merge_cells_menuitem:`セルを結合`,background_color_menuitem:`背景色を変更`},suggestion_menu:{no_items_title:`アイテムが見つかりません`},color_picker:{text_title:`文字色`,background_title:`背景色`,colors:{default:`自動`,gray:`グレー`,brown:`茶色`,red:`赤`,orange:`オレンジ`,yellow:`黄色`,green:`緑`,blue:`青`,purple:`紫`,pink:`ピンク`}},formatting_toolbar:{bold:{tooltip:`太字`,secondary_tooltip:`Mod+B`},italic:{tooltip:`斜体`,secondary_tooltip:`Mod+I`},underline:{tooltip:`下線`,secondary_tooltip:`Mod+U`},strike:{tooltip:`打ち消し`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`コード`,secondary_tooltip:``},colors:{tooltip:`色`},link:{tooltip:`リンク`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`キャプションを編集`,input_placeholder:`キャプションを編集`},file_replace:{tooltip:{image:`画像を置換`,video:`ビデオを置換`,audio:`オーディオを置換`,file:`ファイルを置換`}},file_rename:{tooltip:{image:`画像の名前を変更`,video:`ビデオの名前を変更`,audio:`オーディオの名前を変更`,file:`ファイルの名前を変更`},input_placeholder:{image:`画像の名前を変更`,video:`ビデオの名前を変更`,audio:`オーディオの名前を変更`,file:`ファイルの名前を変更`}},file_download:{tooltip:{image:`画像をダウンロード`,video:`ビデオをダウンロード`,audio:`オーディオをダウンロード`,file:`ファイルをダウンロード`}},file_delete:{tooltip:{image:`画像を削除`,video:`ビデオを削除`,audio:`オーディオを削除`,file:`ファイルを削除`}},file_preview_toggle:{tooltip:`プレビューの切り替え`},nest:{tooltip:`インデント増`,secondary_tooltip:`Tab`},unnest:{tooltip:`インデント減`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`左揃え`},align_center:{tooltip:`中央揃え`},align_right:{tooltip:`右揃え`},align_justify:{tooltip:`両端揃え`},table_cell_merge:{tooltip:`セルを結合`},comment:{tooltip:`コメントを追加`}},file_panel:{upload:{title:`アップロード`,file_placeholder:{image:`画像をアップロード`,video:`ビデオをアップロード`,audio:`オーディオをアップロード`,file:`ファイルをアップロード`},upload_error:`エラー: アップロードが失敗しました`},embed:{title:`埋め込み`,embed_button:{image:`画像を埋め込む`,video:`ビデオを埋め込む`,audio:`オーディオを埋め込む`,file:`ファイルを埋め込む`},url_placeholder:`URLを入力`}},link_toolbar:{delete:{tooltip:`リンクを解除`},edit:{text:`リンクを編集`,tooltip:`編集`},open:{tooltip:`新しいタブでリンクを開く`},form:{title_placeholder:`タイトルを編集`,url_placeholder:`URLを編集`}},comments:{edited:`編集済み`,save_button_text:`保存`,cancel_button_text:`キャンセル`,deleted_reference_text:`元のコンテンツが削除されました`,discard_pending_comment:`このコメントを破棄してもよろしいですか?`,actions:{add_reaction:`リアクションを追加`,resolve:`解決`,reopen:`再開`,edit_comment:`コメントを編集`,delete_comment:`コメントを削除`,more_actions:`その他の操作`},reactions:{reacted_by:`リアクションした人`},sidebar:{marked_as_resolved:`解決済みとしてマーク`,more_replies:e=>`${e} 件の追加返信`}},suggestion_changes:{formatting_change:`書式の変更`,deleted:`削除済み`,inserted:`挿入済み`,inserted_by:e=>`挿入者: ${e}`,deleted_by:e=>`削除者: ${e}`,changed:`変更済み`,changed_by:e=>`変更者: ${e}`,formatting_change_by:(e,t)=>`書式の変更 (${e}) 変更者: ${t}`},versioning:{start_of_document:`ドキュメントの開始`,compare_since_beginning_menuitem:`最初から比較`,title:`履歴`,close:`閉じる`,show_named_only:`名前付きバージョンのみ表示`,show_all:`すべてのバージョンを表示`,comparison_on:`比較を有効にする`,comparison_off:`比較を無効にする`,versions_list:`バージョン`,empty:`バージョンはまだありません`,empty_named_only:`名前付きのバージョンはありません`,current_version:`現在のバージョン`,before_restore:`復元前`,comparing_to:`比較対象`,restored_from:e=>`${e} から復元`,more_actions:`その他の操作`,version_name_input:`バージョン名`,name_version_menuitem:`このバージョンに名前を付ける`,rename_menuitem:`名前を変更`,compare_with_menuitem:`このバージョンと比較`,restore_menuitem:`復元`,delete_menuitem:`削除`,action_failed:`問題が発生しました。もう一度お試しください。`,history_load_failed:`バージョン履歴を読み込めませんでした`},exporter:{open_file:`ファイルを開く`,open_video_file:`動画を開く`,open_audio_file:`音声を開く`},generic:{loading:`読み込み中...`,load_more:`さらに読み込む`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}},ko:{slash_menu:{heading:{title:`제목1`,subtext:`섹션 제목(대)`,aliases:[`h`,`제목1`,`h1`,`대제목`],group:`제목`},heading_2:{title:`제목2`,subtext:`섹션 제목(중)`,aliases:[`h2`,`제목2`,`중제목`],group:`제목`},heading_3:{title:`제목3`,subtext:`섹션 제목(소)`,aliases:[`h3`,`제목3`,`subheading`],group:`제목`},heading_4:{title:`제목4`,subtext:`하위 소단락 제목`,aliases:[`h4`,`제목4`,`소제목4`],group:`소제목`},heading_5:{title:`제목5`,subtext:`작은 하위 섹션 제목`,aliases:[`h5`,`제목5`,`소제목5`],group:`소제목`},heading_6:{title:`제목6`,subtext:`가장 하위 수준 제목`,aliases:[`h6`,`제목6`,`소제목6`],group:`소제목`},toggle_heading:{title:`접을 수 있는 제목1`,subtext:`내용을 표시하거나 숨길 수 있는 섹션 제목(대)`,aliases:[`h`,`제목1`,`h1`,`대제목`,`접기`,`토글`],group:`소제목`},toggle_heading_2:{title:`접을 수 있는 제목2`,subtext:`내용을 표시하거나 숨길 수 있는 섹션 제목(중)`,aliases:[`h2`,`제목2`,`중제목`,`접기`,`토글`],group:`소제목`},toggle_heading_3:{title:`접을 수 있는 제목3`,subtext:`내용을 표시하거나 숨길 수 있는 섹션 제목(소)`,aliases:[`h3`,`제목3`,`subheading`,`접기`,`토글`],group:`소제목`},quote:{title:`인용`,subtext:`인용문 또는 발췌`,aliases:[`quotation`,`blockquote`,`bq`],group:`기본 블록`},numbered_list:{title:`번호 매기기 목록`,subtext:`번호가 매겨진 목록을 추가합니다.`,aliases:[`ol`,`li`,`목록`,`번호 매기기 목록`,`번호 목록`],group:`기본 블록`},bullet_list:{title:`글머리 기호 목록`,subtext:`간단한 글머리 기호를 추가합니다.`,aliases:[`ul`,`li`,`목록`,`글머리 기호 목록`,`글머리 목록`],group:`기본 블록`},check_list:{title:`체크리스트`,subtext:`체크박스가 있는 목록을 표시하는 데 사용`,aliases:[`ul`,`li`,`목록`,`체크리스트`,`체크 리스트`,`체크된 목록`,`체크박스`],group:`기본 블록`},toggle_list:{title:`접을 수 있는 목록`,subtext:`숨길 수 있는 하위 항목이 있는 목록`,aliases:[`li`,`목록`,`접을 수 있는 목록`,`토글 목록`,`접기 목록`],group:`기본 블록`},paragraph:{title:`본문`,subtext:`일반 텍스트`,aliases:[`p`,`paragraph`,`본문`],group:`기본 블록`},code_block:{title:`코드 블록`,subtext:`구문 강조가 있는 코드 블록`,aliases:[`code`,`pre`],group:`기본 블록`},page_break:{title:`페이지 나누기`,subtext:`페이지 구분자`,aliases:[`page`,`break`,`separator`,`페이지`,`구분자`],group:`기본 블록`},table:{title:`표`,subtext:`간단한 표를 추가합니다.`,aliases:[`표`],group:`고급`},image:{title:`이미지`,subtext:`이미지 파일을 업로드합니다.`,aliases:[`image`,`imageUpload`,`upload`,`img`,`picture`,`media`,`이미지`,`url`],group:`미디어`},video:{title:`비디오`,subtext:`비디오 삽입`,aliases:[`video`,`videoUpload`,`upload`,`mp4`,`film`,`media`,`동영상`,`url`],group:`미디어`},audio:{title:`오디오`,subtext:`오디오 삽입`,aliases:[`audio`,`audioUpload`,`upload`,`mp3`,`sound`,`media`,`오디오`,`url`],group:`미디어`},file:{title:`파일`,subtext:`파일 삽입`,aliases:[`file`,`upload`,`embed`,`media`,`파일`,`url`],group:`미디어`},emoji:{title:`이모지`,subtext:`이모지 삽입용으로 사용됩니다`,aliases:[`이모지`,`emoji`,`감정 표현`,`emotion expression`,`표정`,`face expression`,`얼굴`,`face`],group:`기타`},divider:{title:`구분선`,subtext:`구분선 블록`,aliases:[`divider`,`hr`,`horizontal rule`],group:`기본 블록`}},placeholders:{default:`텍스트를 입력하거나 /를 입력하여 명령을 입력하세요.`,heading:`제목`,toggleListItem:`토글`,bulletListItem:`목록`,numberedListItem:`목록`,checkListItem:`목록`,new_comment:`댓글 작성...`,edit_comment:`댓글 수정...`,comment_reply:`댓글 추가...`},file_blocks:{add_button_text:{image:`이미지 추가`,video:`비디오 추가`,audio:`오디오 추가`,file:`파일 추가`}},toggle_blocks:{add_block_button:`비어 있는 토글입니다. 클릭하여 블록을 추가하세요.`,toggle_button:`펼치기 또는 접기`},code_block:{add_source_button_text:`소스 코드 추가`,ok_button_text:`확인`},side_menu:{add_block_label:`블록 추가`,drag_handle_label:`블록 메뉴 열기`},drag_handle:{delete_menuitem:`삭제`,colors_menuitem:`색깔`,header_row_menuitem:`행 제목`,header_column_menuitem:`열 제목`},table_handle:{delete_column_menuitem:`열 1개 삭제`,delete_row_menuitem:`행 삭제`,add_left_menuitem:`왼쪽에 열 1개 추가`,add_right_menuitem:`오른쪽에 열 1개 추가`,add_above_menuitem:`위에 행 1개 추가`,add_below_menuitem:`아래에 행 1개 추가`,split_cell_menuitem:`셀 분할`,merge_cells_menuitem:`셀 병합`,background_color_menuitem:`배경색 변경`},suggestion_menu:{no_items_title:`항목을 찾을 수 없음`},color_picker:{text_title:`텍스트`,background_title:`배경`,colors:{default:`자동`,gray:`회색`,brown:`갈색`,red:`빨간색`,orange:`주황색`,yellow:`노란색`,green:`녹색`,blue:`파란색`,purple:`보라색`,pink:`분홍색`}},formatting_toolbar:{bold:{tooltip:`진하게`,secondary_tooltip:`Mod+B`},italic:{tooltip:`기울임`,secondary_tooltip:`Mod+I`},underline:{tooltip:`밑줄`,secondary_tooltip:`Mod+U`},strike:{tooltip:`취소선`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`코드`,secondary_tooltip:``},colors:{tooltip:`색깔`},link:{tooltip:`링크 만들기`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`이미지 캡션 수정`,input_placeholder:`이미지 캡션 수정`},file_replace:{tooltip:{image:`이미지 교체`,video:`비디오 교체`,audio:`오디오 교체`,file:`파일 교체`}},file_rename:{tooltip:{image:`이미지 이름 변경`,video:`비디오 이름 변경`,audio:`오디오 이름 변경`,file:`파일 이름 변경`},input_placeholder:{image:`이미지 이름 변경`,video:`비디오 이름 변경`,audio:`오디오 이름 변경`,file:`파일 이름 변경`}},file_download:{tooltip:{image:`이미지 다운로드`,video:`비디오 다운로드`,audio:`오디오 다운로드`,file:`파일 다운로드`}},file_delete:{tooltip:{image:`이미지 삭제`,video:`비디오 삭제`,audio:`오디오 삭제`,file:`파일 삭제`}},file_preview_toggle:{tooltip:`미리보기 전환`},nest:{tooltip:`중첩 블록`,secondary_tooltip:`Tab`},unnest:{tooltip:`비중첩 블록`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`텍스트 왼쪽 맞춤`},align_center:{tooltip:`텍스트 가운데 맞춤`},align_right:{tooltip:`텍스트 오른쪽 맞춤`},align_justify:{tooltip:`텍스트 양쪽 맞춤`},table_cell_merge:{tooltip:`셀 병합`},comment:{tooltip:`코멘트 추가`}},file_panel:{upload:{title:`업로드`,file_placeholder:{image:`이미지 업로드`,video:`비디오 업로드`,audio:`오디오 업로드`,file:`파일 업로드`},upload_error:`오류: 업로드 실패`},embed:{title:`임베드`,embed_button:{image:`이미지 삽입`,video:`비디오 삽입`,audio:`오디오 삽입`,file:`파일 삽입`},url_placeholder:`URL을 입력하세요.`}},link_toolbar:{delete:{tooltip:`링크 삭제`},edit:{text:`링크 수정`,tooltip:`수정`},open:{tooltip:`새 탭으로 열기`},form:{title_placeholder:`제목 수정`,url_placeholder:`URL 수정`}},comments:{edited:`수정됨`,save_button_text:`저장`,cancel_button_text:`취소`,deleted_reference_text:`원본 콘텐츠 삭제됨`,discard_pending_comment:`이 댓글을 삭제하시겠습니까?`,actions:{add_reaction:`반응 추가`,resolve:`해결`,reopen:`다시 열기`,edit_comment:`댓글 수정`,delete_comment:`댓글 삭제`,more_actions:`더 많은 작업`},reactions:{reacted_by:`반응한 사람`},sidebar:{marked_as_resolved:`해결됨으로 표시됨`,more_replies:e=>`${e}개의 추가 답글`}},suggestion_changes:{formatting_change:`서식 변경`,deleted:`삭제됨`,inserted:`삽입됨`,inserted_by:e=>`삽입한 사람: ${e}`,deleted_by:e=>`삭제한 사람: ${e}`,changed:`변경됨`,changed_by:e=>`변경한 사람: ${e}`,formatting_change_by:(e,t)=>`서식 변경 (${e}) 변경한 사람: ${t}`},versioning:{start_of_document:`문서 시작`,compare_since_beginning_menuitem:`처음부터 비교`,title:`기록`,close:`닫기`,show_named_only:`이름이 지정된 버전만 표시`,show_all:`모든 버전 표시`,comparison_on:`비교 켜기`,comparison_off:`비교 끄기`,versions_list:`버전`,empty:`아직 버전이 없습니다`,empty_named_only:`이름이 지정된 버전이 없습니다`,current_version:`현재 버전`,before_restore:`복원 전`,comparing_to:`비교 대상`,restored_from:e=>`${e}에서 복원됨`,more_actions:`추가 작업`,version_name_input:`버전 이름`,name_version_menuitem:`이 버전의 이름 지정`,rename_menuitem:`이름 바꾸기`,compare_with_menuitem:`이 버전과 비교`,restore_menuitem:`복원`,delete_menuitem:`삭제`,action_failed:`문제가 발생했습니다. 다시 시도해 주세요.`,history_load_failed:`버전 기록을 불러오지 못했습니다`},exporter:{open_file:`파일 열기`,open_video_file:`동영상 열기`,open_audio_file:`오디오 열기`},generic:{loading:`불러오는 중...`,load_more:`더 불러오기`,ctrl_shortcut:`Ctrl`,form_submit:`확인`}},es:{slash_menu:{heading:{title:`Encabezado 1`,subtext:`Encabezado de primer nivel`,aliases:[`h`,`encabezado1`,`h1`],group:`Encabezados`},heading_2:{title:`Encabezado 2`,subtext:`Encabezado de sección principal`,aliases:[`h2`,`encabezado2`,`subencabezado`],group:`Encabezados`},heading_3:{title:`Encabezado 3`,subtext:`Encabezado de subsección y grupo`,aliases:[`h3`,`encabezado3`,`subencabezado`],group:`Encabezados`},heading_4:{title:`Encabezado 4`,subtext:`Encabezado de subsección menor`,aliases:[`h4`,`encabezado4`,`subencabezado4`],group:`Subencabezados`},heading_5:{title:`Encabezado 5`,subtext:`Encabezado de subsección pequeña`,aliases:[`h5`,`encabezado5`,`subencabezado5`],group:`Subencabezados`},heading_6:{title:`Encabezado 6`,subtext:`Encabezado de nivel más bajo`,aliases:[`h6`,`encabezado6`,`subencabezado6`],group:`Subencabezados`},toggle_heading:{title:`Encabezado Plegable 1`,subtext:`Encabezado de primer nivel que se puede plegar`,aliases:[`h`,`encabezado1`,`h1`,`plegable`,`contraible`],group:`Subencabezados`},toggle_heading_2:{title:`Encabezado Plegable 2`,subtext:`Encabezado de sección principal que se puede plegar`,aliases:[`h2`,`encabezado2`,`subencabezado`,`plegable`,`contraible`],group:`Subencabezados`},toggle_heading_3:{title:`Encabezado Plegable 3`,subtext:`Encabezado de subsección y grupo que se puede plegar`,aliases:[`h3`,`encabezado3`,`subencabezado`,`plegable`,`contraible`],group:`Subencabezados`},quote:{title:`Cita`,subtext:`Cita o extracto`,aliases:[`quotation`,`blockquote`,`bq`],group:`Bloques básicos`},numbered_list:{title:`Lista Numerada`,subtext:`Lista con elementos ordenados`,aliases:[`ol`,`li`,`lista`,`lista numerada`],group:`Bloques básicos`},bullet_list:{title:`Lista con Viñetas`,subtext:`Lista con elementos no ordenados`,aliases:[`ul`,`li`,`lista`,`lista con viñetas`],group:`Bloques básicos`},check_list:{title:`Lista de Verificación`,subtext:`Lista con casillas de verificación`,aliases:[`ul`,`li`,`lista`,`lista de verificación`,`lista de chequeo`,`checkbox`],group:`Bloques básicos`},toggle_list:{title:`Lista Plegable`,subtext:`Lista con subelementos ocultables`,aliases:[`li`,`lista`,`lista plegable`,`lista colapsable`],group:`Bloques básicos`},paragraph:{title:`Párrafo`,subtext:`El cuerpo de tu documento`,aliases:[`p`,`párrafo`],group:`Bloques básicos`},code_block:{title:`Bloque de Código`,subtext:`Bloque de código con resaltado de sintaxis`,aliases:[`code`,`pre`],group:`Bloques básicos`},page_break:{title:`Salto de página`,subtext:`Separador de página`,aliases:[`page`,`break`,`separator`,`salto`,`separador`],group:`Bloques básicos`},table:{title:`Tabla`,subtext:`Tabla con celdas editables`,aliases:[`tabla`],group:`Avanzado`},image:{title:`Imagen`,subtext:`Imagen redimensionable con leyenda`,aliases:[`imagen`,`subir imagen`,`cargar`,`img`,`foto`,`media`,`url`],group:`Medios`},video:{title:`Vídeo`,subtext:`Vídeo redimensionable con leyenda`,aliases:[`video`,`subir vídeo`,`cargar`,`mp4`,`película`,`media`,`url`],group:`Medios`},audio:{title:`Audio`,subtext:`Audio incrustado con leyenda`,aliases:[`audio`,`subir audio`,`cargar`,`mp3`,`sonido`,`media`,`url`],group:`Medios`},file:{title:`Archivo`,subtext:`Archivo incrustado`,aliases:[`archivo`,`cargar`,`incrustar`,`media`,`url`],group:`Medios`},emoji:{title:`Emoji`,subtext:`Busca e inserta un emoji`,aliases:[`emoji`,`emoticono`,`emoción`,`cara`],group:`Otros`},divider:{title:`Divisor`,subtext:`Divisor de bloques`,aliases:[`divisor`,`hr`,`horizontal rule`],group:`Bloques básicos`}},placeholders:{default:`Escribe o teclea '/' para comandos`,heading:`Encabezado`,toggleListItem:`Plegable`,bulletListItem:`Lista`,numberedListItem:`Lista`,checkListItem:`Lista`,new_comment:`Escribe un comentario...`,edit_comment:`Editar comentario...`,comment_reply:`Agregar comentario...`},file_blocks:{add_button_text:{image:`Agregar imagen`,video:`Agregar vídeo`,audio:`Agregar audio`,file:`Agregar archivo`}},toggle_blocks:{add_block_button:`Toggle vacío. Haz clic para añadir un bloque.`,toggle_button:`Expandir o contraer`},code_block:{add_source_button_text:`Agregar código fuente`,ok_button_text:`Aceptar`},side_menu:{add_block_label:`Agregar bloque`,drag_handle_label:`Abrir menú de bloque`},drag_handle:{delete_menuitem:`Eliminar`,colors_menuitem:`Colores`,header_row_menuitem:`Fila de encabezado`,header_column_menuitem:`Columna de encabezado`},table_handle:{delete_column_menuitem:`Eliminar columna`,delete_row_menuitem:`Eliminar fila`,add_left_menuitem:`Agregar columna a la izquierda`,add_right_menuitem:`Agregar columna a la derecha`,add_above_menuitem:`Agregar fila arriba`,add_below_menuitem:`Agregar fila abajo`,split_cell_menuitem:`Dividir celda`,merge_cells_menuitem:`Combinar celdas`,background_color_menuitem:`Color de fondo`},suggestion_menu:{no_items_title:`No se encontraron elementos`},color_picker:{text_title:`Texto`,background_title:`Fondo`,colors:{default:`Automático`,gray:`Gris`,brown:`Marrón`,red:`Rojo`,orange:`Naranja`,yellow:`Amarillo`,green:`Verde`,blue:`Azul`,purple:`Morado`,pink:`Rosa`}},formatting_toolbar:{bold:{tooltip:`Negrita`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Cursiva`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Subrayado`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Tachado`,secondary_tooltip:`Mod+Shift+S`},code:{tooltip:`Código`,secondary_tooltip:``},colors:{tooltip:`Colores`},link:{tooltip:`Crear enlace`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Editar leyenda`,input_placeholder:`Editar leyenda`},file_replace:{tooltip:{image:`Reemplazar imagen`,video:`Reemplazar vídeo`,audio:`Reemplazar audio`,file:`Reemplazar archivo`}},file_rename:{tooltip:{image:`Renombrar imagen`,video:`Renombrar vídeo`,audio:`Renombrar audio`,file:`Renombrar archivo`},input_placeholder:{image:`Renombrar imagen`,video:`Renombrar vídeo`,audio:`Renombrar audio`,file:`Renombrar archivo`}},file_download:{tooltip:{image:`Descargar imagen`,video:`Descargar vídeo`,audio:`Descargar audio`,file:`Descargar archivo`}},file_delete:{tooltip:{image:`Eliminar imagen`,video:`Eliminar vídeo`,audio:`Eliminar audio`,file:`Eliminar archivo`}},file_preview_toggle:{tooltip:`Alternar vista previa`},nest:{tooltip:`Anidar bloque`,secondary_tooltip:`Tab`},unnest:{tooltip:`Desanidar bloque`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Alinear texto a la izquierda`},align_center:{tooltip:`Alinear texto al centro`},align_right:{tooltip:`Alinear texto a la derecha`},align_justify:{tooltip:`Justificar texto`},table_cell_merge:{tooltip:`Combinar celdas`},comment:{tooltip:`Añadir comentario`}},file_panel:{upload:{title:`Subir`,file_placeholder:{image:`Subir imagen`,video:`Subir vídeo`,audio:`Subir audio`,file:`Subir archivo`},upload_error:`Error: Fallo en la subida`},embed:{title:`Incrustar`,embed_button:{image:`Incrustar imagen`,video:`Incrustar vídeo`,audio:`Incrustar audio`,file:`Incrustar archivo`},url_placeholder:`Introduce la URL`}},link_toolbar:{delete:{tooltip:`Eliminar enlace`},edit:{text:`Editar enlace`,tooltip:`Editar`},open:{tooltip:`Abrir en nueva pestaña`},form:{title_placeholder:`Editar título`,url_placeholder:`Editar URL`}},comments:{edited:`editado`,save_button_text:`Guardar`,cancel_button_text:`Cancelar`,deleted_reference_text:`Contenido original eliminado`,discard_pending_comment:`¿Seguro que quieres descartar este comentario?`,actions:{add_reaction:`Agregar reacción`,resolve:`Resolver`,reopen:`Reabrir`,edit_comment:`Editar comentario`,delete_comment:`Eliminar comentario`,more_actions:`Más acciones`},reactions:{reacted_by:`Reaccionado por`},sidebar:{marked_as_resolved:`Marcado como resuelto`,more_replies:e=>`${e} respuestas más`}},suggestion_changes:{formatting_change:`Cambio de formato`,deleted:`Eliminado`,inserted:`Insertado`,inserted_by:e=>`Insertado por: ${e}`,deleted_by:e=>`Eliminado por: ${e}`,changed:`Modificado`,changed_by:e=>`Modificado por: ${e}`,formatting_change_by:(e,t)=>`Cambio de formato (${e}) por: ${t}`},versioning:{start_of_document:`Inicio del documento`,compare_since_beginning_menuitem:`Comparar desde el inicio`,title:`Historial`,close:`Cerrar`,show_named_only:`Mostrar solo versiones con nombre`,show_all:`Mostrar todas las versiones`,comparison_on:`Activar comparación`,comparison_off:`Desactivar comparación`,versions_list:`Versiones`,empty:`Aún no hay versiones`,empty_named_only:`No hay versiones con nombre`,current_version:`Versión actual`,before_restore:`Antes de restaurar`,comparing_to:`Comparando con`,restored_from:e=>`Restaurado desde ${e}`,more_actions:`Más acciones`,version_name_input:`Nombre de la versión`,name_version_menuitem:`Nombrar esta versión`,rename_menuitem:`Cambiar nombre`,compare_with_menuitem:`Comparar con esta versión`,restore_menuitem:`Restaurar`,delete_menuitem:`Eliminar`,action_failed:`Algo salió mal. Inténtalo de nuevo.`,history_load_failed:`No se pudo cargar el historial de versiones`},exporter:{open_file:`Abrir archivo`,open_video_file:`Abrir vídeo`,open_audio_file:`Abrir audio`},generic:{loading:`Cargando...`,load_more:`Cargar más`,ctrl_shortcut:`Ctrl`,form_submit:`Aceptar`}},fr:{slash_menu:{heading:{title:`Titre 1`,subtext:`Utilisé pour un titre de premier niveau`,aliases:[`h`,`titre1`,`h1`],group:`Titres`},heading_2:{title:`Titre 2`,subtext:`Titre de deuxième niveau Utilisé pour les sections clés`,aliases:[`h2`,`titre2`,`sous-titre`],group:`Titres`},heading_3:{title:`Titre 3`,subtext:`Titre de troisième niveau utilisé pour les sous-sections et les titres de groupe`,aliases:[`h3`,`titre3`,`sous-titre`],group:`Titres`},heading_4:{title:`Titre 4`,subtext:`Titre de sous‑section mineure`,aliases:[`h4`,`titre4`,`sous‑titre4`],group:`Sous-titres`},heading_5:{title:`Titre 5`,subtext:`Titre de sous-section mineure`,aliases:[`h5`,`titre5`,`sous-titre5`],group:`Sous-titres`},heading_6:{title:`Titre 6`,subtext:`Titre de niveau le plus bas`,aliases:[`h6`,`titre6`,`sous-titre6`],group:`Sous-titres`},toggle_heading:{title:`Titre Repliable 1`,subtext:`Titre de premier niveau qui peut être replié pour masquer son contenu`,aliases:[`h`,`titre1`,`h1`,`repliable`,`masquable`,`déroulant`],group:`Sous-titres`},toggle_heading_2:{title:`Titre Repliable 2`,subtext:`Titre de section qui peut être replié pour masquer son contenu`,aliases:[`h2`,`titre2`,`sous-titre`,`repliable`,`masquable`,`déroulant`],group:`Sous-titres`},toggle_heading_3:{title:`Titre Repliable 3`,subtext:`Titre de sous-section qui peut être replié pour masquer son contenu`,aliases:[`h3`,`titre3`,`sous-titre`,`repliable`,`masquable`,`déroulant`],group:`Sous-titres`},quote:{title:`Citation`,subtext:`Citation ou extrait`,aliases:[`quotation`,`blockquote`,`bq`],group:`Blocs de base`},numbered_list:{title:`Liste Numérotée`,subtext:`Utilisé pour afficher une liste numérotée`,aliases:[`ol`,`li`,`liste`,`listenumérotée`,`liste numérotée`],group:`Blocs de base`},bullet_list:{title:`Liste à puces`,subtext:`Utilisé pour afficher une liste à puce non numérotée`,aliases:[`ul`,`li`,`liste`,`listeàpuces`,`liste à puces`,`bullet points`,`bulletpoints`],group:`Blocs de base`},check_list:{title:`Liste de tâches`,subtext:`Utilisé pour afficher une liste avec des cases à cocher`,aliases:[`ul`,`li`,`liste`,`liste de vérification`,`liste cochée`,`case à cocher`,`checklist`,`checkbox`,`check box`,`to do`,`todo`],group:`Blocs de base`},toggle_list:{title:`Liste repliable`,subtext:`Liste avec des sous-éléments masquables`,aliases:[`li`,`liste`,`liste pliable`,`liste escamotable`,`liste repliable`],group:`Blocs de base`},paragraph:{title:`Paragraphe`,subtext:`Utilisé pour le corps de votre document`,aliases:[`p`,`paragraphe`,`texte`],group:`Blocs de base`},code_block:{title:`Bloc de code`,subtext:`Bloc de code avec coloration syntaxique`,aliases:[`code`,`pre`],group:`Blocs de base`},page_break:{title:`Saut de page`,subtext:`Séparateur de page`,aliases:[`page`,`break`,`separator`,`saut`,`séparateur`],group:`Blocs de base`},table:{title:`Tableau`,subtext:`Utilisé pour les tableaux`,aliases:[`tableau`,`grille`],group:`Avancé`},image:{title:`Image`,subtext:`Insérer une image`,aliases:[`image`,`uploadImage`,`télécharger image`,`téléverser image`,`uploader image`,`img`,`photo`,`média`,`url`],group:`Médias`},video:{title:`Vidéo`,subtext:`Insérer une vidéo`,aliases:[`vidéo`,`télécharger vidéo`,`téléverser vidéo`,`mp4`,`film`,`média`,`url`],group:`Média`},audio:{title:`Audio`,subtext:`Insérer un audio`,aliases:[`audio`,`télécharger audio`,`téléverser audio`,`mp3`,`son`,`média`,`url`],group:`Média`},file:{title:`Fichier`,subtext:`Insérer un fichier`,aliases:[`fichier`,`téléverser fichier`,`intégrer fichier`,`insérer fichier`,`média`,`url`],group:`Média`},emoji:{title:`Emoji`,subtext:`Utilisé pour insérer un emoji`,aliases:[`emoji`,`émoticône`,`émotion`,`visage`,`smiley`],group:`Autres`},divider:{title:`Diviseur`,subtext:`Utilisé pour diviser les blocs`,aliases:[`diviseur`,`hr`,`horizontal rule`],group:`Blocs de base`}},placeholders:{default:`Entrez du texte ou tapez '/' pour faire apparaître les options de mise en page`,heading:`Titre`,toggleListItem:`Basculer`,bulletListItem:`Liste`,numberedListItem:`Liste`,checkListItem:`Liste`,new_comment:`Écrire un commentaire...`,edit_comment:`Modifier le commentaire...`,comment_reply:`Ajouter un commentaire...`},file_blocks:{add_button_text:{image:`Ajouter une image`,video:`Ajouter une vidéo`,audio:`Ajouter un audio`,file:`Ajouter un fichier`}},toggle_blocks:{add_block_button:`Liste repliable vide. Cliquez pour ajouter un bloc.`,toggle_button:`Déplier ou replier`},code_block:{add_source_button_text:`Ajouter le code source`,ok_button_text:`OK`},side_menu:{add_block_label:`Ajouter un bloc`,drag_handle_label:`Ouvrir le menu du bloc`},drag_handle:{delete_menuitem:`Supprimer`,colors_menuitem:`Couleurs`,header_row_menuitem:`En-tête de ligne`,header_column_menuitem:`En-tête de colonne`},table_handle:{delete_column_menuitem:`Supprimer la colonne`,delete_row_menuitem:`Supprimer la ligne`,add_left_menuitem:`Ajouter une colonne à gauche`,add_right_menuitem:`Ajouter une colonne à droite`,add_above_menuitem:`Ajouter une ligne au-dessus`,add_below_menuitem:`Ajouter une ligne en dessous`,split_cell_menuitem:`Diviser la cellule`,merge_cells_menuitem:`Fusionner les cellules`,background_color_menuitem:`Couleur de fond`},suggestion_menu:{no_items_title:`Aucun élément trouvé`},color_picker:{text_title:`Texte`,background_title:`Fond`,colors:{default:`Auto`,gray:`Gris`,brown:`Marron`,red:`Rouge`,orange:`Orange`,yellow:`Jaune`,green:`Vert`,blue:`Bleu`,purple:`Violet`,pink:`Rose`}},formatting_toolbar:{bold:{tooltip:`Gras`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Italique`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Souligner`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Barré`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`Code`,secondary_tooltip:``},colors:{tooltip:`Couleurs`},link:{tooltip:`Créer un lien`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Modifier la légende`,input_placeholder:`Modifier la légende`},file_replace:{tooltip:{image:`Remplacer l'image`,video:`Remplacer la vidéo`,audio:`Remplacer l'audio`,file:`Remplacer le fichier`}},file_rename:{tooltip:{image:`Renommer l'image`,video:`Renommer la vidéo`,audio:`Renommer l'audio`,file:`Renommer le fichier`},input_placeholder:{image:`Renommer l'image`,video:`Renommer la vidéo`,audio:`Renommer l'audio`,file:`Renommer le fichier`}},file_download:{tooltip:{image:`Télécharger l'image`,video:`Télécharger la vidéo`,audio:`Télécharger l'audio`,file:`Télécharger le fichier`}},file_delete:{tooltip:{image:`Supprimer l'image`,video:`Supprimer la vidéo`,audio:`Supprimer l'audio`,file:`Supprimer le fichier`}},file_preview_toggle:{tooltip:`Basculer l'aperçu`},nest:{tooltip:`Augmenter le retrait du bloc`,secondary_tooltip:`Tab`},unnest:{tooltip:`Diminuer le retait du bloc`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Aligner le texte à gauche`},align_center:{tooltip:`Aligner le texte au centre`},align_right:{tooltip:`Aligner le texte à droite`},align_justify:{tooltip:`Justifier le texte`},table_cell_merge:{tooltip:`Fusionner les cellules`},comment:{tooltip:`Ajouter un commentaire`}},file_panel:{upload:{title:`Télécharger`,file_placeholder:{image:`Télécharger une image`,video:`Télécharger une vidéo`,audio:`Télécharger un fichier audio`,file:`Télécharger un fichier`},upload_error:`Erreur : échec du téléchargement`},embed:{title:`Intégrer`,embed_button:{image:`Intégrer une image`,video:`Intégrer une vidéo`,audio:`Intégrer un fichier audio`,file:`Intégrer un fichier`},url_placeholder:`Entrez l'URL`}},link_toolbar:{delete:{tooltip:`Supprimer le lien`},edit:{text:`Modifier le lien`,tooltip:`Modifier`},open:{tooltip:`Ouvrir dans un nouvel onglet`},form:{title_placeholder:`Modifier le titre`,url_placeholder:`Modifier l'URL`}},comments:{edited:`modifié`,save_button_text:`Enregistrer`,cancel_button_text:`Annuler`,deleted_reference_text:`Contenu d'origine supprimé`,discard_pending_comment:`Voulez-vous vraiment abandonner ce commentaire ?`,actions:{add_reaction:`Ajouter une réaction`,resolve:`Résoudre`,reopen:`Rouvrir`,edit_comment:`Modifier le commentaire`,delete_comment:`Supprimer le commentaire`,more_actions:`Plus d'actions`},reactions:{reacted_by:`Réagi par`},sidebar:{marked_as_resolved:`Marqué comme résolu`,more_replies:e=>`${e} réponses de plus`}},suggestion_changes:{formatting_change:`Modification de mise en forme`,deleted:`Supprimé`,inserted:`Inséré`,inserted_by:e=>`Inséré par : ${e}`,deleted_by:e=>`Supprimé par : ${e}`,changed:`Modifié`,changed_by:e=>`Modifié par : ${e}`,formatting_change_by:(e,t)=>`Modification de mise en forme (${e}) par : ${t}`},versioning:{start_of_document:`Début du document`,compare_since_beginning_menuitem:`Comparer depuis le début`,title:`Historique`,close:`Fermer`,show_named_only:`Afficher uniquement les versions nommées`,show_all:`Afficher toutes les versions`,comparison_on:`Activer la comparaison`,comparison_off:`Désactiver la comparaison`,versions_list:`Versions`,empty:`Aucune version pour l'instant`,empty_named_only:`Aucune version nommée`,current_version:`Version actuelle`,before_restore:`Avant la restauration`,comparing_to:`Comparé à`,restored_from:e=>`Restauré depuis ${e}`,more_actions:`Plus d'actions`,version_name_input:`Nom de la version`,name_version_menuitem:`Nommer cette version`,rename_menuitem:`Renommer`,compare_with_menuitem:`Comparer avec cette version`,restore_menuitem:`Restaurer`,delete_menuitem:`Supprimer`,action_failed:`Une erreur s'est produite. Veuillez réessayer.`,history_load_failed:`Impossible de charger l'historique des versions`},exporter:{open_file:`Ouvrir le fichier`,open_video_file:`Ouvrir la vidéo`,open_audio_file:`Ouvrir l'audio`},generic:{loading:`Chargement...`,load_more:`Charger plus`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}},de:{slash_menu:{heading:{title:`Überschrift 1`,subtext:`Hauptebene Überschrift`,aliases:[`h`,`überschrift1`,`h1`],group:`Überschriften`},heading_2:{title:`Überschrift 2`,subtext:`Wichtige Abschnittsüberschrift`,aliases:[`h2`,`überschrift2`,`unterüberschrift`],group:`Überschriften`},heading_3:{title:`Überschrift 3`,subtext:`Unterabschnitts- und Gruppenüberschrift`,aliases:[`h3`,`überschrift3`,`unterüberschrift`],group:`Überschriften`},heading_4:{title:`Überschrift 4`,subtext:`Überschrift für kleinere Unterabschnitte`,aliases:[`h4`,`überschrift4`,`unterüberschrift4`],group:`Unterüberschriften`},heading_5:{title:`Überschrift 5`,subtext:`Überschrift für tiefere Unterabschnitte`,aliases:[`h5`,`überschrift5`,`unterüberschrift5`],group:`Unterüberschriften`},heading_6:{title:`Überschrift 6`,subtext:`Überschrift auf der untersten Ebene`,aliases:[`h6`,`überschrift6`,`unterüberschrift6`],group:`Unterüberschriften`},toggle_heading:{title:`Aufklappbare Überschrift 1`,subtext:`Aufklappbare Hauptebene Überschrift`,aliases:[`h`,`überschrift1`,`h1`,`aufklappbar`,`einklappbar`],group:`Unterüberschrift`},toggle_heading_2:{title:`Aufklappbare Überschrift 2`,subtext:`Aufklappbare wichtige Abschnittsüberschrift`,aliases:[`h2`,`überschrift2`,`unterüberschrift`,`aufklappbar`,`einklappbar`],group:`Unterüberschriften`},toggle_heading_3:{title:`Aufklappbare Überschrift 3`,subtext:`Aufklappbare Unterabschnitts- und Gruppenüberschrift`,aliases:[`h3`,`überschrift3`,`unterüberschrift`,`aufklappbar`,`einklappbar`],group:`Unterüberschriften`},quote:{title:`Zitat`,subtext:`Zitat oder Auszug`,aliases:[`quotation`,`blockquote`,`bq`],group:`Grundlegende Blöcke`},numbered_list:{title:`Nummerierte Liste`,subtext:`Liste mit nummerierten Elementen`,aliases:[`ol`,`li`,`liste`,`nummerierteliste`,`nummerierte liste`],group:`Grundlegende Blöcke`},bullet_list:{title:`Aufzählungsliste`,subtext:`Liste mit unnummerierten Elementen`,aliases:[`ul`,`li`,`liste`,`aufzählungsliste`,`aufzählung liste`],group:`Grundlegende Blöcke`},check_list:{title:`Checkliste`,subtext:`Liste mit Kontrollkästchen`,aliases:[`ul`,`li`,`liste`,`checkliste`,`check liste`,`geprüfte liste`,`kontrollkästchen`],group:`Grundlegende Blöcke`},toggle_list:{title:`Aufklappbare Liste`,subtext:`Liste mit ausblendbare Unterpunkten`,aliases:[`li`,`liste`,`aufklappbare liste`,`einklappbare liste`,`aufklappbareListe`,`aufklappbare liste`],group:`Grundlegende Blöcke`},paragraph:{title:`Absatz`,subtext:`Der Hauptteil Ihres Dokuments`,aliases:[`p`,`absatz`],group:`Grundlegende Blöcke`},code_block:{title:`Codeblock`,subtext:`Codeblock mit Syntaxhervorhebung`,aliases:[`code`,`pre`],group:`Grundlegende Blöcke`},page_break:{title:`Seitenumbruch`,subtext:`Seitentrenner`,aliases:[`page`,`break`,`separator`,`seitenumbruch`,`trenner`],group:`Grundlegende Blöcke`},table:{title:`Tabelle`,subtext:`Tabelle mit editierbaren Zellen`,aliases:[`tabelle`],group:`Erweitert`},image:{title:`Bild`,subtext:`Größenveränderbares Bild mit Beschriftung`,aliases:[`bild`,`bildhochladen`,`hochladen`,`img`,`bild`,`medien`,`url`],group:`Medien`},video:{title:`Video`,subtext:`Größenveränderbares Video mit Beschriftung`,aliases:[`video`,`videoupload`,`hochladen`,`mp4`,`film`,`medien`,`url`],group:`Medien`},audio:{title:`Audio`,subtext:`Eingebettetes Audio mit Beschriftung`,aliases:[`audio`,`audioupload`,`hochladen`,`mp3`,`ton`,`medien`,`url`],group:`Medien`},file:{title:`Datei`,subtext:`Eingebettete Datei`,aliases:[`datei`,`hochladen`,`einbetten`,`medien`,`url`],group:`Medien`},emoji:{title:`Emoji`,subtext:`Nach Emoji suchen und einfügen`,aliases:[`emoji`,`emote`,`emotion`,`gesicht`],group:`Andere`},divider:{title:`Trennlinie`,subtext:`Trennlinie zwischen Blöcken`,aliases:[`trennlinie`,`hr`,`horizontal rule`],group:`Grundlegende Blöcke`}},placeholders:{default:`Text eingeben oder '/' für Befehle tippen`,heading:`Überschrift`,toggleListItem:`Umschalten`,bulletListItem:`Liste`,numberedListItem:`Liste`,checkListItem:`Liste`,new_comment:`Einen Kommentar schreiben …`,edit_comment:`Kommentar bearbeiten …`,comment_reply:`Kommentar hinzufügen …`},file_blocks:{add_button_text:{image:`Bild hinzufügen`,video:`Video hinzufügen`,audio:`Audio hinzufügen`,file:`Datei hinzufügen`}},toggle_blocks:{add_block_button:`Leerer aufklappbarer Bereich. Klicken, um einen Block hinzuzufügen.`,toggle_button:`Aufklappen oder zuklappen`},code_block:{add_source_button_text:`Quellcode hinzufügen`,ok_button_text:`OK`},side_menu:{add_block_label:`Block hinzufügen`,drag_handle_label:`Blockmenü öffnen`},drag_handle:{delete_menuitem:`Löschen`,colors_menuitem:`Farben`,header_row_menuitem:`Kopfzeile`,header_column_menuitem:`Kopfspalte`},table_handle:{delete_column_menuitem:`Spalte löschen`,delete_row_menuitem:`Zeile löschen`,add_left_menuitem:`Spalte links hinzufügen`,add_right_menuitem:`Spalte rechts hinzufügen`,add_above_menuitem:`Zeile oberhalb hinzufügen`,add_below_menuitem:`Zeile unterhalb hinzufügen`,split_cell_menuitem:`Zelle teilen`,merge_cells_menuitem:`Zellen zusammenführen`,background_color_menuitem:`Hintergrundfarbe`},suggestion_menu:{no_items_title:`Keine Elemente gefunden`},color_picker:{text_title:`Text`,background_title:`Hintergrund`,colors:{default:`Automatisch`,gray:`Grau`,brown:`Braun`,red:`Rot`,orange:`Orange`,yellow:`Gelb`,green:`Grün`,blue:`Blau`,purple:`Lila`,pink:`Rosa`}},formatting_toolbar:{bold:{tooltip:`Fett`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Kursiv`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Unterstrichen`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Durchgestrichen`,secondary_tooltip:`Mod+Shift+S`},code:{tooltip:`Code`,secondary_tooltip:``},colors:{tooltip:`Farben`},link:{tooltip:`Link erstellen`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Beschriftung bearbeiten`,input_placeholder:`Beschriftung bearbeiten`},file_replace:{tooltip:{image:`Bild ersetzen`,video:`Video ersetzen`,audio:`Audio ersetzen`,file:`Datei ersetzen`}},file_rename:{tooltip:{image:`Bild umbenennen`,video:`Video umbenennen`,audio:`Audio umbenennen`,file:`Datei umbenennen`},input_placeholder:{image:`Bild umbenennen`,video:`Video umbenennen`,audio:`Audio umbenennen`,file:`Datei umbenennen`}},file_download:{tooltip:{image:`Bild herunterladen`,video:`Video herunterladen`,audio:`Audio herunterladen`,file:`Datei herunterladen`}},file_delete:{tooltip:{image:`Bild löschen`,video:`Video löschen`,audio:`Audio löschen`,file:`Datei löschen`}},file_preview_toggle:{tooltip:`Vorschau umschalten`},nest:{tooltip:`Block verschachteln`,secondary_tooltip:`Tab`},unnest:{tooltip:`Block entnesten`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Text linksbündig`},align_center:{tooltip:`Text zentrieren`},align_right:{tooltip:`Text rechtsbündig`},align_justify:{tooltip:`Text Blocksatz`},table_cell_merge:{tooltip:`Zellen zusammenführen`},comment:{tooltip:`Kommentar hinzufügen`}},file_panel:{upload:{title:`Hochladen`,file_placeholder:{image:`Bild hochladen`,video:`Video hochladen`,audio:`Audio hochladen`,file:`Datei hochladen`},upload_error:`Fehler: Hochladen fehlgeschlagen`},embed:{title:`Einbetten`,embed_button:{image:`Bild einbetten`,video:`Video einbetten`,audio:`Audio einbetten`,file:`Datei einbetten`},url_placeholder:`URL eingeben`}},link_toolbar:{delete:{tooltip:`Link entfernen`},edit:{text:`Link bearbeiten`,tooltip:`Bearbeiten`},open:{tooltip:`In neuem Tab öffnen`},form:{title_placeholder:`Titel bearbeiten`,url_placeholder:`URL bearbeiten`}},comments:{edited:`bearbeitet`,save_button_text:`Speichern`,cancel_button_text:`Abbrechen`,deleted_reference_text:`Originalinhalt gelöscht`,discard_pending_comment:`Möchten Sie diesen Kommentar wirklich verwerfen?`,actions:{add_reaction:`Reaktion hinzufügen`,resolve:`Lösen`,reopen:`Wieder öffnen`,edit_comment:`Kommentar bearbeiten`,delete_comment:`Kommentar löschen`,more_actions:`Weitere Aktionen`},reactions:{reacted_by:`Reagiert von`},sidebar:{marked_as_resolved:`Als gelöst markiert`,more_replies:e=>`${e} weitere Antworten`}},suggestion_changes:{formatting_change:`Formatierungsänderung`,deleted:`Gelöscht`,inserted:`Eingefügt`,inserted_by:e=>`Eingefügt von: ${e}`,deleted_by:e=>`Gelöscht von: ${e}`,changed:`Geändert`,changed_by:e=>`Geändert von: ${e}`,formatting_change_by:(e,t)=>`Formatierungsänderung (${e}) von: ${t}`},versioning:{start_of_document:`Anfang des Dokuments`,compare_since_beginning_menuitem:`Seit Beginn vergleichen`,title:`Verlauf`,close:`Schließen`,show_named_only:`Nur benannte Versionen anzeigen`,show_all:`Alle Versionen anzeigen`,comparison_on:`Vergleich einschalten`,comparison_off:`Vergleich ausschalten`,versions_list:`Versionen`,empty:`Noch keine Versionen`,empty_named_only:`Keine benannten Versionen`,current_version:`Aktuelle Version`,before_restore:`Vor der Wiederherstellung`,comparing_to:`Verglichen mit`,restored_from:e=>`Wiederhergestellt aus ${e}`,more_actions:`Weitere Aktionen`,version_name_input:`Versionsname`,name_version_menuitem:`Diese Version benennen`,rename_menuitem:`Umbenennen`,compare_with_menuitem:`Mit dieser Version vergleichen`,restore_menuitem:`Wiederherstellen`,delete_menuitem:`Löschen`,action_failed:`Etwas ist schiefgelaufen. Bitte versuche es erneut.`,history_load_failed:`Versionsverlauf konnte nicht geladen werden`},exporter:{open_file:`Datei öffnen`,open_video_file:`Video öffnen`,open_audio_file:`Audio öffnen`},generic:{loading:`Wird geladen...`,load_more:`Mehr laden`,ctrl_shortcut:`Strg`,form_submit:`OK`}},pt:{slash_menu:{heading:{title:`Título`,subtext:`Usado para um título de nível superior`,aliases:[`h`,`titulo1`,`h1`],group:`Títulos`},heading_2:{title:`Título 2`,subtext:`Usado para seções principais`,aliases:[`h2`,`titulo2`,`subtitulo`],group:`Títulos`},heading_3:{title:`Título 3`,subtext:`Usado para subseções e títulos de grupo`,aliases:[`h3`,`titulo3`,`subtitulo`],group:`Títulos`},heading_4:{title:`Título 4`,subtext:`Usado para subseções menores`,aliases:[`h4`,`titulo4`,`subtitulo4`],group:`Subtítulos`},heading_5:{title:`Título 5`,subtext:`Usado para títulos de subseções pequenas`,aliases:[`h5`,`titulo5`,`subtitulo5`],group:`Subtítulos`},heading_6:{title:`Título 6`,subtext:`Usado para títulos de nível mais baixo`,aliases:[`h6`,`titulo6`,`subtitulo6`],group:`Subtítulos`},toggle_heading:{title:`Título Expansível`,subtext:`Título expansível de nível superior`,aliases:[`h`,`titulo1`,`h1`,`expansível`],group:`Subtítulos`},toggle_heading_2:{title:`Título Expansível 2`,subtext:`Título expansível para seções principais`,aliases:[`h2`,`titulo2`,`subtitulo`,`expansível`],group:`Subtítulos`},toggle_heading_3:{title:`Título Expansível 3`,subtext:`Título expansível para subseções e títulos de grupo`,aliases:[`h3`,`titulo3`,`subtitulo`,`expansível`],group:`Subtítulos`},quote:{title:`Citação`,subtext:`Citação ou trecho`,aliases:[`quotation`,`blockquote`,`bq`],group:`Blocos básicos`},numbered_list:{title:`Lista Numerada`,subtext:`Usado para exibir uma lista numerada`,aliases:[`ol`,`li`,`lista`,`listanumerada`,`lista numerada`],group:`Blocos básicos`},bullet_list:{title:`Lista com Marcadores`,subtext:`Usado para exibir uma lista não ordenada`,aliases:[`ul`,`li`,`lista`,`listamarcadores`,`lista com marcadores`],group:`Blocos básicos`},check_list:{title:`Lista de verificação`,subtext:`Usado para exibir uma lista com caixas de seleção`,aliases:[`ul`,`li`,`lista`,`lista de verificação`,`lista marcada`,`caixa de seleção`],group:`Blocos básicos`},toggle_list:{title:`Lista expansível`,subtext:`Lista com subitens ocultáveis`,aliases:[`li`,`lista`,`lista expansível`,`lista recolhível`],group:`Blocos básicos`},paragraph:{title:`Parágrafo`,subtext:`Usado para o corpo do seu documento`,aliases:[`p`,`paragrafo`],group:`Blocos básicos`},code_block:{title:`Bloco de Código`,subtext:`Usado para exibir código com destaque de sintaxe`,aliases:[`codigo`,`pre`],group:`Blocos básicos`},page_break:{title:`Quebra de página`,subtext:`Separador de página`,aliases:[`page`,`break`,`separator`,`quebra`,`separador`],group:`Blocos básicos`},table:{title:`Tabela`,subtext:`Usado para tabelas`,aliases:[`tabela`],group:`Avançado`},image:{title:`Imagem`,subtext:`Inserir uma imagem`,aliases:[`imagem`,`uploadImagem`,`upload`,`img`,`foto`,`media`,`url`],group:`Mídia`},video:{title:`Vídeo`,subtext:`Inserir um vídeo`,aliases:[`vídeo`,`uploadVídeo`,`upload`,`mp4`,`filme`,`mídia`,`url`],group:`Mídia`},audio:{title:`Áudio`,subtext:`Inserir um áudio`,aliases:[`áudio`,`uploadÁudio`,`upload`,`mp3`,`som`,`mídia`,`url`],group:`Mídia`},file:{title:`Arquivo`,subtext:`Inserir um arquivo`,aliases:[`arquivo`,`upload`,`incorporar`,`mídia`,`url`],group:`Mídia`},emoji:{title:`Emoji`,subtext:`Usado para inserir um emoji`,aliases:[`emoji`,`emoticon`,`expressão emocional`,`rosto`],group:`Outros`},divider:{title:`Separador`,subtext:`Separador de blocos`,aliases:[`separador`,`hr`,`horizontal rule`],group:`Blocos básicos`}},placeholders:{default:`Digite texto ou use '/' para comandos`,heading:`Título`,toggleListItem:`Alternar`,bulletListItem:`Lista`,numberedListItem:`Lista`,checkListItem:`Lista`,new_comment:`Escreva um comentário...`,edit_comment:`Editar comentário...`,comment_reply:`Adicionar comentário...`},file_blocks:{add_button_text:{image:`Adicionar imagem`,video:`Adicionar vídeo`,audio:`Adicionar áudio`,file:`Adicionar arquivo`}},toggle_blocks:{add_block_button:`Toggle vazio. Clique para adicionar um bloco.`,toggle_button:`Expandir ou recolher`},code_block:{add_source_button_text:`Adicionar código-fonte`,ok_button_text:`OK`},side_menu:{add_block_label:`Adicionar bloco`,drag_handle_label:`Abrir menu do bloco`},drag_handle:{delete_menuitem:`Excluir`,colors_menuitem:`Cores`,header_row_menuitem:`Cabeçalho de linha`,header_column_menuitem:`Cabeçalho de coluna`},table_handle:{delete_column_menuitem:`Excluir coluna`,delete_row_menuitem:`Excluir linha`,add_left_menuitem:`Adicionar coluna à esquerda`,add_right_menuitem:`Adicionar coluna à direita`,add_above_menuitem:`Adicionar linha acima`,add_below_menuitem:`Adicionar linha abaixo`,split_cell_menuitem:`Dividir célula`,merge_cells_menuitem:`Juntar células`,background_color_menuitem:`Alterar cor de fundo`},suggestion_menu:{no_items_title:`Nenhum item encontrado`},color_picker:{text_title:`Texto`,background_title:`Fundo`,colors:{default:`Automático`,gray:`Cinza`,brown:`Marrom`,red:`Vermelho`,orange:`Laranja`,yellow:`Amarelo`,green:`Verde`,blue:`Azul`,purple:`Roxo`,pink:`Rosa`}},formatting_toolbar:{bold:{tooltip:`Negrito`,secondary_tooltip:`Mod+B`},italic:{tooltip:`Itálico`,secondary_tooltip:`Mod+I`},underline:{tooltip:`Sublinhado`,secondary_tooltip:`Mod+U`},strike:{tooltip:`Riscado`,secondary_tooltip:`Mod+Shift+X`},code:{tooltip:`Código`,secondary_tooltip:``},colors:{tooltip:`Cores`},link:{tooltip:`Criar link`,secondary_tooltip:`Mod+K`},file_caption:{tooltip:`Editar legenda`,input_placeholder:`Editar legenda`},file_replace:{tooltip:{image:`Substituir imagem`,video:`Substituir vídeo`,audio:`Substituir áudio`,file:`Substituir arquivo`}},file_rename:{tooltip:{image:`Renomear imagem`,video:`Renomear vídeo`,audio:`Renomear áudio`,file:`Renomear arquivo`},input_placeholder:{image:`Renomear imagem`,video:`Renomear vídeo`,audio:`Renomear áudio`,file:`Renomear arquivo`}},file_download:{tooltip:{image:`Baixar imagem`,video:`Baixar vídeo`,audio:`Baixar áudio`,file:`Baixar arquivo`}},file_delete:{tooltip:{image:`Excluir imagem`,video:`Excluir vídeo`,audio:`Excluir áudio`,file:`Excluir arquivo`}},file_preview_toggle:{tooltip:`Alternar visualização`},nest:{tooltip:`Aninhar bloco`,secondary_tooltip:`Tab`},unnest:{tooltip:`Desaninhar bloco`,secondary_tooltip:`Shift+Tab`},align_left:{tooltip:`Alinhar à esquerda`},align_center:{tooltip:`Alinhar ao centro`},align_right:{tooltip:`Alinhar à direita`},align_justify:{tooltip:`Justificar texto`},table_cell_merge:{tooltip:`Juntar células`},comment:{tooltip:`Adicionar comentário`}},file_panel:{upload:{title:`Upload`,file_placeholder:{image:`Upload de imagem`,video:`Upload de vídeo`,audio:`Upload de áudio`,file:`Upload de arquivo`},upload_error:`Erro: Falha no upload`},embed:{title:`Incorporar`,embed_button:{image:`Incorporar imagem`,video:`Incorporar vídeo`,audio:`Incorporar áudio`,file:`Incorporar arquivo`},url_placeholder:`Insira a URL`}},link_toolbar:{delete:{tooltip:`Remover link`},edit:{text:`Editar link`,tooltip:`Editar`},open:{tooltip:`Abrir em nova aba`},form:{title_placeholder:`Editar título`,url_placeholder:`Editar URL`}},comments:{edited:`editado`,save_button_text:`Salvar`,cancel_button_text:`Cancelar`,deleted_reference_text:`Conteúdo original excluído`,discard_pending_comment:`Tem certeza de que deseja descartar este comentário?`,actions:{add_reaction:`Adicionar reação`,resolve:`Resolver`,reopen:`Reabrir`,edit_comment:`Editar comentário`,delete_comment:`Excluir comentário`,more_actions:`Mais ações`},reactions:{reacted_by:`Reagido por`},sidebar:{marked_as_resolved:`Marcado como resolvido`,more_replies:e=>`${e} respostas a mais`}},suggestion_changes:{formatting_change:`Alteração de formatação`,deleted:`Excluído`,inserted:`Inserido`,inserted_by:e=>`Inserido por: ${e}`,deleted_by:e=>`Excluído por: ${e}`,changed:`Alterado`,changed_by:e=>`Alterado por: ${e}`,formatting_change_by:(e,t)=>`Alteração de formatação (${e}) por: ${t}`},versioning:{start_of_document:`Início do documento`,compare_since_beginning_menuitem:`Comparar desde o início`,title:`Histórico`,close:`Fechar`,show_named_only:`Mostrar apenas versões nomeadas`,show_all:`Mostrar todas as versões`,comparison_on:`Ativar comparação`,comparison_off:`Desativar comparação`,versions_list:`Versões`,empty:`Ainda não há versões`,empty_named_only:`Não há versões nomeadas`,current_version:`Versão atual`,before_restore:`Antes da restauração`,comparing_to:`Comparando com`,restored_from:e=>`Restaurado de ${e}`,more_actions:`Mais ações`,version_name_input:`Nome da versão`,name_version_menuitem:`Nomear esta versão`,rename_menuitem:`Renomear`,compare_with_menuitem:`Comparar com esta versão`,restore_menuitem:`Restaurar`,delete_menuitem:`Excluir`,action_failed:`Algo deu errado. Tente novamente.`,history_load_failed:`Falha ao carregar o histórico de versões`},exporter:{open_file:`Abrir arquivo`,open_video_file:`Abrir vídeo`,open_audio_file:`Abrir áudio`},generic:{loading:`Carregando...`,load_more:`Carregar mais`,ctrl_shortcut:`Ctrl`,form_submit:`OK`}}},Nf=ce({en:{loading:`Opening…`,unreadable:`This doc cannot be shown right now: its file is not written as a doc. Here is what it says.`,duplicate:`Duplicate`,remove:`Delete`,colors:`Colors`,tag:`Tag`,noTag:`No tag`,nothing:`No block by that name`,nothingToLink:`Nothing in the project by that name`,turnInto:`Turn into`,aligns:{left:`Left`,center:`Center`,right:`Right`,justify:`Justify`},copyPlace:`Copy its place in the file`,find:`Find something to do…`,text:`text`,background:`background`,placeholder:`Write, or press / for blocks`,heading:`Heading`,colorNames:{gray:`Gray`,brown:`Brown`,red:`Red`,orange:`Orange`,yellow:`Yellow`,green:`Green`,blue:`Blue`,purple:`Purple`,pink:`Pink`},embed:`Drawn by code`,title:`Title`,untitled:`Untitled`,outline:`On this page`,blocks:{paragraph:`Text`,heading1:`Heading 1`,heading2:`Heading 2`,heading3:`Heading 3`,bullet:`Bulleted list`,numbered:`Numbered list`,check:`To-do list`,toggle:`Toggle`,quote:`Quote`,callout:`Callout`,code:`Code`,divider:`Divider`,table:`Table`,image:`Image`,chart:`Chart`,equation:`Equation`,diagram:`Diagram`,columns2:`2 columns`,columns3:`3 columns`,footnote:`Footnote`,pagebreak:`Page break`,pagebreakLandscape:`Page break, landscape after it`,pagebreakPortrait:`Page break, portrait after it`,toc:`Contents`,bibliography:`Bibliography`,card:`Card`,stats:`Figures`},component:`Component`,stats:{label:`Label`,value:`Value`,delta:`Change`,note:`Note`,trend:`Trend: 12, 15, 14`,add:`Add a figure`,remove:`Remove this figure`},card:{title:`Card title`,subtitle:`A line under it`},sample:{category:e=>`Category ${String(e)}`,series:e=>`Series ${String(e)}`},chart:{types:{"column-clustered":`Clustered column`,"column-stacked":`Stacked column`,"column-stacked-100":`100% stacked column`,"bar-clustered":`Clustered bar`,"bar-stacked":`Stacked bar`,"bar-stacked-100":`100% stacked bar`,line:`Line`,"line-markers":`Line with markers`,area:`Area`,"area-stacked":`Stacked area`,"area-stacked-100":`100% stacked area`,pie:`Pie`,doughnut:`Doughnut`,scatter:`Scatter`,"scatter-lines":`Scatter with straight lines and markers`,"scatter-smooth":`Scatter with smooth lines and markers`},type:`Chart type`,title:`Chart title`,legend:`Legend`,legendAt:{none:`None`,bottom:`Bottom`,top:`Top`,left:`Left`,right:`Right`},dataLabels:`Data labels`,smooth:`Smooth lines`,barColors:`Colour of each bar`,addCategory:`Add category`,addSeries:`Add series`,deleteCategory:`Delete category`,deleteSeries:`Delete series`,cell:(e,t)=>`Row ${String(e)}, column ${String(t)}`,fromFile:e=>`The numbers come from ${e}: change them there.`,notHere:e=>`The numbers from ${e} are not here yet.`,cannotDraw:`This chart cannot be drawn`},emptyEquation:`Empty equation`,emptyDiagram:`Empty diagram`,style:`Style`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Accent`,defaultColor:`Default`,pageNumbers:`Page numbers`,page:{preset:`Preset`,none:`None`,presets:{apa:`APA 7`,mla:`MLA 9`,report:`Report`,memo:`Memo`,"business-letter":`Business letter`},paper:`Paper`,orientation:`Orientation`,portrait:`Portrait`,landscape:`Landscape`,margins:`Margins`,marginNames:{normal:`Normal`,narrow:`Narrow`,wide:`Wide`},size:`Text size`,pt:e=>`${String(e)} pt`,lineHeight:`Line height`,grid:`The grid`,indent:`Indent first lines`},tocEmpty:`No headings yet`,sourcesEmpty:`Cite a source with [@key] to list it here`,pages:`Pages`,pagesPrinting:`Printing…`,pagesFailed:e=>`The pages could not be printed: ${e}`,pageOf:(e,t)=>`Page ${String(e)} of ${String(t)}`,pageBlock:e=>`A block on page ${String(e)}: show it in the text`,cover:{add:`Add cover`,change:`Change cover`,reposition:`Reposition`,remove:`Remove`,drag:`Drag image to reposition`,save:`Save position`,cancel:`Cancel`,upload:`Upload`,none:`No pictures in the project`,gallery:`Gallery`,project:`Project`,names:{dots:`Pointillist`,scales:`Sea scales`,bay:`Evening bay`,stacks:`Wheat stacks`,steam:`Steam train`,dusk:`Mountains at dusk`,lake:`Lake at dawn`}}},"zh-cn":{loading:`正在打开…`,unreadable:`这份文档现在显示不了:文件的写法不对。下面是它的原文。`,duplicate:`复制一份`,remove:`删除`,colors:`颜色`,tag:`标签`,noTag:`不加标签`,nothing:`没有叫这个名字的块`,nothingToLink:`项目里没有叫这个名字的内容`,turnInto:`转换为`,aligns:{left:`左对齐`,center:`居中`,right:`右对齐`,justify:`两端对齐`},copyPlace:`复制它在文件里的位置`,find:`输入要做的事…`,text:`文字`,background:`背景`,placeholder:`输入文字,或按 / 选择块`,heading:`标题`,colorNames:{gray:`灰色`,brown:`棕色`,red:`红色`,orange:`橙色`,yellow:`黄色`,green:`绿色`,blue:`蓝色`,purple:`紫色`,pink:`粉色`},embed:`由代码绘制`,title:`标题`,untitled:`未命名`,outline:`本页目录`,blocks:{paragraph:`正文`,heading1:`一级标题`,heading2:`二级标题`,heading3:`三级标题`,bullet:`无序列表`,numbered:`有序列表`,check:`待办清单`,toggle:`折叠`,quote:`引用`,callout:`提示块`,code:`代码`,divider:`分隔线`,table:`表格`,image:`图片`,chart:`图表`,equation:`公式`,diagram:`图示`,columns2:`2 栏`,columns3:`3 栏`,footnote:`脚注`,pagebreak:`分页符`,pagebreakLandscape:`分页符,之后横向`,pagebreakPortrait:`分页符,之后纵向`,toc:`目录`,bibliography:`参考文献`,card:`卡片`,stats:`数字卡`},component:`组件`,stats:{label:`名称`,value:`数值`,delta:`变化`,note:`备注`,trend:`走势:12, 15, 14`,add:`添加一个数字`,remove:`删除这个数字`},card:{title:`卡片标题`,subtitle:`副标题`},sample:{category:e=>`类别 ${String(e)}`,series:e=>`系列 ${String(e)}`},chart:{types:{"column-clustered":`簇状柱形图`,"column-stacked":`堆积柱形图`,"column-stacked-100":`百分比堆积柱形图`,"bar-clustered":`簇状条形图`,"bar-stacked":`堆积条形图`,"bar-stacked-100":`百分比堆积条形图`,line:`折线图`,"line-markers":`带数据标记的折线图`,area:`面积图`,"area-stacked":`堆积面积图`,"area-stacked-100":`百分比堆积面积图`,pie:`饼图`,doughnut:`圆环图`,scatter:`散点图`,"scatter-lines":`带直线和数据标记的散点图`,"scatter-smooth":`带平滑线和数据标记的散点图`},type:`图表类型`,title:`图表标题`,legend:`图例`,legendAt:{none:`无`,bottom:`底部`,top:`顶部`,left:`左侧`,right:`右侧`},dataLabels:`数据标签`,smooth:`平滑曲线`,barColors:`每根柱子的颜色`,addCategory:`添加类别`,addSeries:`添加系列`,deleteCategory:`删除类别`,deleteSeries:`删除系列`,cell:(e,t)=>`第 ${String(e)} 行,第 ${String(t)} 列`,fromFile:e=>`数值来自 ${e}:请在那里修改。`,notHere:e=>`${e} 的数值还没到。`,cannotDraw:`这个图表画不出来`},emptyEquation:`空公式`,emptyDiagram:`空图示`,style:`样式`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`宋体`,hei:`黑体`,fangsong:`仿宋`,kai:`楷体`,xiaobiaosong:`小标宋`},accent:`强调色`,defaultColor:`默认`,pageNumbers:`页码`,page:{preset:`预设`,none:`无`,presets:{apa:`APA 7`,mla:`MLA 9`,report:`报告`,memo:`备忘录`,"business-letter":`商务信函`},paper:`纸张`,orientation:`方向`,portrait:`纵向`,landscape:`横向`,margins:`页边距`,marginNames:{normal:`普通`,narrow:`窄`,wide:`宽`},size:`字号`,pt:e=>`${String(e)} 磅`,lineHeight:`行距`,grid:`按网格`,indent:`首行缩进`},tocEmpty:`还没有标题`,sourcesEmpty:`用 [@key] 引用文献后会列在这里`,pages:`分页`,pagesPrinting:`正在排版…`,pagesFailed:e=>`无法排出页面:${e}`,pageOf:(e,t)=>`第 ${String(e)} 页,共 ${String(t)} 页`,pageBlock:e=>`第 ${String(e)} 页上的一块:在正文中显示`,cover:{add:`添加封面`,change:`更换封面`,reposition:`调整位置`,remove:`移除`,drag:`拖动图片以调整位置`,save:`保存位置`,cancel:`取消`,upload:`上传`,none:`项目中没有图片`,gallery:`图库`,project:`项目`,names:{dots:`点彩`,scales:`青海波`,bay:`暮色海湾`,stacks:`麦垛`,steam:`蒸汽火车`,dusk:`暮山`,lake:`晨湖`}}},"zh-tw":{loading:`正在打開…`,unreadable:`目前無法顯示這份文件:它的檔案不是以文件的格式撰寫。以下是檔案的原文。`,duplicate:`複製一份`,remove:`刪除`,colors:`顏色`,tag:`標籤`,noTag:`不加標籤`,nothing:`沒有這個名稱的區塊`,nothingToLink:`專案中沒有這個名稱的內容`,turnInto:`轉換為`,aligns:{left:`靠左對齊`,center:`置中`,right:`靠右對齊`,justify:`左右對齊`},copyPlace:`拷貝它在檔案中的位置`,find:`搜尋要做的事…`,text:`文字`,background:`背景`,placeholder:`輸入文字,或按 / 選擇區塊`,heading:`標題`,colorNames:{gray:`灰色`,brown:`棕色`,red:`紅色`,orange:`橘色`,yellow:`黃色`,green:`綠色`,blue:`藍色`,purple:`紫色`,pink:`粉紅色`},embed:`由程式碼繪製`,title:`標題`,untitled:`未命名`,outline:`本頁內容`,blocks:{paragraph:`文字`,heading1:`標題 1`,heading2:`標題 2`,heading3:`標題 3`,bullet:`項目符號清單`,numbered:`編號清單`,check:`待辦清單`,toggle:`摺疊`,quote:`引言`,callout:`標註`,code:`程式碼`,divider:`分隔線`,table:`表格`,image:`圖片`,chart:`圖表`,equation:`方程式`,diagram:`圖示`,columns2:`2 欄`,columns3:`3 欄`,footnote:`註腳`,pagebreak:`分頁符號`,pagebreakLandscape:`分頁符,之後橫向`,pagebreakPortrait:`分頁符,之後縱向`,toc:`目錄`,bibliography:`參考文獻`,card:`卡片`,stats:`數字卡`},component:`元件`,stats:{label:`名稱`,value:`數值`,delta:`變化`,note:`備註`,trend:`走勢:12, 15, 14`,add:`新增一個數字`,remove:`刪除這個數字`},card:{title:`卡片標題`,subtitle:`副標題`},sample:{category:e=>`類別 ${String(e)}`,series:e=>`數列 ${String(e)}`},chart:{types:{"column-clustered":`群組直條圖`,"column-stacked":`堆疊直條圖`,"column-stacked-100":`百分比堆疊直條圖`,"bar-clustered":`群組橫條圖`,"bar-stacked":`堆疊橫條圖`,"bar-stacked-100":`百分比堆疊橫條圖`,line:`折線圖`,"line-markers":`含有資料標記的折線圖`,area:`區域圖`,"area-stacked":`堆疊區域圖`,"area-stacked-100":`百分比堆疊區域圖`,pie:`圓形圖`,doughnut:`環圈圖`,scatter:`散佈圖`,"scatter-lines":`帶有直線和資料標記的散佈圖`,"scatter-smooth":`帶有平滑線和資料標記的散佈圖`},type:`圖表類型`,title:`圖表標題`,legend:`圖例`,legendAt:{none:`無`,bottom:`下`,top:`上`,left:`左`,right:`右`},dataLabels:`資料標籤`,smooth:`平滑曲線`,barColors:`每根長條的顏色`,addCategory:`新增類別`,addSeries:`新增數列`,deleteCategory:`刪除類別`,deleteSeries:`刪除數列`,cell:(e,t)=>`第 ${String(e)} 列,第 ${String(t)} 欄`,fromFile:e=>`數值來自 ${e}:請在那裡修改。`,notHere:e=>`${e} 的數值還沒到。`,cannotDraw:`這個圖表畫不出來`},emptyEquation:`空方程式`,emptyDiagram:`空圖示`,style:`樣式`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`宋體`,hei:`黑體`,fangsong:`仿宋`,kai:`楷體`,xiaobiaosong:`小標宋`},accent:`強調色`,defaultColor:`預設`,pageNumbers:`頁碼`,page:{preset:`預設`,none:`無`,presets:{apa:`APA 7`,mla:`MLA 9`,report:`報告`,memo:`備忘錄`,"business-letter":`商務信函`},paper:`紙張`,orientation:`方向`,portrait:`縱向`,landscape:`橫向`,margins:`邊界`,marginNames:{normal:`一般`,narrow:`窄`,wide:`寬`},size:`字級`,pt:e=>`${String(e)} pt`,lineHeight:`行距`,grid:`依格線`,indent:`首行縮排`},tocEmpty:`還沒有標題`,sourcesEmpty:`用 [@key] 引用文獻後會列在這裡`,pages:`分頁`,pagesPrinting:`正在排版…`,pagesFailed:e=>`無法排出頁面:${e}`,pageOf:(e,t)=>`第 ${String(e)} 頁,共 ${String(t)} 頁`,pageBlock:e=>`第 ${String(e)} 頁上的一塊:在正文中顯示`,cover:{add:`新增封面`,change:`更換封面`,reposition:`調整位置`,remove:`移除`,drag:`拖曳圖片以調整位置`,save:`儲存位置`,cancel:`取消`,upload:`上傳`,none:`專案中沒有圖片`,gallery:`圖庫`,project:`專案`,names:{dots:`點彩`,scales:`青海波`,bay:`暮色海灣`,stacks:`麥垛`,steam:`蒸汽火車`,dusk:`暮山`,lake:`晨湖`}}},ja:{loading:`開いています…`,unreadable:`このドキュメントは現在表示できません:ファイルがドキュメントの形式で書かれていません。ファイルの内容は次のとおりです。`,duplicate:`複製`,remove:`削除`,colors:`カラー`,tag:`タグ`,noTag:`タグなし`,nothing:`その名前のブロックはありません`,nothingToLink:`その名前のものはプロジェクトにありません`,turnInto:`ブロックタイプの変更`,aligns:{left:`左揃え`,center:`中央揃え`,right:`右揃え`,justify:`両端揃え`},copyPlace:`ファイル内の位置をコピー`,find:`操作を検索…`,text:`文字`,background:`背景`,placeholder:`入力するか、/ でブロックを選択`,heading:`見出し`,colorNames:{gray:`グレー`,brown:`ブラウン`,red:`レッド`,orange:`オレンジ`,yellow:`イエロー`,green:`グリーン`,blue:`ブルー`,purple:`パープル`,pink:`ピンク`},embed:`コードで描画`,title:`タイトル`,untitled:`無題`,outline:`このページの内容`,blocks:{paragraph:`テキスト`,heading1:`見出し 1`,heading2:`見出し 2`,heading3:`見出し 3`,bullet:`箇条書きリスト`,numbered:`番号付きリスト`,check:`ToDo リスト`,toggle:`トグル`,quote:`引用`,callout:`コールアウト`,code:`コード`,divider:`区切り線`,table:`表`,image:`画像`,chart:`グラフ`,equation:`数式`,diagram:`ダイアグラム`,columns2:`2列`,columns3:`3列`,footnote:`脚注`,pagebreak:`改ページ`,pagebreakLandscape:`改ページ(以降は横向き)`,pagebreakPortrait:`改ページ(以降は縦向き)`,toc:`目次`,bibliography:`参考文献`,card:`カード`,stats:`数値カード`},component:`コンポーネント`,stats:{label:`ラベル`,value:`値`,delta:`変化`,note:`注記`,trend:`推移:12, 15, 14`,add:`数値を追加`,remove:`この数値を削除`},card:{title:`カードのタイトル`,subtitle:`サブタイトル`},sample:{category:e=>`分類 ${String(e)}`,series:e=>`系列 ${String(e)}`},chart:{types:{"column-clustered":`集合縦棒`,"column-stacked":`積み上げ縦棒`,"column-stacked-100":`100% 積み上げ縦棒`,"bar-clustered":`集合横棒`,"bar-stacked":`積み上げ横棒`,"bar-stacked-100":`100% 積み上げ横棒`,line:`折れ線`,"line-markers":`マーカー付き折れ線`,area:`面`,"area-stacked":`積み上げ面`,"area-stacked-100":`100% 積み上げ面`,pie:`円`,doughnut:`ドーナツ`,scatter:`散布図`,"scatter-lines":`散布図 (直線とマーカー)`,"scatter-smooth":`散布図 (平滑線とマーカー)`},type:`グラフの種類`,title:`グラフ タイトル`,legend:`凡例`,legendAt:{none:`なし`,bottom:`下`,top:`上`,left:`左`,right:`右`},dataLabels:`データ ラベル`,smooth:`滑らかな線`,barColors:`棒ごとの色`,addCategory:`分類を追加`,addSeries:`系列を追加`,deleteCategory:`分類を削除`,deleteSeries:`系列を削除`,cell:(e,t)=>`${String(e)} 行目、${String(t)} 列目`,fromFile:e=>`数値は ${e} から読み込まれます。そちらで変更してください。`,notHere:e=>`${e} の数値はまだ届いていません。`,cannotDraw:`このグラフは描画できません`},emptyEquation:`空の数式`,emptyDiagram:`空のダイアグラム`,style:`スタイル`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`宋朝体`,hei:`黒体`,fangsong:`仿宋体`,kai:`楷書体`,xiaobiaosong:`小標宋`},accent:`アクセント`,defaultColor:`デフォルト`,pageNumbers:`ページ番号`,page:{preset:`プリセット`,none:`なし`,presets:{apa:`APA 7`,mla:`MLA 9`,report:`レポート`,memo:`社内メモ`,"business-letter":`ビジネスレター`},paper:`用紙`,orientation:`向き`,portrait:`縦`,landscape:`横`,margins:`余白`,marginNames:{normal:`標準`,narrow:`狭い`,wide:`広い`},size:`文字サイズ`,pt:e=>`${String(e)} pt`,lineHeight:`行の高さ`,grid:`グリッド`,indent:`段落の字下げ`},tocEmpty:`まだ見出しがありません`,sourcesEmpty:`[@key] で文献を引用すると、ここに並びます`,pages:`ページ`,pagesPrinting:`印刷中…`,pagesFailed:e=>`ページを印刷できませんでした:${e}`,pageOf:(e,t)=>`${String(e)} / ${String(t)} ページ`,pageBlock:e=>`${String(e)} ページのブロック:本文で表示`,cover:{add:`カバーを追加`,change:`カバーを変更`,reposition:`位置を調整`,remove:`削除`,drag:`画像をドラッグして位置を調整`,save:`位置を保存`,cancel:`キャンセル`,upload:`アップロード`,none:`プロジェクトに画像がありません`,gallery:`ギャラリー`,project:`プロジェクト`,names:{dots:`点描`,scales:`青海波`,bay:`夕暮れの入江`,stacks:`積みわら`,steam:`蒸気機関車`,dusk:`夕暮れの山`,lake:`夜明けの湖`}}},ko:{loading:`여는 중…`,unreadable:`지금은 이 문서를 표시할 수 없습니다. 파일이 문서 형식으로 쓰여 있지 않습니다. 파일 내용은 다음과 같습니다.`,duplicate:`복제`,remove:`삭제`,colors:`색상`,tag:`태그`,noTag:`태그 없음`,nothing:`해당 이름의 블록이 없습니다`,nothingToLink:`프로젝트에 해당 이름의 항목이 없습니다`,turnInto:`변환`,aligns:{left:`왼쪽`,center:`가운데`,right:`오른쪽`,justify:`양쪽 맞춤`},copyPlace:`파일 내 위치 복사`,find:`할 작업 찾기…`,text:`텍스트`,background:`배경`,placeholder:`입력하거나 /를 눌러 블록 추가`,heading:`제목`,colorNames:{gray:`회색`,brown:`갈색`,red:`빨간색`,orange:`주황색`,yellow:`노란색`,green:`초록색`,blue:`파란색`,purple:`보라색`,pink:`분홍색`},embed:`코드로 그린 항목`,title:`제목`,untitled:`제목 없음`,outline:`이 페이지의 내용`,blocks:{paragraph:`텍스트`,heading1:`제목 1`,heading2:`제목 2`,heading3:`제목 3`,bullet:`글머리 기호 목록`,numbered:`번호 매기기 목록`,check:`할 일 목록`,toggle:`토글`,quote:`인용`,callout:`콜아웃`,code:`코드`,divider:`구분선`,table:`표`,image:`이미지`,chart:`차트`,equation:`수식`,diagram:`다이어그램`,columns2:`2열`,columns3:`3열`,footnote:`각주`,pagebreak:`페이지 나누기`,pagebreakLandscape:`페이지 나누기, 이후 가로`,pagebreakPortrait:`페이지 나누기, 이후 세로`,toc:`목차`,bibliography:`참고 문헌`,card:`카드`,stats:`수치 카드`},component:`컴포넌트`,stats:{label:`이름`,value:`값`,delta:`변화`,note:`메모`,trend:`추이: 12, 15, 14`,add:`수치 추가`,remove:`이 수치 삭제`},card:{title:`카드 제목`,subtitle:`부제`},sample:{category:e=>`항목 ${String(e)}`,series:e=>`계열 ${String(e)}`},chart:{types:{"column-clustered":`묶은 세로 막대형`,"column-stacked":`누적 세로 막대형`,"column-stacked-100":`100% 기준 누적 세로 막대형`,"bar-clustered":`묶은 가로 막대형`,"bar-stacked":`누적 가로 막대형`,"bar-stacked-100":`100% 기준 누적 가로 막대형`,line:`꺾은선형`,"line-markers":`표식이 있는 꺾은선형`,area:`영역형`,"area-stacked":`누적 영역형`,"area-stacked-100":`100% 기준 누적 영역형`,pie:`원형`,doughnut:`도넛형`,scatter:`분산형`,"scatter-lines":`직선 및 표식이 있는 분산형`,"scatter-smooth":`곡선 및 표식이 있는 분산형`},type:`차트 종류`,title:`차트 제목`,legend:`범례`,legendAt:{none:`없음`,bottom:`아래쪽`,top:`위쪽`,left:`왼쪽`,right:`오른쪽`},dataLabels:`데이터 레이블`,smooth:`부드러운 선`,barColors:`막대별 색`,addCategory:`항목 추가`,addSeries:`계열 추가`,deleteCategory:`항목 삭제`,deleteSeries:`계열 삭제`,cell:(e,t)=>`${String(e)}행, ${String(t)}열`,fromFile:e=>`숫자는 ${e}에서 가져옵니다. 그곳에서 변경하세요.`,notHere:e=>`${e}의 숫자가 아직 오지 않았습니다.`,cannotDraw:`이 차트를 그릴 수 없습니다`},emptyEquation:`빈 수식`,emptyDiagram:`빈 다이어그램`,style:`스타일`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`송체`,hei:`흑체`,fangsong:`방송체`,kai:`해서체`,xiaobiaosong:`소표송`},accent:`강조 색`,defaultColor:`기본값`,pageNumbers:`페이지 번호`,page:{preset:`프리셋`,none:`없음`,presets:{apa:`APA 7`,mla:`MLA 9`,report:`보고서`,memo:`메모`,"business-letter":`비즈니스 서신`},paper:`용지`,orientation:`방향`,portrait:`세로`,landscape:`가로`,margins:`여백`,marginNames:{normal:`보통`,narrow:`좁게`,wide:`넓게`},size:`글자 크기`,pt:e=>`${String(e)} pt`,lineHeight:`줄 높이`,grid:`격자`,indent:`첫 줄 들여쓰기`},tocEmpty:`아직 제목이 없습니다`,sourcesEmpty:`[@key]로 출처를 인용하면 여기에 나열됩니다`,pages:`페이지`,pagesPrinting:`인쇄 중…`,pagesFailed:e=>`페이지를 인쇄하지 못했습니다: ${e}`,pageOf:(e,t)=>`${String(t)}쪽 중 ${String(e)}쪽`,pageBlock:e=>`${String(e)}쪽의 블록: 본문에서 보기`,cover:{add:`커버 추가`,change:`커버 변경`,reposition:`위치 변경`,remove:`제거`,drag:`이미지를 드래그하여 위치 변경`,save:`위치 저장`,cancel:`취소`,upload:`업로드`,none:`프로젝트에 이미지가 없습니다`,gallery:`갤러리`,project:`프로젝트`,names:{dots:`점묘`,scales:`청해파`,bay:`저녁 만`,stacks:`밀짚 더미`,steam:`증기 기관차`,dusk:`해 질 녘 산`,lake:`새벽 호수`}}},es:{loading:`Abriendo…`,unreadable:`Este documento no se puede mostrar ahora: su archivo no está escrito como un documento. Esto es lo que dice.`,duplicate:`Duplicar`,remove:`Eliminar`,colors:`Colores`,tag:`Etiqueta`,noTag:`Sin etiqueta`,nothing:`Ningún bloque con ese nombre`,nothingToLink:`No hay nada en el proyecto con ese nombre`,turnInto:`Convertir en`,aligns:{left:`Izquierda`,center:`Centro`,right:`Derecha`,justify:`Justificar`},copyPlace:`Copiar su posición en el archivo`,find:`Busca qué hacer…`,text:`texto`,background:`fondo`,placeholder:`Escribe o pulsa / para ver los bloques`,heading:`Encabezado`,colorNames:{gray:`Gris`,brown:`Marrón`,red:`Rojo`,orange:`Naranja`,yellow:`Amarillo`,green:`Verde`,blue:`Azul`,purple:`Morado`,pink:`Rosa`},embed:`Dibujado con código`,title:`Título`,untitled:`Sin título`,outline:`En esta página`,blocks:{paragraph:`Texto`,heading1:`Encabezado 1`,heading2:`Encabezado 2`,heading3:`Encabezado 3`,bullet:`Lista con viñetas`,numbered:`Lista numerada`,check:`Lista de tareas`,toggle:`Desplegable`,quote:`Cita`,callout:`Destacado`,code:`Código`,divider:`Separador`,table:`Tabla`,image:`Imagen`,chart:`Gráfico`,equation:`Ecuación`,diagram:`Diagrama`,columns2:`2 columnas`,columns3:`3 columnas`,footnote:`Nota al pie`,pagebreak:`Salto de página`,pagebreakLandscape:`Salto de página, luego horizontal`,pagebreakPortrait:`Salto de página, luego vertical`,toc:`Índice`,bibliography:`Bibliografía`,card:`Tarjeta`,stats:`Cifras`},component:`Componente`,stats:{label:`Etiqueta`,value:`Valor`,delta:`Cambio`,note:`Nota`,trend:`Tendencia: 12, 15, 14`,add:`Añadir una cifra`,remove:`Quitar esta cifra`},card:{title:`Título de la tarjeta`,subtitle:`Subtítulo`},sample:{category:e=>`Categoría ${String(e)}`,series:e=>`Serie ${String(e)}`},chart:{types:{"column-clustered":`Columna agrupada`,"column-stacked":`Columna apilada`,"column-stacked-100":`Columna 100% apilada`,"bar-clustered":`Barra agrupada`,"bar-stacked":`Barra apilada`,"bar-stacked-100":`Barra 100% apilada`,line:`Línea`,"line-markers":`Línea con marcadores`,area:`Área`,"area-stacked":`Área apilada`,"area-stacked-100":`Área 100% apilada`,pie:`Circular`,doughnut:`Anillo`,scatter:`Dispersión`,"scatter-lines":`Dispersión con líneas rectas y marcadores`,"scatter-smooth":`Dispersión con líneas suavizadas y marcadores`},type:`Tipo de gráfico`,title:`Título del gráfico`,legend:`Leyenda`,legendAt:{none:`Ninguna`,bottom:`Abajo`,top:`Arriba`,left:`Izquierda`,right:`Derecha`},dataLabels:`Etiquetas de datos`,smooth:`Líneas suavizadas`,barColors:`Color de cada barra`,addCategory:`Agregar categoría`,addSeries:`Agregar serie`,deleteCategory:`Eliminar categoría`,deleteSeries:`Eliminar serie`,cell:(e,t)=>`Fila ${String(e)}, columna ${String(t)}`,fromFile:e=>`Los números vienen de ${e}: cámbialos allí.`,notHere:e=>`Los números de ${e} aún no han llegado.`,cannotDraw:`Este gráfico no se puede dibujar`},emptyEquation:`Ecuación vacía`,emptyDiagram:`Diagrama vacío`,style:`Estilo`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Acento`,defaultColor:`Predeterminado`,pageNumbers:`Números de página`,page:{preset:`Plantilla`,none:`Ninguna`,presets:{apa:`APA 7`,mla:`MLA 9`,report:`Informe`,memo:`Memorándum`,"business-letter":`Carta comercial`},paper:`Papel`,orientation:`Orientación`,portrait:`Vertical`,landscape:`Horizontal`,margins:`Márgenes`,marginNames:{normal:`Normal`,narrow:`Estrecho`,wide:`Ancho`},size:`Tamaño del texto`,pt:e=>`${String(e)} pt`,lineHeight:`Interlineado`,grid:`La cuadrícula`,indent:`Sangrar primeras líneas`},tocEmpty:`Aún no hay encabezados`,sourcesEmpty:`Cita una fuente con [@key] para listarla aquí`,pages:`Páginas`,pagesPrinting:`Imprimiendo…`,pagesFailed:e=>`No se pudieron imprimir las páginas: ${e}`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,pageBlock:e=>`Un bloque en la página ${String(e)}: mostrarlo en el texto`,cover:{add:`Añadir portada`,change:`Cambiar portada`,reposition:`Reposicionar`,remove:`Quitar`,drag:`Arrastra la imagen para reposicionarla`,save:`Guardar posición`,cancel:`Cancelar`,upload:`Subir`,none:`No hay imágenes en el proyecto`,gallery:`Galería`,project:`Proyecto`,names:{dots:`Puntillismo`,scales:`Escamas de mar`,bay:`Bahía al atardecer`,stacks:`Almiares`,steam:`Tren de vapor`,dusk:`Montañas al anochecer`,lake:`Lago al alba`}}},fr:{loading:`Ouverture…`,unreadable:`Ce document ne peut pas être affiché pour l’instant\xA0: son fichier n’est pas écrit comme un document. Voici ce qu’il contient.`,duplicate:`Dupliquer`,remove:`Supprimer`,colors:`Couleurs`,tag:`Étiquette`,noTag:`Sans étiquette`,nothing:`Aucun bloc de ce nom`,nothingToLink:`Rien de ce nom dans le projet`,turnInto:`Transformer en`,aligns:{left:`À gauche`,center:`Centré`,right:`À droite`,justify:`Justifié`},copyPlace:`Copier son emplacement dans le fichier`,find:`Rechercher une action…`,text:`texte`,background:`fond`,placeholder:`Écrivez, ou tapez / pour les blocs`,heading:`Titre`,colorNames:{gray:`Gris`,brown:`Marron`,red:`Rouge`,orange:`Orange`,yellow:`Jaune`,green:`Vert`,blue:`Bleu`,purple:`Violet`,pink:`Rose`},embed:`Dessiné par du code`,title:`Titre`,untitled:`Sans titre`,outline:`Sur cette page`,blocks:{paragraph:`Texte`,heading1:`Titre 1`,heading2:`Titre 2`,heading3:`Titre 3`,bullet:`Liste à puces`,numbered:`Liste numérotée`,check:`Liste de tâches`,toggle:`Bloc dépliable`,quote:`Citation`,callout:`Encadré`,code:`Code`,divider:`Séparateur`,table:`Tableau`,image:`Image`,chart:`Graphique`,equation:`Équation`,diagram:`Diagramme`,columns2:`2 colonnes`,columns3:`3 colonnes`,footnote:`Note de bas de page`,pagebreak:`Saut de page`,pagebreakLandscape:`Saut de page, puis paysage`,pagebreakPortrait:`Saut de page, puis portrait`,toc:`Sommaire`,bibliography:`Bibliographie`,card:`Carte`,stats:`Chiffres clés`},component:`Composant`,stats:{label:`Libellé`,value:`Valeur`,delta:`Variation`,note:`Note`,trend:`Tendance : 12, 15, 14`,add:`Ajouter un chiffre`,remove:`Retirer ce chiffre`},card:{title:`Titre de la carte`,subtitle:`Sous-titre`},sample:{category:e=>`Catégorie ${String(e)}`,series:e=>`Série ${String(e)}`},chart:{types:{"column-clustered":`Histogramme groupé`,"column-stacked":`Histogramme empilé`,"column-stacked-100":`Histogramme empilé 100 %`,"bar-clustered":`Barres groupées`,"bar-stacked":`Barres empilées`,"bar-stacked-100":`Barres empilées 100 %`,line:`Courbes`,"line-markers":`Courbes avec marques`,area:`Aires`,"area-stacked":`Aires empilées`,"area-stacked-100":`Aires empilées 100 %`,pie:`Secteurs`,doughnut:`Anneau`,scatter:`Nuage de points`,"scatter-lines":`Nuage de points avec lignes droites et marqueurs`,"scatter-smooth":`Nuage de points avec courbes lissées et marqueurs`},type:`Type de graphique`,title:`Titre du graphique`,legend:`Légende`,legendAt:{none:`Aucune`,bottom:`Bas`,top:`Haut`,left:`Gauche`,right:`Droite`},dataLabels:`Étiquettes de données`,smooth:`Lignes lissées`,barColors:`Couleur de chaque barre`,addCategory:`Ajouter une catégorie`,addSeries:`Ajouter une série`,deleteCategory:`Supprimer la catégorie`,deleteSeries:`Supprimer la série`,cell:(e,t)=>`Ligne ${String(e)}, colonne ${String(t)}`,fromFile:e=>`Les nombres viennent de ${e} : modifiez-les là-bas.`,notHere:e=>`Les nombres de ${e} ne sont pas encore là.`,cannotDraw:`Ce graphique ne peut pas être dessiné`},emptyEquation:`Équation vide`,emptyDiagram:`Diagramme vide`,style:`Style`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Accent`,defaultColor:`Par défaut`,pageNumbers:`Numéros de page`,page:{preset:`Modèle`,none:`Aucun`,presets:{apa:`APA 7`,mla:`MLA 9`,report:`Rapport`,memo:`Note de service`,"business-letter":`Lettre commerciale`},paper:`Papier`,orientation:`Orientation`,portrait:`Portrait`,landscape:`Paysage`,margins:`Marges`,marginNames:{normal:`Normales`,narrow:`Étroites`,wide:`Larges`},size:`Taille du texte`,pt:e=>`${String(e)} pt`,lineHeight:`Interligne`,grid:`La grille`,indent:`Retrait de première ligne`},tocEmpty:`Pas encore de titres`,sourcesEmpty:`Citez une source avec [@key] pour la lister ici`,pages:`Pages`,pagesPrinting:`Impression…`,pagesFailed:e=>`Les pages n’ont pas pu être imprimées : ${e}`,pageOf:(e,t)=>`Page ${String(e)} sur ${String(t)}`,pageBlock:e=>`Un bloc de la page ${String(e)} : le montrer dans le texte`,cover:{add:`Ajouter une couverture`,change:`Changer de couverture`,reposition:`Repositionner`,remove:`Retirer`,drag:`Faites glisser l’image pour la repositionner`,save:`Enregistrer la position`,cancel:`Annuler`,upload:`Importer`,none:`Aucune image dans le projet`,gallery:`Galerie`,project:`Projet`,names:{dots:`Pointillisme`,scales:`Écailles de mer`,bay:`Baie au soir`,stacks:`Meules de blé`,steam:`Train à vapeur`,dusk:`Montagnes au crépuscule`,lake:`Lac à l'aube`}}},de:{loading:`Wird geöffnet …`,unreadable:`Dieses Dokument kann gerade nicht angezeigt werden: Seine Datei ist nicht als Dokument geschrieben. Hier steht, was sie enthält.`,duplicate:`Duplizieren`,remove:`Löschen`,colors:`Farben`,tag:`Etikett`,noTag:`Kein Etikett`,nothing:`Kein Block mit diesem Namen`,nothingToLink:`Nichts im Projekt mit diesem Namen`,turnInto:`Umwandeln in`,aligns:{left:`Links`,center:`Zentriert`,right:`Rechts`,justify:`Blocksatz`},copyPlace:`Stelle in der Datei kopieren`,find:`Aktion suchen …`,text:`Text`,background:`Hintergrund`,placeholder:`Schreib, oder drück / für Blöcke`,heading:`Überschrift`,colorNames:{gray:`Grau`,brown:`Braun`,red:`Rot`,orange:`Orange`,yellow:`Gelb`,green:`Grün`,blue:`Blau`,purple:`Lila`,pink:`Pink`},embed:`Per Code gezeichnet`,title:`Titel`,untitled:`Ohne Titel`,outline:`Auf dieser Seite`,blocks:{paragraph:`Text`,heading1:`Überschrift 1`,heading2:`Überschrift 2`,heading3:`Überschrift 3`,bullet:`Aufzählung`,numbered:`Nummerierte Liste`,check:`To-do-Liste`,toggle:`Toggle-Liste`,quote:`Zitat`,callout:`Hinweis`,code:`Code`,divider:`Trennlinie`,table:`Tabelle`,image:`Bild`,chart:`Diagramm`,equation:`Formel`,diagram:`Schaubild`,columns2:`2 Spalten`,columns3:`3 Spalten`,footnote:`Fußnote`,pagebreak:`Seitenumbruch`,pagebreakLandscape:`Seitenumbruch, danach Querformat`,pagebreakPortrait:`Seitenumbruch, danach Hochformat`,toc:`Inhalt`,bibliography:`Literaturverzeichnis`,card:`Karte`,stats:`Kennzahlen`},component:`Komponente`,stats:{label:`Bezeichnung`,value:`Wert`,delta:`Veränderung`,note:`Anmerkung`,trend:`Verlauf: 12, 15, 14`,add:`Kennzahl hinzufügen`,remove:`Diese Kennzahl entfernen`},card:{title:`Kartentitel`,subtitle:`Untertitel`},sample:{category:e=>`Kategorie ${String(e)}`,series:e=>`Datenreihe ${String(e)}`},chart:{types:{"column-clustered":`Gruppierte Säulen`,"column-stacked":`Gestapelte Säulen`,"column-stacked-100":`Gestapelte Säulen (100 %)`,"bar-clustered":`Gruppierte Balken`,"bar-stacked":`Gestapelte Balken`,"bar-stacked-100":`Gestapelte Balken (100 %)`,line:`Linie`,"line-markers":`Linie mit Datenpunkten`,area:`Fläche`,"area-stacked":`Gestapelte Fläche`,"area-stacked-100":`Gestapelte Fläche (100 %)`,pie:`Kreis`,doughnut:`Ring`,scatter:`Punkt (XY)`,"scatter-lines":`Punkte mit geraden Linien und Datenpunkten`,"scatter-smooth":`Punkte mit interpolierten Linien und Datenpunkten`},type:`Diagrammtyp`,title:`Diagrammtitel`,legend:`Legende`,legendAt:{none:`Keine`,bottom:`Unten`,top:`Oben`,left:`Links`,right:`Rechts`},dataLabels:`Datenbeschriftungen`,smooth:`Glatte Linien`,barColors:`Farbe je Balken`,addCategory:`Kategorie hinzufügen`,addSeries:`Datenreihe hinzufügen`,deleteCategory:`Kategorie löschen`,deleteSeries:`Datenreihe löschen`,cell:(e,t)=>`Zeile ${String(e)}, Spalte ${String(t)}`,fromFile:e=>`Die Zahlen stammen aus ${e}: Ändern Sie sie dort.`,notHere:e=>`Die Zahlen aus ${e} sind noch nicht da.`,cannotDraw:`Dieses Diagramm kann nicht gezeichnet werden`},emptyEquation:`Leere Formel`,emptyDiagram:`Leeres Schaubild`,style:`Stil`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Akzent`,defaultColor:`Standard`,pageNumbers:`Seitenzahlen`,page:{preset:`Vorlage`,none:`Keine`,presets:{apa:`APA 7`,mla:`MLA 9`,report:`Bericht`,memo:`Memo`,"business-letter":`Geschäftsbrief`},paper:`Papier`,orientation:`Ausrichtung`,portrait:`Hochformat`,landscape:`Querformat`,margins:`Ränder`,marginNames:{normal:`Normal`,narrow:`Schmal`,wide:`Breit`},size:`Schriftgröße`,pt:e=>`${String(e)} pt`,lineHeight:`Zeilenhöhe`,grid:`Das Raster`,indent:`Erste Zeile einrücken`},tocEmpty:`Noch keine Überschriften`,sourcesEmpty:`Eine Quelle mit [@key] zitieren, um sie hier aufzuführen`,pages:`Seiten`,pagesPrinting:`Wird gedruckt …`,pagesFailed:e=>`Die Seiten konnten nicht gedruckt werden: ${e}`,pageOf:(e,t)=>`Seite ${String(e)} von ${String(t)}`,pageBlock:e=>`Ein Block auf Seite ${String(e)}: im Text zeigen`,cover:{add:`Titelbild hinzufügen`,change:`Titelbild ändern`,reposition:`Neu positionieren`,remove:`Entfernen`,drag:`Bild ziehen, um es neu zu positionieren`,save:`Position speichern`,cancel:`Abbrechen`,upload:`Hochladen`,none:`Keine Bilder im Projekt`,gallery:`Galerie`,project:`Projekt`,names:{dots:`Pointillismus`,scales:`Meeresschuppen`,bay:`Bucht am Abend`,stacks:`Weizenschober`,steam:`Dampflok`,dusk:`Berge in der Dämmerung`,lake:`See im Morgenlicht`}}},pt:{loading:`Abrindo…`,unreadable:`Não é possível mostrar este documento agora: o arquivo não está escrito como documento. Veja o que ele diz.`,duplicate:`Duplicar`,remove:`Excluir`,colors:`Cores`,tag:`Etiqueta`,noTag:`Sem etiqueta`,nothing:`Nenhum bloco com esse nome`,nothingToLink:`Nada no projeto com esse nome`,turnInto:`Transformar em`,aligns:{left:`À esquerda`,center:`Centralizado`,right:`À direita`,justify:`Justificado`},copyPlace:`Copiar a posição no arquivo`,find:`Buscar uma ação…`,text:`texto`,background:`fundo`,placeholder:`Escreva ou pressione / para blocos`,heading:`Título`,colorNames:{gray:`Cinza`,brown:`Marrom`,red:`Vermelho`,orange:`Laranja`,yellow:`Amarelo`,green:`Verde`,blue:`Azul`,purple:`Roxo`,pink:`Rosa`},embed:`Desenhado por código`,title:`Título`,untitled:`Sem título`,outline:`Nesta página`,blocks:{paragraph:`Texto`,heading1:`Título 1`,heading2:`Título 2`,heading3:`Título 3`,bullet:`Lista com marcadores`,numbered:`Lista numerada`,check:`Lista de tarefas`,toggle:`Lista de alternância`,quote:`Citação`,callout:`Destaque`,code:`Código`,divider:`Divisor`,table:`Tabela`,image:`Imagem`,chart:`Gráfico`,equation:`Equação`,diagram:`Diagrama`,columns2:`2 colunas`,columns3:`3 colunas`,footnote:`Nota de rodapé`,pagebreak:`Quebra de página`,pagebreakLandscape:`Quebra de página, depois paisagem`,pagebreakPortrait:`Quebra de página, depois retrato`,toc:`Sumário`,bibliography:`Bibliografia`,card:`Cartão`,stats:`Números`},component:`Componente`,stats:{label:`Rótulo`,value:`Valor`,delta:`Variação`,note:`Nota`,trend:`Tendência: 12, 15, 14`,add:`Adicionar um número`,remove:`Remover este número`},card:{title:`Título do cartão`,subtitle:`Subtítulo`},sample:{category:e=>`Categoria ${String(e)}`,series:e=>`Série ${String(e)}`},chart:{types:{"column-clustered":`Colunas Agrupadas`,"column-stacked":`Colunas Empilhadas`,"column-stacked-100":`Colunas 100% Empilhadas`,"bar-clustered":`Barras Agrupadas`,"bar-stacked":`Barras Empilhadas`,"bar-stacked-100":`Barras 100% Empilhadas`,line:`Linhas`,"line-markers":`Linhas com Marcadores`,area:`Área`,"area-stacked":`Área Empilhada`,"area-stacked-100":`Área 100% Empilhada`,pie:`Pizza`,doughnut:`Rosca`,scatter:`Dispersão`,"scatter-lines":`Dispersão com Linhas Retas e Marcadores`,"scatter-smooth":`Dispersão com Linhas Suaves e Marcadores`},type:`Tipo de gráfico`,title:`Título do gráfico`,legend:`Legenda`,legendAt:{none:`Nenhuma`,bottom:`Inferior`,top:`Superior`,left:`Esquerda`,right:`Direita`},dataLabels:`Rótulos de dados`,smooth:`Linhas suavizadas`,barColors:`Cor de cada barra`,addCategory:`Adicionar categoria`,addSeries:`Adicionar série`,deleteCategory:`Excluir categoria`,deleteSeries:`Excluir série`,cell:(e,t)=>`Linha ${String(e)}, coluna ${String(t)}`,fromFile:e=>`Os números vêm de ${e}: altere-os lá.`,notHere:e=>`Os números de ${e} ainda não chegaram.`,cannotDraw:`Não é possível desenhar este gráfico`},emptyEquation:`Equação vazia`,emptyDiagram:`Diagrama vazio`,style:`Estilo`,fonts:{sans:`Calibri`,serif:`Cambria`,mono:`Courier`,times:`Times`,song:`Song`,hei:`Hei`,fangsong:`Fangsong`,kai:`Kai`,xiaobiaosong:`Xiaobiaosong`},accent:`Destaque`,defaultColor:`Padrão`,pageNumbers:`Números de página`,page:{preset:`Predefinição`,none:`Nenhuma`,presets:{apa:`APA 7`,mla:`MLA 9`,report:`Relatório`,memo:`Memorando`,"business-letter":`Carta comercial`},paper:`Papel`,orientation:`Orientação`,portrait:`Retrato`,landscape:`Paisagem`,margins:`Margens`,marginNames:{normal:`Normais`,narrow:`Estreitas`,wide:`Largas`},size:`Tamanho do texto`,pt:e=>`${String(e)} pt`,lineHeight:`Altura da linha`,grid:`A grade`,indent:`Recuar a primeira linha`},tocEmpty:`Ainda sem títulos`,sourcesEmpty:`Cite uma fonte com [@key] para listá-la aqui`,pages:`Páginas`,pagesPrinting:`Imprimindo…`,pagesFailed:e=>`Não foi possível imprimir as páginas: ${e}`,pageOf:(e,t)=>`Página ${String(e)} de ${String(t)}`,pageBlock:e=>`Um bloco na página ${String(e)}: mostrar no texto`,cover:{add:`Adicionar capa`,change:`Alterar capa`,reposition:`Reposicionar`,remove:`Remover`,drag:`Arraste a imagem para reposicioná-la`,save:`Salvar posição`,cancel:`Cancelar`,upload:`Enviar`,none:`Nenhuma imagem no projeto`,gallery:`Galeria`,project:`Projeto`,names:{dots:`Pontilhismo`,scales:`Escamas do mar`,bay:`Baía ao entardecer`,stacks:`Medas de trigo`,steam:`Trem a vapor`,dusk:`Montanhas ao entardecer`,lake:`Lago ao amanhecer`}}}});function Pf(e){return C(Mf,e)}var Ff=e=>e.map(sa),If=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);function Lf(e,t,n){let r=Ff(e),i=Ff(t),a=new Map(yn(r,i)),o=new Map(yn(r,Ff(n))),s=new Set(a.values()),c=new Set;for(let e=0;e<r.length;e++){let t=a.get(e);t!==void 0&&!o.has(e)&&c.add(t)}let l=new Map([...o].map(([e,t])=>[t,e])),u=new Map,d=-1;n.forEach((e,t)=>{let n=l.get(t);n===void 0?u.set(d,[...u.get(d)??[],e]):d=n});let f=e=>{for(let t=e;t>=0;t--){let e=a.get(t);if(e!==void 0)return e+1}return 0},p=new Map;for(let[e,n]of u){let c=f(e),l=c;for(;l<t.length&&!s.has(l);)l++;if(If(i.slice(c,l),Ff(n)))continue;let u=e+1<r.length&&!o.has(e+1),d=e>=0&&!a.has(e),m=u||d?l:c;p.set(m,[...p.get(m)??[],...n])}let m=[];for(let e=0;e<=t.length;e++){m.push(...p.get(e)??[]);let n=t[e];n&&!c.has(e)&&m.push(n)}return m}function Rf(e,t){if(!e.some(e=>e.type===`source`))return[...t];let n=new Map(yn(Ff(pa(e)),Ff(t))),r=new Map,i=-1,a=0;for(let o of e){if(o.type!==`source`){i++;let e=n.get(i);e!==void 0&&(a=e+1);continue}let e=i<0?0:(n.get(i)??a-1)+1,s=Math.max(0,Math.min(t.length,e));r.set(s,[...r.get(s)??[],o])}let o=[];for(let e=0;e<=t.length;e++){o.push(...r.get(e)??[]);let n=t[e];n&&o.push(n)}return o}var zf=(e,t)=>e.font===t.font&&e.accent===t.accent&&e.cover===t.cover&&(e.coverY??50)===(t.coverY??50)&&e.pageNumbers===t.pageNumbers;function Bf(e,t){let n={...e};return delete n.pageNumbers,t?n:{...n,pageNumbers:!1}}function Vf(e,t){let n={...e};return delete n.cover,delete n.coverY,t===void 0?n:{...n,cover:t}}function Hf(e,t){let n=Math.round(Math.min(100,Math.max(0,t))),r={...e};return delete r.coverY,n===50?r:{...r,coverY:n}}var Uf=e=>e.blocks.length===0&&e.problems.length>0,Wf=class{doc;constructor(e){this.doc=wd(e)}get source(){return this.doc.source}get problems(){return this.doc.problems}get unreadable(){return Uf(this.doc)}lineOf(e){let t=0;for(let n of this.doc.segments){let r=pa(n.blocks).length;if(e<t+r)return this.doc.source.slice(0,n.start).split(`
123
- `).length;t+=r}}indexAtLine(e){let t=0,n;for(let r of this.doc.segments){if(this.doc.source.slice(0,r.start).split(`
124
- `).length>e)break;let i=pa(r.blocks).length;i>0&&(n=t),t+=i}return n}get page(){return this.doc.page}shown(){return pa(this.doc.blocks)}textFor(e,t=this.doc.page){let n=Rf(this.doc.blocks,e),r=ca(n,this.doc.blocks)?this.doc.source:Qd(this.doc,n),i=zf(t,this.doc.page)?r:Jd({source:r,frontMatter:this.doc.frontMatter},t);return i===this.doc.source?void 0:i}adopt(e){e!==this.doc.source&&(this.doc=wd(e))}incoming(e,t){if(e===this.doc.source)return;let n=this.shown(),r=wd(e);if(this.doc=r,Uf(r))return;let i=Lf(n,t,pa(r.blocks));return ca(i,t)?void 0:i}},Gf=t((e=>{var t=l();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,l=r[1];return o(function(){c.value=n,c.getSnapshot=t,u(c)&&l({inst:c})},[e,n,t]),a(function(){return u(c)&&l({inst:c}),e(function(){u(c)&&l({inst:c})})},[e]),s(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Kf=t(((e,t)=>{t.exports=Gf()})),qf=t((e=>{var t=l(),n=Kf();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,l){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),l!==void 0&&f.hasValue){var t=f.value;if(l(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return l!==void 0&&l(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,l]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),Jf=t(((e,t)=>{t.exports=qf()})),Yf=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!(o===`_owner`&&t.$$typeof)&&!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),Xf=Jf(),Zf=e(m(),1),Qf=e(Yf(),1),$f=(0,W.createContext)(void 0);function ep(e){return(0,W.useContext)($f)}function tp(e){let t=ep(e);if(!t?.editor)throw Error(`useBlockNoteEditor was called outside of a BlockNoteContext provider or BlockNoteView component`);return t.editor}function np(e,t=e=>e){return(0,Xf.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,rp)}function rp(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=ip(e);return n.length===ip(t).length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&Object.is(e[n],t[n]))}function ip(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var ap=typeof window<`u`?W.useLayoutEffect:W.useEffect,op=class{transactionNumber=0;lastTransactionNumber=0;lastSnapshot;editor;subscribers=new Set;constructor(e){this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e,t){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},n=this.editor._tiptapEditor,r={all:[`transaction`,`create`,`mount`,`unmount`],mount:[`create`,`mount`,`unmount`],selection:[`selectionUpdate`],change:[`update`]};for(let i of r[t])n.on(i,e);return()=>{for(let i of r[t])n.off(i,e)}}}};function sp(e){let t=ep(),n=e.editor||t?.editor||null,r=e.on||`all`,[i]=(0,W.useState)(()=>new op(n)),a=(0,Xf.useSyncExternalStoreWithSelector)(i.subscribe,i.getSnapshot,i.getServerSnapshot,e.selector,e.equalityFn??Qf.default);return ap(()=>i.watch(n,r),[n,i,r]),(0,W.useDebugValue)(a),a}function cp(e){let t=ep();if(e||=t?.editor,!e)throw Error("'editor' is required in `useEditorDOMElement`, either from BlockNoteContext or as a function argument");return sp({editor:e,selector:e=>e.editor.domElement,equalityFn:(e,t)=>e===t,on:`mount`})}var lp=(0,W.createContext)(void 0);function up(){return(0,W.useContext)(lp)}var dp=typeof window<`u`?W.useInsertionEffect:W.useEffect,fp=(0,W.createContext)(null);function pp(){let e=(0,W.useContext)(fp),t=cp();return e||(t?.parentElement??null)}function mp(e){return(0,G.jsx)(fp.Provider,{value:null,children:e.children})}function hp(e){let{target:t,children:n}=e,r=tp(),i=up()?.applyThemedRoot,[a]=(0,W.useState)(()=>typeof document>`u`?null:document.createElement(`div`));return dp(()=>{if(a&&t)return t.appendChild(a),()=>a.remove()},[a,t]),dp(()=>{a&&t&&i?.(a)},[a,t,i]),dp(()=>{if(a&&t)return r.registerPortalElement(a),()=>r.unregisterPortalElement(a)},[r,a,t]),t===void 0?n:(0,G.jsx)(fp.Provider,{value:a,children:n})}function gp(e){return(0,G.jsx)(hp,{target:e.target,children:(0,G.jsx)(_p,{children:e.children})})}function _p(e){let t=pp();return t?(0,Zf.createPortal)(e.children,t):null}function vp(){let[e]=(0,W.useState)(()=>{if(typeof document>`u`)return null;let e=document.createElement(`span`);return e.className=`bn-portal-anchor`,e}),t=(0,W.useCallback)(t=>{t&&e&&e.parentElement!==t&&t.appendChild(e)},[e]);return{anchor:e,holder:(0,G.jsx)(`span`,{ref:t,className:yp,style:{position:`absolute`,width:0,height:0,overflow:`visible`}})}}var yp=`bn-portal-anchor-holder`;function bp(e){return Array.from(e.childNodes).some(e=>!(e instanceof Element&&e.classList.contains(yp)))}function xp(e){let{anchor:t,holder:n}=vp(),r=pp(),i=t??r,a=typeof e.children==`function`?e.children(i):e.children;return(0,G.jsxs)(G.Fragment,{children:[n,(0,G.jsx)(fp.Provider,{value:i,children:a})]})}var Sp=(0,W.createContext)(void 0);function Cp(){return(0,W.useContext)(Sp)}function wp(){return ep().editor.dictionary}var Tp={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ep=W.createContext&&W.createContext(Tp),Dp=[`attr`,`size`,`title`];function Op(e,t){if(e==null)return{};var n,r,i=kp(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kp(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ap(){return Ap=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ap.apply(null,arguments)}function jp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jp(Object(n),!0).forEach(function(t){Np(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Np(e,t,n){return(t=Pp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pp(e){var t=Fp(e,`string`);return typeof t==`symbol`?t:t+``}function Fp(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ip(e){return e&&e.map((e,t)=>W.createElement(e.tag,Mp({key:t},e.attr),Ip(e.child)))}function Lp(e){return t=>W.createElement(Rp,Ap({attr:Mp({},e.attr)},t),Ip(e.child))}function Rp(e){var t=t=>{var{attr:n,size:r,title:i}=e,a=Op(e,Dp),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),W.createElement(`svg`,Ap({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:Mp(Mp({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&W.createElement(`title`,null,i),e.children)};return Ep===void 0?t(Tp):W.createElement(Ep.Consumer,null,e=>t(e))}function zp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM8 13H16C16 15.2091 14.2091 17 12 17C9.79086 17 8 15.2091 8 13ZM8 11C7.17157 11 6.5 10.3284 6.5 9.5C6.5 8.67157 7.17157 8 8 8C8.82843 8 9.5 8.67157 9.5 9.5C9.5 10.3284 8.82843 11 8 11ZM16 11C15.1716 11 14.5 10.3284 14.5 9.5C14.5 8.67157 15.1716 8 16 8C16.8284 8 17.5 8.67157 17.5 9.5C17.5 10.3284 16.8284 11 16 11Z`},child:[]}]})(e)}function Bp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM8 13C8 15.2091 9.79086 17 12 17C14.2091 17 16 15.2091 16 13H8ZM8 11C8.82843 11 9.5 10.3284 9.5 9.5C9.5 8.67157 8.82843 8 8 8C7.17157 8 6.5 8.67157 6.5 9.5C6.5 10.3284 7.17157 11 8 11ZM16 11C16.8284 11 17.5 10.3284 17.5 9.5C17.5 8.67157 16.8284 8 16 8C15.1716 8 14.5 8.67157 14.5 9.5C14.5 10.3284 15.1716 11 16 11Z`},child:[]}]})(e)}function Vp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 11V13H19V11H5Z`},child:[]}]})(e)}function Hp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z`},child:[]}]})(e)}function Up(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V12L17.206 8.207L11.2071 14.2071L9.79289 12.7929L15.792 6.793L12 3H21Z`},child:[]}]})(e)}function Wp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M4 19H20V12H22V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V12H4V19ZM14 9H19L12 16L5 9H10V3H14V9Z`},child:[]}]})(e)}function Gp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM9 11V17H11V11H9ZM13 11V17H15V11H13ZM9 4V6H15V4H9Z`},child:[]}]})(e)}function Kp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 4V6H15V4H9Z`},child:[]}]})(e)}function qp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z`},child:[]}]})(e)}function Jp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z`},child:[]}]})(e)}function Yp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z`},child:[]}]})(e)}function Xp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 18V20H2V18H22ZM2 3.5L10 8.5L2 13.5V3.5ZM22 11V13H12V11H22ZM22 4V6H12V4H22Z`},child:[]}]})(e)}function Zp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M20 3C20.5523 3 21 3.44772 21 4V5.757L19 7.757V5H5V13.1L9 9.1005L13.328 13.429L12.0012 14.7562L11.995 18.995L16.2414 19.0012L17.571 17.671L18.8995 19H19V16.242L21 14.242V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM21.7782 7.80761L23.1924 9.22183L15.4142 17L13.9979 16.9979L14 15.5858L21.7782 7.80761ZM15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7Z`},child:[]}]})(e)}function Qp(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 15V18H24V20H21V23H19V20H16V18H19V15H21ZM21.0082 3C21.556 3 22 3.44495 22 3.9934L22.0007 13.3417C21.3749 13.1204 20.7015 13 20 13V5H4L4.001 19L13.2929 9.70715C13.6528 9.34604 14.22 9.31823 14.6123 9.62322L14.7065 9.70772L18.2521 13.2586C15.791 14.0069 14 16.2943 14 19C14 19.7015 14.1204 20.3749 14.3417 21.0007L2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082ZM8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7Z`},child:[]}]})(e)}function $p(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z`},child:[]}]})(e)}function em(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z`},child:[]}]})(e)}function tm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 3V12C8 14.2091 9.79086 16 12 16C14.2091 16 16 14.2091 16 12V3H18V12C18 15.3137 15.3137 18 12 18C8.68629 18 6 15.3137 6 12V3H8ZM4 20H20V22H4V20Z`},child:[]}]})(e)}function nm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 6V21H11V6H5V4H19V6H13Z`},child:[]}]})(e)}function rm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 10V14H19V10H13ZM11 10H5V14H11V10ZM13 19H19V16H13V19ZM11 19V16H5V19H11ZM13 5V8H19V5H13ZM11 5H5V8H11V5ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z`},child:[]}]})(e)}function im(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17.1538 14C17.3846 14.5161 17.5 15.0893 17.5 15.7196C17.5 17.0625 16.9762 18.1116 15.9286 18.867C14.8809 19.6223 13.4335 20 11.5862 20C9.94674 20 8.32335 19.6185 6.71592 18.8555V16.6009C8.23538 17.4783 9.7908 17.917 11.3822 17.917C13.9333 17.917 15.2128 17.1846 15.2208 15.7196C15.2208 15.0939 15.0049 14.5598 14.5731 14.1173C14.5339 14.0772 14.4939 14.0381 14.4531 14H3V12H21V14H17.1538ZM13.076 11H7.62908C7.4566 10.8433 7.29616 10.6692 7.14776 10.4778C6.71592 9.92084 6.5 9.24559 6.5 8.45207C6.5 7.21602 6.96583 6.165 7.89749 5.299C8.82916 4.43299 10.2706 4 12.2219 4C13.6934 4 15.1009 4.32808 16.4444 4.98426V7.13591C15.2448 6.44921 13.9293 6.10587 12.4978 6.10587C10.0187 6.10587 8.77917 6.88793 8.77917 8.45207C8.77917 8.87172 8.99709 9.23796 9.43293 9.55079C9.86878 9.86362 10.4066 10.1135 11.0463 10.3004C11.6665 10.4816 12.3431 10.7148 13.076 11H13.076Z`},child:[]}]})(e)}function am(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 4H3V6H21V4ZM21 11H8V13H21V11ZM21 18H8V20H21V18ZM5 11H3V20H5V11Z`},child:[]}]})(e)}function om(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21 20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20C20.5523 3 21 3.44772 21 4V20ZM19 11V5H13.001V7H15L12 10L9 7H11V5H5V11H7V13H5V19H11V17H9L12 14L15 17H13.001V19H19V13H17V11H19ZM11 13H9V11H11V13ZM15 13H13V11H15V13Z`},child:[]}]})(e)}function sm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z`},child:[]}]})(e)}function cm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 4H21V6H8V4ZM4.5 6.5C3.67157 6.5 3 5.82843 3 5C3 4.17157 3.67157 3.5 4.5 3.5C5.32843 3.5 6 4.17157 6 5C6 5.82843 5.32843 6.5 4.5 6.5ZM4.5 13.5C3.67157 13.5 3 12.8284 3 12C3 11.1716 3.67157 10.5 4.5 10.5C5.32843 10.5 6 11.1716 6 12C6 12.8284 5.32843 13.5 4.5 13.5ZM4.5 20.4C3.67157 20.4 3 19.7284 3 18.9C3 18.0716 3.67157 17.4 4.5 17.4C5.32843 17.4 6 18.0716 6 18.9C6 19.7284 5.32843 20.4 4.5 20.4ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z`},child:[]}]})(e)}function lm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 4H21V6H8V4ZM5 3V6H6V7H3V6H4V4H3V3H5ZM3 14V11.5H5V11H3V10H6V12.5H4V13H6V14H3ZM5 19.5H3V18.5H5V18H3V17H6V21H3V20H5V19.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z`},child:[]}]})(e)}function um(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8.00008 6V9H5.00008V6H8.00008ZM3.00008 4V11H10.0001V4H3.00008ZM13.0001 4H21.0001V6H13.0001V4ZM13.0001 11H21.0001V13H13.0001V11ZM13.0001 18H21.0001V20H13.0001V18ZM10.7072 16.2071L9.29297 14.7929L6.00008 18.0858L4.20718 16.2929L2.79297 17.7071L6.00008 20.9142L10.7072 16.2071Z`},child:[]}]})(e)}function dm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M18.3638 15.5355L16.9496 14.1213L18.3638 12.7071C20.3164 10.7545 20.3164 7.58866 18.3638 5.63604C16.4112 3.68341 13.2453 3.68341 11.2927 5.63604L9.87849 7.05025L8.46428 5.63604L9.87849 4.22182C12.6122 1.48815 17.0443 1.48815 19.778 4.22182C22.5117 6.95549 22.5117 11.3876 19.778 14.1213L18.3638 15.5355ZM15.5353 18.364L14.1211 19.7782C11.3875 22.5118 6.95531 22.5118 4.22164 19.7782C1.48797 17.0445 1.48797 12.6123 4.22164 9.87868L5.63585 8.46446L7.05007 9.87868L5.63585 11.2929C3.68323 13.2455 3.68323 16.4113 5.63585 18.364C7.58847 20.3166 10.7543 20.3166 12.7069 18.364L14.1211 16.9497L15.5353 18.364ZM14.8282 7.75736L16.2425 9.17157L9.17139 16.2426L7.75717 14.8284L14.8282 7.75736Z`},child:[]}]})(e)}function fm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M17 17H22V19H19V22H17V17ZM7 7H2V5H5V2H7V7ZM18.364 15.5355L16.9497 14.1213L18.364 12.7071C20.3166 10.7545 20.3166 7.58866 18.364 5.63604C16.4113 3.68342 13.2455 3.68342 11.2929 5.63604L9.87868 7.05025L8.46447 5.63604L9.87868 4.22183C12.6123 1.48816 17.0445 1.48816 19.7782 4.22183C22.5118 6.9555 22.5118 11.3877 19.7782 14.1213L18.364 15.5355ZM15.5355 18.364L14.1213 19.7782C11.3877 22.5118 6.9555 22.5118 4.22183 19.7782C1.48816 17.0445 1.48816 12.6123 4.22183 9.87868L5.63604 8.46447L7.05025 9.87868L5.63604 11.2929C3.68342 13.2455 3.68342 16.4113 5.63604 18.364C7.58866 20.3166 10.7545 20.3166 12.7071 18.364L14.1213 16.9497L15.5355 18.364ZM14.8284 7.75736L16.2426 9.17157L9.17157 16.2426L7.75736 14.8284L14.8284 7.75736Z`},child:[]}]})(e)}function pm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M15 20H7V18H9.92661L12.0425 6H9V4H17V6H14.0734L11.9575 18H15V20Z`},child:[]}]})(e)}function mm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 5H11V19H8V21H16V19H13V5H16V3H8V5ZM2 7C1.44772 7 1 7.44772 1 8V16C1 16.5523 1.44772 17 2 17H8V15H3V9H8V7H2ZM16 9H21V15H16V17H22C22.5523 17 23 16.5523 23 16V8C23 7.44772 22.5523 7 22 7H16V9Z`},child:[]}]})(e)}function hm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM7 12.5L3 16V9L7 12.5Z`},child:[]}]})(e)}function gm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM3 12.5L7 9V16L3 12.5Z`},child:[]}]})(e)}function _m(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M21.097 8L18.499 12.5C20.7091 12.5 22.5 14.2909 22.5 16.5C22.5 18.7091 20.7091 20.5 18.5 20.5C16.2909 20.5 14.5 18.7091 14.5 16.5C14.5 15.7636 14.699 15.0737 15.0461 14.4811L18.788 8H21.097ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 14.5C17.3954 14.5 16.5 15.3954 16.5 16.5C16.5 17.6046 17.3954 18.5 18.5 18.5C19.6046 18.5 20.5 17.6046 20.5 16.5C20.5 15.3954 19.6046 14.5 18.5 14.5Z`},child:[]}]})(e)}function vm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 8V10H17.6769L17.2126 12.6358C17.5435 12.5472 17.8912 12.5 18.25 12.5C20.4591 12.5 22.25 14.2909 22.25 16.5C22.25 18.7091 20.4591 20.5 18.25 20.5C16.4233 20.5 14.8827 19.2756 14.4039 17.6027L16.3271 17.0519C16.5667 17.8881 17.3369 18.5 18.25 18.5C19.3546 18.5 20.25 17.6046 20.25 16.5C20.25 15.3954 19.3546 14.5 18.25 14.5C17.6194 14.5 17.057 14.7918 16.6904 15.2478L14.8803 14.3439L16 8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z`},child:[]}]})(e)}function ym(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM22 8V16H23.5V18H22V20H20V18H14.5V16.66L19.5 8H22ZM20 11.133L17.19 16H20V11.133Z`},child:[]}]})(e)}function bm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M22 8L21.9984 10L19.4934 12.883C21.0823 13.3184 22.25 14.7728 22.25 16.5C22.25 18.5711 20.5711 20.25 18.5 20.25C16.674 20.25 15.1528 18.9449 14.8184 17.2166L16.7821 16.8352C16.9384 17.6413 17.6481 18.25 18.5 18.25C19.4665 18.25 20.25 17.4665 20.25 16.5C20.25 15.5335 19.4665 14.75 18.5 14.75C18.214 14.75 17.944 14.8186 17.7056 14.9403L16.3992 13.3932L19.3484 10H15V8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z`},child:[]}]})(e)}function xm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 8C20.5711 8 22.25 9.67893 22.25 11.75C22.25 12.6074 21.9623 13.3976 21.4781 14.0292L21.3302 14.2102L18.0343 18H22V20H15L14.9993 18.444L19.8207 12.8981C20.0881 12.5908 20.25 12.1893 20.25 11.75C20.25 10.7835 19.4665 10 18.5 10C17.5818 10 16.8288 10.7071 16.7558 11.6065L16.75 11.75H14.75C14.75 9.67893 16.4289 8 18.5 8Z`},child:[]}]})(e)}function Sm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM21.0005 8V20H19.0005L19 10.204L17 10.74V8.67L19.5005 8H21.0005Z`},child:[]}]})(e)}function Cm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M5.55397 22H3.3999L10.9999 3H12.9999L20.5999 22H18.4458L16.0458 16H7.95397L5.55397 22ZM8.75397 14H15.2458L11.9999 5.88517L8.75397 14Z`},child:[]}]})(e)}function wm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3.41436 5.99995L5.70726 3.70706L4.29304 2.29285L0.585938 5.99995L4.29304 9.70706L5.70726 8.29285L3.41436 5.99995ZM9.58594 5.99995L7.29304 3.70706L8.70726 2.29285L12.4144 5.99995L8.70726 9.70706L7.29304 8.29285L9.58594 5.99995ZM14.0002 2.99995H21.0002C21.5524 2.99995 22.0002 3.44767 22.0002 3.99995V20C22.0002 20.5522 21.5524 21 21.0002 21H3.00015C2.44787 21 2.00015 20.5522 2.00015 20V12H4.00015V19H20.0002V4.99995H14.0002V2.99995Z`},child:[]}]})(e)}function Tm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 11H12.5C13.8807 11 15 9.88071 15 8.5C15 7.11929 13.8807 6 12.5 6H8V11ZM18 15.5C18 17.9853 15.9853 20 13.5 20H6V4H12.5C14.9853 4 17 6.01472 17 8.5C17 9.70431 16.5269 10.7981 15.7564 11.6058C17.0979 12.3847 18 13.837 18 15.5ZM8 13V18H13.5C14.8807 18 16 16.8807 16 15.5C16 14.1193 14.8807 13 13.5 13H8Z`},child:[]}]})(e)}function Em(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM7 19H21V21H7V19ZM3 14H21V16H3V14ZM7 9H21V11H7V9Z`},child:[]}]})(e)}function Dm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H17V21H3V19ZM3 14H21V16H3V14ZM3 9H17V11H3V9Z`},child:[]}]})(e)}function Om(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z`},child:[]}]})(e)}function km(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 4H21V6H3V4ZM5 19H19V21H5V19ZM3 14H21V16H3V14ZM5 9H19V11H5V9Z`},child:[]}]})(e)}function Am(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M23 12L15.9289 19.0711L14.5147 17.6569L20.1716 12L14.5147 6.34317L15.9289 4.92896L23 12ZM3.82843 12L9.48528 17.6569L8.07107 19.0711L1 12L8.07107 4.92896L9.48528 6.34317L3.82843 12Z`},child:[]}]})(e)}function jm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z`},child:[]}]})(e)}function Mm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M7.29117 20.8242L2 22L3.17581 16.7088C2.42544 15.3056 2 13.7025 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C10.2975 22 8.6944 21.5746 7.29117 20.8242ZM7.58075 18.711L8.23428 19.0605C9.38248 19.6745 10.6655 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 13.3345 4.32549 14.6175 4.93949 15.7657L5.28896 16.4192L4.63416 19.3658L7.58075 18.711Z`},child:[]}]})(e)}function Nm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M7.24264 17.9967H3V13.754L14.435 2.319C14.8256 1.92848 15.4587 1.92848 15.8492 2.319L18.6777 5.14743C19.0682 5.53795 19.0682 6.17112 18.6777 6.56164L7.24264 17.9967ZM3 19.9967H21V21.9967H3V19.9967Z`},child:[]}]})(e)}function Pm(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M8 7V11L2 6L8 1V5H13C17.4183 5 21 8.58172 21 13C21 17.4183 17.4183 21 13 21H4V19H13C16.3137 19 19 16.3137 19 13C19 9.68629 16.3137 7 13 7H8Z`},child:[]}]})(e)}var Fm=`input:not([inert]):not([inert] *),select:not([inert]):not([inert] *),textarea:not([inert]):not([inert] *),a[href]:not([inert]):not([inert] *),area[href]:not([inert]):not([inert] *),button:not([inert]):not([inert] *),[tabindex]:not(slot):not([inert]):not([inert] *),audio[controls]:not([inert]):not([inert] *),video[controls]:not([inert]):not([inert] *),[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *),details>summary:first-of-type:not([inert]):not([inert] *),details:not([inert]):not([inert] *)`,Im=typeof Element>`u`,Lm=Im?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Rm=!Im&&Element.prototype.getRootNode?function(e){return e==null||e.getRootNode==null?void 0:e.getRootNode()}:function(e){return e?.ownerDocument},zm=function(e,t){t===void 0&&(t=!0);var n=e==null||e.getAttribute==null?void 0:e.getAttribute(`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):zm(e.parentNode))},Bm=function(e){var t,n=e==null||e.getAttribute==null||(t=e.getAttribute(`contenteditable`))==null?void 0:t.toLowerCase();return n===``||n===`true`||n===`plaintext-only`},Vm=function(e,t,n){if(zm(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Fm));return t&&Lm.call(e,Fm)&&r.unshift(e),r=r.filter(n),r},Hm=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!zm(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Hm(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{Lm.call(a,Fm)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!zm(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Hm(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}}return r},Um=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Wm=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Bm(e))&&!Um(e)?0:e.tabIndex},Gm=function(e,t){var n=Wm(e);return n<0&&t&&!Um(e)?0:n},Km=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},qm=function(e){return e.tagName===`INPUT`},Jm=function(e){return qm(e)&&e.type===`hidden`},Ym=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Xm=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Zm=function(e){if(!e.name)return!0;var t=e.form||Rm(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Xm(r,e.form);return!i||i===e},Qm=function(e){return qm(e)&&e.type===`radio`},$m=function(e){return Qm(e)&&!Zm(e)},eh=function(e){var t=e&&Rm(e),n=t?.host,r=!1;if(t&&t!==e){var i,a;for(r=!!((i=n)!=null&&(i=i.ownerDocument)!=null&&i.contains(n)||e!=null&&(a=e.ownerDocument)!=null&&a.contains(e));!r&&n;){var o;t=Rm(n),n=t?.host,r=!!((o=n)!=null&&(o=o.ownerDocument)!=null&&o.contains(n))}}return r},th=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},nh=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=Lm.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Lm.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=Rm(e);if(s&&!s.shadowRoot&&r(s)===!0)return th(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(eh(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return th(e);return!1},rh=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Lm.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},ih=function(e,t){return!(t.disabled||Jm(t)||nh(t,e)||Ym(t)||rh(t))},ah=function(e,t){return!($m(t)||Wm(t)<0||!ih(e,t))},oh=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},sh=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Gm(a,i),s=i?sh(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Km).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ch=function(e,t){return t||={},sh(t.getShadowRoot?Hm([e],t.includeContainer,{filter:ah.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:oh}):Vm(e,t.includeContainer,ah.bind(null,t)))},lh=function(e,t){return t||={},t.getShadowRoot?Hm([e],t.includeContainer,{filter:ih.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Vm(e,t.includeContainer,ih.bind(null,t))},uh=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Lm.call(e,Fm)!==!1&&ah(t,e)};function dh(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function fh(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function ph(){return/apple/i.test(navigator.vendor)}function mh(){let e=/android/i;return e.test(dh())||e.test(fh())}function hh(){return fh().includes(`jsdom/`)}var gh=`data-floating-ui-focusable`,_h=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function vh(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function yh(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function bh(e){return`composedPath`in e?e.composedPath()[0]:e.target}function xh(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Sh(e){return e.matches(`html,body`)}function Ch(e){return e?.ownerDocument||document}function wh(e){return d(e)&&e.matches(_h)}function Th(e){return e?e.getAttribute(`role`)===`combobox`&&wh(e):!1}function Eh(e){return e?e.hasAttribute(gh)?e:e.querySelector(`[`+gh+`]`)||e:null}function Dh(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Dh(e,t.id,n)])}function Oh(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function kh(e){e.preventDefault(),e.stopPropagation()}function Ah(e){return`nativeEvent`in e}function jh(e){return e.mozInputSource===0&&e.isTrusted?!0:mh()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Mh(e){return hh()?!1:!mh()&&e.width===0&&e.height===0||mh()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Nh(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Ph=typeof document<`u`?W.useLayoutEffect:function(){},Fh={...W};function Ih(e){let t=W.useRef(e);return Ph(()=>{t.current=e}),t}var Lh=Fh.useInsertionEffect||(e=>e());function Rh(e){let t=W.useRef(()=>{});return Lh(()=>{t.current=e}),W.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var zh=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Bh(e,t){let n=ch(e,zh()),r=n.length;if(r===0)return;let i=vh(Ch(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Vh(e){return Bh(Ch(e).body,1)||e}function Hh(e){return Bh(Ch(e).body,-1)||e}function Uh(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!yh(n,r)}function Wh(e){ch(e,zh()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Gh(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Kh(e){let t=W.useRef(void 0),n=W.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return W.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var qh=`data-floating-ui-focusable`,Jh=`active`,Yh=`selected`,Xh=`ArrowLeft`,Zh=`ArrowRight`,Qh=`ArrowUp`,$h=`ArrowDown`,eg=[Xh,Zh],tg=[Qh,$h];[...eg,...tg];var ng={...W},rg=!1,ig=0,ag=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+ig++;function og(){let[e,t]=W.useState(()=>rg?ag():void 0);return Ph(()=>{e??t(ag())},[]),W.useEffect(()=>{rg=!0},[]),e}var sg=ng.useId||og;function cg(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var lg=W.createContext(null),ug=W.createContext(null),dg=()=>W.useContext(lg)?.id||null,fg=()=>W.useContext(ug);function pg(e){return`data-floating-ui-`+e}function mg(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var hg=pg(`safe-polygon`);function gg(e,t,n){if(n&&!Nh(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function _g(e){return typeof e==`function`?e():e}function vg(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=fg(),m=dg(),h=Ih(l),g=Ih(c),_=Ih(n),v=Ih(d),y=W.useRef(),b=W.useRef(-1),x=W.useRef(),C=W.useRef(-1),w=W.useRef(!0),T=W.useRef(!1),E=W.useRef(()=>{}),D=W.useRef(!1),O=Rh(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});W.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||(mg(b),mg(C),w.current=!0,D.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),W.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){O()&&r(!1,e,`hover`)}let t=Ch(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,O]);let k=W.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=gg(g.current,`close`,y.current);i&&!x.current?(mg(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(mg(b),r(!1,e,n))},[g,r]),A=Rh(()=>{E.current(),x.current=void 0}),j=Rh(()=>{if(T.current){let e=Ch(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(hg),T.current=!1}}),M=Rh(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);W.useEffect(()=>{if(!s)return;function e(e){if(mg(b),w.current=!1,u&&!Nh(y.current)||_g(v.current)>0&&!gg(g.current,`open`))return;let t=gg(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(M()){j();return}E.current();let t=Ch(o.floating);if(mg(C),D.current=!1,h.current&&i.current.floatingContext){n||mg(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),E.current=()=>{t.removeEventListener(`mousemove`,r)}}else y.current===`touch`&&yh(o.floating,e.relatedTarget)||k(e)}function a(e){M()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e)}})(e))}function c(){mg(b)}function l(e){M()||k(e,!1)}if(S(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,k,A,j,r,n,_,p,g,h,i,M,v]),Ph(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&O()){T.current=!0;let e=o.floating;if(S(o.domReference)&&e){var t;let n=Ch(o.floating).body;n.setAttribute(hg,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,O]),Ph(()=>{n||(y.current=void 0,D.current=!1,A(),j())},[n,A,j]),W.useEffect(()=>()=>{A(),mg(b),mg(C),j()},[s,o.domReference,A,j]);let N=W.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!w.current&&!_.current&&r(!0,t,`hover`)}u&&!Nh(y.current)||n||_g(v.current)===0||D.current&&e.movementX**2+e.movementY**2<2||(mg(C),y.current===`touch`?i():(D.current=!0,C.current=window.setTimeout(i,_g(v.current))))}}},[u,r,n,_,v]);return W.useMemo(()=>s?{reference:N}:{},[s,N])}var yg=0;function bg(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(yg);let a=()=>e?.focus({preventScroll:n});i?a():yg=requestAnimationFrame(a)}function xg(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Sg(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Cg(e){return e?.ownerDocument||document}var wg={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Tg(e){return e===`inert`?wg.inert:e===`aria-hidden`?wg[`aria-hidden`]:wg.none}var Eg=new WeakSet,Dg={},Og=0,kg=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function Ag(e){return e?f(e)?e.host:Ag(e.parentNode):null}var jg=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ag(t);return e.contains(n)?n:null}).filter(e=>e!=null);function Mg(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=jg(t,e),s=new Set,c=new Set(o),l=[];Dg[i]||(Dg[i]=new WeakMap);let u=Dg[i];o.forEach(d),f(t),s.clear();function d(e){e&&!s.has(e)&&(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){e&&!c.has(e)&&[].forEach.call(e.children,e=>{if(re(e)!==`script`){if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=Tg(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&Eg.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}}})}return Og++,()=>{l.forEach(e=>{let t=Tg(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!Eg.has(e)&&a&&e.removeAttribute(a),Eg.delete(e)),r||e.removeAttribute(i)}),Og--,Og||(wg.inert=new WeakMap,wg[`aria-hidden`]=new WeakMap,wg.none=new WeakMap,Eg=new WeakSet,Dg={})}}function Ng(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=Cg(e[0]).body;return Mg(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}var Pg={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},Fg=W.forwardRef(function(e,t){let[n,r]=W.useState();Ph(()=>{ph()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[pg(`focus-guard`)]:``,style:Pg};return(0,G.jsx)(`span`,{...e,...i})}),Ig={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Lg=W.createContext(null),Rg=pg(`portal`);function zg(e){e===void 0&&(e={});let{id:t,root:n}=e,r=sg(),i=Vg(),[a,o]=W.useState(null),s=W.useRef(null);return Ph(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),Ph(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(Rg,``),e.appendChild(n),s.current=n,o(n)},[t,r]),Ph(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!w(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(Rg,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function Bg(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=zg({id:n,root:r}),[o,s]=W.useState(null),c=W.useRef(null),l=W.useRef(null),u=W.useRef(null),d=W.useRef(null),f=o?.modal,p=o?.open,m=!!o&&!o.modal&&o.open&&i&&!!(r||a);return W.useEffect(()=>{if(!a||!i||f)return;function e(e){a&&Uh(e)&&(e.type===`focusin`?Gh:Wh)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,f]),W.useEffect(()=>{a&&(p||Gh(a))},[p,a]),(0,G.jsxs)(Lg.Provider,{value:W.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[m&&a&&(0,G.jsx)(Fg,{"data-type":`outside`,ref:c,onFocus:e=>{if(Uh(e,a)){var t;(t=u.current)==null||t.focus()}else Hh(o?o.domReference:null)?.focus()}}),m&&a&&(0,G.jsx)(`span`,{"aria-owns":a.id,style:Ig}),a&&Zf.createPortal(t,a),m&&a&&(0,G.jsx)(Fg,{"data-type":`outside`,ref:l,onFocus:e=>{if(Uh(e,a)){var t;(t=d.current)==null||t.focus()}else Vh(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var Vg=()=>W.useContext(Lg);function Hg(e){return W.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}var Ug=20,Wg=[];function Gg(){Wg=Wg.filter(e=>e.deref()?.isConnected)}function Kg(e){Gg(),e&&re(e)!==`body`&&(Wg.push(new WeakRef(e)),Wg.length>Ug&&(Wg=Wg.slice(-20)))}function qg(){return Gg(),Wg[Wg.length-1]?.deref()}function Jg(e){let t=zh();return uh(e,t)?e:ch(e,t)[0]||e}function Yg(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=zh(),i=lh(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return uh(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}var Xg=W.forwardRef(function(e,t){return(0,G.jsx)(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:Pg})});function Zg(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0,outsideElementsInert:p=!1,getInsideElements:m=()=>[]}=e,{open:h,onOpenChange:g,events:_,dataRef:v,elements:{domReference:y,floating:b}}=t,x=Rh(()=>v.current.floatingContext?.nodeId),S=Rh(m),C=typeof o==`number`&&o<0,w=Th(y)&&C,T=kg(),E=!T||a,D=!E||T&&p,O=Ih(i),k=Ih(o),A=Ih(s),j=fg(),M=Vg(),N=W.useRef(null),P=W.useRef(null),F=W.useRef(!1),I=W.useRef(!1),L=W.useRef(-1),R=W.useRef(-1),z=M!=null,B=Eh(b),ee=Rh(function(e){return e===void 0&&(e=B),e?ch(e,zh()):[]}),te=Rh(e=>{let t=ee(e);return O.current.map(e=>y&&e===`reference`?y:B&&e===`floating`?B:t).filter(Boolean).flat()});W.useEffect(()=>{if(r||!l)return;function e(e){if(e.key===`Tab`){yh(B,vh(Ch(B)))&&ee().length===0&&!w&&kh(e);let t=te(),n=bh(e);O.current[0]===`reference`&&n===y&&(kh(e),e.shiftKey?bg(t[t.length-1]):bg(t[1])),O.current[1]===`floating`&&n===B&&e.shiftKey&&(kh(e),bg(t[0]))}}let t=Ch(B);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,y,B,l,O,w,ee,te]),W.useEffect(()=>{if(r||!b)return;function e(e){let t=bh(e),n=ee().indexOf(t);n!==-1&&(L.current=n)}return b.addEventListener(`focusin`,e),()=>{b.removeEventListener(`focusin`,e)}},[r,b,ee]),W.useEffect(()=>{if(r||!f)return;function e(){I.current=!0,setTimeout(()=>{I.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=bh(e);queueMicrotask(()=>{let i=x(),a=!(yh(y,t)||yh(b,t)||yh(t,b)||yh(M?.portalNode,t)||t!=null&&t.hasAttribute(pg(`focus-guard`))||j&&(Dh(j.nodesRef.current,i).find(e=>yh(e.context?.elements.floating,t)||yh(e.context?.elements.domReference,t))||Oh(j.nodesRef.current,i).find(e=>[e.context?.elements.floating,Eh(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===y&&B&&Yg(B,O),c&&n!==y&&!(r!=null&&r.isConnected)&&vh(Ch(B))===Ch(B).body){d(B)&&B.focus();let e=L.current,t=ee(),n=t[e]||t[t.length-1]||B;d(n)&&n.focus()}v.current.insideReactTree?v.current.insideReactTree=!1:(w||!l)&&t&&a&&!I.current&&t!==qg()&&(F.current=!0,g(!1,e,`focus-out`))})}let n=!(j||!M);function i(){mg(R),v.current.insideReactTree=!0,R.current=window.setTimeout(()=>{v.current.insideReactTree=!1})}if(b&&d(y))return y.addEventListener(`focusout`,t),y.addEventListener(`pointerdown`,e),b.addEventListener(`focusout`,t),n&&b.addEventListener(`focusout`,i,!0),()=>{y.removeEventListener(`focusout`,t),y.removeEventListener(`pointerdown`,e),b.removeEventListener(`focusout`,t),n&&b.removeEventListener(`focusout`,i,!0)}},[r,y,b,B,l,j,M,g,f,c,ee,w,x,O,v]);let ne=W.useRef(null),re=W.useRef(null),ie=Hg([ne,M?.beforeInsideRef]),ae=Hg([re,M?.afterInsideRef]);W.useEffect(()=>{var e,t;if(r||!b)return;let n=Array.from((M==null||(e=M.portalNode)==null?void 0:e.querySelectorAll(`[`+pg(`portal`)+`]`))||[]),i=(t=(j?Oh(j.nodesRef.current,x()):[]).find(e=>Th(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,a=[b,i,...n,...S(),N.current,P.current,ne.current,re.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,O.current.includes(`reference`)||w?y:null].filter(e=>e!=null),o=l||w?Ng(a,!D,D):Ng(a);return()=>{o()}},[r,y,b,l,O,M,w,E,D,j,x,S]),Ph(()=>{if(r||!d(B))return;let e=vh(Ch(B));queueMicrotask(()=>{let t=te(B),n=k.current,r=(typeof n==`number`?t[n]:n.current)||B,i=yh(B,e);!C&&!i&&h&&bg(r,{preventScroll:r===B})})},[r,h,B,C,te,k]),Ph(()=>{if(r||!B)return;let e=Ch(B);Kg(vh(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(F.current=!0),t===`outside-press`){if(r)F.current=!1;else if(jh(n)||Mh(n))F.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?F.current=!1:F.current=!0}}}_.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,Pg),z&&y&&y.insertAdjacentElement(`afterend`,n);function i(){if(typeof A.current==`boolean`){let e=y||qg();return e&&e.isConnected?e:n}return A.current.current||n}return()=>{_.off(`openchange`,t);let r=vh(e),a=yh(b,r)||j&&Dh(j.nodesRef.current,x(),!1).some(e=>yh(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Jg(o);A.current&&!F.current&&d(t)&&(t===r||r===e.body||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,b,B,A,v,_,j,z,y,x]),W.useEffect(()=>(queueMicrotask(()=>{F.current=!1}),()=>{queueMicrotask(Gg)}),[r]),Ph(()=>{if(!r&&M)return M.setFocusManagerState({modal:l,closeOnFocusOut:f,open:h,onOpenChange:g,domReference:y}),()=>{M.setFocusManagerState(null)}},[r,M,l,h,g,f,y]),Ph(()=>{r||B&&Yg(B,O)},[r,B,O]);function V(e){return r||!u||!l?null:(0,G.jsx)(Xg,{ref:e===`start`?N:P,onClick:e=>g(!1,e.nativeEvent),children:typeof u==`string`?u:`Dismiss`})}let oe=!r&&E&&(!l||!w)&&(z||l);return(0,G.jsxs)(G.Fragment,{children:[oe&&(0,G.jsx)(Fg,{"data-type":`inside`,ref:ie,onFocus:e=>{if(l){let e=te();bg(i[0]===`reference`?e[0]:e[e.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode){if(F.current=!1,Uh(e,M.portalNode))Vh(y)?.focus();else{var t;(t=M.beforeOutsideRef.current)==null||t.focus()}}}}),!w&&V(`start`),n,V(`end`),oe&&(0,G.jsx)(Fg,{"data-type":`inside`,ref:ae,onFocus:e=>{if(l)bg(te()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode){if(f&&(F.current=!0),Uh(e,M.portalNode))Hh(y)?.focus();else{var t;(t=M.afterOutsideRef.current)==null||t.focus()}}}})]})}var Qg={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},$g={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},e_=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function t_(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:f=`pointerdown`,ancestorScroll:p=!1,bubbles:m,capture:h}=t,g=fg(),_=Rh(typeof c==`function`?c:()=>!1),v=typeof c==`function`?_:c,y=W.useRef(!1),{escapeKey:x,outsidePress:C}=e_(m),{escapeKey:w,outsidePress:T}=e_(h),O=W.useRef(!1),k=Rh(e=>{if(!n||!o||!s||e.key!==`Escape`||O.current)return;let t=a.current.floatingContext?.nodeId,i=g?Dh(g.nodesRef.current,t):[];if(!x&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;(n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}r(!1,Ah(e)?e.nativeEvent:e,`escape-key`)}),A=Rh(e=>{var t;let n=()=>{var t;k(e),(t=bh(e))==null||t.removeEventListener(`keydown`,n)};(t=bh(e))==null||t.addEventListener(`keydown`,n)}),j=Rh(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=y.current;if(y.current=!1,l===`click`&&n||t||typeof v==`function`&&!v(e))return;let o=bh(e),s=`[`+pg(`inert`)+`]`,c=Ch(i.floating).querySelectorAll(s),u=S(o)?o:null;for(;u&&!ae(u);){let e=D(u);if(ae(e)||!S(e))break;u=e}if(c.length&&S(o)&&!Sh(o)&&!yh(o,i.floating)&&Array.from(c).every(e=>!yh(u,e)))return;if(d(o)&&P){let t=ae(o),n=E(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let f=a.current.floatingContext?.nodeId,p=g&&Dh(g.nodesRef.current,f).some(t=>xh(e,t.context?.elements.floating));if(xh(e,i.floating)||xh(e,i.domReference)||p)return;let m=g?Dh(g.nodesRef.current,f):[];if(m.length>0){let e=!0;if(m.forEach(t=>{var n;(n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}r(!1,e,`outside-press`)}),M=Rh(e=>{var t;let n=()=>{var t;j(e),(t=bh(e))==null||t.removeEventListener(l,n)};(t=bh(e))==null||t.addEventListener(l,n)});W.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=x,a.current.__outsidePressBubbles=C;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),O.current=!0}function u(){e=window.setTimeout(()=>{O.current=!1},b()?5:0)}let d=Ch(i.floating);s&&(d.addEventListener(`keydown`,w?A:k,w),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),v&&d.addEventListener(l,T?M:j,T);let f=[];return p&&(S(i.domReference)&&(f=se(i.domReference)),S(i.floating)&&(f=f.concat(se(i.floating))),!S(i.reference)&&i.reference&&i.reference.contextElement&&(f=f.concat(se(i.reference.contextElement)))),f=f.filter(e=>e!==d.defaultView?.visualViewport),f.forEach(e=>{e.addEventListener(`scroll`,t)}),()=>{s&&(d.removeEventListener(`keydown`,w?A:k,w),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),v&&d.removeEventListener(l,T?M:j,T),f.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,v,l,n,r,p,o,x,C,k,w,A,j,T,M]),W.useEffect(()=>{a.current.insideReactTree=!1},[a,v,l]);let N=W.useMemo(()=>({onKeyDown:k,...u&&{[Qg[f]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...f!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[k,r,u,f]),P=W.useMemo(()=>{function e(e){e.button===0&&(y.current=!0)}return{onKeyDown:k,onMouseDown:e,onMouseUp:e,[$g[l]]:()=>{a.current.insideReactTree=!0}}},[k,l,a]);return W.useMemo(()=>o?{reference:N,floating:P}:{},[o,N,P])}function n_(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=sg(),a=W.useRef({}),[o]=W.useState(()=>cg()),s=dg()!=null,[c,l]=W.useState(r.reference),u=Rh((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=W.useMemo(()=>({setPositionReference:l}),[]),f=W.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return W.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function r_(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=n_({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=W.useState(null),[l,u]=W.useState(null),d=o?.domReference||s,f=W.useRef(null),p=fg();Ph(()=>{d&&(f.current=d)},[d]);let m=z({...n,elements:{...o,...l&&{reference:l}}}),h=W.useCallback(e=>{let t=S(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=W.useCallback(e=>{(S(e)||e===null)&&(f.current=e,c(e)),(S(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!S(e))&&m.refs.setReference(e)},[m.refs]),_=W.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=W.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=W.useMemo(()=>({...m,...a,refs:_,elements:v,nodeId:r}),[m,_,v,r,a]);return Ph(()=>{a.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=y)}),W.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}function i_(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[Jh]:t,[Yh]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[qh]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[Jh,Yh].includes(n))){if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}}),e),{})}}function a_(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=W.useCallback(t=>i_(t,e,`reference`),t),a=W.useCallback(t=>i_(t,e,`floating`),n),o=W.useCallback(t=>i_(t,e,`item`),r);return W.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var o_=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase());function s_(e,t){return typeof e==`function`?e(t):e}function c_(e,t){let[n,r]=W.useState(e);return e&&!n&&r(!0),W.useEffect(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}function l_(e,t){t===void 0&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i==`number`?i:i.close)||0,[o,s]=W.useState(`unmounted`),c=c_(n,a);return!c&&o===`close`&&s(`unmounted`),Ph(()=>{if(r){if(n){s(`initial`);let e=requestAnimationFrame(()=>{Zf.flushSync(()=>{s(`open`)})});return()=>{cancelAnimationFrame(e)}}s(`close`)}},[n,r]),{isMounted:c,status:o}}function u_(e,t){t===void 0&&(t={});let{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,c=s.split(`-`)[0],l=W.useMemo(()=>({side:c,placement:s}),[c,s]),u=typeof o==`number`,d=(u?o:o.open)||0,f=(u?o:o.close)||0,[p,m]=W.useState(()=>({...s_(a,l),...s_(n,l)})),{isMounted:h,status:g}=l_(e,{duration:o}),_=Ih(n),v=Ih(r),y=Ih(i),b=Ih(a);return Ph(()=>{let e=s_(_.current,l),t=s_(y.current,l),n=s_(b.current,l),r=s_(v.current,l)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(g===`initial`&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),g===`open`&&m({transitionProperty:Object.keys(r).map(o_).join(`,`),transitionDuration:d+`ms`,...n,...r}),g===`close`){let r=t||e;m({transitionProperty:Object.keys(r).map(o_).join(`,`),transitionDuration:f+`ms`,...n,...r})}},[f,y,_,v,b,d,g,l]),{isMounted:h,styles:p}}function d_(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...d_(e,t.id,n)])}function f_(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function p_(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function m_(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){mg(i),u()}if(mg(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=Sg(e),v=e.type===`mouseleave`,y=xg(c.floating,_),b=xg(c.domReference,_),x=c.domReference.getBoundingClientRect(),C=c.floating.getBoundingClientRect(),w=s.split(`-`)[0],T=n>C.right-C.width/2,E=o>C.bottom-C.height/2,D=p_(g,x),O=C.width>x.width,k=C.height>x.height,A=(O?x:C).left,j=(O?x:C).right,M=(k?x:C).top,N=(k?x:C).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&S(e.relatedTarget)&&xg(c.floating,e.relatedTarget)||f&&d_(f.nodesRef.current,d).length)return;if(w===`top`&&o>=x.bottom-1||w===`bottom`&&o<=x.top+1||w===`left`&&n>=x.right-1||w===`right`&&n<=x.left+1)return p();let P=[];switch(w){case`top`:P=[[A,x.top+1],[A,C.bottom-1],[j,C.bottom-1],[j,x.top+1]];break;case`bottom`:P=[[A,C.top+1],[A,x.bottom-1],[j,x.bottom-1],[j,C.top+1]];break;case`left`:P=[[C.right-1,N],[C.right-1,M],[x.left+1,M],[x.left+1,N]];break;case`right`:P=[[x.right-1,N],[x.right-1,M],[C.left+1,M],[C.left+1,N]]}function F(e){let[n,r]=e;switch(w){case`top`:return[[O?n+t/2:T?n+t*4:n-t*4,r+t+1],[O?n-t/2:T?n+t*4:n-t*4,r+t+1],[C.left,T||O?C.bottom-t:C.top],[C.right,T?O?C.bottom-t:C.top:C.bottom-t]];case`bottom`:return[[O?n+t/2:T?n+t*4:n-t*4,r-t],[O?n-t/2:T?n+t*4:n-t*4,r-t],[C.left,T||O?C.top+t:C.bottom],[C.right,T?O?C.top+t:C.bottom:C.top+t]];case`left`:{let e=[n+t+1,k?r+t/2:E?r+t*4:r-t*4],i=[n+t+1,k?r-t/2:E?r+t*4:r-t*4];return[[E||k?C.right-t:C.left,C.top],[E?k?C.right-t:C.left:C.right-t,C.bottom],e,i]}case`right`:return[[n-t,k?r+t/2:E?r+t*4:r-t*4],[n-t,k?r-t/2:E?r+t*4:r-t*4],[E||k?C.left+t:C.right,C.top],[E?k?C.left+t:C.right:C.left+t,C.bottom]]}}if(!f_([m,h],P)){if(a&&!D)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}f_([m,h],F([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var h_=`annotation`;function g_(e){return e&&lt(e.options.extensions).some(e=>{if(e.type!==`mark`)return!1;let t=pt(e,`group`);return typeof t==`string`&&t.split(` `).includes(`annotation`)})?h_:``}function __(e){return e?lt(e.options.extensions).filter(e=>{if(e.type!==`mark`)return!1;let t=pt(e,`group`);return typeof t!=`string`||!t.split(` `).includes(`annotation`)}).map(e=>e.name).join(` `):`_`}var v_=class{listeners=new Set;state;prevState;options;constructor(e,t){this.prevState=e,this.state=e,this.options=t}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});setState(e){this.prevState=this.state,this.state=y_(e)?e(this.prevState):e,S_(this)}_notify(){let e={prevVal:this.prevState,currentVal:this.state};for(let t of this.listeners)t(e)}};function y_(e){return typeof e==`function`}var b_=!1,x_=new Set;function S_(e){x_.add(e);let t=!b_;b_=!0;try{if(e.options?.onUpdate?.(e.state,e.prevState),!t)return;for(;x_.size>0;){let e=Array.from(x_);x_.clear();for(let t of e)t._notify()}}finally{t&&(b_=!1,x_.clear())}}var C_=Symbol(`originalFactory`);function w_(e){if(typeof e==`object`&&`key`in e)return function t(){return e[C_]=t,e};if(typeof e!=`function`)throw Error(`factory must be a function`);return function t(n){return r=>{let i=e({editor:r.editor,options:n});return i[C_]=t,i}}}function T_(e,t){return new v_(e,t)}crypto.subtle;var E_=crypto.getRandomValues.bind(crypto),D_=()=>E_(new Uint32Array(1))[0],O_=`10000000-1000-4000-8000-100000000000`,k_=typeof crypto<`u`&&crypto.randomUUID!=null?crypto.randomUUID.bind(crypto):()=>O_.replace(/[018]/g,e=>(e^D_()&15>>e/4).toString(16)),A_,j_;if(typeof WeakMap<`u`){let e=new WeakMap;A_=t=>e.get(t),j_=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;A_=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},j_=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var M_=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return A_(e)||j_(e,N_(e))}};function N_(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=P_(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new M_(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&F_(s,o,e),s}function P_(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function F_(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r==null||c.colwidth&&c.colwidth[n]==r||((s||=I_(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function I_(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function L_(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var R_=new hr(`selectingCells`);function z_(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function B_(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function V_(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function H_(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=z_(t.$head)||U_(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function U_(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function W_(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function G_(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function K_(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function q_(e,t,n){let r=e.node(-1),i=M_.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function J_(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function Y_(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function X_(e,t,n){let r=L_(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var Z_=class e extends xr{constructor(e,t=e){let n=e.node(-1),r=M_.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Dr(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(W_(r)&&W_(i)&&K_(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return gr.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=M_.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=J_(e,0,l)),u>0&&(e=J_(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(dr.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new br(dr.from(o),1,1)}replace(e,t=br.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?br.empty:t)}let i=xr.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new br(dr.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=M_.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=M_.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=M_.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=M_.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new Q_(this.$anchorCell.pos,this.$headCell.pos)}};Z_.prototype.visible=!1,xr.jsonID(`cell`,Z_);var Q_=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&K_(t,n)?new Z_(t,n):xr.near(n,1)}};function $_(e){if(!(e.selection instanceof Z_))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(Er.node(n,n+e.nodeSize,{class:`selectedCell`}))}),Cr.create(e.doc,t)}function ev({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function tv({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function nv(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof wr&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=Z_.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=Z_.rowSelection(e,e)}else if(!n){let e=M_.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=Z_.create(i,t+1,n)}}else r instanceof gr&&ev(r)?a=gr.create(i,r.from):r instanceof gr&&tv(r)&&(a=gr.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var rv=new hr(`fix-tables`);function iv(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?iv(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function av(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=ov(e,t,r,n))};return t?t.doc!=e.doc&&iv(t.doc,e.doc,0,r):e.doc.descendants(r),n}function ov(e,t,n,r){let i=M_.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,J_(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=L_(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(rv,{fixTables:!0})}function sv(e){let t=e.selection,n=H_(e),r=n.node(-1),i=n.start(-1),a=M_.get(r);return{...t instanceof Z_?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function cv(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;X_(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,Y_(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?L_(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function lv(e,t){if(!V_(e))return!1;if(t){let n=sv(e);t(cv(e.tr,n,n.left))}return!0}function uv(e,t){if(!V_(e))return!1;if(t){let n=sv(e);t(cv(e.tr,n,n.right))}return!0}function dv(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,J_(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function fv(e,t){if(!V_(e))return!1;if(t){let n=sv(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;dv(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=M_.get(e)}t(r)}return!0}function pv(e,t,n){let r=L_(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function mv(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;pv(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?L_(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,L_(r.type.schema).row.create(null,o)),e}function hv(e,t){if(!V_(e))return!1;if(t){let n=sv(e);t(mv(e.tr,n,n.top))}return!0}function gv(e,t){if(!V_(e))return!1;if(t){let n=sv(e);t(mv(e.tr,n,n.bottom))}return!0}function _v(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function vv(e,t){if(!V_(e))return!1;if(t){let n=sv(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;_v(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=M_.get(n.table)}t(r)}return!0}function yv(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function bv({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function xv(e,t){let n=e.selection;if(!(n instanceof Z_)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=sv(e),{map:i}=r;if(bv(i,r))return!1;if(t){let n=e.tr,a={},o=dr.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!a[l]&&u){if(a[l]=!0,s==null)s=l,c=u;else{yv(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Y_(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=yv(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new Z_(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function Sv(e,t){let n=L_(e.schema);return Cv(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Cv(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof Z_){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=B_(r.$from),!i)return!1;a=z_(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=sv(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)(r!=l.left||t!=l.top)&&u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof Z_&&u.setSelection(new Z_(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function wv(e){return function(t,n){if(!V_(t))return!1;if(n){let r=L_(t.schema),i=sv(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function Tv(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function Ev(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?wv(e):function(t,n){if(!V_(t))return!1;if(n){let r=L_(t.schema),i=sv(t),a=t.tr,o=Tv(`row`,i,r),s=Tv(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}Ev(`row`,{useDeprecatedLogic:!0}),Ev(`column`,{useDeprecatedLogic:!0}),Ev(`cell`,{useDeprecatedLogic:!0});function Dv(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function Ov(e){return function(t,n){if(!V_(t))return!1;let r=Dv(H_(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(gr.between(e,G_(e))).scrollIntoView())}return!0}}function kv(e,t){let n=e.selection;if(!(n instanceof Z_))return!1;if(t){let r=e.tr,i=L_(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new br(i,0,0))}),r.docChanged&&t(r)}return!0}function Av(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=Mv(L_(o).row,new br(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?Mv(L_(o).row,new br(t,n,r)).content:t);else return null;return jv(o,s)}function jv(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(dr.empty),n[i]<r){let a=L_(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(dr.from(o))}return{height:t.length,width:r,rows:t}}function Mv(e,t){let n=e.createAndFill();return new vr(n).replace(0,n.content.size,t).doc}function Nv({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(J_(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(dr.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(dr.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function Pv(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=L_(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,dr.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function Fv(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function Iv(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,J_(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(J_(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function Lv(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=M_.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=M_.get(a),f=d.mapping.maps.length}Pv(d,o,a,n,l,u,f)&&p(),Fv(d,o,a,n,c,l,s,f)&&p(),Fv(d,o,a,n,c,l,u,f)&&p(),Iv(d,o,a,n,s,u,c,f)&&p(),Iv(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new br(i.rows[e-s],0,0))}p(),d.setSelection(new Z_(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Rv=qt({ArrowLeft:Bv(`horiz`,-1),ArrowRight:Bv(`horiz`,1),ArrowUp:Bv(`vert`,-1),ArrowDown:Bv(`vert`,1),"Shift-ArrowLeft":Vv(`horiz`,-1),"Shift-ArrowRight":Vv(`horiz`,1),"Shift-ArrowUp":Vv(`vert`,-1),"Shift-ArrowDown":Vv(`vert`,1),Backspace:kv,"Mod-Backspace":kv,Delete:kv,"Mod-Delete":kv});function zv(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Bv(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof Z_)return zv(n,r,xr.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=Gv(i,e,t);if(o==null)return!1;if(e==`horiz`)return zv(n,r,xr.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=q_(i,e,t),s;return s=a?xr.near(a,1):t<0?xr.near(n.doc.resolve(i.before(-1)),-1):xr.near(n.doc.resolve(i.after(-1)),1),zv(n,r,s)}}}function Vv(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof Z_)o=a;else{let r=Gv(i,e,t);if(r==null)return!1;o=new Z_(n.doc.resolve(r))}let s=q_(o.$headCell,e,t);return s?zv(n,r,new Z_(o.$anchorCell,s)):!1}}function Hv(e,t){let n=e.state.doc,r=z_(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new Z_(r))),!0):!1}function Uv(e,t,n){if(!V_(e.state))return!1;let r=Av(n),i=e.state.selection;if(i instanceof Z_){r||={width:1,height:1,rows:[dr.from(Mv(L_(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=M_.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=Nv(r,o.right-o.left,o.bottom-o.top),Lv(e.state,e.dispatch,a,o,r),!0}if(r){let t=H_(e.state),n=t.start(-1);return Lv(e.state,e.dispatch,n,M_.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function Wv(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=Kv(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof Z_)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=z_(e.state.selection.$anchor))!=null&&qv(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=qv(e,n),i=R_.getState(e.state)==null;if(!r||!K_(t,r)){if(i)r=t;else return}let a=new Z_(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(R_,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),R_.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(R_,-1))}function o(r){let o=r,s=R_.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(Kv(e,o.target)!=n&&(c=qv(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function Gv(e,t,n){if(!(e.state.selection instanceof gr))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function Kv(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function qv(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&z_(e.state.doc.resolve(r))||z_(e.state.doc.resolve(i))}var Jv=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),Yv(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type&&(this.node=e,Yv(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function Yv(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var Xv=new hr(`tableColumnResizing`);function Zv({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Jv,lastColumnResizable:i=!0}={}){let a=new Tr({key:Xv,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=L_(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new Qv(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=Xv.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{$v(t,n,e,i)},mouseleave:e=>{ey(e)},mousedown:(e,r)=>{ty(e,r,t,n)}},decorations:e=>{let t=Xv.getState(e);if(t&&t.activeHandle>-1)return uy(e,t.activeHandle)},nodeViews:{}}});return a}var Qv=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(Xv);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return W_(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function $v(e,t,n,r){if(!e.editable)return;let i=Xv.getState(e.state);if(i&&!i.dragging){let a=ry(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=iy(e,t,`left`,n):i-t.clientX<=n&&(o=iy(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=M_.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}oy(e,o)}}}function ey(e){if(!e.editable)return;let t=Xv.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&oy(e,-1)}function ty(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=Xv.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=ny(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(Xv,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=Xv.getState(e.state);r?.dragging&&(sy(e,r.activeHandle,ay(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Xv,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=Xv.getState(e.state);if(i&&i.dragging){let a=ay(i.dragging,t,n);cy(e,i.activeHandle,a,r)}}return cy(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function ny(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function ry(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function iy(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=z_(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=M_.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function ay(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function oy(e,t){e.dispatch(e.state.tr.setMeta(Xv,{setHandle:t}))}function sy(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=M_.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():ly(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function cy(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=M_.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&Yv(a,c.firstChild,c,r,s,n)}function ly(e){return Array(e).fill(0)}function uy(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return Cr.empty;let a=M_.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,Xv.getState(e)?.dragging&&n.push(Er.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(Er.widget(s,c))}}return Cr.create(e.doc,n)}function dy({allowTableNodeSelection:e=!1}={}){return new Tr({key:R_,state:{init(){return null},apply(e,t){let n=e.getMeta(R_);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:$_,handleDOMEvents:{mousedown:Wv},createSelectionBetween(e){return R_.getState(e.state)==null?null:e.state.selection},handleTripleClick:Hv,handleKeyDown:Rv,handlePaste:Uv},appendTransaction(t,n,r){return nv(r,av(r,n),e)}})}var fy=`childContainer`,py=`blockGroupChild`;function my(e){return e.isInGroup(`childContainer`)&&e.isInGroup(`bnBlock`)}function hy(e,t){return e.nodes.blockGroup.createChecked({},t)}function gy(e){return my(e)&&e.spec.blockConfig?.placeable===`namedOnly`}var _y={min:30,max:49},vy=101;function yy(e){if(e===void 0)return 40;let t=Math.round((e-vy)/10);return Math.min(_y.max,Math.max(_y.min,40+t))}function by(e){return e!==void 0&&`min`in e?e.min??1:1}function xy(e,t){if(e.length===0)return py;let n=[`blockContainer`,...Object.entries(t).filter(([t,{config:n}])=>n.layoutOnly===!0&&n.placeable!==`namedOnly`&&!e.includes(t)).map(([e])=>e)];return n.length===1?n[0]:`(${n.join(` | `)})`}function Sy(e={},t=py){let{allow:n=`blocks`}=e,r=by(e),i;if(n===`blocks`)i=t;else{if(n.length===0)throw Error("Layout block `allow` permits nothing. A layout block must accept at least one block or layout block type; drop `children` entirely for a block that holds none.");i=n.length===1?n[0]:`(${n.join(` | `)})`}return i+(r===0?`*`:r===1?`+`:`{${r},}`)}function Cy(e,t){return t===`start`?e.beforePos+4:e.afterPos-4}function wy(e,t){return!e.hasContent||e.contentKind===`none`?null:e.contentKind===`table`?Cy(e.content,t):t===`start`?e.contentStart:e.contentEnd}function Ty(e,t,n){let r=wy(t,n);if(r!==null)return gr.create(e,r);if(t.hasContent)return wr.create(e,t.content.beforePos);let{node:i,childrenStart:a,childrenEnd:o}=t.children,s=n===`start`?i.firstChild:i.lastChild;return s?Ty(e,jy(s,n===`start`?a:o-s.nodeSize),n):wr.create(e,t.block.beforePos)}function Ey(e){return e.marks.some(e=>[`y-attributed-delete`].includes(e.type.name))}var Dy=new WeakMap;function Oy(e){let t=Dy.get(e);if(t===void 0){let n=new Map,r=new Map;e.descendants(e=>{let t=e.attrs.id;if(t){let i=r.get(t)??0;Ey(e)&&!n.has(e)&&n.set(e,`${t}-${i}`),r.set(t,i+1)}return!0}),t=n,Dy.set(e,t)}return t}function ky(e,t){let n=e.attrs.id;if(!n)throw Error(`Node ${e.type.name} does not have an ID`);if(Ey(e)){let r=Oy(t).get(e);if(r===void 0)throw Error(`Node ${e.type.name} with ID ${n} not found in document`);return r}return n}function Ay(e,t){let n=e.resolve(t);if(n.nodeAfter&&n.nodeAfter.type.isInGroup(`bnBlock`))return{posBeforeNode:n.pos,node:n.nodeAfter};let r=n.depth,i=n.node(r);for(;r>0;){if(i.type.isInGroup(`bnBlock`))return{posBeforeNode:n.before(r),node:i};r--,i=n.node(r)}let a=[];e.descendants((e,t)=>{e.type.isInGroup(`bnBlock`)&&a.push(t)}),console.warn(`Position ${t} is not within a blockContainer node.`);let o=e.resolve(a.find(e=>e>=t)||a[a.length-1]);return{posBeforeNode:o.pos,node:o.nodeAfter}}function jy(e,t){if(!e.type.isInGroup(`bnBlock`))throw Error(`Attempted to get block node at position but found node of different type ${e.type.name}`);let n={node:e,beforePos:t,afterPos:t+e.nodeSize};if(my(e.type))return{hasContent:!1,block:n,children:{...n,childrenStart:n.beforePos+1,childrenEnd:n.afterPos-1},blockNoteType:e.type.name};if(e.type.name===`blockContainer`){let r=e.firstChild;if(!r||!r.type.isInGroup(`blockContent`))throw Error(`blockContainer must start with a block content node.`);let i={node:r,beforePos:t+1,afterPos:t+1+r.nodeSize},a;if(e.childCount>1){let t=e.child(1);if(e.childCount!==2||t.type.name!==`blockGroup`)throw Error(`blockContainer may only have a blockGroup after its content.`);a={node:t,beforePos:i.afterPos,afterPos:n.afterPos-1,childrenStart:i.afterPos+1,childrenEnd:n.afterPos-2}}let o=i.node.type.spec.blockConfig;if(!o)throw Error(`Block content node "${i.node.type.name}" was not built from a block spec, so it has no content kind. Register it with \`createBlockSpec\`/\`createBlockSpecFromTiptapNode\` instead of joining the \`blockContent\` group directly.`);return{hasContent:!0,block:n,content:i,children:a,contentStart:i.beforePos+1,contentEnd:i.afterPos-1,contentKind:o.content,isContentEmpty:i.node.childCount===0,blockNoteType:i.node.type.name}}throw Error(`Node "${e.type.name}" is not a container or blockContainer.`)}function My(e,t){let n=e.resolve(t);if(!n.nodeAfter)throw Error(`Attempted to get block node at position ${t} but a node at this position does not exist`);return jy(n.nodeAfter,n.pos)}function Ny(e,t){let n=Ay(e.doc,t);return jy(n.node,n.posBeforeNode)}function Py(e){return Ny(e,e.selection.anchor)}function Fy(e,t){let n=e.resolve(t),r=n.node();if(r.type.isInGroup(`bnBlock`))return My(e,n.before(n.depth));if(r.type.isInGroup(`childContainer`)&&n.depth>1)return My(e,n.before(n.depth-1))}function Iy(e,t){let n=e.resolve(t),r=n.index();if(r!==0)return My(e,n.posAtIndex(r-1))}function Ly(e,t){let n=e.resolve(t),r=n.index();if(r!==n.node().childCount-1)return My(e,n.posAtIndex(r+1))}function Ry(e){for(;e.children&&e.children.node.childCount;){let t=e.children.node.lastChild;e=jy(t,e.children.childrenEnd-t.nodeSize)}return e}function zy(e,t,n,r){if(n===`before`||n===`after`){let i=n===`before`?t.block.beforePos:t.block.afterPos,a=e.resolve(i);return a.parent.canReplaceWith(a.index(),a.index(),r)?{pos:i}:null}if(!t.children){let e=r.schema.nodes.blockGroup;return t.hasContent&&e?.contentMatch.matchType(r)?{pos:t.content.afterPos,wrapIn:e}:null}let i=n===`last-child`;for(;t.children;){let e=t.children,n=i?e.node.childCount:0;if(e.node.canReplaceWith(n,n,r))return{pos:i?e.childrenEnd:e.childrenStart};let a=i?e.node.lastChild:e.node.firstChild;if(!a||!my(a.type))break;t=jy(a,i?e.childrenEnd-a.nodeSize:e.childrenStart)}return null}function By(e){for(;!e.hasContent;){let{node:t,childrenStart:n}=e.children;if(!t.firstChild)return null;e=jy(t.firstChild,n)}return e}function Vy(e,t,n,r=`before`){for(;;){let i=e.resolve(t),a=i.node();if(a.canReplaceWith(i.index(),i.index(),n))return t;if(i.depth>0&&my(a.type))t=r===`before`?i.before():i.after();else return}}function Hy(e,t){let n=e.resolve(t),r=[];for(let e=n.depth;e>0;e--){let t=n.node(e);if(!my(t.type))break;t.attrs.id&&r.push({id:t.attrs.id,depth:e})}return r}function Uy(e,t){return t.length===1&&t[0].before===e?t[0]:at(e,[...t])}function Wy(e){let{mapping:t,steps:n}=e,r=t.maps;for(let e=0;e<r.length;e++)if(t.getMirror(e)!==void 0)return Ze({mapping:t,steps:n});let i=new Ky(r),a=[];return r.forEach((e,t)=>{let r=[];if(e.forEach((e,t)=>r.push({from:e,to:t})),!r.length){let{from:e,to:i}=n[t];if(e===void 0||i===void 0)return;r.push({from:e,to:i})}for(let{from:e,to:n}of r){let r=i.mapForward(e,-1,t),o=i.mapForward(n,1,t);a.push({oldRange:{from:i.mapBackward(r,-1),to:i.mapBackward(o,1)},newRange:{from:r,to:o}})}}),Gy(a)}function Gy(e){let t=new Set,n=e.filter(({oldRange:e,newRange:n})=>{let r=`${e.from},${e.to},${n.from},${n.to}`;return!t.has(r)&&(t.add(r),!0)});if(n.length===1)return n;let r=n.map((e,t)=>t).sort((e,t)=>n[e].newRange.from-n[t].newRange.from),i=new Jy(r.map(e=>n[e].newRange.to),`max`);return n.filter((e,t)=>{let a=0,o=r.length-1;for(;a<o;){let t=a+o+1>>1;n[r[t]].newRange.from<=e.newRange.from?a=t:o=t-1}return!i.someBefore(a,t=>t>=e.newRange.to,e=>r[e]!==t)})}var Ky=class{maps;inverted;firstStarts=[];oldEnds=[];newEnds=[];shift=[0];trees;constructor(e){this.maps=e,this.inverted=Array(e.length);for(let t of e){let e=1/0,n=-1/0,r=-1/0,i=0;t.forEach((t,a,o,s)=>{e=Math.min(e,t,o),n=Math.max(n,a),r=Math.max(r,s),i+=s-o-(a-t)}),this.firstStarts.push(e),this.oldEnds.push(n),this.newEnds.push(r),this.shift.push(this.shift[this.shift.length-1]+i)}}mapForward(e,t,n){let r=0,i=n;for(;i<this.maps.length;)if(e<this.firstStarts[i])r=Math.max(r,0)+1,r>qy?(i=this.getTrees().firstStart.firstFrom(i,t=>t<=e),r=0):i++;else if(e>this.oldEnds[i]){if(r=Math.min(r,0)-1,r<-qy){let t=e-this.shift[i],n=this.getTrees().forwardShiftFrom.firstFrom(i,e=>e>=t);e+=this.shift[n]-this.shift[i],i=n,r=0}else e+=this.shift[i+1]-this.shift[i],i++}else e=this.maps[i].map(e,t),r=0,i++;return e}mapBackward(e,t){let n=0,r=this.maps.length-1;for(;r>=0;)if(e<this.firstStarts[r])n=Math.max(n,0)+1,n>qy?(r=this.getTrees().firstStart.lastFrom(r,t=>t<=e),n=0):r--;else if(e>this.newEnds[r]){if(n=Math.min(n,0)-1,n<-qy){let t=e-this.shift[r+1],i=this.getTrees().backwardShiftFrom.lastFrom(r,e=>e>=t);e-=this.shift[r+1]-this.shift[i+1],r=i,n=0}else e-=this.shift[r+1]-this.shift[r],r--}else this.inverted[r]??=this.maps[r].invert(),e=this.inverted[r].map(e,t),n=0,r--;return e}getTrees(){return this.trees??={firstStart:new Jy(this.firstStarts,`min`),forwardShiftFrom:new Jy(this.oldEnds.map((e,t)=>e-this.shift[t]),`max`),backwardShiftFrom:new Jy(this.newEnds.map((e,t)=>e-this.shift[t+1]),`max`)},this.trees}},qy=8,Jy=class{values;kind;size;tree;constructor(e,t){this.values=e,this.kind=t,this.size=e.length,this.tree=Array(4*Math.max(1,e.length)),e.length&&this.build(1,0,e.length-1)}firstFrom(e,t){let n=this.first(1,0,this.size-1,e,t);return n===-1?this.size:n}lastFrom(e,t){return this.last(1,0,this.size-1,e,t)}someBefore(e,t,n){for(let r=this.lastFrom(e,t);r!==-1;){if(n(r))return!0;r=r===0?-1:this.lastFrom(r-1,t)}return!1}build(e,t,n){if(t===n){this.tree[e]=this.values[t];return}let r=t+n>>1;this.build(2*e,t,r),this.build(2*e+1,r+1,n),this.tree[e]=this.kind===`min`?Math.min(this.tree[2*e],this.tree[2*e+1]):Math.max(this.tree[2*e],this.tree[2*e+1])}first(e,t,n,r,i){if(n<r||!i(this.tree[e]))return-1;if(t===n)return t;let a=t+n>>1,o=this.first(2*e,t,a,r,i);return o===-1?this.first(2*e+1,a+1,n,r,i):o}last(e,t,n,r,i){if(t>r||!i(this.tree[e]))return-1;if(t===n)return t;let a=t+n>>1,o=this.last(2*e+1,a+1,n,r,i);return o===-1?this.last(2*e,t,a,r,i):o}};function Yy(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Xy(e){return Yy(e.filter((t,n)=>e.indexOf(t)!==n))}function Zy(e){return e.marks.some(e=>e.type.name===`y-attributed-delete`)}var Qy=dt.create({name:`uniqueID`,priority:1e4,addOptions(){return{types:[],setIdAttribute:!1,isWithinEditor:void 0,generateID:()=>{let e=globalThis.window??globalThis;if(e.__TEST_OPTIONS){let t=e.__TEST_OPTIONS;return t.mockID===void 0?t.mockID=0:t.mockID++,t.mockID.toString()}return k_()}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{id:{default:null,parseHTML:e=>e.getAttribute(`data-id`),renderHTML:e=>{let t={"data-id":e.id};return this.options.setIdAttribute?{...t,id:e.id}:t}}}}]},addProseMirrorPlugins(){let{isWithinEditor:e}=this.options,t=null,n=!1;return[new Tr({key:new hr(`uniqueID`),appendTransaction:(e,t,n)=>{if(!e.some(e=>e.docChanged)||t.doc.eq(n.doc))return;let{tr:r}=n,{types:i,generateID:a}=this.options,o=Uy(t.doc,e),{mapping:s}=o;if(Wy(o).forEach(({newRange:e})=>{let o=et(n.doc,e,e=>i.includes(e.type.name)),c=Xy(o.filter(({node:e})=>!Zy(e)).map(({node:e})=>e.attrs.id).filter(e=>e!==null));o.forEach(({node:e,pos:i})=>{if(Zy(e))return;let o=r.doc.nodeAt(i)?.attrs.id;if(o===null){let o=t.doc.type.createAndFill().content;if(t.doc.content.findDiffStart(o)===null){let t=JSON.parse(JSON.stringify(n.doc.toJSON()));if(t.content[0].content[0].attrs.id=`initialBlockId`,JSON.stringify(t.content)===JSON.stringify(o.toJSON())){r.setNodeMarkup(i,void 0,{...e.attrs,id:`initialBlockId`});return}}r.setNodeMarkup(i,void 0,{...e.attrs,id:a()})}else c.includes(o)&&s.invert().mapResult(i).deleted&&r.setNodeMarkup(i,void 0,{...e.attrs,id:a()})})}),r.steps.length)return r.setMeta(`uniqueID`,!0),r},view(n){let r=r=>{let i=n.dom.parentElement;t=i?.contains(r.target)||e?.(r.target)?i:null};return window.addEventListener(`dragstart`,r),{destroy(){window.removeEventListener(`dragstart`,r)}}},props:{handleDOMEvents:{drop:(e,r)=>(n=t!==e.dom.parentElement||r.dataTransfer?.effectAllowed===`copy`,t=null,!1),paste:()=>(n=!0,!1)},transformPasted:e=>{if(!n)return e;let{types:t}=this.options,r=e=>{let n=[];return e.forEach(e=>{if(e.isText){n.push(e);return}if(!t.includes(e.type.name)){n.push(e.copy(r(e.content)));return}let i=e.type.create({...e.attrs,id:null},r(e.content),e.marks);n.push(i)}),dr.from(n)};return n=!1,new br(r(e.content),e.openStart,e.openEnd)}}})]}});function $y(e){return e.type===`link`}function eb(e){return typeof e!=`string`&&e.type===`link`}function tb(e){return typeof e!=`string`&&e.type===`text`}function nb(e){return ib(e)?{...e}:rb(e)?{type:`tableCell`,content:[].concat(e.content),props:{backgroundColor:e.props?.backgroundColor??`default`,textColor:e.props?.textColor??`default`,textAlignment:e.props?.textAlignment??`left`,colspan:e.props?.colspan??1,rowspan:e.props?.rowspan??1}}:{type:`tableCell`,content:[].concat(e),props:{backgroundColor:`default`,textColor:`default`,textAlignment:`left`,colspan:1,rowspan:1}}}function rb(e){return e!=null&&typeof e!=`string`&&!Array.isArray(e)&&e.type===`tableCell`}function ib(e){return rb(e)&&e.props!==void 0&&e.content!==void 0}function ab(e){return ib(e)?e.props.colspan??1:1}function ob(e){return ib(e)?e.props.rowspan??1:1}var sb=class extends Error{constructor(e){super(`Unreachable case: ${e}`)}};function cb(e,t=!0){let{"data-test":n,...r}=e;if(Object.keys(r).length>0&&t)throw Error(`Object must be empty `+JSON.stringify(e))}var lb=()=>typeof navigator<`u`&&(/Mac/.test(navigator.platform)||/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent));function ub(e,t=`Ctrl`){return lb()?e.replace(`Mod`,`⌘`):e.replace(`Mod`,t)}function db(...e){return[...new Set(e.filter(e=>e).join(` `).split(` `))].join(` `)}var fb=()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent),pb,mb=()=>typeof navigator>`u`||typeof window>`u`?!1:(pb===void 0&&(pb=navigator.maxTouchPoints>0&&typeof window.matchMedia==`function`&&window.matchMedia(`(pointer: coarse)`).matches),pb);function hb(e,t,n,r){let i=document.createElement(`div`);i.className=db(`bn-block-content`,n.class),i.setAttribute(`data-content-type`,e);for(let[e,t]of Object.entries(n))e!==`class`&&i.setAttribute(e,t);let a=document.createElement(t);a.className=db(`bn-inline-content`,r.class);for(let[e,t]of Object.entries(r))e!==`class`&&a.setAttribute(e,t);return i.appendChild(a),{dom:i,contentDOM:a}}var gb=(e,t)=>{let n=hS(e,t.pmSchema);n.type.name===`blockContainer`&&(n=n.firstChild);let r=t.pmSchema.nodes[n.type.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=r(n);if(typeof i!=`object`||!(`dom`in i))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap node's `renderHTML` function does not return an object with the `dom` property.");return i};function _b(e,t=`<br>`){let n=e.querySelectorAll(`p`);if(n.length>1){let e=n[0];for(let r=1;r<n.length;r++){let i=n[r];e.innerHTML+=t+i.innerHTML,i.remove()}}}var vb=`blockLevelSuggestion`;function yb(e){return e&&e.options.extensions.some(e=>{if(e.type!==`mark`)return!1;let t=pt(e,`group`);return typeof t==`string`&&t.split(` `).includes(`blockLevelSuggestion`)})?vb:``}function bb(e){return e.type!==`attributes`||!e.attributeName?!1:e.attributeName.startsWith(`data-darkreader`)?!0:e.attributeName===`style`?(e.target.getAttribute(`style`)??``).includes(`--darkreader`)||(e.oldValue??``).includes(`--darkreader`):!1}function xb(e){let t=e.ignoreMutation?.bind(e),n=e.contentDOM;e.ignoreMutation=e=>bb(e)?!0:t?t(e):!n&&e.type!==`selection`}function Sb(e){return`data-`+e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function Cb(e){let t=e.split(`/`);return!t.length||t[t.length-1]===``?e:t[t.length-1]}function wb(e){let t=[`mp4`,`webm`,`ogg`,`mov`,`mkv`,`flv`,`avi`,`wmv`,`m4v`];try{let n=new URL(e).pathname.split(`.`).pop()?.toLowerCase()||``;return t.includes(n)}catch{return!1}}function Tb(e,t){return[...new Set([...Object.keys(e),...Object.keys(t)])].filter(e=>e in t)}function Eb(e,t){let n={};for(let r of Tb(e,t)){let i=e[r];i!==void 0&&i!==t[r].default&&(n[Sb(r)]=String(i))}return n}function Db(e,t){for(let[n,r]of Object.entries(t))e.setAttribute(n,r)}function Ob(e,t,n){let r=Eb(t,n);for(let i of Tb(t,n)){let t=Sb(i);t in r?e.setAttribute(t,r[t]):e.removeAttribute(t)}}function kb(e){return`doc`in e?e.doc.type.schema:e.type.schema}function Ab(e){return e.cached.blockNoteEditor}function jb(e){return Ab(e).schema}function Mb(e){return jb(e).blockSchema}function Nb(e){return jb(e).inlineContentSchema}function Pb(e){return jb(e).styleSchema}function Fb(e){return Ab(e).blockCache}function Ib(e,t){if(Mb(e)[t.name]?.content===`plain`)return!0;let n=Nb(e)[t.name];return typeof n==`object`&&n.content===`plain`}function Lb(e){let t=``;return e.forEach(e=>{Ey(e)||(t+=e.textContent)}),t}function Rb(e,t,n){let r={type:`tableContent`,columnWidths:[],headerRows:void 0,headerCols:void 0,rows:[]},i=[];e.content.forEach((e,a,o)=>{let s={cells:[]};o===0&&e.content.forEach(e=>{let t=e.attrs.colwidth;t??=Array(e.attrs.colspan??1).fill(void 0),r.columnWidths.push(...t)}),s.cells=e.content.content.map((e,r)=>(i[o]||(i[o]=[]),i[o][r]=e.type.name===`tableHeader`,{type:`tableCell`,content:e.content.content.map(e=>zb(e,t,n)).reduce((e,t)=>{if(!e.length)return t;let n=e[e.length-1],r=t[0];return r&&tb(n)&&tb(r)&&JSON.stringify(n.styles)===JSON.stringify(r.styles)?(n.text+=`
125
- `+r.text,e.push(...t.slice(1)),e):(e.push(...t),e)},[]),props:{colspan:e.attrs.colspan,rowspan:e.attrs.rowspan,backgroundColor:e.attrs.backgroundColor,textColor:e.attrs.textColor,textAlignment:e.attrs.textAlignment}})),r.rows.push(s)});for(let e=0;e<i.length;e++)i[e]?.every(e=>e)&&(r.headerRows=(r.headerRows??0)+1);for(let e=0;e<i[0]?.length;e++)i?.every(t=>t[e])&&(r.headerCols=(r.headerCols??0)+1);return r}function zb(e,t,n){let r=[],i;return e.content.forEach(e=>{if(e.type.name===`hardBreak`){if(i){if(tb(i))i.text+=`
126
- `;else if($y(i))i.content[i.content.length-1].text+=`
127
- `;else throw Error(`unexpected`)}else i={type:`text`,text:`
128
- `,styles:{}};return}if(e.type.name!==`link`&&e.type.name!==`text`){if(!t[e.type.name]){console.warn(`unrecognized inline content type`,e.type.name);return}i&&=(r.push(i),void 0),r.push(Bb(e,t,n));return}let a={},o;for(let t of e.marks)if(t.type.name===`link`)o=t;else{let e=n[t.type.name];if(!e){if(t.type.spec.blocknoteIgnore)continue;throw Error(`style ${t.type.name} not found in styleSchema`)}if(e.propSchema===`boolean`)a[e.type]=!0;else if(e.propSchema===`string`)a[e.type]=t.attrs.stringValue;else throw new sb(e.propSchema)}i?tb(i)?o?(r.push(i),i={type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}):JSON.stringify(i.styles)===JSON.stringify(a)?i.text+=e.textContent:(r.push(i),i={type:`text`,text:e.textContent,styles:a}):$y(i)&&(o?i.href===o.attrs.href?JSON.stringify(i.content[i.content.length-1].styles)===JSON.stringify(a)?i.content[i.content.length-1].text+=e.textContent:i.content.push({type:`text`,text:e.textContent,styles:a}):(r.push(i),i={type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}):(r.push(i),i={type:`text`,text:e.textContent,styles:a})):i=o?{type:`link`,href:o.attrs.href,content:[{type:`text`,text:e.textContent,styles:a}]}:{type:`text`,text:e.textContent,styles:a}}),i&&r.push(i),r}function Bb(e,t,n){if(e.type.name===`text`||e.type.name===`link`)throw Error(`unexpected`);let r={},i=t[e.type.name];for(let[t,n]of Object.entries(e.attrs)){if(!i)throw Error(`ic node is of an unrecognized type: `+e.type.name);t in i.propSchema&&(r[t]=n)}let a;return a=i.content===`styled`?zb(e,t,n):i.content===`plain`?Lb(e):void 0,{type:e.type.name,props:r,content:a}}function Vb(e,t){let n=e.type.schema,r=Mb(n),i=Nb(n),a=Pb(n),o=Fb(n);if(!e.type.isInGroup(`bnBlock`))throw Error(`Node should be a block, but is instead: `+e.type.name);let s=o?.get(e);if(s)return s;let c=jy(e,0),l;try{l=ky(c.block.node,t)}catch{l=Qy.options.generateID()}let u=r[c.blockNoteType];if(!u)throw Error(`Block is of an unrecognized type: `+c.blockNoteType);let d={};for(let[t,n]of Object.entries({...e.attrs,...c.hasContent?c.content.node.attrs:{}})){let e=u.propSchema;t in e&&(e[t].default!==void 0||n!==void 0)&&(d[t]=n)}let f=[];c.children?.node.forEach(e=>{f.push(Vb(e,t))});let p;switch(c.contentKind){case`inline`:p=zb(c.content.node,i,a);break;case`table`:p=Rb(c.content.node,i,a);break;case`plain`:{let e=Lb(c.content.node);p=e.length>0?[{type:`text`,text:e,styles:{}}]:[];break}case`none`:case void 0:p=void 0;break;default:throw new sb(c)}let m={id:l,type:u.type,props:d,content:p,children:f};return o?.set(e,m),m}function Hb(e){let t=[];return e.firstChild&&e.firstChild.descendants(n=>(t.push(Vb(n,e)),!1)),t}function Ub(e){function t(n,r,i){if(n.type.name!==`blockGroup`&&!my(n.type))throw Error(`unexpected`);let a=[],o,s;return n.forEach((c,l,u)=>{let d=u===0,f=u===n.childCount-1,p=my(c.type);if(!p){if(c.type.name!==`blockContainer`)throw Error(`unexpected`);if(c.childCount===0)return;if(c.childCount>2)throw Error(`unexpected, blockContainer.childCount: `+c.childCount)}let m=!p&&c.firstChild.type.name===`blockGroup`;if(m&&!d)throw Error(`unexpected`);if(m||p&&(d&&r>0||f&&i>0)){let e=t(p?c:c.firstChild,d?Math.max(0,r-1):0,f?Math.max(0,i-1):0);d&&(o=e.blockCutAtStart),f&&(s=e.blockCutAtEnd),a.push(...e.blocks);return}if(p){a.push(Vb(c,e.content.firstChild));return}let h=Vb(c,e.content.firstChild),g=c.childCount>1?c.child(1):void 0,_=[];if(g){let e=t(g,0,f?Math.max(0,i-1):0);_=e.blocks,f&&(s=e.blockCutAtEnd)}f&&!g&&i>1&&(s=h.id),d&&r>1&&(o=h.id),a.push({...h,children:_})}),{blocks:a,blockCutAtStart:o,blockCutAtEnd:s}}if(e.content.childCount===0)return{blocks:[],blockCutAtStart:void 0,blockCutAtEnd:void 0};if(e.content.childCount!==1)throw Error(`slice must be a single block, did you forget includeParents=true?`);return t(e.content.firstChild,Math.max(e.openStart-1,0),Math.max(e.openEnd-1,0))}function Wb(e,t,n,r,i){e&&(Ob(e,n,r),e.setAttribute(`data-node-type`,t),i&&e.setAttribute(`data-id`,i))}var Gb=`data-frame-slot`;function Kb(e){e.setAttribute(Gb,``)}function qb(e){if(e.hasAttribute(`data-frame-slot`))return e;for(let t of e.querySelectorAll(`[${Gb}]`))if(t.closest(`[data-node-type]`)===e)return t}function Jb(e,t,n){Wb(t.dom,e.type,n.props,e.propSchema,n.id),Kb(t.slot)}function Yb(e,t){let n=e.blockImplementations[t.type],r=n.implementation.renderFrame?.call({renderType:`dom`,props:void 0,propSchema:n.config.propSchema},t,e);if(n.config.layoutOnly===!0){if(!r)throw Error(`Layout block "${t.type}" must draw its frame: \`renderFrame\` returned undefined.`);Jb(n.config,r,t)}return r}function Xb(e){let{props:t,editor:n,blockNode:r}=e;return n.blockImplementations[r(t.node).type.name].implementation.frameView?.(t)??Zb(e)}function Zb(e){let{props:t,editor:n,blockNode:r,unframed:i}=e,a=n.blockImplementations[r(t.node).type.name].config;function o(e,t){a.layoutOnly===!0&&Jb(a,e,t)}function s(e){let i=n.blockImplementations[r(e).type.name],a=i.implementation.renderFrame;if(!a)return;let s=Vb(e,t.view.state.doc),c=a.call({renderType:`nodeView`,props:t,propSchema:i.config.propSchema},s,n);if(c)return o(c,s),c}let c=s(t.node),l,u;if(c)l=c.dom,u=c.slot;else if(i)l=i,u=i;else throw Error(`Block "${r(t.node).type.name}" must draw its frame: \`renderFrame\` returned undefined.`);let d=t.node;return{dom:l,slot:u,get node(){return d},update(e){let n=r(d),i=r(e);if(!c){let t=i.sameMarkup(n)?void 0:s(e);return t?(t.destroy?.(),!1):(d=e,!0)}if(i.type!==n.type)return!1;if(c.update){let n=Vb(e,t.view.state.doc);if(c.update(n)===!1)return!1;o(c,n)}else if(!i.sameMarkup(n))return!1;return d=e,!0},destroy:()=>c?.destroy?.()}}var Qb=new Set([`dragenter`,`dragover`,`dragleave`,`drop`,`copy`,`cut`,`paste`]);function $b(e,t){let n=t.target;return n instanceof globalThis.Node&&e.dom.contains(n)&&!e.slot.contains(n)&&!Qb.has(t.type)}function ex(e,t){return t.type===`selection`?!1:bb(t)||t.target===e.slot&&t.type===`attributes`?!0:e.dom.contains(t.target)&&!e.slot.contains(t.target)}function tx(e){return{stopEvent:t=>$b(e,t),ignoreMutation:t=>ex(e,t),selectNode:e.selectNode?.bind(e),deselectNode:e.deselectNode?.bind(e),destroy:e.destroy?.bind(e)}}function nx(e,t){let{isLayoutBlock:n,hardBreakShortcut:r}=t,i={enter:r===`enter`?`line-break`:`split`,shiftEnter:r===`none`?`same-as-enter`:`line-break`,splitKeepsType:!1,splitKeepsChildren:!1,resetsTo:{type:`paragraph`},emptyEnterResets:!1,emptyChildEnter:n?`exit-at-end`:`outdent`,childrenCanOutdent:!n};if(typeof e==`function`)return t=>rx(i,e(t));let a=rx(i,e);return()=>a}function rx(e,t){let n={...e};for(let[e,r]of Object.entries(t??{}))r!==void 0&&Object.assign(n,{[e]:r});return t?.splitKeepsChildren===void 0&&(n.splitKeepsChildren=n.enter===`into-children`),n}function ix(e,t){let n=t.layoutOnly===!0;return{...e,selectable:e?.selectable??!0,code:n?!1:e?.code??!1,defining:n?!0:e?.defining??!0,isolating:n?!1:e?.isolating??!0,draggable:e?.draggable??t.placeable!==`namedOnly`}}function ax(e){let t={};return Object.entries(e).forEach(([e,n])=>{t[e]={default:n.default,keepOnSplit:!0,parseHTML:t=>{let r=t.getAttribute(Sb(e));if(r===null)return null;if(n.default===void 0&&n.type===`boolean`||n.default!==void 0&&typeof n.default==`boolean`)return r===`true`||r!==`false`&&null;if(n.default===void 0&&n.type===`number`||n.default!==void 0&&typeof n.default==`number`){let e=parseFloat(r);return!Number.isNaN(e)&&Number.isFinite(e)?e:null}return r},renderHTML:t=>Eb({[e]:t[e]},{[e]:n})}}),t}function ox(e,t){let n=e();if(n===void 0)throw Error(`Cannot find node position`);let r=t.resolve(n).node();if(!r)throw Error(`Cannot find block container`);return Vb(r,t)}function sx(e,t,n){try{return ox(e,n)}catch(e){let r=n.type.schema.nodes.blockContainer?.createAndFill(null,t);if(r)return Vb(r,n);throw e}}var cx=11;function lx(e){return e.nodeType===cx}function ux(e,t){if(t&&!lx(e))for(let[n,r]of Object.entries(t))n===`class`?e.className=db(e.className,r):e.setAttribute(n,r)}function dx(e,t,n,r,i=!1,a){let o=document.createElement(`div`);if(a!==void 0)for(let[e,t]of Object.entries(a))e!==`class`&&o.setAttribute(e,t);return o.className=db(`bn-block-content`,a?.class||``),o.setAttribute(`data-content-type`,t),Db(o,Eb(n,r)),i&&o.setAttribute(`data-file-block`,``),o.appendChild(e.dom),e.contentDOM&&(e.contentDOM.className=db(`bn-inline-content`,e.contentDOM.className)),{...e,dom:o}}function fx(e,t,n){return{config:{type:e.type,content:e.content,propSchema:t},implementation:{node:e.node,meta:ix(void 0,{}),keyboard:nx(void 0,{isLayoutBlock:!1,hardBreakShortcut:void 0}),render:gb,toExternalHTML:gb},extensions:n}}function px(e,t){e.stopEvent=e=>(e.type===`mousedown`&&setTimeout(()=>{t.view.dom.blur()},10),!0)}function mx(e,t){let n=e.layoutOnly===!0;if(!(e.content===`table`||n&&!t.parseContent))return(r,i)=>{if(t.parseContent){let e=t.parseContent({el:r,schema:i});if(e!==void 0)return e}if(n)return Or.fromSchema(i).parse(r,{topNode:i.nodes.blockGroup.create(),preserveWhitespace:!0}).content;if(e.content===`none`)return dr.empty;let a=r.cloneNode(!0);_b(a,e.content===`plain`||t.meta?.code?`
129
- `:`<br>`);let o=Or.fromSchema(i).parse(a,{topNode:i.nodes.paragraph.create(),preserveWhitespace:e.content!==`plain`||`full`});if(e.content===`inline`)return o.content;let s=[];return o.content.forEach(e=>{if(e.isText){s.push(e);return}let t=e.type===i.linebreakReplacement?`
130
- `:e.textContent;t&&s.push(i.text(t,e.marks))}),dr.fromArray(s)}}function hx(e,t){let n=[e.layoutOnly===!0?{tag:`[data-node-type=${e.type}]`,contentElement:e=>qb(e)??e}:{tag:`[data-content-type=`+e.type+`]`,contentElement:`.bn-inline-content`,preserveWhitespace:e.content===`plain`?`full`:void 0}];return t.parse&&n.push({tag:`*`,getAttrs(e){if(typeof e==`string`)return!1;let n=t.parse?.(e);return n!==void 0&&n},preserveWhitespace:!0,getContent:mx(e,t)}),n}function gx(e,t){if(e.layoutOnly!==!0){if(!t.render)throw Error(`Block "${e.type}" must declare \`render\`.`)}else{if(t.render)throw Error(`Layout block "${e.type}" draws its box in \`renderFrame\`, and has no content for \`render\` to draw.`);if(!t.renderFrame)throw Error(`Layout block "${e.type}" must declare \`renderFrame\`.`)}}function _x(e,t){let n=Xb({props:t,editor:t.extension.options.editor,blockNode:e=>e}),r={dom:n.dom,contentDOM:n.slot,update(e,t,r){return e.attrs.id===n.node.attrs.id&&n.update(e,t,r)},...tx(n)};return e.meta.selectable||px(r,t.editor),r}function vx(e,t,n){if(e.layoutOnly===!0)return _x(t,n);let r=sx(n.getPos,n.node,n.view.state.doc),i=t.render.call({blockContentDOMAttributes:n.extension.options.domAttributes?.blockContent||{},props:n,renderType:`nodeView`,propSchema:e.propSchema},r,n.extension.options.editor);return t.meta.selectable||px(i,n.editor),xb(i),i}function yx(e){let t=e!==void 0&&`exclude`in e?e.exclude:[];return t===void 0||t.length===0?Sy(e):function(){return Sy(e,xy(t,this.options.editor.schema.blockSpecs))}}function bx(e,t,n){let r=e.layoutOnly===!0;return st.create({name:e.type,content:r?yx(e.children):e.content===`inline`?`inline*`:e.content===`plain`?`text*`:e.content===`none`?``:e.content,marks(){return r?yb(this.editor):e.content===`plain`?g_(this.editor):void 0},group:r?[`bnBlock`,fy,...e.placeable===`namedOnly`?[]:[py]].join(` `):`blockContent`,selectable:t.meta.selectable,isolating:t.meta.isolating,code:t.meta.code,defining:t.meta.defining,priority:r?yy(n):n,addAttributes(){return ax(e.propSchema)},parseHTML(){return hx(e,t)},renderHTML({HTMLAttributes:n}){if(r){let t=document.createElement(`div`);t.setAttribute(`data-node-type`,e.type);for(let[e,r]of Object.entries(n))t.setAttribute(e,r);return{dom:t,contentDOM:t}}let i=document.createElement(`div`);return dx({dom:i,contentDOM:e.content===`inline`||e.content===`plain`?i:void 0},e.type,{},e.propSchema,t.meta.fileBlockAccept!==void 0,n)},addNodeView(){return n=>vx(e,t,n)}})}function xx(e,t,n,r){let i=e.layoutOnly===!0,a={...t,meta:ix(t.meta,e)},o=a.node??bx(e,a,r);if(o.name!==e.type)throw Error(`Node name does not match block type. This is a bug in BlockNote.`);gx(e,a);let s=o.extend({extendNodeSchema(t){return t.name===o.name?{blockConfig:e}:{}}}),{experimental_keyboard:c,render:l,toExternalHTML:u,...d}=a;return{config:e,implementation:{...d,keyboard:nx(c,{isLayoutBlock:i,hardBreakShortcut:a.meta.hardBreakShortcut}),node:s,...l&&{render(t,n){let r=s.options.domAttributes?.blockContent||{};return l.call({blockContentDOMAttributes:r,props:void 0,renderType:`dom`,propSchema:e.propSchema},t,n)}},...u&&{toExternalHTML:(t,n,r)=>{let a=s.options.domAttributes?.blockContent||{},o=u.call({blockContentDOMAttributes:a,propSchema:e.propSchema},t,n,r);return o&&i&&!lx(o.dom)&&Ob(o.dom,t.props,e.propSchema),o}}},extensions:n}}function Sx(e){return e}function Cx(e,t,n){return(r={})=>{let i=typeof e==`function`?e(r):e,a=typeof t==`function`?t(r):t,o=n?typeof n==`function`?n(r):n:void 0,s=i.layoutOnly===!0;gx(i,a);let c=a.render,l=a.toExternalHTML;return{config:i,implementation:{...a,...l&&{toExternalHTML(e,t,n){let r=l.call({blockContentDOMAttributes:this.blockContentDOMAttributes},e,t,n);if(r!==void 0)return s?(ux(r.dom,this.blockContentDOMAttributes),r):dx(r,e.type,e.props,this.propSchema??i.propSchema,a.meta?.fileBlockAccept!==void 0)}},...c&&{render(e,t){return dx(c.call({blockContentDOMAttributes:this.blockContentDOMAttributes,renderType:this.renderType,props:this.props},e,t),e.type,e.props,this.propSchema??i.propSchema,a.meta?.fileBlockAccept!==void 0,this.blockContentDOMAttributes)}}},extensions:o}}}function wx(e,t,n,r){return e.dom.setAttribute(`data-inline-content-type`,t),Db(e.dom,Eb(n,r)),e.contentDOM&&e.contentDOM.setAttribute(`data-editable`,``),e}function Tx(e){return{Backspace:({editor:t})=>{let n=t.state.selection.$from;return t.state.selection.empty&&n.node().type.name===e.type&&n.parentOffset===0}}}function Ex(e,t,n){return{config:e,implementation:t,extensions:n}}function Dx(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function Ox(e){return e===`boolean`?{}:{stringValue:{default:void 0,keepOnSplit:!0,parseHTML:e=>e.getAttribute(`data-value`),renderHTML:e=>e.stringValue===void 0?{}:{"data-value":e.stringValue}}}}function kx(e,t,n,r){return e.dom.setAttribute(`data-style-type`,t),r===`string`&&e.dom.setAttribute(`data-value`,n),e.contentDOM&&e.contentDOM.setAttribute(`data-editable`,``),e}function Ax(e,t){return{config:e,implementation:t}}function jx(e,t){return Ax({type:e.name,propSchema:t},{mark:e,render(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=n.pmSchema.mark(e.name,{stringValue:t}),a=pr.renderSpec(document,r(i,!0));if(typeof a!=`object`||!(`dom`in a))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a},toExternalHTML(t,n){let r=n.pmSchema.marks[e.name].spec.toDOM;if(r===void 0)throw Error("This block has no default HTML serialization as its corresponding TipTap node doesn't implement `renderHTML`.");let i=n.pmSchema.mark(e.name,{stringValue:t}),a=pr.renderSpec(document,r(i,!0));if(typeof a!=`object`||!(`dom`in a))throw Error("Cannot use this block's default HTML serialization as its corresponding TipTap mark's `renderHTML` function does not return an object with the `dom` property.");return a}})}function Mx(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t.config]))}function Nx(e,t){let n=[{tag:`[data-style-type="${e.type}"]`,contentElement:e=>{let t=e;return t.matches(`[data-editable]`)?t:t.querySelector(`[data-editable]`)||t}}];return t&&n.push({tag:`*`,consuming:!1,getAttrs(e){if(typeof e==`string`)return!1;let n=t?.(e);return n!==void 0&&{stringValue:n}}}),n}function Px(e,t){let n=Qe.create({name:e.type,addAttributes(){return Ox(e.propSchema)},parseHTML(){return Nx(e,t.parse)},renderHTML({mark:n}){return kx((t.toExternalHTML||t.render)(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema)},addMarkView(){return({mark:n})=>kx(t.render(n.attrs.stringValue),e.type,n.attrs.stringValue,e.propSchema)}});return Ax(e,{...t,mark:n,render:n=>kx(t.render(n),e.type,n,e.propSchema),toExternalHTML:n=>kx((t.toExternalHTML||t.render)(n),e.type,n,e.propSchema)})}function Fx(e){let t=Lx(e),{roots:n,nonRoots:r}=Rx(t),i=[];for(;n.size;){i.push(n);let r=new Set;for(let i of n){let n=e.get(i);if(n)for(let e of n){let n=t.get(e);if(n===void 0)continue;let i=n-1;t.set(e,i),i===0&&r.add(e)}}n=r}if(r=Rx(t).nonRoots,r.size)throw Error(`Cycle(s) detected; toposort only works on acyclic graphs. Cyclic nodes: ${Array.from(r).join(`, `)}`);return i}function Ix(e){return Fx(zx(e))}function Lx(e){let t=new Map;for(let[n,r]of e.entries()){t.has(n)||t.set(n,0);for(let e of r){let n=t.get(e)??0;t.set(e,n+1)}}return t}function Rx(e){let t=new Set,n=new Set;for(let[r,i]of e.entries())i===0?t.add(r):n.add(r);return{roots:t,nonRoots:n}}function zx(e){let t=new Map;for(let[n,r]of e.entries()){t.has(n)||t.set(n,new Set);for(let e of r)t.has(e)||t.set(e,new Set),t.get(e).add(n)}return t}function Bx(){return new Map}function Vx(e,t,n){return e.has(t)||e.set(t,new Set),e.get(t).add(n),e}function Hx(e){let t=Bx();for(let n of e)Array.isArray(n.runsBefore)&&n.runsBefore.length>0?n.runsBefore.forEach(e=>{Vx(t,n.key,e)}):Vx(t,`default`,n.key);let n=Ix(t),r=n.findIndex(e=>e.has(`default`));return e=>91+(n.findIndex(t=>t.has(e))+r)*10}function Ux(e){for(let[t,{config:n}]of Object.entries(e)){if(n.layoutOnly===!0&&n.content!==`none`&&Wx(t,'`layoutOnly: true` is only for blocks without content (`content: "none"`). A layout block holds only child blocks, no content of its own.'),n.placeable===`namedOnly`&&n.layoutOnly!==!0&&Wx(t,'`placeable: "namedOnly"` is only for layout blocks (`layoutOnly: true`). Only a layout block can be limited to the blocks that name it in `children.allow`.'),!n.children)continue;let{allow:r=`blocks`,min:i,exclude:a,dissolve:o}=n.children;if(n.layoutOnly!==!0)(r!==`blocks`||i!==void 0||a!==void 0||o!==void 0)&&Wx(t,'restricting child types, a minimum count or `dissolve` requires `layoutOnly: true`. Other blocks can always have any child blocks (`{ allow: "blocks" }`).');else{if(r===`blocks`&&(i!==void 0||o!==void 0)&&Wx(t,`\`children.${i===void 0?`dissolve`:`min`}\` needs an \`allow\` list. A layout block that accepts any blocks always holds at least one child, and dissolves when its last child is removed.`),i!==void 0&&!(Number.isInteger(i)&&i>=0)&&Wx(t,`\`children.min\` must be a whole number that is 0 or more, not ${String(i)}.`),a!==void 0){r!==`blocks`&&Wx(t,"`children.exclude` is only for a layout block that accepts any blocks. An `allow` list already names exactly what the layout block holds.");for(let n of a){Object.prototype.hasOwnProperty.call(e,n)||Wx(t,`\`exclude\` contains "${n}", which is not a configured block type.`);let{config:r}=e[n];r.layoutOnly!==!0&&Wx(t,`\`exclude\` contains "${n}", which is not a layout block. Only layout blocks (\`layoutOnly: true\`) can be excluded.`),r.placeable===`namedOnly`&&Wx(t,`\`exclude\` contains "${n}", which is \`placeable: "namedOnly"\` and never a child of a layout block that accepts any blocks.`)}}if(r!==`blocks`)for(let n of r)Object.prototype.hasOwnProperty.call(e,n)||Wx(t,`\`allow\` contains "${n}", which is not a configured block type.`),e[n].config.layoutOnly!==!0&&Wx(t,`\`allow\` contains "${n}", which is not a layout block. An \`allow\` list can name only layout blocks (\`layoutOnly: true\`); naming other blocks is not supported yet. Use \`allow: "blocks"\` to accept all other blocks.`)}}let t=new Set(Object.values(e).flatMap(({config:e})=>e.children?.allow&&e.children.allow!==`blocks`?e.children.allow:[]));for(let[n,{config:r}]of Object.entries(e))r.placeable===`namedOnly`&&!t.has(n)&&Wx(n,'`placeable: "namedOnly"` limits this block to the blocks that name it in `children.allow`, but no block names it. Name it in the `allow` list of a layout block.')}function Wx(e,t){throw Error(`Invalid config for block "${e}": ${t}`)}function Gx(e){return e&&Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var Kx=class{opts;BlockNoteEditor=`only for types`;Block=`only for types`;PartialBlock=`only for types`;inlineContentSpecs;styleSpecs;blockSpecs;blockSchema;inlineContentSchema;styleSchema;constructor(e){this.opts=e;let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:i,inlineContentSchema:a,styleSchema:o}=this.init();this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=o,this.inlineContentSpecs=n,this.blockSchema=i,this.inlineContentSchema=a}init(){let e=Hx(Object.entries({...this.opts.blockSpecs,...this.opts.inlineContentSpecs,...this.opts.styleSpecs}).map(([e,t])=>({key:e,runsBefore:t.implementation?.runsBefore??[]})));Ux(this.opts.blockSpecs);let t=Object.fromEntries(Object.entries(this.opts.blockSpecs).map(([t,n])=>[t,xx(n.config,n.implementation,n.extensions,e(t))])),n=Object.fromEntries(Object.entries(this.opts.inlineContentSpecs).map(([t,n])=>typeof n.config==`object`?[t,{...n,implementation:{...n.implementation,node:n.implementation?.node.extend({priority:e(t)})}}]:[t,n])),r=Object.fromEntries(Object.entries(this.opts.styleSpecs).map(([t,n])=>[t,{...n,implementation:{...n.implementation,mark:n.implementation?.mark.extend({priority:e(t)})}}]));return{blockSpecs:t,blockSchema:Object.fromEntries(Object.entries(t).map(([e,t])=>[e,t.config])),inlineContentSpecs:Gx(n),styleSpecs:Gx(r),inlineContentSchema:Dx(n),styleSchema:Mx(r)}}extend(e){this.opts={blockSpecs:{...this.opts.blockSpecs,...e.blockSpecs},inlineContentSpecs:{...this.opts.inlineContentSpecs,...e.inlineContentSpecs},styleSpecs:{...this.opts.styleSpecs,...e.styleSpecs}};let{blockSpecs:t,inlineContentSpecs:n,styleSpecs:r,blockSchema:i,inlineContentSchema:a,styleSchema:o}=this.init();return this.blockSpecs=t,this.styleSpecs=r,this.styleSchema=o,this.inlineContentSpecs=n,this.blockSchema=i,this.inlineContentSchema=a,this}};function qx(e){let{height:t,width:n}=Xx(e),r=Array(t).fill(!1).map(()=>Array(n).fill(null)),i=(e,i)=>{for(let a=e;a<t;a++)for(let e=i;e<n;e++)if(!r[a][e])return{row:a,col:e};throw Error(`Unable to create occupancy grid for table, no more available cells`)};for(let t=0;t<e.content.rows.length;t++)for(let n=0;n<e.content.rows[t].cells.length;n++){let a=nb(e.content.rows[t].cells[n]),o=ob(a),s=ab(a),{row:c,col:l}=i(t,n);for(let e=c;e<c+o;e++)for(let i=l;i<l+s;i++){if(r[e][i])throw Error(`Unable to create occupancy grid for table, cell at ${e},${i} is already occupied`);r[e][i]={row:t,col:n,rowspan:o,colspan:s,cell:a}}}return r}function Jx(e){let t=new Set;return e.map(e=>({cells:e.map(e=>!t.has(e.row+`:`+e.col)&&(t.add(e.row+`:`+e.col),e.cell)).filter(e=>e!==!1)}))}function Yx(e,t,n=qx(t)){for(let t=0;t<n.length;t++)for(let r=0;r<n[t].length;r++){let i=n[t][r];if(i&&i.row===e.row&&i.col===e.col)return{row:t,col:r,cell:i.cell}}throw Error(`Unable to resolve relative table cell indices for table, cell at ${e.row},${e.col} is not occupied`)}function Xx(e){let t=e.content.rows.length,n=0;return e.content.rows.forEach(e=>{let t=0;e.cells.forEach(e=>{t+=ab(e)}),n=Math.max(n,t)}),{height:t,width:n}}function Zx(e,t,n=qx(t)){let r=n[e.row]?.[e.col];if(r)return{row:r.row,col:r.col,cell:r.cell}}function Qx(e,t){let n=qx(e);if(t<0||t>=n.length)return[];let r=0;for(let e=0;e<t;e++){let e=n[r]?.[0];if(!e)return[];r+=e.rowspan}let i=Array(n[0].length).fill(!1).map((t,i)=>Zx({row:r,col:i},e,n)).filter(e=>e!==void 0);return i.filter((e,t)=>i.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function $x(e,t){let n=qx(e);if(t<0||t>=n[0].length)return[];let r=0;for(let e=0;e<t;e++){let e=n[0]?.[r];if(!e)return[];r+=e.colspan}let i=Array(n.length).fill(!1).map((t,i)=>Zx({row:i,col:r},e,n)).filter(e=>e!==void 0);return i.filter((e,t)=>i.findIndex(t=>t.row===e.row&&t.col===e.col)===t)}function eS(e,t,n,r=qx(e)){let{col:i}=Yx({row:0,col:t},e,r),{col:a}=Yx({row:0,col:n},e,r);return r.forEach(e=>{let[t]=e.splice(i,1);e.splice(a,0,t)}),Jx(r)}function tS(e,t,n,r=qx(e)){let{row:i}=Yx({row:t,col:0},e,r),{row:a}=Yx({row:n,col:0},e,r),[o]=r.splice(i,1);return r.splice(a,0,o),Jx(r)}function nS(e){return e?rb(e)?nS(e.content):typeof e==`string`?e.length===0:Array.isArray(e)?e.every(e=>typeof e==`string`?e.length===0:tb(e)?e.text.length===0:eb(e)?typeof e.content==`string`?e.content.length===0:e.content.every(e=>e.text.length===0):!1):!1:!0}function rS(e,t,n=qx(e)){if(t===`columns`){let e=0;for(let t=n[0].length-1;t>=0&&n.every(e=>nS(e[t].cell)&&e[t].colspan===1);t--)e++;for(let t=n.length-1;t>=0;t--){let r=Math.max(n[t].length-e,1);n[t]=n[t].slice(0,r)}return Jx(n)}let r=0;for(let e=n.length-1;e>=0&&n[e].every(e=>nS(e.cell)&&e.rowspan===1);e--)r++;let i=Math.min(r,n.length-1);return n.splice(n.length-i,i),Jx(n)}function iS(e,t,n,r=qx(e)){let{width:i,height:a}=Xx(e);if(t===`columns`)r.forEach((e,t)=>{if(n>=0)for(let r=0;r<n;r++)e.push({row:t,col:Math.max(...e.map(e=>e.col))+1,rowspan:1,colspan:1,cell:nb(``)});else e.splice(i+n,-1*n)});else if(n>0)for(let e=0;e<n;e++){let t=Array(i).fill(null).map((t,n)=>({row:a+e,col:n,rowspan:1,colspan:1,cell:nb(``)}));r.push(t)}else n<0&&r.splice(a+n,-1*n);return Jx(r)}function aS(e,t,n){let r=Qx(e,n);if(!r.some(e=>ob(e.cell)>1))return!0;let i=n,a=n;return r.forEach(e=>{let t=ob(e.cell);i=Math.max(i,e.row+t-1),a=Math.min(a,e.row)}),t<n?n===i:n===a}function oS(e,t,n){let r=$x(e,n);if(!r.some(e=>ab(e.cell)>1))return!0;let i=n,a=n;return r.forEach(e=>{let t=ab(e.cell);i=Math.max(i,e.col+t-1),a=Math.min(a,e.col)}),t<n?n===i:n===a}function sS(e,t,n){let r=Yx(e,n),i=Yx(t,n);return r.col===i.col}function cS(e,t,n,r){let i=[];for(let[r,a]of Object.entries(e.styles||{})){let e=n[r];if(!e)throw Error(`style ${r} not found in styleSchema`);if(e.propSchema===`boolean`)a&&i.push(t.mark(r));else if(e.propSchema===`string`)a&&i.push(t.mark(r,{stringValue:a}));else throw new sb(e.propSchema)}let a=r&&t.nodes[r]&&Ib(t,t.nodes[r])?[...t.nodes[r].allowedMarks(i)]:i;return r&&Ib(t,t.nodes[r])?e.text.length>0?[t.text(e.text,a)]:[]:e.text.split(/(\n)/g).filter(e=>e.length>0).map(e=>e===`
131
- `?t.nodes.hardBreak.createChecked():t.text(e,a))}function lS(e,t,n){let r=t.marks.link.create({href:e.href});return uS(e.content,t,n).map(e=>{if(e.type.name===`text`)return e.mark([...e.marks,r]);if(e.type.name===`hardBreak`)return e;throw Error(`unexpected node type`)})}function uS(e,t,n,r){let i=[];if(typeof e==`string`)return i.push(...cS({type:`text`,text:e,styles:{}},t,n,r)),i;for(let a of e)i.push(...cS(a,t,n,r));return i}function dS(e,t,n,r=Pb(t)){let i=[];for(let a of e)typeof a==`string`?i.push(...uS(a,t,r,n)):eb(a)?i.push(...lS(a,t,r)):tb(a)?i.push(...uS([a],t,r,n)):i.push(pS(a,t,r));return i}function fS(e,t,n=Pb(t)){let r=[],i=Array(e.headerRows??0).fill(!0),a=Array(e.headerCols??0).fill(!0),o=e.columnWidths??[];for(let s=0;s<e.rows.length;s++){let c=e.rows[s],l=[],u=i[s];for(let r=0;r<c.cells.length;r++){let i=c.cells[r],d=a[r],f=null,p=Yx({row:s,col:r},{type:`table`,content:e}),m=o[p.col]?[o[p.col]]:null;if(i){if(typeof i==`string`)f=t.text(i);else if(rb(i)){i.content&&(f=dS(i.content,t,`tableParagraph`,n));let e=ab(i);e>1&&(m=Array(e).fill(!1).map((e,t)=>o[p.col+t]??void 0))}else f=dS(i,t,`tableParagraph`,n)}let h=t.nodes[d||u?`tableHeader`:`tableCell`].createChecked({...rb(i)?i.props:{},colwidth:m},t.nodes.tableParagraph.createChecked(void 0,f));l.push(h)}let d=t.nodes.tableRow.createChecked({},l);r.push(d)}return r}function pS(e,t,n){let r,i=e.type;if(i===void 0&&(i=`paragraph`),!t.nodes[i])throw Error(`node type ${i} not found in schema`);if(!e.content)r=t.nodes[i].createChecked(e.props);else if(typeof e.content==`string`){let a=dS([e.content],t,i,n);r=t.nodes[i].createChecked(e.props,a)}else if(Array.isArray(e.content)){let a=dS(e.content,t,i,n);r=t.nodes[i].createChecked(e.props,a)}else if(e.content.type===`tableContent`){let a=fS(e.content,t,n);r=t.nodes[i].createChecked(e.props,a)}else throw new sb(e.content.type);return r}function mS(e){if(e.isText)return e;let t=[];e.forEach(e=>t.push(mS(e)));let n=e.type.isInGroup(`bnBlock`)&&e.attrs.id===null;return e.type.create(n?{...e.attrs,id:Qy.options.generateID()}:e.attrs,dr.from(t),e.marks)}function hS(e,t,n=Pb(t)){let r=e.id;r===void 0&&(r=Qy.options.generateID());let i=[];if(e.children)for(let r of e.children)i.push(hS(r,t,n));if(!e.type||t.nodes[e.type].isInGroup(`blockContent`)){let a=pS(e,t,n),o=i.length>0?hy(t,i):void 0;return t.nodes.blockContainer.createChecked({id:r,...e.props},o?[a,o]:a)}if(my(t.nodes[e.type])){let n=t.nodes[e.type],a={id:r,...e.props},o=n.createAndFill(a,i);if(!o)throw Error(`Cannot create block "${e.type}": its children don't fit its \`children\` config (it accepts \`${n.spec.content}\`).`);return mS(o)}throw Error(`block type ${e.type} doesn't match blockContent or bnBlock group`)}var gS={gray:{text:`#9b9a97`,background:`#ebeced`},brown:{text:`#64473a`,background:`#e9e5e3`},red:{text:`#e03e3e`,background:`#fbe4e4`},orange:{text:`#d9730d`,background:`#f6e9d9`},yellow:{text:`#dfab01`,background:`#fbf3db`},green:{text:`#4d6461`,background:`#ddedea`},blue:{text:`#0b6e99`,background:`#ddebf1`},purple:{text:`#6940a5`,background:`#eae4f2`},pink:{text:`#ad1a72`,background:`#f4dfeb`}},_S={backgroundColor:{default:`default`},textColor:{default:`default`},textAlignment:{default:`left`,values:[`left`,`center`,`right`,`justify`]}},vS=e=>{let t={};return e.hasAttribute(`data-background-color`)?t.backgroundColor=e.getAttribute(`data-background-color`):e.style.backgroundColor&&(t.backgroundColor=e.style.backgroundColor),e.hasAttribute(`data-text-color`)?t.textColor=e.getAttribute(`data-text-color`):e.style.color&&(t.textColor=e.style.color),t.textAlignment=_S.textAlignment.values.includes(e.style.textAlign)?e.style.textAlign:void 0,t},yS=(e,t)=>{e.backgroundColor&&e.backgroundColor!==_S.backgroundColor.default&&(t.style.backgroundColor=e.backgroundColor in gS?gS[e.backgroundColor].background:e.backgroundColor),e.textColor&&e.textColor!==_S.textColor.default&&(t.style.color=e.textColor in gS?gS[e.textColor].text:e.textColor),e.textAlignment&&e.textAlignment!==_S.textAlignment.default&&(t.style.textAlign=e.textAlignment)},bS=(e=`backgroundColor`)=>({default:_S.backgroundColor.default,parseHTML:e=>e.hasAttribute(`data-background-color`)?e.getAttribute(`data-background-color`):e.style.backgroundColor?e.style.backgroundColor:_S.backgroundColor.default,renderHTML:t=>t[e]===_S.backgroundColor.default?{}:{"data-background-color":t[e]}}),xS=(e=`textColor`)=>({default:_S.textColor.default,parseHTML:e=>e.hasAttribute(`data-text-color`)?e.getAttribute(`data-text-color`):e.style.color?e.style.color:_S.textColor.default,renderHTML:t=>t[e]===_S.textColor.default?{}:{"data-text-color":t[e]}}),SS=(e,t)=>{let n=e.querySelector(t);if(n)return{targetElement:n,caption:e.querySelector(`figcaption`)?.textContent??void 0}},CS=w_(({editor:e})=>{let t=T_(void 0);function n(){t.setState(void 0)}return{key:`filePanel`,store:t,mount({signal:t}){let r=e.onChange(n,!1),i=e.onSelectionChange(n,!1);t.addEventListener(`abort`,()=>{r(),i()})},closeMenu:n,showMenu(e){t.setState(e)}}}),wS=(e,t,n)=>{let r=document.createElement(`div`);r.className=`bn-add-file-button`;let i=document.createElement(`div`);i.className=`bn-add-file-button-icon`,n?i.appendChild(n):i.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`,r.appendChild(i);let a=document.createElement(`p`);a.className=`bn-add-file-button-text`,a.innerHTML=e.type in t.dictionary.file_blocks.add_button_text?t.dictionary.file_blocks.add_button_text[e.type]:t.dictionary.file_blocks.add_button_text.file,r.appendChild(a);let o=e=>{e.preventDefault(),e.stopPropagation()},s=()=>{t.isEditable&&t.getExtension(CS)?.showMenu(e.id)};return r.addEventListener(`mousedown`,o,!0),r.addEventListener(`click`,s,!0),{dom:r,destroy:()=>{r.removeEventListener(`mousedown`,o,!0),r.removeEventListener(`click`,s,!0)}}},TS=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8ZM10 4V9H5V20H19V4H10Z"></path></svg>`,ES=e=>{let t=document.createElement(`div`);t.className=`bn-file-name-with-icon`;let n=document.createElement(`div`);n.className=`bn-file-icon`,n.innerHTML=TS,t.appendChild(n);let r=document.createElement(`p`);return r.className=`bn-file-name`,r.textContent=e.props.name,t.appendChild(r),{dom:t}},DS=(e,t,n,r)=>{let i=e.props.url!==``&&!!e.props.caption,a=document.createElement(i?`figure`:`div`);if(a.className=`bn-file-block-content-wrapper`,e.props.url===``){let n=wS(e,t,r);a.appendChild(n.dom);let i=t.onUploadStart(t=>{if(t===e.id){a.removeChild(n.dom);let e=document.createElement(`div`);e.className=`bn-file-loading-preview`,e.textContent=`Loading...`,a.appendChild(e)}});return{dom:a,destroy:()=>{i(),n.destroy()}}}let o={dom:a};if(e.props.showPreview===!1||!n){let t=ES(e);a.appendChild(t.dom),o.destroy=()=>{t.destroy?.()}}else a.appendChild(n.dom);if(e.props.caption){let t=document.createElement(`figcaption`);t.className=`bn-file-caption`,t.textContent=e.props.caption,a.appendChild(t)}return o},OS=(e,t)=>{let n=document.createElement(`figure`),r=document.createElement(`figcaption`);return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},kS=(e,t)=>{let n=document.createElement(`div`),r=document.createElement(`p`);return r.textContent=t,n.appendChild(e),n.appendChild(r),{dom:n}},AS=e=>({url:e.src||void 0}),jS=Sx(e=>({type:`audio`,propSchema:{backgroundColor:_S.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0}},content:`none`})),MS=(e={})=>e=>{if(e.tagName===`AUDIO`){if(e.closest(`figure`))return;let{backgroundColor:t}=vS(e);return{...AS(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=SS(e,`audio`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=vS(e);return{...AS(n),backgroundColor:i,caption:r}}},NS=(e={})=>(t,n)=>{let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 16.0001H5.88889L11.1834 20.3319C11.2727 20.405 11.3846 20.4449 11.5 20.4449C11.7761 20.4449 12 20.2211 12 19.9449V4.05519C12 3.93977 11.9601 3.8279 11.887 3.73857C11.7121 3.52485 11.3971 3.49335 11.1834 3.66821L5.88889 8.00007H2C1.44772 8.00007 1 8.44778 1 9.00007V15.0001C1 15.5524 1.44772 16.0001 2 16.0001ZM23 12C23 15.292 21.5539 18.2463 19.2622 20.2622L17.8445 18.8444C19.7758 17.1937 21 14.7398 21 12C21 9.26016 19.7758 6.80629 17.8445 5.15557L19.2622 3.73779C21.5539 5.75368 23 8.70795 23 12ZM18 12C18 10.0883 17.106 8.38548 15.7133 7.28673L14.2842 8.71584C15.3213 9.43855 16 10.64 16 12C16 13.36 15.3213 14.5614 14.2842 15.2841L15.7133 16.7132C17.106 15.6145 18 13.9116 18 12Z"></path></svg>`;let i=document.createElement(`audio`);return i.className=`bn-audio`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{i.src=e}):i.src=t.props.url,i.controls=!0,i.contentEditable=`false`,i.draggable=!1,DS(t,n,{dom:i},r.firstElementChild)},PS=(e={})=>(e,t)=>{if(!e.props.url)return{dom:document.createElement(`audio`)};let n;return e.props.showPreview?(n=document.createElement(`audio`),n.src=e.props.url):(n=document.createElement(`a`),n.href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?OS(n,e.props.caption):kS(n,e.props.caption):{dom:n}},FS=Cx(jS,e=>({meta:{fileBlockAccept:[`audio/*`]},parse:MS(e),render:NS(e),toExternalHTML:PS(e),runsBefore:[`file`]})),IS=e=>{{if(e.tagName!==`PRE`||e.childElementCount!==1||e.firstElementChild?.tagName!==`CODE`)return;let t=e.firstElementChild;return{language:t.getAttribute(`data-language`)||t.className.split(` `).find(e=>e.startsWith(`language-`))?.replace(`language-`,``)}}},LS=({el:e,schema:t},n)=>{let r=Or.fromSchema(t),i=e.firstElementChild;return r.parse(i,{preserveWhitespace:`full`,topNode:t.nodes[n].create()}).content},RS=e=>{let t=document.createElement(`pre`),n=document.createElement(`code`);return n.className=`language-${e.props.language}`,n.dataset.language=e.props.language,t.appendChild(n),{dom:t,contentDOM:n}};function zS(e,t){let n=t.trim().toLowerCase();return Object.entries(e.supportedLanguages??{}).find(([e,{aliases:t}])=>e.toLowerCase()===n||t?.some(e=>e.toLowerCase()===n))?.[0]}var BS=e=>(t,n)=>w_({key:t,keyboardShortcuts:{Delete:({editor:e})=>e.transact(t=>{let{block:r}=e.getTextCursorPosition();if(r.type!==n)return!1;let{$from:i}=t.selection;return!i.parent.textContent&&(e.removeBlocks([r]),!0)}),Tab:({editor:t})=>e.indentLineWithTab!==!1&&t.transact(e=>{let{block:r}=t.getTextCursorPosition();return r.type===n&&(e.insertText(` `),!0)}),Enter:({editor:e})=>e.transact(t=>{let{block:r,nextBlock:i}=e.getTextCursorPosition();if(r.type!==n)return!1;let{$from:a}=t.selection,o=a.parentOffset===a.parent.nodeSize-2,s=a.parent.textContent.endsWith(`
132
-
133
- `);if(o&&s){if(t.delete(a.pos-2,a.pos),i)return e.setTextCursorPosition(i,`start`),!0;let[n]=e.insertBlocks([{type:`paragraph`}],r,`after`);return e.setTextCursorPosition(n,`start`),!0}return t.insertText(`
134
- `),!0}),"Shift-Enter":({editor:e})=>e.transact(()=>{let{block:t}=e.getTextCursorPosition();if(t.type!==n)return!1;let[r]=e.insertBlocks([{type:`paragraph`}],t,`after`);return e.setTextCursorPosition(r,`start`),!0})},inputRules:[{find:/^```(.*?)\s$/,replace:({match:t})=>{let r=t[1].trim();return{type:n,props:{language:{language:zS(e,r)??(r||e.defaultLanguage||`text`)}.language},content:[]}}}]}),VS=(e,t,n,r)=>{if(!(n in r))throw Error(`Language ${n} is not supported.`);let i=document.createElement(`select`);Object.entries(r).forEach(([e,{name:t}])=>{let n=document.createElement(`option`);n.value=e,n.text=t,i.appendChild(n)}),i.value=n;let a=n=>{t.isEditable&&t.updateBlock(e.id,{props:{language:n.target.value}})};t.isEditable?i.addEventListener(`change`,a):i.disabled=!0;let o=document.createElement(`div`);return o.contentEditable=`false`,o.appendChild(i),{dom:o,destroy:()=>i.removeEventListener(`change`,a)}},HS=(e,t,n)=>{let r=document.createElement(`pre`),i=document.createElement(`code`);r.appendChild(i);let a=document.createDocumentFragment(),o;return n&&Object.keys(n.supportedLanguages).length>1&&(o=VS(e,t,n.selectedLanguage,n.supportedLanguages),a.appendChild(o.dom)),a.appendChild(r),{dom:a,contentDOM:i,destroy:()=>{o?.destroy()}}},US=`code-block-keyboard-shortcuts`,WS=Cx(Sx(({defaultLanguage:e=`text`})=>({type:`codeBlock`,propSchema:{language:{default:e}},content:`plain`})),e=>({meta:{code:!0,defining:!0,isolating:!1,highlight:e=>e.props.language},parse:e=>IS(e),parseContent:e=>LS(e,`codeBlock`),render:(t,n)=>HS(t,n,e.supportedLanguages&&{selectedLanguage:t.props.language,supportedLanguages:e.supportedLanguages}),toExternalHTML:e=>RS(e)}),e=>[BS(e)(US,`codeBlock`)]),GS=Cx(Sx(()=>({type:`divider`,propSchema:{},content:`none`})),{meta:{isolating:!1},parse(e){if(e.tagName===`HR`)return{}},render(){return{dom:document.createElement(`hr`)}}},[w_({key:`divider-block-shortcuts`,inputRules:[{find:RegExp(`^---$`),replace(){return{type:`divider`,props:{},content:[]}}}]})]),KS=e=>({url:e.src||void 0}),qS=Cx(Sx(()=>({type:`file`,propSchema:{backgroundColor:_S.backgroundColor,name:{default:``},url:{default:``},caption:{default:``}},content:`none`})),{meta:{fileBlockAccept:[`*/*`]},parse:e=>{if(e.tagName===`EMBED`){if(e.closest(`figure`))return;let{backgroundColor:t}=vS(e);return{...KS(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=SS(e,`embed`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=vS(e);return{...KS(n),backgroundColor:i,caption:r}}},render(e,t){return DS(e,t)},toExternalHTML(e){if(!e.props.url)return{dom:document.createElement(`embed`)};let t=document.createElement(`a`);return t.href=e.props.url,t.textContent=e.props.name||e.props.url,e.props.caption?kS(t,e.props.caption):{dom:t}}});function JS(e,t,n){let r=Or.fromSchema(t),i=e.querySelector(`:scope > summary`),a;if(i){let e=i.cloneNode(!0);_b(e),a=r.parse(e,{topNode:t.nodes.paragraph.create(),preserveWhitespace:!0}).content}else a=dr.empty;let o=document.createElement(`div`);o.setAttribute(`data-node-type`,`blockGroup`);let s=!1;for(let t of Array.from(e.childNodes))t.tagName!==`SUMMARY`&&(t.nodeType!==3||t.textContent?.trim())&&(s=!0,o.appendChild(t.cloneNode(!0)));let c=t.nodes[n].create({},a);if(!s)return c.content;let l=r.parse(o,{topNode:t.nodes.blockGroup.create()});return l.content.size>0?c.content.addToEnd(l):c.content}var YS={set:(e,t)=>window.localStorage.setItem(`toggle-${e.id}`,t?`true`:`false`),get:e=>window.localStorage.getItem(`toggle-${e.id}`)===`true`},XS=`<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="CURRENTCOLOR"><path d="M320-200v-560l440 280-440 280Z"/></svg>`;function ZS(e){return YS.get(e)}function QS(e,t,n=YS){let r=document.createElement(`div`);r.className=`bn-toggle-wrapper bn-toggle-frame`;let i=document.createElement(`button`);i.className=`bn-toggle-button`,i.type=`button`,i.setAttribute(`aria-label`,t.dictionary.toggle_blocks.toggle_button),i.innerHTML=XS,i.addEventListener(`mousedown`,e=>e.preventDefault());let a=document.createElement(`div`);a.className=`bn-toggle-slot`;let o=document.createElement(`button`);o.className=`bn-toggle-add-block-button`,o.type=`button`,o.textContent=t.dictionary.toggle_blocks.add_block_button,o.addEventListener(`mousedown`,e=>e.preventDefault()),o.addEventListener(`click`,()=>{t.transact(()=>{let n=t.updateBlock(e.id,{children:[{}]});t.setTextCursorPosition(n.children[0],`end`),t.focus()})}),r.append(i,a);let s=e.children.length,c=n.get(e);function l(){i.setAttribute(`aria-expanded`,String(c));let e=c&&s===0&&t.isEditable;e&&!o.isConnected?r.append(o):e||o.remove()}return i.addEventListener(`click`,()=>{c=!c,n.set(e,c),l()}),l(),{dom:r,slot:a,update(e){let t=e.children.length,r=c;return t>s&&(c=!0),c!==r&&n.set(e,c),s=t,l(),!0}}}var $S=[1,2,3,4,5,6];function eC(e,t){return t?{level:e,isToggleable:!1}:{level:e}}var tC=(e,t)=>({editor:n})=>{let r=n.getTextCursorPosition();return n.schema.blockSchema[r.block.type].content===`inline`&&(n.updateBlock(r.block,{type:`heading`,props:eC(e,t)}),!0)},nC=Cx(Sx(({defaultLevel:e=1,levels:t=$S,allowToggleHeadings:n=!0}={})=>({type:`heading`,propSchema:{..._S,level:{default:e,values:t},...n?{isToggleable:{default:!1,optional:!0}}:{}},content:`inline`})),({allowToggleHeadings:e=!0}={})=>({meta:{isolating:!1,dropsIntoChildren:t=>e&&t.props.isToggleable===!0},experimental_keyboard:e?e=>{if(!e.props.isToggleable)return{};let t=ZS(e);return{resetsTo:{type:`heading`,props:{isToggleable:!1}},emptyEnterResets:!0,enter:t?`into-children`:`split`,splitKeepsChildren:!t,emptyChildEnter:t?`stay`:`outdent`}}:void 0,parse(t){if(e&&t.tagName===`DETAILS`){let e=t.querySelector(`:scope > summary`);if(!e)return;let n=e.querySelector(`h1, h2, h3, h4, h5, h6`);return n?{...vS(n),level:parseInt(n.tagName[1]),isToggleable:!0}:void 0}let n;switch(t.tagName){case`H1`:n=1;break;case`H2`:n=2;break;case`H3`:n=3;break;case`H4`:n=4;break;case`H5`:n=5;break;case`H6`:n=6;break;default:return}return{...vS(t),level:n}},...e?{parseContent:({el:e,schema:t})=>{if(e.tagName===`DETAILS`)return JS(e,t,`heading`)}}:{},runsBefore:[`toggleListItem`],render(e){let t=document.createElement(`h${e.props.level}`);return{dom:t,contentDOM:t}},renderFrame(t,n){if(!e||!t.props.isToggleable)return;let r=QS(t,n);return{...r,update:e=>!!e.props.isToggleable&&r.update(e)}},toExternalHTML(t){let n=document.createElement(`h${t.props.level}`);if(yS(t.props,n),e&&t.props.isToggleable){let e=document.createElement(`details`);e.setAttribute(`open`,``);let t=document.createElement(`summary`);return t.appendChild(n),e.appendChild(t),{dom:e,contentDOM:n,childrenDOM:e}}return{dom:n,contentDOM:n}}}),({levels:e=$S,allowToggleHeadings:t=!0}={})=>[w_({key:`heading-shortcuts`,keyboardShortcuts:Object.fromEntries(e.map(e=>[`Mod-Alt-${e}`,tC(e,t)])??[]),inputRules:e.map(e=>({find:RegExp(`^(#{${e}})\\s$`),replace({match:e}){return{type:`heading`,props:eC(e[1].length,t)}}}))})]),rC=(e,t,n,r,i)=>{let{dom:a,destroy:o}=DS(e,t,n,i),s=a;s.style.position=`relative`,e.props.url&&e.props.showPreview&&(e.props.previewWidth?s.style.width=`${e.props.previewWidth}px`:s.style.width=`fit-content`);let c=document.createElement(`div`);c.className=`bn-resize-handle`,c.style.left=`4px`,c.style.display=`none`,r.appendChild(c);let l=document.createElement(`div`);l.className=`bn-resize-handle`,l.style.right=`4px`,l.style.display=`none`,r.appendChild(l);let u=document.createElement(`div`);u.style.position=`absolute`,u.style.height=`100%`,u.style.width=`100%`;let d,f=e.props.previewWidth,p=n=>{if(!d){t.isEditable||(c.style.display=`none`,l.style.display=`none`);return}let r,i=`touches`in n?n.touches[0].clientX:n.clientX;r=e.props.textAlignment===`center`?d.handleUsed===`left`?d.initialWidth+(d.initialClientX-i)*2:d.initialWidth+(i-d.initialClientX)*2:d.handleUsed===`left`?d.initialWidth+d.initialClientX-i:d.initialWidth+i-d.initialClientX,f=Math.min(Math.max(r,64),t.domElement?.firstElementChild?.clientWidth||Number.MAX_VALUE),s.style.width=`${f}px`},m=n=>{n.target&&s.contains(n.target)&&t.isEditable||(c.style.display=`none`,l.style.display=`none`),d&&(d=void 0,s.contains(u)&&s.removeChild(u),t.updateBlock(e,{props:{previewWidth:f}}))},h=()=>{t.isEditable&&(c.style.display=``,l.style.display=``)},g=e=>{e.relatedTarget!==c&&e.relatedTarget!==l&&(d||t.isEditable&&(c.style.display=`none`,l.style.display=`none`))},_=e=>{e.preventDefault(),s.contains(u)||s.appendChild(u);let t=`touches`in e?e.touches[0].clientX:e.clientX;d={handleUsed:`left`,initialWidth:s.clientWidth,initialClientX:t}},v=e=>{e.preventDefault(),s.contains(u)||s.appendChild(u);let t=`touches`in e?e.touches[0].clientX:e.clientX;d={handleUsed:`right`,initialWidth:s.clientWidth,initialClientX:t}};return window.addEventListener(`mousemove`,p),window.addEventListener(`touchmove`,p),window.addEventListener(`mouseup`,m),window.addEventListener(`touchend`,m),s.addEventListener(`mouseenter`,h),s.addEventListener(`mouseleave`,g),c.addEventListener(`mousedown`,_),c.addEventListener(`touchstart`,_),l.addEventListener(`mousedown`,v),l.addEventListener(`touchstart`,v),{dom:s,destroy:()=>{o?.(),window.removeEventListener(`mousemove`,p),window.removeEventListener(`touchmove`,p),window.removeEventListener(`mouseup`,m),window.removeEventListener(`touchend`,m),s.removeEventListener(`mouseenter`,h),s.removeEventListener(`mouseleave`,g),c.removeEventListener(`mousedown`,_),c.removeEventListener(`touchstart`,_),l.removeEventListener(`mousedown`,v),l.removeEventListener(`touchstart`,v)}}},iC=e=>({url:e.src||void 0,previewWidth:e.width||void 0,name:e.alt||void 0}),aC=Sx((e={})=>({type:`image`,propSchema:{textAlignment:_S.textAlignment,backgroundColor:_S.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0},previewWidth:{default:void 0,type:`number`}},content:`none`})),oC=(e={})=>e=>{if(e.tagName===`IMG`){if(e.closest(`figure`))return;let{backgroundColor:t}=vS(e);return{...iC(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=SS(e,`img`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=vS(e);return{...iC(n),backgroundColor:i,caption:r}}},sC=(e={})=>(t,n)=>{let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 11.1005L7 9.1005L12.5 14.6005L16 11.1005L19 14.1005V5H5V11.1005ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10Z"></path></svg>`;let i=document.createElement(`div`);i.className=`bn-visual-media-wrapper`;let a=document.createElement(`img`);return a.className=`bn-visual-media`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{a.src=e}):a.src=t.props.url,a.alt=t.props.name||``,a.contentEditable=`false`,a.draggable=!1,t.props.previewWidth&&(a.width=t.props.previewWidth),i.appendChild(a),rC(t,n,{dom:i},i,r.firstElementChild)},cC=(e={})=>(e,t)=>{if(!e.props.url)return{dom:document.createElement(`img`)};let n;return e.props.showPreview?(n=document.createElement(`img`),n.src=e.props.url,n.alt=e.props.name||``,e.props.previewWidth&&(n.width=e.props.previewWidth)):(n=document.createElement(`a`),n.href=e.props.url,n.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?OS(n,e.props.caption):kS(n,e.props.caption):{dom:n}},lC=Cx(aC,e=>({meta:{fileBlockAccept:[`image/*`]},parse:oC(e),render:sC(e),toExternalHTML:cC(e),runsBefore:[`file`]}));function uC(e,t,n){let r=Or.fromSchema(t),i=e,a=document.createElement(`div`);a.setAttribute(`data-node-type`,`blockGroup`);for(let e of Array.from(i.childNodes))a.appendChild(e.cloneNode(!0));let o=r.parse(a,{topNode:t.nodes.blockGroup.create()});o.firstChild?.firstChild?.type.name===`checkListItem`&&(o=o.copy(o.content.cut(o.firstChild.firstChild.nodeSize+2)));let s=o.firstChild?.firstChild;if(!s?.isTextblock)return dr.from(o);let c=t.nodes[n].create({},s.content),l=o.content.cut(s.nodeSize+2);if(l.size>0){let e=o.copy(l);return c.content.addToEnd(e)}return c.content}var dC=Cx(Sx(()=>({type:`bulletListItem`,propSchema:{..._S},content:`inline`})),{experimental_keyboard:{splitKeepsType:!0,emptyEnterResets:!0},meta:{isolating:!1},parse(e){if(e.tagName!==`LI`)return;let t=e.parentElement;if(t===null||t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`||!e.closest(`ul, ol`))return vS(e)},parseContent:({el:e,schema:t})=>uC(e,t,`bulletListItem`),render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`p`);return yS(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[w_({key:`bullet-list-item-shortcuts`,keyboardShortcuts:{"Mod-Shift-8":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`bulletListItem`,props:{}}),!0)}},inputRules:[{find:/^\s?[-+*]\s$/,replace({editor:e}){if(Py(e.prosemirrorState).blockNoteType!==`heading`)return{type:`bulletListItem`,props:{}}}}]})]),fC=Cx(Sx(()=>({type:`checkListItem`,propSchema:{..._S,checked:{default:!1,type:`boolean`}},content:`inline`})),{experimental_keyboard:{splitKeepsType:!0,emptyEnterResets:!0},meta:{isolating:!1},parse(e){if(e.tagName===`input`)return e.closest(`[data-content-type]`)||e.closest(`li`)?void 0:e.type===`checkbox`?{checked:e.checked}:void 0;if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`)){let t=e.querySelector(`input[type=checkbox]`)||null;return t===null?void 0:{...vS(e),checked:t.checked}}},parseContent:({el:e,schema:t})=>uC(e,t,`checkListItem`),render(e,t){let n=document.createDocumentFragment(),r=document.createElement(`input`);r.type=`checkbox`,r.checked=e.props.checked,e.props.checked&&r.setAttribute(`checked`,``),r.disabled=!t.isEditable,r.addEventListener(`change`,()=>{t.isEditable&&t.updateBlock(e,{props:{checked:!e.props.checked}})});let i=document.createElement(`p`),a=document.createElement(`div`);return a.contentEditable=`false`,a.appendChild(r),n.appendChild(a),n.appendChild(i),{dom:n,contentDOM:i}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`input`);n.type=`checkbox`,n.checked=e.props.checked,e.props.checked&&n.setAttribute(`checked`,``);let r=document.createElement(`p`);return yS(e.props,t),t.appendChild(n),t.appendChild(r),{dom:t,contentDOM:r}},runsBefore:[`bulletListItem`]},[w_({key:`check-list-item-shortcuts`,keyboardShortcuts:{"Mod-Shift-9":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`checkListItem`,props:{}}),!0)}},inputRules:[{find:/^\s?\[\s*\]\s$/,replace(){return{type:`checkListItem`,props:{checked:!1}}}},{find:/^\s?\[[Xx]\]\s$/,replace(){return{type:`checkListItem`,props:{checked:!0}}}}]})]);function pC(e,t,n,r){let i=!!e.firstChild.attrs.start,a=jy(e,t);if(!a.hasContent)throw Error(`impossible`);let o=n.doc.resolve(a.block.beforePos).nodeBefore,s=o?r.get(o):void 0;if(s!==void 0){let t=s+1;return r.set(e,t),{index:t,isFirst:!1,hasStart:i}}let c=[{node:e,pos:t}],l=o,u=a.block.beforePos;for(;l&&r.get(l)===void 0;){let e=jy(l,u-l.nodeSize);if(e.blockNoteType!==`numberedListItem`)break;c.push({node:l,pos:u-l.nodeSize});let t=n.doc.resolve(e.block.beforePos).nodeBefore;u=e.block.beforePos,l=t}let d,f,p=c[c.length-1],m=jy(p.node,p.pos);if(!m.hasContent)throw Error(`impossible`);let h=n.doc.resolve(m.block.beforePos).nodeBefore,g=h?r.get(h):void 0;g===void 0?(d=(p.node.firstChild.attrs.start||1)-1,f=!0):(d=g,f=!1);for(let e=c.length-1;e>=0;e--){let t=c[e];f&&e<c.length-1&&(f=!1),d++,r.set(t.node,d)}return{index:d,isFirst:c.length===1?f||g===void 0:!1,hasStart:i}}function mC(e,t){let n=new Map,r=t.decorations.map(e.mapping,e.doc),i=e.changedRange()??{from:0,to:e.doc.nodeSize-2},a=[],o=new Set;e.doc.nodesBetween(i.from,e.doc.nodeSize-2,(t,s,c)=>{if(c&&o.has(c))return!1;if(t.type.name===`blockContainer`&&t.firstChild.type.name===`numberedListItem`){let{index:l,isFirst:u,hasStart:d}=pC(t,s,e,n),f=e.doc.nodeAt(s+1);if(r.find(s+1,s+1+f.nodeSize,e=>e.index===l&&e.isFirst===u&&e.hasStart===d).length===0)a.push(Er.node(s+1,s+1+f.nodeSize,{"data-index":l.toString()},{index:l,isFirst:u,hasStart:d}));else if(s>=i.to&&c)return o.add(c),!1}});let s=a.flatMap(e=>r.find(e.from,e.to));return{decorations:r.remove(s).add(e.doc,a)}}var hC=Cx(Sx(()=>({type:`numberedListItem`,propSchema:{..._S,start:{default:void 0,type:`number`}},content:`inline`})),{experimental_keyboard:{splitKeepsType:!0,emptyEnterResets:!0},meta:{isolating:!1},parse(e){if(e.tagName!==`LI`)return;let t=e.parentElement;if(t!==null&&(t.tagName===`OL`||t.tagName===`DIV`&&t.parentElement?.tagName===`OL`)){let n=parseInt(t.getAttribute(`start`)||`1`),r=vS(e);return e.previousElementSibling||n===1?r:{...r,start:n}}},parseContent:({el:e,schema:t})=>uC(e,t,`numberedListItem`),render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`p`);return yS(e.props,t),t.appendChild(n),{dom:t,contentDOM:n}}},[w_({key:`numbered-list-item-shortcuts`,inputRules:[{find:/^\s?(\d+)\.\s$/,replace({match:e,editor:t}){if(Py(t.prosemirrorState).blockNoteType===`heading`)return;let n=parseInt(e[1]);return{type:`numberedListItem`,props:{start:n===1?void 0:n}}}}],keyboardShortcuts:{"Mod-Shift-7":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`numberedListItem`,props:{}}),!0)}},prosemirrorPlugins:[new Tr({key:new hr(`numbered-list-indexing-decorations`),state:{init(e,t){return mC(t.tr,{decorations:Cr.empty})},apply(e,t){return!e.docChanged&&t.decorations?t:mC(e,t)}},props:{decorations(e){return this.getState(e)?.decorations??Cr.empty}}})]})]),gC=Cx(Sx(()=>({type:`toggleListItem`,propSchema:{..._S},content:`inline`})),{experimental_keyboard:e=>{let t=ZS(e);return{splitKeepsType:!0,emptyEnterResets:!0,enter:t?`into-children`:`split`,splitKeepsChildren:!t,emptyChildEnter:t?`stay`:`outdent`}},meta:{isolating:!1,dropsIntoChildren:()=>!0},parse(e){if(e.tagName===`DETAILS`)return vS(e);if(e.tagName===`LI`){let t=e.parentElement;if(t&&(t.tagName===`UL`||t.tagName===`DIV`&&t.parentElement?.tagName===`UL`)&&e.querySelector(`:scope > details`))return vS(e)}},parseContent:({el:e,schema:t})=>{let n=e.tagName===`DETAILS`?e:e.querySelector(`:scope > details`);if(!n)throw Error(`No details found in toggleListItem parseContent`);return JS(n,t,`toggleListItem`)},runsBefore:[`bulletListItem`],render(){let e=document.createElement(`p`);return{dom:e,contentDOM:e}},renderFrame:QS,toExternalHTML(e){let t=document.createElement(`li`),n=document.createElement(`details`);n.setAttribute(`open`,``);let r=document.createElement(`summary`),i=document.createElement(`p`);return r.appendChild(i),n.appendChild(r),yS(e.props,t),t.appendChild(n),{dom:t,contentDOM:i,childrenDOM:n}}},[w_({key:`toggle-list-item-shortcuts`,keyboardShortcuts:{"Mod-Shift-6":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`toggleListItem`,props:{}}),!0)}}})]),_C=Cx(Sx(()=>({type:`paragraph`,propSchema:_S,content:`inline`})),{meta:{isolating:!1},parse:e=>{if(e.tagName===`P`&&e.textContent?.trim())return vS(e)},render:()=>{let e=document.createElement(`p`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`p`);return yS(e.props,t),{dom:t,contentDOM:t}},runsBefore:[`default`,`heading`]},[w_({key:`paragraph-shortcuts`,keyboardShortcuts:{"Mod-Alt-0":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`paragraph`,props:{}}),!0)}}})]),vC=Cx(Sx(()=>({type:`quote`,propSchema:{backgroundColor:_S.backgroundColor,textColor:_S.textColor},content:`inline`})),{meta:{isolating:!1},parse(e){if(e.tagName===`BLOCKQUOTE`){let{backgroundColor:t,textColor:n}=vS(e);return{backgroundColor:t,textColor:n}}},render(){let e=document.createElement(`blockquote`);return{dom:e,contentDOM:e}},toExternalHTML(e){let t=document.createElement(`blockquote`);return yS(e.props,t),{dom:t,contentDOM:t}}},[w_({key:`quote-block-shortcuts`,keyboardShortcuts:{"Mod-Alt-q":({editor:e})=>{let t=e.getTextCursorPosition();return e.schema.blockSchema[t.block.type].content===`inline`&&(e.updateBlock(t.block,{type:`quote`,props:{}}),!0)}},inputRules:[{find:RegExp(`^>\\s$`),replace(){return{type:`quote`,props:{}}}},{find:RegExp(`^\\p{Quotation_Mark}\\s$`,`u`),replace(){return{type:`quote`,props:{}}}}]})]),yC=dt.create({name:`BlockNoteTableExtension`,addProseMirrorPlugins:()=>[Zv({cellMinWidth:35,defaultCellMinWidth:120,View:null}),dy()],addKeyboardShortcuts(){return{Enter:()=>V_(this.editor.state)?this.editor.commands.command(({state:e,dispatch:t})=>{let n=H_(e),r=n?q_(n,`vert`,1):null;return r&&t&&t(e.tr.setSelection(gr.between(r,G_(r))).scrollIntoView()),!0}):!1,Backspace:()=>{let e=this.editor.state.selection,t=e.empty,n=e.$head.parentOffset===0,r=e.$head.node().type.name===`tableParagraph`;return t&&n&&r},Tab:()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>V_(e)?(Ov(1)(e,t,n),!0):!1),"Shift-Tab":()=>this.editor.commands.command(({state:e,dispatch:t,view:n})=>V_(e)?(Ov(-1)(e,t,n),!0):!1)}},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{tableRole:Xe(pt(e,`tableRole`,t))}}}),bC={textColor:_S.textColor},xC=st.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`tableContent+`,marks(){return yb(this.editor)},addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getContent:(e,t)=>EC(e,t)}]},renderHTML({HTMLAttributes:e}){return[`th`,kt(this.options.HTMLAttributes,e),0]}}),SC=st.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`tableContent+`,marks(){return yb(this.editor)},addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}}}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getContent:(e,t)=>EC(e,t)}]},renderHTML({HTMLAttributes:e}){return[`td`,kt(this.options.HTMLAttributes,e),0]}}),CC=st.create({name:`table`,content:`tableRow+`,group:`blockContent`,tableRole:`table`,marks(){return yb(this.editor)},isolating:!0,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let n=hb(this.name,`table`,{...this.options.domAttributes?.blockContent||{},...t},this.options.domAttributes?.inlineContent||{}),r=document.createElement(`colgroup`);for(let t of e.children[0].children)if(t.attrs.colwidth)for(let e of t.attrs.colwidth){let t=document.createElement(`col`);e&&(t.style=`width: ${e}px`),r.appendChild(t)}else r.appendChild(document.createElement(`col`));return n.dom.firstChild?.appendChild(r),n},addNodeView(){return({node:e,HTMLAttributes:t})=>{class n extends Jv{node;cellMinWidth;blockContentHTMLAttributes;constructor(e,t,n){super(e,t),this.node=e,this.cellMinWidth=t,this.blockContentHTMLAttributes=n;let r=document.createElement(`div`);r.className=db(`bn-block-content`,n.class),r.setAttribute(`data-content-type`,`table`);for(let[e,t]of Object.entries(n))e!==`class`&&r.setAttribute(e,t);let i=this.dom,a=document.createElement(`div`);a.className=`tableWrapper-inner`,a.appendChild(i.firstChild),i.appendChild(a),r.appendChild(i);let o=document.createElement(`div`);o.className=`table-widgets-container`,o.style.position=`relative`,i.appendChild(o),this.dom=r}ignoreMutation(e){return!e.target.closest(`.tableWrapper-inner`)||super.ignoreMutation(e)}update(e){return super.update(e)?(Ob(this.dom,e.attrs,bC),!0):!1}}return new n(e,120,{...this.options.domAttributes?.blockContent||{},...t})}}}),wC=st.create({name:`tableParagraph`,group:`tableContent`,content:`inline*`,parseHTML(){return[{tag:`p`,getAttrs:e=>{if(typeof e==`string`||!e.textContent||!e.closest(`[data-content-type]`))return!1;let t=e.parentElement;return t===null?!1:t.tagName===`TD`||t.tagName===`TH`?{}:!1},node:`tableParagraph`}]},renderHTML({HTMLAttributes:e}){return[`p`,e,0]}}),TC=st.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)+`,tableRole:`row`,marks(){return yb(this.editor)},parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,kt(this.options.HTMLAttributes,e),0]}});function EC(e,t){let n=Or.fromSchema(t).parse(e,{topNode:t.nodes.blockGroup.create()}),r=[];return n.content.descendants(e=>{if(e.isInline)return r.push(e),!1}),dr.fromArray(r)}var DC=()=>fx({node:CC,type:`table`,content:`table`},bC,[w_({key:`table-extensions`,tiptapExtensions:[yC,wC,xC,SC,TC]}),w_({key:`table-keyboard-delete`,keyboardShortcuts:{Backspace:({editor:e})=>{if(!(e.prosemirrorState.selection instanceof Z_))return!1;let t=e.getTextCursorPosition().block,n=t.content,r=0;for(let e of n.rows)for(let t of e.cells){if(`type`in t&&t.content.length>0||!(`type`in t)&&t.length>0)return!1;r++}let i=0;return e.prosemirrorState.selection.forEachCell(()=>{i++}),i<r?!1:(e.transact(()=>{(e.getPrevBlock(t)||e.getNextBlock(t))&&e.setTextCursorPosition(t),e.removeBlocks([t])}),!0)}}})]),OC=e=>({url:e.src||void 0,previewWidth:e.width||void 0,name:e.getAttribute(`data-name`)||void 0}),kC=Sx(e=>({type:`video`,propSchema:{textAlignment:_S.textAlignment,backgroundColor:_S.backgroundColor,name:{default:``},url:{default:``},caption:{default:``},showPreview:{default:!0},previewWidth:{default:void 0,type:`number`}},content:`none`})),AC=e=>e=>{if(e.tagName===`VIDEO`){if(e.closest(`figure`))return;let{backgroundColor:t}=vS(e);return{...OC(e),backgroundColor:t}}if(e.tagName===`FIGURE`){let t=SS(e,`video`);if(!t)return;let{targetElement:n,caption:r}=t,{backgroundColor:i}=vS(e);return{...OC(n),backgroundColor:i,caption:r}}},jC=Cx(kC,e=>({meta:{fileBlockAccept:[`video/*`]},parse:AC(e),render(t,n){let r=document.createElement(`div`);r.innerHTML=e.icon??`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM8 5V19H16V5H8ZM4 5V7H6V5H4ZM18 5V7H20V5H18ZM4 9V11H6V9H4ZM18 9V11H20V9H18ZM4 13V15H6V13H4ZM18 13V15H20V13H18ZM4 17V19H6V17H4ZM18 17V19H20V17H18Z"></path></svg>`;let i=document.createElement(`div`);i.className=`bn-visual-media-wrapper`;let a=document.createElement(`video`);return a.className=`bn-visual-media`,n.resolveFileUrl?n.resolveFileUrl(t.props.url).then(e=>{a.src=e}):a.src=t.props.url,a.controls=!0,a.contentEditable=`false`,a.draggable=!1,t.props.previewWidth&&(a.width=t.props.previewWidth),i.appendChild(a),rC(t,n,{dom:i},i,r.firstElementChild)},toExternalHTML(e){if(!e.props.url)return{dom:document.createElement(`video`)};let t;return e.props.showPreview?(t=document.createElement(`video`),t.src=e.props.url,e.props.previewWidth&&(t.width=e.props.previewWidth)):(t=document.createElement(`a`),t.href=e.props.url,t.textContent=e.props.name||e.props.url),e.props.caption?e.props.showPreview?OS(t,e.props.caption):kS(t,e.props.caption):{dom:t}},runsBefore:[`file`]}));function MC(e,t,n){if(!(t in e.schema.blockSpecs))return!1;if(!n)return!0;for(let[r,i]of Object.entries(n)){if(!(r in e.schema.blockSpecs[t].config.propSchema))return!1;if(typeof i==`string`){if(e.schema.blockSpecs[t].config.propSchema[r].default!==void 0&&typeof e.schema.blockSpecs[t].config.propSchema[r].default!==i||e.schema.blockSpecs[t].config.propSchema[r].type!==void 0&&e.schema.blockSpecs[t].config.propSchema[r].type!==i)return!1}else{if(e.schema.blockSpecs[t].config.propSchema[r].default!==i.default||e.schema.blockSpecs[t].config.propSchema[r].default===void 0&&i.default===void 0&&e.schema.blockSpecs[t].config.propSchema[r].type!==i.type||typeof e.schema.blockSpecs[t].config.propSchema[r].values!=typeof i.values)return!1;if(typeof e.schema.blockSpecs[t].config.propSchema[r].values==`object`&&typeof i.values==`object`){for(let n of i.values)if(!e.schema.blockSpecs[t].config.propSchema[r].values.includes(n))return!1}}}return!0}function NC(e,t,n,r){return MC(t,n,r)&&e.type===n}function PC(e){return e instanceof Z_}function FC(e){let t=e.type.spec.tableRole;return t===`cell`||t===`header_cell`}var IC={1:`heading`,2:`heading_2`,3:`heading_3`,4:`heading_4`,5:`heading_5`,6:`heading_6`},LC={1:`toggle_heading`,2:`toggle_heading_2`,3:`toggle_heading_3`};function RC(e){let t=[];if(MC(e,`paragraph`)&&t.push({key:`paragraph`,type:`paragraph`}),MC(e,`heading`,{level:`number`})){let n=e.schema.blockSchema.heading.propSchema.level.values,r=MC(e,`heading`,{level:`number`,isToggleable:`boolean`});for(let e of[1,2,3,4,5,6])n?.includes(e)&&t.push({key:IC[e],type:`heading`,props:r?{level:e,isToggleable:!1}:{level:e}});if(r)for(let e of[1,2,3])n?.includes(e)&&t.push({key:LC[e],type:`heading`,props:{level:e,isToggleable:!0}})}for(let[n,r]of[[`quote`,`quote`],[`toggle_list`,`toggleListItem`],[`bullet_list`,`bulletListItem`],[`numbered_list`,`numberedListItem`],[`check_list`,`checkListItem`]])MC(e,r)&&t.push({key:n,type:r});return t}var zC=w_(({editor:e})=>{let t=T_(!1),n=()=>e.transact(e=>{if(e.selection.empty||e.selection instanceof gr&&e.doc.textBetween(e.selection.from,e.selection.to).length===0)return!1;let t=!1;return e.selection.content().content.descendants(e=>(e.type.spec.content===`text*`&&(t=!0),!t)),!t});return{key:`formattingToolbar`,store:t,mount({dom:r,signal:i}){let a=!1,o=!1,s=e.onChange(()=>{a||o||t.setState(n())}),c=e.onSelectionChange(()=>{a||o||t.setState(n())}),l=e.onFocusChange((r,{focused:i})=>{i?a||o||e.isFocused()&&t.setState(n()):t.setState(!1)},{includeEditorUI:!0});r.addEventListener(`pointerdown`,()=>{a=!0,t.setState(!1)},{signal:i}),e.prosemirrorView.root.addEventListener(`pointerup`,()=>{a=!1,e.isFocused()&&t.setState(n())},{signal:i,capture:!0}),r.addEventListener(`pointercancel`,()=>{a=!0},{signal:i,capture:!0}),e.prosemirrorView.root.addEventListener(`dragstart`,()=>{o=!0,t.setState(!1)},{signal:i}),e.prosemirrorView.root.addEventListener(`dragend`,()=>{o=!1},{signal:i}),i.addEventListener(`abort`,()=>{s(),c(),l()})}}});function BC(e,t,n=`left`){let r=e.getExtension(`yPositionMapping`);if(r)return r.mapPosition(t,n);let i=e.getExtension(`positionMapping`);if(i)return i.mapPosition(t,n);throw Error(`No position mapping extension found`)}var VC=nt(e=>e.type.name===`blockContainer`),HC=class{editor;state;emitUpdate;rootEl;pluginState;constructor(e,t,n){this.editor=e,this.pluginState=void 0,this.emitUpdate=e=>{if(!this.state)throw Error(`Attempting to update uninitialized suggestions menu`);t(e,{...this.state,ignoreQueryLength:this.pluginState?.ignoreQueryLength})},this.rootEl=n.root,this.rootEl?.addEventListener(`scroll`,this.handleScroll,!0)}handleScroll=e=>{if(this.state?.show){let t=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);if(!t||e.target instanceof Node&&!e.target.contains(t))return;this.state.referencePos=t.getBoundingClientRect().toJSON(),this.emitUpdate(this.pluginState.triggerCharacter)}};update(e,t){let n=UC.getState(t),r=UC.getState(e.state),i=n===void 0&&r!==void 0,a=n!==void 0&&r===void 0;if(!i&&(n===void 0||r===void 0)&&!a)return;if(this.pluginState=a?n:r,a||!this.editor.isEditable){this.state&&(this.state.show=!1),this.emitUpdate(this.pluginState.triggerCharacter);return}let o=this.rootEl?.querySelector(`[data-decoration-id="${this.pluginState.decorationId}"]`);this.editor.isEditable&&o&&(this.state={show:!0,referencePos:o.getBoundingClientRect().toJSON(),query:this.pluginState.query},this.emitUpdate(this.pluginState.triggerCharacter))}destroy(){this.rootEl?.removeEventListener(`scroll`,this.handleScroll,!0)}closeMenu=()=>{this.editor.transact(e=>e.setMeta(UC,null))};clearQuery=()=>{this.pluginState!==void 0&&this.editor._tiptapEditor.chain().focus().deleteRange({from:this.pluginState.queryStartPos()-(this.pluginState.deleteTriggerCharacter?this.pluginState.triggerCharacter.length:0),to:this.editor.transact(e=>e.selection.from)}).run()}},UC=new hr(`SuggestionMenuPlugin`),WC=w_(({editor:e})=>{let t=new Map,n,r=T_(void 0);return{key:`suggestionMenu`,store:r,addSuggestionMenu:e=>{t.set(e.triggerCharacter,e)},removeSuggestionMenu:e=>{t.delete(e)},closeMenu:()=>{n?.closeMenu()},clearQuery:()=>{n?.clearQuery()},shown:()=>n?.state?.show||!1,openSuggestionMenu:(t,n)=>{e.headless||(e.focus(),e.transact(e=>{n?.deleteTriggerCharacter&&e.insertText(t),e.scrollIntoView().setMeta(UC,{triggerCharacter:t,deleteTriggerCharacter:n?.deleteTriggerCharacter||!1,ignoreQueryLength:n?.ignoreQueryLength||!1})}))},prosemirrorPlugins:[new Tr({key:UC,view:t=>(n=new HC(e,(e,t)=>{r.setState({...t,triggerCharacter:e})},t),n),state:{init(){},apply:(t,r,i,a)=>{if(t.selection.$from.parent.type.spec.code)return r;let o=t.getMeta(UC);if(typeof o==`object`&&o){r&&n?.closeMenu();let t=BC(e,a.selection.from-o.triggerCharacter.length);return{triggerCharacter:o.triggerCharacter,deleteTriggerCharacter:o.deleteTriggerCharacter!==!1,queryStartPos:()=>t()+o.triggerCharacter.length,query:``,decorationId:`id_${Math.floor(Math.random()*4294967295)}`,ignoreQueryLength:o?.ignoreQueryLength}}if(r===void 0)return r;if(a.selection.from!==a.selection.to||o===null||t.getMeta(`focus`)||t.getMeta(`blur`)||t.getMeta(`pointer`)||r.triggerCharacter!==void 0&&a.selection.from<r.queryStartPos()||!a.selection.$from.sameParent(a.doc.resolve(r.queryStartPos())))return;let s={...r};return s.query=a.doc.textBetween(r.queryStartPos(),a.selection.from),s}},props:{handleTextInput(e,n,r,i){let a=e.state.doc,o=[...t.entries()].sort(([e],[t])=>t.length-e.length);for(let[t,r]of o){let o=a.textBetween(Math.max(0,n-(t.length-i.length)),n)+i;if(t===o){if(r.shouldOpen&&!r.shouldOpen(e.state.tr))continue;return e.dispatch(e.state.tr.insertText(i)),e.dispatch(e.state.tr.setMeta(UC,{triggerCharacter:o}).scrollIntoView()),!0}}return!1},decorations(e){let t=this.getState(e);if(t===void 0)return null;if(!t.deleteTriggerCharacter){let n=VC(e.selection);if(n)return Cr.create(e.doc,[Er.node(n.pos,n.pos+n.node.nodeSize,{nodeName:`span`,class:`bn-suggestion-decorator`,"data-decoration-id":t.decorationId})])}return Cr.create(e.doc,[Er.inline(t.queryStartPos()-t.triggerCharacter.length,t.queryStartPos(),{nodeName:`span`,class:`bn-suggestion-decorator`,"data-decoration-id":t.decorationId})])}}})]}});function GC(e){let t=e.getTextCursorPosition().block,n=e.schema.blockSchema[t.type].content;for(;n===`none`;){if(t=e.getTextCursorPosition().nextBlock,t===void 0){let t=e.document[e.document.length-1],n=e.insertBlocks([{type:`paragraph`}],t,`after`)[0];e.setTextCursorPosition(n,`end`);return}n=e.schema.blockSchema[t.type].content,e.setTextCursorPosition(t,`end`)}}function KC(e,t){let n=e.getTextCursorPosition().block;if(n.content===void 0)throw Error(`Slash Menu open in a block that doesn't contain content.`);let r;return Array.isArray(n.content)&&(n.content.length===1&&tb(n.content[0])&&n.content[0].type===`text`&&n.content[0].text===`/`||n.content.length===0)?(r=e.updateBlock(n,t),e.setTextCursorPosition(r)):(r=e.insertBlocks([t],n,`after`)[0],e.setTextCursorPosition(e.getTextCursorPosition().nextBlock)),GC(e),r}function qC(e){let t=[],n=new Map(RC(e).map(e=>[e.key,e]));function r(r,i){let a=n.get(r);a&&t.push({onItemClick:()=>{KC(e,{type:a.type,props:a.props})},badge:i,key:r,...e.dictionary.slash_menu[r]})}return r(`heading`,ub(`Mod-Alt-1`)),r(`heading_2`,ub(`Mod-Alt-2`)),r(`heading_3`,ub(`Mod-Alt-3`)),r(`quote`),r(`toggle_list`,ub(`Mod-Shift-6`)),r(`numbered_list`,ub(`Mod-Shift-7`)),r(`bullet_list`,ub(`Mod-Shift-8`)),r(`check_list`,ub(`Mod-Shift-9`)),r(`paragraph`,ub(`Mod-Alt-0`)),MC(e,`codeBlock`)&&t.push({onItemClick:()=>{KC(e,{type:`codeBlock`})},badge:ub(`Mod-Alt-c`),key:`code_block`,...e.dictionary.slash_menu.code_block}),MC(e,`divider`)&&t.push({onItemClick:()=>{KC(e,{type:`divider`})},key:`divider`,...e.dictionary.slash_menu.divider}),MC(e,`table`)&&t.push({onItemClick:()=>{KC(e,{type:`table`,content:{type:`tableContent`,rows:[{cells:[``,``,``]},{cells:[``,``,``]}]}})},badge:void 0,key:`table`,...e.dictionary.slash_menu.table}),MC(e,`image`,{url:`string`})&&t.push({onItemClick:()=>{let t=KC(e,{type:`image`});e.getExtension(CS)?.showMenu(t.id),e.getExtension(zC)?.store.setState(!1)},key:`image`,...e.dictionary.slash_menu.image}),MC(e,`video`,{url:`string`})&&t.push({onItemClick:()=>{let t=KC(e,{type:`video`});e.getExtension(CS)?.showMenu(t.id),e.getExtension(zC)?.store.setState(!1)},key:`video`,...e.dictionary.slash_menu.video}),MC(e,`audio`,{url:`string`})&&t.push({onItemClick:()=>{let t=KC(e,{type:`audio`});e.getExtension(CS)?.showMenu(t.id),e.getExtension(zC)?.store.setState(!1)},key:`audio`,...e.dictionary.slash_menu.audio}),MC(e,`file`,{url:`string`})&&t.push({onItemClick:()=>{let t=KC(e,{type:`file`});e.getExtension(CS)?.showMenu(t.id),e.getExtension(zC)?.store.setState(!1)},key:`file`,...e.dictionary.slash_menu.file}),r(`toggle_heading`),r(`toggle_heading_2`),r(`toggle_heading_3`),r(`heading_4`,ub(`Mod-Alt-4`)),r(`heading_5`,ub(`Mod-Alt-5`)),r(`heading_6`,ub(`Mod-Alt-6`)),t.push({onItemClick:()=>{e.getExtension(WC)?.openSuggestionMenu(`:`,{deleteTriggerCharacter:!0,ignoreQueryLength:!0})},key:`emoji`,...e.dictionary.slash_menu.emoji}),t}function JC(e,t){return e.filter(({title:e,aliases:n})=>e.toLowerCase().includes(t.toLowerCase())||n&&n.filter(e=>e.toLowerCase().includes(t.toLowerCase())).length!==0)}var YC={audio:FS(),bulletListItem:dC(),checkListItem:fC(),codeBlock:WS(),divider:GS(),file:qS(),heading:nC(),image:lC(),numberedListItem:hC(),paragraph:_C(),quote:vC(),table:DC(),toggleListItem:gC(),video:jC()},XC=Px({type:`textColor`,propSchema:`string`},{render:()=>{let e=document.createElement(`span`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`span`);return e!==_S.textColor.default&&(t.style.color=e in gS?gS[e].text:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName===`SPAN`&&e.style.color)return e.style.color}}),ZC=Px({type:`backgroundColor`,propSchema:`string`},{render:()=>{let e=document.createElement(`span`);return{dom:e,contentDOM:e}},toExternalHTML:e=>{let t=document.createElement(`span`);return e!==_S.backgroundColor.default&&(t.style.backgroundColor=e in gS?gS[e].background:e),{dom:t,contentDOM:t}},parse:e=>{if(e.tagName===`SPAN`&&e.style.backgroundColor)return e.style.backgroundColor}}),QC={bold:jx(ut,`boolean`),italic:jx(Lt,`boolean`),underline:jx(Et,`boolean`),strike:jx(xt,`boolean`),code:jx(ht.extend({excludes(){return __(this.editor)},addInputRules(){return[vt({find:/(^|[^`])`([^`]+)`(?!`)$/,type:this.type}),new $e({find:/(^|[^`])`([^`]+)`(?!`) $/,handler:({state:e,range:t,match:n})=>{let{tr:r,schema:i}=e,a=n[1],o=n[2];r.replaceWith(t.from+a.length,t.to,[i.text(o,[this.type.create()]),i.text(` `)])}})]}}),`boolean`),textColor:XC,backgroundColor:ZC};Mx(QC);var $C={text:{config:`text`,implementation:{}},link:{config:`link`,implementation:{}}},ew=Dx($C),tw=class e extends Kx{static create(t){return new e({blockSpecs:t?.blockSpecs??YC,inlineContentSpecs:t?.inlineContentSpecs??$C,styleSpecs:t?.styleSpecs??QC})}},nw=new hr(`blocknote-show-selection`),rw=w_(({editor:e})=>{let t=T_({enabledSet:new Set},{onUpdate(){e.transact(e=>e.setMeta(nw,{}))}});return{key:`showSelection`,store:t,prosemirrorPlugins:[new Tr({key:nw,props:{decorations:e=>{let{doc:n,selection:r}=e;if(t.state.enabledSet.size===0)return Cr.empty;let i=Er.inline(r.from,r.to,{"data-show-selection":`true`});return Cr.create(n,[i])}}})],showSelection(e,n){t.setState({enabledSet:e?new Set([...t.state.enabledSet,n]):new Set([...t.state.enabledSet].filter(e=>e!==n))})}}});function iw(e){if(!e)throw Error(`resolveUsers is required to create a user store`);let t=T_(new Map),n=new Set,r={store:t,async loadUsers(e){await i(e.filter(e=>!t.state.has(e)&&!n.has(e)))},async refetchUsers(e){await i(e.filter(e=>!n.has(e)))},getUser(e){return t.state.get(e)},setUser(e){let n=Array.isArray(e)?e:[e];t.setState(e=>{let t=new Map(e);for(let e of n)t.set(e.id,e);return t})}};async function i(i){if(i.length!==0){for(let e of i)n.add(e);try{let n=await e(i,r);n.length>0&&t.setState(e=>{let t=new Map(e);for(let e of n)t.set(e.id,e);return t})}finally{for(let e of i)n.delete(e)}}}return r}function aw(e){return typeof e==`function`?iw(e):e??iw(async()=>[])}var ow=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),sw=class e{constructor(e){this.cache=new Map(e)}get(e){return this.cache.get(e)}set(e,t,n){e<0||this.cache.set(e,[t,n])}replace(e,t,n,r){this.remove(e),this.set(t,n,r)}remove(e){this.cache.delete(e)}invalidate(t){let n=new e(this.cache),r=t.mapping;return this.cache.forEach(([e,i],a)=>{if(a<0)return;let o=r.mapResult(a),s=t.doc.nodeAt(o.pos);if(o.deleted||!s?.eq(e))n.remove(a);else if(a!==o.pos){let e=i.map(e=>e.map(r,0,0)).filter(e=>e!=null);n.replace(a,o.pos,s,e)}}),n}};function cw({parser:e,nodeTypes:t=[`code_block`,`codeBlock`],languageExtractor:n=e=>e.attrs.language}){let r=new hr(`prosemirror-highlight`);return new Tr({key:r,state:{init(r,i){let a=new sw,[o,s]=lw(i.doc,e,t,n,a);return{cache:a,decorations:o,promises:s}},apply:(r,i)=>{let a=i.cache.invalidate(r),o=!!r.getMeta(`prosemirror-highlight-refresh`);if(!r.docChanged&&!o)return{cache:a,decorations:i.decorations?.map(r.mapping,r.doc),promises:i.promises};let[s,c]=lw(r.doc,e,t,n,a);return{cache:a,decorations:s,promises:c}}},view:e=>{let t=new Set,n=()=>{if(t.size>0||e.isDestroyed)return;let n=e.state.tr.setMeta(`prosemirror-highlight-refresh`,!0);e.dispatch(n)},i=()=>{let i=r.getState(e.state);for(let e of i?.promises??[])t.add(e),e.then(()=>{t.delete(e),n()}).catch(n=>{console.error(`[prosemirror-highlight] Error resolving parser:`,n),t.delete(e)})};return i(),{update:()=>{i()}}},props:{decorations(e){return this.getState(e)?.decorations}}})}function lw(e,t,n,r,i){let a=[],o=[],s=uw(e,n);try{for(let[e,n]of s){let s=r(e),c=i.get(n);if(c){let[e,t]=c;t.length>0&&a.push(t)}else{let r=t({content:e.textContent,language:s||void 0,pos:n,size:e.nodeSize});r&&Array.isArray(r)?(i.set(n,e,r),r.length>0&&a.push(r)):r instanceof Promise?(i.remove(n),o.push(r)):console.error(`[prosemirror-highlight] Invalid parser result:`,r)}}}catch(e){console.error(`[prosemirror-highlight] Error parsing code blocks:`,e)}return[a.length>0?Cr.create(e,a.flat()):void 0,o]}function uw(e,t){let n=[];return e.descendants((e,r)=>{if(e.type.inlineContent&&t.includes(e.type.name))return n.push([e,r]),!1}),n}function dw(e,t){return function({content:n,language:r,pos:i,size:a}){let o=[],{tokens:s,fg:c,bg:l,rootStyle:u}=e.codeToTokens(n,{lang:r,...t??{theme:e.getLoadedThemes()[0]}}),d=u||(c&&l?`--prosemirror-highlight:${c};--prosemirror-highlight-bg:${l}`:``);if(d){let e=Er.node(i,i+a,{style:d});o.push(e)}let f=i+1;for(let e of s){for(let t of e){let e=f+t.content.length,n=Er.inline(f,e,{style:fw(t.htmlStyle??`color: ${t.color}`),class:`shiki`});o.push(n),f=e}f+=1}return o}}function fw(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var pw=e(ow(),1);function mw(e,t){let n,r;if(t.firstChild.descendants((i,a)=>n?!1:!hw(i)||!i.attrs.id||ky(i,t)!==e||(n=i,r=a+1,!1)),n!==void 0&&r!==void 0)return{node:n,posBeforeNode:r}}function hw(e){return e.type.isInGroup(`bnBlock`)}var gw=`[data-node-type][data-id]:not([data-node-type="blockOuter"])`;function _w(e,t){if(!t.dom.contains(e))return;let n=e.closest(`.bn-editor`);if(n&&n!==t.dom)return;let r=e.closest(gw);return r&&r!==t.dom&&t.dom.contains(r)?r:void 0}function vw(e,t,n){let r=e.nodeDOM(t);if(!(r instanceof Element))return;let i=r.matches(`[data-node-type][data-id]:not([data-node-type="blockOuter"])`)?r:r.querySelector(gw);return i?.getAttribute(`data-id`)===n?i:void 0}function yw(e,t){let n=_w(e,t);if(!n)return;let r=n.getAttribute(`data-id`),i=n.getAttribute(`data-node-type`),a=i===`blockContainer`?n.querySelector(`[data-content-type]`)?.getAttribute(`data-content-type`):i,o=n.ownerDocument.defaultView?.HTMLElement;if(!o||!(n instanceof o)||!r||!a)throw Error(`Block root is missing its HTML element, ID, or block type.`);return{node:n,id:r,type:a}}function bw(e,t,n){let r=yw(e,t);for(;r;){if(n(r.type))return r;let e=r.node.parentElement;r=e?yw(e,t):void 0}}function xw(e){let t=e.closest(`.bn-editor`),n=[];for(let r of e.querySelectorAll(gw))r.parentElement?.closest(`[data-node-type][data-id]:not([data-node-type="blockOuter"])`)===e&&r.closest(`.bn-editor`)===t&&n.push(r);return n}function Sw(e){let t=Array.from(e.classList).filter(e=>!e.startsWith(`bn-`))||[];t.length>0?e.className=t.join(` `):e.removeAttribute(`class`)}function Cw(e,t,n,r){let i;if(!t)throw Error(`blockContent is required`);if(typeof t==`string`)i=dS([t],e.pmSchema,r?.blockType);else if(Array.isArray(t))i=dS(t,e.pmSchema,r?.blockType);else if(t.type===`tableContent`)i=fS(t,e.pmSchema);else throw new sb(t.type);let a=(r?.document??document).createDocumentFragment();for(let t of i)if(t.type.name!==`text`&&e.schema.inlineContentSchema[t.type.name]){let i=e.schema.inlineContentSpecs[t.type.name].implementation;if(i){let o=Bb(t,e.schema.inlineContentSchema,e.schema.styleSchema),s=i.toExternalHTML?i.toExternalHTML(o,e):i.render.call({renderType:`dom`,props:void 0},o,()=>{},e);if(s){if(a.appendChild(s.dom),s.contentDOM){let e=n.serializeFragment(t.content,r);s.contentDOM.dataset.editable=``,s.contentDOM.appendChild(e)}continue}}}else if(t.type.name===`text`){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=(e.schema.styleSpecs[r.type.name].implementation.toExternalHTML??e.schema.styleSpecs[r.type.name].implementation.render)(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=pr.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}a.appendChild(n)}else{let e=n.serializeFragment(dr.from([t]),r);a.appendChild(e)}return a.childNodes.length===1&&a.firstChild?.nodeType===1&&Sw(a.firstChild),a}function ww(e,t,n,r,i){let a=e.toExternalHTML?.call({},t,n,{nestingLevel:i});if(a)return{output:a};let o=Yb(n,t);if(r){if(!o)throw Error(`Layout block "${t.type}" drew no frame. This is a bug in BlockNote.`);return{output:{dom:o.dom,childrenDOM:o.slot}}}if(!e.render)throw Error(`Block "${t.type}" has no \`render\`. This is a bug in BlockNote.`);return{output:e.render.call({},t,n),frame:o}}function Tw(e,t,n,r,i,a,o,s){let c=s?.document??document,l=t.pmSchema.nodes.blockContainer,u=n.props||{};for(let[e,r]of Object.entries(t.schema.blockSchema[n.type].propSchema))!(e in u)&&r.default!==void 0&&(u[e]=r.default);let d=l.spec?.toDOM?.(l.create({id:n.id,...u})),f=Array.from(d.dom.attributes),p=t.blockImplementations[n.type].implementation,m={...n,props:u,children:n.children??[]},h=my(t.pmSchema.nodes[n.type]),{output:g,frame:_}=ww(p,m,t,h,o),v=c.createDocumentFragment(),y;if(lx(g.dom)||(y=g.dom),y?.classList.contains(`bn-block-content`)){let e=[...f,...Array.from(y.attributes)].filter(e=>e.name.startsWith(`data`)&&e.name!==`data-content-type`&&e.name!==`data-file-block`&&e.name!==`data-node-view-wrapper`&&e.name!==`data-node-type`&&e.name!==`data-id`&&e.name!==`data-editable`);for(let t of e)y.firstChild.setAttribute(t.name,t.value);Sw(y.firstChild),o>0&&y.firstChild.setAttribute(`data-nesting-level`,o.toString()),v.append(...Array.from(y.childNodes))}else v.append(g.dom),h&&(y?.removeAttribute(`data-node-type`),y?.removeAttribute(`data-id`),g.childrenDOM?.removeAttribute(`data-frame-slot`)),o>0&&y?.setAttribute(`data-nesting-level`,o.toString());if(g.contentDOM){if(n.content){let e=Cw(t,n.content,r,{...s,blockType:n.type});g.contentDOM.appendChild(e)}let e=t.pmSchema.nodes[n.type];e?.inlineContent&&!e.spec.code&&g.contentDOM.childNodes.length===0&&g.contentDOM.appendChild(c.createTextNode(``))}let b=g.childrenDOM;_&&(_.slot.append(v),v.append(_.dom),b=_.slot);let x;if(i.has(n.type)?x=`OL`:a.has(n.type)&&(x=`UL`),x){if(e.lastChild?.nodeName!==x){let t=c.createElement(x);x===`OL`&&`start`in u&&u.start&&u?.start!==1&&t.setAttribute(`start`,String(u.start)),e.append(t)}e.lastChild.appendChild(v)}else e.append(v);if(n.children&&n.children.length>0){let l=c.createDocumentFragment();if(Ew(l,t,n.children,r,i,a,o+1,s),e.lastChild?.nodeName===`UL`||e.lastChild?.nodeName===`OL`)for(;l.firstChild?.nodeName===`UL`||l.firstChild?.nodeName===`OL`;)e.lastChild.lastChild.appendChild(l.firstChild);b?b.append(l):t.pmSchema.nodes[n.type].isInGroup(`blockContent`)||!g.contentDOM?e.append(l):g.contentDOM.append(l)}}var Ew=(e,t,n,r,i,a,o=0,s)=>{for(let c of n)Tw(e,t,c,r,i,a,o,s)},Dw=(e,t,n,r,i,a)=>{let o=(a?.document??document).createDocumentFragment();return Ew(o,e,t,n,r,i,0,a),o},Ow=(e,t)=>{let n=pr.fromSchema(e);return{exportBlocks:(e,r)=>{let i=Dw(t,e,n,new Set([`numberedListItem`]),new Set([`bulletListItem`,`checkListItem`,`toggleListItem`]),r),a=document.createElement(`div`);return a.append(i),a.innerHTML},exportInlineContent:(e,r)=>{let i=Cw(t,e,n,r),a=document.createElement(`div`);return a.append(i.cloneNode(!0)),a.innerHTML}}};function kw(e){let{mapping:t,steps:n}=e,r=1/0,i=-1/0;for(let e=0;e<t.maps.length;e++){let a=t.maps[e];e&&(r=a.map(r,1),i=a.map(i,-1));let o=!1;if(a.forEach((e,t,n,a)=>{o=!0,r=Math.min(r,n),i=Math.max(i,a)}),!o){let t=n[e];typeof t.pos==`number`?(r=Math.min(r,t.pos),i=Math.max(i,t.pos+1)):typeof t.from==`number`&&typeof t.to==`number`&&(r=Math.min(r,t.from),i=Math.max(i,t.to))}}return r===1/0?null:{from:r,to:i}}function Aw(e,t){if(t===0)return;let n=e.resolve(t);for(let t=n.depth;t>0;t--){let r=n.node(t);if(hw(r))return ky(r,e)}}function jw(e){return e.getMeta(`paste`)?{type:`paste`}:e.getMeta(`uiEvent`)===`drop`?{type:`drop`}:e.getMeta(`history$`)?{type:e.getMeta(`history$`).redo?`redo`:`undo`}:e.getMeta(`y-sync$`)?e.getMeta(`y-sync$`).isUndoRedoOperation?{type:`undo-redo`}:{type:`yjs-remote`}:{type:`local`}}function Mw(e,t){let n={},r={},i=Math.max(0,Math.min(t.from,e.content.size)),a=Math.max(i,Math.min(t.to,e.content.size));return e.nodesBetween(i,a,(t,i)=>{if(!hw(t))return!0;let a=Aw(e,i),o=a??`__root__`;r[o]||(r[o]=[]);let s=Vb(t,e),c=ky(t,e);return n[c]={block:s,parentId:a},r[o].push(c),!0}),{byId:n,childrenByParent:r}}function Nw(e,t){let n=new Set;if(!e||!t)return n;let r=new Set(e),i=t.filter(e=>r.has(e)),a=e.filter(e=>i.includes(e));if(a.length<=1||i.length<=1)return n;let o={};for(let e=0;e<a.length;e++)o[a[e]]=e;let s=i.map(e=>o[e]),c=s.length,l=[],u=[],d=Array(c).fill(-1),f=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n};for(let e=0;e<c;e++){let t=s[e],n=f(l,t);n>0&&(d[e]=u[n-1]),n===l.length?(l.push(t),u.push(e)):(l[n]=t,u[n]=e)}let p=new Set,m=u[u.length-1]??-1;for(;m!==-1;)p.add(m),m=d[m];for(let e=0;e<i.length;e++)p.has(e)||n.add(i[e]);return n}function Pw(e,t=[]){let n=jw(e),r=Uy(e.before,[e,...t]),i=kw(r);if(!i)return[];let a=r.mapping.invert(),o={from:a.map(i.from,-1),to:a.map(i.to,1)},s=Mw(r.before,o),c=Mw(r.doc,i),l=[],u=new Set;Object.keys(c.byId).filter(e=>!(e in s.byId)).forEach(e=>{l.push({type:`insert`,block:c.byId[e].block,source:n,prevBlock:void 0}),u.add(e)}),Object.keys(s.byId).filter(e=>!(e in c.byId)).forEach(e=>{l.push({type:`delete`,block:s.byId[e].block,source:n,prevBlock:void 0}),u.add(e)}),Object.keys(c.byId).filter(e=>e in s.byId).forEach(e=>{let t=s.byId[e],r=c.byId[e];t.parentId===r.parentId?(0,pw.default)({...t.block,children:void 0},{...r.block,children:void 0})||(l.push({type:`update`,block:r.block,prevBlock:t.block,source:n}),u.add(e)):(l.push({type:`move`,block:r.block,prevBlock:t.block,source:n,prevParent:t.parentId?s.byId[t.parentId]?.block:void 0,currentParent:r.parentId?c.byId[r.parentId]?.block:void 0}),u.add(e))});let d=s.childrenByParent,f=c.childrenByParent,p=new Set([...Object.keys(d),...Object.keys(f)]),m=new Set;return p.forEach(e=>{let t=Nw(d[e],f[e]);t.size!==0&&t.forEach(t=>{let r=s.byId[t],i=c.byId[t];r&&i&&r.parentId===i.parentId&&(u.has(t)||(r.parentId??`__root__`)===e&&(m.has(t)||(m.add(t),l.push({type:`move`,block:i.block,prevBlock:r.block,source:n,prevParent:r.parentId?s.byId[r.parentId]?.block:void 0,currentParent:i.parentId?c.byId[i.parentId]?.block:void 0}),u.add(t))))})}),l}var Fw=w_(()=>{let e=[];return{key:`blockChange`,prosemirrorPlugins:[new Tr({key:new hr(`blockChange`),filterTransaction:t=>{let n;return e.reduce((e,r)=>e===!1?e:r({getChanges(){return n||(n=Pw(t),n)},tr:t})!==!1,!0)}})],subscribe(t){return e.push(t),()=>{e.splice(e.indexOf(t),1)}}}});function Iw(e,t){return!e||!t?!1:!!e.closest(`.${t}`)}function Lw(e,t,n,r,i){let a=e.state.doc.resolve(t.pos);if(a.parent.inlineContent||t.orientation===`inline`)return null;let o=a.nodeBefore,s=a.nodeAfter;if(!o&&!s)return null;let c=t.orientation===`block-vertical-left`||t.orientation===`block-vertical-right`,l=c?t.pos:t.pos-(o?o.nodeSize:0),u=e.nodeDOM(l);if(!u)return null;let d=u.getBoundingClientRect();if(c){let e=n/2*r,i=t.orientation===`block-vertical-left`?d.left:d.right;return{left:i-e,right:i+e,top:d.top,bottom:d.bottom}}let f=o?d.bottom:d.top;o&&s&&(f=(f+e.nodeDOM(t.pos).getBoundingClientRect().top)/2);let p=n/2*i;return{left:d.left,right:d.right,top:f-p,bottom:f+p}}function Rw(e,t,n,r){let i=e.coordsAtPos(t.pos),a=n/2*r;return{left:i.left-a,right:i.left+a,top:i.top,bottom:i.bottom}}function zw(e,t){e.classList.toggle(`prosemirror-dropcursor-inline`,t===`inline`),e.classList.toggle(`prosemirror-dropcursor-block-horizontal`,t===`block-horizontal`),e.classList.toggle(`prosemirror-dropcursor-block-vertical-left`,t===`block-vertical-left`),e.classList.toggle(`prosemirror-dropcursor-block-vertical-right`,t===`block-vertical-right`),e.classList.toggle(`prosemirror-dropcursor-block`,t===`block-horizontal`),e.classList.toggle(`prosemirror-dropcursor-vertical`,t===`block-vertical-left`||t===`block-vertical-right`)}function Bw(e){if(!e||e===document.body&&getComputedStyle(e).position===`static`)return{parentLeft:-window.pageXOffset,parentTop:-window.pageYOffset};let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return{parentLeft:t.left-e.scrollLeft*n,parentTop:t.top-e.scrollTop*r}}function Vw(e){let t=[];function n(e,r){let i=e.type.spec.blockConfig?.children,a=e.type.name===`blockContainer`&&e.firstChild?.type.name===`blockGroup`,o=my(e.type)&&(!i||gy(e.type)||e.childCount<by(i));a||o||!e.type.isInGroup(`bnBlock`)?e.forEach(e=>n(e,o?r:e)):t.push(Vb(e,r))}return e.forEach(e=>n(e,e)),t}function Hw(e,t,n){let r=t.dragging?.slice;if(!r||r.openStart>0)return;let i=Vw(r.content),a=t.posAtCoords(n);if(i.length===0||!a||a.inside<0)return;let o=t.state.doc.resolve(a.inside+1),s=o.depth;for(;s>0&&!o.node(s).type.isInGroup(`bnBlock`);){if(o.node(s).type.name===`blockGroup`)return;s--}if(s===0)return;let c=jy(o.node(s),o.before(s));if(!c.hasContent||!e.schema.blockSpecs[c.blockNoteType]?.implementation.meta.dropsIntoChildren?.(Vb(c.block.node,t.state.doc)))return;let l=c.block.node.attrs.id,u=e=>e.id===l||e.children.some(u);if(!i.some(u))return{blockInfo:c,draggedBlocks:i,pos:c.children?c.children.childrenStart:c.block.afterPos-1}}var Uw=new hr(`dropInto`),Ww=w_(({editor:e,options:t})=>{let n=null,r=null,i=-1,a=null,o={width:t.dropCursor?.width??5,color:t.dropCursor?.color??`#ddeeff`,exclude:t.dropCursor?.exclude??`bn-drag-exclude`,hooks:t.dropCursor?.hooks},s=t=>{let n=e.prosemirrorView,r=Uw.getState(n.state);(r?.blockId!==t?.blockId||r?.pos!==t?.pos)&&n.dispatch(n.state.tr.setMeta(Uw,{into:t}))},c=e=>{(e?.pos!==n?.pos||e?.orientation!==n?.orientation)&&(n=e,e==null?(s(void 0),r&&r.parentNode&&r.parentNode.removeChild(r),r=null):l())},l=()=>{if(!n)return;let t=e.prosemirrorView,i=t.dom,a=i.getBoundingClientRect(),s=a.width/i.offsetWidth,c=a.height/i.offsetHeight,l=Lw(t,n,o.width,s,c)??Rw(t,n,o.width,s),u=t.dom.offsetParent;r||(r=u.appendChild(document.createElement(`div`)),r.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,o.color&&(r.style.backgroundColor=o.color)),zw(r,n.orientation);let{parentLeft:d,parentTop:f}=Bw(u);r.style.left=(l.left-d)/s+`px`,r.style.top=(l.top-f)/c+`px`,r.style.width=(l.right-l.left)/s+`px`,r.style.height=(l.bottom-l.top)/c+`px`},u=e=>{clearTimeout(i),i=window.setTimeout(()=>c(null),e)},d=e=>{let t=e;a=t.target instanceof Element?t.target:null},f=t=>{let n=t;if(a&&Iw(a,o.exclude)||n.target instanceof Element&&Iw(n.target,o.exclude))return;let r=e.prosemirrorView;if(!r.editable)return;let i=r.posAtCoords({left:n.clientX,top:n.clientY}),l=i&&i.inside>=0&&r.state.doc.nodeAt(i.inside),d=l&&l.type.spec.disableDropCursor,f=typeof d==`function`?d(r,i,n):d;if(i&&!f){let t=i.pos;if(r.dragging&&r.dragging.slice){let e=kr(r.state.doc,t,r.dragging.slice);e!=null&&(t=e)}let a=!r.state.doc.resolve(t).parent.inlineContent,l=Hw(e,r,{left:n.clientX,top:n.clientY}),d=l?{pos:l.pos,orientation:`block-horizontal`}:{pos:t,orientation:a?`block-horizontal`:`inline`},f=d;if(o.hooks?.computeDropPosition){let t=o.hooks.computeDropPosition({editor:e,event:n,view:r,defaultPosition:d});if(t===null){c(null);return}f=t}if(c(f),l&&f.pos===l.pos&&f.orientation===`block-horizontal`){let{block:e}=l.blockInfo;s({blockId:e.node.attrs.id,draggedBlocks:l.draggedBlocks,pos:e.beforePos})}else s(void 0);u(5e3)}},p=t=>{let n=t;n.relatedTarget instanceof Node&&e.prosemirrorView.dom.contains(n.relatedTarget)||c(null)},m=()=>{u(20)},h=()=>{u(20),a=null};return{key:`dropCursor`,prosemirrorPlugins:[new Tr({key:Uw,state:{init:()=>void 0,apply(e,t){let n=e.getMeta(Uw);if(n)return n.into;if(!t)return;let{pos:r,deletedAfter:i}=e.mapping.mapResult(t.pos,1);return i?void 0:{...t,pos:r}}},props:{decorations(e){let t=Uw.getState(e),n=t&&e.doc.nodeAt(t.pos);return!t||!n?Cr.empty:Cr.create(e.doc,[Er.node(t.pos,t.pos+n.nodeSize,{"data-drop-target":`true`})])},handleDrop(t,n,r,i){let a=Uw.getState(t.state);if(s(void 0),!a||!e.getBlock(a.blockId))return!1;let{blockId:o,draggedBlocks:c}=a;return e.transact(()=>{i&&e.removeBlocks(c.filter(t=>e.getBlock(t.id)));let t=e.getBlock(o);if(!t)throw Error(`The drop target was removed with the dragged blocks`);t.children.length>0?e.insertBlocks(c,t.children[0],`before`):e.updateBlock(t,{children:c})}),!0}}})],mount({signal:e,dom:t,root:n}){n.addEventListener(`dragstart`,d,{capture:!0,signal:e}),t.addEventListener(`dragover`,f,{signal:e}),t.addEventListener(`dragleave`,p,{signal:e}),t.addEventListener(`drop`,m,{signal:e}),t.addEventListener(`dragend`,h,{signal:e}),e.addEventListener(`abort`,()=>{clearTimeout(i),c(null)})}}}),Gw=w_(()=>({key:`history`,prosemirrorPlugins:[Kt()],undoCommand:Ut,redoCommand:Wt})),Kw=new hr(`inline-content-boundary-edit`);function qw(e,t,n){if(!e.empty)return e.from<=n.from&&e.to>=n.to;let r=n.to-n.from===1;return t===`Backspace`?r&&e.from===n.to:r&&e.from===n.from}var Jw=w_(()=>({key:`inlineContentBoundaryEdit`,prosemirrorPlugins:[new Tr({key:Kw,props:{handleKeyDown:(e,t)=>{if(!e.editable)return!1;let n=t.key.length===1&&!t.ctrlKey&&!t.metaKey;if(!n&&t.key!==`Backspace`&&t.key!==`Delete`)return!1;let{selection:r}=e.state,i=r.$from.node();if(!i.type.spec.inline)return!1;let a=r.$from.before(),o=a+1,s=a+1+i.content.size;if(n&&i.content.size===0){let n=e.state.tr.insert(o,e.state.schema.text(t.key));return n.setSelection(gr.create(n.doc,o+t.key.length)),e.dispatch(n),!0}if(i.content.size>0&&qw(r,t.key,{from:o,to:s})){let t=e.state.tr.delete(o,s);return t.setSelection(gr.create(t.doc,o)),e.dispatch(t),!0}return!1}}})]})),Yw=w_(({editor:e})=>{function t(t){let n=e.prosemirrorView.nodeDOM(t);for(;n&&n.parentElement;){if(n.nodeName===`A`)return n;n=n.parentElement}return null}function n(t){let n=e.getLinkMarkAtPos(t);if(n)return{range:{from:n.from,to:n.to},mark:{attrs:{href:n.href}},get text(){return n.text},get position(){return mt(e.prosemirrorView,n.from,n.to).toJSON()}}}function r(){return e.transact(e=>{if(e.selection.empty)return n(e.selection.anchor)})}return{key:`linkToolbar`,getLinkAtSelection:r,getLinkElementAtPos:t,getMarkAtPos(e,t){return n(e)},getLinkAtElement(t){return e.transact(()=>n(e.prosemirrorView.posAtDOM(t,0)+1))},editLink(t,n,r=e.transact(e=>e.selection.anchor)){e.editLink(t,n,r)},deleteLink(t=e.transact(e=>e.selection.anchor)){e.deleteLink(t)}}}),Xw=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`],Zw=`https`,Qw=new hr(`node-selection-keyboard`),$w=w_(({editor:e})=>({key:`nodeSelectionKeyboard`,prosemirrorPlugins:[new Tr({key:Qw,props:{handleKeyDown:(t,n)=>{let{selection:r}=t.state;if(r instanceof wr){if(n.ctrlKey||n.metaKey)return!1;if(n.key===`ArrowDown`&&!n.shiftKey&&!n.altKey&&!n.isComposing&&!r.node.isInline&&r.eq(xr.atEnd(t.state.doc))){let{block:t}=e.getTextCursorPosition();if(e.schema.blockSchema[t.type].content===`none`)return e.transact(n=>{let[r]=e.insertBlocks([{type:`paragraph`}],t,`after`);e.setTextCursorPosition(r,`start`),n.scrollIntoView()}),n.preventDefault(),!0}if(n.key.length===1)return n.preventDefault(),!0;if(n.key===`Enter`&&!n.isComposing&&!n.shiftKey&&!n.altKey&&!n.ctrlKey&&!n.metaKey){let e=t.state.tr;return t.dispatch(e.insert(t.state.tr.selection.$to.after(),t.state.schema.nodes.paragraph.createChecked()).setSelection(new gr(e.doc.resolve(t.state.tr.selection.$to.after()+1)))),!0}}return!1}}})]})),eT=new hr(`blocknote-placeholder`),tT=w_(({editor:e,options:t})=>{let n=t.placeholders,r=`placeholder-selector-${k_()}`;return{key:`placeholder`,prosemirrorPlugins:[new Tr({key:eT,view:t=>{let i=document.createElement(`style`),a=e._tiptapEditor.options.injectNonce;a&&i.setAttribute(`nonce`,a),t.root instanceof window.ShadowRoot?t.root.append(i):t.root.head.appendChild(i);let o=i.sheet,s=(e=``)=>`.${r} .bn-block-content${e}:has(.ProseMirror-trailingBreak:only-child):after`;try{let{default:e,emptyDocument:t,...r}=n||{};for(let[e,t]of Object.entries(r)){let n=`[data-content-type="${e}"]`;o.insertRule(`${s(n)} { content: ${JSON.stringify(t)}; }`)}o.insertRule(`${s(`[data-is-only-empty-block]`)} { content: ${JSON.stringify(t)}; }`),o.insertRule(`${s(`[data-is-empty-and-focused]`)} { content: ${JSON.stringify(e)}; }`)}catch(e){console.warn(`Failed to insert placeholder CSS rule - this is likely due to the browser not supporting certain CSS pseudo-element selectors (:has, :only-child:, or :before)`,e)}return{destroy:()=>{i.remove()}}},props:{attributes:{class:r},decorations:t=>{let{doc:n,selection:r}=t;if(!e.isEditable||!r.empty||r.$from.parent.type.spec.code)return;let i=[];t.doc.content.size===6&&i.push(Er.node(2,4,{"data-is-only-empty-block":`true`}));let a=r.$anchor,o=a.parent;if(o.content.size===0){let e=a.before();i.push(Er.node(e,e+o.nodeSize,{"data-is-empty-and-focused":`true`}))}return Cr.create(n,i)}}})]}}),nT=w_(({editor:e})=>{let t=new _r,n=0;function r(){t=new _r,n=0}let i=typeof FinalizationRegistry<`u`?new FinalizationRegistry(()=>{n--,n===0&&r()}):null;return e.on(`create`,()=>{e._tiptapEditor.on(`transaction`,({transaction:e})=>{n!==0&&t.appendMapping(e.mapping)}),e._tiptapEditor.on(`destroy`,()=>{r()})}),{key:`positionMapping`,mapPosition:(e,r=`left`)=>{n++;let a=t.maps.length,o=()=>t.slice(a).map(e,r===`left`?-1:1);return i&&i.register(o,void 0),o}}}),rT=new hr(`previous-blocks`),iT={index:`index`,level:`level`,type:`type`,depth:`depth`,"depth-change":`depth-change`},aT=w_(()=>{let e,t=!1;return{key:`previousBlockType`,prosemirrorPlugins:[new Tr({key:rT,view(n){return t=!0,{update:async(t,n)=>{this.key?.getState(t.state).updatedBlocks.size>0&&(e=setTimeout(()=>{t.dispatch(t.state.tr.setMeta(rT,{clearUpdate:!0}))},0))},destroy:()=>{t=!1,e&&clearTimeout(e)}}},state:{init(){return{prevTransactionOldBlockAttrs:{},currentTransactionOldBlockAttrs:{},updatedBlocks:new Set}},apply(e,n,r,i){if(n.currentTransactionOldBlockAttrs={},n.updatedBlocks.clear(),!e.docChanged||!t)return n;let a=kw(e);if(!a)return n;let o=e.mapping.invert(),s={from:o.map(a.from,-1),to:o.map(a.to,1)},c={},l=et(r.doc,s,e=>e.attrs.id),u=new Map(l.map(e=>[ky(e.node,r.doc),e])),d=et(i.doc,a,e=>e.attrs.id);for(let e of d){let t=ky(e.node,i.doc),a=u.get(t),o=a?.node.firstChild,s=e.node.firstChild;if(a&&o&&s){let l={index:s.attrs.index,level:s.attrs.level,type:s.type.name,depth:i.doc.resolve(e.pos).depth},u={index:o.attrs.index,level:o.attrs.level,type:o.type.name,depth:r.doc.resolve(a.pos).depth};c[t]=u,n.currentTransactionOldBlockAttrs[t]=u,(u.index!==l.index||u.level!==l.level||u.type!==l.type||u.depth!==l.depth)&&(u[`depth-change`]=u.depth-l.depth,n.updatedBlocks.add(t))}}return n.prevTransactionOldBlockAttrs=c,n}},props:{decorations(e){let t=this.getState(e);if(t.updatedBlocks.size===0)return;let n=[];return e.doc.descendants((r,i)=>{if(!r.attrs.id)return;let a=ky(r,e.doc);if(!t.updatedBlocks.has(a))return;let o=t.currentTransactionOldBlockAttrs[a],s={};for(let[e,t]of Object.entries(o))s[`data-prev-`+iT[e]]=t||`none`;n.push(Er.node(i,i+r.nodeSize,{...s}))}),Cr.create(e.doc,n)}}})]}}),oT=new hr(`bn-read-only`),sT=w_(({editor:e,options:t})=>{let n=T_({isEditable:t?.editable??!0,enabledSet:new Set},{onUpdate(t,n){(t.isEditable&&t.enabledSet.size===0)!==(n.isEditable&&n.enabledSet.size===0)&&(e.headless||e.transact(e=>e.setMeta(`editable`,!0)))}});return{key:`readOnly`,store:n,prosemirrorPlugins:[new Tr({key:oT,props:{editable:()=>n.state.isEditable&&n.state.enabledSet.size===0}})],setEditable(e){n.state.isEditable!==e&&n.setState({...n.state,isEditable:e})},setReadOnly(e,t){n.setState({...n.state,enabledSet:e?new Set([...n.state.enabledSet,t]):new Set([...n.state.enabledSet].filter(e=>e!==t))})}}});function cT(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r];if(!(t.y<i.top||t.y>i.bottom)){if(t.x>=i.left&&t.x<=i.right)return r;n??=r}}return n}function lT(e,t){for(;e.matches(gw);){let n=xw(e),r=cT(n.map(e=>e.getBoundingClientRect()),t);if(r===void 0)break;e=n[r]}return e}var uT=10;function dT(e,t,n){return Math.min(Math.max(e,t),n)}function fT(e,t){for(let n of e.root.elementsFromPoint(t.x,t.y)){let t=_w(n,e);if(t)return t}}function pT(e,t){let n=e.dom.firstElementChild?.getBoundingClientRect();if(!n||t.y<n.top||t.y>n.bottom)return;let r=Math.min(uT,n.width/2),i=fT(e,{x:dT(t.x,n.left+r,n.right-r),y:t.y});return i?lT(i,t):void 0}function mT(e,t,n,r,i,a){function o(t){let n=t?bw(t,e,r):void 0;return n?{kind:`block`,block:n}:{kind:`none`}}if(t&&e.dom.contains(t)){if(t.closest(`.bn-editor`)!==e.dom)return{kind:`none`};let r=_w(t,e);return o(r?lT(r,n):pT(e,n))}if(t&&i(t))return{kind:`editorUI`};let s=e.dom.getBoundingClientRect();return n.x>=s.left&&n.x<=s.right&&n.y>=s.top&&n.y<=s.bottom?{kind:`none`}:n.y>=s.top&&n.y<=s.bottom&&Math.max(s.left-n.x,n.x-s.right)<=a&&!t?.closest(`.bn-editor`)?o(pT(e,n)):{kind:`none`}}var hT=3;function gT(e,t,n){return(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x)}function _T(e,t){let n=0;for(let r=0;r<t.length;r++){let i=Math.sign(gT(t[r],t[(r+1)%t.length],e));if(i!==0){if(n===0)n=i;else if(i!==n)return!1}}return!0}function vT(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i,o=a===0?0:dT(((e.x-t.x)*r+(e.y-t.y)*i)/a,0,1);return Math.hypot(e.x-(t.x+o*r),e.y-(t.y+o*i))}function yT(e,t){return Math.hypot(e.x-dT(e.x,t.left,t.right),e.y-dT(e.y,t.top,t.bottom))}function bT(e){let t=[...e].sort((e,t)=>e.x-t.x||e.y-t.y),n=[];for(let e of t){for(;n.length>=2&&gT(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}let r=[];for(let e of[...t].reverse()){for(;r.length>=2&&gT(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}return n.pop(),r.pop(),n.concat(r)}function xT(e,t,n){if(yT(e,n)>=yT(t,n))return!1;let r=bT([t,{x:n.left,y:n.top},{x:n.right,y:n.top},{x:n.right,y:n.bottom},{x:n.left,y:n.bottom}]);return r.length>=3&&_T(e,r)?!0:r.some((t,n)=>vT(e,t,r[(n+1)%r.length])<=hT)}function ST(e){return e.synthetic===!0}function CT(e,t,n){let r={x:t.clientX,y:t.clientY},i=t.target instanceof Element?t.target.closest(`.bn-editor`):null,a=i?[i]:Array.from(e.root.querySelectorAll(`.bn-editor`)).filter(e=>yT(r,e.getBoundingClientRect())<=n),o=t;if(a.length===0)return null;let s=a[0],c=Number.MAX_VALUE;for(let e of a){let t=e.querySelector(`.bn-block-group`).getBoundingClientRect(),n=o.clientX<t.left?t.left-o.clientX:o.clientX>t.right?o.clientX-t.right:0,r=o.clientY<t.top?t.top-o.clientY:o.clientY>t.bottom?o.clientY-t.bottom:0,i=Math.sqrt(n**2+r**2);i<c&&(c=i,s=e)}return{element:s,distance:c}}function wT(e,t,n,r){function i(n){return e.dragging!==null||t()||n.dataTransfer?.types.includes(`blocknote/html`)||n.target instanceof Node&&e.dom.contains(n.target)}function a(){let t=new Event(`dragleave`,{bubbles:!1});t.synthetic=!0,e.dom.dispatchEvent(t)}function o(t){let n=e.dom.firstChild.getBoundingClientRect(),r=Object.assign(new Event(t.type,t),{clientX:Math.min(Math.max(t.clientX,n.left),n.left+n.width),clientY:Math.min(Math.max(t.clientY,n.top),n.top+n.height),dataTransfer:t.dataTransfer,preventDefault:()=>t.preventDefault(),synthetic:!0});e.dom.dispatchEvent(r)}function s(r){if(!i(r))return;let a=!r.dataTransfer?.types.includes(`blocknote/html`)&&!!e.dragging,o=t(),s=a||o,c=CT(e,r,n);if(!c)return;let l=c.element===e.dom,u=l&&c.distance===0;if(l||s)return{isDropPoint:l,isDropWithinEditorBounds:u,isDragOrigin:s}}function c(t){let n=t.dataTransfer?.getData(`blocknote/html`);if(!n||e.dragging)return;let r=new(e.dom.ownerDocument.defaultView??globalThis.window).DOMParser().parseFromString(n,`text/html`).body,{nodes:i}=e.state.schema,a=i[t.dataTransfer.getData(`blocknote/parent`)]??i.blockGroup,o=Or.fromSchema(e.state.schema).parse(r,{topNode:a.create()});e.dragging={slice:new br(o.content,0,0),move:!0}}function l(e){if(ST(e)||!i(e))return;let t=s(e);!t||!t.isDropPoint?a():t.isDropWithinEditorBounds||o(e)}function u(t){if(ST(t)||!i(t))return;let n=s(t);if(!n){a();return}let{isDropPoint:r,isDropWithinEditorBounds:c,isDragOrigin:l}=n;if(!c&&r&&o(t),r){if(e.dragging)return;e.dispatch(e.state.tr.setSelection(gr.create(e.state.tr.doc,e.state.tr.selection.anchor)))}else l&&setTimeout(()=>e.dispatch(e.state.tr.deleteSelection()),0)}function d(t){ST(t)||(e.dragging=null)}let f=e.root;f.addEventListener(`dragstart`,c,{signal:r}),f.addEventListener(`dragover`,l,{signal:r}),f.addEventListener(`drop`,u,{signal:r,capture:!0}),f.addEventListener(`dragend`,d,{signal:r,capture:!0})}var TT=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`;function ET(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;r+i<e.length&&e.charCodeAt(r+i)>=48&&e.charCodeAt(r+i)<=57;)i++;if(i>0){t.push(n.join(``));let a=parseInt(e.substring(r,r+i),10);for(;a-->0;)n.pop();r+=i}else n.push(e[r]),r++}return t}var DT=new Set(ET(TT)),OT=new Set([`localhost`]),kT=/[.,;:!?"']+$/,AT=/(?:https?|ftp|ftps):\/\/[^\s]+/g,jT=/mailto:[^\s]+/g,MT=/[a-zA-Z0-9._%+-]+@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}/g,NT=/(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(?::\d{1,5})?(?:[/?#][^\s]*)?/g;function PT(e){let t=e,n=!0;for(;n;){n=!1;let e=t;t=t.replace(kT,``),t!==e&&(n=!0);for(let[e,r]of[[`(`,`)`],[`[`,`]`]])for(;t.endsWith(r);){let i=FT(t,e);if(FT(t,r)>i)t=t.slice(0,-1),n=!0;else break}}return t}function FT(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}function IT(e){let t=e.split(`.`);return t[t.length-1].toLowerCase()}function LT(e){let t=IT(e);return DT.has(t)}function RT(e,t,n){return t===`email`?`mailto:`+e:/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(e)||/^mailto:/i.test(e)?e:n+`://`+e}function zT(e,t){if(!e)return[];let n=t?.defaultProtocol||`http`,r=[];for(let t of e.matchAll(AT))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(jT))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(MT))r.push({type:`email`,value:t[0],start:t.index,end:t.index+t[0].length});for(let t of e.matchAll(NT))r.push({type:`url`,value:t[0],start:t.index,end:t.index+t[0].length});r.sort((e,t)=>e.start-t.start||t.end-e.end);let i=[],a=-1;for(let e of r)e.start>=a&&(i.push(e),a=e.end);let o=[];for(let e of i){let t=PT(e.value);if(!t)continue;let r=e.start,i=r+t.length;if(e.type===`url`&&!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)){let e=new URL(`http://`+t).hostname;if(!LT(e))continue}if(e.type===`email`){let e=t.split(`@`)[1];if(!LT(e))continue}let a=RT(t,e.type,n);o.push({type:e.type,value:t,isLink:!0,href:a,start:r,end:i})}return o}function BT(e,t=`http`){if(!e)return[UT(e,0,0)];for(let[n,r]of[[`(`,`)`],[`[`,`]`],[`{`,`}`]])if(e.startsWith(n)&&e.endsWith(r)&&e.length>2){let i=e.slice(1,-1);if(VT(i))return[UT(n,0,1),HT(i,1,1+i.length,t),UT(r,1+i.length,e.length)]}if(e.endsWith(`.`)&&e.length>1){let n=e.slice(0,-1);if(VT(n))return[HT(n,0,n.length,t),UT(`.`,n.length,e.length)]}return VT(e)?[HT(e,0,e.length,t)]:[UT(e,0,e.length)]}function VT(e){if(/^(?:https?|ftp|ftps):\/\/[^\s]+$/.test(e)||/^mailto:[^\s]+$/.test(e)||OT.has(e.toLowerCase()))return!0;let t=e.match(/^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+([a-zA-Z]{2,})(?::\d{1,5})?(?:[/?#][^\s]*)?$/);if(t){let e=t[1].toLowerCase();if(DT.has(e))return!0}return!1}function HT(e,t,n,r){let i=e.includes(`@`)&&!e.includes(`://`)&&!e.startsWith(`mailto:`)?`email`:`url`;return{type:i,value:e,isLink:!0,href:RT(e,i,r),start:t,end:n}}function UT(e,t,n){return{type:`text`,value:e,isLink:!1,href:e,start:t,end:n}}function WT(e){if(!/^(https?:\/\/|www\.)/i.test(e))return;let t=zT(e.replace(/&[a-zA-Z0-9]+;$/,``),{defaultProtocol:`http`})[0];if(t&&t.start===0)return{value:t.value,href:t.href}}function GT(e){let t=document.createElement(`div`);return t.innerHTML=e,KT(t,{indent:``,inListItem:!1}).trim()+`
135
- `}function KT(e,t){let n=``,r=Array.from(e.childNodes);for(let e=0;e<r.length;e++){let i=r[e];n+=qT(i,t)}return n}function qT(e,t){if(e.nodeType===3)return e.textContent||``;if(e.nodeType!==1)return``;let n=e;switch(n.tagName.toLowerCase()){case`p`:return JT(n,t);case`h1`:case`h2`:case`h3`:case`h4`:case`h5`:case`h6`:return YT(n,t);case`blockquote`:return XT(n,t);case`pre`:return ZT(n,t);case`ul`:return nE(n,t);case`ol`:return rE(n,t);case`table`:return oE(n,t);case`hr`:return t.indent+`***
136
-
137
- `;case`math`:return $T(n,t);case`img`:return uE(n,t);case`video`:return dE(n,t);case`audio`:return fE(n,t);case`embed`:return pE(n,t);case`figure`:return mE(n,t);case`a`:return vE(n,t);case`details`:return xE(n,t);case`div`:return KT(n,t);case`br`:return``;default:return KT(n,t)}}function JT(e,t){let n=wE(SE(e));return t.inListItem?n:t.indent+n+`
138
-
139
- `}function YT(e,t){let n=parseInt(e.tagName[1],10),r=`#`.repeat(n)+` `,i=SE(e);return t.indent+r+i+`
140
-
141
- `}function XT(e,t){let n=Array.from(e.children).filter(e=>{let t=e.tagName.toLowerCase();return[`p`,`ul`,`ol`,`pre`,`blockquote`,`table`,`hr`].includes(t)}),r;if(n.length>0){let e=[];for(let t of n)t.tagName.toLowerCase()===`p`?e.push(SE(t)):e.push(qT(t,{indent:``,inListItem:!1}).trim());r=e.join(`
142
-
143
- `)}else r=SE(e);return r.split(`
144
- `).map(e=>t.indent+`> `+e).join(`
145
- `)+`
146
-
147
- `}function ZT(e,t){let n=e.querySelector(`code`);if(!n)return``;let r=n.getAttribute(`data-language`)||tE(n.className)||``,i=eE(n),a=Math.max(0,...(i.match(/`+/g)??[]).map(e=>e.length)),o="`".repeat(Math.max(3,a+1));return i?[o+r,...(i.endsWith(`
148
- `)?i.slice(0,-1):i).split(`
149
- `),o].map(e=>e&&t.indent+e).join(`
150
- `)+`
151
-
152
- `:t.indent+o+r+`
153
- `+t.indent+o+`
154
-
155
- `}function QT(e){return(e.querySelector(`annotation[encoding="application/x-tex"]`)?.textContent??e.textContent??``).trim()}function $T(e,t){return[`$$`,...QT(e).split(`
156
- `),`$$`].map(e=>e&&t.indent+e).join(`
157
- `)+`
158
-
159
- `}function eE(e){let t=``;for(let n of Array.from(e.childNodes))n.nodeType===3?t+=n.textContent||``:n.nodeType===1&&(n.tagName.toLowerCase()===`br`?t+=`
160
- `:t+=eE(n));return t}function tE(e){let t=e.match(/language-(\S+)/);return t?t[1]:``}function nE(e,t){let n=``,r=Array.from(e.children).filter(e=>e.tagName.toLowerCase()===`li`);for(let e of r)n+=iE(e,`bullet`,t);return t.inListItem||(n+=`
161
- `),n}function rE(e,t){let n=``,r=Array.from(e.children).filter(e=>e.tagName.toLowerCase()===`li`),i=parseInt(e.getAttribute(`start`)||`1`,10);for(let e=0;e<r.length;e++){let a=i+e;n+=iE(r[e],`ordered`,t,a)}return t.inListItem||(n+=`
162
- `),n}function iE(e,t,n,r){let i=null,a=null;for(let t of Array.from(e.children)){let e=t.tagName.toLowerCase();e===`input`&&t.type===`checkbox`&&(i=t),e===`details`&&(a=t)}let o,s;i?(o=`* ${i.checked?`[x]`:`[ ]`} `,s=2):t===`ordered`?(o=`${r}. `,s=o.length):(o=`* `,s=2);let c,l;if(a){let e=a.querySelector(`summary`)?.querySelector(`p`);l=a,c=e?SE(e):``}else l=aE(e,i),c=l?SE(l):``;let u=n.indent+o+c+`
163
- `,d=n.indent+` `.repeat(s),f={indent:d,inListItem:!0};if(a){let e=a.querySelector(`summary`);for(let t of Array.from(a.children))if(t!==e){if(t.tagName.toLowerCase()===`p`){let e=SE(t);u+=`
164
- `+d+e+`
165
- `}else u+=qT(t,f)}}let p=Array.from(e.children);for(let e of p){let t=e.tagName.toLowerCase();if(e!==l&&e!==i&&t!==`input`){if(t===`ul`||t===`ol`)u+=qT(e,f);else if(t===`p`){let t=SE(e);u+=`
166
- `+d+t+`
167
- `}else u+=`
168
- `+qT(e,f)}}return u}function aE(e,t){for(let n of Array.from(e.children)){if(n===t||n.tagName.toLowerCase()===`input`)continue;let e=n.tagName.toLowerCase();if(e===`p`||e===`span`)return n}return null}function oE(e,t){let n=e.querySelector(`colgroup`),r=0;n&&(r=n.querySelectorAll(`col`).length);let i=[],a=!1,o=e.querySelectorAll(`tr`),s=[];o.forEach((e,t)=>{s[t]||(s[t]=[]);let n=e.querySelectorAll(`th, td`),i=0;n.forEach(e=>{for(;s[t][i]!==void 0;)i++;t===0&&e.tagName.toLowerCase()===`th`&&(a=!0);let n=sE(SE(e).trim()),r=parseInt(e.getAttribute(`colspan`)||`1`,10),o=parseInt(e.getAttribute(`rowspan`)||`1`,10);for(let e=0;e<o;e++)for(let a=0;a<r;a++){let r=t+e;s[r]||(s[r]=[]),s[r][i+a]=e===0&&a===0?n:``}i+=r}),s[t]&&(r=Math.max(r,s[t].length))});for(let e of s){let t=[];for(let n=0;n<r;n++)t.push(e&&e[n]!==void 0?e[n]??``:``);i.push(t)}if(i.length===0)return``;let c=[];for(let e=0;e<r;e++){let t=3;for(let n of i){let r=e<n.length?n[e].length:0;t=Math.max(t,r)}c.push(Math.max(t,10))}let l=``;if(a){l+=t.indent+cE(i[0],c,r)+`
169
- `,l+=t.indent+lE(c,r)+`
170
- `;for(let e=1;e<i.length;e++)l+=t.indent+cE(i[e],c,r)+`
171
- `}else{let e=Array(r).fill(``);l+=t.indent+cE(e,c,r)+`
172
- `,l+=t.indent+lE(c,r)+`
173
- `;for(let e of i)l+=t.indent+cE(e,c,r)+`
174
- `}return l+=`
175
- `,l}function sE(e){return e.replace(/\|/g,`\\|`)}function cE(e,t,n){let r=[];for(let i=0;i<n;i++){let n=i<e.length?e[i]:``;r.push(` `+n.padEnd(t[i])+` `)}return`|`+r.join(`|`)+`|`}function lE(e,t){let n=[];for(let r=0;r<t;r++)n.push(` `+`-`.repeat(e[r])+` `);return`|`+n.join(`|`)+`|`}function uE(e,t){let n=e.getAttribute(`src`)||``,r=e.getAttribute(`alt`)||``;return n?t.indent+`![${r}](${n})\n\n`:`
176
-
177
- `}function dE(e,t){let n=e.getAttribute(`src`)||e.getAttribute(`data-url`)||``,r=e.getAttribute(`data-name`)||e.getAttribute(`title`)||``;return n?t.indent+`![${r}](${n})\n\n`:`
178
-
179
- `}function fE(e,t){let n=e.getAttribute(`src`)||``;return n?t.indent+`<audio src="${gE(n)}" controls></audio>\n\n`:`
180
-
181
- `}function pE(e,t){let n=e.getAttribute(`src`)||``;return n?t.indent+`[](${n})\n\n`:`
182
-
183
- `}function mE(e,t){let n=e.querySelector(`img`),r=e.querySelector(`video`),i=e.querySelector(`audio`),a=e.querySelector(`a`),o=e.querySelector(`figcaption`)?.textContent?.trim()||``;return n?hE(`img`,n.getAttribute(`src`)||``,n.getAttribute(`alt`)||``,o,t):r?hE(`video`,r.getAttribute(`src`)||r.getAttribute(`data-url`)||``,r.getAttribute(`data-name`)||r.getAttribute(`title`)||``,o,t):i?hE(`audio`,i.getAttribute(`src`)||``,``,o,t):a?vE(a,t):``}function hE(e,t,n,r,i){if(!t)return``;if(!r&&e!==`audio`)return i.indent+`![${n}](${t})\n\n`;let a=n&&n!==r?e===`img`?` alt="${gE(n)}"`:e===`video`?` data-name="${gE(n)}"`:``:``,o=e===`img`?`<img${a} src="${gE(t)}">`:`<${e} src="${gE(t)}"${a} controls></${e}>`,s=r?`<figcaption>${_E(r)}</figcaption>`:``;return i.indent+`<figure>${o}${s}</figure>\n\n`}function gE(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function _E(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function vE(e,t){let n=e.getAttribute(`href`)||``,r=e.textContent?.trim()||``;return n?t.indent+yE(r,n)+`
184
-
185
- `:t.indent+r+`
186
-
187
- `}function yE(e,t){if(!e)return t;if(e===t){let e=WT(t);if(!/^(https?:\/\/|www\.)/i.test(t)||e?.href===t&&e.value===t)return t}return`[${e}](${bE(t)})`}function bE(e){return e.replace(/[\\()]/g,`\\$&`)}function xE(e,t){let n=e.querySelector(`summary`);if(!n)return KT(e,t);let r=n.querySelector(`h1, h2, h3, h4, h5, h6`);if(r){let i=YT(r,t);for(let r of Array.from(e.children))r!==n&&(i+=qT(r,t));return i}return KT(n,t)}function SE(e){let t=``;for(let n of Array.from(e.childNodes))if(n.nodeType===3)t+=n.textContent||``;else if(n.nodeType===1){let e=n;switch(e.tagName.toLowerCase()){case`strong`:case`b`:{let{content:n,trailing:r}=CE(SE(e));t+=n?`**${n}**${r}`:r;break}case`em`:case`i`:{let{content:n,trailing:r}=CE(SE(e));t+=n?`*${n}*${r}`:r;break}case`s`:case`del`:t+=`~~${SE(e)}~~`;break;case`code`:{let n=e.textContent||``,r=Math.max(0,...(n.match(/`+/g)??[]).map(e=>e.length)),i="`".repeat(r+1),a=n.startsWith("`")||n.endsWith("`");t+=i+(a?` ${n} `:n)+i;break}case`u`:t+=SE(e);break;case`a`:{let n=e.getAttribute(`href`)||``,r=SE(e);t+=yE(r,n);break}case`br`:t+=`\\
188
- `;break;case`math`:{let n=QT(e).split(`
189
- `).map(e=>e.trim()).join(` `);t+=`$${n}$`;break}case`span`:t+=SE(e);break;case`img`:{let n=e.getAttribute(`src`)||``,r=e.getAttribute(`alt`)||``;t+=`![${r}](${n})`;break}case`video`:{let n=e.getAttribute(`src`)||e.getAttribute(`data-url`)||``,r=e.getAttribute(`data-name`)||e.getAttribute(`title`)||``;t+=`![${r}](${n})`;break}case`p`:t+=SE(e);break;case`input`:break;default:t+=SE(e)}}return t}function CE(e){let t=e.match(/^(.*?)(\s*)$/);return t?{content:t[1],trailing:t[2]}:{content:e,trailing:``}}function wE(e){let t=e.replace(/^(\\\n)+/,``);return t=t.replace(/(\\\n)+$/,``),t}function TE(e){return GT(e.split(``).join(``))}function EE(e,t,n,r){return TE(Ow(t,n).exportBlocks(e,r))}var DE=class e extends xr{nodes;constructor(e,t){super(e,t);let n=e.node();this.nodes=[],e.doc.nodesBetween(e.pos,t.pos,(e,t,r)=>{if(r!==null&&r.eq(n))return this.nodes.push(e),!1})}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}content(){return new br(dr.from(this.nodes),0,0)}eq(t){if(!(t instanceof e)||this.nodes.length!==t.nodes.length||this.from!==t.from||this.to!==t.to)return!1;for(let e=0;e<this.nodes.length;e++)if(!this.nodes[e].eq(t.nodes[e]))return!1;return!0}map(t,n){let r=n.mapResult(this.from),i=n.mapResult(this.to);return i.deleted?xr.near(t.resolve(r.pos)):r.deleted?xr.near(t.resolve(i.pos)):new e(t.resolve(r.pos),t.resolve(i.pos))}toJSON(){return{type:`multiple-node`,anchor:this.anchor,head:this.head}}};xr.jsonID(`multiple-node`,DE);var OE;function kE(e,t){let n,r,i=t.resolve(e.from).node().type.spec.group===`blockContent`,a=t.resolve(e.to).node().type.spec.group===`blockContent`,o=Math.min(e.$anchor.depth,e.$head.depth);if(i&&a){let i=e.$from.start(o-1),a=e.$to.end(o-1);n=t.resolve(i-1).pos,r=t.resolve(a+1).pos}else n=e.from,r=e.to;return{from:n,to:r}}function AE(e,t,n=t){t===n&&(n+=e.state.doc.resolve(t+1).node().nodeSize);let r=e.domAtPos(t).node.cloneNode(!1);r.style.removeProperty(`display`);for(let i=t;i<n;i+=e.state.doc.nodeAt(i).nodeSize){let t=e.nodeDOM(i);if(!t)throw Error(`The dragged block at ${i} has no DOM.`);r.appendChild(t.cloneNode(!0))}jE(e.root),OE=r,OE.querySelectorAll(`iframe, embed, object`).forEach(e=>e.parentElement?.removeChild(e));let i=e.dom.className.split(` `).filter(e=>e!==`ProseMirror`&&e!==`bn-root`&&e!==`bn-editor`).join(` `);OE.className=OE.className+` bn-drag-preview `+i,e.root instanceof ShadowRoot?e.root.appendChild(OE):e.root.body.appendChild(OE)}function jE(e){OE!==void 0&&(e instanceof ShadowRoot?e.removeChild(OE):e.body.removeChild(OE),OE=void 0)}function ME(e,t,n){if(!e.dataTransfer||n.headless)return;let r=n.prosemirrorView,i=mw(t.id,r.state.doc);if(!i)throw Error(`Block with ID ${t.id} not found`);let a=i.posBeforeNode;if(a!=null){let t=r.state.selection,i=r.state.doc,{from:o,to:s}=kE(t,i),c=o<=a&&a<s,l=t.$anchor.node()!==t.$head.node()||t instanceof DE;c&&l?(r.dispatch(r.state.tr.setSelection(DE.create(i,o,s))),AE(r,o,s)):(r.dispatch(r.state.tr.setSelection(wr.create(r.state.doc,a))),AE(r,a));let u=r.state.selection.content(),d=n.pmSchema,f=r.serializeForClipboard(u).dom.innerHTML,p=Ow(d,n),m=Vw(u.content),h=p.exportBlocks(m,{}),g=TE(h);e.dataTransfer.clearData(),e.dataTransfer.setData(`blocknote/html`,f),e.dataTransfer.setData(`blocknote/parent`,r.state.selection.$from.parent.type.name),e.dataTransfer.setData(`text/html`,h),e.dataTransfer.setData(`text/plain`,g),e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setDragImage(OE,0,0)}}var NE=350;function PE(e){if(!e||!(`nodeType`in e))return null;let t=e;return t.nodeType===Node.ELEMENT_NODE?t:t.parentElement}var FE=new hr(`SideMenuPlugin`),IE=w_(({editor:e,options:t})=>{let n=T_(void 0),r=t?.sideMenu?.hoverMargin??0,i=!1,a=!1,o,s,c,l;function u(t){return e.schema.blockSpecs[t].implementation.meta.draggable}function d(){l&&=(clearTimeout(l.timer),void 0)}function f(){let e=n.state;e?.show&&n.setState({...e,show:!1})}function p(t){let r=e.getBlock(t.id);r?n.setState({show:!0,referencePos:t.node.getBoundingClientRect(),block:r}):f()}function m(t,s,m){if(i||a)return;if(s&&o?.contains(s)){d(),c=t;return}if(!e.isEditable){d(),f();return}let h=mT(e.prosemirrorView,s,t,u,e.isWithinEditor,r);if(h.kind===`editorUI`)return;let _=n.state,v=_?.show?_.block.id:void 0;if(h.kind===`block`&&h.block.id===v)d(),c=t;else{if(m&&v!==void 0&&o?.isConnected){let e=l?.exit??c??t;if(xT(t,e,o.getBoundingClientRect())){d(),l={exit:e,timer:setTimeout(g,NE)};return}}d(),h.kind===`block`?(c=t,p(h.block)):f()}}function h(){jE(e.prosemirrorView.root),a=!1}function g(){l=void 0,_()}function _(){if(!s)return;let t=e.prosemirrorView,n=o?.isConnected?o.getBoundingClientRect():void 0,r=n!==void 0&&s.x>=n.left&&s.x<=n.right&&s.y>=n.top&&s.y<=n.bottom?{x:n.right+1,y:s.y}:s;m(r,t.root.elementsFromPoint(r.x,r.y).find(n=>t.dom.contains(n)||!e.isWithinEditor(n))??null,!1)}return{key:`sideMenu`,store:n,prosemirrorPlugins:[new Tr({key:FE,appendTransaction:(e,t,n)=>e.some(e=>e.getMeta(`uiEvent`)===`drop`)?n.tr.scrollIntoView():null})],mount({root:r,signal:o}){wT(e.prosemirrorView,()=>a,t?.sideMenu?.dropMargin??250,o),r.addEventListener(`mousemove`,e=>{let{clientX:t,clientY:n,buttons:r}=e;if(i||typeof t!=`number`||typeof n!=`number`||!Number.isFinite(t)||!Number.isFinite(n))return;a&&r===0&&h();let o={x:t,y:n};s=o,m(o,PE(e.target),!0)},{signal:o,capture:!0}),r.addEventListener(`mouseout`,e=>{e.relatedTarget===null&&!i&&!a&&(s=void 0,d(),f())},{signal:o,capture:!0}),r.addEventListener(`keydown`,()=>{n.state?.show&&e.isFocused()&&(d(),f())},{signal:o,capture:!0});let c=e.onChange(()=>{n.state?.show&&(d(),_())});o.addEventListener(`abort`,()=>{c(),d(),f()})},setMenuElement(e){o=e},blockDragStart(t,n){a=!0,ME(t,n,e)},blockDragEnd(){h(),e.blur()},get menuFrozen(){return i},freezeMenu(){i=!0,d();let e=n.state;e&&n.setState({...e,show:!0})},unfreezeMenu(){i=!1,f()},hideMenuIfNotFrozen(){!i&&!a&&(d(),f())}}}),LE=w_(({editor:e})=>{let t=T_({popupOpen:void 0,selected:void 0}),n=t=>!!e.schema.blockSpecs[t.type]?.implementation.meta.hasPreview,r=e=>({editor:r})=>{let{block:i,prevBlock:a,nextBlock:o}=r.getTextCursorPosition();if(!n(i)||t.state.popupOpen===i.id)return!1;let s=e===`prev`?a:o;return s?(r.setTextCursorPosition(s.id,e===`prev`?`end`:`start`),!0):!1};return{key:`sourceBlockWithPreview`,store:t,keyboardShortcuts:{Enter:({editor:e})=>{let{block:r}=e.getTextCursorPosition();if(!n(r))return!1;if(t.state.popupOpen===r.id&&e.schema.blockSpecs[r.type].implementation.keyboard(r).enter===`line-break`){let t=e.prosemirrorView;return t.dispatch(t.state.tr.insertText(`
190
- `)),!0}return e.setTextCursorPosition(r.id,`end`),t.setState(e=>({...e,popupOpen:t.state.popupOpen===r.id?void 0:r.id})),!0},Escape:({editor:e})=>{let{block:r}=e.getTextCursorPosition();return!n(r)||t.state.popupOpen!==r.id?!1:(e.setTextCursorPosition(r.id,`end`),t.setState(e=>({...e,popupOpen:void 0})),!0)},"Mod-a":({editor:e})=>{let{block:r}=e.getTextCursorPosition();if(!n(r)||t.state.popupOpen!==r.id)return!1;let i=e.prosemirrorView,{$from:a}=i.state.selection;return a.parent.type.name===r.type&&(i.dispatch(i.state.tr.setSelection(gr.create(i.state.doc,a.start(),a.end()))),!0)},ArrowUp:r(`prev`),ArrowLeft:r(`prev`),ArrowDown:r(`next`),ArrowRight:r(`next`)},mount:({dom:r,signal:i})=>{let a=e.onSelectionChange(()=>{let{block:r}=e.getTextCursorPosition(),i=n(r)?r.id:void 0,a=t.state.popupOpen&&t.state.popupOpen!==r.id?void 0:t.state.popupOpen;(i!==t.state.selected||a!==t.state.popupOpen)&&t.setState(e=>({...e,selected:i,popupOpen:a}))});i.addEventListener(`abort`,a),r.addEventListener(`keydown`,r=>{if(!e.isEditable)return;let{block:i}=e.getTextCursorPosition();if(n(i)&&t.state.popupOpen!==i.id){if(r.key===`Backspace`||r.key===`Delete`){r.preventDefault(),r.stopImmediatePropagation(),e.removeBlocks([i.id]);return}(r.key.length===1&&!r.ctrlKey&&!r.metaKey||r.key===`Tab`)&&(r.preventDefault(),r.stopImmediatePropagation())}},{capture:!0,signal:i}),r.addEventListener(`blur`,()=>t.setState(e=>({...e,popupOpen:void 0})),{capture:!0,signal:i})}}}),RE=w_(({editor:e})=>{let t=T_({selected:void 0}),n=t=>!!e.schema.inlineContentSpecs[t]?.implementation?.meta?.hasPreview,r=e=>({editor:t})=>{let{$from:r}=t.prosemirrorState.selection,i=r.node();if(!n(i.type.name))return!1;let a=t.prosemirrorView,o=xr.near(a.state.doc.resolve(e===`before`?r.before():r.after()),e===`before`?-1:1);return a.dispatch(a.state.tr.setSelection(o)),!0};return{key:`sourceInlineContentWithPreview`,store:t,keyboardShortcuts:{Enter:r(`after`),"Shift-Enter":r(`after`),Escape:r(`after`),ArrowUp:r(`before`),ArrowDown:r(`after`),"Mod-a":({editor:e})=>{let{$from:t}=e.prosemirrorState.selection;if(!n(t.node().type.name))return!1;let r=e.prosemirrorView;return r.dispatch(r.state.tr.setSelection(gr.create(r.state.doc,t.start(),t.end()))),!0}},mount:({dom:r,signal:i})=>{let a=e.onSelectionChange(()=>{let{$from:r}=e.prosemirrorState.selection,i=r.node();t.setState({selected:n(i.type.name)?r.before():void 0})});i.addEventListener(`abort`,a),r.addEventListener(`keydown`,t=>{if(t.key!==`ArrowUp`&&t.key!==`ArrowDown`)return;let{$from:i}=e.prosemirrorState.selection;n(i.node().type.name)||(r.classList.add(`bn-suppress-source-popup-caret`),requestAnimationFrame(()=>r.classList.remove(`bn-suppress-source-popup-caret`)))},{capture:!0,signal:i}),r.addEventListener(`blur`,()=>t.setState({selected:void 0}),{capture:!0,signal:i})}}}),zE=Symbol.for(`blocknote.shikiParser`),BE=Symbol.for(`blocknote.shikiHighlighterPromise`),VE=[`text`,`none`,`plaintext`,`txt`];function HE(e,t,n){let r=globalThis,i,a,o=new Set;return cw({parser:t=>{if(!e.createHighlighter)return[];if(!i)return r[BE]=r[BE]||e.createHighlighter(),r[BE].then(e=>{i=e});let n=t.language;return!n||VE.includes(n)||o.has(n)?[]:i.getLoadedLanguages().includes(n)?(a||(a=r[zE]||dw(i,UE(i)),r[zE]=a),a(t)):i.loadLanguage(n).catch(()=>{o.add(n)})},languageExtractor:e=>{let t={type:e.type.name,props:e.attrs};return(n.blockSpecs[t.type]||n.inlineContentSpecs[t.type])?.implementation.meta.highlight?.(t)??void 0},nodeTypes:t})}function UE(e){let t=e.getLoadedThemes(),n=t.find(e=>/light/i.test(e)),r=t.find(e=>/dark/i.test(e));if(n&&r)return{themes:{light:n,dark:r},defaultColor:!1}}function WE(e){let t=Object.values(e.blockSpecs).filter(e=>typeof e?.config==`object`&&e.config.content===`plain`&&!!e.implementation.meta.highlight).map(e=>e.config.type),n=Object.values(e.inlineContentSpecs).filter(e=>typeof e?.config==`object`&&e.config.content===`plain`&&!!e.implementation?.meta?.highlight).map(e=>e.config.type);return[...t,...n]}w_(({editor:e,options:t})=>({key:`syntaxHighlighting`,prosemirrorPlugins:[HE(t,WE(e.schema),e.schema)]}));var GE;async function KE(){return GE||(GE=(async()=>{let[e,t]=await Promise.all([jn(()=>import(`./module-BrWgIX20.js`),[],import.meta.url),jn(()=>import(`./native-Cqs-2kTC.js`),[],import.meta.url)]),n=`default`in e?e.default:e,r=`default`in t?t.default:t;return await n.init({data:r}),{emojiMart:n,emojiData:r}})(),GE)}async function qE(e,t){if(!(`text`in e.schema.inlineContentSchema)||e.schema.inlineContentSchema.text!==ew.text)return[];let{emojiData:n,emojiMart:r}=await KE();return(t.trim()===``?Object.values(n.emojis):await r.SearchIndex.search(t)).map(t=>({id:t.skins[0].native,onItemClick:()=>e.insertInlineContent(t.skins[0].native+` `)}))}var JE;function YE(e){JE||(JE=document.createElement(`div`),JE.innerHTML=`_`,JE.style.opacity=`0`,JE.style.height=`1px`,JE.style.width=`1px`,e instanceof Document?e.body.appendChild(JE):e.appendChild(JE))}function XE(e){JE&&=(e instanceof Document?e.body.removeChild(JE):e.removeChild(JE),void 0)}function ZE(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function QE(e){let t=e;for(;t&&t.nodeName!==`TD`&&t.nodeName!==`TH`&&!t.classList.contains(`tableWrapper`);){if(t.classList.contains(`ProseMirror`))return;let e=t.parentNode;if(!e||!(e instanceof Element))return;t=e}return t.nodeName===`TD`||t.nodeName===`TH`?{type:`cell`,domNode:t,tbodyNode:t.closest(`tbody`)}:{type:`wrapper`,domNode:t,tbodyNode:t.querySelector(`tbody`)}}function $E(e,t){let n=t.querySelectorAll(e);for(let e=0;e<n.length;e++)n[e].style.visibility=`hidden`}var eD=class{editor;pmView;state;emitUpdate;tableId;tablePos;tableElement;menuFrozen=!1;mouseState=`up`;prevWasEditable=null;constructor(e,t,n){this.editor=e,this.pmView=t,this.emitUpdate=()=>{n(this.state)},t.dom.addEventListener(`mousemove`,this.mouseMoveHandler),t.dom.addEventListener(`mousedown`,this.viewMousedownHandler),window.addEventListener(`mouseup`,this.mouseUpHandler),t.root.addEventListener(`dragover`,this.dragOverHandler),t.root.addEventListener(`drop`,this.dropHandler)}viewMousedownHandler=()=>{this.mouseState=`down`};hideHandles=()=>{this.state?.show&&(this.state.show=!1,this.state.showAddOrRemoveRowsButton=!1,this.state.showAddOrRemoveColumnsButton=!1,this.emitUpdate())};mouseUpHandler=e=>{this.mouseState=`up`,this.mouseMoveHandler(e)};mouseMoveHandler=e=>{if(this.menuFrozen||this.mouseState===`selecting`||!(e.target instanceof Element)||!this.pmView.dom.contains(e.target))return;let t=QE(e.target);if(t?.type===`cell`&&this.mouseState===`down`&&!this.state?.draggingState){this.mouseState=`selecting`,this.hideHandles();return}if(!t||!this.editor.isEditable){this.hideHandles();return}if(!t.tbodyNode)return;let n=t.tbodyNode.getBoundingClientRect(),r=yw(t.domNode,this.pmView);if(!r){this.hideHandles();return}let{pmNodeInfo:i,doc:a}=this.editor.transact(e=>({pmNodeInfo:mw(r.id,e.doc),doc:e.doc}));if(!i){this.hideHandles();return}let o=Vb(i.node,a);if(!NC(o,this.editor,`table`)){this.hideHandles();return}let s=o;this.tablePos=i.posBeforeNode+1,this.tableElement=r.node,this.tableId=r.id;let c=t.domNode.closest(`.tableWrapper`)?.querySelector(`.table-widgets-container`);if(t?.type===`wrapper`){let t=e.clientY>=n.bottom-1&&e.clientY<n.bottom+20,r=e.clientX>=n.right-1&&e.clientX<n.right+20,i=this.state?.block?.id!==s.id||e.clientX>n.right||e.clientY>n.bottom;this.state={...this.state,show:!0,showAddOrRemoveRowsButton:t,showAddOrRemoveColumnsButton:r,referencePosTable:n,block:s,widgetContainer:c,colIndex:i?void 0:this.state?.colIndex,rowIndex:i?void 0:this.state?.rowIndex,referencePosCell:i?void 0:this.state?.referencePosCell}}else{let e=ZE(t.domNode),i=ZE(t.domNode.parentElement),a=t.domNode.getBoundingClientRect();if(this.state!==void 0&&this.state.show&&this.tableId===r.id&&this.state.rowIndex===i&&this.state.colIndex===e)return;this.state={show:!0,showAddOrRemoveColumnsButton:e===s.content.rows[0].cells.length-1,showAddOrRemoveRowsButton:i===s.content.rows.length-1,referencePosTable:n,block:s,draggingState:void 0,referencePosCell:a,colIndex:e,rowIndex:i,widgetContainer:c}}return this.emitUpdate(),!1};dragOverHandler=e=>{if(this.state?.draggingState===void 0)return;e.preventDefault(),e.dataTransfer.dropEffect=`move`,$E(`.prosemirror-dropcursor-block, .prosemirror-dropcursor-inline`,this.pmView.root);let t={left:Math.min(Math.max(e.clientX,this.state.referencePosTable.left+1),this.state.referencePosTable.right-1),top:Math.min(Math.max(e.clientY,this.state.referencePosTable.top+1),this.state.referencePosTable.bottom-1)},n=this.pmView.root.elementsFromPoint(t.left,t.top).filter(e=>e.tagName===`TD`||e.tagName===`TH`);if(n.length===0)return;let r=n[0],i=!1,a=ZE(r.parentElement),o=ZE(r),s=this.state.draggingState.draggedCellOrientation===`row`?this.state.rowIndex:this.state.colIndex,c=(this.state.draggingState.draggedCellOrientation===`row`?a:o)!==s;(this.state.rowIndex!==a||this.state.colIndex!==o)&&(this.state.rowIndex=a,this.state.colIndex=o,this.state.referencePosCell=r.getBoundingClientRect(),i=!0);let l=this.state.draggingState.draggedCellOrientation===`row`?t.top:t.left;this.state.draggingState.mousePos!==l&&(this.state.draggingState.mousePos=l,i=!0),i&&this.emitUpdate(),c&&this.editor.transact(e=>e.setMeta(tD,!0))};dropHandler=e=>{if(this.mouseState=`up`,this.state===void 0||this.state.draggingState===void 0)return!1;if(this.state.rowIndex===void 0||this.state.colIndex===void 0)throw Error(`Attempted to drop table row or column, but no table block was hovered prior.`);e.preventDefault();let{draggingState:t,colIndex:n,rowIndex:r}=this.state;this.state.draggingState=void 0;let i=this.state.block.content.columnWidths;if(t.draggedCellOrientation===`row`){if(!aS(this.state.block,t.originalIndex,r))return!1;let e=tS(this.state.block,t.originalIndex,r);this.editor.updateBlock(this.state.block,{type:`table`,content:{...this.state.block.content,rows:e}})}else{if(!oS(this.state.block,t.originalIndex,n))return!1;let e=eS(this.state.block,t.originalIndex,n),[r]=i.splice(t.originalIndex,1);i.splice(n,0,r),this.editor.updateBlock(this.state.block,{type:`table`,content:{...this.state.block.content,columnWidths:i,rows:e}})}return this.editor.setTextCursorPosition(this.state.block.id),!0};getTablePos(e){if(this.tableId===void 0)return;let t=mw(this.tableId,e);return t&&t.posBeforeNode+1}update(){if(!this.state||!this.state.show)return;let e=this.editor.getBlock(this.state.block.id);if(!e||e.type!==`table`||!this.tableElement?.isConnected){this.state=void 0,this.tableId=void 0,this.tablePos=void 0,this.tableElement=void 0,this.emitUpdate();return}this.state.block=e,this.tablePos=this.getTablePos(this.pmView.state.doc);let{height:t,width:n}=Xx(this.state.block);this.state.rowIndex!==void 0&&this.state.colIndex!==void 0&&(this.state.rowIndex>=t&&(this.state.rowIndex=t-1),this.state.colIndex>=n&&(this.state.colIndex=n-1));let r=this.tableElement.querySelector(`tbody`);if(!r)throw Error(`Table block does not contain a 'tbody' HTML element. This should never happen.`);if(this.state.rowIndex!==void 0&&this.state.colIndex!==void 0){let e=r.children[this.state.rowIndex].children[this.state.colIndex];e?this.state.referencePosCell=e.getBoundingClientRect():(this.state.rowIndex=void 0,this.state.colIndex=void 0)}this.state.referencePosTable=r.getBoundingClientRect(),this.emitUpdate()}destroy(){this.pmView.dom.removeEventListener(`mousemove`,this.mouseMoveHandler),window.removeEventListener(`mouseup`,this.mouseUpHandler),this.pmView.dom.removeEventListener(`mousedown`,this.viewMousedownHandler),this.pmView.root.removeEventListener(`dragover`,this.dragOverHandler),this.pmView.root.removeEventListener(`drop`,this.dropHandler)}},tD=new hr(`TableHandlesPlugin`),nD=w_(({editor:e})=>{let t,n=T_(void 0);return{key:`tableHandles`,store:n,prosemirrorPlugins:[new Tr({key:tD,view:r=>(t=new eD(e,r,e=>{n.setState(e?.block?{...e,draggingState:e.draggingState?{...e.draggingState}:void 0}:void 0)}),t),props:{decorations:e=>{if(t===void 0||t.state===void 0||t.state.draggingState===void 0)return;let n=t.getTablePos(e.doc);if(n===void 0)return;let r=t.state.draggingState.draggedCellOrientation===`row`?t.state.rowIndex:t.state.colIndex;if(r===void 0)return;let i=[],{block:a,draggingState:o}=t.state,{originalIndex:s,draggedCellOrientation:c}=o;if(r===s||!a||c===`row`&&!aS(a,s,r)||c===`col`&&!oS(a,s,r))return Cr.create(e.doc,i);let l=e.doc.resolve(n+1);return t.state.draggingState.draggedCellOrientation===`row`?Qx(t.state.block,r).forEach(({row:t,col:n})=>{let a=e.doc.resolve(l.posAtIndex(t)+1),o=e.doc.resolve(a.posAtIndex(n)+1),c=o.node(),u=o.pos+(r>s?c.nodeSize-2:0);i.push(Er.widget(u,()=>{let e=document.createElement(`div`);return e.className=`bn-table-drop-cursor`,e.style.left=`0`,e.style.right=`0`,r>s?e.style.bottom=`-2px`:e.style.top=`-3px`,e.style.height=`4px`,e}))}):$x(t.state.block,r).forEach(({row:t,col:n})=>{let a=e.doc.resolve(l.posAtIndex(t)+1),o=e.doc.resolve(a.posAtIndex(n)+1),c=o.node(),u=o.pos+(r>s?c.nodeSize-2:0);i.push(Er.widget(u,()=>{let e=document.createElement(`div`);return e.className=`bn-table-drop-cursor`,e.style.top=`0`,e.style.bottom=`0`,r>s?e.style.right=`-2px`:e.style.left=`-3px`,e.style.width=`4px`,e}))}),Cr.create(e.doc,i)}}})],colDragStart(n){if(t===void 0||t.state===void 0||t.state.colIndex===void 0)throw Error(`Attempted to drag table column, but no table block was hovered prior.`);t.state.draggingState={draggedCellOrientation:`col`,originalIndex:t.state.colIndex,mousePos:n.clientX},t.emitUpdate(),e.transact(e=>e.setMeta(tD,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.colIndex,newIndex:t.state.colIndex,tablePos:t.tablePos})),!e.headless&&(YE(e.prosemirrorView.root),n.dataTransfer.setDragImage(JE,0,0),n.dataTransfer.effectAllowed=`move`)},rowDragStart(n){if(t.state===void 0||t.state.rowIndex===void 0)throw Error(`Attempted to drag table row, but no table block was hovered prior.`);t.state.draggingState={draggedCellOrientation:`row`,originalIndex:t.state.rowIndex,mousePos:n.clientY},t.emitUpdate(),e.transact(e=>e.setMeta(tD,{draggedCellOrientation:t.state.draggingState.draggedCellOrientation,originalIndex:t.state.rowIndex,newIndex:t.state.rowIndex,tablePos:t.tablePos})),!e.headless&&(YE(e.prosemirrorView.root),n.dataTransfer.setDragImage(JE,0,0),n.dataTransfer.effectAllowed=`copyMove`)},dragEnd(){if(t.state===void 0)throw Error(`Attempted to drag table row, but no table block was hovered prior.`);t.state.draggingState=void 0,t.emitUpdate(),e.transact(e=>e.setMeta(tD,null)),!e.headless&&XE(e.prosemirrorView.root)},freezeHandles(){t.menuFrozen=!0},unfreezeHandles(){t.menuFrozen=!1},hideHandlesIfNotFrozen(){t.menuFrozen||t.hideHandles()},getCellsAtRowHandle(e,t){return Qx(e,t)},getCellsAtColumnHandle(e,t){return $x(e,t)},setCellSelection(e,n,r=n){if(!t)throw Error(`Table handles view not initialized`);let i=t.getTablePos(e.doc);if(i===void 0)throw Error(`Attempted to select table cells, but the hovered table is no longer in the document.`);let a=e.doc.resolve(i+1),o=e.doc.resolve(a.posAtIndex(n.row)+1),s=e.doc.resolve(o.posAtIndex(n.col)),c=e.doc.resolve(a.posAtIndex(r.row)+1),l=e.doc.resolve(c.posAtIndex(r.col)),u=e.tr;return u.setSelection(new Z_(s,l)),e.apply(u)},addRowOrColumn(t,n){e.exec((e,r)=>{let i=this.setCellSelection(e,n.orientation===`row`?{row:t,col:0}:{row:0,col:t});return n.orientation===`row`?n.side===`above`?hv(i,r):gv(i,r):n.side===`left`?lv(i,r):uv(i,r)})},removeRowOrColumn(t,n){return n===`row`?e.exec((e,n)=>vv(this.setCellSelection(e,{row:t,col:0}),n)):e.exec((e,n)=>fv(this.setCellSelection(e,{row:0,col:t}),n))},mergeCells(t){return e.exec((e,n)=>xv(t?this.setCellSelection(e,t.relativeStartCell,t.relativeEndCell):e,n))},splitCell(t){return e.exec((e,n)=>Sv(t?this.setCellSelection(e,t):e,n))},getCellSelection(){return e.transact(e=>{let t=e.selection,n=t.$from,r=t.$to;if(PC(t)){let{ranges:e}=t;e.forEach(e=>{n=e.$from.min(n??e.$from),r=e.$to.max(r??e.$to)})}else{let i=t.$from.pos-t.$from.parentOffset-1,a=t.$to.pos-t.$to.parentOffset-1;if(i<0||a<0||(n=e.doc.resolve(i),r=e.doc.resolve(a),!FC(n.parent)||!FC(r.parent)))return}let i=e.doc.resolve(n.pos-n.parentOffset-1),a=e.doc.resolve(r.pos-r.parentOffset-1),o=e.doc.resolve(i.pos-i.parentOffset-1),s=n.index(i.depth),c=i.index(o.depth),l=r.index(a.depth),u=a.index(o.depth),d=[];for(let e=c;e<=u;e++)for(let t=s;t<=l;t++)d.push({row:e,col:t});return{from:{row:c,col:s},to:{row:u,col:l},cells:d}})},getMergeDirection(t){return e.transact(e=>{let n=PC(e.selection)?e.selection:void 0;if(!n||!t||n.ranges.length<=1)return;let r=this.getCellSelection();if(r)return sS(r.from,r.to,t)?`vertical`:`horizontal`})},cropEmptyRowsOrColumns(e,t){return rS(e,t)},addRowsOrColumns(e,t,n){return iS(e,t,n)}}}),rD=new hr(`trailingNode`);function iD(e){let t=e.lastChild,n=t?.firstChild;return t?.type.name!==`blockContainer`||n?.type.name!==`paragraph`||n.content.size!==0}function aD(e){if(!e.type.schema.nodes.column){let t=e.lastChild;return t&&iD(t)?[e.content.size-1]:[]}let t=[];return e.descendants((e,n,r)=>!e.isTextblock&&((e.type.name===`column`||e.type.name===`blockGroup`&&r?.type.name===`doc`)&&iD(e)&&t.push(n+e.nodeSize-1),!0)),t}var oD=w_(({editor:e})=>{function t(t){return Er.widget(t,()=>{let t=document.createElement(`div`);return t.className=`bn-trailing-block`,t.contentEditable=`false`,t.addEventListener(`mousedown`,n=>{n.preventDefault();let r=e.prosemirrorView;if(!r)return;let i=r.state.doc.resolve(r.posAtDOM(t,0)).parent.lastChild?.attrs.id;i&&(e.transact(t=>{let[n]=e.insertBlocks([{type:`paragraph`}],i,`after`);e.setTextCursorPosition(n,`start`),t.scrollIntoView()}),r.focus())}),t},{side:1})}function n(e,n,r){let i=n.map(e.mapping,e.doc),a=new Set(r?aD(e.doc):[]),o=new Set,s=[];for(let e of i.find())a.has(e.from)&&!o.has(e.from)?o.add(e.from):s.push(e);let c=[...a].filter(e=>!o.has(e)),l=i;return s.length>0&&(l=l.remove(s)),c.length>0&&(l=l.add(e.doc,c.map(t))),l}return{key:`trailingNode`,prosemirrorPlugins:[new Tr({key:rD,state:{init:(t,r)=>n(r.tr,Cr.empty,e.isEditable),apply:(t,r)=>!t.docChanged&&!t.getMeta(rD)?r:n(t,r,e.isEditable)},view(e){let t=e.editable;return{update(e){e.editable!==t&&(t=e.editable,e.dispatch(e.state.tr.setMeta(rD,!0)))}}},props:{decorations:e=>rD.getState(e),handleKeyDown:(t,n)=>{if(n.key!==`ArrowRight`&&n.key!==`ArrowDown`)return!1;let{selection:r}=t.state;if(!r.empty)return!1;let i=xr.atEnd(t.state.doc);if(r.$head.pos!==i.$head.pos)return!1;let a=t.state.doc.lastChild;return!e.isEditable||!a||!iD(a)?!1:(n.preventDefault(),!0)}}})]}}),sD=class{match;handler;undoable;inCode;inCodeMark;constructor(e,t,n={}){this.match=e,this.match=e,this.handler=typeof t==`string`?cD(t):t,this.undoable=n.undoable!==!1,this.inCode=n.inCode||!1,this.inCodeMark=n.inCodeMark!==!1}};function cD(e){return function(t,n,r,i){let a=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);a+=n[0].slice(e+n[1].length),r+=e;let t=r-i;t>0&&(a=n[0].slice(e-t,e)+a,r=i)}return t.tr.insertText(a,r,i)}}var lD=500;function uD({rules:e}){let t=new Tr({state:{init(){return null},apply(e,t){return e.getMeta(this)||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput(n,r,i,a){return dD(n,r,i,a,e,t)},handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&dD(n,r.pos,r.pos,``,e,t)})}}},isInputRules:!0});return t}function dD(e,t,n,r,i,a){if(e.composing)return!1;let o=e.state.tr.insertText(r,t,n),s=o.mapping.map(t),c=o.mapping.map(n),l=null,u=o.doc.resolve(s),d=u.parent.textBetween(Math.max(0,u.parentOffset-lD),u.parentOffset,null,``);for(let t=0;t<i.length;t++){let n=i[t];if(!n.inCodeMark&&u.marks().some(e=>e.type.spec.code))continue;if(u.parent.type.spec.code){if(!n.inCode)continue}else if(n.inCode===`only`)continue;let f=n.match.exec(d);if(!f||f[0].length<r.length)continue;l??=e.state.apply(o);let p=n.handler(l,f,s-f[0].length,c);if(p)return e.dispatch(o),e.dispatch(Jt(e.state.tr)),n.undoable&&p.setMeta(a,{transform:p,from:s,to:c,text:r}),e.dispatch(p),!0}return!1}new sD(/--$/,`—`,{inCodeMark:!1}),new sD(/\.\.\.$/,`…`,{inCodeMark:!1}),new sD(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,`“`,{inCodeMark:!1}),new sD(/"$/,`”`,{inCodeMark:!1}),new sD(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,`‘`,{inCodeMark:!1}),new sD(/'$/,`’`,{inCodeMark:!1});var fD=dt.create({name:`gapCursor`,addProseMirrorPlugins(){return[_t()]},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:Xe(pt(e,`allowGapCursor`,t))??null}}});function pD(e){return e.matches(`[data-editable]`)?e:e.querySelector(`[data-editable]`)||e}function mD(e,t){return Or.fromSchema(t).parse(e,{topNode:t.nodes.paragraph.create(),preserveWhitespace:!0}).content}function hD(e,t){let n=[];return e.forEach(e=>{if(e.isText)n.push(e);else{let r=e.type===t.linebreakReplacement?`
191
- `:e.textContent;r&&n.push(t.text(r,e.marks))}}),dr.fromArray(n)}function gD(e,t,n){let r=e.content===`plain`||n&&e.content===`styled`?t=>(r,i)=>{let a=n?.({el:r,schema:i});if(a!==void 0)return e.content===`plain`?hD(a,i):a;let o=mD(t(r),i);return e.content===`plain`?hD(o,i):o}:void 0,i=[{tag:`[data-inline-content-type="${e.type}"]`,contentElement:e=>pD(e),getContent:r?(e,t)=>r(pD)(e,t):void 0}];return t&&i.push({tag:`*`,getAttrs(e){if(typeof e==`string`)return!1;let n=t?.(e);return n!==void 0&&n},preserveWhitespace:r?!0:void 0,getContent:r?(e,t)=>r(e=>e)(e,t):void 0}),i}function _D(e,t,n,r=`before`){let i=typeof n==`string`?n:n.id,a=kb(e),o=t.map(e=>{let t=hS(e,a);return t.check(),t}),s=mw(i,e.doc);if(!s)throw Error(`Block with ID ${i} not found`);if(o.length===0)return[];let c=zy(e.doc,My(e.doc,s.posBeforeNode),r,o[0].type);if(!c)throw Error(`Cannot insert blocks at "${r}" of block "${i}": no valid position for them`);if(c.wrapIn&&!c.wrapIn.validContent(dr.from(o)))throw Error(`Cannot insert blocks at "${r}" of block "${i}": a "${c.wrapIn.name}" doesn't accept them`);let l=c.wrapIn?dr.from(c.wrapIn.create(null,o)):dr.from(o),u=e.doc.resolve(c.pos);if(!u.parent.canReplace(u.index(),u.index(),l))throw Error(`Cannot insert blocks at "${r}" of block "${i}": a "${u.parent.type.name}" doesn't accept them`);return e.step(new yr(c.pos,c.pos,new br(l,0,0))),o.map(t=>Vb(t,e.doc))}function vD(e){if(e.type.name===`blockContainer`){let t=e.firstChild;return e.childCount===1&&!!t&&t.type.name===`paragraph`&&t.childCount===0}return my(e.type)?e.childCount===1?vD(e.firstChild):e.childCount===0&&by(e.type.spec.blockConfig?.children)>=1:!1}function yD(e,t){let n=e.doc.resolve(t).nodeAfter;if(!n||!my(n.type))throw Error(`Invalid layoutBlockPos: does not point to a layout block node.`);if(gy(n.type))return;let r=n.type.spec.blockConfig?.children;if(r&&`dissolve`in r&&r.dissolve===!1)return;let i=by(n.type.spec.blockConfig?.children),a=[],o=[];if(n.forEach((e,n)=>{if(!vD(e))a.push({node:e,offset:n});else if(my(e.type)){let r=t+1+n;o.push({from:r,to:r+e.nodeSize})}}),a.length>=i){for(let{from:t,to:n}of o.reverse())e.delete(t,n);return}if(a.length===1){let[{node:r,offset:i}]=a,o=t+1+i,s=gy(r.type)?{from:o+1,to:o+r.nodeSize-1}:{from:o,to:o+r.nodeSize};e.step(new Sr(t,t+n.nodeSize,s.from,s.to,br.empty,0,!1));return}let s=[];for(let{node:e}of a)gy(e.type)?e.forEach(e=>s.push(e)):s.push(e);e.replaceWith(t,t+n.nodeSize,dr.from(s))}function bD(e,t){[...t].sort((e,t)=>t.depth-e.depth).forEach(({id:t})=>{let n=mw(t,e.doc);n&&my(n.node.type)&&yD(e,n.posBeforeNode)})}function xD(e,t,n,r={}){let i=kb(e),a=n.map(e=>{let t=hS(e,i);return t.check(),t}),o=new Set(t.map(e=>typeof e==`string`?e:e.id)),s=[],c=[],l=typeof t[0]==`string`?t[0]:t[0].id,u=e.steps.length,d=t=>e.mapping.slice(u).map(t);if(e.doc.descendants((t,r)=>{if(o.size===0)return!1;if(!t.type.isInGroup(`bnBlock`))return!0;let i=ky(t,e.doc);if(!o.has(i))return!0;s.push(Vb(t,e.doc)),o.delete(i),n.length>0&&i===l&&e.insert(d(r),a);let u=e.doc.resolve(d(r));for(let e of Hy(u.doc,u.pos))c.some(t=>t.id===e.id)||c.push(e);let f=u.node();return f.type.name===`blockGroup`&&u.node(u.depth-1).type.name!==`doc`&&f.childCount===1?e.delete(u.before(),u.after()):e.delete(u.pos,u.pos+t.nodeSize),!1}),o.size>0){let e=[...o].join(`
192
- `);throw Error(`Blocks with the following IDs could not be found in the editor: `+e)}return r.fixLayoutBlocks!==!1&&bD(e,c),{insertedBlocks:a.map(t=>Vb(t,e.doc)),removedBlocks:s}}var SD=(e,t)=>({tr:n,dispatch:r})=>(r&&CD(n,e,t),!0);function CD(e,t,n,r,i){let a=e.mapping.maps.length,o=My(e.doc,t),s=o.hasContent&&o.blockNoteType===`table`?AD(e):null,c=kb(e);if(r!==void 0&&i!==void 0&&r>i)throw Error(`Invalid replaceFromPos or replaceToPos`);let l=n.type||o.blockNoteType,u=c.nodes[l],d=u.isInGroup(`bnBlock`)?u:c.nodes.blockContainer,f=o.hasContent&&r!==void 0&&r>=o.contentStart&&r<=o.contentEnd?r-o.contentStart:void 0,p=o.hasContent&&i!==void 0&&i>=o.contentStart&&i<=o.contentEnd?i-o.contentStart:void 0;if(o.hasContent!==u.isInGroup(`blockContent`)||!o.hasContent&&!u.validContent(o.block.node.content)){let t=Vb(o.block.node,e.doc),r=Mb(c)[l],i,a=[...t.children];Array.isArray(t.content)&&t.content.length&&(r.content===`inline`||r.content===`plain`?i=t.content:my(u)&&a.unshift({type:`paragraph`,content:t.content}));let s=hS({id:t.id,...i?{content:i}:{},...a.length>0?{children:a}:{},...n},c);s.check();let d=e.doc.resolve(o.block.beforePos);if(!d.parent.canReplace(d.index(),d.index(),dr.from(s)))throw Error(`Cannot update block to "${l}": a "${d.parent.type.name}" doesn't accept it`);e.replaceWith(o.block.beforePos,o.block.afterPos,s)}else OD(n,e,o),o.hasContent&&wD(n,e,c.nodes[o.blockNoteType],u,o,f,p),ED(e,o.block.beforePos,d,{...n.props}),s&&o.hasContent&&jD(e,e.mapping.slice(a).map(o.content.beforePos),s)}function wD(e,t,n,r,i,a,o){let s=kb(t),c=`keep`;if(e.content){if(typeof e.content==`string`)c=dS([e.content],s,r.name);else if(Array.isArray(e.content))c=dS(e.content,s,r.name);else if(e.content.type===`tableContent`)c=fS(e.content,s);else throw new sb(e.content.type)}else{let e=i.content.node.content;if(n.spec.content!==``&&r.spec.content!==n.spec.content&&!r.validContent(e)){if(r.inlineContent&&n.inlineContent){let e=i.content.node.textContent;c=e.length>0?[s.text(e)]:[]}else c=[]}}if(c===`keep`)ED(t,i.content.beforePos,r,{...e.props});else if(a!==void 0||o!==void 0){let n=DD(t,i.content.beforePos,r,{...e.props}),s=n+1+(a??0),l=n+1+(o??i.content.node.content.size),u=t.doc.resolve(n).depth,d=t.doc.resolve(s).depth,f=t.doc.resolve(l).depth;t.replace(s,l,new br(dr.from(c),d-u-1,f-u-1))}else r===n||r.validContent(i.content.node.content)?TD(t,DD(t,i.content.beforePos,r,{...e.props}),dr.from(c)):t.replaceWith(i.content.beforePos,i.content.afterPos,r.createChecked({...i.content.node.attrs,...e.props},c))}function TD(e,t,n){let r=e.doc.nodeAt(t);if(!r)throw RangeError(`No node at given position`);let i=r.content,a=t+1;if(r.isTextblock){let t=i.findDiffStart(n);if(t===null)return;let{a:r,b:o}=i.findDiffEnd(n),s=Math.max(0,t-r,t-o);s>0&&(r+=s,o+=s),e.replace(a+t,a+r,new br(n.cut(t,o),0,0));return}let o=i.childCount,s=n.childCount,c=0;for(;c<o&&c<s&&i.child(c).eq(n.child(c));)c++;let l=o,u=s;for(;l>c&&u>c&&i.child(l-1).eq(n.child(u-1));)l--,u--;if(c===l&&c===u)return;let d=a;for(let e=0;e<c;e++)d+=i.child(e).nodeSize;let f=d;for(let e=c;e<l;e++)f+=i.child(e).nodeSize;let p=[];for(let e=c;e<u;e++)p.push(n.child(e));e.step(new yr(d,f,new br(dr.from(p),0,0)))}function ED(e,t,n,r){let i=e.doc.nodeAt(t);if(!i)throw RangeError(`No node at given position`);let a=n.spec.attrs??{},o={};for(let e of Object.keys(r))e in a&&(o[e]=r[e]);let s={...i.attrs,...o};if(i.type===n)for(let n of Object.keys(s))s[n]!==i.attrs[n]&&e.setNodeAttribute(t,n,s[n]);else e.setNodeMarkup(t,n,s)}function DD(e,t,n,r){let i=e.mapping.maps.length;return ED(e,t,n,r),e.mapping.slice(i).map(t,-1)}function OD(e,t,n){let r=kb(t);if(e.children!==void 0&&e.children.length>0){let i=e.children.map(e=>{let t=hS(e,r);return t.check(),t});n.children?TD(t,n.children.beforePos,dr.from(i)):n.hasContent&&t.insert(n.content.afterPos,hy(r,i))}}function kD(e,t,n,r,i){let a=typeof t==`string`?t:t.id,o=mw(a,e.doc);if(!o)throw Error(`Block with ID ${a} not found`);CD(e,o.posBeforeNode,n,r,i);let s=e.doc.resolve(o.posBeforeNode).nodeAfter;if(!s)throw Error(`Block with ID ${a} not found after update`);return Vb(s,e.doc)}function AD(e){let t=`selection`in e?e.selection:null;if(!(t instanceof gr))return null;let n=e.doc.resolve(t.head),r=-1,i=-1;for(let e=n.depth;e>=0;e--){let t=n.node(e).type.name;if(r<0&&(t===`tableCell`||t===`tableHeader`)&&(r=e),t===`table`){i=e;break}}if(r<0||i<0)return null;let a=n.before(r),o=n.before(i),s=e.doc.nodeAt(o);if(!s||s.type.name!==`table`)return null;let c=M_.get(s),l=a-(o+1),u=c.map.indexOf(l);if(u<0)return null;let d=Math.floor(u/c.width),f=u%c.width,p=a+1+1;return{row:d,col:f,offset:Math.max(0,t.head-p)}}function jD(e,t,n){let r=e.doc.nodeAt(t);if(!r||r.type.name!==`table`)return!1;let i=M_.get(r),a=Math.max(0,Math.min(n.row,i.height-1)),o=Math.max(0,Math.min(n.col,i.width-1)),s=a*i.width+o,c=i.map[s];if(c==null)return!1;let l=t+1+c+1,u=e.doc.nodeAt(l),d=l+1,f=u?u.content.size:0,p=d+Math.max(0,Math.min(n.offset,f));return`selection`in e&&e.setSelection(gr.create(e.doc,p)),!0}var MD=[[`textColor`,`data-text-color`],[`backgroundColor`,`data-background-color`]];function ND(e){return typeof e==`string`&&e!=="default"}function PD(e){return MD.some(([t])=>ND(e[t]))}function FD(e,t){for(let[n,r]of MD){let i=t?.[n];ND(i)?e.setAttribute(r,i):e.removeAttribute(r)}}var ID={blockColor:`data-block-color`,blockStyle:`data-block-style`,id:`data-id`,depth:`data-depth`,depthChange:`data-depth-change`},LD=st.create({name:`blockContainer`,group:`blockGroupChild bnBlock`,content:`blockContent blockGroup?`,priority:50,defining:!0,marks(){return yb(this.editor)},parseHTML(){return[{tag:`div[data-node-type=`+this.name+`]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t={};for(let[n,r]of Object.entries(ID))e.getAttribute(r)&&(t[n]=e.getAttribute(r));return t},contentElement:e=>qb(e)??e},{tag:`div[data-node-type="blockOuter"]`,skip:!0}]},renderHTML({HTMLAttributes:e}){let t=document.createElement(`div`);t.className=`bn-block-outer`,t.setAttribute(`data-node-type`,`blockOuter`);for(let[n,r]of Object.entries(e))n!==`class`&&t.setAttribute(n,r);let n={...this.options.domAttributes?.block||{},...e},r=document.createElement(`div`);r.className=db(`bn-block`,n.class),r.setAttribute(`data-node-type`,this.name);for(let[e,t]of Object.entries(n))e!==`class`&&r.setAttribute(e,t);return t.appendChild(r),{dom:t,contentDOM:r}},addNodeView(){return(e=>{let{dom:t,contentDOM:n}=this.type.spec.toDOM(e.node),r=this.options.editor,i=Xb({props:e,editor:r,blockNode:e=>e.firstChild,unframed:n});i.dom!==n&&n.appendChild(i.dom);let a=e.node.firstChild.attrs;return PD(a)&&FD(n,a),{dom:t,contentDOM:i.slot,update(e,t,r){let a=i.node;return!e.sameMarkup(a)||!i.update(e,t,r)?!1:(e.firstChild.sameMarkup(a.firstChild)||FD(n,e.firstChild.attrs),!0)},...tx(i)}})}});function RD(e,t,n,r,i){let a;if(!t)throw Error(`blockContent is required`);if(typeof t==`string`)a=dS([t],e.pmSchema,r);else if(Array.isArray(t))a=dS(t,e.pmSchema,r);else if(t.type===`tableContent`)a=fS(t,e.pmSchema);else throw new sb(t.type);let o=(i?.document??document).createDocumentFragment();for(let t of a)if(t.type.name!==`text`&&e.schema.inlineContentSchema[t.type.name]){let r=e.schema.inlineContentSpecs[t.type.name].implementation;if(r){let a=Bb(t,e.schema.inlineContentSchema,e.schema.styleSchema),s=r.render.call({renderType:`dom`,props:void 0},a,()=>{},e);if(s){if(o.appendChild(s.dom),s.contentDOM){let e=n.serializeFragment(t.content,i);s.contentDOM.dataset.editable=``,s.contentDOM.appendChild(e)}continue}}}else if(t.type.name===`text`){let n=document.createTextNode(t.textContent);for(let r of t.marks.toReversed())if(r.type.name in e.schema.styleSpecs){let t=e.schema.styleSpecs[r.type.name].implementation.render(r.attrs.stringValue,e);t.contentDOM.appendChild(n),n=t.dom}else{let e=r.type.spec.toDOM(r,!0),t=pr.renderSpec(document,e);t.contentDOM.appendChild(n),n=t.dom}o.appendChild(n)}else{let e=n.serializeFragment(dr.from([t]),i);o.appendChild(e)}return o}function zD(e,t,n,r){let i=e.pmSchema.nodes.blockContainer,a=t.props||{};for(let[n,r]of Object.entries(e.schema.blockSchema[t.type].propSchema))!(n in a)&&r.default!==void 0&&(a[n]=r.default);let o=t.children||[],s=e.blockImplementations[t.type].implementation,c={...t,props:a,children:o};if(my(e.pmSchema.nodes[t.type])){let i=Yb(e,c);if(!i)throw Error(`Layout block "${t.type}" drew no frame. This is a bug in BlockNote.`);return o.length>0&&i.slot.append(BD(e,o,n,r)),i.dom}if(!s.render)throw Error(`Block "${t.type}" has no \`render\`. This is a bug in BlockNote.`);let l=s.render.call({renderType:`dom`,props:void 0},c,e);if(l.contentDOM&&t.content){let i=RD(e,t.content,n,t.type,r);l.contentDOM.appendChild(i)}let u=i.spec?.toDOM?.(i.create({id:t.id,...a}));u.contentDOM&&FD(u.contentDOM,a);let d=u.contentDOM,f=Yb(e,c);return f&&(Kb(f.slot),u.contentDOM?.appendChild(f.dom),d=f.slot),d?.appendChild(l.dom),o.length>0&&d?.appendChild(VD(e,o,n,r)),u.dom}function BD(e,t,n,r){let i=(r?.document??document).createDocumentFragment();for(let a of t){let t=zD(e,a,n,r);i.appendChild(t)}return i}var VD=(e,t,n,r)=>{let i=e.pmSchema.nodes.blockGroup,a=i.spec.toDOM(i.create({})),o=BD(e,t,n,r);return a.contentDOM?.appendChild(o),a.dom},HD=e=>(e.querySelectorAll(`[data-content-type="numberedListItem"]`).forEach(e=>{let t=e.closest(`.bn-block-outer`)?.previousElementSibling?.querySelector(`[data-content-type="numberedListItem"]`);if(!t)e.setAttribute(`data-index`,e.getAttribute(`data-start`)||`1`);else{let n=t.getAttribute(`data-index`);e.setAttribute(`data-index`,(parseInt(n||`0`)+1).toString())}}),e),UD=e=>(e.querySelectorAll(`[data-content-type="checkListItem"] input`).forEach(e=>{e.disabled=!0}),e),WD=e=>(e.querySelectorAll(`.bn-toggle-button[aria-expanded="false"]`).forEach(e=>{e.setAttribute(`aria-expanded`,`true`)}),e),GD=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{e.setAttribute(`style`,`--default-cell-min-width: 120px;`),e.setAttribute(`data-show-children`,`true`)}),e),KD=e=>(e.querySelectorAll(`[data-content-type="table"] table`).forEach(e=>{let t=document.createElement(`div`);t.className=`tableWrapper`;let n=document.createElement(`div`);n.className=`tableWrapper-inner`,t.appendChild(n),e.parentElement?.appendChild(t),t.appendChild(e)}),e),qD=e=>(e.querySelectorAll(`.bn-inline-content:empty`).forEach(e=>{let t=document.createElement(`span`);t.className=`ProseMirror-trailingBreak`,t.setAttribute(`style`,`display: inline-block;`),e.appendChild(t)}),e),JD=(e,t)=>{let n=pr.fromSchema(e),r=[HD,UD,WD,GD,KD,qD];return{serializeBlocks:(e,i)=>{let a=VD(t,e,n,i);for(let e of r)a=e(a);return a.outerHTML}}},YD=class{callbacks={};on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),()=>this.off(e,t)}emit(e,...t){let n=this.callbacks[e];n&&n.forEach(e=>e.apply(this,t))}off(e,t){let n=this.callbacks[e];n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e])}removeAllListeners(){this.callbacks={}}};function XD(e,t){return e.flatMap(e=>gy(t.nodes[e.type])?XD(e.children,t):[e])}function ZD(e){return e.transact(e=>{let t=Ny(e,e.selection.anchor),n=ky(t.block.node,e.doc);if(e.selection instanceof Z_)return{type:`cell`,anchorBlockId:n,anchorCellOffset:e.selection.$anchorCell.pos-t.block.beforePos,headCellOffset:e.selection.$headCell.pos-t.block.beforePos};if(e.selection instanceof wr)return{type:`node`,anchorBlockId:n};{let r=Ny(e,e.selection.head);return{type:`text`,anchorBlockId:n,headBlockId:ky(r.block.node,e.doc),anchorOffset:e.selection.anchor-t.block.beforePos,headOffset:e.selection.head-r.block.beforePos}}})}function QD(e,t){let n=mw(t.anchorBlockId,e.doc)?.posBeforeNode;if(n===void 0)throw Error(`Could not find block with ID ${t.anchorBlockId} to update selection`);let r;if(t.type===`cell`)r=Z_.create(e.doc,n+t.anchorCellOffset,n+t.headCellOffset);else if(t.type===`node`){let t=My(e.doc,n);r=wr.create(e.doc,t.hasContent?t.content.beforePos:n)}else{let i=mw(t.headBlockId,e.doc)?.posBeforeNode;if(i===void 0)throw Error(`Could not find block with ID ${t.headBlockId} to update selection`);r=gr.create(e.doc,n+t.anchorOffset,i+t.headOffset)}e.setSelection(r)}function $D(e,t,n,r){e.transact(i=>{xD(i,t,[],{fixLayoutBlocks:!1}),_D(i,XD(t,e.pmSchema),n,r)})}function eO(e,t,n){e.transact(r=>{let i=e.getSelection()?.blocks||[e.getTextCursorPosition().block],a=ZD(e);$D(e,i,t,n),QD(r,a)})}function tO(e,t){let n=XD([t],e.pmSchema)[0],r=n&&e.pmSchema.nodes[n.type];return r&&my(r)?r:e.pmSchema.nodes.blockContainer}function nO(e,t,n,r,i){let a=n===`up`?`before`:`after`,o=n===`up`?`after`:`before`;for(;r||i;){let s=r&&r.children.length>0,c=r?s?r.children[n===`up`?r.children.length-1:0]:r:i,l=s?o:a;if(e.transact(e=>{let n=mw(c.id,e.doc);return n!==void 0&&zy(e.doc,My(e.doc,n.posBeforeNode),l,t)!==null}))return{referenceBlock:c,placement:l};i=e.getParentBlock(c),r=l===o?c:n===`up`?e.getPrevBlock(c):e.getNextBlock(c)}}function rO(e,t,n){e.transact(()=>{let r;if(n){let t=e.getBlock(n);if(!t)return;r=[t]}else r=e.getSelection()?.blocks||[e.getTextCursorPosition().block];let i=r[t===`up`?0:r.length-1],a=nO(e,tO(e,r[0]),t,t===`up`?e.getPrevBlock(i):e.getNextBlock(i),e.getParentBlock(i));a&&(n?$D(e,r,a.referenceBlock,a.placement):eO(e,a.referenceBlock,a.placement))})}function iO(e,t){rO(e,`up`,t)}function aO(e,t){rO(e,`down`,t)}function oO(e,t){return e.childCount>0&&e.type.isInGroup(`childContainer`)&&e.type.contentMatch.matchType(t)!==null}function sO(e,t,n){let{$from:r,$to:i}=e.selection,a=r.blockRange(i,e=>oO(e,t));if(!a)return!1;let o=a.startIndex;if(o===0)return!1;let s=a.parent.child(o-1);if(s.type!==t)return!1;let c=s.lastChild&&s.lastChild.type===n?2:1,l=new br(dr.from(t.create(null,dr.from(n.create()))),c,0),u=a.start,d=a.end;return e.step(new Sr(u-c,d,u,d,l,2-c,!0)).scrollIntoView(),!0}function cO(e){return t=>sO(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup)}function lO(e){return e.transact(cO(e))}function uO(e,t,n,r){let i=r.end,a=r.$to.end(r.depth);if(i<a){let o=r.parent.child(r.endIndex-1),s=o.lastChild&&o.lastChild.type===n;e.step(new Sr(i-(s?2:1),a,i,a,new br(dr.from(t.create(null,n.create())),s?2:1,0),+!s,!0)),r=new ur(e.doc.resolve(r.$from.pos),e.doc.resolve(a),r.depth)}let o=fr(r);if(o==null)return!1;e.lift(r,o);let s=e.doc.resolve(e.mapping.map(i,-1)-1);return mr(e.doc,s.pos)&&s.nodeBefore.type===s.nodeAfter.type&&e.join(s.pos),e.scrollIntoView(),!0}function dO(e,t,n,r){let{$from:i,$to:a}=e.selection,o=i.blockRange(a,e=>oO(e,t));if(!o)return!1;let s=i.node(o.depth-1);return s.type===t&&!r(s)?!1:s.type===t&&uO(e,t,n,o)}function fO(e){return t=>dO(t,e.pmSchema.nodes.blockContainer,e.pmSchema.nodes.blockGroup,n=>{let r=Vb(n,t.doc);return e.schema.blockSpecs[r.type].implementation.keyboard(r).childrenCanOutdent})}function pO(e){return e.transact(fO(e))}function mO(e){return e.canExec(t=>cO(e)(t.tr))}function hO(e){return e.canExec(t=>fO(e)(t.tr))}function gO(e,t){let n=mw(typeof t==`string`?t:t.id,e);if(n)return Vb(n.node,e)}function _O(e,t){let n=mw(typeof t==`string`?t:t.id,e);if(!n)return;let r=e.resolve(n.posBeforeNode).nodeBefore;if(r)return Vb(r,e)}function vO(e,t){let n=mw(typeof t==`string`?t:t.id,e);if(!n)return;let r=e.resolve(n.posBeforeNode+n.node.nodeSize).nodeAfter;if(r)return Vb(r,e)}function yO(e,t){let n=mw(typeof t==`string`?t:t.id,e);if(!n)return;let r=Fy(e,n.posBeforeNode);if(r)return Vb(r.block.node,e)}var bO=class{editor;constructor(e){this.editor=e}get document(){return this.editor.transact(e=>Hb(e.doc))}getBlock(e){return this.editor.transact(t=>gO(t.doc,e))}getPrevBlock(e){return this.editor.transact(t=>_O(t.doc,e))}getNextBlock(e){return this.editor.transact(t=>vO(t.doc,e))}getParentBlock(e){return this.editor.transact(t=>yO(t.doc,e))}forEachBlock(e,t=!1){let n=this.document.slice();t&&n.reverse();function r(n){for(let i of n)if(e(i)===!1||!r(t?i.children.slice().reverse():i.children))return!1;return!0}r(n)}insertBlocks(e,t,n=`before`){return this.editor.transact(r=>_D(r,e,t,n))}updateBlock(e,t){return this.editor.transact(n=>kD(n,e,t))}removeBlocks(e){return this.editor.transact(t=>xD(t,e,[]).removedBlocks)}replaceBlocks(e,t){return this.editor.transact(n=>xD(n,e,t))}canNestBlock(){return mO(this.editor)}nestBlock(){lO(this.editor)}canUnnestBlock(){return hO(this.editor)}unnestBlock(){pO(this.editor)}moveBlocksUp(e){return iO(this.editor,e)}moveBlocksDown(e){return aO(this.editor,e)}},xO=class extends YD{editor;constructor(e){super(),this.editor=e,e.on(`create`,()=>{e._tiptapEditor.on(`update`,({transaction:t,appendedTransactions:n})=>{this.emit(`onChange`,{editor:e,transaction:t,appendedTransactions:n})}),e._tiptapEditor.on(`selectionUpdate`,({transaction:t})=>{this.emit(`onSelectionChange`,{editor:e,transaction:t})}),e._tiptapEditor.on(`focus`,({event:t})=>{this.emit(`onFocusChange`,{editor:e,focused:!0,event:t})}),e._tiptapEditor.on(`blur`,({event:t})=>{this.emit(`onFocusChange`,{editor:e,focused:!1,event:t})}),e._tiptapEditor.on(`mount`,()=>{this.emit(`onMount`,{editor:e})}),e._tiptapEditor.on(`unmount`,()=>{this.emit(`onUnmount`,{editor:e})});let t;this.onMount(()=>{t=this.attachUIFocusTracker()}),this.onUnmount(()=>{t&&t()})})}attachUIFocusTracker(){if(typeof document>`u`)return()=>{};let e=this.editor.isFocused({includeEditorUI:!0}),t,n=t=>{let n=this.editor.isFocused({includeEditorUI:!0});n!==e&&(e=n,this.emit(`onFocusChangeWithinUI`,{editor:this.editor,focused:n,event:t}))},r=e=>n(e),i=e=>{clearTimeout(t),t=setTimeout(()=>n(e))};return document.addEventListener(`focusin`,r,!0),document.addEventListener(`focusout`,i,!0),()=>{clearTimeout(t),document.removeEventListener(`focusin`,r,!0),document.removeEventListener(`focusout`,i,!0)}}onChange(e,t=!0){return this.on(`onChange`,({transaction:n,appendedTransactions:r})=>{(t||!SO(n))&&e(this.editor,{getChanges(){return Pw(n,r)}})})}onSelectionChange(e,t=!1){return this.on(`onSelectionChange`,({transaction:n})=>{(t||!SO(n))&&e(this.editor)})}onFocusChange(e,t){return this.on(t?.includeEditorUI?`onFocusChangeWithinUI`:`onFocusChange`,({focused:t,event:n})=>e(this.editor,{focused:t,event:n}))}onMount(e){return this.on(`onMount`,e)}onUnmount(e){return this.on(`onUnmount`,e)}};function SO(e){return!!e.getMeta(`y-sync$`)}function CO(e){return Array.prototype.indexOf.call(e.parentElement.childNodes,e)}function wO(e){return e.nodeType===3&&!/\S/.test(e.nodeValue||``)}function TO(e){e.querySelectorAll(`li > ul, li > ol`).forEach(e=>{let t=CO(e),n=e.parentElement,r=Array.from(n.childNodes).slice(t+1);e.remove(),r.forEach(e=>{e.remove()}),n.insertAdjacentElement(`afterend`,e),r.reverse().forEach(t=>{if(wO(t))return;let n=document.createElement(`li`);n.append(t),e.insertAdjacentElement(`afterend`,n)}),n.childNodes.length===0&&n.remove()})}function EO(e){e.querySelectorAll(`li + ul, li + ol`).forEach(e=>{let t=e.previousElementSibling,n=document.createElement(`div`);t.insertAdjacentElement(`afterend`,n),n.append(t);let r=document.createElement(`div`);for(r.setAttribute(`data-node-type`,`blockGroup`),n.append(r);n.nextElementSibling?.nodeName===`UL`||n.nextElementSibling?.nodeName===`OL`;)r.append(n.nextElementSibling)})}var DO=null;function OO(){return DO||=document.implementation.createHTMLDocument(`title`)}function kO(e){if(typeof e==`string`){let t=OO().createElement(`div`);t.innerHTML=e,e=t}return TO(e),EO(e),e}function AO(e){let t=e.ownerDocument.createTreeWalker(e,128),n;for(;n=t.nextNode();)if(/^\s*notionvc:/.test(n.nodeValue||``))return!0;return!1}function jO(e){let t=new Set([`PRE`,`CODE`]),n=e.ownerDocument.createTreeWalker(e,4,{acceptNode(n){let r=n.parentElement;for(;r&&r!==e;){if(t.has(r.tagName))return 2;r=r.parentElement}return 1}}),r=[],i;for(;i=n.nextNode();)r.push(i);for(let e of r)e.nodeValue&&/[\r\n]/.test(e.nodeValue)&&(e.nodeValue=e.nodeValue.replace(/[ \t\r\n\f]+/g,` `))}function MO(e){AO(e)||jO(e)}function NO(e){let t=[];for(let n of e)if(n.type===`text`){let e=n.text.split(``).join(``);e.length>0&&t.push({...n,text:e})}else Array.isArray(n.content)?t.push({...n,content:NO(n.content)}):t.push(n);return t}function PO(e){for(let t of e)Array.isArray(t.content)&&(t.content=NO(t.content)),t.children.length>0&&PO(t.children)}function FO(e,t){let n=kO(e);MO(n);let r=Or.fromSchema(t).parse(n,{topNode:t.nodes.blockGroup.create()}),i=[];for(let e=0;e<r.childCount;e++)i.push(Vb(r.child(e),r));return PO(i),i}function IO(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function LO(e){return e?/\w/.test(e):!1}function RO(e,t,n){let r=t>0?e[t-1]:void 0,i=t+n<e.length?e[t+n]:void 0;return LO(r)&&LO(i)}function zO(e,t){if(e[t]!==`\\`||t+1>=e.length)return null;let n=e[t+1];return n===`
193
- `?{html:`<br>
194
- `,end:t+2}:"\\`*_{}[]()#+-.!~|>".includes(n)?{html:IO(n),end:t+2}:null}function BO(e,t){return e[t]==="`"?ok(e,t):null}function VO(e,t){return e[t]!==`!`||e[t+1]!==`[`?null:sk(e,t)}function HO(e,t){return e[t]===`[`?ck(e,t):null}function UO(e,t){let n=e.substring(t);if(e[t]===`<`){let e=n.match(/^<([a-zA-Z][a-zA-Z0-9+.-]{1,31}:[^\s<>]*)>/);if(e){let n=e[1];return{html:`<a href="${IO(n)}">${IO(n)}</a>`,end:t+e[0].length}}let r=n.match(/^<([^\s<>]+)>/),i=r?.[1],a=i?zT(i).find(e=>e.type===`email`&&e.start===0&&e.end===i.length):void 0;return r&&i&&a?{html:`<a href="${IO(a.href)}">${IO(i)}</a>`,end:t+r[0].length}:null}if(t>0&&/[a-zA-Z0-9_]/.test(e[t-1]))return null;let r=n.match(/^(https?:\/\/|www\.)[^\s<>]+/i);if(!r)return null;let i=WT(r[0]);return i?{html:`<a href="${IO(i.href)}">${IO(i.value)}</a>`,end:t+i.value.length}:null}function WO(e,t,n){return e[t]!==`~`||e[t+1]!==`~`?null:fk(e,t,`~~`,`<del>`,`</del>`,n)}function GO(e,t,n){return e[t]===`*`&&e[t+1]===`*`&&e[t+2]===`*`||e[t]===`_`&&e[t+1]===`_`&&e[t+2]===`_`&&!RO(e,t,3)?fk(e,t,e.substring(t,t+3),`<strong><em>`,`</em></strong>`,n):null}function KO(e,t,n){return e[t]===`*`&&e[t+1]===`*`||e[t]===`_`&&e[t+1]===`_`&&!RO(e,t,2)?fk(e,t,e.substring(t,t+2),`<strong>`,`</strong>`,n):null}function qO(e,t,n){return e[t]===`*`||e[t]===`_`&&!RO(e,t,1)?fk(e,t,e[t],`<em>`,`</em>`,n):null}function JO(e,t){return e[t]===`
195
- `?{html:`<br>
196
- `,end:t+1}:null}var YO=/^<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9_.:-]*(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*\s*\/?>/,XO=/^<!--[\s\S]*?-->/,ZO=/^<!\[CDATA\[[\s\S]*?\]\]>/,QO=/^<\?[\s\S]*?\?>/,$O=/^<![A-Za-z][\s\S]*?>/;function ek(e,t){if(e[t]!==`<`)return null;let n=e.substring(t);for(let e of[XO,ZO,QO,$O,YO]){let r=n.match(e);if(r)return{html:r[0],end:t+r[0].length}}return null}var tk=new Set(`\\\`![~*_
197
- <`);function nk(e,t){let n=e[t];return tk.has(n)?!0:n===`h`?e.startsWith(`http://`,t)||e.startsWith(`https://`,t):n===`w`&&e.startsWith(`www.`,t)}var rk=[zO,BO,VO,HO,UO,WO,GO,KO,qO,ek,JO],ik=rk.filter(e=>e!==HO&&e!==UO);function ak(e,t=!0){let n=``,r=0,i=t?rk:ik;for(;r<e.length;){if(e[r]===`
198
- `&&r>=2&&e[r-1]===` `&&e[r-2]===` `){n=n.replace(/ +$/,``),n+=`<br>
199
- `,r++;continue}let a=!1;if(nk(e,r))for(let o of i){let i=o(e,r,t);if(i){n+=i.html,r=i.end,a=!0;break}}if(!a){let t=r;for(r++;r<e.length&&!nk(e,r);)r++;n+=IO(e.substring(t,r))}}return n}function ok(e,t){let n=0,r=t;for(;r<e.length&&e[r]==="`";)n++,r++;let i=r;for(;i<e.length;)if(e[i]==="`"){let t=0,a=i;for(;i<e.length&&e[i]==="`";)t++,i++;if(t===n){let t=e.substring(r,a);return t=t.replace(/\n/g,` `),t.length>=2&&t[0]===` `&&t[t.length-1]===` `&&/[^ ]/.test(t)&&(t=t.substring(1,t.length-1)),{html:`<code>${IO(t)}</code>`,end:i}}}else i++;return null}function sk(e,t){let n=lk(e,t+1);if(n===-1)return null;let r=t+2;if(e[n+1]!==`(`)return null;let i=n+2,a=uk(e,i-1);if(a===-1)return null;let o=e.substring(r,n),{url:s,title:c}=dk(e.substring(i,a));if(wb(s)){let e=o||c;return{html:`<video src="${IO(s)}"${e?` data-name="${IO(e)}"`:``} data-url="${IO(s)}" controls></video>`,end:a+1}}let l=c===void 0?``:` title="${IO(c)}"`;return{html:`<img src="${IO(s)}" alt="${IO(o)}"${l}>`,end:a+1}}function ck(e,t){let n=t+1,r=lk(e,t);if(r===-1||e[r+1]!==`(`)return null;let i=r+2,a=uk(e,r+1);if(a===-1)return null;let o=e.substring(n,r),{url:s,title:c}=dk(e.substring(i,a)),l=c===void 0?``:` title="${IO(c)}"`;return{html:`<a href="${IO(s)}"${l}>${ak(o,!1)}</a>`,end:a+1}}function lk(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]===`\\`&&r+1<e.length)r++;else if(e[r]===`[`&&n++,e[r]===`]`&&(n--,n===0))return r;return-1}function uk(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]===`\\`&&r+1<e.length)r++;else if(e[r]===`(`&&n++,e[r]===`)`&&(n--,n===0))return r;return-1}function dk(e){e=e.trim();let t,n;if(e.startsWith(`<`)){let r=e.indexOf(`>`);r===-1?(t=e.substring(1),n=``):(t=e.substring(1,r),n=e.substring(r+1).trim())}else{let r=e.length;for(let t=0;t<e.length;t++)if(e[t]===`\\`&&t+1<e.length)t++;else if(e[t]===` `||e[t]===` `||e[t]===`
200
- `){r=t;break}t=e.substring(0,r),n=e.substring(r).trim()}let r;if(n.length>0){let e=n.match(/^"([^"]*)"$|^'([^']*)'$|^\(([^)]*)\)$/);e&&(r=e[1]??e[2]??e[3])}return{url:t,title:r}}function fk(e,t,n,r,i,a){let o=n.length,s=t+o;if(s>=e.length||e[s]===` `||e[s]===` `)return null;let c=s;for(;c<e.length;)if(e[c]===`\\`&&c+1<e.length)c+=2;else{if(e.substring(c,c+o)===n){if(e[c-1]===` `||e[c-1]===` `||o===1&&(c>0&&e[c-1]===n[0]&&!(c>=2&&e[c-2]===`\\`)||c+o<e.length&&e[c+o]===n[0])){c++;continue}let t=e.substring(s,c);if(t.length===0){c++;continue}return{html:r+ak(t,a)+i,end:c+o}}c++}return null}var pk=new Set(`address.article.aside.audio.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.section.source.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`));function mk(e){if(/^ {0,3}<(!--|\?|![A-Za-z]|!\[CDATA\[)/.test(e))return!0;let t=e.match(/^ {0,3}<\/?([a-zA-Z][a-zA-Z0-9-]*)(?:\s|\/?>|$)/);return t?pk.has(t[1].toLowerCase()):!1}function hk(e){let t=e.split(`
201
- `),n=[],r=0,i=!0;for(;r<t.length;){let e=t[r];if(e.trim()===``){i=!0,r++;continue}let a=e.match(/^ {0,3}(`{3,}|~{3,})(.*)$/);if(a){let e=a[1],o=e[0],s=e.length,c=a[2].trim(),l=[];for(r++;r<t.length;){if(t[r].match(RegExp(`^ {0,3}${o}{${s},}\\s*$`))){r++;break}l.push(t[r]),r++}n.push({type:`codeBlock`,language:c||``,code:l.join(`
202
- `)}),i=!1;continue}let o=e.match(/^(#{1,6})\s+(.+?)(?:\s+#+\s*|\s*)$/);if(o){n.push({type:`heading`,level:o[1].length,content:o[2]}),i=!1,r++;continue}if(/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e)){let t=n[n.length-1];if(!i&&e.trim().match(/^-+$/)&&t&&t.type===`paragraph`){let e=t;n[n.length-1]={type:`heading`,level:2,content:e.content},i=!1,r++;continue}n.push({type:`hr`}),i=!1,r++;continue}if(r+1<t.length){let a=t[r+1];if(/^={1,}\s*$/.test(a)&&e.trim().length>0){n.push({type:`heading`,level:1,content:e.trim()}),i=!1,r+=2;continue}}let s=gk(t,r);if(s){n.push(s.token),r=s.nextLine,i=!1;continue}if(/^\s{0,3}>/.test(e)){let e=[];for(;r<t.length&&/^\s{0,3}>/.test(t[r]);)e.push(t[r].replace(/^\s{0,3}>\s?/,``)),r++;for(;r<t.length;){let n=t[r];if(n.trim()===``||/^\s{0,3}>/.test(n)||/^(#{1,6})\s/.test(n)||/^(`{3,}|~{3,})/.test(n)||/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(n)||/^\s*([-*+]|\d+[.)])\s+/.test(n)||/^\s*\|(.+\|)+\s*$/.test(n))break;e.push(n),r++}n.push({type:`blockquote`,content:e.join(`
203
- `)}),i=!1;continue}let c=e.match(/^(\s*)([-*+]|\d+[.)])(\s+)(\[[ xX]\] )?(.*)$/);if(c){let e=c[1].length,a=c[2],o=c[3],s=c[4],l=c[5],u,d,f;s?(u=`task`,f=s.trim()!==`[ ]`):/^\d+[.)]$/.test(a)?(u=`ordered`,d=parseInt(a,10)):u=`bullet`;let p=e+a.length+o.length+(s?s.length:0),m=e+1,h=e=>{if(e.trim()===``)return!0;let t=e.match(/^\s*/)[0].length;return!!(t>=p||t>=m&&e.match(/^\s*([-*+]|\d+[.)])\s+/))};r++;let g=[];for(;r<t.length;){let e=t[r];if(e.trim()===``){let e=r+1;for(;e<t.length&&t[e].trim()===``;)e++;if(e<t.length&&h(t[e])){g.push(``),r++;continue}break}if(!h(e))break;e.match(/^\s*/)[0].length>=p?g.push(e.substring(p)):g.push(e.substring(m)),r++}let _=g.join(`
204
- `).replace(/^\n+|\n+$/g,``);n.push({type:`listItem`,listType:u,indent:e,content:l.trim(),start:d,checked:f,childContent:_||void 0}),i=!1;continue}if(mk(e)){let e=[];for(;r<t.length&&t[r].trim()!==``;)e.push(t[r]),r++;n.push({type:`rawHtml`,content:e.join(`
205
- `)}),i=!1;continue}let l=[e];for(r++;r<t.length;){let e=t[r];if(e.trim()===``||/^(#{1,6})\s/.test(e)||/^(`{3,}|~{3,})/.test(e)||/^\s{0,3}>/.test(e)||/^(\s{0,3})([-*_])\s*(\2\s*){2,}$/.test(e)||/^\s*([-*+]|\d+[.)])\s+/.test(e)||/^\s*\|(.+\|)+\s*$/.test(e)||mk(e)||r+1<t.length&&/^[=-]+\s*$/.test(t[r+1])&&e.trim().length>0)break;l.push(e),r++}n.push({type:`paragraph`,content:l.map(e=>e.replace(/^ {1,3}/,``)).join(`
206
- `).replace(/[ \t]+$/,``)}),i=!1}return n}function gk(e,t){if(t+1>=e.length)return null;let n=e[t],r=e[t+1];if(!r.includes(`|`)||!/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/.test(r)||!n.includes(`|`))return null;let i=_k(n),a=vk(r),o=[],s=t+2;for(;s<e.length;){let t=e[s];if(!t.includes(`|`))break;o.push(_k(t)),s++}return{token:{type:`table`,headers:i,rows:o,alignments:a},nextLine:s}}function _k(e){let t=e.trim(),n=t.startsWith(`|`)?t.substring(1):t,r=n.endsWith(`|`)?n.substring(0,n.length-1):n,i=[],a=``;for(let e=0;e<r.length;e++)r[e]===`\\`&&e+1<r.length&&r[e+1]===`|`?(a+=`|`,e++):r[e]===`|`?(i.push(a.trim()),a=``):a+=r[e];return i.push(a.trim()),i}function vk(e){return _k(e).map(e=>{let t=e.trim(),n=t.startsWith(`:`),r=t.endsWith(`:`);return n&&r?`center`:r?`right`:n?`left`:null})}function yk(e){let t=``,n=0;for(;n<e.length;){let r=e[n];switch(r.type){case`heading`:{let e=r;t+=`<h${e.level}>${ak(e.content)}</h${e.level}>`,n++;break}case`paragraph`:t+=`<p>${ak(r.content)}</p>`,n++;break;case`codeBlock`:{let e=r,i=e.language?` data-language="${IO(e.language)}"`:``;t+=`<pre><code${i}>${IO(e.code)}</code></pre>`,n++;break}case`blockquote`:{let e=yk(hk(r.content));t+=`<blockquote>${e}</blockquote>`,n++;break}case`hr`:t+=`<hr>`,n++;break;case`listItem`:{let r=bk(e,n);t+=r.html,n=r.nextIndex;break}case`table`:t+=Sk(r),n++;break;case`rawHtml`:t+=r.content,n++;break;default:n++}}return t}function bk(e,t){let n=``,r=t,i=null;for(;r<e.length&&e[r].type===`listItem`;){let t=e[r],a=xk(t.listType);if(i!==null&&i!==a&&(n+=`</${i===`ordered`?`ol`:`ul`}>`,i=null),i===null){if(a===`ordered`){let e=t.start!==void 0&&t.start!==1?` start="${t.start}"`:``;n+=`<ol${e}>`}else n+=`<ul>`;i=a}if(t.listType===`task`){let e=t.checked?` checked`:``;n+=`<li><input type="checkbox" disabled${e}><p>${ak(t.content)}</p>`}else n+=`<li><p>${ak(t.content)}</p>`;if(t.childContent){let e=hk(t.childContent);n+=yk(e)}n+=`</li>`,r++}return i!==null&&(n+=`</${i===`ordered`?`ol`:`ul`}>`),{html:n,nextIndex:r}}function xk(e){return e===`ordered`?`ordered`:`bullet`}function Sk(e){let t=`<table>`,n=e.headers.every(e=>e.trim()===``),r=e.headers.length;if(!n){t+=`<thead><tr>`;for(let n=0;n<r;n++){let r=e.alignments[n],i=r?` align="${r}"`:``;t+=`<th${i}>${ak(e.headers[n])}</th>`}t+=`</tr></thead>`}if(e.rows.length>0){t+=`<tbody>`;for(let n of e.rows){t+=`<tr>`;for(let i=0;i<r;i++){let r=i<n.length?n[i]:``,a=e.alignments[i],o=a?` align="${a}"`:``;t+=`<td${o}>${ak(r)}</td>`}t+=`</tr>`}t+=`</tbody>`}return t+=`</table>`,t}function Ck(e){return yk(hk(e))}function wk(e){return Ck(e)}function Tk(e,t){return FO(wk(e),t)}var Ek=class{editor;constructor(e){this.editor=e}blocksToHTMLLossy(e=this.editor.document){return Ow(this.editor.pmSchema,this.editor).exportBlocks(e,{})}blocksToFullHTML(e=this.editor.document){return JD(this.editor.pmSchema,this.editor).serializeBlocks(e,{})}tryParseHTMLToBlocks(e){return FO(e,this.editor.pmSchema)}blocksToMarkdownLossy(e=this.editor.document){return EE(e,this.editor.pmSchema,this.editor,{})}tryParseMarkdownToBlocks(e){return Tk(e,this.editor.pmSchema)}pasteHTML(e,t=!1){let n=e;if(!t){let t=this.tryParseHTMLToBlocks(e);n=this.blocksToFullHTML(t)}n&&this.editor.prosemirrorView?.pasteHTML(n)}pasteText(e){return this.editor.prosemirrorView?.pasteText(e)}pasteMarkdown(e){let t=wk(e);return this.pasteHTML(t)}};function Dk(e){let{block:t}=Py(e),n=e.doc.resolve(t.beforePos).nodeBefore,r=e.doc.resolve(t.afterPos).nodeAfter,i=Fy(e.doc,t.beforePos)?.block.node;return{block:Vb(t.node,e.doc),prevBlock:n===null?void 0:Vb(n,e.doc),nextBlock:r===null?void 0:Vb(r,e.doc),parentBlock:i===void 0?void 0:Vb(i,e.doc)}}function Ok(e,t,n=`start`){let r=typeof t==`string`?t:t.id,i=mw(r,e.doc);if(!i)throw Error(`Block with ID ${r} not found`);e.setSelection(Ty(e.doc,jy(i.node,i.posBeforeNode),n))}var kk=[`vscode-editor-data`,`blocknote/html`,`text/markdown`,`text/html`,`text/plain`,`Files`];function Ak(e,t){if(!e.startsWith(`.`)||!t.startsWith(`.`))throw Error(`The strings provided are not valid file extensions.`);return e===t}function jk(e,t){let n=e.split(`/`),r=t.split(`/`);if(n.length!==2)throw Error(`The string ${e} is not a valid MIME type.`);if(r.length!==2)throw Error(`The string ${t} is not a valid MIME type.`);return n[1]===`*`||r[1]===`*`?n[0]===r[0]:(n[0]===`*`||r[0]===`*`||n[0]===r[0])&&n[1]===r[1]}function Mk(e,t,n,r=`after`){let i;return i=Array.isArray(t.content)&&t.content.length===0?e.updateBlock(t,n).id:e.insertBlocks([n],t,r)[0].id,i}async function Nk(e,t){if(!t.uploadFile){console.warn(`Attempted ot insert file, but uploadFile is not set in the BlockNote editor options`);return}let n=`dataTransfer`in e?e.dataTransfer:e.clipboardData;if(n===null)return;let r=null;for(let e of kk)if(n.types.includes(e)){r=e;break}if(r!==`Files`)return;let i=n.items;if(i){e.preventDefault();for(let n=0;n<i.length;n++){let r=`file`;for(let e of Object.values(t.schema.blockSpecs))for(let t of e.implementation.meta.fileBlockAccept||[]){let a=t.startsWith(`.`),o=i[n].getAsFile();if(o&&(!a&&o.type&&jk(i[n].type,t)||a&&Ak(`.`+o.name.split(`.`).pop(),t))){r=e.config.type;break}}let a=i[n].getAsFile();if(a){let n={type:r,props:{name:a.name}},i;if(e.type===`paste`){let e=t.getTextCursorPosition().block;i=Mk(t,e,n)}else if(e.type===`drop`){let r={left:e.clientX,top:e.clientY},a=t.prosemirrorView.posAtCoords(r);if(!a)return;i=t.transact(e=>{let i=ky(Ny(e,a.pos).block.node,e.doc),o=(t.domElement?.querySelector(`[data-id="${i}"]`))?.getBoundingClientRect(),s=t.getBlock(i);if(s)return Mk(t,s,n,o&&(o.top+o.bottom)/2>r.top?`before`:`after`)})}else return;if(!i)return;let o=await t.uploadFile(a,i),s=typeof o==`string`?{props:{url:o}}:{...o};t.updateBlock(i,s)}}}}var Pk=e=>dt.create({name:`dropFile`,addProseMirrorPlugins(){return[new Tr({props:{handleDOMEvents:{drop(t,n){if(!e.isEditable)return;let r=null;for(let e of kk)if(n.dataTransfer.types.includes(e)){r=e;break}return r===null||r===`Files`&&(Nk(n,e),!0)}}}})]}}),Fk=/(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/,Ik=/(_|__|\*|\*\*|~~|==|\+\+)(?!\s)(?:[^\s](?:.{0,62}[^\s])?|\S)(?=\1)/,Lk=/\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/,Rk=/(?:\s|^)`(?!\s)(?:[^\s`](?:[^`]{0,46}[^\s`])?|[^\s`])`([^\w]|$)/,zk=/(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/,Bk=/(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/,Vk=/\n{2} {0,3}-{2,48}\n{2}/,Hk=/(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/,Uk=/(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/,Wk=/(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/,Gk=/^\s*\|(.+\|)+\s*$/m,Kk=/^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m,qk=/^\s*\|(.+\|)+\s*$/m,Jk=e=>Fk.test(e)||Ik.test(e)||Lk.test(e)||Rk.test(e)||zk.test(e)||Bk.test(e)||Vk.test(e)||Hk.test(e)||Uk.test(e)||Wk.test(e)||Gk.test(e)||Kk.test(e)||qk.test(e);function Yk(e,t){let{schema:n}=t.state;if(!e.clipboardData)return!1;let r=e.clipboardData.getData(`text/plain`);if(!r||!n.nodes.codeBlock)return!1;let i=e.clipboardData.getData(`vscode-editor-data`),a=(i?JSON.parse(i):void 0)?.mode;return a?(t.pasteHTML(`<pre><code class="language-${a}">${r.replace(/\r\n?/g,`
207
- `)}</code></pre>`),!0):!1}function Xk({event:e,editor:t,prioritizeMarkdownOverHTML:n,plainTextAsMarkdown:r}){if(t.transact(e=>e.selection.$from.parent.type.spec.code&&e.selection.$to.parent.type.spec.code)){let n=e.clipboardData?.getData(`text/plain`);if(n)return t.pasteText(n),!0}let i;for(let t of kk)if(e.clipboardData.types.includes(t)){i=t;break}if(!i)return!0;if(i===`vscode-editor-data`){if(Yk(e,t.prosemirrorView))return!0;i=`text/plain`}if(i===`Files`)return Nk(e,t),!0;let a=e.clipboardData.getData(i);if(i===`blocknote/html`)return t.pasteHTML(a,!0),!0;if(i===`text/markdown`)return t.pasteMarkdown(a),!0;if(n){let n=e.clipboardData.getData(`text/plain`);if(Jk(n))return t.pasteMarkdown(n),!0}return i===`text/html`?(t.pasteHTML(a),!0):r?(t.pasteMarkdown(a),!0):(t.pasteText(a),!0)}var Zk=(e,t)=>dt.create({name:`pasteFromClipboard`,addProseMirrorPlugins(){return[new Tr({props:{handleDOMEvents:{paste(n,r){if(r.preventDefault(),e.isEditable)return t({event:r,editor:e,defaultPasteHandler:({prioritizeMarkdownOverHTML:t=!0,plainTextAsMarkdown:n=!0}={})=>Xk({event:r,editor:e,prioritizeMarkdownOverHTML:t,plainTextAsMarkdown:n})})}}}})]}});function Qk(e,t,n){let r=!1,i=e.state.selection instanceof Z_;if(!i){let n=e.state.doc.slice(e.state.selection.from,e.state.selection.to,!1).content,i=[];for(let e=0;e<n.childCount;e++)i.push(n.child(e));r=i.find(e=>e.type.isInGroup(`bnBlock`)||e.type.name===`blockGroup`||e.type.spec.group===`blockContent`)===void 0,r&&(t=n)}let a,o=Ow(e.state.schema,n);if(i){t.firstChild?.type.name===`table`&&(t=t.firstChild.content);let e=Rb(t,n.schema.inlineContentSchema,n.schema.styleSchema);a=`<table>${o.exportInlineContent(e,{})}</table>`}else if(r){let e=zb(t,n.schema.inlineContentSchema,n.schema.styleSchema);a=o.exportInlineContent(e,{})}else{let e=Vw(t);a=o.exportBlocks(e,{})}return a}function $k(e,t){`node`in e.state.selection&&e.state.selection.node.type.spec.group===`blockContent`&&t.transact(t=>t.setSelection(new wr(t.doc.resolve(e.state.selection.from-1))));let n=e.serializeForClipboard(e.state.selection.content()).dom.innerHTML,r=e.state.selection.content().content,i=Qk(e,r,t),{$from:a,$to:o}=e.state.selection,s=a.parent.type.name,c=t.schema.blockSpecs[s];return{clipboardHTML:n,externalHTML:i,markdown:a.sameParent(o)&&c?.implementation.meta.code===!0?e.state.doc.textBetween(a.pos,o.pos):TE(i)}}var eA=e=>{if(e.state.selection.empty)return!0;let t=window.getSelection();if(t&&!t.isCollapsed){let e=t.focusNode;for(;e;){if(e instanceof HTMLElement&&e.getAttribute(`contenteditable`)===`false`)return!0;e=e.parentElement}}return!1},tA=(e,t,n)=>{n.preventDefault(),n.clipboardData.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=$k(t,e);n.clipboardData.setData(`blocknote/html`,r),n.clipboardData.setData(`text/html`,i),n.clipboardData.setData(`text/plain`,a)},nA=e=>dt.create({name:`copyToClipboard`,addProseMirrorPlugins(){return[new Tr({props:{handleDOMEvents:{copy(t,n){return eA(t)||tA(e,t,n),!0},cut(t,n){return eA(t)||(tA(e,t,n),t.editable&&t.dispatch(t.state.tr.deleteSelection())),!0},dragstart(t,n){if(!(`node`in t.state.selection)||t.state.selection.node.type.spec.group!==`blockContent`)return;e.transact(e=>e.setSelection(new wr(e.doc.resolve(t.state.selection.from-1)))),n.preventDefault(),n.dataTransfer.clearData();let{clipboardHTML:r,externalHTML:i,markdown:a}=$k(t,e);return n.dataTransfer.setData(`blocknote/html`,r),n.dataTransfer.setData(`text/html`,i),n.dataTransfer.setData(`text/plain`,a),!0}}}})]}}),rA=dt.create({name:`blockBackgroundColor`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{backgroundColor:bS()}}]}}),iA=st.create({name:`hardBreak`,inline:!0,group:`inline`,selectable:!1,linebreakReplacement:!0,priority:10,parseHTML(){return[{tag:`br`}]},renderHTML({HTMLAttributes:e}){return[`br`,kt(this.options.HTMLAttributes,e)]},renderText(){return`
208
- `}});function aA(e,t){return e.contentKind===`inline`&&t.contentKind===`inline`?t.content.node.content:void 0}function oA(e,t,n,r){if(!n.children)return!1;let i=aA(n,r);if(i===void 0||i.size>0&&!n.content.node.type.validContent(n.content.node.content.append(i)))return!1;if(t){let a=e.tr;n.children.node.childCount===1&&!r.children?a.delete(n.children.beforePos,n.children.afterPos):a.replaceWith(r.block.beforePos,r.block.afterPos,r.children?.node.content??dr.empty);let o=n.contentEnd;i.size>0&&a.insert(o,i),a.setSelection(xr.near(a.doc.resolve(o),-1)),t(a.scrollIntoView())}return!0}var sA=e=>({state:t,dispatch:n})=>{let r=My(t.doc,e);if(!r.hasContent)return!1;let i=Iy(t.doc,r.block.beforePos);if(!i){let e=Fy(t.doc,r.block.beforePos);return e?.hasContent?oA(t,n,e,r):!1}let a=Ry(i);if(!a.hasContent||aA(a,r)===void 0)return!1;if(a.isContentEmpty&&a.content.node.sameMarkup(r.content.node)){if(n){let e=t.tr.delete(r.block.beforePos,r.block.afterPos).replaceWith(a.block.beforePos,a.block.afterPos,r.block.node);e.setSelection(gr.create(e.doc,a.contentStart)),n(e.scrollIntoView())}return!0}if(n&&r.children){let e=t.doc.resolve(r.children.childrenStart).blockRange(t.doc.resolve(r.children.childrenEnd));if(!e)throw Error(`Children of a block are expected to form a block range`);t.tr.lift(e,t.doc.resolve(r.block.beforePos).depth)}return n&&n(t.tr.delete(a.contentEnd,r.contentStart)),!0},cA=(e,t,n,r)=>({state:i,dispatch:a})=>!a||lA(i.tr,e,t,n,r),lA=(e,t,n,r,i)=>{let a=Ay(e.doc,t),o=jy(a.node,a.posBeforeNode);if(!o.hasContent)return!1;let s=kb(e),c=[{type:o.block.node.type,attrs:r?{...o.block.node.attrs,id:void 0}:{}},{type:n?o.content.node.type:s.nodes.paragraph,attrs:r?{...o.content.node.attrs}:{}}],l=i&&t!==o.contentStart?o.children:void 0;if(l&&e.delete(l.beforePos,l.afterPos),e.split(t,2,c),l){let t=e.doc.nodeAt(o.block.beforePos);if(!t?.firstChild)throw Error(`Split lost its original block`);e.insert(o.block.beforePos+1+t.firstChild.nodeSize,l.node)}return!0};function uA(e,t,n){let r=Hy(e.doc,t.beforePos);e.delete(t.beforePos,t.afterPos);let i=e.mapping.map(n);e.insert(i,t.node);let a=e.steps.length;bD(e,r),e.setSelection(gr.near(e.doc.resolve(e.mapping.slice(a).map(i)+1)))}function dA(e,t,n,r=n.block){return e.insertContentAt(n.block.afterPos,n.children?.node.content||dr.empty).deleteRange({from:r.beforePos,to:r.afterPos}).insertContentAt(t.contentEnd,aA(t,n)??null).setTextSelection(t.contentEnd).scrollIntoView().run()}var fA=dt.create({priority:50,addKeyboardShortcuts(){let e=this.options.editor;function t(t,n){let r=Vb(t,n);return e.schema.blockSpecs[r.type].implementation.keyboard(r)}function n(e){return n=>t(n,e).childrenCanOutdent}let r=()=>this.editor.commands.first(({chain:e,commands:r})=>[()=>r.deleteSelection(),()=>r.undoInputRule(),()=>r.command(({state:e})=>{let n=Py(e);if(!n.hasContent||e.selection.from!==n.contentStart)return!1;let i=t(n.block.node,e.doc).resetsTo,a=n.content.node;return a.type.name===i.type&&Object.entries(i.props??{}).every(([e,t])=>a.attrs[e]===t)?!1:r.command(SD(n.block.beforePos,i))}),()=>r.command(({state:t})=>{let n=Py(t);if(!n.hasContent)return!1;let{block:r}=n,i=Iy(t.doc,n.block.beforePos);if(i&&!i.hasContent)return!1;let a=t.selection.from===n.contentStart,o=t.selection.empty,s=r.beforePos;return a&&o?e().command(sA(s)).scrollIntoView().run():!1}),()=>r.command(({state:e,tr:t,dispatch:n})=>{let r=Py(e);if(!r.hasContent||e.selection.from!==r.contentStart)return!1;let i=r.block.node.type,a=Iy(t.doc,r.block.beforePos),o;if(a){if(a.hasContent)return!1}else{let e=t.doc.resolve(r.block.beforePos);if(!my(e.parent.type))return!1;let n=t.doc.resolve(e.before()),s=n.nodeBefore;my(n.parent.type)&&s&&my(s.type)?a=jy(s,n.pos-s.nodeSize):o=Vy(t.doc,n.pos,i)}return a&&(o=zy(t.doc,a,`last-child`,i)?.pos),o!==void 0&&(n&&uA(t,r.block,o),!0)}),()=>r.command(({state:e,tr:t,dispatch:n})=>{let r=Py(e);if(!r.hasContent||!e.selection.empty||r.contentKind!==`inline`||!r.isContentEmpty)return!1;let i=Iy(e.doc,r.block.beforePos),a=i?void 0:Fy(e.doc,r.block.beforePos),o=i?Ry(i):a;return o?.hasContent?(n&&(a?.children?.node.childCount===1&&!r.children?t.delete(a.children.beforePos,a.children.afterPos):t.replaceWith(r.block.beforePos,r.block.afterPos,r.children?.node.content??dr.empty),t.setSelection(o.contentKind===`none`?wr.create(t.doc,o.content.beforePos):gr.near(t.doc.resolve(o.contentEnd),-1)),t.scrollIntoView()),!0):!1}),()=>r.command(({state:e,tr:t,dispatch:n})=>{let r=Py(e);if(!r.hasContent)return!1;let i=e.selection.from===r.contentStart,a=e.selection.empty,o=Iy(e.doc,r.block.beforePos);if(o&&i&&a){let e=Ry(o);if(!e.hasContent)return!1;if(e.contentKind===`none`||e.contentKind===`inline`&&e.isContentEmpty)return n&&(t.delete(r.block.beforePos,r.block.afterPos),t.replaceWith(e.block.beforePos,e.block.afterPos,r.block.node),t.setSelection(gr.near(t.doc.resolve(e.block.beforePos+2))),t.scrollIntoView()),!0}return!1}),()=>r.command(({state:e,tr:t})=>{let r=Py(e);return!r.hasContent||!e.selection.empty||e.selection.from!==r.contentStart?!1:dO(t,t.doc.type.schema.nodes.blockContainer,t.doc.type.schema.nodes.blockGroup,n(t.doc))})]),i=()=>this.editor.commands.first(({chain:e,commands:t})=>[()=>t.deleteSelection(),()=>t.command(({state:t})=>{let n=Py(t);if(!n.hasContent||!n.children)return!1;let{children:r}=n;if(r.node.childCount===0)return!1;let i=t.selection.from===n.contentEnd,a=t.selection.empty,o=My(t.doc,r.childrenStart);return o.hasContent&&i&&a?dA(e(),n,o,r.node.childCount===1?r:o.block):!1}),()=>t.command(({state:t})=>{let n=Py(t);if(!n.hasContent)return!1;let{block:r}=n,i=Ly(t.doc,n.block.beforePos);if(!i||!i.hasContent)return!1;let a=t.selection.from===n.contentEnd,o=t.selection.empty,s=r.afterPos;return a&&o?e().command(sA(s)).scrollIntoView().run():!1}),()=>t.command(({state:e,tr:t,dispatch:n})=>{let r=Py(e);if(!r.hasContent||e.selection.from!==r.contentEnd)return!1;let i=t.doc.resolve(r.block.afterPos);for(;!i.nodeAfter&&i.depth>0&&my(i.parent.type);)i=t.doc.resolve(i.after());let a=i.nodeAfter;if(!a||i.pos===r.block.afterPos&&!my(a.type))return!1;let o=By(jy(a,i.pos));return o?(n&&uA(t,o.block,r.block.afterPos),!0):!1}),()=>t.command(({state:t})=>{let n=Py(t);if(!n.hasContent)return!1;let r=t.selection.from===n.contentEnd,i=t.selection.empty;if(r&&i){let r,i=n;for(;i&&(r=Ly(t.doc,i.block.beforePos),!r);)i=Fy(t.doc,i.block.beforePos);return!r||!r.hasContent?!1:dA(e(),n,r,r.block)}return!1}),()=>t.command(({state:t})=>{let n=Py(t);if(!n.hasContent)return!1;if(n.isContentEmpty&&n.contentKind===`inline`){let r=Ly(t.doc,n.block.beforePos);if(!r||!r.hasContent)return!1;let i=e();return i.command(({tr:e})=>(e.setSelection(Ty(e.doc,r,`start`)),!0)),i.deleteRange({from:n.block.beforePos,to:n.block.afterPos}).scrollIntoView().run()}return!1}),()=>t.command(({state:t})=>{let n=Py(t);if(!n.hasContent)return!1;let r=t.selection.from===n.contentEnd,i=t.selection.empty,a=Ly(t.doc,n.block.beforePos);return!a||!a.hasContent?!1:a&&r&&i&&(a.contentKind===`none`||a.contentKind===`inline`&&a.isContentEmpty)?e().deleteRange({from:a.block.beforePos,to:a.block.afterPos}).insertContentAt(n.block.afterPos,a.children?.node.content??null).run():!1})]),a=(e=!1)=>this.editor.commands.first(({commands:r,tr:i})=>[()=>r.command(({state:e})=>{let n=Py(e);if(!n.hasContent||!e.selection.empty||!n.isContentEmpty)return!1;let i=t(n.block.node,e.doc);return i.emptyEnterResets?r.command(SD(n.block.beforePos,i.resetsTo)):!1}),()=>r.command(({state:e,tr:r})=>{let i=Py(e);if(!i.hasContent)return!1;let{block:a}=i,{depth:o}=e.doc.resolve(a.beforePos),s=e.selection.$anchor.parentOffset===0,c=e.selection.anchor===e.selection.head,l=i.isContentEmpty;if(s&&c&&l&&o>1){let i=Fy(e.doc,a.beforePos);return i&&t(i.block.node,e.doc).emptyChildEnter!==`outdent`?!1:dO(r,r.doc.type.schema.nodes.blockContainer,r.doc.type.schema.nodes.blockGroup,n(r.doc))}return!1}),()=>r.command(({state:n})=>{let r=Py(n),a=this.options.editor.schema.blockSpecs[r.blockNoteType],o=t(r.block.node,n.doc);if(o.enter===`line-break`||e&&o.shiftEnter===`line-break`){if(a?.config?.content===`plain`)return i.insertText(`
209
- `,i.selection.head),!0;let e=i.storedMarks||i.selection.$head.marks().filter(e=>this.editor.extensionManager.splittableMarks.includes(e.type.name));return i.insert(i.selection.head,i.doc.type.schema.nodes.hardBreak.create()).ensureMarks(e),!0}return!1}),()=>r.command(({state:e,tr:n,dispatch:r})=>{let i=Py(e);if(!i.hasContent)return!1;let a=e.selection.anchor===e.selection.head,o=i.isContentEmpty;if(!a||!o)return!1;let s=n.doc.resolve(i.block.beforePos);if(n.doc.resolve(i.block.afterPos).nodeAfter!==null)return!1;let c=Fy(n.doc,i.block.beforePos);if(!c||t(c.block.node,n.doc).emptyChildEnter!==`exit-at-end`||s.index()===0&&c.hasContent)return!1;let l=Vy(n.doc,c.block.afterPos,e.schema.nodes.blockContainer,`after`);return l!==void 0&&(r&&(uA(n,i.block,l),n.scrollIntoView()),!0)}),()=>r.command(({state:e,dispatch:n,tr:r})=>{let i=Py(e);if(!i.hasContent)return!1;let{block:a}=i,o=e.selection.$anchor.parentOffset===0,s=e.selection.anchor===e.selection.head,c=i.isContentEmpty;if(o&&s&&c&&t(i.block.node,e.doc).enter!==`into-children`){let t=a.afterPos,o=t+2;if(n){let n=e.schema.nodes.blockContainer.createAndFill(void 0,[e.schema.nodes.paragraph.createAndFill()||void 0,i.children?.node].filter(e=>e!==void 0));r.insert(t,n).setSelection(new gr(r.doc.resolve(o))).scrollIntoView(),i.children&&r.delete(i.children.beforePos,i.children.afterPos)}return!0}return!1}),()=>r.command(({state:e,tr:n,dispatch:r})=>{let i=Py(e);if(!i.hasContent||i.contentKind===`table`||!e.selection.empty||i.isContentEmpty||e.selection.from!==i.contentStart)return!1;if(r){let r=t(i.block.node,e.doc).splitKeepsType?i.content.node.type:e.schema.nodes.paragraph,a=e.schema.nodes.blockContainer.create(void 0,r.create());n.insert(i.block.beforePos,a).scrollIntoView()}return!0}),()=>r.command(({state:e,tr:n,dispatch:r})=>{let i=Py(e);if(!i.hasContent||t(i.block.node,e.doc).enter!==`into-children`||!e.selection.empty||e.selection.from<i.contentStart||e.selection.from>i.contentEnd)return!1;if(r){let t=i.content.node.cut(e.selection.from-i.contentStart),r=e.schema.nodes.blockContainer.create(void 0,e.schema.nodes.paragraph.create(void 0,t.content));n.delete(e.selection.from,i.contentEnd);let a=My(n.doc,i.block.beforePos).children,o=a?a.childrenStart:n.mapping.map(i.content.afterPos);n.insert(o,a?r:e.schema.nodes.blockGroup.create(void 0,r)).setSelection(new gr(n.doc.resolve(o+(a?2:3)))).scrollIntoView()}return!0}),()=>r.command(({state:e,chain:n})=>{let r=Py(e);if(!r.hasContent)return!1;let i=e.selection.$anchor.parentOffset===0;if(!r.isContentEmpty){let a=t(r.block.node,e.doc),o=i||a.splitKeepsType;return n().deleteSelection().command(cA(e.selection.from,o,i,a.splitKeepsChildren)).scrollIntoView().run(),!0}return!1})]),o=this.options;function s(e){let{editor:t,tabBehavior:n}=o;return n!==`prefer-indent`&&(t.getExtension(zC)?.store.state||t.getExtension(CS)?.store.state!==void 0)?!1:e?pO(t):lO(t)}return{Backspace:r,Delete:i,Enter:()=>a(),"Shift-Enter":()=>a(!0),Tab:()=>s(!1),"Shift-Tab":()=>s(!0),"Shift-Mod-ArrowUp":()=>(this.options.editor.moveBlocksUp(),!0),"Shift-Mod-ArrowDown":()=>(this.options.editor.moveBlocksDown(),!0),"Mod-z":()=>this.options.editor.undo(),"Mod-y":()=>this.options.editor.redo(),"Shift-Mod-z":()=>this.options.editor.redo(),"Mod-a":()=>{let e=this.editor.view,{doc:t,selection:n,tr:r}=e.state,i=gr.between(xr.atStart(t).$from,xr.atEnd(t).$to);if(this.options.selectAllBehavior===`document`)return e.dispatch(r.setSelection(i)),!0;let a,o=Py(e.state);if(o.hasContent){let e=o.contentStart,n=o.contentEnd,r=gr.between(t.resolve(e),t.resolve(n));!r.empty&&r.from>=e&&r.to<=n&&(a=r)}let s=!a||n.from<a.from||n.to>a.to||n.from===a.from&&n.to===a.to;return a&&!s?r.setSelection(a).scrollIntoView():r.setSelection(i),e.dispatch(r),!0}}}}),pA=dt.create({name:`textAlignment`,addGlobalAttributes(){return[{types:[`tableCell`,`tableHeader`],attributes:{textAlignment:{default:`left`,parseHTML:e=>e.getAttribute(`data-text-alignment`),renderHTML:e=>e.textAlignment===`left`?{}:{"data-text-alignment":e.textAlignment}}}}]}}),mA=dt.create({name:`blockTextColor`,addGlobalAttributes(){return[{types:[`table`,`tableCell`,`tableHeader`],attributes:{textColor:xS()}}]}}),hA=`[\0- \xA0 ᠎ -\u2029  ]`,gA=new RegExp(hA),_A=RegExp(`${hA}$`),vA=new RegExp(hA,`g`);function yA(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function bA(e){return new Tr({key:new hr(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(Wy(Uy(n.doc,t)).forEach(({newRange:t})=>{let n=et(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!_A.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(gA).filter(Boolean);if(t.length<=0)return;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return;let c=BT(n,e.defaultProtocol);if(!yA(c))return;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{ft(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function xA(e){return new Tr({key:new hr(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement&&r.target.getAttribute(`data-inline-content-type`)===`link`)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.tiptapEditor.view.dom;i=t.closest(`a[data-inline-content-type="link"]`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;if(e.onClick){if(!e.editor)throw Error(`BlockNoteEditor not found in Link click handler`);return e.onClick(r,e.editor)??!0}let a=zt(t.state,e.type.name),o=i.href??a.href,s=i.target??a.target;return o?(window.open(o,s),!0):!1}}})}function SA(e){return new Tr({key:new hr(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i,isValidLink:a}=e,{state:o}=t,{selection:s}=o,{empty:c}=s;if(c)return!1;let l=``;r.content.forEach(e=>{l+=e.textContent});let u=zT(l,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!l||!u||!a(u.value)||i!==void 0&&!i(u.value)?!1:e.editor.commands.setMark(e.type,{href:u.href})}}})}var CA=`https`,wA=/^(?:(?:http|https|ftp|ftps|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z0-9+.\-]+(?:[^a-z+.\-:]|$))/i;function TA(e){if(!e)return!0;let t=e.replace(vA,``);return wA.test(t)}function EA(e){let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}var DA=Qe.create({name:`link`,keepOnSplit:!1,exitable:!0,inclusive:!1,addOptions(){return{HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,className:`bn-inline-content-section`,"data-inline-content-type":`link`},editor:void 0,onClick:void 0,isValidLink:TA}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}}}},parseHTML(){let e=this.options.isValidLink;return[{tag:`a[href]`,getAttrs:t=>{let n=t.getAttribute(`href`);return!n||!e(n)?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isValidLink(e.href)?[`a`,kt(e,this.options.HTMLAttributes),0]:[`a`,kt({...e,href:``},this.options.HTMLAttributes),0]},addPasteRules(){let e=this.options.isValidLink;return[Pt({find:t=>{let n=[];if(t){let r=zT(t,{defaultProtocol:CA}).filter(t=>t.isLink&&e(t.value));for(let e of r)EA(e.value)&&n.push({text:e.value,data:{href:e.href},index:e.start})}return n},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[];return e.push(bA({type:this.type,defaultProtocol:CA,validate:this.options.isValidLink,shouldAutoLink:EA})),e.push(xA({type:this.type,tiptapEditor:this.editor,editor:this.options.editor,onClick:this.options.onClick})),e.push(SA({editor:this.editor,defaultProtocol:CA,type:this.type,shouldAutoLink:EA,isValidLink:this.options.isValidLink})),e}}),OA=w_(({editor:e,options:t})=>({key:`link`,tiptapExtensions:[DA.configure({HTMLAttributes:t.HTMLAttributes??{},editor:e,onClick:t.onClick,...t.isValidLink?{isValidLink:t.isValidLink}:{}})]})),kA=st.create({name:`blockGroup`,group:fy,content:`blockGroupChild+`,marks(){return yb(this.editor)},parseHTML(){return[{tag:`div`,getAttrs:e=>typeof e!=`string`&&e.getAttribute(`data-node-type`)===`blockGroup`&&null}]},renderHTML({HTMLAttributes:e}){let t={...this.options.domAttributes?.blockGroup||{},...e},n=document.createElement(`div`);n.className=db(`bn-block-group`,t.class),n.setAttribute(`data-node-type`,`blockGroup`);for(let[e,r]of Object.entries(t))e!==`class`&&n.setAttribute(e,r);return{dom:n,contentDOM:n}}}),AA=st.create({name:`doc`,topNode:!0,content:`blockGroup`,marks(){return yb(this.editor)}});function jA(e,t){return[ct.ClipboardTextSerializer,ct.Commands,ct.Editable,ct.FocusEvents,ct.Tabindex,fD,Qy.configure({types:[`blockContainer`,...Object.values(e.schema.blockSpecs).filter(e=>e.config.layoutOnly===!0).map(e=>e.config.type)],setIdAttribute:t.setIdAttribute,isWithinEditor:e.isWithinEditor}),iA,yt,...Object.values(e.schema.styleSpecs).map(t=>t.implementation.mark.configure({editor:e})),mA,rA,pA,dt.create({name:`OverrideEscape`,addKeyboardShortcuts:()=>({Escape:()=>!e.getExtension(WC)?.shown()&&(e.blur(),!0)})}),AA,LD.configure({editor:e,domAttributes:t.domAttributes}),fA.configure({editor:e,tabBehavior:t.tabBehavior,selectAllBehavior:t.selectAllBehavior??`block-first`}),kA.configure({domAttributes:t.domAttributes}),...Object.values(e.schema.inlineContentSpecs).filter(e=>e.config!==`link`&&e.config!==`text`).map(t=>t.implementation.node.configure({editor:e})),...Object.values(e.schema.blockSpecs).flatMap(n=>[...`node`in n.implementation?[n.implementation.node.configure({editor:e,domAttributes:t.domAttributes})]:[]]),nA(e),Zk(e,t.pasteHandler||(e=>e.defaultPasteHandler())),Pk(e)]}function MA(e,t){let n=[Fw(),Ww(t),CS(t),zC(t),OA({HTMLAttributes:t.links?.HTMLAttributes??{},onClick:t.links?.onClick,...t.links?.isValidLink?{isValidLink:t.links.isValidLink}:{}}),Yw(t),$w(),tT(t),sT({editable:t._tiptapOptions?.editable}),rw(t),IE(t),LE(),RE(),WC(t),Gw(),Jw(),nT(),...t.trailingBlock===!1?[]:[oD()]];return`table`in e.schema.blockSpecs&&n.push(nD(t)),t.animations!==!1&&n.push(aT()),n}var NA=class{editor;options;disabledExtensions=new Set;extensions=[];abortMap=new Map;extensionFactories=new Map;extensionPlugins=new Map;runtimeExtensions=new Set;blockNoteExtensionDependents=new Map;constructor(e,t){this.editor=e,this.options=t,e.onMount(()=>{for(let e of this.extensions)this.mountExtension(e)}),e.onUnmount(()=>{for(let[e,t]of this.abortMap.entries())this.abortMap.delete(e),t.abort()}),this.disabledExtensions=new Set(t.disableExtensions||[]);for(let e of MA(this.editor,this.options))this.addExtension(e);for(let e of this.options.extensions??[])this.addExtension(e);for(let e of Object.values(this.editor.schema.blockSpecs))for(let t of e.extensions??[])this.addExtension(t)}mountExtension(e){if(!e.mount||this.abortMap.has(e))return;let t=new window.AbortController;this.abortMap.set(e,t);let n=e.mount({dom:this.editor.prosemirrorView.dom,root:this.editor.prosemirrorView.root,signal:t.signal});n&&(t.signal.aborted?n():t.signal.addEventListener(`abort`,n,{once:!0}))}registerExtension(e){this.replaceExtension(void 0,e)}addExtension(e,t){let n;if(n=typeof e==`function`?e({editor:this.editor}):e,!n||this.disabledExtensions.has(n.key))return;if(t){let e=this.blockNoteExtensionDependents.get(n.key);e||(e=new Set,this.blockNoteExtensionDependents.set(n.key,e)),e.add(t)}if(this.extensions.some(e=>e.key===n.key))return;let r=n[C_];if(typeof r==`function`&&this.extensionFactories.set(r,n),this.extensions.push(n),n.blockNoteExtensions)for(let e of n.blockNoteExtensions)this.addExtension(e,n.key);return n}resolveExtensions(e){let t=[];if(typeof e==`function`){let n=this.extensionFactories.get(e);n&&t.push(n)}else if(Array.isArray(e))for(let n of e)t.push(...this.resolveExtensions(n));else if(typeof e==`object`&&`key`in e)t.push(e);else if(typeof e==`string`){let n=this.extensions.find(t=>t.key===e);n&&t.push(n)}return t}unregisterExtension(e){let t=[...new Set(this.resolveExtensions(e))].filter(e=>this.extensions.includes(e));return t.length&&this.replaceExtension(t,[]),Array.isArray(e)?t:t[0]}replaceExtension(e,t,n){let r=this.resolveExtensions(e);e&&!r.length&&console.warn(`No extensions found to unregister`,e);let i=!1,a=new Set,o=new Set;for(let t of r)this.extensions=this.extensions.filter(e=>e!==t),this.extensionFactories.forEach((e,n)=>{e===t&&this.extensionFactories.delete(n)}),this.abortMap.get(t)?.abort(),this.abortMap.delete(t),this.extensionPlugins.get(t)?.forEach(e=>{a.add(e);let t=e.spec?.key,n=typeof t==`object`&&t?t.key:t;typeof n==`string`&&o.add(n)}),this.extensionPlugins.delete(t),this.runtimeExtensions.delete(t),t.tiptapExtensions&&!i&&(i=!0,console.warn(`Extension ${t.key} has tiptap extensions, but they will not be removed. Please separate the extension into multiple extensions if you want to remove them, or re-initialize the editor.`,e));let s=[].concat(t).filter(Boolean).map(e=>this.addExtension(e)).filter(Boolean),c=[];for(let e of s)this.runtimeExtensions.add(e),e?.tiptapExtensions&&console.warn(`Extension ${e.key} has tiptap extensions, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),e?.inputRules?.length&&console.warn(`Extension ${e.key} has input rules, but these cannot be changed after initializing the editor. Please separate the extension into multiple extensions if you want to add them, or re-initialize the editor.`,e),this.getProsemirrorPluginsFromExtension(e).plugins.forEach(e=>{c.push(e)});if((a.size||o.size||c.length||n?.resetPluginStateFor.length)&&this.updatePlugins(e=>[...e.filter(e=>{if(a.has(e))return!1;if(o.size){let t=e.spec?.key,n=typeof t==`object`&&t?t.key:t;if(typeof n==`string`&&o.has(n))return!1}return!0}),...c],n?.resetPluginStateFor),!this.editor.headless)for(let e of s)this.mountExtension(e)}updatePlugins(e,t){let n=this.editor.prosemirrorState,r=new Set(t),i=(r.size?n.reconfigure({plugins:n.plugins.filter(e=>!e.spec.key||!r.has(e.spec.key))}):n).reconfigure({plugins:e(n.plugins.slice())});this.editor.prosemirrorView.updateState(i)}getTiptapExtensions(){let e=jA(this.editor,this.options).filter(e=>!this.disabledExtensions.has(e.name)),t=Hx(this.extensions.map(e=>{let t=this.blockNoteExtensionDependents.get(e.key);return t?.size?{key:e.key,runsBefore:[...e.runsBefore??[],...t]}:e})),n=new Map;for(let r of this.extensions){r.tiptapExtensions&&e.push(...r.tiptapExtensions);let i=t(r.key),{plugins:a,inputRules:o}=this.getProsemirrorPluginsFromExtension(r);a.length&&e.push(dt.create({name:r.key,priority:i,addProseMirrorPlugins:()=>this.runtimeExtensions.has(r)?[]:this.extensionPlugins.get(r)??[]})),o.length&&(n.has(i)||n.set(i,[]),n.get(i).push(...o))}e.push(dt.create({name:`blocknote-runtime-extensions`,priority:-1/0,addProseMirrorPlugins:()=>this.extensions.filter(e=>this.runtimeExtensions.has(e)).flatMap(e=>this.extensionPlugins.get(e)??[])})),e.push(dt.create({name:`blocknote-input-rules`,addProseMirrorPlugins(){let e=[];Array.from(n.keys()).sort((e,t)=>e-t).reverse().forEach(t=>{e.push(...n.get(t))});let t=uD({rules:e});return[t,new Tr({props:{handleKeyDown(e,n){if(n.key!==`Enter`||n.shiftKey||n.ctrlKey||n.metaKey||n.altKey)return!1;let{$cursor:r}=e.state.selection;return r?!!t.props.handleTextInput?.call(t,e,r.pos,r.pos,`
210
- `,()=>e.state.tr.insertText(`
211
- `,r.pos,r.pos)):!1}}})]}}));for(let t of this.options._tiptapOptions?.extensions??[])e.push(t);return e}getProsemirrorPluginsFromExtension(e){let t=[...e.prosemirrorPlugins??[]],n=[];if(!e.prosemirrorPlugins?.length&&!Object.keys(e.keyboardShortcuts||{}).length&&!e.inputRules?.length)return{plugins:t,inputRules:n};if(this.extensionPlugins.set(e,t),e.inputRules?.length&&n.push(...e.inputRules.map(e=>new sD(e.find,(t,n,r,i)=>{let a=e.replace({match:n,range:{from:r,to:i},editor:this.editor});if(a){let e=t.tr,n=Py(e);return!n.hasContent||this.editor.schema.blockSchema[n.blockNoteType]?.content!==`inline`?null:(e.deleteRange(r,i),CD(e,n.block.beforePos,a),Ok(e,ky(n.block.node,e.doc),`start`),e)}return null},{undoable:!0}))),Object.keys(e.keyboardShortcuts||{}).length){let n,r=qt(Object.fromEntries(Object.entries(e.keyboardShortcuts).map(([e,t])=>[e,()=>{if(!n)throw Error(`Keyboard shortcut called outside handleKeyDown`);return t({editor:this.editor,event:n})}])));t.push(new Tr({props:{handleKeyDown:(e,t)=>{let i=n;n=t;try{return r(e,t)}finally{n=i}}}}))}return{plugins:t,inputRules:n}}getExtensions(){return new Map(this.extensions.map(e=>[e.key,e]))}getExtension(e){if(typeof e==`string`)return this.extensions.find(t=>t.key===e)||void 0;if(typeof e==`function`)return this.extensionFactories.get(e)||void 0;throw Error(`Invalid extension type: ${typeof e}`)}hasExtension(e){return typeof e==`string`?this.extensions.some(t=>t.key===e):typeof e==`object`&&`key`in e?this.extensions.some(t=>t.key===e.key):typeof e==`function`&&this.extensionFactories.has(e)}};function PA(e,t){let{$from:n,$to:r}=t;if(n.pos>n.start()&&n.pos<e.content.size){let t=e.textBetween(n.pos,n.pos+1);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(n.start(),n.pos).match(/[\w\p{P}]+$/u);t&&(n=e.resolve(n.pos-t[0].length))}}if(r.pos<r.end()&&r.pos>0){let t=e.textBetween(r.pos-1,r.pos);if(/^[\w\p{P}]$/u.test(t)){let t=e.textBetween(r.pos,r.end()).match(/^[\w\p{P}]+/u);t&&(r=e.resolve(r.pos+t[0].length))}}return{$from:n,$to:r,from:n.pos,to:r.pos}}function FA(e){if(e.selection.empty||`node`in e.selection)return;let t=e.doc.resolve(Ay(e.doc,e.selection.from).posBeforeNode),n=e.doc.resolve(Ay(e.doc,e.selection.to).posBeforeNode),r=(n,r)=>{let i=t.posAtIndex(n,r),a=e.doc.resolve(i).nodeAfter;if(!a)throw Error(`Error getting selection - node not found at position ${i}`);return Vb(a,e.doc)},i=[],a=t.sharedDepth(n.pos),o=t.index(a),s=n.index(a);if(t.depth>a){i.push(Vb(t.nodeAfter,e.doc));for(let e=t.depth;e>a;e--)if(t.node(e).type.isInGroup(`childContainer`)){let n=t.index(e)+1,a=t.node(e).childCount;for(let t=n;t<a;t++)i.push(r(t,e))}}else i.push(r(o,a));for(let e=o+1;e<=s;e++)i.push(r(e,a));if(i.length===0)throw Error(`Error getting selection - selection doesn't span any blocks (${e.selection})`);return{blocks:i}}function IA(e,t,n){let r=typeof t==`string`?t:t.id,i=typeof n==`string`?n:n.id;if(r===i)throw Error(`Attempting to set selection with the same anchor and head blocks (id ${r})`);let a=mw(r,e.doc);if(!a)throw Error(`Block with ID ${r} not found`);let o=mw(i,e.doc);if(!o)throw Error(`Block with ID ${i} not found`);let s=jy(a.node,a.posBeforeNode),c=jy(o.node,o.posBeforeNode),l=wy(s,`start`);if(l===null)throw Error(`Attempting to set selection anchor in block without content (id ${r})`);let u=wy(c,`end`);if(u===null)throw Error(`Attempting to set selection head in block without content (id ${i})`);e.setSelection(gr.create(e.doc,l,u))}function LA(e,t=!1){let n=t?PA(e.doc,e.selection):e.selection,r=n.$from,i=n.$to;for(;i.parentOffset>=i.parent.nodeSize-2&&i.depth>0;)i=e.doc.resolve(i.pos+1);for(;i.parentOffset===0&&i.depth>0;)i=e.doc.resolve(i.pos-1);for(;r.parentOffset===0&&r.depth>0;)r=e.doc.resolve(r.pos-1);for(;r.parentOffset>=r.parent.nodeSize-2&&r.depth>0;)r=e.doc.resolve(r.pos+1);let a=Ub(e.doc.slice(r.pos,i.pos,!0));return{_meta:{startPos:r.pos,endPos:i.pos},...a}}var RA=class{editor;constructor(e){this.editor=e}getSelection(){return this.editor.transact(e=>FA(e))}getSelectionCutBlocks(e=!1){return this.editor.transact(t=>LA(t,e))}setSelection(e,t){return this.editor.transact(n=>IA(n,e,t))}getTextCursorPosition(){return this.editor.transact(e=>Dk(e))}setTextCursorPosition(e,t=`start`){return this.editor.transact(n=>Ok(n,e,t))}getSelectionBoundingBox(){if(!this.editor.prosemirrorView)return;let{selection:e}=this.editor.prosemirrorState,{ranges:t}=e,n=Math.min(...t.map(e=>e.$from.pos)),r=Math.max(...t.map(e=>e.$to.pos));if(Ye(e)){let e=this.editor.prosemirrorView.nodeDOM(n);if(e)return e.getBoundingClientRect()}return mt(this.editor.prosemirrorView,n,r).toJSON()}},zA=class{editor;constructor(e){this.editor=e}activeTransaction=null;can(e){try{return this.isInCan=!0,e()}finally{this.isInCan=!1}}isInCan=!1;exec(e){if(this.activeTransaction)throw Error("`exec` should not be called within a `transact` call, move the `exec` call outside of the `transact` call");if(this.isInCan)return this.canExec(e);let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,e=>this.prosemirrorView.dispatch(e),n)}canExec(e){if(this.activeTransaction)throw Error("`canExec` should not be called within a `transact` call, move the `canExec` call outside of the `transact` call");let t=this.prosemirrorState,n=this.prosemirrorView;return e(t,void 0,n)}transact(e){if(this.activeTransaction)return e(this.activeTransaction);try{this.activeTransaction=this.editor._tiptapEditor.state.tr;let t=e(this.activeTransaction),n=this.activeTransaction;return this.activeTransaction=null,n&&(n.docChanged||n.selectionSet||n.scrolledIntoView||n.storedMarksSet||!n.isGeneric)&&this.prosemirrorView.dispatch(n),t}finally{this.activeTransaction=null}}get prosemirrorState(){if(this.activeTransaction)throw Error("`prosemirrorState` should not be called within a `transact` call, move the `prosemirrorState` call outside of the `transact` call or use `editor.transact` to read the current editor state");return this.editor._tiptapEditor.state}get prosemirrorView(){return this.editor._tiptapEditor.view}isFocused(){return this.prosemirrorView?.hasFocus()||!1}focus(){this.prosemirrorView?.focus()}get isEditable(){if(!this.editor._tiptapEditor){if(!this.editor.headless)throw Error(`no editor, but also not headless?`);return!1}if(this.editor.headless){let e=this.editor.getExtension(sT)?.store.state;if(e)return e.isEditable&&e.enabledSet.size===0}return this.editor._tiptapEditor.isEditable===void 0||this.editor._tiptapEditor.isEditable}set isEditable(e){if(this.editor._tiptapEditor)this.editor.getExtension(sT).setEditable(e);else if(!this.editor.headless)throw Error(`no editor, but also not headless?`)}undo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.undoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.undoCommand);throw Error(`No undo plugin found`)}redo(){let e=this.editor.getExtension(`yUndo`);if(e)return this.exec(e.redoCommand);let t=this.editor.getExtension(`history`);if(t)return this.exec(t.redoCommand);throw Error(`No redo plugin found`)}};function BA(e,t,n,r={updateSelection:!0}){let{from:i,to:a}=typeof t==`number`?{from:t,to:t}:{from:t.from,to:t.to},o=!0,s=!0,c=``;if(n.forEach(e=>{e.check(),o&&e.isText&&e.marks.length===0?c+=e.text:o=!1,s=s?e.isBlock:!1}),i===a&&s){let{parent:t}=e.doc.resolve(i);t.isTextblock&&!t.type.spec.code&&!t.childCount&&(--i,a+=1)}return o?e.insertText(c,i,a):e.replaceWith(i,a,n),r.updateSelection&&Nt(e,e.steps.length-1,-1),!0}var VA=class{editor;constructor(e){this.editor=e}insertInlineContent(e,{updateSelection:t=!1}={}){let n=dS(e,this.editor.pmSchema);this.editor.transact(e=>{BA(e,{from:e.selection.from,to:e.selection.to},n,{updateSelection:t})})}getActiveStyles(){return this.editor.transact(e=>{let t={},n=e.selection.empty&&e.storedMarks||e.selection.$to.marks();for(let e of n){let n=this.editor.schema.styleSchema[e.type.name];n?n.propSchema===`boolean`?t[n.type]=!0:t[n.type]=e.attrs.stringValue:e.type.name!==`link`&&!e.type.spec.blocknoteIgnore&&console.warn(`mark not found in styleschema`,e.type.name)}return t})}addStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if(e.propSchema===`boolean`)this.editor._tiptapEditor.commands.setMark(t);else if(e.propSchema===`string`)this.editor._tiptapEditor.commands.setMark(t,{stringValue:n});else throw new sb(e.propSchema)}}removeStyles(e){for(let t of Object.keys(e))this.editor._tiptapEditor.commands.unsetMark(t)}toggleStyles(e){for(let[t,n]of Object.entries(e)){let e=this.editor.schema.styleSchema[t];if(!e)throw Error(`style ${t} not found in styleSchema`);if(e.propSchema===`boolean`)this.editor._tiptapEditor.commands.toggleMark(t);else if(e.propSchema===`string`)this.editor._tiptapEditor.commands.toggleMark(t,{stringValue:n});else throw new sb(e.propSchema)}}getSelectedText(){return this.editor.transact(e=>e.doc.textBetween(e.selection.from,e.selection.to))}getLinkMarkAtPos(e){return this.editor.transact(t=>{let n=this.editor.pmSchema.marks.link,r=tt(t.doc.resolve(e),n);if(!r)return;let i=t.doc.nodeAt(r.from)?.marks.find(e=>e.type===n);if(i)return{href:i.attrs.href,from:r.from,to:r.to,text:t.doc.textBetween(r.from,r.to)}})}getSelectedLinkUrl(){return this.editor.transact(e=>(e.doc.nodeAt(e.selection.from)?.marks.find(e=>e.type.name===`link`))?.attrs.href)}createLink(e,t){e!==``&&this.editor.transact(n=>{let{from:r,to:i}=n.selection,a=this.editor.pmSchema.mark(`link`,{href:e});t?n.insertText(t,r,i).addMark(r,r+t.length,a):n.addMark(r,i,a)})}editLink(e,t,n=this.editor.transact(e=>e.selection.anchor)){this.editor.transact(r=>{let{from:i,to:a}=this.getLinkMarkAtPos(n)||{from:r.selection.from,to:r.selection.to},o=this.editor.pmSchema.mark(`link`,{href:e});t!==r.doc.textBetween(i,a)&&r.insertText(t,i,a),r.addMark(i,i+t.length,o)}),this.editor.prosemirrorView.focus()}deleteLink(e=this.editor.transact(e=>e.selection.anchor)){this.editor.transact(t=>{let{from:n,to:r}=this.getLinkMarkAtPos(e)||{from:t.selection.from,to:t.selection.to};t.removeMark(n,r,this.editor.pmSchema.marks.link).setMeta(`preventAutolink`,!0)}),this.editor.prosemirrorView.focus()}};function HA(e){return it(e.state.selection.$from,e=>e.type.name===`tableCell`||e.type.name===`tableHeader`)!==void 0}function UA(e,t){let n=t.nodes.hardBreak,r=dr.empty;return e.forEach(e=>{e.isTextblock&&e.childCount>0?(r=r.append(e.content),r=r.addToEnd(n.create())):e.isText?r=r.addToEnd(e):e.isBlock&&e.childCount>0&&(r=r.append(UA(e.content,t)),r=r.addToEnd(n.create()))}),r.lastChild?.type===n&&(r=r.cut(0,r.size-1)),r}function WA(e,t){let n=[];return e.forEach((e,r,i)=>{i!==t&&n.push(e)}),dr.from(n)}function GA(e,t){let n=[];for(let r=0;r<e.childCount;r++)if(e.child(r).type.name===`tableRow`){if(n.length>0&&n[n.length-1].type.name===`table`){let t=n[n.length-1],i=t.copy(t.content.addToEnd(e.child(r)));n[n.length-1]=i}else{let i=t.nodes.table.createChecked(void 0,e.child(r));n.push(i)}}else n.push(e.child(r));return e=dr.from(n),e}function KA(e,t){let n=dr.from(e.content);n=GA(n,t.state.schema);let r=qA(n,t,e);if(r)return r;let i=t.state.schema.nodes.tableParagraph;if(i&&HA(t)){let e=!1;if(n.descendants(t=>{t.type.isInGroup(`tableContent`)&&(e=!0)}),!e&&!i.validContent(n))return new br(UA(n,t.state.schema),0,0)}if(!JA(n,t))return new br(n,e.openStart,e.openEnd);for(let e=0;e<n.childCount;e++)if(n.child(e).type.spec.group===`blockContent`){let r=[n.child(e)];if(e+1<n.childCount&&n.child(e+1).type.name===`blockGroup`){let t=n.child(e+1).child(0).child(0);(t.type.name===`bulletListItem`||t.type.name===`numberedListItem`||t.type.name===`checkListItem`)&&(r.push(n.child(e+1)),n=WA(n,e+1))}let i=t.state.schema.nodes.blockContainer.createChecked(void 0,r);n=n.replaceChild(e,i)}return new br(n,e.openStart,e.openEnd)}function qA(e,t,n){if(HA(t)||t.dragging)return null;let r=Py(t.state);if(!r.hasContent||r.content.node.type.name===`paragraph`||r.contentKind!==`inline`||!r.isContentEmpty)return null;let i=r.content.node,a=e.firstChild,o=a?.firstChild,s=o?.firstChild;if(a?.type.name!==`blockGroup`||o?.type.name!==`blockContainer`||s?.type.name!==`paragraph`)return null;let c=i.type.create(i.attrs,s.content),l=o.copy(o.content.replaceChild(0,c)),u=a.copy(a.content.replaceChild(0,l));return new br(e.replaceChild(0,u),n.openStart,n.openEnd)}function JA(e,t){let n=e.childCount===1,r=e.firstChild?.type.spec.content===`inline*`,i=e.firstChild?.type.spec.content===`tableRow+`;if(n){if(r)return!1;if(i){let e=Py(t.state);if(e.hasContent)return e.contentKind!==`table`}}return!0}var YA={enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!1},XA=class e extends YD{options;pmSchema;_tiptapEditor;elementRenderer=null;blockCache=new WeakMap;dictionary;schema;blockImplementations;inlineContentImplementations;styleImplementations;uploadFile;onUploadStartCallbacks=[];onUploadEndCallbacks=[];resolveFileUrl;settings;static create(t){return new e(t??{})}constructor(e){super(),this.options=e,this.dictionary=e.dictionary||jf,this.settings={tables:{splitCells:e?.tables?.splitCells??!1,cellBackgroundColor:e?.tables?.cellBackgroundColor??!1,cellTextColor:e?.tables?.cellTextColor??!1,headers:e?.tables?.headers??!1}};let t={defaultStyles:!0,schema:e.schema||tw.create(),...e,placeholders:{...this.dictionary.placeholders,...e.placeholders}};if(this.schema=t.schema,this.blockImplementations=t.schema.blockSpecs,this.inlineContentImplementations=t.schema.inlineContentSpecs,this.styleImplementations=t.schema.styleSpecs,t.uploadFile){let e=t.uploadFile;this.uploadFile=async(t,n)=>{this.onUploadStartCallbacks.forEach(e=>e.apply(this,[n]));try{return await e(t,n)}finally{this.onUploadEndCallbacks.forEach(e=>e.apply(this,[n]))}}}this.resolveFileUrl=t.resolveFileUrl,this._eventManager=new xO(this),this._extensionManager=new NA(this,t);let n=this._extensionManager.getTiptapExtensions(),r={...YA,...t._tiptapOptions,editable:!0,element:null,autofocus:t.autofocus??!1,extensions:n,editorProps:{scrollMargin:{top:72,bottom:72,left:0,right:0},...t._tiptapOptions?.editorProps,attributes:{tabIndex:`0`,...t._tiptapOptions?.editorProps?.attributes,...t.domAttributes?.editor,class:db(`bn-editor`,t.defaultStyles?`bn-default-styles`:``,t.domAttributes?.editor?.class||``)},transformPasted:KA}};try{let e=t.initialContent||[{type:`paragraph`,id:Qy.options.generateID()}];if(!Array.isArray(e)||e.length===0)throw Error(`initialContent must be a non-empty array of blocks, received: `+JSON.stringify(e));let n=rt(r.extensions);n.cached.blockNoteEditor=this;let i=e.map(e=>hS(e,n,this.schema.styleSchema).toJSON()),a=ot({type:`doc`,content:[{type:`blockGroup`,content:i}]},n,r.parseOptions);a.check(),this._tiptapEditor=new Rt({...r,content:a.toJSON()}),this.pmSchema=this._tiptapEditor.schema}catch(e){throw Error("Error creating document from blocks passed as `initialContent`",{cause:e})}this.pmSchema.cached.blockNoteEditor=this,this._tiptapEditor.on(`mount`,()=>{this.headless=!1}),this._tiptapEditor.on(`unmount`,()=>{this.headless=!0}),this._tiptapEditor.on(`destroy`,()=>{this.emit(`destroy`)}),this._blockManager=new bO(this),this._exportManager=new Ek(this),this._selectionManager=new RA(this),this._stateManager=new zA(this),this._styleManager=new VA(this),this.emit(`create`)}_blockManager;_eventManager;_exportManager;_extensionManager;_selectionManager;_stateManager;_styleManager;get extensions(){return this._extensionManager.getExtensions()}exec(e){return this._stateManager.exec(e)}canExec(e){return this._stateManager.canExec(e)}transact(e){return this._stateManager.transact(e)}unregisterExtension(e){return this._extensionManager.unregisterExtension(e)}registerExtension=(...e)=>this._extensionManager.registerExtension(...e);replaceExtension=(...e)=>this._extensionManager.replaceExtension(...e);getExtension=(e=>this._extensionManager.getExtension(e));mount=e=>{this._tiptapEditor.mount({mount:e}),this._tiptapEditor.isEditorContentInitialized=!0};unmount=()=>{this._tiptapEditor.isEditorContentInitialized=!1,this._tiptapEditor.unmount()};get prosemirrorState(){return this._stateManager.prosemirrorState}get prosemirrorView(){return this._stateManager.prosemirrorView}get domElement(){if(!this.headless)return this.prosemirrorView?.dom}_portalElements=new Map;registerPortalElement=e=>{this._portalElements.set(e,(this._portalElements.get(e)??0)+1)};unregisterPortalElement=e=>{let t=this._portalElements.get(e);t!==void 0&&(t<=1?this._portalElements.delete(e):this._portalElements.set(e,t-1))};isWithinEditor=e=>{if(this.domElement?.parentElement?.contains(e))return!0;for(let t of this._portalElements.keys())if(t.contains(e))return!0;return!1};isFocused(e){if(this.headless)return!1;let t=this.prosemirrorView?.hasFocus()||!1;if(!e?.includeEditorUI)return t;let n=typeof document<`u`?document.activeElement:null;return t||!!n&&this.isWithinEditor(n)}headless=!0;focus(){this.headless||this.prosemirrorView.focus()}blur(){this.headless||this.domElement?.blur()}onUploadStart(e){return this.onUploadStartCallbacks.push(e),()=>{let t=this.onUploadStartCallbacks.indexOf(e);t>-1&&this.onUploadStartCallbacks.splice(t,1)}}onUploadEnd(e){return this.onUploadEndCallbacks.push(e),()=>{let t=this.onUploadEndCallbacks.indexOf(e);t>-1&&this.onUploadEndCallbacks.splice(t,1)}}get topLevelBlocks(){return this.document}get document(){return this._blockManager.document}getBlock(e){return this._blockManager.getBlock(e)}getPrevBlock(e){return this._blockManager.getPrevBlock(e)}getNextBlock(e){return this._blockManager.getNextBlock(e)}getParentBlock(e){return this._blockManager.getParentBlock(e)}forEachBlock(e,t=!1){this._blockManager.forEachBlock(e,t)}onEditorContentChange(e){this._tiptapEditor.on(`update`,e)}onEditorSelectionChange(e){this._tiptapEditor.on(`selectionUpdate`,e)}onBeforeChange(e){return this._extensionManager.getExtension(Fw).subscribe(e)}getTextCursorPosition(){return this._selectionManager.getTextCursorPosition()}setTextCursorPosition(e,t=`start`){return this._selectionManager.setTextCursorPosition(e,t)}getSelection(){return this._selectionManager.getSelection()}getSelectionCutBlocks(e=!1){return this._selectionManager.getSelectionCutBlocks(e)}setSelection(e,t){return this._selectionManager.setSelection(e,t)}get isEditable(){return this._stateManager.isEditable}set isEditable(e){this._stateManager.isEditable=e}insertBlocks(e,t,n=`before`){return this._blockManager.insertBlocks(e,t,n)}updateBlock(e,t){return this._blockManager.updateBlock(e,t)}removeBlocks(e){return this._blockManager.removeBlocks(e)}replaceBlocks(e,t){return this._blockManager.replaceBlocks(e,t)}undo(){return this._stateManager.undo()}redo(){return this._stateManager.redo()}insertInlineContent(e,{updateSelection:t=!1}={}){this._styleManager.insertInlineContent(e,{updateSelection:t})}getActiveStyles(){return this._styleManager.getActiveStyles()}addStyles(e){this._styleManager.addStyles(e)}removeStyles(e){this._styleManager.removeStyles(e)}toggleStyles(e){this._styleManager.toggleStyles(e)}getSelectedText(){return this._styleManager.getSelectedText()}getSelectedLinkUrl(){return this._styleManager.getSelectedLinkUrl()}createLink(e,t){this._styleManager.createLink(e,t)}getLinkMarkAtPos(e){return this._styleManager.getLinkMarkAtPos(e)}editLink(e,t,n){this._styleManager.editLink(e,t,n)}deleteLink(e){this._styleManager.deleteLink(e)}canNestBlock(){return this._blockManager.canNestBlock()}nestBlock(){this._blockManager.nestBlock()}canUnnestBlock(){return this._blockManager.canUnnestBlock()}unnestBlock(){this._blockManager.unnestBlock()}moveBlocksUp(e){return this._blockManager.moveBlocksUp(e)}moveBlocksDown(e){return this._blockManager.moveBlocksDown(e)}blocksToHTMLLossy(e=this.document){return this._exportManager.blocksToHTMLLossy(e)}blocksToFullHTML(e=this.document){return this._exportManager.blocksToFullHTML(e)}tryParseHTMLToBlocks(e){return this._exportManager.tryParseHTMLToBlocks(e)}blocksToMarkdownLossy(e=this.document){return this._exportManager.blocksToMarkdownLossy(e)}tryParseMarkdownToBlocks(e){return this._exportManager.tryParseMarkdownToBlocks(e)}onChange(e,t){return this._eventManager.onChange(e,t)}onSelectionChange(e,t){return this._eventManager.onSelectionChange(e,t)}onFocusChange(e,t){return this._eventManager.onFocusChange(e,t)}onMount(e){return this._eventManager.onMount(e)}onUnmount(e){return this._eventManager.onUnmount(e)}getSelectionBoundingBox(){return this._selectionManager.getSelectionBoundingBox()}get isEmpty(){let e=this.document;return e.length===0||e.length===1&&e[0].type===`paragraph`&&e[0].content.length===0}pasteHTML(e,t=!1){this._exportManager.pasteHTML(e,t)}pasteText(e){return this._exportManager.pasteText(e)}pasteMarkdown(e){return this._exportManager.pasteMarkdown(e)}};function ZA(e,t){let n=(t?.editor??tp()).getExtension(e);if(!n)throw Error(`Extension not found`,{cause:{plugin:e}});return n}function QA(e,t){let{store:n}=ZA(e,t);if(!n)throw Error(`Store not found on plugin`,{cause:{plugin:e}});return np(n,t?.selector)}function $A(e){let t=new DOMRect,n=`getBoundingClientRect`in e?()=>e.getBoundingClientRect():()=>e.element.getBoundingClientRect();return()=>e.element&&(e.cacheMountedBoundingClientRect??!0)?(e.element.isConnected&&(t=n()),t):n()}function ej(e,t){return e?t?(n,r,i)=>{let a=e(n,r,i),o=t(n,r,i);return()=>{a?.(),o?.()}}:e:t}var tj=e=>{let t=tp(),n=pp(),{whileElementsMounted:r,middleware:i,...a}=e.useFloatingOptions??{},{refs:o,floatingStyles:s,context:c,middlewareData:l}=r_({whileElementsMounted:ej(P,e.useFloatingOptions?.whileElementsMounted),middleware:[...i??[],k()],...a}),{isMounted:u,styles:d}=u_(c,e.useTransitionStylesProps),{status:f}=l_(c,e.useTransitionStatusProps),{getFloatingProps:p}=a_([t_(c,e.useDismissProps),vg(c,{enabled:!1,...e.useHoverProps})]),m=(0,W.useRef)(``),h=(0,W.useRef)(null),g=Kh([h,o.setFloating]);if((0,W.useEffect)(()=>{if(e.reference){let n=`element`in e.reference?e.reference.element:void 0;n!==void 0&&(e.focusManagerProps?.disabled||!t.isWithinEditor(n))&&o.setReference(n);let r=`getClientRects`in e.reference?e.reference.getClientRects:n?()=>n.getClientRects():void 0;o.setPositionReference({getBoundingClientRect:$A(e.reference),...r?{getClientRects:r}:{},contextElement:n})}},[e.reference,o,e.focusManagerProps?.disabled,t]),(0,W.useEffect)(()=>{(f===`initial`||f===`open`)&&h.current&&bp(h.current)&&(m.current=h.current.innerHTML)},[f,e.reference,e.children]),!u||!n)return!1;let _={...e.elementProps,style:{display:`flex`,...e.elementProps?.style,zIndex:`calc(var(--bn-ui-base-z-index, 0) + ${e.elementProps?.style?.zIndex||0})`,...s,...d,...l.hide?.referenceHidden?{visibility:`hidden`}:{}},...p()};return f===`close`?(0,G.jsx)(Bg,{root:n,children:(0,G.jsx)(`div`,{ref:g,..._,dangerouslySetInnerHTML:{__html:m.current}})}):e.focusManagerProps?.disabled?(0,G.jsx)(Bg,{root:n,children:(0,G.jsx)(`div`,{ref:g,..._,children:(0,G.jsx)(xp,{children:e.children})})}):(0,G.jsx)(Bg,{root:n,children:(0,G.jsx)(Zg,{...e.focusManagerProps,context:c,children:(0,G.jsx)(`div`,{ref:g,..._,children:(0,G.jsx)(xp,{children:e.children})})})})},nj=e=>{let{position:t,children:n,...r}=e,{from:i,to:a}=t||{},o=tp(),s=cp(),c=(0,W.useMemo)(()=>{if(i!==void 0&&a!==void 0)return{element:s?.firstElementChild||void 0,getBoundingClientRect:()=>mt(o.prosemirrorView,i,a??i)}},[o,s,i,a]);return(0,G.jsx)(tj,{reference:c,...r,children:t!==void 0&&n})},rj=(e={},t=[])=>(0,W.useMemo)(()=>{let t=XA.create(e);return window&&(window.ProseMirror=t._tiptapEditor),t},t),ij=e=>{let[t,n]=(0,W.useState)(!1),r=sp({editor:e.editor,selector:({editor:e})=>e.isEmpty}),i=Cp(),a=(0,W.useCallback)(()=>{n(!0)},[]),o=(0,W.useCallback)(()=>{n(!1)},[]);return(0,W.useEffect)(()=>{e.editable&&e.autoFocus&&e.editor.focus()},[e.autoFocus,e.editable,e.editor]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(i.Comments.Editor,{autoFocus:e.autoFocus,className:`bn-comment-editor`,editor:e.editor,onFocus:a,onBlur:o,editable:e.editable}),e.actions&&(0,G.jsx)(`div`,{className:`bn-comment-actions-wrapper`,children:e.actions({isFocused:t,isEmpty:r})})]})},{textColor:aj,backgroundColor:oj,...sj}=QC,cj=tw.create({blockSpecs:{paragraph:_C()},styleSpecs:sj});function lj(e){return!e.hasUnsavedContent||!e.confirmBeforeDiscard||(e.confirm??(e=>window.confirm(e)))(e.message)}var uj=w_(({editor:e,options:{submitOnEnter:t=!0,onSubmit:n}})=>{let r=!1;async function i(){if(!(!e.isEditable||e.isEmpty||r)){r=!0;try{await n(e)}finally{r=!1}}}function a({event:t}){let n=e.prosemirrorView;return!n.editable||n.composing||t.isComposing||t.keyCode===229?!1:(t.repeat||i(),!0)}return{key:`commentEditorSubmit`,submit:i,runsBefore:[`default`],keyboardShortcuts:{"Mod-Enter":a,...t?{Enter:a}:{}}}}),dj=Qe.create({name:`comment`,excludes:``,inclusive:!1,keepOnSplit:!0,group:h_,addAttributes(){return{orphan:{parseHTML:e=>!!e.getAttribute(`data-orphan`),renderHTML:e=>e.orphan?{"data-orphan":`true`}:{},default:!1},threadId:{parseHTML:e=>e.getAttribute(`data-bn-thread-id`),renderHTML:e=>({"data-bn-thread-id":e.threadId}),default:``}}},renderHTML({HTMLAttributes:e}){return[`span`,kt(e,{class:`bn-thread-mark`})]},parseHTML(){return[{tag:`span.bn-thread-mark`}]},extendMarkSchema(e){return e.name===`comment`?{blocknoteIgnore:!0}:{}}}),fj=new hr(`blocknote-comments`);function pj(e,t){let n=new Map;return e.descendants((e,r)=>{e.marks.forEach(i=>{if(i.type.name===t){let t=i.attrs.threadId;if(!t)return;let a=r,o=a+e.nodeSize,s=n.get(t)??{from:1/0,to:0};n.set(t,{from:Math.min(a,s.from),to:Math.max(o,s.to)})}})}),n}var mj=w_(({editor:e,options:{schema:t,threadStore:n,resolveUsers:r,confirmBeforeDiscard:i=!0,submitOnEnter:a=!0}})=>{if(!r)throw Error(`resolveUsers is required to be defined when using comments`);if(!n)throw Error(`threadStore is required to be defined when using comments`);let o=aw(r),s=dj.name,c=T_({pendingComment:!1,selectedThreadId:void 0,threadPositions:new Map},{onUpdate(t,n){t.selectedThreadId!==n.selectedThreadId&&e.transact(e=>e.setMeta(fj,!0))}}),l=t=>{e.transact(e=>{e.doc.descendants((n,r)=>{n.marks.forEach(i=>{if(i.type.name===s){let a=i.type,o=i.attrs.threadId,s=t.get(o),l=!!(!s||s.resolved||s.deletedAt);if(l!==i.attrs.orphan){let t=Math.max(r,0),s=Math.min(r+n.nodeSize,e.doc.content.size-1,e.doc.content.size-1);e.removeMark(t,s,i),e.addMark(t,s,a.create({...i.attrs,orphan:l})),l&&c.state.selectedThreadId===o&&c.setState(e=>({...e,selectedThreadId:void 0}))}}})})})};return{key:`comments`,store:c,userStore:o,runsBefore:[`link`],tiptapExtensions:[dj],prosemirrorPlugins:[new Tr({key:fj,state:{init(){return{decorations:Cr.empty}},apply(e,t){let n=e.getMeta(fj);if(!e.docChanged&&!n)return t;let r=e.docChanged?pj(e.doc,s):c.state.threadPositions;(r.size>0||c.state.threadPositions.size>0)&&c.setState(e=>({...e,threadPositions:r}));let i=[];if(c.state.selectedThreadId){let e=r.get(c.state.selectedThreadId);e&&i.push(Er.inline(e.from,e.to,{class:`bn-thread-mark-selected`}))}return{decorations:Cr.create(e.doc,i)}}},props:{decorations(e){return fj.getState(e)?.decorations??Cr.empty},handleClick:(e,t,n)=>{if(n.button!==0)return!1;let r=e.state.doc.nodeAt(t);if(!r)return c.setState(e=>({...e,selectedThreadId:void 0})),!1;let i=r.marks.find(e=>e.type.name===s&&e.attrs.orphan!==!0);if(!i)return c.state.selectedThreadId!==void 0&&c.setState(e=>({...e,selectedThreadId:void 0})),!1;let a=i.attrs.threadId;return a!==c.state.selectedThreadId&&(c.setState(e=>({...e,selectedThreadId:a})),!0)}}})],threadStore:n,mount(){let t=n.subscribe(l);l(n.getThreads());let r=e.onSelectionChange(()=>{c.state.pendingComment&&c.setState(e=>({...e,pendingComment:!1}))});return()=>{t(),r()}},selectThread(t,n=!0){if(c.state.selectedThreadId!==t&&(c.setState(e=>({...e,pendingComment:!1,selectedThreadId:t})),t&&n)){let n=c.state.threadPositions.get(t);if(!n)return;(e.prosemirrorView?.domAtPos(n.from).node)?.scrollIntoView({behavior:`smooth`,block:`center`})}},startPendingComment(){c.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!0})),e.domElement?.focus(),e.getExtension(rw)?.showSelection(!0,`comments`)},stopPendingComment(){c.setState(e=>({...e,selectedThreadId:void 0,pendingComment:!1})),e.getExtension(rw)?.showSelection(!1,`comments`)},async createThread(t){let r=await n.createThread(t);n.addThreadToDocument?await n.addThreadToDocument({threadId:r.id,selection:e.transact(e=>e.selection),editor:e}):e._tiptapEditor.commands.setMark(s,{orphan:!1,threadId:r.id})},commentEditorSchema:t,confirmBeforeDiscard:i,submitOnEnter:a}}),hj=In(),gj=Object.defineProperty,_j=(e,t)=>{let n={};for(var r in e)gj(n,r,{get:e[r],enumerable:!0});return t||gj(n,Symbol.toStringTag,{value:`Module`}),n},vj=e=>{let{blockId:t,children:n,...r}=e,i=tp(),a=(0,W.useMemo)(()=>i.transact(e=>{if(!t)return;let n=mw(t,e.doc);if(!n)return;let r=vw(i.prosemirrorView,n.posBeforeNode,t);return r?{element:r}:void 0}),[i,t]);return(0,G.jsx)(tj,{reference:a,...r,children:t!==void 0&&n})},yj=e=>{let t=Cp(),n=wp(),r=tp(),i=r.getBlock(e.blockId),[a,o]=(0,W.useState)(``),s=(0,W.useCallback)(e=>{o(e.currentTarget.value)},[]),c=(0,W.useCallback)(()=>{r.getBlock(e.blockId)&&r.updateBlock(e.blockId,{props:{name:Cb(a),url:a}})},[r,e.blockId,a]);return i?(0,G.jsx)(t.FilePanel.TabPanel,{className:`bn-tab-panel`,children:(0,G.jsx)(t.Generic.Form.Root,{onSubmit:c,submitButton:(0,G.jsx)(t.FilePanel.Button,{className:`bn-button`,type:`submit`,"data-test":`embed-input-button`,children:n.file_panel.embed.embed_button[i.type]||n.file_panel.embed.embed_button.file}),children:(0,G.jsx)(t.FilePanel.TextInput,{className:`bn-text-input`,placeholder:n.file_panel.embed.url_placeholder,value:a,onChange:s,"data-test":`embed-input`})})}):null},bj=e=>{let t=Cp(),n=wp(),{setLoading:r}=e,i=tp(),a=i.getBlock(e.blockId),[o,s]=(0,W.useState)(!1);(0,W.useEffect)(()=>{o&&setTimeout(()=>{s(!1)},3e3)},[o]);let c=(0,W.useCallback)(t=>{if(t===null)return;async function n(t){if(r(!0),i.uploadFile!==void 0)try{let n=await i.uploadFile(t,e.blockId);if(!i.getBlock(e.blockId))return;typeof n==`string`&&(n={props:{name:t.name,url:n}}),i.updateBlock(e.blockId,n)}catch{s(!0)}finally{r(!1)}}n(t)},[e.blockId,i,r]);if(!a)return null;let l=i.schema.blockSpecs[a.type],u=l.implementation.meta.fileBlockAccept?.length?l.implementation.meta.fileBlockAccept.join(`,`):`*/*`;return(0,G.jsxs)(t.FilePanel.TabPanel,{className:`bn-tab-panel`,children:[(0,G.jsx)(t.FilePanel.FileInput,{className:`bn-file-input`,"data-test":`upload-input`,accept:u,placeholder:n.file_panel.upload.file_placeholder[a.type]||n.file_panel.upload.file_placeholder.file,value:null,onChange:c}),o&&(0,G.jsx)(`div`,{className:`bn-error-text`,children:n.file_panel.upload.upload_error})]})},xj=e=>{let t=Cp(),n=wp(),r=tp(),[i,a]=(0,W.useState)(!1),o=e.tabs??[...r.uploadFile===void 0?[]:[{name:n.file_panel.upload.title,tabPanel:(0,G.jsx)(bj,{blockId:e.blockId,setLoading:a})}],{name:n.file_panel.embed.title,tabPanel:(0,G.jsx)(yj,{blockId:e.blockId})}],[s,c]=(0,W.useState)(e.defaultOpenTab||o[0].name);return(0,G.jsx)(t.FilePanel.Root,{className:`bn-panel`,defaultOpenTab:s,openTab:s,setOpenTab:c,tabs:o,loading:i})},Sj=e=>{let t=tp(),n=ZA(CS),r=QA(CS),i=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!r,onOpenChange:(e,r,i)=>{e||n.closeMenu(),i===`escape-key`&&t.focus()},middleware:[A(10),te()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:90},...e.floatingUIOptions?.elementProps}}),[r,t,n,e.floatingUIOptions]),a=e.filePanel||xj;return(0,G.jsx)(hp,{target:e.portalElement,children:(0,G.jsx)(vj,{blockId:r,...i,children:r&&(0,G.jsx)(a,{blockId:r})})})},Cj={bold:Tm,italic:pm,underline:tm,strike:im,code:Am};function wj(e,t){return e in t.schema.styleSchema&&t.schema.styleSchema[e].type===e&&t.schema.styleSchema[e].propSchema===`boolean`}var Tj=e=>{let t=wp(),n=Cp(),r=tp(),i=sp({editor:r,selector:({editor:t})=>{if(t.isEditable&&wj(e.basicTextStyle,t)&&(t.getSelection()?.blocks||[t.getTextCursorPosition().block]).find(e=>e.content!==void 0))return e.basicTextStyle in t.getActiveStyles()?{active:!0}:{active:!1}}}),a=(0,W.useCallback)(e=>{r.focus(),r.toggleStyles({[e]:!0})},[r]);if(i===void 0)return null;let o=Cj[e.basicTextStyle];return(0,G.jsx)(n.FormattingToolbar.Button,{className:`bn-button`,"data-test":e.basicTextStyle,onClick:()=>a(e.basicTextStyle),isSelected:i.active,label:t.formatting_toolbar[e.basicTextStyle].tooltip,mainTooltip:t.formatting_toolbar[e.basicTextStyle].tooltip,secondaryTooltip:ub(t.formatting_toolbar[e.basicTextStyle].secondary_tooltip,t.generic.ctrl_shortcut),icon:(0,G.jsx)(o,{})})},Ej=(0,W.createContext)(`desktop`);function Dj(){return(0,W.useContext)(Ej)}var Oj=e=>{let t=e.textColor||`default`,n=e.backgroundColor||`default`,r=e.size||16,i=(0,W.useMemo)(()=>({pointerEvents:`none`,fontSize:(r*.75).toString()+`px`,height:r.toString()+`px`,lineHeight:r.toString()+`px`,textAlign:`center`,width:r.toString()+`px`}),[r]);return(0,G.jsx)(`div`,{className:`bn-color-icon`,"data-background-color":n,"data-text-color":t,style:i,children:`A`})},kj=[`default`,`gray`,`brown`,`red`,`orange`,`yellow`,`green`,`blue`,`purple`,`pink`],Aj=e=>{let t=Cp(),n=wp();return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(()=>e.text?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(t.Generic.Menu.Label,{children:n.color_picker.text_title}),kj.map(r=>(0,G.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick?.(),e.text.setColor(r)},"data-test":`text-color-`+r,icon:(0,G.jsx)(Oj,{textColor:r,size:e.iconSize}),checked:e.text.color===r,children:n.color_picker.colors[r]},`text-color-`+r))]}):null,{}),(0,G.jsx)(()=>e.background?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(t.Generic.Menu.Label,{children:n.color_picker.background_title}),kj.map(r=>(0,G.jsx)(t.Generic.Menu.Item,{onClick:()=>{e.onClick?.(),e.background.setColor(r)},"data-test":`background-color-`+r,icon:(0,G.jsx)(Oj,{backgroundColor:r,size:e.iconSize}),checked:e.background.color===r,children:n.color_picker.colors[r]},`background-color-`+r))]}):null,{})]})};function jj(e,t){return`${e}Color`in t.schema.styleSchema&&t.schema.styleSchema[`${e}Color`].type===`${e}Color`&&t.schema.styleSchema[`${e}Color`].propSchema===`string`}var Mj=()=>{let e=Cp(),t=wp(),n=Dj(),r=pp(),i=tp(),a=jj(`text`,i),o=jj(`background`,i),s=sp({editor:i,selector:({editor:e})=>{if(!e.isEditable||!(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return;let t=jj(`text`,e),n=jj(`background`,e);if(t||n)return{textColor:t?e.getActiveStyles().textColor||`default`:void 0,backgroundColor:n?e.getActiveStyles().backgroundColor||`default`:void 0}}}),c=(0,W.useCallback)(e=>{if(!a)throw Error(`Tried to set text color, but style does not exist in editor schema.`);e==="default"?i.removeStyles({textColor:e}):i.addStyles({textColor:e}),i.focus()},[i,a]),l=(0,W.useCallback)(e=>{if(!o)throw Error(`Tried to set background color, but style does not exist in editor schema.`);e==="default"?i.removeStyles({backgroundColor:e}):i.addStyles({backgroundColor:e}),i.focus()},[o,i]);return s===void 0?null:(0,G.jsxs)(e.Generic.Menu.Root,{portalElement:r,preventFocusOnOpen:n===`mobile`,children:[(0,G.jsx)(e.Generic.Menu.Trigger,{children:(0,G.jsx)(e.FormattingToolbar.Button,{className:`bn-button`,"data-test":`colors`,label:t.formatting_toolbar.colors.tooltip,mainTooltip:t.formatting_toolbar.colors.tooltip,icon:(0,G.jsx)(Oj,{textColor:s.textColor,backgroundColor:s.backgroundColor,size:20})})}),(0,G.jsx)(e.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,G.jsx)(Aj,{text:s.textColor?{color:s.textColor,setColor:c}:void 0,background:s.backgroundColor?{color:s.backgroundColor,setColor:l}:void 0})})]})};function Nj(){let e=wp();return(0,G.jsx)(`button`,{className:`bn-screen-reader-only-submit`,tabIndex:-1,type:`submit`,children:e.generic.form_submit})}var Pj=e=>{for(let t of Xw)if(e.startsWith(t))return e;return`${Zw}://${e}`},Fj=e=>{let t=Cp(),n=wp(),{editLink:r}=ZA(Yw),{url:i,text:a,showTextField:o}=e,[s,c]=(0,W.useState)(i),[l,u]=(0,W.useState)(a);(0,W.useEffect)(()=>{c(i),u(a)},[a,i]);let d=(0,W.useCallback)(e=>c(e.currentTarget.value),[]),f=(0,W.useCallback)(e=>u(e.currentTarget.value),[]),p=(0,W.useCallback)(()=>{r(Pj(s),l,e.range.from),e.setToolbarOpen?.(!1),e.setToolbarPositionFrozen?.(!1)},[r,s,l,e]);return(0,G.jsxs)(t.Generic.Form.Root,{onSubmit:p,submitButton:(0,G.jsx)(Nj,{}),children:[(0,G.jsx)(t.Generic.Form.TextInput,{className:`bn-text-input`,name:`url`,icon:(0,G.jsx)(dm,{}),autoFocus:!0,placeholder:n.link_toolbar.form.url_placeholder,value:s,onChange:d}),o!==!1&&(0,G.jsx)(t.Generic.Form.TextInput,{className:`bn-text-input`,name:`title`,icon:(0,G.jsx)(nm,{}),placeholder:n.link_toolbar.form.title_placeholder,value:l,onChange:f})]})};function Ij(e){return`link`in e.schema.inlineContentSchema&&e.schema.inlineContentSchema.link===`link`}var Lj=()=>{let e=tp(),t=cp(),n=Cp(),r=wp(),i=pp(),a=ZA(zC),{showSelection:o}=ZA(rw),[s,c]=(0,W.useState)(!1);(0,W.useEffect)(()=>(o(s,`createLinkButton`),()=>o(!1,`createLinkButton`)),[s,o]);let l=(0,W.useCallback)(t=>{t||e.focus(),c(t)},[e]),u=sp({editor:e,selector:({editor:e})=>{if(e.isEditable&&!e.prosemirrorState.selection.empty&&Ij(e)&&!PC(e.prosemirrorState.selection)&&(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return{url:e.getSelectedLinkUrl(),text:e.getSelectedText(),range:{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}}}});return(0,W.useEffect)(()=>{c(!1)},[u]),(0,W.useEffect)(()=>{let n=t=>{e.isEditable&&(t.ctrlKey||t.metaKey)&&t.key===`k`&&(c(!0),t.preventDefault())};return t?.addEventListener(`keydown`,n),()=>{t?.removeEventListener(`keydown`,n)}},[e,t]),u===void 0?null:(0,G.jsxs)(n.Generic.Popover.Root,{open:s,onOpenChange:l,portalElement:i,children:[(0,G.jsx)(n.Generic.Popover.Trigger,{children:(0,G.jsx)(n.FormattingToolbar.Button,{className:`bn-button`,"data-test":`createLink`,label:r.formatting_toolbar.link.tooltip,mainTooltip:r.formatting_toolbar.link.tooltip,secondaryTooltip:ub(r.formatting_toolbar.link.secondary_tooltip,r.generic.ctrl_shortcut),icon:(0,G.jsx)(dm,{}),onClick:()=>l(!s)})}),(0,G.jsx)(n.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,G.jsx)(Fj,{url:u.url||``,text:u.text,range:u.range,showTextField:!1,setToolbarOpen:e=>a.store.setState(e)})})]})},Rj=()=>{let e=wp(),t=Cp(),n=pp(),r=tp(),i=sp({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(NC(n,e,n.type,{url:`string`,caption:`string`}))return n}}),[a,o]=(0,W.useState)(!1),s=(0,W.useCallback)(e=>{e||r.focus(),o(e)},[r]),c=(0,W.useCallback)(e=>{i!==void 0&&MC(r,i.type,{caption:`string`})&&r.updateBlock(i.id,{props:{caption:e.currentTarget.value}})},[i,r]);return i===void 0?null:(0,G.jsxs)(t.Generic.Popover.Root,{open:a,onOpenChange:s,portalElement:n,children:[(0,G.jsx)(t.Generic.Popover.Trigger,{children:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_caption.tooltip,mainTooltip:e.formatting_toolbar.file_caption.tooltip,icon:(0,G.jsx)(mm,{}),onClick:()=>s(!a)})}),(0,G.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,G.jsx)(t.Generic.Form.Root,{onSubmit:()=>s(!1),submitButton:(0,G.jsx)(Nj,{}),children:(0,G.jsx)(t.Generic.Form.TextInput,{name:`file-caption`,icon:(0,G.jsx)(mm,{}),value:i.props.caption,autoFocus:!0,placeholder:e.formatting_toolbar.file_caption.input_placeholder,onChange:c})})})]})},zj=()=>{let e=wp(),t=Cp(),n=tp(),r=sp({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(NC(n,e,n.type,{url:`string`}))return n}}),i=(0,W.useCallback)(()=>{r!==void 0&&(n.focus(),n.removeBlocks([r.id]))},[r,n]);return r===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_delete.tooltip[r.type]||e.formatting_toolbar.file_delete.tooltip.file,mainTooltip:e.formatting_toolbar.file_delete.tooltip[r.type]||e.formatting_toolbar.file_delete.tooltip.file,icon:(0,G.jsx)(Kp,{}),onClick:i})},Bj=()=>{let e=wp(),t=Cp(),n=pp(),r=tp(),i=sp({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(NC(n,e,n.type,{url:`string`,name:`string`}))return n}}),[a,o]=(0,W.useState)(!1),s=(0,W.useCallback)(e=>{e||r.focus(),o(e)},[r]),c=(0,W.useCallback)(e=>{i!==void 0&&MC(r,i.type,{name:`string`})&&r.updateBlock(i.id,{props:{name:e.currentTarget.value}})},[i,r]);return i===void 0?null:(0,G.jsxs)(t.Generic.Popover.Root,{open:a,onOpenChange:s,portalElement:n,children:[(0,G.jsx)(t.Generic.Popover.Trigger,{children:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_rename.tooltip[i.type]||e.formatting_toolbar.file_rename.tooltip.file,mainTooltip:e.formatting_toolbar.file_rename.tooltip[i.type]||e.formatting_toolbar.file_rename.tooltip.file,icon:(0,G.jsx)(Cm,{}),onClick:()=>s(!a)})}),(0,G.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,G.jsx)(t.Generic.Form.Root,{onSubmit:()=>s(!1),submitButton:(0,G.jsx)(Nj,{}),children:(0,G.jsx)(t.Generic.Form.TextInput,{name:`file-name`,icon:(0,G.jsx)(Cm,{}),value:i.props.name,autoFocus:!0,placeholder:e.formatting_toolbar.file_rename.input_placeholder[i.type]||e.formatting_toolbar.file_rename.input_placeholder.file,onChange:c})})})]})},Vj=()=>{let e=wp(),t=Cp(),n=pp(),r=tp(),i=sp({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(NC(n,e,n.type,{url:`string`}))return n}});return i===void 0?null:(0,G.jsxs)(t.Generic.Popover.Root,{onOpenChange:e=>{e||r.focus()},portalElement:n,children:[(0,G.jsx)(t.Generic.Popover.Trigger,{children:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,mainTooltip:e.formatting_toolbar.file_replace.tooltip[i.type]||e.formatting_toolbar.file_replace.tooltip.file,label:e.formatting_toolbar.file_replace.tooltip[i.type]||e.formatting_toolbar.file_replace.tooltip.file,icon:(0,G.jsx)(Zp,{})})}),(0,G.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-panel-popover`,variant:`panel-popover`,children:(0,G.jsx)(xj,{blockId:i.id})})]})},Hj=()=>{let e=wp(),t=Cp(),n=tp(),r=sp({editor:n,selector:({editor:e})=>{if(e.isEditable&&(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return{canNestBlock:e.canNestBlock()}}}),i=(0,W.useCallback)(()=>{r!==void 0&&r.canNestBlock&&(n.focus(),n.nestBlock())},[n,r]);return r===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`nestBlock`,onClick:i,isDisabled:!r.canNestBlock,label:e.formatting_toolbar.nest.tooltip,mainTooltip:e.formatting_toolbar.nest.tooltip,secondaryTooltip:ub(e.formatting_toolbar.nest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,G.jsx)(hm,{})})},Uj=()=>{let e=wp(),t=Cp(),n=tp(),r=sp({editor:n,selector:({editor:e})=>{if(e.isEditable&&(e.getSelection()?.blocks||[e.getTextCursorPosition().block]).find(e=>e.content!==void 0))return{canUnnestBlock:e.canUnnestBlock()}}}),i=(0,W.useCallback)(()=>{r!==void 0&&r.canUnnestBlock&&(n.focus(),n.unnestBlock())},[n,r]);return r===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`unnestBlock`,onClick:i,isDisabled:!r.canUnnestBlock,label:e.formatting_toolbar.unnest.tooltip,mainTooltip:e.formatting_toolbar.unnest.tooltip,secondaryTooltip:ub(e.formatting_toolbar.unnest.secondary_tooltip,e.generic.ctrl_shortcut),icon:(0,G.jsx)(gm,{})})},Wj={paragraph:nm,heading:Sm,heading_2:xm,heading_3:bm,heading_4:ym,heading_5:vm,heading_6:_m,toggle_heading:Sm,toggle_heading_2:xm,toggle_heading_3:bm,quote:am,toggle_list:Xp,bullet_list:cm,numbered_list:lm,check_list:um},Gj=e=>RC(e).map(({key:t,type:n,props:r})=>({name:e.dictionary.slash_menu[t].title,type:n,props:r,icon:Wj[t]})),Kj=e=>{let t=Cp(),n=Dj(),r=pp(),i=tp(),a=sp({editor:i,selector:({editor:e})=>e.getSelection()?.blocks||[e.getTextCursorPosition().block]}),o=a[0],s=(0,W.useMemo)(()=>(e.items||Gj(i)).filter(e=>MC(i,e.type,Object.fromEntries(Object.entries(e.props||{}).map(([e,t])=>[e,typeof t])))),[i,e.items]),c=(0,W.useMemo)(()=>s.map(e=>{let t=e.icon,n=e.type===o.type,r=Object.entries(e.props||{}).filter(([e,t])=>t!==o.props[e]).length===0;return{text:e.name,icon:(0,G.jsx)(t,{size:16}),onClick:()=>{i.focus(),i.transact(()=>{for(let t of a)i.updateBlock(t,{type:e.type,props:e.props})})},isSelected:n&&r}}),[i,s,o.props,o.type,a]);return!(0,W.useMemo)(()=>c.find(e=>e.isSelected)!==void 0,[c])||!i.isEditable?null:(0,G.jsx)(t.FormattingToolbar.Select,{className:`bn-select`,items:c,portalElement:r,preventFocusOnOpen:n===`mobile`})},qj=()=>{let e=wp(),t=Cp(),n=tp(),r=ZA(`comments`),{store:i}=ZA(zC),a=sp({editor:n,selector:({editor:e})=>e.prosemirrorState.selection.empty}),o=(0,W.useCallback)(()=>{r.startPendingComment(),i.setState(!1)},[r,i]);return a?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,G.jsx)(Mm,{}),onClick:o})},Jj=()=>tp().getExtension(`comments`)?(0,G.jsx)(qj,{}):null,Yj=()=>{let e=wp(),t=Cp(),n=tp(),r=sp({editor:n,selector:({editor:e})=>e.prosemirrorState.selection.empty}),i=(0,W.useCallback)(()=>{n._tiptapEditor.chain().focus().addPendingComment().run()},[n]);return!n._tiptapEditor.commands.addPendingComment||!n.isEditable||r?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.comment.tooltip,mainTooltip:e.formatting_toolbar.comment.tooltip,icon:(0,G.jsx)(Mm,{}),onClick:i})};function Xj(e,t){try{let n=new URL(e,t);if(n.protocol!==`javascript:`)return n.href}catch{}return`#`}var Zj=()=>{let e=wp(),t=Cp(),n=tp(),r=sp({editor:n,selector:({editor:e})=>{let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(NC(n,e,n.type,{url:`string`}))return n}}),i=(0,W.useCallback)(()=>{r!==void 0&&(n.focus(),n.resolveFileUrl?n.resolveFileUrl(r.props.url).then(e=>window.open(Xj(e,window.location.href))):window.open(Xj(r.props.url,window.location.href)))},[r,n]);return r===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.file_download.tooltip[r.type]||e.formatting_toolbar.file_download.tooltip.file,mainTooltip:e.formatting_toolbar.file_download.tooltip[r.type]||e.formatting_toolbar.file_download.tooltip.file,icon:(0,G.jsx)(Wp,{}),onClick:i})},Qj=()=>{let e=wp(),t=Cp(),n=tp(),r=sp({editor:n,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(NC(n,e,n.type,{url:`string`,showPreview:`boolean`}))return n}}),i=(0,W.useCallback)(()=>{r!==void 0&&MC(n,r.type,{showPreview:`boolean`})&&n.updateBlock(r.id,{props:{showPreview:!r.props.showPreview}})},[r,n]);return r===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:`Toggle preview`,mainTooltip:e.formatting_toolbar.file_preview_toggle.tooltip,icon:(0,G.jsx)(Qp,{}),isSelected:r.props.showPreview,onClick:i})},$j=()=>{let e=wp(),t=Cp(),n=tp(),r=ZA(nD),i=sp({editor:n,selector:({editor:e})=>{if(!e.isEditable||!e.settings.tables.splitCells)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block];if(t.length!==1)return;let n=t[0];if(n.type===`table`)return{mergeDirection:r.getMergeDirection(n)}}}),a=(0,W.useCallback)(()=>{r?.mergeCells()},[r]);return i===void 0?null:(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,label:e.formatting_toolbar.table_cell_merge.tooltip,mainTooltip:e.formatting_toolbar.table_cell_merge.tooltip,icon:i.mergeDirection===`horizontal`?(0,G.jsx)(sm,{}):(0,G.jsx)(om,{}),onClick:a})},eM=()=>tp().getExtension(nD)?(0,G.jsx)($j,{}):null,tM={left:Dm,center:km,right:Em,justify:Om},nM=e=>{let t=Cp(),n=wp(),r=tp(),i=sp({editor:r,selector:({editor:e})=>{if(!e.isEditable)return;let t=e.getSelection()?.blocks||[e.getTextCursorPosition().block],n=t[0];if(NC(n,e,n.type,{textAlignment:_S.textAlignment}))return{textAlignment:n.props.textAlignment,blocks:t};if(t.length===1&&NC(n,e,`table`))return e.getExtension(nD)?.getCellSelection()?{textAlignment:nb(n.content.rows[0].cells[0]).props.textAlignment,blocks:[n]}:void 0}}),a=(0,W.useCallback)(e=>{if(i!==void 0){r.focus();for(let t of i.blocks)if(NC(t,r,t.type,{textAlignment:_S.textAlignment})&&MC(r,t.type,{textAlignment:_S.textAlignment}))r.updateBlock(t,{props:{textAlignment:e}});else if(t.type===`table`){let n=r.getExtension(nD)?.getCellSelection();if(!n)continue;let i=t.content.rows.map(e=>({...e,cells:e.cells.map(e=>nb(e))}));n.cells.forEach(({row:t,col:n})=>{i[t].cells[n].props.textAlignment=e}),r.updateBlock(t,{type:`table`,content:{...t.content,type:`tableContent`,rows:i}}),r.setTextCursorPosition(t)}}},[r,i]);if(i===void 0)return null;let o=tM[e.textAlignment];return(0,G.jsx)(t.FormattingToolbar.Button,{className:`bn-button`,"data-test":`alignText${e.textAlignment.slice(0,1).toUpperCase()+e.textAlignment.slice(1)}`,onClick:()=>a(e.textAlignment),isSelected:i.textAlignment===e.textAlignment,label:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,mainTooltip:n.formatting_toolbar[`align_${e.textAlignment}`].tooltip,icon:(0,G.jsx)(o,{})})},rM=e=>[(0,G.jsx)(Kj,{items:e},`blockTypeSelect`),(0,G.jsx)(eM,{},`tableCellMergeButton`),(0,G.jsx)(Rj,{},`fileCaptionButton`),(0,G.jsx)(Vj,{},`replaceFileButton`),(0,G.jsx)(Bj,{},`fileRenameButton`),(0,G.jsx)(zj,{},`fileDeleteButton`),(0,G.jsx)(Zj,{},`fileDownloadButton`),(0,G.jsx)(Qj,{},`filePreviewButton`),(0,G.jsx)(Tj,{basicTextStyle:`bold`},`boldStyleButton`),(0,G.jsx)(Tj,{basicTextStyle:`italic`},`italicStyleButton`),(0,G.jsx)(Tj,{basicTextStyle:`underline`},`underlineStyleButton`),(0,G.jsx)(Tj,{basicTextStyle:`strike`},`strikeStyleButton`),(0,G.jsx)(nM,{textAlignment:`left`},`textAlignLeftButton`),(0,G.jsx)(nM,{textAlignment:`center`},`textAlignCenterButton`),(0,G.jsx)(nM,{textAlignment:`right`},`textAlignRightButton`),(0,G.jsx)(Mj,{},`colorStyleButton`),(0,G.jsx)(Hj,{},`nestBlockButton`),(0,G.jsx)(Uj,{},`unnestBlockButton`),(0,G.jsx)(Lj,{},`createLinkButton`),(0,G.jsx)(Jj,{},`addCommentButton`),(0,G.jsx)(Yj,{},`addTiptapCommentButton`)],iM=e=>{let t=Cp();return(0,G.jsx)(t.FormattingToolbar.Root,{className:`bn-toolbar bn-formatting-toolbar`,children:e.children||rM(e.blockTypeSelectItems)})},aM=e=>{switch(e){case`left`:return`top-start`;case`center`:return`top`;case`right`:return`top-end`;default:return`top-start`}},oM=e=>{let t=tp(),n=ZA(zC,{editor:t}),r=QA(zC,{editor:t}),i=sp({editor:t,selector:({editor:e})=>n.store.state?{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}:void 0}),a=sp({editor:t,selector:({editor:e})=>{let t=e.getTextCursorPosition().block;return NC(t,e,t.type,{textAlignment:_S.textAlignment})?aM(t.props.textAlignment):`top-start`}}),o=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:r,onOpenChange:(e,r,i)=>{n.store.setState(e),i===`escape-key`&&t.focus()},placement:a,middleware:[A(10),j(),te()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:40},...e.floatingUIOptions?.elementProps}}),[r,a,e.floatingUIOptions,n.store,t]),s=e.formattingToolbar||iM;return(0,G.jsx)(hp,{target:e.portalElement,children:(0,G.jsx)(nj,{position:i,...o,children:r&&(0,G.jsx)(s,{})})})};function sM(e,t){let n=ep(),r=t??n?.editor;if(!r)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);let i=e?.includeEditorUI??!1,a=(0,W.useRef)(void 0);(a.current===void 0||a.current.editor!==r||a.current.includeEditorUI!==i)&&(a.current={editor:r,includeEditorUI:i,value:r.isFocused({includeEditorUI:i})});let o=(0,W.useCallback)(e=>(a.current={editor:r,includeEditorUI:i,value:r.isFocused({includeEditorUI:i})},e(),r.onFocusChange((t,n)=>{a.current={editor:r,includeEditorUI:i,value:n.focused},e()},{includeEditorUI:i})),[r,i]),s=(0,W.useCallback)(()=>a.current.value,[]);return(0,W.useSyncExternalStore)(o,s,s)}var cM=0,lM=0;function uM(){if(typeof window>`u`)return!1;let e=window.visualViewport,t=e?.scale??1,n=(e?.height??window.innerHeight)*t,r=document.documentElement.clientWidth;return Math.abs(r-lM)>lM*.2&&(lM=r,cM=0),cM=Math.max(cM,n),cM-n>150}var dM=[`--bn-vv-top`,`--bn-vv-left`,`--bn-vv-width`,`--bn-vv-height`,`--bn-vv-scale`],fM=0;function pM(){let[e,t]=(0,W.useState)(uM);return(0,W.useLayoutEffect)(()=>{let e=document.documentElement,n=window.visualViewport,r=()=>document.querySelectorAll(`.bn-scroll-container`),i=()=>{e.style.setProperty(`--bn-vv-top`,`${n?.offsetTop??0}px`),e.style.setProperty(`--bn-vv-left`,`${n?.offsetLeft??0}px`),e.style.setProperty(`--bn-vv-width`,`${n?.width??window.innerWidth}px`),e.style.setProperty(`--bn-vv-height`,`${n?.height??window.innerHeight}px`),e.style.setProperty(`--bn-vv-scale`,`${n?.scale??1}`)},a=(e,t)=>e.toggleAttribute(`data-bn-allow-pull-to-refresh`,!t&&e.scrollTop<=0),o=()=>{let e=uM();t(e),i();for(let t of r())a(t,e)};fM++,o(),n?.addEventListener(`resize`,o),n?.addEventListener(`scroll`,o),window.addEventListener(`resize`,o);let s=e=>{e.target instanceof HTMLElement&&e.target.classList.contains(`bn-scroll-container`)&&a(e.target,uM())};return document.addEventListener(`scroll`,s,{capture:!0,passive:!0}),()=>{if(n?.removeEventListener(`resize`,o),n?.removeEventListener(`scroll`,o),window.removeEventListener(`resize`,o),document.removeEventListener(`scroll`,s,{capture:!0}),fM--,fM===0){for(let t of dM)e.style.removeProperty(t);for(let e of r())e.removeAttribute(`data-bn-allow-pull-to-refresh`);cM=0,lM=0}}},[]),e}var mM=e=>{let t=pM(),n=sM({includeEditorUI:!0});if(!t||!n)return null;let r=e.formattingToolbar||iM;return(0,G.jsx)(gp,{target:document.body,children:(0,G.jsx)(Ej.Provider,{value:`mobile`,children:(0,G.jsx)(xp,{children:(0,G.jsx)(`div`,{className:`bn-mobile-formatting-toolbar`,children:(0,G.jsx)(r,{})})})})})},hM=e=>{let t=pM();return mb()&&t?(0,G.jsx)(mM,{formattingToolbar:e.formattingToolbar}):(0,G.jsx)(oM,{...e})},gM=e=>{let t=Cp(),n=wp(),{deleteLink:r}=ZA(Yw);return(0,G.jsx)(t.LinkToolbar.Button,{className:`bn-button`,label:n.link_toolbar.delete.tooltip,mainTooltip:n.link_toolbar.delete.tooltip,isSelected:!1,onClick:()=>{r(e.range.from),e.setToolbarOpen?.(!1)},icon:(0,G.jsx)(fm,{})})},_M=e=>{let t=Cp(),n=pp(),r=wp();return(0,G.jsxs)(t.Generic.Popover.Root,{onOpenChange:e.setToolbarPositionFrozen,portalElement:n,children:[(0,G.jsx)(t.Generic.Popover.Trigger,{children:(0,G.jsx)(t.LinkToolbar.Button,{className:`bn-button`,mainTooltip:r.link_toolbar.edit.tooltip,isSelected:!1,children:r.link_toolbar.edit.text})}),(0,G.jsx)(t.Generic.Popover.Content,{className:`bn-popover-content bn-form-popover`,variant:`form-popover`,children:(0,G.jsx)(Fj,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen})})]})},vM=e=>{let t=Cp(),n=wp();return(0,G.jsx)(t.LinkToolbar.Button,{className:`bn-button`,mainTooltip:n.link_toolbar.open.tooltip,label:n.link_toolbar.open.tooltip,isSelected:!1,onClick:()=>{window.open(Xj(e.url,window.location.href),`_blank`)},icon:(0,G.jsx)(Up,{})})},yM=e=>{let t=Cp();return(0,G.jsx)(t.LinkToolbar.Root,{className:`bn-toolbar bn-link-toolbar`,children:e.children||(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(_M,{url:e.url,text:e.text,range:e.range,setToolbarOpen:e.setToolbarOpen,setToolbarPositionFrozen:e.setToolbarPositionFrozen}),(0,G.jsx)(vM,{url:e.url}),(0,G.jsx)(gM,{range:e.range,setToolbarOpen:e.setToolbarOpen})]})})},bM=e=>{let t=tp(),n=sp({editor:t,selector:({editor:e})=>e?.isEditable??!1}),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(!1),s=cp(),c=ZA(Yw),[l,u]=(0,W.useState)(void 0);(0,W.useEffect)(()=>{if(!n){u(void 0),i(!1);return}let e=()=>{let e=c.getLinkAtSelection();e?(u({cursorType:`text`,url:e.mark.attrs.href,text:e.text,range:e.range,element:c.getLinkElementAtPos(e.range.from)}),a||i(!0)):(u(void 0),a||i(!1))},r=e=>{if(l!==void 0&&l.cursorType===`text`||!(e.target instanceof HTMLElement))return;let t=c.getLinkAtElement(e.target);t&&u({cursorType:`mouse`,url:t.mark.attrs.href,text:t.text,range:t.range,element:c.getLinkElementAtPos(t.range.from)})},o=t.onChange(e),d=t.onSelectionChange(e);return s?.addEventListener(`mouseover`,r),()=>{o(),d(),s?.removeEventListener(`mouseover`,r)}},[t,s,n,c,l,a]);let d=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:r,onOpenChange:(e,n,r)=>{a||(l===void 0||l.cursorType!==`text`||r!==`hover`)&&(r===`escape-key`&&t.focus(),i(e))},placement:`top-start`,middleware:[A(10),te()],...e.floatingUIOptions?.useFloatingOptions},useHoverProps:{enabled:l!==void 0&&l.cursorType===`mouse`,delay:{open:250,close:250},handleClose:m_(),...e.floatingUIOptions?.useHoverProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:50},...e.floatingUIOptions?.elementProps}}),[t,l,e.floatingUIOptions,r,a]),f=(0,W.useMemo)(()=>l?.element?{element:l.element}:void 0,[l?.element]);if(!n)return null;let p=e.linkToolbar||yM;return(0,G.jsx)(hp,{target:e.portalElement,children:(0,G.jsx)(tj,{reference:f,...d,children:l&&(0,G.jsx)(p,{url:l.url,text:l.text,range:l.range,setToolbarOpen:i,setToolbarPositionFrozen:o})})})};function xM(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 1024 1024`},child:[{tag:`path`,attr:{d:`M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8Z`},child:[]},{tag:`path`,attr:{d:`M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8Z`},child:[]}]})(e)}var SM=()=>{let e=Cp(),t=wp(),n=tp(),r=ZA(WC),i=QA(IE,{editor:n,selector:e=>e?.block}),a=(0,W.useCallback)(()=>{if(i===void 0)return;let e=i.content;if(e!==void 0&&Array.isArray(e)&&e.length===0)n.setTextCursorPosition(i),r.openSuggestionMenu(`/`);else{let e=n.insertBlocks([{type:`paragraph`}],i,`after`)[0];n.setTextCursorPosition(e),r.openSuggestionMenu(`/`)}},[i,n,r]);return i===void 0?null:(0,G.jsx)(e.SideMenu.Button,{className:`bn-button`,label:t.side_menu.add_block_label,icon:(0,G.jsx)(xM,{size:24,onClick:a,"data-test":`dragHandleAdd`})})};function CM(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0z`},child:[]},{tag:`path`,attr:{d:`m7 10 5 5 5-5z`},child:[]}]})(e)}function wM(e){return Lp({tag:`svg`,attr:{viewBox:`0 0 24 24`},child:[{tag:`path`,attr:{fill:`none`,d:`M0 0h24v24H0V0z`},child:[]},{tag:`path`,attr:{d:`M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z`},child:[]}]})(e)}var TM=e=>{let t=Cp(),n=pp(),r=tp(),i=QA(IE,{editor:r,selector:e=>e?.block});return i===void 0||!NC(i,r,i.type,{textColor:`string`})&&!NC(i,r,i.type,{backgroundColor:`string`})?null:(0,G.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,portalElement:n,children:[(0,G.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children})}),(0,G.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,G.jsx)(Aj,{iconSize:18,text:NC(i,r,i.type,{textColor:`string`})&&MC(r,i.type,{textColor:`string`})?{color:i.props.textColor,setColor:e=>r.updateBlock(i,{type:i.type,props:{textColor:e}})}:void 0,background:NC(i,r,i.type,{backgroundColor:`string`})&&MC(r,i.type,{backgroundColor:`string`})?{color:i.props.backgroundColor,setColor:e=>r.updateBlock(i,{props:{backgroundColor:e}})}:void 0})})]})},EM=e=>{let t=Cp(),n=tp(),r=QA(IE,{editor:n,selector:e=>e?.block});return r===void 0?null:(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,onClick:()=>{let e=n.getSelection()?.blocks,t=e&&e.some(e=>e.id===r.id)?e:[r];n.removeBlocks(t)},children:e.children})},DM=e=>{let t=Cp(),n=tp(),r=QA(IE,{editor:n,selector:e=>e?.block});if(r===void 0||r.type!==`table`||!n.settings.tables.headers)return null;let i=!!r.content.headerRows;return(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:i,onClick:()=>{n.updateBlock(r,{content:{...r.content,headerRows:i?void 0:1}})},children:e.children})},OM=e=>{let t=Cp(),n=tp(),r=QA(IE,{editor:n,selector:e=>e?.block});if(r===void 0||r.type!==`table`||!n.settings.tables.headers)return null;let i=!!r.content.headerCols;return(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:i,onClick:()=>{n.updateBlock(r,{content:{...r.content,headerCols:i?void 0:1}})},children:e.children})},kM=e=>{let t=Cp(),n=wp();return(0,G.jsx)(t.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-drag-handle-menu`,children:e.children||(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(EM,{children:n.drag_handle.delete_menuitem}),(0,G.jsx)(TM,{children:n.drag_handle.colors_menuitem}),(0,G.jsx)(DM,{children:n.drag_handle.header_row_menuitem}),(0,G.jsx)(OM,{children:n.drag_handle.header_column_menuitem})]})})},AM=e=>{let t=Cp(),n=pp(),r=wp(),i=ZA(IE),a=QA(IE,{selector:e=>e?.block});if(a===void 0)return null;let o=e.dragHandleMenu||kM;return(0,G.jsxs)(t.Generic.Menu.Root,{onOpenChange:e=>{e?i.freezeMenu():i.unfreezeMenu()},position:`left`,portalElement:n,children:[(0,G.jsx)(t.Generic.Menu.Trigger,{children:(0,G.jsx)(t.SideMenu.Button,{label:r.side_menu.drag_handle_label,draggable:!0,onDragStart:e=>i.blockDragStart(e,a),onDragEnd:i.blockDragEnd,className:`bn-button`,icon:(0,G.jsx)(wM,{size:24,"data-test":`dragHandle`})})}),(0,G.jsx)(o,{children:e.children})]})},jM=e=>{let t=Cp();return(0,G.jsx)(t.SideMenu.Root,{className:`bn-side-menu`,children:e.children||(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(SM,{}),(0,G.jsx)(AM,{dragHandleMenu:e.dragHandleMenu})]})})};function MM(e,t){if(t.type===`heading`)switch(t.props.level){case 1:return 39;case 2:return 27;case 3:return 18.5;default:return 0}return e.schema.blockSpecs[t.type]?.implementation.meta?.fileBlockAccept&&!t.props.url?12:t.type===`file`?4:t.type===`audio`||t.type===`table`?15:0}var NM=e=>{let t=tp(),{show:n,block:r}=QA(IE,{selector:e=>e===void 0?void 0:{show:e.show,block:e.block}})||{},i=(0,W.useCallback)((e,n,r)=>{let i=t.getExtension(IE);i?.setMenuElement(n);let a=!1,o=P(e,n,()=>{a?i?.hideMenuIfNotFrozen():a=!0},{ancestorScroll:!0,ancestorResize:!1,elementResize:!1,layoutShift:!1});return()=>{o(),i?.setMenuElement(void 0)}},[t]),a=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:n,placement:`left-start`,middleware:[A({crossAxis:r?MM(t,r):0})],whileElementsMounted:i,...e.floatingUIOptions?.useFloatingOptions},useDismissProps:{enabled:!1,...e.floatingUIOptions?.useDismissProps},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:20},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,n,r,t,i]),o=e.sideMenu||jM;return(0,G.jsx)(hp,{target:e.portalElement,children:(0,G.jsx)(vj,{blockId:n?r?.id:void 0,...a,children:r?.id&&(0,G.jsx)(o,{})})})},PM=({format:e,dictionary:t})=>{let n=t.suggestion_changes.formatting_change;if(e.length===0)return n;let r=t.formatting_toolbar,i=[];for(let t of e){if(t===`link`)return n;let e=r[t],a=e&&typeof e==`object`&&`tooltip`in e?e.tooltip:void 0;if(typeof a!=`string`)return n;i.push(a)}return i.join(`, `)},FM=e=>{let t=Cp(),n=wp(),r=(0,W.useMemo)(()=>{let t=n.suggestion_changes,r=e.formatChangeLabel??PM,i=e.users.join(`, `);if(e.modificationType===`insert`)return i?t.inserted_by(i):t.inserted;if(e.modificationType===`delete`)return i?t.deleted_by(i):t.deleted;if(e.modificationType===`change`)return i?t.changed_by(i):t.changed;if(e.modificationType===`attrs`)return i?`${t.formatting_change}: ${i}`:t.formatting_change;let a=e.format?r({format:e.format,dictionary:n}):``;return!a||a===t.formatting_change?i?`${t.formatting_change}: ${i}`:t.formatting_change:i?t.formatting_change_by(a,i):`${t.formatting_change} (${a})`},[n,e]);return(0,G.jsx)(t.AttributionTooltip.Root,{className:`bn-suggestion-tooltip`,markClassName:e.className,backgroundColor:e.className?void 0:e.color,children:r})};function IM(e){let t=e.firstElementChild??e,n=t.getBoundingClientRect();return n.width||n.height?t:t.firstElementChild??t}function LM(e,t){let{anchor:n,reference:r,...i}=e;return{...i,formatChangeLabel:t}}var RM=e=>{let t=QA(`attribution`,{selector:e=>e}),n=(0,W.useMemo)(()=>t?{element:t.reference??IM(t.anchor)}:void 0,[t]),r=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!t,placement:`top-start`,middleware:[R(),A(4),te(),j({padding:4})],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:1e4,pointerEvents:`none`},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,t]),i=e.attributionTooltip||FM,a=t?LM(t,e.formatChangeLabel):void 0;return(0,G.jsx)(hp,{target:e.portalElement,children:(0,G.jsx)(tj,{reference:n,...r,children:a&&(0,G.jsx)(i,{...a})})})},zM=10,BM=10,VM=600,HM=300,UM={name:`placeBelowUnlessCramped`,async fn(e){let{rects:t,placement:n,platform:r}=e,i={...t.floating,height:HM},a=await r.detectOverflow({...e,rects:{...t,floating:i},y:t.reference.y+t.reference.height+zM},{padding:BM}),o=`bottom-start`;return a.bottom>0&&(await r.detectOverflow({...e,rects:{...t,floating:i},y:t.reference.y-zM-HM},{padding:BM})).top<a.bottom&&(o=`top-start`),o===n?{}:{reset:{placement:o}}}};function WM(e){let t=e.getBoundingClientRect().width;t>=(parseFloat(e.style.minWidth)||0)+1&&(e.style.minWidth=`${Math.ceil(t)}px`)}var GM=[UM,A(zM),j(),ee({apply({elements:e,availableHeight:t}){e.floating.style.maxHeight=`${Math.max(0,Math.min(t,VM))}px`,WM(e.floating)},padding:BM})];async function KM(e,t){return(await qE(e,t)).map(({id:e,onItemClick:t})=>({id:e,onItemClick:t,icon:e}))}function qM(e){let t=Cp(),n=wp(),{items:r,loadingState:i,selectedIndex:a,onItemClick:o,columns:s}=e,c=i===`loading-initial`||i===`loading`?(0,G.jsx)(t.GridSuggestionMenu.Loader,{className:`bn-grid-suggestion-menu-loader`,columns:s}):null,l=(0,W.useMemo)(()=>{let e=[];for(let n=0;n<r.length;n++){let i=r[n];e.push((0,G.jsx)(t.GridSuggestionMenu.Item,{className:`bn-grid-suggestion-menu-item`,item:i,id:`bn-grid-suggestion-menu-item-${n}`,isSelected:n===a,onClick:()=>o?.(i)},i.id))}return e},[t,r,o,a]);return(0,G.jsxs)(t.GridSuggestionMenu.Root,{id:`bn-grid-suggestion-menu`,columns:s,className:`bn-grid-suggestion-menu`,children:[c,l,l.length===0&&e.loadingState===`loaded`&&(0,G.jsx)(t.GridSuggestionMenu.EmptyItem,{className:`bn-grid-suggestion-menu-empty-item`,columns:s,children:n.suggestion_menu.no_items_title})]})}function JM(e){return e===void 0?void 0:`bn-suggestion-menu-item-`+e}function YM(e,t,n,r=3){let i=(0,W.useRef)(0);(0,W.useEffect)(()=>{t!==void 0&&(e.length>0?i.current=t.length:t.length-i.current>r&&n())},[n,r,e.length,t])}function XM(e,t){let[n,r]=(0,W.useState)([]),[i,a]=(0,W.useState)(!1),o=(0,W.useRef)(void 0),s=(0,W.useRef)(void 0);return(0,W.useEffect)(()=>{let n=e;o.current=e,a(!0),t(e).then(e=>{o.current===n&&(r(e),a(!1),s.current=n)})},[e,t]),{items:n||[],usedQuery:s.current,loadingState:s.current===void 0?`loading-initial`:i?`loading`:`loaded`}}function ZM(e,t,n,r,i){let a=cp(e),[o,s]=(0,W.useState)(0);return(0,W.useEffect)(()=>{let e=e=>(e.key===`ArrowLeft`&&(e.preventDefault(),n.length&&s((o-1+n.length)%n.length)),e.key===`ArrowRight`&&(e.preventDefault(),n.length&&s((o+1+n.length)%n.length)),e.key===`ArrowUp`?(e.preventDefault(),n.length&&s((o-r+n.length)%n.length),!0):e.key===`ArrowDown`?(e.preventDefault(),n.length&&s((o+r)%n.length),!0):e.key===`Enter`&&!e.isComposing&&(e.stopPropagation(),e.preventDefault(),n.length&&i?.(n[o]),!0));return a?.addEventListener(`keydown`,e,!0),()=>{a?.removeEventListener(`keydown`,e,!0)}},[a,n,o,i,r,r!==void 0&&r>1]),(0,W.useEffect)(()=>{s(0)},[t]),{selectedIndex:n.length===0?void 0:o}}function QM(e){let t=ep().setContentEditableProps,n=tp(),{getItems:r,gridSuggestionMenuComponent:i,query:a,clearQuery:o,closeMenu:s,onItemClick:c,columns:l}=e,u=(0,W.useCallback)(e=>{s(),o(),c?.(e)},[c,s,o]),{items:d,usedQuery:f,loadingState:p}=XM(a,r);YM(d,f,s);let{selectedIndex:m}=ZM(n,a,d,l,u);return(0,W.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":`bn-suggestion-menu`})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,W.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":JM(m)})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,m]),(0,G.jsx)(i,{items:d,onItemClick:u,loadingState:p,selectedIndex:m,columns:l})}function $M(e){let t=tp(),n=cp(),{triggerCharacter:r,gridSuggestionMenuComponent:i,columns:a,shouldOpen:o,minQueryLength:s,onItemClick:c,getItems:l}=e,u=(0,W.useMemo)(()=>c||(e=>{e.onItemClick(t)}),[t,c]),d=(0,W.useMemo)(()=>l||(async e=>await KM(t,e)),[t,l]),f=ZA(WC);(0,W.useEffect)(()=>{f.addSuggestionMenu({triggerCharacter:r,shouldOpen:o})},[f,r,o]);let p=QA(WC),m=QA(WC,{selector:e=>({element:n?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),h=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:p?.show&&p?.triggerCharacter===r,onOpenChange:e=>{e||f.closeMenu()},placement:`bottom-start`,middleware:GM,...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:70},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,p?.show,p?.triggerCharacter,f,r]);return!p||!p.ignoreQueryLength&&s&&(p.query.startsWith(` `)||p.query.length<s)?null:(0,G.jsx)(hp,{target:e.portalElement,children:(0,G.jsx)(tj,{reference:m,...h,children:r&&(0,G.jsx)(QM,{query:p.query,closeMenu:f.closeMenu,clearQuery:f.clearQuery,getItems:d,columns:a,gridSuggestionMenuComponent:i||qM,onItemClick:u})})})}function eN(e){let t=Cp(),n=wp(),{items:r,loadingState:i,selectedIndex:a,onItemClick:o}=e,s=i===`loading-initial`||i===`loading`?(0,G.jsx)(t.SuggestionMenu.Loader,{className:`bn-suggestion-menu-loader`}):null,c=(0,W.useMemo)(()=>{let e,n=[];for(let i=0;i<r.length;i++){let s=r[i];s.group!==e&&(e=s.group,n.push((0,G.jsx)(t.SuggestionMenu.Label,{className:`bn-suggestion-menu-label`,children:e},e))),n.push((0,G.jsx)(t.SuggestionMenu.Item,{className:db(`bn-suggestion-menu-item`,s.size===`small`?`bn-suggestion-menu-item-small`:``),item:s,id:`bn-suggestion-menu-item-${i}`,isSelected:i===a,onClick:()=>o?.(s)},s.title))}return n},[t,r,o,a]);return(0,G.jsxs)(t.SuggestionMenu.Root,{id:`bn-suggestion-menu`,className:`bn-suggestion-menu`,children:[c,c.length===0&&(e.loadingState===`loading`||e.loadingState===`loaded`)&&(0,G.jsx)(t.SuggestionMenu.EmptyItem,{className:`bn-suggestion-menu-item`,children:n.suggestion_menu.no_items_title}),s]})}function tN(e,t){let[n,r]=(0,W.useState)(0);return{selectedIndex:n,setSelectedIndex:r,handler:i=>{if(i.key===`ArrowUp`)return i.preventDefault(),e.length&&r((n-1+e.length)%e.length),!0;if(i.key===`ArrowDown`)return i.preventDefault(),e.length&&r((n+1)%e.length),!0;if(i.key===`PageUp`)return i.preventDefault(),e.length&&r(0),!0;if(i.key===`PageDown`)return i.preventDefault(),e.length&&r(e.length-1),!0;let a=nN(i)?i.nativeEvent.isComposing:i.isComposing;return i.key===`Enter`&&!a&&(i.preventDefault(),i.stopPropagation(),e.length&&t?.(e[n]),!0)}}}function nN(e){return e.nativeEvent!==void 0}function rN(e,t,n,r,i){let a=cp(),{selectedIndex:o,setSelectedIndex:s,handler:c}=tN(n,r);return(0,W.useEffect)(()=>{let e=i||a;return e?.addEventListener(`keydown`,c,!0),()=>{e?.removeEventListener(`keydown`,c,!0)}},[a,n,o,r,i,c]),(0,W.useEffect)(()=>{s(0)},[t,s]),{selectedIndex:n.length===0?void 0:o}}function iN(e){let t=ep().setContentEditableProps,n=tp(),{getItems:r,suggestionMenuComponent:i,query:a,clearQuery:o,closeMenu:s,onItemClick:c}=e,l=(0,W.useCallback)(e=>{s(),o(),c?.(e)},[c,s,o]),{items:u,usedQuery:d,loadingState:f}=XM(a,r);YM(u,d,s);let{selectedIndex:p}=rN(n,a,u,l);return(0,W.useEffect)(()=>(t(e=>({...e,"aria-expanded":!0,"aria-controls":`bn-suggestion-menu`})),()=>{t(e=>({...e,"aria-expanded":!1,"aria-controls":void 0}))}),[t]),(0,W.useEffect)(()=>(t(e=>({...e,"aria-activedescendant":JM(p)})),()=>{t(e=>({...e,"aria-activedescendant":void 0}))}),[t,p]),(0,G.jsx)(i,{items:u,onItemClick:l,loadingState:f,selectedIndex:p})}var aN={heading:Sm,heading_2:xm,heading_3:bm,heading_4:ym,heading_5:vm,heading_6:_m,toggle_heading:Sm,toggle_heading_2:xm,toggle_heading_3:bm,quote:am,toggle_list:Xp,numbered_list:lm,bullet_list:cm,check_list:um,paragraph:nm,table:rm,image:$p,video:em,audio:Yp,file:jm,emoji:Bp,code_block:wm,divider:Vp};function oN(e){return qC(e).map(e=>{let t=aN[e.key];return{...e,icon:(0,G.jsx)(t,{size:18})}})}function sN(e){let t=tp(),n=cp(),{triggerCharacter:r,suggestionMenuComponent:i,shouldOpen:a,minQueryLength:o,onItemClick:s,getItems:c}=e,l=(0,W.useMemo)(()=>s||(e=>{e.onItemClick(t)}),[t,s]),u=(0,W.useMemo)(()=>c||(async e=>JC(oN(t),e)),[t,c]),d=ZA(WC);(0,W.useEffect)(()=>{d.addSuggestionMenu({triggerCharacter:r,shouldOpen:a})},[d,r,a]);let f=QA(WC),p=QA(WC,{selector:e=>({element:n?.firstChild||void 0,getBoundingClientRect:()=>e?.referencePos||new DOMRect})}),m=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:f?.show&&f?.triggerCharacter===r,onOpenChange:e=>{e||d.closeMenu()},placement:`bottom-start`,middleware:GM,...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{onMouseDownCapture:e=>e.preventDefault(),style:{zIndex:80},...e.floatingUIOptions?.elementProps}}),[e.floatingUIOptions,f?.show,f?.triggerCharacter,d,r]);return!f||!f.ignoreQueryLength&&o&&(f.query.startsWith(` `)||f.query.length<o)?null:(0,G.jsx)(hp,{target:e.portalElement,children:(0,G.jsx)(tj,{reference:p,...m,children:r&&(0,G.jsx)(iN,{query:f.query,closeMenu:d.closeMenu,clearQuery:d.clearQuery,getItems:u,suggestionMenuComponent:i||eN,onItemClick:l})})})}var cN=(e,t=.3)=>{let n=Math.floor(e)+t,r=Math.ceil(e)-t;return e>=n&&e<=r?Math.round(e):e<n?Math.floor(e):Math.ceil(e)},lN=e=>{let t=Cp(),n=tp(),r=ZA(nD),i=QA(nD,{selector:e=>e?.block}),a=(0,W.useRef)(!1),[o,s]=(0,W.useState)(),c=(0,W.useCallback)(t=>{r.freezeHandles(),e.hideOtherElements(!0),i&&(s({originalContent:i.content,originalCroppedContent:{rows:r.cropEmptyRowsOrColumns(i,e.orientation===`addOrRemoveColumns`?`columns`:`rows`)},startPos:e.orientation===`addOrRemoveColumns`?t.clientX:t.clientY}),a.current=!1,t.preventDefault())},[i,e,r]),l=(0,W.useCallback)(()=>{i&&!a.current&&n.updateBlock(i,{type:`table`,content:{...i.content,rows:e.orientation===`addOrRemoveColumns`?r.addRowsOrColumns(i,`columns`,1):r.addRowsOrColumns(i,`rows`,1)}})},[i,n,e.orientation,r]);return(0,W.useEffect)(()=>{let t=t=>{if(!i)return;if(!o)throw Error(`editingState is undefined`);a.current=!0;let s=(e.orientation===`addOrRemoveColumns`?t.clientX:t.clientY)-o.startPos,c=e.orientation===`addOrRemoveColumns`?o.originalCroppedContent.rows[0]?.cells.length??0:o.originalCroppedContent.rows.length,l=e.orientation===`addOrRemoveColumns`?o.originalContent.rows[0]?.cells.length??0:o.originalContent.rows.length,u=e.orientation===`addOrRemoveColumns`?i.content.rows[0].cells.length:i.content.rows.length,d=l+cN(s/(e.orientation===`addOrRemoveColumns`?120:31),.3);d>=c&&d>0&&d!==u&&(n.updateBlock(i,{type:`table`,content:{...i.content,rows:e.orientation===`addOrRemoveColumns`?r.addRowsOrColumns({type:`table`,content:o.originalCroppedContent},`columns`,d-c):r.addRowsOrColumns({type:`table`,content:o.originalCroppedContent},`rows`,d-c)}}),i.content&&n.setTextCursorPosition(i))};return o&&window.addEventListener(`mousemove`,t),()=>{window.removeEventListener(`mousemove`,t)}},[i,o,n,e.orientation,r]),(0,W.useEffect)(()=>{let t=()=>{e.hideOtherElements(!1),r.unfreezeHandles(),s(void 0)};return o&&window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mouseup`,t)}},[o,e,r]),n.isEditable?(0,G.jsx)(t.TableHandle.ExtendButton,{className:db(`bn-extend-button`,e.orientation===`addOrRemoveColumns`?`bn-extend-button-add-remove-columns`:`bn-extend-button-add-remove-rows`,o===null?``:`bn-extend-button-editing`),onClick:l,onMouseDown:c,children:e.children||(0,G.jsx)(Jp,{size:18,"data-test":`extendButton`})}):null},uN=e=>{let t=Cp(),n=pp(),r=wp(),i=tp(),{block:a,colIndex:o,rowIndex:s}=QA(nD,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})}),c=(e,t)=>{if(a===void 0||o===void 0||s===void 0)return;let n=a.content.rows.map(e=>({...e,cells:e.cells.map(e=>nb(e))}));t===`text`?n[s].cells[o].props.textColor=e:n[s].cells[o].props.backgroundColor=e,i.updateBlock(a,{type:`table`,content:{...a.content,rows:n}}),i.setTextCursorPosition(a)};if(a===void 0||o===void 0||s===void 0)return null;let l=a.content.rows[s]?.cells?.[o];return!l||i.settings.tables.cellTextColor===!1&&i.settings.tables.cellBackgroundColor===!1?null:(0,G.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,portalElement:n,children:[(0,G.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children||r.drag_handle.colors_menuitem})}),(0,G.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,G.jsx)(Aj,{iconSize:18,text:i.settings.tables.cellTextColor?{color:ib(l)?l.props.textColor:`default`,setColor:e=>c(e,`text`)}:void 0,background:i.settings.tables.cellBackgroundColor?{color:ib(l)?l.props.backgroundColor:`default`,setColor:e=>c(e,`background`)}:void 0})})]})},dN=()=>{let e=Cp(),t=wp(),n=tp(),r=ZA(nD),{block:i,colIndex:a,rowIndex:o}=QA(nD,{selector:e=>({block:e?.block,colIndex:e?.colIndex,rowIndex:e?.rowIndex})});if(i===void 0||a===void 0||o===void 0)return null;let s=i.content.rows[o]?.cells?.[a];return!s||!ib(s)||ob(s)===1&&ab(s)===1||!n.settings.tables.splitCells?null:(0,G.jsx)(e.Generic.Menu.Item,{onClick:()=>{r.splitCell({row:o,col:a})},children:t.table_handle.split_cell_menuitem})},fN=e=>{let t=Cp();return(0,G.jsx)(t.Generic.Menu.Dropdown,{className:`bn-menu-dropdown bn-table-handle-menu`,children:e.children||(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(dN,{}),(0,G.jsx)(uN,{})]})})},pN=e=>{let t=Cp(),n=pp(),r=tp(),i=ZA(nD),a=e.tableCellMenu||fN;return!r.settings.tables.splitCells&&!r.settings.tables.cellBackgroundColor&&!r.settings.tables.cellTextColor?null:(0,G.jsxs)(t.Generic.Menu.Root,{onOpenChange:t=>{t?(i.freezeHandles(),e.hideOtherElements(!0)):(i.unfreezeHandles(),e.hideOtherElements(!1),r.focus())},position:`right`,portalElement:n,children:[(0,G.jsx)(t.Generic.Menu.Trigger,{children:(0,G.jsx)(t.Generic.Menu.Button,{className:`bn-table-cell-handle`,children:e.children||(0,G.jsx)(CM,{size:12,"data-test":`tableCellHandle`})})}),(0,G.jsx)(a,{})]})},mN=e=>{let t=Cp(),n=wp(),r=ZA(nD),i=QA(nD,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});return r===void 0||i===void 0?null:(0,G.jsx)(t.Generic.Menu.Item,{onClick:()=>{r.addRowOrColumn(i,e.orientation===`row`?{orientation:`row`,side:e.side}:{orientation:`column`,side:e.side})},children:n.table_handle[`add_${e.side}_menuitem`]})},hN=e=>{let t=Cp(),n=wp(),r=ZA(nD),i=QA(nD,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});return r===void 0||i===void 0?null:(0,G.jsx)(t.Generic.Menu.Item,{onClick:()=>r.removeRowOrColumn(i,e.orientation),children:e.orientation===`row`?n.table_handle.delete_row_menuitem:n.table_handle.delete_column_menuitem})},gN=e=>{let t=Cp(),n=pp(),r=wp(),i=tp(),a=ZA(nD),{block:o,index:s}=QA(nD,{selector:t=>({block:t?.block,index:e.orientation===`column`?t?.colIndex:t?.rowIndex})}),c=(0,W.useMemo)(()=>a===void 0||o===void 0||s===void 0?[]:e.orientation===`row`?a.getCellsAtRowHandle(o,s):a.getCellsAtColumnHandle(o,s),[o,s,e.orientation,a]),l=(e,t)=>{if(o===void 0)return;let n=o.content.rows.map(e=>({...e,cells:e.cells.map(e=>nb(e))}));c.forEach(({row:r,col:i})=>{t===`text`?n[r].cells[i].props.textColor=e:n[r].cells[i].props.backgroundColor=e}),i.updateBlock(o,{type:`table`,content:{...o.content,rows:n}}),i.setTextCursorPosition(o)};if(!c||!c[0]||!a||i.settings.tables.cellTextColor===!1&&i.settings.tables.cellBackgroundColor===!1)return null;let u=nb(c[0].cell);return(0,G.jsxs)(t.Generic.Menu.Root,{position:`right`,sub:!0,portalElement:n,children:[(0,G.jsx)(t.Generic.Menu.Trigger,{sub:!0,children:(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,subTrigger:!0,children:e.children||r.drag_handle.colors_menuitem})}),(0,G.jsx)(t.Generic.Menu.Dropdown,{sub:!0,className:`bn-menu-dropdown bn-color-picker-dropdown`,children:(0,G.jsx)(Aj,{iconSize:18,text:i.settings.tables.cellTextColor?{color:c.every(({cell:e})=>ib(e)&&e.props.textColor===u.props.textColor)?u.props.textColor:`default`,setColor:e=>{l(e,`text`)}}:void 0,background:i.settings.tables.cellBackgroundColor?{color:c.every(({cell:e})=>ib(e)&&e.props.backgroundColor===u.props.backgroundColor)?u.props.backgroundColor:`default`,setColor:e=>l(e,`background`)}:void 0})})]})},_N=e=>{let t=Cp(),n=wp(),r=tp(),i=ZA(nD),{block:a,index:o}=QA(nD,{selector:t=>({block:t?.block,index:e.orientation===`column`?t?.colIndex:t?.rowIndex})});if(i===void 0||a===void 0||o!==0||e.orientation!==`row`||!r.settings.tables.headers)return null;let s=!!a.content.headerRows;return(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:s,onClick:()=>{r.updateBlock(a,{...a,content:{...a.content,headerRows:s?void 0:1}})},children:n.drag_handle.header_row_menuitem})},vN=e=>{let t=Cp(),n=wp(),r=tp(),i=ZA(nD),a=QA(nD,{selector:e=>e?.block}),o=QA(nD,{selector:t=>e.orientation===`column`?t?.colIndex:t?.rowIndex});if(!i||o!==0||!a||e.orientation!==`column`||!r.settings.tables.headers)return null;let s=!!a.content.headerCols;return(0,G.jsx)(t.Generic.Menu.Item,{className:`bn-menu-item`,checked:s,onClick:()=>{r.updateBlock(a,{...a,content:{...a.content,headerCols:s?void 0:1}})},children:n.drag_handle.header_column_menuitem})},yN=e=>{let t=Cp();return(0,G.jsx)(t.Generic.Menu.Dropdown,{className:`bn-table-handle-menu`,children:e.children||(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(hN,{orientation:e.orientation}),(0,G.jsx)(mN,{orientation:e.orientation,side:e.orientation===`row`?`above`:`left`}),(0,G.jsx)(mN,{orientation:e.orientation,side:e.orientation===`row`?`below`:`right`}),(0,G.jsx)(_N,{orientation:e.orientation}),(0,G.jsx)(vN,{orientation:e.orientation}),(0,G.jsx)(gN,{orientation:e.orientation})]})})},bN=e=>{let t=tp(),n=Cp(),r=pp(),[i,a]=(0,W.useState)(!1),o=e.tableHandleMenu||yN,s=ZA(nD),c=QA(nD),l=(0,W.useMemo)(()=>!s||!c||!c.block||c.block.type!==`table`?!1:e.orientation===`column`?s.getCellsAtColumnHandle(c.block,c.colIndex).every(({cell:e})=>ab(e)===1):s.getCellsAtRowHandle(c.block,c.rowIndex).every(({cell:e})=>ob(e)===1),[e.orientation,c,s]);return c?(0,G.jsxs)(n.Generic.Menu.Root,{onOpenChange:n=>{n?(s.freezeHandles(),e.hideOtherElements(!0)):(s.unfreezeHandles(),e.hideOtherElements(!1),t.focus())},position:`right`,portalElement:r,children:[(0,G.jsx)(n.Generic.Menu.Trigger,{children:(0,G.jsx)(n.TableHandle.Root,{className:db(`bn-table-handle`,i?`bn-table-handle-dragging`:``,l?``:`bn-table-handle-not-draggable`),draggable:l,onDragStart:t=>{a(!0),e.hideOtherElements(!0),e.orientation===`column`?s.colDragStart(t):s.rowDragStart(t)},onDragEnd:()=>{s.dragEnd(),e.hideOtherElements(!1),a(!1)},style:e.orientation===`column`?{transform:`rotate(0.25turn)`}:void 0,children:e.children||(0,G.jsx)(wM,{size:24,"data-test":`tableHandle`})})}),(0,G.jsx)(o,{orientation:e.orientation})]}):null},xN=e=>{let t=tp(),[n,r]=(0,W.useState)(),i=QA(nD),a=(0,W.useMemo)(()=>{let e={};if(i===void 0)return{};let n=mw(i.block.id,t.prosemirrorState.doc);if(!n)return{};let r=n.posBeforeNode+1,a=t.prosemirrorView.domAtPos(r+1).node;if(!(a instanceof Element))return{};if(e.tableReference={element:a},i.rowIndex===void 0||i.colIndex===void 0)return e;let o=t.prosemirrorState.doc.resolve(r+1).posAtIndex(i.rowIndex),s=t.prosemirrorState.doc.resolve(o+1).posAtIndex(i.colIndex),c=t.prosemirrorView.domAtPos(s+1).node;return c instanceof Element?(e.cellReference={element:c},e.rowReference={element:a,getBoundingClientRect:()=>{let e=a.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(e.x,i.draggingState&&i.draggingState.draggedCellOrientation===`row`?i.draggingState.mousePos-t.height/2:t.y,e.width,t.height)}},e.columnReference={element:a,getBoundingClientRect:()=>{let e=a.getBoundingClientRect(),t=c.getBoundingClientRect();return new DOMRect(i.draggingState&&i.draggingState.draggedCellOrientation===`col`?i.draggingState.mousePos-t.width/2:t.x,e.y,t.width,e.height)}},e):{}},[t,i]),o=(0,W.useCallback)((e,n,r)=>{let i=!1;return P(e,n,()=>{i?t.getExtension(nD)?.hideHandlesIfNotFrozen():i=!0},{ancestorScroll:!0,ancestorResize:!1,elementResize:!1,layoutShift:!1})},[t]),s=(0,W.useMemo)(()=>i===void 0?void 0:{rowTableHandle:{useFloatingOptions:{open:i.show&&i.rowIndex!==void 0&&(!n||n===`rowTableHandle`),placement:`left`,middleware:[A(-10)],whileElementsMounted:o},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},columnTableHandle:{useFloatingOptions:{open:i.show&&i.colIndex!==void 0&&(!n||n===`columnTableHandle`),placement:`top`,middleware:[A(-12)],whileElementsMounted:o},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},tableCellHandle:{useFloatingOptions:{open:i.show&&i.rowIndex!==void 0&&i.colIndex!==void 0&&(!n||n===`tableCellHandle`),placement:`top-end`,middleware:[A({mainAxis:-15,crossAxis:-1})],whileElementsMounted:o},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendRowsButton:{useFloatingOptions:{open:i.show&&i.showAddOrRemoveRowsButton&&(!n||n===`extendRowsButton`),placement:`bottom`,whileElementsMounted:o,middleware:[ee({apply({rects:e,elements:t}){Object.assign(t.floating.style,{width:`${e.reference.width}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}},extendColumnsButton:{useFloatingOptions:{open:i.show&&i.showAddOrRemoveColumnsButton&&(!n||n===`extendColumnsButton`),placement:`right`,whileElementsMounted:o,middleware:[ee({apply({rects:e,elements:t}){Object.assign(t.floating.style,{height:`${e.reference.height}px`})}})]},focusManagerProps:{disabled:!0},elementProps:{style:{zIndex:10}}}},[n,i,o]);if(!i)return null;let c=e.tableHandle||bN,l=e.extendButton||lN,u=e.tableCellHandle||pN;return(0,G.jsxs)(hp,{target:e.portalElement,children:[(0,G.jsx)(tj,{reference:a?.rowReference,...s?.rowTableHandle,children:i.show&&i.rowIndex!==void 0&&(!n||n===`rowTableHandle`)&&(0,G.jsx)(c,{orientation:`row`,hideOtherElements:e=>r(e?`rowTableHandle`:void 0)})}),(0,G.jsx)(tj,{reference:a?.columnReference,...s?.columnTableHandle,children:i.show&&i.colIndex!==void 0&&(!n||n===`columnTableHandle`)&&(0,G.jsx)(c,{orientation:`column`,hideOtherElements:e=>r(e?`columnTableHandle`:void 0)})}),(0,G.jsx)(tj,{reference:a?.cellReference,...s?.tableCellHandle,children:i.show&&i.rowIndex!==void 0&&i.colIndex!==void 0&&(!n||n===`tableCellHandle`)&&(0,G.jsx)(u,{hideOtherElements:e=>r(e?`tableCellHandle`:void 0)})}),(0,G.jsx)(tj,{reference:a?.tableReference,...s?.extendRowsButton,children:i.show&&i.showAddOrRemoveRowsButton&&(!n||n===`extendRowsButton`)&&(0,G.jsx)(l,{orientation:`addOrRemoveRows`,hideOtherElements:e=>r(e?`extendRowsButton`:void 0)})}),(0,G.jsx)(tj,{reference:a?.tableReference,...s?.extendColumnsButton,children:i.show&&i.showAddOrRemoveColumnsButton&&(!n||n===`extendColumnsButton`)&&(0,G.jsx)(l,{orientation:`addOrRemoveColumns`,hideOtherElements:e=>r(e?`extendColumnsButton`:void 0)})})]})};function SN(e){if(e!==void 0){if(typeof e==`string`){if(typeof document>`u`)return;let t=document.querySelector(e);if(!t){console.warn(`[BlockNote] portalElements selector "${e}" did not match any element`);return}return t}return e}}var CN=(0,W.lazy)(()=>Promise.resolve().then(()=>oP)),wN=(0,W.lazy)(()=>Promise.resolve().then(()=>dP));function TN(e){let t=tp();if(!t)throw Error(`BlockNoteDefaultUI must be used within a BlockNoteContext.Provider`);let n=e.portalElements,r=SN(n?.formattingToolbar),i=SN(n?.linkToolbar),a=SN(n?.slashMenu),o=SN(n?.emojiPicker),s=SN(n?.sideMenu),c=SN(n?.filePanel),l=SN(n?.tableHandles),u=SN(n?.comments),d=SN(n?.attributionTooltip);return(0,G.jsxs)(G.Fragment,{children:[t.getExtension(zC)&&e.formattingToolbar!==!1&&(0,G.jsx)(hM,{portalElement:r}),t.getExtension(Yw)&&e.linkToolbar!==!1&&(0,G.jsx)(bM,{portalElement:i}),t.getExtension(WC)&&e.slashMenu!==!1&&(0,G.jsx)(sN,{triggerCharacter:`/`,shouldOpen:e=>!e.selection.$from.parent.type.isInGroup(`tableContent`),portalElement:a}),t.getExtension(WC)&&e.emojiPicker!==!1&&(0,G.jsx)($M,{triggerCharacter:`:`,columns:10,minQueryLength:2,portalElement:o}),t.getExtension(IE)&&e.sideMenu!==!1&&(0,G.jsx)(NM,{portalElement:s}),t.getExtension(CS)&&e.filePanel!==!1&&(0,G.jsx)(Sj,{portalElement:c}),t.getExtension(nD)&&e.tableHandles!==!1&&(0,G.jsx)(xN,{portalElement:l}),t.getExtension(mj)&&e.comments!==!1&&(0,G.jsxs)(W.Suspense,{children:[(0,G.jsx)(CN,{portalElement:u}),(0,G.jsx)(wN,{portalElement:u})]}),t.getExtension(`attribution`)&&e.attributionTooltip!==!1&&(0,G.jsx)(RM,{portalElement:d})]})}var EN=!1;function DN(){typeof process>`u`&&(EN||typeof document>`u`||(EN=!0,(document.querySelector(`meta[name="viewport"]`)?.getAttribute(`content`)??``).replace(/\s/g,``).includes(`interactive-widget=resizes-content`)||console.warn(`[BlockNote] This page's viewport meta tag is missing "interactive-widget=resizes-content" in its content attribute. Add it to ensure proper mobile functionality, e.g. <meta name="viewport" content="width=device-width, initial-scale=1, interactive-widget=resizes-content">. See https://www.blocknotejs.org/docs/getting-started#mobile-compatibility for more information`)))}function ON(e,t){let n=ep(),r=t??n?.editor,i=(0,W.useRef)(e);ap(()=>{i.current=e}),(0,W.useEffect)(()=>{if(!r)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);return r.onChange((...e)=>i.current(...e))},[r])}function kN(e,t,n){let r=ep(),i=t??r?.editor,a=(0,W.useRef)(e);ap(()=>{a.current=e}),(0,W.useEffect)(()=>{if(!i)throw Error(`'editor' is required, either from BlockNoteContext or as a function argument`);return i.onSelectionChange(e=>a.current(e),n)},[i,n])}var AN=()=>{let e=(0,W.useMemo)(()=>window.matchMedia?.(`(prefers-color-scheme: dark)`),[]),t=(0,W.useMemo)(()=>window.matchMedia?.(`(prefers-color-scheme: light)`),[]),n=e?.matches,r=t?.matches,[i,a]=(0,W.useState)(n?`dark`:r?`light`:`no-preference`);return(0,W.useEffect)(()=>{a(n?`dark`:r?`light`:`no-preference`)},[n,r]),(0,W.useEffect)(()=>{if(typeof e?.addEventListener==`function`){let n=({matches:e})=>e&&a(`dark`),r=({matches:e})=>e&&a(`light`);return e?.addEventListener(`change`,n),t?.addEventListener(`change`,r),()=>{e?.removeEventListener(`change`,n),t?.removeEventListener(`change`,r)}}{let n=()=>a(e.matches?`dark`:t.matches?`light`:`no-preference`);return e?.addEventListener(`change`,n),t?.addEventListener(`change`,n),()=>{e?.removeEventListener(`change`,n),t?.removeEventListener(`change`,n)}}},[e,t]),window.matchMedia,i};function jN(){let e=new Set,t={};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:(0,Zf.createPortal)(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}var MN=({contentComponent:e})=>{let t=(0,W.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,G.jsx)(G.Fragment,{children:Object.values(t)})},NN=(0,W.forwardRef)((e,t)=>{let[n,r]=(0,W.useState)();return(0,W.useImperativeHandle)(t,()=>(e,t)=>{(0,Zf.flushSync)(()=>{r({node:e,container:t})}),r(void 0)},[]),(0,G.jsx)(G.Fragment,{children:n&&(0,Zf.createPortal)(n.node,n.container)})}),PN=()=>{};function FN(e,t){let{editor:n,className:r,theme:i,children:a,editable:o,onSelectionChange:s,onChange:c,formattingToolbar:l,linkToolbar:u,slashMenu:d,emojiPicker:f,sideMenu:p,filePanel:m,tableHandles:h,comments:g,portalElements:_,applyThemedRoot:v,autoFocus:y,renderEditor:b=!0,...x}=e,S=(0,W.useMemo)(()=>SN(_?.default),[_?.default]),[C,w]=(0,W.useState)(),T=ep(),E=AN(),D=T?.colorSchemePreference||E,O=i||(D===`dark`?`dark`:`light`),k=Cp(),A=(0,W.useMemo)(()=>({formattingToolbar:k?l:!1,linkToolbar:k?u:!1,sideMenu:k?p:!1,slashMenu:k?d:!1,filePanel:k?m:!1,tableHandles:k?h:!1,emojiPicker:k?f:!1,comments:k?g:!1,portalElements:_}),[g,k,f,m,l,u,p,d,h,_]);ON(c||PN,n),kN(s||PN,n);let j=(0,W.useCallback)(e=>{n.elementRenderer=e},[n]),M=(0,W.useCallback)(e=>{e.className=db(`bn-root`,O,r||``),e.setAttribute(`data-color-scheme`,O),v?.(e)},[O,r,v]),N=(0,W.useMemo)(()=>({...T,editor:n,setContentEditableProps:w,colorSchemePreference:O}),[T,n,O]),P=(0,W.useMemo)(()=>({editorProps:{autoFocus:y,contentEditableProps:C,editable:o},defaultUIProps:A,applyThemedRoot:M}),[y,C,o,A,M]);return(0,G.jsx)($f.Provider,{value:N,children:(0,G.jsxs)(lp.Provider,{value:P,children:[(0,G.jsx)(NN,{ref:j}),(0,G.jsx)(IN,{className:r,renderEditor:b,editorColorScheme:O,defaultPortalElement:S,ref:t,...x,children:a})]})})}var IN=W.forwardRef(({className:e,renderEditor:t,editorColorScheme:n,defaultPortalElement:r,children:i,...a},o)=>(0,G.jsx)(`div`,{className:db(`bn-root`,`bn-container`,n,e),"data-color-scheme":n,...a,ref:o,children:(0,G.jsx)(mp,{children:(0,G.jsx)(hp,{target:r,children:t?(0,G.jsx)(RN,{children:i}):i})})})),LN=W.forwardRef(FN),RN=e=>{let t=up(),n=tp(),r=(0,W.useMemo)(()=>jN(),[]);(0,W.useEffect)(()=>{DN()},[]);let i=(0,W.useCallback)(e=>{n.isEditable=t.editorProps.editable!==!1,n._tiptapEditor.contentComponent=r,e?n.mount(e):n.unmount()},[t.editorProps.editable,n,r]);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(MN,{contentComponent:r}),(0,G.jsx)(zN,{...t.editorProps,...e,mount:i}),(0,G.jsx)(TN,{...t.defaultUIProps}),e.children]})},zN=e=>{let{autoFocus:t,mount:n,contentEditableProps:r}=e;return(0,G.jsx)(`div`,{"aria-autocomplete":`list`,"aria-haspopup":`listbox`,"data-bn-autofocus":t,ref:n,...r})};function BN(e,t){let n,r=document.createElement(`div`),i;if(t?.elementRenderer)t.elementRenderer(e(e=>n=e||void 0),r);else{if(!t?.headless)throw Error(`elementRenderer not available, expected headless editor`);i=(0,hj.createRoot)(r),(0,Zf.flushSync)(()=>{i.render(e(e=>n=e||void 0))})}if(!r.childElementCount)return i?.unmount(),{dom:document.createElement(`span`)};n?.setAttribute(`data-tmp-find`,`true`);let a=r.cloneNode(!0),o=a.firstElementChild,s=a.querySelector(`[data-tmp-find]`);return s?.removeAttribute(`data-tmp-find`),i?.unmount(),{dom:o,contentDOM:s||void 0}}function VN(e,t){let n=(0,W.useRef)(t),r=e.view.state.doc;if(e.node.type.isInGroup(`bnBlock`))return Vb(e.node,r);try{n.current=ox(e.getPos,r)}catch{}return n.current}var HN={display:`contents`},UN=`data-bn-children-ref`;function WN(e){let t=e.querySelector(`[${UN}]`);return e.hasAttribute(UN)&&(t=e),t?.removeAttribute(UN),t??void 0}function GN(e,t){function n(){let n=e.querySelector(`[data-id]`);return n?.getAttribute(`data-id`)===t()?n:e}e.getBoundingClientRect=()=>Element.prototype.getBoundingClientRect.call(n()),e.getClientRects=()=>Element.prototype.getClientRects.call(n())}function KN(e){return(0,G.jsx)(Ot,{onDragOver:e=>e.preventDefault(),...Object.fromEntries(Object.entries(e.domAttributes||{}).filter(([e])=>e!==`class`)),className:db(`bn-block-content`,e.domAttributes?.class||``),"data-content-type":e.blockType,...Eb(e.blockProps,e.propSchema),"data-file-block":e.isFileBlock===!0||void 0,children:e.children})}function qN(e,t,n){return(r={})=>{let i=typeof e==`function`?e(r):e,a=typeof t==`function`?t(r):t;gx(i,a);let{render:o,renderFrame:s,toExternalHTML:c,...l}=a,u=n?typeof n==`function`?n(r):n:void 0,d=i.layoutOnly===!0;function f(e){let{BlockContent:t,block:n,editor:r}=e;return BN(a=>{let o=(0,G.jsx)(t,{block:n,editor:r,childrenRef:e.childrenRef,contentRef:e=>{a(e),e&&!d&&(e.className=db(`bn-inline-content`,e.className))},context:e.context});return d?o:(0,G.jsx)(KN,{blockType:n.type,blockProps:n.props,propSchema:i.propSchema,domAttributes:e.domAttributes,isFileBlock:e.isFileBlock,children:o})},r)}let p=s;function m(e,t,n){Kb(e);let r=e.closest(`[data-node-view-wrapper]`)?.firstElementChild;if(!(r instanceof HTMLElement))throw Error(`Layout block content must be inside its node view wrapper.`);Wb(r,i.type,t.props,i.propSchema,t.id),r.toggleAttribute(`data-selected`,n)}function h(e){let t=Vb(e.node,e.view.state.doc);if(t.type!==i.type)throw Error(`Frame for "${i.type}" received block "${t.type}".`);let n=gt().nodeViewContentRef,r=(0,W.useRef)(null),a=(0,W.useRef)(null);if(!n||!p)throw Error(`Frame node view requires a frame and content mount.`);let o=(0,W.useRef)({block:t,selected:e.selected});(0,W.useLayoutEffect)(()=>{o.current={block:t,selected:e.selected},d&&a.current&&m(a.current,t,e.selected)});let s=(0,W.useCallback)(e=>{a.current=e,e&&(e.dataset.nodeViewContent=``),n(e??(d?null:r.current)),d&&e&&m(e,o.current.block,o.current.selected)},[n]),c=(0,W.useCallback)(e=>{r.current=e,!a.current&&!d&&n(e)},[n]);return(0,G.jsx)(Ot,{ref:c,style:HN,children:(0,G.jsx)(p,{block:t,editor:e.extension.options.editor,slotRef:s})})}return{config:i,implementation:{...l,...c&&{toExternalHTML(e,t,n){let r=f({BlockContent:c,block:e,editor:t,domAttributes:this.blockContentDOMAttributes,isFileBlock:a.meta?.fileBlockAccept!==void 0,context:n,childrenRef:e=>e?.setAttribute(UN,``)});return{...r,childrenDOM:WN(r.dom)}}},...o&&{render(e,t){if(this.renderType===`nodeView`){let n=e,r=o,s=this.blockContentDOMAttributes;function c(e){let o=VN(e,n),c=gt().nodeViewContentRef;if(!c)throw Error(`nodeViewContentRef is not set`);let l=c;function u(e){l(e),e&&(e.dataset.nodeViewContent=``,e.className=db(`bn-inline-content`,e.className))}return(0,G.jsx)(KN,{blockType:o.type,blockProps:o.props,propSchema:i.propSchema,isFileBlock:!!a.meta?.fileBlockAccept,domAttributes:s,children:(0,G.jsx)(r,{block:o,editor:t,contentRef:u})})}return At(c,{className:`bn-react-node-view-renderer`})(this.props)}return f({BlockContent:o,block:e,editor:t,domAttributes:this.blockContentDOMAttributes})}},...p?{renderFrame(e,t){let{dom:n,contentDOM:r}=BN(n=>(0,G.jsx)(p,{block:e,editor:t,slotRef:n}),t);return r?{dom:n,slot:r}:void 0},frameView:e=>{let t=At(h,{className:`bn-react-node-view-renderer bn-frame-node-view`})(e);if(!(t instanceof U))throw Error(`React frames need an editor that renders React node views.`);let n=t.dom,r=t.contentDOM;if(!r)throw Error(`React frame node view has no content DOM.`);return d&&(r.style.display=`contents`,GN(n,()=>t.node.attrs.id)),{dom:n,slot:r,get node(){return t.node},update(e,n,r){return!d&&e.firstChild?.type!==t.node.firstChild?.type?!1:t.update(e,n,r)},selectNode:()=>t.selectNode(),deselectNode:()=>t.deselectNode(),destroy:()=>t.destroy()}}}:{}},extensions:u}}}var JN;async function YN(){return JN||(JN=(async()=>{let[e,t]=await Promise.all([jn(()=>import(`./module-BrWgIX20.js`),[],import.meta.url),jn(()=>import(`./native-Cqs-2kTC.js`),[],import.meta.url)]),n=`default`in e?e.default:e,r=`default`in t?t.default:t;return await n.init({data:r}),{emojiMart:n,emojiData:r}})(),JN)}function XN(e){let t=(0,W.useRef)(null),n=(0,W.useRef)(null);return n.current&&n.current.update(e),(0,W.useEffect)(()=>((async()=>{let{emojiMart:r}=await YN();n.current=new r.Picker({...e,ref:t})})(),()=>{n.current=null}),[]),W.createElement(`div`,{ref:t})}var ZN=e=>{let[t,n]=(0,W.useState)(!1),r=Cp(),i=ep(),a=pp();return(0,G.jsxs)(r.Generic.Popover.Root,{open:t,portalElement:a,children:[(0,G.jsx)(r.Generic.Popover.Trigger,{children:(0,G.jsx)(`div`,{onClick:r=>{r.preventDefault(),r.stopPropagation(),n(!t),e.onOpenChange?.(!t)},style:{display:`flex`,justifyContent:`center`,alignItems:`center`},children:e.children})}),(0,G.jsx)(r.Generic.Popover.Content,{className:`bn-emoji-picker-popover`,variant:`panel-popover`,children:(0,G.jsx)(XN,{perLine:7,onClickOutside:()=>{n(!1),e.onOpenChange?.(!1)},onEmojiSelect:t=>{e.onEmojiSelect(t),n(!1),e.onOpenChange?.(!1)},theme:i?.colorSchemePreference})})]})};function QN(e){let{userStore:t}=ZA(mj),n=e.join(`,`);return(0,W.useEffect)(()=>{t.loadUsers(e)},[t,n]),np(t.store,t=>{let n=new Map;for(let r of e){let e=t.get(r);e&&n.set(r,e)}return n})}function $N(e){return QN([e]).get(e)}var eP=e=>{let t=Cp(),n=wp(),r=ZA(mj),i=e.comment.reactions.find(t=>t.emoji===e.emoji);if(!i)throw Error(`Trying to render reaction badge for non-existing reaction`);let[a,o]=(0,W.useState)([]),s=QN(a);return(0,G.jsx)(t.Generic.Badge.Root,{className:db(`bn-badge`,`bn-comment-reaction`),text:i.userIds.length.toString(),icon:i.emoji,isSelected:r.threadStore.auth.canDeleteReaction(e.comment,i.emoji),onClick:()=>e.onReactionSelect(i.emoji),onMouseEnter:()=>o(i.userIds),mainTooltip:n.comments.reactions.reacted_by,secondaryTooltip:`${Array.from(s.values()).map(e=>e.username).join(`
212
- `)}`},i.emoji)},tP=(0,W.memo)(({isEmpty:e,comment:t,isEditing:n,threadStore:r,onReactionSelect:i,onEditSubmit:a,onEditCancel:o,onEmojiPickerOpenChange:s,Components:c,dict:l})=>{let u=r.auth.canAddReaction(t);return(0,G.jsxs)(G.Fragment,{children:[t.reactions.length>0&&!n&&(0,G.jsxs)(c.Generic.Badge.Group,{className:db(`bn-badge-group`,`bn-comment-reactions`),children:[t.reactions.map(e=>(0,G.jsx)(eP,{comment:t,emoji:e.emoji,onReactionSelect:i},e.emoji)),u&&(0,G.jsx)(ZN,{onEmojiSelect:e=>i(e.native),onOpenChange:s,children:(0,G.jsx)(c.Generic.Badge.Root,{className:db(`bn-badge`,`bn-comment-add-reaction`),text:`+`,icon:(0,G.jsx)(zp,{size:16}),mainTooltip:l.comments.actions.add_reaction})})]}),n&&(0,G.jsxs)(c.Generic.Toolbar.Root,{variant:`action-toolbar`,className:db(`bn-action-toolbar`,`bn-comment-actions`),children:[(0,G.jsx)(c.Generic.Toolbar.Button,{mainTooltip:l.comments.save_button_text,variant:`compact`,onClick:a,isDisabled:e,children:l.comments.save_button_text}),(0,G.jsx)(c.Generic.Toolbar.Button,{className:`bn-button`,mainTooltip:l.comments.cancel_button_text,variant:`compact`,onClick:o,children:l.comments.cancel_button_text})]})]})}),nP=({comment:e,thread:t,showResolveButton:n})=>{let r=ZA(mj),i=wp(),[a,o]=(0,W.useState)(!1),s=rj({initialContent:e.body,trailingBlock:!1,dictionary:{...i,placeholders:{emptyDocument:i.placeholders.edit_comment}},schema:r.commentEditorSchema||cj,extensions:[uj({submitOnEnter:r.submitOnEnter,onSubmit:async n=>{await r.threadStore.updateComment({commentId:e.id,comment:{body:n.document},threadId:t.id}),o(!1)}})]}),c=Cp(),l=pp(),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(!1),m=r.threadStore,h=(0,W.useCallback)(()=>{o(!0)},[]),g=(0,W.useCallback)(()=>{s.replaceBlocks(s.document,e.body),o(!1)},[s,e.body]),_=s.getExtension(uj).submit,v=(0,W.useCallback)(async()=>{await m.deleteComment({commentId:e.id,threadId:t.id})},[e,t.id,m]),y=(0,W.useCallback)(async n=>{m.auth.canAddReaction(e,n)?await m.addReaction({threadId:t.id,commentId:e.id,emoji:n}):m.auth.canDeleteReaction(e,n)&&await m.deleteReaction({threadId:t.id,commentId:e.id,emoji:n})},[m,e,t.id]),b=(0,W.useCallback)(async()=>{await m.resolveThread({threadId:t.id})},[t.id,m]),x=(0,W.useCallback)(async()=>{await m.unresolveThread({threadId:t.id})},[t.id,m]),S=$N(e.userId);if(!e.body)return null;let C,w=m.auth.canAddReaction(e),T=m.auth.canDeleteComment(e),E=m.auth.canUpdateComment(e),D=n&&(t.resolved?m.auth.canUnresolveThread(t):m.auth.canResolveThread(t));a||(C=(0,G.jsxs)(c.Generic.Toolbar.Root,{className:db(`bn-action-toolbar`,`bn-comment-actions`),variant:`action-toolbar`,children:[w&&(0,G.jsx)(ZN,{onEmojiSelect:e=>y(e.native),onOpenChange:d,children:(0,G.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.add_reaction,variant:`compact`,children:(0,G.jsx)(zp,{size:16})},`add-reaction`)}),D&&(t.resolved?(0,G.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.reopen,variant:`compact`,onClick:x,children:(0,G.jsx)(Pm,{size:16})},`reopen`):(0,G.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.resolve,variant:`compact`,onClick:b,children:(0,G.jsx)(qp,{size:16})},`resolve`)),(T||E)&&(0,G.jsxs)(c.Generic.Menu.Root,{position:`bottom-start`,onOpenChange:p,portalElement:l,children:[(0,G.jsx)(c.Generic.Menu.Trigger,{children:(0,G.jsx)(c.Generic.Toolbar.Button,{mainTooltip:i.comments.actions.more_actions,variant:`compact`,children:(0,G.jsx)(Hp,{size:16})},`more-actions`)}),(0,G.jsxs)(c.Generic.Menu.Dropdown,{className:`bn-menu-dropdown`,children:[E&&(0,G.jsx)(c.Generic.Menu.Item,{icon:(0,G.jsx)(Nm,{}),onClick:h,children:i.comments.actions.edit_comment},`edit-comment`),T&&(0,G.jsx)(c.Generic.Menu.Item,{icon:(0,G.jsx)(Gp,{}),onClick:v,children:i.comments.actions.delete_comment},`delete-comment`)]})]})]}));let O=e.createdAt.toLocaleDateString(void 0,{month:`short`,day:`numeric`});if(!e.body)throw Error(`soft deletes are not yet supported`);return(0,G.jsx)(c.Comments.Comment,{authorInfo:S??`loading`,timeString:O,edited:e.updatedAt.getTime()!==e.createdAt.getTime(),showActions:f||`hover`,actions:C,className:`bn-thread-comment`,emojiPickerOpen:u,children:(0,G.jsx)(ij,{autoFocus:a,editor:s,editable:a,actions:e.reactions.length>0||a?({isFocused:t,isEmpty:n})=>(0,G.jsx)(tP,{isFocused:t,isEmpty:n,comment:e,isEditing:a,threadStore:m,onReactionSelect:y,onEditSubmit:_,onEditCancel:g,onEmojiPickerOpenChange:d,Components:c,dict:i}):void 0})})},rP=({thread:e,maxCommentsBeforeCollapse:t})=>{let n=Cp(),r=wp(),i=QN(e.resolvedBy?[e.resolvedBy]:[]),a=e.comments.map((t,n)=>(0,G.jsx)(nP,{thread:e,comment:t,showResolveButton:n===0},t.id+JSON.stringify(t.body||`{}`)));if(e.resolved&&e.resolvedUpdatedAt&&e.resolvedBy){if(!i.get(e.resolvedBy))throw Error(`User ${e.resolvedBy} resolved thread ${e.id}, but their data could not be found.`);let t=e.comments.findLastIndex(t=>e.resolvedUpdatedAt.getTime()>t.createdAt.getTime())+1;a.splice(t,0,(0,G.jsx)(n.Comments.Comment,{className:`bn-thread-comment`,authorInfo:e.resolvedBy&&i.get(e.resolvedBy)||`loading`,timeString:e.resolvedUpdatedAt.toLocaleDateString(void 0,{month:`short`,day:`numeric`}),edited:!1,showActions:!1,children:(0,G.jsx)(`div`,{className:`bn-resolved-text`,children:r.comments.sidebar.marked_as_resolved})},`resolved-comment`))}return t&&a.length>t&&a.splice(1,a.length-2,(0,G.jsx)(n.Comments.ExpandSectionsPrompt,{className:`bn-thread-expand-prompt`,children:r.comments.sidebar.more_replies(e.comments.length-2)},`expand-prompt`)),a},iP=(0,W.memo)(({isEmpty:e,onSave:t,Components:n,dict:r})=>(0,G.jsx)(n.Generic.Toolbar.Root,{className:db(`bn-action-toolbar`,`bn-comment-actions`),variant:`action-toolbar`,children:(0,G.jsx)(n.Generic.Toolbar.Button,{className:`bn-button`,mainTooltip:r.comments.save_button_text,variant:`compact`,isDisabled:e,onClick:t,children:r.comments.save_button_text})}));function aP(e){let t=e.newCommentEditor,n=Cp(),r=wp(),i=t.getExtension(uj);if(!i)throw Error(`FloatingComposer's newCommentEditor must include CommentEditorSubmitExtension.`);let a=i.submit;return(0,G.jsx)(n.Comments.Card,{className:`bn-thread`,children:(0,G.jsx)(ij,{autoFocus:!0,editable:!0,editor:t,actions:({isFocused:e,isEmpty:t})=>(0,G.jsx)(iP,{isFocused:e,isEmpty:t,onSave:a,Components:n,dict:r})})})}var oP=_j({default:()=>sP});function sP(e){let t=tp(),n=wp(),r=ZA(mj),i=QA(mj,{editor:t,selector:e=>e.pendingComment}),a=rj({trailingBlock:!1,dictionary:{...n,placeholders:{emptyDocument:n.placeholders.new_comment}},schema:r.commentEditorSchema||cj,extensions:[uj({submitOnEnter:r.submitOnEnter,onSubmit:async e=>{await r.createThread({initialComment:{body:e.document}}),r.stopPendingComment(),t.transact(e=>{e.setSelection(gr.create(e.doc,e.selection.to))}),t.focus()}})]},[i]),o=sp({editor:t,selector:({editor:e})=>i?{from:e.prosemirrorState.selection.from,to:e.prosemirrorState.selection.to}:void 0}),s=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!i,onOpenChange:e=>{if(!e){if(!lj({hasUnsavedContent:!a.isEmpty,confirmBeforeDiscard:r.confirmBeforeDiscard,message:n.comments.discard_pending_comment}))return;r.stopPendingComment(),t.focus()}},placement:`bottom`,middleware:[A(10),j(),te()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!1},elementProps:{style:{zIndex:60},...e.floatingUIOptions?.elementProps}}),[r,n,t,a,i,e.floatingUIOptions]),c=e.floatingComposer||aP;return(0,G.jsx)(hp,{target:e.portalElement,children:(0,G.jsx)(nj,{position:o,...s,children:(0,G.jsx)(c,{newCommentEditor:a})})})}var cP=(0,W.memo)(({isEmpty:e,onNewCommentSave:t,Components:n,dict:r})=>e?null:(0,G.jsx)(n.Generic.Toolbar.Root,{variant:`action-toolbar`,className:db(`bn-action-toolbar`,`bn-comment-actions`),children:(0,G.jsx)(n.Generic.Toolbar.Button,{mainTooltip:r.comments.save_button_text,variant:`compact`,isDisabled:e,onClick:t,children:r.comments.save_button_text})})),lP=({thread:e,selected:t,orphaned:n,referenceText:r,maxCommentsBeforeCollapse:i,onFocus:a,onBlur:o,tabIndex:s,newCommentEditor:c})=>{let l=Cp(),u=wp(),d=ZA(mj),f=(0,W.useRef)(e.id);f.current=e.id;let p=rj({trailingBlock:!1,dictionary:{...u,placeholders:{emptyDocument:u.placeholders.comment_reply}},schema:d.commentEditorSchema||cj,extensions:[uj({submitOnEnter:d.submitOnEnter,onSubmit:async e=>{await d.threadStore.addComment({comment:{body:e.document},threadId:f.current}),e.removeBlocks(e.document)}})]}),m=c??p,h=m.getExtension(uj);if(!h)throw Error(`Thread's newCommentEditor must include CommentEditorSubmitExtension.`);let g=h.submit;return(0,G.jsxs)(l.Comments.Card,{className:db(`bn-thread`,n&&`bn-thread-orphaned`),headerText:r,onFocus:a,onBlur:o,selected:t,tabIndex:s,children:[(0,G.jsx)(l.Comments.CardSection,{className:`bn-thread-comments`,children:(0,G.jsx)(rP,{thread:e,maxCommentsBeforeCollapse:t?void 0:i||5})}),t&&(0,G.jsx)(l.Comments.CardSection,{className:`bn-thread-composer`,children:(0,G.jsx)(ij,{autoFocus:!1,editable:!0,editor:m,actions:({isFocused:e,isEmpty:t})=>(0,G.jsx)(cP,{isFocused:e,isEmpty:t,onNewCommentSave:g,Components:l,dict:u})})})]})};function uP(){let e=ZA(mj).threadStore,t=(0,W.useRef)(void 0);t.current||=e.getThreads();let n=(0,W.useCallback)(n=>e.subscribe(e=>{t.current=e,n()}),[e]);return(0,W.useSyncExternalStore)(n,()=>t.current)}var dP=_j({default:()=>fP});function fP(e){let t=tp(),n=wp(),r=ZA(mj),i=QA(mj,{editor:t,selector:e=>e.selectedThreadId?{id:e.selectedThreadId,position:e.threadPositions.get(e.selectedThreadId)}:void 0}),a=rj({trailingBlock:!1,dictionary:{...n,placeholders:{emptyDocument:n.placeholders.comment_reply}},schema:r.commentEditorSchema||cj,extensions:[uj({submitOnEnter:r.submitOnEnter,onSubmit:async e=>{i&&(await r.threadStore.addComment({comment:{body:e.document},threadId:i.id}),e.removeBlocks(e.document))}})]},[i?.id]),o=uP(),s=(0,W.useMemo)(()=>i?o.get(i.id):void 0,[i,o]),c=(0,W.useMemo)(()=>({...e.floatingUIOptions,useFloatingOptions:{open:!!i,onOpenChange:(e,i,o)=>{if(!e){if(!lj({hasUnsavedContent:!a.isEmpty,confirmBeforeDiscard:r.confirmBeforeDiscard,message:n.comments.discard_pending_comment}))return;o===`escape-key`&&t.focus(),r.selectThread(void 0)}},placement:`bottom`,middleware:[A(10),j(),te()],...e.floatingUIOptions?.useFloatingOptions},focusManagerProps:{disabled:!0,...e.floatingUIOptions?.focusManagerProps},elementProps:{style:{zIndex:30},...e.floatingUIOptions?.elementProps}}),[r,n,t,a,e.floatingUIOptions,i]),l=e.floatingThread||lP;return(0,G.jsx)(hp,{target:e.portalElement,children:(0,G.jsx)(nj,{position:i?.position,...c,children:s&&(0,G.jsx)(l,{thread:s,selected:!0,newCommentEditor:a})})})}W.memo(({thread:e,selectedThreadId:t,maxCommentsBeforeCollapse:n,referenceText:r,orphaned:i})=>{let a=ZA(mj),o=(0,W.useCallback)(t=>{t.target.closest(`.bn-action-toolbar`)||a.selectThread(e.id)},[a,e.id]),s=(0,W.useCallback)(e=>{if(!e.relatedTarget||e.relatedTarget.closest(`.bn-action-toolbar`))return;let t=e.target instanceof Node?e.target:null,n=e.relatedTarget instanceof Node?e.relatedTarget.closest(`.bn-thread`):null;t&&n&&n.contains(t)||a.selectThread(void 0)},[a]);return(0,G.jsx)(lP,{thread:e,selected:e.id===t,orphaned:i,referenceText:r,maxCommentsBeforeCollapse:n,onFocus:o,onBlur:s,tabIndex:0})});function pP(e){let t=(0,W.useRef)(null);return(0,W.useEffect)(()=>{e&&t.current?.focus({preventScroll:!0})},[e]),t}function mP(e){return e.currentTarget instanceof HTMLElement&&e.relatedTarget instanceof HTMLElement&&e.currentTarget.contains(e.relatedTarget)}function hP({onBlur:e,onFocus:t}={}){let n=(0,W.useRef)(null),[r,i]=(0,W.useState)(!1),a=(0,W.useRef)(!1),o=e=>{i(e),a.current=e},s=(0,W.useCallback)(e=>{a.current||(o(!0),t?.(e))},[t]),c=(0,W.useCallback)(t=>{a.current&&!mP(t)&&(o(!1),e?.(t))},[e]);return(0,W.useEffect)(()=>{let e=n.current;if(e)return e.addEventListener(`focusin`,s),e.addEventListener(`focusout`,c),()=>{e?.removeEventListener(`focusin`,s),e?.removeEventListener(`focusout`,c)}},[s,c]),{ref:n,focused:r}}function gP(e){return(0,G.jsx)(Ot,{as:`span`,className:`bn-inline-content-section`,"data-inline-content-type":e.inlineContentType,...Eb(e.inlineContentProps,e.propSchema),children:e.children})}function _P(e,t,n){let r=st.create({name:e.type,inline:!0,group:`inline`,selectable:e.content!==`none`,atom:e.content===`none`,draggable:t.meta?.draggable,code:t.meta?.code,content:e.content===`styled`?`inline*`:e.content===`plain`?`text*`:``,marks(){return e.content===`plain`?g_(this.editor):void 0},addAttributes(){return ax(e.propSchema)},addKeyboardShortcuts(){return Tx(e)},parseHTML(){return gD(e,t.parse,t.parseContent)},renderHTML({node:n}){let r=this.options.editor,i=Bb(n,r.schema.inlineContentSchema,r.schema.styleSchema),a=t.toExternalHTML||t.render;return wx(BN(e=>(0,G.jsx)(a,{contentRef:t=>{e(t),t&&(t.dataset.editable=``)},inlineContent:i,updateInlineContent:()=>{},editor:r,node:n,getPos:()=>void 0}),r),e.type,n.attrs,e.propSchema)},addNodeView(){let n=this.options.editor;return r=>At(r=>{let i=gt().nodeViewContentRef;if(!i)throw Error(`nodeViewContentRef is not set`);let a=t.render;return(0,G.jsx)(gP,{inlineContentProps:r.node.attrs,inlineContentType:e.type,propSchema:e.propSchema,children:(0,G.jsx)(a,{contentRef:e=>{i(e),e&&(e.dataset.editable=``)},editor:n,node:r.node,getPos:r.getPos,inlineContent:Bb(r.node,n.schema.inlineContentSchema,n.schema.styleSchema),updateInlineContent:e=>{let t=dS([e],n.pmSchema),i=r.getPos();i!==void 0&&n.transact(e=>e.replaceWith(i,i+r.node.nodeSize,t))}})})},{className:`bn-ic-react-node-view-renderer`,as:`span`})(r)}});return Ex(e,{...t,node:r,render(n,r,i){let a=t.render,o=dS([n],i.pmSchema)[0];return BN(t=>(0,G.jsx)(gP,{inlineContentProps:n.props,inlineContentType:e.type,propSchema:e.propSchema,children:(0,G.jsx)(a,{contentRef:e=>{t(e),e&&(e.dataset.editable=``)},editor:i,inlineContent:n,updateInlineContent:r,node:o,getPos:()=>void 0})}),i)},toExternalHTML(n,r){let i=t.toExternalHTML||t.render,a=dS([n],r.pmSchema)[0];return BN(t=>(0,G.jsx)(gP,{inlineContentProps:n.props,inlineContentType:e.type,propSchema:e.propSchema,children:(0,G.jsx)(i,{contentRef:e=>{t(e),e&&(e.dataset.editable=``)},editor:r,inlineContent:n,updateInlineContent:()=>{},node:a,getPos:()=>void 0})}),r)}},n)}function vP(e,t){let n=Qe.create({name:e.type,addAttributes(){return Ox(e.propSchema)},parseHTML(){return Nx(e)},renderHTML({mark:n}){let r=t.render;return kx(BN(t=>(0,G.jsx)(r,{editor:this.options.editor,value:e.propSchema===`boolean`?void 0:n.attrs.stringValue,contentRef:e=>{t(e),e&&(e.dataset.editable=``)}}),this.options.editor),e.type,n.attrs.stringValue,e.propSchema)},addMarkView(){let n=this.options.editor;return r=>{let i=wt(r=>{let i=(0,W.useContext)(Mt).markViewContentRef;if(!i)throw Error(`markViewContentRef is not set`);let a=t.render;return(0,G.jsx)(a,{editor:n,contentRef:e=>{i(e),e&&(e.dataset.markViewContent=``)},value:e.propSchema===`boolean`?void 0:r.mark.attrs.stringValue})})(r);return i.didMountContentDomElement=!0,i}}});return Ax(e,{...t,mark:n,render(n,r){let i=t.render;return kx(BN(e=>(0,G.jsx)(i,{editor:r,value:n,contentRef:t=>{e(t),t&&(t.dataset.editable=``)}}),r),e.type,n,e.propSchema)},toExternalHTML(n,r){let i=t.render;return kx(BN(e=>(0,G.jsx)(i,{editor:r,value:n,contentRef:t=>{e(t),t&&(t.dataset.editable=``)}}),r),e.type,n,e.propSchema)}})}function yP(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top<r.top,a=n.bottom>r.bottom;return i&&a?`both`:i?`top`:a?`bottom`:`none`}function bP(e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}function xP(e){return(0,W.useMemo)(()=>bP(e),e)}function SP(e){mb()?e.preventDefault():fb()&&e.currentTarget.focus()}var CP={};function wP(e,t){let n=W.useRef(CP);return n.current===CP&&(n.current=e(t)),n}function TP(e,t,n,r){let i=wP(DP).current;return OP(i,e,t,n,r)&&AP(i,[e,t,n,r]),i.callback}function EP(e){let t=wP(DP).current;return kP(t,e)&&AP(t,e),t.callback}function DP(){return{callback:null,cleanup:null,refs:[]}}function OP(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function kP(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function AP(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var jP=19;function MP(e){return jP>=e}function NP(e){if(!W.isValidElement(e))return null;let t=e,n=t.props;return(MP(19)?n?.ref:t.ref)??null}function PP(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function FP(){}var IP=Object.freeze([]),LP=Object.freeze({});function RP(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function zP(e,t){return typeof e==`function`?e(t):e}function BP(e,t){return typeof e==`function`?e(t):e}var VP={};function HP(e,t,n,r,i){if(!n&&!r&&!i&&!e)return WP(t);let a=WP(e);return t&&(a=GP(a,t)),n&&(a=GP(a,n)),r&&(a=GP(a,r)),i&&(a=GP(a,i)),a}function UP(e){if(e.length===0)return VP;if(e.length===1)return WP(e[0]);let t=WP(e[0]);for(let n=1;n<e.length;n+=1)t=GP(t,e[n]);return t}function WP(e){return YP(e)?{...e(VP)}:KP(e)}function GP(e,t){return YP(t)?t(e):qP(e,t)}function KP(e){let t={...e};for(let e in t){let n=t[e];JP(e,n)&&(t[e]=ZP(n))}return t}function qP(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=PP(e.style,r);break;case`className`:e[n]=$P(e.className,r);break;default:e[n]=JP(n,r)?XP(e[n],r):r}}return e}function JP(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function YP(e){return typeof e==`function`}function XP(e,t){return t?e?(...n)=>{let r=n[0];if(eF(r)){let i=r;QP(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:ZP(t):e}function ZP(e){return e&&((...t)=>{let n=t[0];return eF(n)&&QP(n),e(...t)})}function QP(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function $P(e,t){return t?e?t+` `+e:t:e}function eF(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function tF(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=aF(r));let i=nF(t,n,r);if(n.enabled===!1)return null;let a=n.state??LP;return oF(e,r,i,a)}function nF(e,t,n){let{className:r,style:i}=e,{state:a=LP,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?zP(r,a):void 0,d=l?BP(i,a):void 0,f=l?RP(a,c):LP,p=l&&s?rF(s):void 0,m=l?PP(f,p)??{}:LP;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?EP([m.ref,NP(n),...o]):TP(m.ref,NP(n),o):TP(null,null)),l?(u!==void 0&&(m.className=$P(m.className,u)),d!==void 0&&(m.style=PP(m.style,d)),m):LP}function rF(e){return Array.isArray(e)?UP(e):HP(void 0,e)}var iF=Symbol.for(`react.lazy`);function aF(e){if(e?.$$typeof!==iF)return e;let t=W.Children.toArray(e)[0];return W.isValidElement(t)?t:e}function oF(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=HP(n,t.props);return e.ref=n.ref,W.cloneElement(t,e)}return sF(e,n)}function sF(e,t){return e===`button`?(0,W.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,W.createElement)(`img`,{alt:``,...t,key:t.key}):W.createElement(e,t)}function cF(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var lF=cF(`https://base-ui.com/production-error`,`Base UI`),uF=W.createContext(void 0);function dF(){let e=W.useContext(uF);if(e===void 0)throw Error(lF(13));return e}var fF={imageLoadingStatus:()=>null},pF=W.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=W.useState(`idle`),c={imageLoadingStatus:o},l=W.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=tF(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:fF});return(0,G.jsx)(uF.Provider,{value:l,children:u})}),mF={...W},hF=mF.useInsertionEffect,gF=hF&&hF!==mF.useLayoutEffect?hF:e=>e();function Z(e){let t=wP(_F).current;return t.next=e,gF(t.effect),t.trampoline}function _F(){let e={next:void 0,callback:vF,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function vF(){}var Q=typeof document<`u`?W.useLayoutEffect:()=>{};function yF(e){W.useEffect(e,IP)}var bF=null;globalThis.requestAnimationFrame;var xF=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},SF=class e{static create(){return new e}static request(e){return xF.request(e)}static cancel(e){return xF.cancel(e)}currentId=bF;request(e){this.cancel(),this.currentId=xF.request(()=>{this.currentId=bF,e()})}cancel=()=>{this.currentId!==bF&&(xF.cancel(this.currentId),this.currentId=bF)};disposeEffect=()=>this.cancel};function CF(){let e=wP(SF.create).current;return yF(e.disposeEffect),e}function wF(e){return e==null?e:`current`in e?e.current:e}function TF(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var EF=`data-starting-style`,DF=`data-ending-style`,OF=null;function kF(e){if(!OF){let e=[];OF=e,queueMicrotask(()=>{OF=null,Zf.flushSync(()=>{for(let t of e)t()})})}OF.push(e)}function AF(e,t=!1,n=!1){let r=CF();return Z((i,a=null)=>{r.cancel();let o=wF(e);if(o==null)return;let s=o,c=()=>{n?kF(()=>{a?.aborted||i()}):Zf.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(TF(s).map(e=>e.finished.then(FP))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(TF(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=EF;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function jF(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Z(a),s=AF(r,n,i);W.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var MF={[EF]:``},NF={[DF]:``},PF={transitionStatus(e){return e===`starting`?MF:e===`ending`?NF:null}};function FF(e,t=!1,n=!1,r=!1){let[i,a]=W.useState(e&&t?`idle`:void 0),[o,s]=W.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Q(()=>{if(!e&&o&&i!==`ending`&&n){let e=SF.request(()=>{a(`ending`)});return()=>{SF.cancel(e)}}},[e,o,i,n]),Q(()=>{if(!e||t||i===void 0)return;let n=SF.request(()=>{a(void 0)});return()=>{SF.cancel(n)}},[t,e,i]),Q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=SF.request(()=>{a(`idle`)});return()=>{SF.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function IF(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=W.useState(`idle`),s=o[1];return Q(()=>{if(!a)return FP;if(!e&&!i)return s(`error`),FP;let o=!0,c=new window.Image,l=e=>()=>{o&&s(e)};return s(`loading`),c.onload=l(`loaded`),c.onerror=l(`error`),t&&(c.referrerPolicy=t),c.crossOrigin=n??null,r&&(c.sizes=r),i&&(c.srcset=i),e&&(c.src=e),c.complete&&s(c.naturalWidth>0?`loaded`:`error`),()=>{o=!1}},[a,e,i,r,n,t,s]),o}var LF={...fF,...PF},RF=W.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,keepMounted:a=!1,style:o,sizes:s,srcSet:c,src:l,...u}=e,{setImageLoadingStatus:d}=dF(),[f,p]=IF(l,e,!a),m=f===`loaded`,{mounted:h,transitionStatus:g,setMounted:_}=FF(m),v=W.useRef(null),y=W.useRef(!0);Q(()=>{if(!a)return;let e=y.current;y.current=!1;let t=v.current;if(!t)return;if(!t.complete){p(`loading`);return}let n=t.naturalWidth>0?`loaded`:`error`;p(n),n===`loaded`&&e&&_(!0)},[a,l,c,s,u.crossOrigin,u.referrerPolicy,r,p,_]);let b=a?{"data-loading":f===`loading`?``:void 0,"data-error":f===`error`?``:void 0,"aria-hidden":f!==`loaded`||void 0,onLoad(){p(`loaded`)},onError(){p(`error`)}}:void 0,x=Z(e=>{i?.(e),d(e)});Q(()=>{f!==`idle`&&x(f)},[f,x]),Q(()=>()=>d(`idle`),[d]),jF({enabled:!m,open:m,ref:v,onComplete(){m||_(!1)}});let S={imageLoadingStatus:f,transitionStatus:a&&g===`ending`?void 0:g},C=a||h,w={};s!==void 0&&(w.sizes=s),c!==void 0&&(w.srcSet=c),l!==void 0&&(w.src=l);let T=tF(`img`,e,{state:S,ref:[t,v],props:[b,u,w],stateAttributesMapping:LF,enabled:C});return C?T:null}),zF=0,BF=class e{static create(){return new e}currentId=zF;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=zF,t()},e)}isStarted(){return this.currentId!==zF}clear=()=>{this.currentId!==zF&&(clearTimeout(this.currentId),this.currentId=zF)};disposeEffect=()=>this.clear};function VF(){let e=wP(BF.create).current;return yF(e.disposeEffect),e}var HF=W.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=dF(),[c,l]=W.useState(i===0),u=VF();return W.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),tF(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:fF,enabled:s!==`loaded`&&(i===0||c)})}),UF=`-`,WF=e=>{let t=JF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(UF);return n[0]===``&&n.length!==1&&n.shift(),GF(n,t)||qF(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},GF=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?GF(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(UF);return t.validators.find(({validator:e})=>e(a))?.classGroupId},KF=/^\[(.+)\]$/,qF=e=>{if(KF.test(e)){let t=KF.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},JF=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return QF(Object.entries(e.classGroups),n).forEach(([e,n])=>{YF(n,r,e,t)}),r},YF=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:XF(t,e);r.classGroupId=n}else if(typeof e==`function`){if(ZF(e)){YF(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n})}else Object.entries(e).forEach(([e,i])=>{YF(i,XF(t,e),n,r)})})},XF=(e,t)=>{let n=e;return t.split(UF).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},ZF=e=>e.isThemeGetter,QF=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,$F=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},eI=`!`,tI=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(eI);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},nI=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},rI=e=>({cache:$F(e.cacheSize),parseClassName:tI(e),...WF(e)}),iI=/\s+/,aI=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(iI),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f||(p=r(u),!p)){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=nI(c).join(`:`),h=l?m+eI:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function oI(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=sI(t))&&(r&&(r+=` `),r+=n);return r}var sI=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=sI(e[r]))&&(n&&(n+=` `),n+=t);return n};function cI(e,...t){let n,r,i,a=o;function o(o){return n=rI(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=aI(e,n);return i(e,a),a}return function(){return a(oI.apply(null,arguments))}}var lI=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},uI=/^\[(?:([a-z-]+):)?(.+)\]$/i,dI=/^\d+\/\d+$/,fI=new Set([`px`,`full`,`screen`]),pI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,hI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,gI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_I=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vI=e=>bI(e)||fI.has(e)||dI.test(e),yI=e=>NI(e,`length`,PI),bI=e=>!!e&&!Number.isNaN(Number(e)),xI=e=>NI(e,`number`,bI),SI=e=>!!e&&Number.isInteger(Number(e)),CI=e=>e.endsWith(`%`)&&bI(e.slice(0,-1)),wI=e=>uI.test(e),TI=e=>pI.test(e),EI=new Set([`length`,`size`,`percentage`]),DI=e=>NI(e,EI,FI),OI=e=>NI(e,`position`,FI),kI=new Set([`image`,`url`]),AI=e=>NI(e,kI,LI),jI=e=>NI(e,``,II),MI=()=>!0,NI=(e,t,n)=>{let r=uI.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},PI=e=>mI.test(e)&&!hI.test(e),FI=()=>!1,II=e=>gI.test(e),LI=e=>_I.test(e),RI=cI(()=>{let e=lI(`colors`),t=lI(`spacing`),n=lI(`blur`),r=lI(`brightness`),i=lI(`borderColor`),a=lI(`borderRadius`),o=lI(`borderSpacing`),s=lI(`borderWidth`),c=lI(`contrast`),l=lI(`grayscale`),u=lI(`hueRotate`),d=lI(`invert`),f=lI(`gap`),p=lI(`gradientColorStops`),m=lI(`gradientColorStopPositions`),h=lI(`inset`),g=lI(`margin`),_=lI(`opacity`),v=lI(`padding`),y=lI(`saturate`),b=lI(`scale`),x=lI(`sepia`),S=lI(`skew`),C=lI(`space`),w=lI(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,wI,t],O=()=>[wI,t],k=()=>[``,vI,yI],A=()=>[`auto`,bI,wI],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],N=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],P=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],F=()=>[``,`0`,wI],I=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],L=()=>[bI,wI];return{cacheSize:500,separator:`:`,theme:{colors:[MI],spacing:[vI,yI],blur:[`none`,``,TI,wI],brightness:L(),borderColor:[e],borderRadius:[`none`,``,`full`,TI,wI],borderSpacing:O(),borderWidth:k(),contrast:L(),grayscale:F(),hueRotate:L(),invert:F(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[CI,yI],inset:D(),margin:D(),opacity:L(),padding:O(),saturate:L(),scale:L(),sepia:F(),skew:L(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,wI]}],container:[`container`],columns:[{columns:[TI]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:[...j(),wI]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,SI,wI]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,wI]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:[`first`,`last`,`none`,SI,wI]}],"grid-cols":[{"grid-cols":[MI]}],"col-start-end":[{col:[`auto`,{span:[`full`,SI,wI]},wI]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[MI]}],"row-start-end":[{row:[`auto`,{span:[SI,wI]},wI]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":[`auto`,`min`,`max`,`fr`,wI]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,wI]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...P()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...P(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...P(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":[C]}],"space-y-reverse":[`space-y-reverse`],w:[{w:[`auto`,`min`,`max`,`fit`,`svw`,`lvw`,`dvw`,wI,t]}],"min-w":[{"min-w":[wI,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[wI,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[TI]},TI]}],h:[{h:[wI,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[wI,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[wI,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[wI,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,TI,yI]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,xI]}],"font-family":[{font:[MI]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`,wI]}],"line-clamp":[{"line-clamp":[`none`,bI,xI]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,vI,wI]}],"list-image":[{"list-image":[`none`,wI]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,wI]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,vI,yI]}],"underline-offset":[{"underline-offset":[`auto`,vI,wI]}],"text-decoration-color":[{decoration:[e]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,wI]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,wI]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),OI]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,DI]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},AI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[vI,wI]}],"outline-w":[{outline:[vI,yI]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[vI,yI]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,TI,jI]}],"shadow-color":[{shadow:[MI]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...N(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,TI,wI]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[`none`,`all`,``,`colors`,`opacity`,`shadow`,`transform`,wI]}],duration:[{duration:L()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,wI]}],delay:[{delay:L()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,wI]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[SI,wI]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:[`center`,`top`,`top-right`,`right`,`bottom-right`,`bottom`,`bottom-left`,`left`,`top-left`,wI]}],accent:[{accent:[`auto`,e]}],appearance:[{appearance:[`none`,`auto`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,wI]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,wI]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[vI,yI,xI]}],stroke:[{stroke:[e,`none`]}],sr:[`sr-only`,`not-sr-only`],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-s`,`border-w-e`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-s`,`border-color-e`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]}}});function zI(e){return tF(e.defaultTagName??`div`,e,e)}var BI=W.createContext(void 0);function VI(e=!1){let t=W.useContext(BI);if(t===void 0&&!e)throw Error(lF(16));return t}function HI(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:W.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function UI(e){return e?.ownerDocument||document}function WI(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(oe(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function GI(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=W.useRef(null),s=VI(!0),c=a??s!==void 0,{props:l}=HI({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=W.useCallback(()=>{let e=o.current;KI(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Q(u,[u]),{getButtonProps:W.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return HP({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(QP(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=KI(r),s=!i&&qI(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),WI(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),WI(r,e)))},onKeyUp(e){t||(QP(e),a?.(e),e.target===e.currentTarget&&i&&c&&KI(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),WI(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Z(e=>{o.current=e,u()})}}function KI(e){return d(e)&&e.tagName===`BUTTON`}function qI(e){return d(e)&&e.tagName===`A`&&!!e.href}var JI=W.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=GI({disabled:i,focusableWhenDisabled:a,native:o});return tF(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),YI=W.createContext(void 0);function XI(e){let t=W.useContext(YI);if(t===void 0&&!e)throw Error(lF(33));return t}var ZI=W.createContext(void 0);function QI(e){let t=W.useContext(ZI);if(t===void 0&&!e)throw Error(lF(36));return t}var $I=`data-open`,eL=`data-closed`,tL=`data-anchor-hidden`,nL=`data-popup-open`,rL=`data-pressed`,iL={[nL]:``},aL={[nL]:``,[rL]:``},oL={[$I]:``},sL={[eL]:``},cL={[tL]:``},lL={open(e){return e?iL:null}},uL={open(e){return e?aL:null}},dL={open(e){return e?oL:sL},anchorHidden(e){return e?cL:null}},fL={...dL,...PF},pL=W.createContext(void 0);function mL(e=!0){let t=W.useContext(pL);if(t===void 0&&!e)throw Error(lF(25));return t}var hL=`none`,gL=`trigger-press`,_L=`trigger-hover`,vL=`trigger-focus`,yL=`outside-press`,bL=`item-press`,xL=`focus-out`,SL=`escape-key`,CL=`list-navigation`,wL=`keyboard`,TL=`pointer`,EL=`cancel-open`,DL=`sibling-open`,OL=`disabled`,kL=`missing`,AL=`initial`,jL=`imperative-action`,ML=`window-resize`;function NL({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=W.useRef(e!==void 0),[a,o]=W.useState(()=>t);return[i&&e!==void 0?e:a,W.useCallback(e=>{i||o(e)},[])]}var PL=W.createContext(null);function FL(e=`root`){let t=W.useContext(PL),n=W.useContext(ZI);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var IL={visible:!0,ref:null};function LL(){return IL}function RL(e,t,n=`root`){let r=FL(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??LL)({label:e.label,children:e.children,render:e.render}),a=TP(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}var zL=W.createContext(void 0);function BL(){let e=W.useContext(zL);if(e===void 0)throw Error(lF(30));return e}function VL(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:HL,platform:UL,maxTouchPoints:WL}=VL(),GL=HL.toLowerCase(),KL=UL.toLowerCase(),qL=/^i(os$|p)/.test(KL)||KL===`macintel`&&WL>1,JL=`android`,YL=KL===JL||GL.includes(JL),XL=!qL&&KL.startsWith(`mac`);KL.startsWith(`win`),!YL&&/^(linux|chrome os)/.test(KL);var ZL=XL||qL,QL=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!QL&&GL.includes(`firefox`),!QL&&GL.includes(`chrom`);var $L=ZL,eR=/jsdom|happydom/.test(GL);function tR(e){e.preventDefault()}function nR(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=QI(),u=mL(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return W.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?tR:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:bL})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!XL&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&WI(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var rR={type:`regular-item`};function iR(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=W.useRef(null),{getButtonProps:d,buttonRef:f}=GI({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=nR({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=W.useCallback(e=>HP(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=TP(u,f);return W.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var aR=W.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function oR(){return W.useContext(aR)}function sR(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=oR(),u=W.useRef(-1),[d,f]=W.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=W.useRef(null),h=W.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}function cR(){let[,e]=W.useState({});return W.useCallback(()=>{e({})},[])}var lR=0;function uR(e,t=`mui`){let n=W.useRef(void 0),r=cR(),i=e??n.current;return W.useEffect(()=>{n.current??(lR+=1,n.current=`${t}-${lR}`,e??r())},[e,t,r]),i}var dR=mF.useId;function fR(e,t){if(dR!==void 0){let n=dR();return e??(t?`${t}-${n}`:n)}return uR(e,t)}function pR(e){return fR(e,`base-ui`)}var mR=`data-checked`,hR=`data-unchecked`,gR={checked(e){return e?{[mR]:``}:{[hR]:``}},...PF};function _R(e,t,n,r){let i=!1,a=!1,o=r??LP;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function vR(e,t,n){let r=n??LP;return{reason:e,event:t??new Event(`base-ui`),...r}}var yR=W.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l=!1,onCheckedChange:u,style:d,...f}=e,{store:p}=QI(),m=sR({guess:!0,label:a}),h=pR(i),g=p.useState(`disabled`),_=p.useState(`isActive`,m.index),v=p.useState(`floatingNodeId`),y=p.useState(`itemProps`),b=s||g,{getItemProps:x,itemRef:S}=iR({closeOnClick:c,disabled:b,highlighted:_,id:h,store:p,nativeButton:o,nodeId:v,itemMetadata:rR}),C=W.useMemo(()=>({disabled:b,highlighted:_,checked:l}),[b,_,l]);function w(e){let t=_R(bL,e.nativeEvent,void 0,{preventUnmountOnClose:FP});u?.(!l,t)}let T=tF(`div`,e,{state:C,stateAttributesMapping:gR,props:[y,{role:`menuitemcheckbox`,"aria-checked":l,onClick:w},f,x],ref:[S,t,m.ref]});return(0,G.jsx)(zL.Provider,{value:C,children:T})}),bR=W.forwardRef(function(e,t){let{checked:n,defaultChecked:r,onCheckedChange:i,...a}=e,[o,s]=NL({controlled:n,default:r??!1,name:`MenuCheckboxItem`,state:`checked`}),c=RL(e,t);function l(e,t){i?.(e,t),t.isCanceled||s(e)}return c.visible?(0,G.jsx)(yR,{...a,checked:o,onCheckedChange:l,ref:c.ref}):null}),xR=W.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=BL(),c=W.useRef(null),{transitionStatus:l,mounted:u,setMounted:d}=FF(s.checked);return jF({batch:!0,enabled:!s.checked,open:s.checked,ref:c,onComplete(){s.checked||d(!1)}}),tF(`span`,e,{state:{checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l},ref:[t,c],stateAttributesMapping:gR,props:{"aria-hidden":!0,...o},enabled:a||u})}),SR=W.createContext(void 0);function CR(){let e=W.useContext(SR);if(e===void 0)throw Error(lF(31));return e}var wR=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=W.useState(void 0),c=tF(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,G.jsx)(SR.Provider,{value:s,children:c})}),TR=W.forwardRef(function(e,t){let n=FL()?.Group??wR;return(0,G.jsx)(n,{...e,ref:t})}),ER=W.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=pR(a),c=CR();return Q(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),tF(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),DR=W.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=QI(),f=sR({guess:!0,label:a}),p=pR(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=iR({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:rR});return tF(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),OR=W.forwardRef(function(e,t){let n=RL(e,t);return n.visible?(0,G.jsx)(DR,{...e,ref:n.ref}):null});function kR(e){e.preventDefault(),e.stopPropagation()}function AR(e){return`nativeEvent`in e}function jR(e){return e.pointerType===``&&e.isTrusted?!0:YL&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function MR(e){return eR?!1:!YL&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(YL||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function NR(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function PR(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function FR(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function IR(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function LR(e,t){let n=e;for(;n;){if(S(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(f(n)?n.host:null)}return null}function RR(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var zR=`data-base-ui-focusable`,BR=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,VR=`ArrowLeft`,HR=`ArrowRight`,UR=`ArrowUp`,WR=`ArrowDown`,GR=`data-trigger-disabled`;function KR(e,t){if(!S(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(GR);for(let[,e]of t.entries())if(IR(e,n))return!e.hasAttribute(GR);return!1}function qR(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function JR(e){return e.matches(`html,body`)}function YR(e){return d(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function XR(e){return LR(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${BR}`)!=null}function ZR(e){return e?e.getAttribute(`role`)===`combobox`&&YR(e):!1}function QR(e){if(!e||eR)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function $R(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function ez(e,t){return t!=null&&!NR(t)?0:typeof e==`function`?e():e}function tz(e,t,n){let r=ez(e,n);return typeof r==`number`?r:r?.[t]}function nz(e){return typeof e==`function`?e():e}function rz(e,t){return t||e===`click`||e===`mousedown`}function iz(e){return e?.includes(`mouse`)&&e!==`mousedown`}var az=W.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new BF,currentIdRef:{current:null},currentContextRef:{current:null}});function oz(e,t){e.current=t.current}function sz(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=W.useRef(n),a=W.useRef(n),o=W.useRef(null),s=W.useRef(null),c=VF();return Q(()=>{a.current=n,o.current?i.current={open:tz(i.current,`open`),close:tz(n,`close`)}:i.current=n},[n,o,i,a]),(0,G.jsx)(az.Provider,{value:W.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function cz(e,t={open:!1}){let{open:n}=t,r=e.useState(`floatingId`),{currentIdRef:i,delayRef:a,timeoutMs:o,initialDelayRef:s,currentContextRef:c,hasProvider:l,timeout:u}=W.useContext(az),[d,f]=W.useState(!1),p=W.useRef(n);return Q(()=>{p.current=n},[n]),Q(()=>{function t(){c.current?.setIsInstantPhase(!1),i.current=null,c.current=null,a.current=s.current,u.clear()}if(i.current&&!n&&i.current===r){if(f(!1),o){let n=r;return u.start(o,()=>{e.select(`open`)||i.current&&i.current!==n||t()}),()=>{(p.current||i.current!==n)&&u.clear()}}t()}},[n,r,i,a,o,s,c,u,e]),Q(()=>{if(!n)return;let t=c.current,o=i.current;u.clear(),c.current={onOpenChange:e.setOpen,setIsInstantPhase:f},i.current=r,a.current={open:0,close:tz(s.current,`close`)},o!==null&&o!==r?(f(!0),t?.setIsInstantPhase(!0),t?.onOpenChange(!1,_R(hL))):(f(!1),t?.setIsInstantPhase(!1))},[n,r,e,i,a,s,c,u]),Q(()=>()=>{if(i.current===r){if(c.current=null,!p.current)return;i.current=null,oz(a,s),u.clear()}},[c,i,a,r,s,u]),W.useMemo(()=>({activeIdRef:i,hasProvider:l,delayRef:a,isInstantPhase:d}),[i,l,a,d])}function lz(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function uz(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function dz(e){let t=wP(fz,e).current;return t.next=e,Q(t.effect),t}function fz(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var pz={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},mz={...pz,position:`fixed`,margin:0,top:0,left:0},hz={...pz,position:`absolute`},gz=W.forwardRef(function(e,t){let[n,r]=W.useState();Q(()=>{$L&&QL&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,G.jsx)(`span`,{...e,ref:t,style:mz,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function _z(e,t){return t<0||t>=e.length}function vz(e,t){return xz(e.current,{disabledIndices:t})}function yz(e,t){return xz(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function bz(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>xz(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:_z(e,u)?-1:u,wrapped:d}}function xz(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Sz(e,a,r));return a}function Sz(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!wz(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Cz(e){return e.visibility===`hidden`||e.visibility===`collapse`}function wz(e,t=e?E(e):null){return!e||!e.isConnected||!t||Cz(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Tz=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Ez(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return f(n)?n.host:null}function Dz(e){for(let t of Array.from(e.children))if(re(t)===`summary`)return t;return null}function Oz(e,t){let n=Dz(t);return!!n&&(e===n||IR(n,e))}function kz(e){let t=e?re(e):``;return e!=null&&e.matches(Tz)&&(t!==`summary`||e.parentElement!=null&&re(e.parentElement)===`details`&&Dz(e.parentElement)===e)&&(t!==`details`||Dz(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Az(e){if(!kz(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Ez(t)){let n=t!==e,r=re(t)===`slot`;if(t.hasAttribute(`inert`)||n&&re(t)===`details`&&!t.open&&!Oz(e,t)||t.hasAttribute(`hidden`)||!r&&!jz(t,n))return!1}return!0}function jz(e,t){let n=E(e);return t?n.display!==`none`:wz(e,n)}function Mz(e){let t=e.tabIndex;if(t<0){let t=re(e);if(t===`details`||t===`audio`||t===`video`||d(e)&&e.isContentEditable)return 0}return t}function Nz(e){if(re(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Pz(e,t){let n=Nz(e);if(!n)return!0;let r=t.find(e=>{let t=Nz(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Nz(e);return t?.name===n.name&&t.form===n.form})===n}function Fz(e){if(d(e)&&re(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return d(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Iz(e,t){Fz(e).forEach(e=>{kz(e)&&t.push(e),Iz(e,t)})}function Lz(e,t,n){Fz(e).forEach(e=>{d(e)&&e.matches(t)&&n.push(e),Lz(e,t,n)})}function Rz(e){return Az(e)&&Mz(e)>=0}function zz(e){let t=[];return Iz(e,t),t.filter(Az)}function Bz(e){let t=zz(e);return t.filter(e=>Mz(e)>=0&&Pz(e,t))}function Vz(e,t){let n=Bz(e),r=n.length;if(r===0)return;let i=FR(UI(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Hz(e){return Vz(UI(e).body,1)||e}function Uz(e){return Vz(UI(e).body,-1)||e}function Wz(e,t,n){if(!e)return null;let r=[];Iz(UI(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Az);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!IR(n,o)&&Rz(o)&&Pz(o,a))return o}return r[i]}function Gz(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!IR(n,r)}function Kz(e){Bz(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function qz(e){let t=[];Lz(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Jz(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Jz(e,t.id,n)])}function Yz(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Xz(e){return`data-base-ui-${e}`}var Zz=0;function Qz(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Zz);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),FP;let o=requestAnimationFrame(a);return Zz=o,()=>{Zz===o&&(cancelAnimationFrame(o),Zz=0)}}var $z=`data-base-ui-inert`,eB=new WeakMap,tB=new WeakSet,nB=new WeakMap,rB=0;function iB(e){return e?f(e)?e.host:iB(e.parentNode):null}var aB=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=iB(t);return e.contains(n)?n:null}).filter(e=>e!=null),oB=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},sB=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{re(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function cB(e,t,n,{mark:r=!0}){let i=aB(t,e),a=r?sB(t,oB(i),new Set(i)):[],o=[],s=[];if(n){let e=aB(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);sB(t,oB(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(eB.get(e)||0)+1;eB.set(e,r),o.push(e),r===1&&n&&tB.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(nB.get(e)||0)+1;nB.set(e,t),s.push(e),t===1&&e.setAttribute($z,``)}),rB+=1,()=>{o.forEach(e=>{let t=(eB.get(e)||0)-1;eB.set(e,t),t||(tB.has(e)||e.removeAttribute(`aria-hidden`),tB.delete(e))}),r&&s.forEach(e=>{let t=(nB.get(e)||0)-1;nB.set(e,t),t||e.removeAttribute($z)}),--rB,rB||(eB=new WeakMap,tB=new WeakSet,nB=new WeakMap)}}function lB(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=UI(e[0]).body;return cB(e,i,n,{mark:r})}var uB={style:{transition:`none`}},dB=`data-base-ui-click-trigger`,fB={fallbackAxisSide:`none`},pB={fallbackAxisSide:`end`},mB={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},hB=W.createContext(null),gB=()=>W.useContext(hB),_B=Xz(`portal`);function vB(e={}){let{ref:t,container:n,componentProps:r=LP,elementProps:i}=e,a=fR(),o=gB()?.portalNode,[s,c]=W.useState(null),[l,u]=W.useState(null),d=Z(e=>{e!==null&&u(e)}),f=W.useRef(null);Q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(w(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=tF(`div`,r,{ref:[t,d],props:[{id:a,[_B]:``},i]}),m=s&&p?Zf.createPortal(p,s):null;return{node:l,nodeId:W.isValidElement(p)?p.props.id:void 0,subtree:m}}var yB=W.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=vB({container:o,ref:t,componentProps:e,elementProps:c}),f=W.useRef(null),p=W.useRef(null),m=W.useRef(null),h=W.useRef(null),[g,_]=W.useState(null),v=W.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;W.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Gz(e)&&(e.type===`focusin`?v.current&&=(qz(l),!1):(Kz(l),v.current=!0))}return uz(lz(l,`focusin`,e,!0),lz(l,`focusout`,e,!0))},[l,y]),Q(()=>{l&&b===!0&&v.current&&(qz(l),v.current=!1)},[b,l]);let S=W.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,G.jsxs)(W.Fragment,{children:[d,(0,G.jsxs)(hB.Provider,{value:S,children:[x&&l&&(0,G.jsx)(gz,{"data-type":`outside`,ref:f,onFocus:e=>{Gz(e,l)?m.current?.focus():Uz(g?g.domReference:null)?.focus()}}),x&&l&&(0,G.jsx)(`span`,{role:s,"aria-owns":u,style:mB}),l&&Zf.createPortal(a,l),x&&l&&(0,G.jsx)(gz,{"data-type":`outside`,ref:p,onFocus:e=>{Gz(e,l)?h.current?.focus():(Hz(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,_R(`focus-out`,e.nativeEvent)))}})]})]})});function bB(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var xB=class{nodesRef={current:[]};events=bB();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},SB=W.createContext(null),CB=W.createContext(null),wB=()=>W.useContext(SB)?.id||null,TB=e=>{let t=W.useContext(CB);return e??t};function EB(e){let t=fR(),n=TB(e),r=wB();return Q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function DB(e){let{children:t,id:n}=e,r=wB();return(0,G.jsx)(SB.Provider,{value:W.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function OB(e){let{children:t,externalTree:n}=e,r=wP(()=>n??new xB).current;return(0,G.jsx)(CB.Provider,{value:r,children:t})}function kB(e,t){let n=oe(RR(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(jR(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var AB=20,jB=[];function MB(){jB=jB.filter(e=>e.deref()?.isConnected)}function NB(e){MB(),e&&re(e)!==`body`&&(jB.push(new WeakRef(e)),jB.length>AB&&(jB=jB.slice(-20)))}function PB(){return MB(),jB[jB.length-1]?.deref()}function FB(e){return e?Rz(e)?e:Bz(e)[0]||e:null}function IB(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=zz(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Rz(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function LB(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:g}=e,_=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=Z(()=>x.current.floatingContext?.nodeId),C=i===!1,w=ZR(v)&&C,T=dz(i),E=dz(a),D=dz(o),O=dz(u),k=dz(_),A=TB(h),j=gB(),M=W.useRef(!1),N=W.useRef(!1),P=W.useRef(!1),F=W.useRef(null),I=W.useRef(``),L=W.useRef(``),R=W.useRef(null),z=W.useRef(null),B=TP(R,m,j?.beforeInsideRef),ee=TP(z,j?.afterInsideRef),te=VF(),ne=VF(),ie=CF(),ae=j!=null,V=$R(y),oe=Z((e=V)=>e?Bz(e):[]),se=Z(()=>g?.().filter(e=>e!=null)??[]);W.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&IR(V,FR(UI(V)))&&oe().length===0&&!w&&kR(e)}return lz(UI(V),`keydown`,e)},[r,V,c,w,oe]),W.useEffect(()=>{if(r||!_)return;let e=UI(V);function t(){P.current=!1}function n(e){let t=RR(e),n=se(),r=IR(y,t)||IR(v,t)||IR(j?.portalNode,t)||n.some(e=>e===t||IR(e,t));P.current=!r,L.current=e.pointerType||`keyboard`,LR(t,`[data-base-ui-click-trigger]`)&&(N.current=!0,ne.start(0,()=>{N.current=!1}))}function i(){L.current=`keyboard`}return uz(lz(e,`pointerdown`,n,!0),lz(e,`pointerup`,t,!0),lz(e,`pointercancel`,t,!0),lz(e,`keydown`,i,!0),t)},[r,y,v,V,_,j,ne,se]),W.useEffect(()=>{if(r||!l)return;let e=UI(V);function n(){N.current=!0,ne.start(0,()=>{N.current=!1})}function i(e){let t=RR(e);Rz(t)&&(F.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=RR(n);c&&r==null&&a!=null&&IR(y,a)&&NB(a),queueMicrotask(()=>{let o=S(),l=t.context.triggerElements,u=se(),m=r?.hasAttribute(Xz(`focus-guard`))&&[R.current,z.current,j?.beforeInsideRef.current,j?.afterInsideRef.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,wF(p),wF(f)].includes(r),h=!(IR(v,r)||IR(y,r)||IR(r,y)||IR(j?.portalNode,r)||u.some(e=>e===r||IR(e,r))||l.hasMatchingElement(e=>IR(e,r))||m||A&&(Jz(A.nodesRef.current,o).find(e=>IR(e.context?.elements.floating,r)||IR(e.context?.elements.domReference,r))||Yz(A.nodesRef.current,o).find(e=>[e.context?.elements.floating,$R(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&V&&IB(V),s&&i!==v&&!wz(a)&&FR(e)===e.body){if(d(V)&&(V.focus(),s===`popup`)){ie.request(()=>{V.focus()});return}let e=oe(),t=F.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||V;d(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!c)&&r&&h&&!N.current&&(w||r!==PB())&&(M.current=!0,t.setOpen(!1,_R(xL,n)))})}function o(){P.current||(x.current.insideReactTree=!0,te.start(0,()=>{x.current.insideReactTree=!1}))}let u=d(v)?v:null;if(y||u)return uz(u&&lz(u,`focusout`,a),u&&lz(u,`pointerdown`,n),y&&lz(y,`focusin`,i),y&&lz(y,`focusout`,a),y&&j&&lz(y,`focusout`,o,!0))},[r,v,y,V,c,A,j,t,l,s,oe,w,S,x,te,ne,ie,f,p,se]),W.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(j?.portalNode?.querySelectorAll(`[${Xz(`portal`)}]`)||[]),t=(A?Yz(A.nodesRef.current,S()):[]).find(e=>ZR(e.context?.elements.domReference||null))?.context?.elements.domReference,n=lB([y,...e,R.current,z.current,j?.beforeOutsideRef.current,j?.afterOutsideRef.current,...se(),t,wF(p),wF(f),w?v:null].filter(e=>e!=null),{ariaHidden:c||w,mark:!1}),i=lB([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,c,j,w,A,S,f,p,se]),Q(()=>{if(!_||r||!d(V))return;I.current=``,L.current=``;let e=UI(V),t=FR(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(O.current||``):n;if(r===void 0||r===!1||IR(V,t))return;let i=null,a=()=>(i??=oe(V),i[0]||V),o;o=r===!0||r===null?a():wF(r),o||=a();let s=IR(V,FR(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&jR(c);Qz(o,{sync:l,preventScroll:o===V,shouldFocus(){if(!k.current)return!1;if(s)return!0;let t=FR(e);return!(t!==o&&IR(V,t))}})})},[r,_,V,oe,T,O,k,x]);let ce=W.useRef(null);Q(()=>{if(r||!V){ce.current=null;return}ce.current&&=(ce.current.cancelled=!0,null);let e=UI(V),t=FR(e),n=O.current==null;NB(t);function i(e){if(e.open||(I.current=kB(e.nativeEvent,L.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Xz(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(M.current=!0),e.reason===`outside-press`){if(e.nested)M.current=!1;else if(jR(e.nativeEvent)||MR(e.nativeEvent))M.current=!1;else{let e=!1;UI(V).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?M.current=!1:M.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&re(t)!==`body`?t:null,s=n?o||a:a||o;return s||=PB()||null,typeof i==`boolean`?s:wF(i)||s||null}return()=>{b.off(`openchange`,i);let t=FR(e),n=se(),r=IR(y,t)||n.some(e=>e===t||IR(e,t))||A&&Jz(A.nodesRef.current,S(),!1).some(e=>IR(e.context?.elements.floating,t)),o=E.current,s=I.current,c=a(s),l={cancelled:!1};ce.current=l,queueMicrotask(()=>{ce.current===l&&(ce.current=null);let n=FB(c),i=D.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!M.current&&d(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}M.current=!1})}},[r,y,V,E,D,O,b,A,v,S,se]),Q(()=>{if(!QL||_||!y)return;let e=FR(UI(y));d(e)&&YR(e)&&IR(y,e)&&e.blur()},[_,y]),Q(()=>{if(!r&&j)return j.setFocusManagerState({modal:c,closeOnFocusOut:l,open:_,onOpenChange:t.setOpen,domReference:v}),()=>{j.setFocusManagerState(null)}},[r,j,c,_,t,l,v]),Q(()=>{if(!r&&V)return IB(V),()=>{queueMicrotask(MB)}},[r,V]);let le=!r&&(!c||!w)&&(ae||c);return(0,G.jsxs)(W.Fragment,{children:[le&&(0,G.jsx)(gz,{"data-type":`inside`,ref:B,onFocus:e=>{if(c){let e=oe();Qz(e[e.length-1])}else j?.portalNode&&(M.current=!1,Gz(e,j.portalNode)?Hz(v)?.focus():wF(p??j.beforeOutsideRef)?.focus())}}),n,le&&(0,G.jsx)(gz,{"data-type":`inside`,ref:ee,onFocus:e=>{c?Qz(oe()[0]):j?.portalNode&&(l&&(M.current=!0),Gz(e,j.portalNode)?Uz(v)?.focus():wF(f??j.afterOutsideRef)?.focus())}})]})}function RB(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=gL}=t,l=e.context.dataRef,u=W.useRef(void 0),d=CF(),f=VF(),p=W.useMemo(()=>{function t(t,n,r,i){let a=_R(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=NR(e.pointerType,!0)&&MR(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||NR(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=RR(s),p=YR(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:NR(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return W.useMemo(()=>n?{reference:p}:LP,[n,p])}function zB(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,(!i||c)&&(d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function BB(e){return e!=null&&e.clientX!=null}function VB(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=e.useState(`open`),a=e.useState(`floatingElement`),o=e.useState(`domReferenceElement`),s=e.context.dataRef,c=W.useRef(!1),l=W.useRef(null),[u,d]=W.useState(),[f,p]=W.useState([]),m=Z(t=>{e.set(`positionReference`,t)}),h=Z((t,n,i)=>{c.current||(!s.current.openEvent||BB(s.current.openEvent))&&e.set(`positionReference`,zB(i??o,{x:t,y:n,axis:r,dataRef:s,pointerType:u}))}),g=Z(e=>{i?l.current||(h(e.clientX,e.clientY,e.currentTarget),p([])):h(e.clientX,e.clientY,e.currentTarget)}),_=NR(u)?a:i;W.useEffect(()=>{if(!n){m(o);return}if(!_)return;function e(){l.current?.(),l.current=null}let t=oe(a);function r(t){let n=RR(t);IR(a,n)?e():h(t.clientX,t.clientY)}return!s.current.openEvent||BB(s.current.openEvent)?l.current=lz(t,`mousemove`,r):m(o),e},[_,n,a,s,o,e,h,m,f]),W.useEffect(()=>()=>{e.set(`positionReference`,null)},[e]),W.useEffect(()=>{n&&!a&&(c.current=!1)},[n,a]),W.useEffect(()=>{!n&&i&&(c.current=!0)},[n,i]);let v=W.useMemo(()=>{function e(e){d(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return W.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}function HB(){return!1}function UB(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function WB(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=HB,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:p,events:m}=e.context,h=TB(c),g=Z(typeof i==`function`?i:()=>!1),_=typeof i==`function`?g:i,v=_!==!1,y=Z(()=>a),{escapeKey:b,outsidePress:x}=UB(s),C=W.useRef(!1),w=W.useRef(!1),T=W.useRef(!1),O=W.useRef(!1),k=W.useRef(!1),A=W.useRef(``),j=W.useRef(null),M=VF(),N=VF(),P=VF(),F=Z(()=>{N.clear(),p.current.insideReactTree=!1}),I=Z(e=>{let t=p.current.floatingContext?.nodeId;return(h?Jz(h.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),L=Z(t=>qR(t,e.select(`floatingElement`))||qR(t,e.select(`domReferenceElement`))),R=Z(t=>{o()&&e.setOpen(!1,_R(gL,t.nativeEvent))}),z=Z(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=AR(t)?t.nativeEvent:t;if(k.current||i.isComposing||!b&&I(`__escapeKeyBubbles`))return;let a=_R(SL,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!b&&!a.isPropagationAllowed&&t.stopPropagation()}),B=Z(()=>{p.current.insideReactTree=!0,N.start(0,F)}),ee=Z(t=>{if(!l||!n||t.button!==0)return;let r=RR(t.nativeEvent);IR(e.select(`floatingElement`),r)&&(C.current||(C.current=!0,w.current=!1))}),te=Z(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&C.current&&(w.current=!0)});W.useEffect(()=>{function e(e){e.open||(O.current=!1)}return m.on(`openchange`,e),()=>{m.off(`openchange`,e)}},[m]),W.useEffect(()=>F,[F]),W.useEffect(()=>{if(!l||!n)return l||(O.current=!1,k.current=!1,A.current=``,j.current=null),F;p.current.__escapeKeyBubbles=b,p.current.__outsidePressBubbles=x;let t=new BF,i=UI(u);function a(){P.clear(),k.current=!0}function o(){k.current=!0,P.start(QL?5:0,()=>{k.current=!1})}function s(){T.current=!0,t.start(0,()=>{T.current=!1})}function c(){C.current=!1,w.current=!1}function m(){let e=A.current,t=e===`pen`||!e?`mouse`:e,n=y(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function g(e){let t=m();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function N(e){let t=p.current.floatingContext?.nodeId,n=h&&Jz(h.nodesRef.current,t).some(t=>qR(e,t.context?.elements.floating));return L(e)||n}function R(n){if(g(n)){n.type!==`click`&&!L(n)&&(t.clear(),T.current=!1),F();return}if(p.current.insideReactTree){F();return}let r=RR(n),i=`[${Xz(`inert`)}]`,a=S(r)?r.getRootNode():null,o=Array.from((f(a)?a:UI(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>IR(e,r))))return;let c=S(r)?r:null;for(;c&&!ae(c);){let e=D(c);if(ae(e)||!S(e))break;c=e}if(!(o.length&&S(r)&&!JR(r)&&!IR(r,e.select(`floatingElement`))&&o.every(e=>!IR(c,e)))){if(d(r)&&!(`touches`in n)){let e=ae(r),t=E(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!N(n)){if(m()===`intentional`){if(n.detail!==0&&!jR(n)&&!O.current)return;if(T.current){t.clear(),T.current=!1;return}}typeof _==`function`&&!_(n)||I(`__outsidePressBubbles`)||(e.setOpen(!1,_R(yL,n)),F())}}}function B(t){m()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!L(t)&&R(t)}function ee(t){if(m()!==`sloppy`||!e.select(`open`)||!n||L(t))return;let r=t.touches[0];r&&(j.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},M.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}function te(e,t){let n=RR(e);if(!n)return;let r=lz(n,e.type,()=>{t(e),r()})}function ne(e){A.current=`touch`,te(e,ee)}function re(e){M.clear(),e.type===`pointerdown`&&(e.button===0&&(O.current=!0),A.current=e.pointerType),(e.type!==`mousedown`||!j.current||j.current.dismissOnMouseDown)&&te(e,e=>{e.type===`pointerdown`?B(e):R(e)})}function ie(e){if(e.type===`pointercancel`&&(O.current=!1),!C.current)return;let n=w.current;c(),m()===`intentional`&&(e.type===`pointercancel`?n&&s():N(e)||(n?s():(typeof _!=`function`||_(e))&&(t.clear(),T.current=!0,F())))}function V(e){if(m()!==`sloppy`||!j.current||L(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-j.current.startX),r=Math.abs(t.clientY-j.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(j.current.dismissOnTouchEnd=!0),i>10&&(R(e),M.clear(),j.current=null)}function oe(e){te(e,V)}function se(e){m()===`sloppy`&&j.current&&!L(e)&&(j.current.dismissOnTouchEnd&&R(e),M.clear(),j.current=null)}function ce(e){te(e,se)}let le=uz(r&&uz(lz(i,`keydown`,z),lz(i,`compositionstart`,a),lz(i,`compositionend`,o)),v&&uz(lz(i,`click`,re,!0),lz(i,`pointerdown`,re,!0),lz(i,`pointerup`,ie,!0),lz(i,`pointercancel`,ie,!0),lz(i,`mousedown`,re,!0),lz(i,`mouseup`,ie,!0),lz(i,`touchstart`,ne,{capture:!0,passive:!0}),lz(i,`touchmove`,oe,{capture:!0,passive:!0}),lz(i,`touchend`,ce,{capture:!0,passive:!0})));return()=>{le(),t.clear(),c(),T.current=!1}},[p,u,r,v,_,l,n,b,x,z,F,y,I,L,h,e,M,P]);let ne=W.useMemo(()=>({onKeyDown:z,onPointerDown:R,onClick:R}),[z,R]),re=W.useMemo(()=>({onKeyDown:z,onPointerDown:te,onMouseDown:te,onClickCapture:B,onMouseDownCapture(e){B(),ee(e)},onPointerDownCapture(e){B(),ee(e)},onMouseUpCapture:B,onTouchEndCapture:B,onTouchMoveCapture:B}),[z,B,ee,te]);return W.useMemo(()=>n?{reference:ne,floating:re,trigger:ne}:{},[n,ne,re])}function GB(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),Q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};S(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function KB(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=Z(i),{mounted:c,setMounted:l,transitionStatus:u}=FF(t,!1,!1,o),d=!t&&r;Q(()=>{t&&s(!1)},[t,s]);let f=W.useRef(c),p=W.useRef(!1),m=cR(),h=()=>{f.current=!1,l(!1),a()};Q(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=Z(()=>{f.current&&(t?(p.current=!0,m()):h())});return jF({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var qB={tabIndex:-1,[zR]:``};function JB(e){return t=>t!==`touch`||e.current}function YB(e,t=!1){let n=fR(),r=wB()!=null,i=wP(()=>e(n,r)).current;return GB({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function XB({handle:e,store:t}){return Q(()=>e.attachStore(t),[e,t]),null}function ZB(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function QB(e,t){let n=W.useRef(null);return Z(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),ZB(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),ZB(t))})}function $B(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function eV(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function tV(e,t,n,r={}){let i=n.reason,a=i===_L,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=eV(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=$B(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Zf.flushSync(l):l()}function nV(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=QB(e,n),o=Z(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Z(e=>{a(e),e&&o(e)});return Q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function rV(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=W.useRef(null),i=e.useState(`open`);Q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=_R(hL);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function iV(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=KB({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return wP(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function aV(e,t){e.useSyncedValues(t),Q(()=>()=>{e.update({activeTriggerProps:LP,inactiveTriggerProps:LP,popupProps:LP})},[e])}function oV(e,t){Q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),Q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var sV=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},cV=[],lV=void 0;function uV(){return lV}function dV(e){cV.push(e)}function fV(e){let t=(t,n)=>{let r=wP(mV).current,i;try{lV=r;for(let e of cV)e.before(r);i=e(t,n);for(let e of cV)e.after(r);r.didInitialize=!0}finally{lV=void 0}return i};return t.displayName=e.displayName||e.name,t}function pV(e){return W.forwardRef(fV(e))}function mV(){return{didInitialize:!1}}var hV=Ft(),gV=Tt(),_V=MP(19)?bV:xV;function vV(e,t,n,r,i){return _V(e,t,n,r,i)}function yV(e,t,n,r,i){let a=W.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,hV.useSyncExternalStore)(e.subscribe,a,a)}dV({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,hV.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function bV(e,t,n,r,i){let a=uV();if(!a)return yV(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function xV(e,t,n,r,i){return(0,gV.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var SV=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return vV(this,e,t,n,r)}},CV=class extends SV{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){W.useDebugValue(e);let n=this;Q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){W.useDebugValue(e);let n=this,r=t!==void 0;Q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return W.useDebugValue(e),vV(this,this.selectors[e],t,n,r)}useContextCallback(e,t){W.useDebugValue(e);let n=Z(t??FP);this.context[e]=n}useStateSetter(e){let t=W.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},wV={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},TV=class extends CV{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:bB(),nested:n,triggerElements:i},wV),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&PR(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function EV(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new TV({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:LP,inactiveTriggerProps:LP,popupProps:LP}}var DV=e=>e.triggerIdProp??e.activeTriggerId,OV=e=>e.openProp??e.open,kV=e=>(e.popupElement?.id??e.floatingId)||void 0;function AV(e,t){return t!==void 0&&OV(e)&&DV(e)===t}function jV(e,t){return AV(e,t)?!0:t!==void 0&&OV(e)&&DV(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var MV={open:OV,mounted:e=>e.mounted,transitionStatus:e=>OV(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:DV,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:kV,isTriggerActive:(e,t)=>t!==void 0&&DV(e)===t,isOpenedByTrigger:(e,t)=>AV(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&DV(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>jV(e,t)?kV(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function NV(e){let t=W.useCallback(t=>e===void 0?FP:e.subscribeStore(t),[e]),n=W.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,hV.useSyncExternalStore)(t,n,()=>e?.serverStore)}function PV(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=fR(),a=wB()!=null,o=wP(()=>new TV({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new sV,floatingId:i,syncOnly:!1,nested:a})).current;return Q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=S(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var FV=XL&&QL;function IV(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=W.useRef(!1),s=W.useRef(null),c=W.useRef(!0),l=VF();W.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=oe(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&d(t)&&t===FR(UI(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return uz(lz(r,`blur`,i),FV&&lz(r,`keydown`,a,!0),FV&&lz(r,`pointerdown`,l,!0))},[e,n]),W.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);S(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=W.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=RR(n.nativeEvent);if(S(a)){if(FV&&!n.relatedTarget){if(!c.current&&!YR(a))return}else if(!QR(a))return}let u=KR(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,_R(vL,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,_R(vL,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=S(r)&&r.hasAttribute(Xz(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=FR(UI(t));!r&&n===t||IR(a.current.floatingContext?.refs.floating.current,n)||IR(t,n)||o||KR(r??n,e.context.triggerElements)||e.setOpen(!1,_R(vL,i))})}}},[a,r,e,l]);return W.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var LV=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new BF;restTimeout=new BF;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},RV=new WeakMap;function zV(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&RV.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),RV.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function BV(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=RV.get(n);a&&a!==e&&zV(a),zV(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,RV.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function VV(e){let t=e.context.dataRef.current,n=wP(()=>t.hoverInteractionState??LV.create()).current;return t.hoverInteractionState||=n,yF(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function HV(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=TB(),u=wB(),d=VV(e),f=VF(),p=Z(()=>rz(c.current.openEvent?.type,d.interactedInside)),m=Z(()=>iz(c.current.openEvent?.type)),h=Z(()=>{zV(d)});Q(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),W.useEffect(()=>h,[h]),Q(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&S(s)&&o){let e=s,t=o,n=UI(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??LR(e,`[data-rootownerid]`)??n.body;return BV(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),W.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Jz(l.nodesRef.current,u).length>0)}function a(t){let n=tz(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,_R(_L,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=RR(e);XR(t)?d.interactedInside=LR(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(KR(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&S(o)&&Jz(l.nodesRef.current,r,!1).some(e=>IR(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,_R(_L,n)),l.events.emit(`floating.closed`,n)})}let y=o;return uz(y&&lz(y,`mouseenter`,g),y&&lz(y,`mouseleave`,_),y&&lz(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var UV={current:null};function WV(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=UV,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=TB(l),v=VV(e),y=W.useRef(!1),b=dz(i),x=dz(r),C=dz(o),w=dz(n),T=dz(p),E=dz(f),D=Z(()=>rz(h.current.openEvent?.type,v.interactedInside)),O=Z(()=>T.current?.()!==!1),k=Z((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!IR(t,n);if(!S(r))return!1;let a=r;return i.hasMatchingElement(e=>IR(e,a))&&(!t||!IR(t,a))}),A=Z(()=>{v.handler&&=(UI(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),j=Z(()=>{zV(v)});return u&&(v.handleCloseOptions=i?.__options),W.useEffect(()=>A,[A]),W.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===_L,A(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,A]),W.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=tz(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,_R(_L,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,_R(_L,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!S(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!NR(v.pointerType))return;let n=nz(C.current),r=tz(x.current,`open`,v.pointerType),i=RR(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(S(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(IR(t,i)){c=t;break}}S(o)&&S(s)&&!e.context.triggerElements.hasElement(o)&&IR(o,s)&&(c=s);let l=c!=null&&k(s,c,i),u=e.select(`open`),d=E.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&S(c)&&S(s)&&IR(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?O()&&e.setOpen(!0,_R(_L,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&O()&&e.setOpen(!0,_R(_L,t,c))}):g&&O()&&e.setOpen(!0,_R(_L,t,c)))}function o(n){if(D()){j();return}A();let r=UI(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!KR(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){j(),A(),w.current&&!D()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else v.pointerType===`touch`&&IR(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){IR(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?lz(r,`mouseout`,l):void 0;return s?uz(lz(r,`mousemove`,i,{once:!0}),lz(r,`mouseenter`,i),lz(r,`mouseleave`,o),f):uz(lz(r,`mouseenter`,i),lz(r,`mouseleave`,o),f)},[A,j,h,x,e,n,b,v,u,k,D,a,s,C,c,_,w,d,E,O,m]),W.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=k(i,r,t.target);if(a&&!NR(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;BV(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=nz(C.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,D())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&O()&&e.setOpen(!0,_R(_L,n,r))}v.pointerType===`touch`?Zf.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,D,k,a,e,C,O])}function GV(e){return QL&&e.movementX===0&&e.movementY===0}function KV(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function qV(e,t){return KV(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function JV(e,t,n){return KV(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function YV(e,t,n){return KV(t,n?e===VR:e===HR,e===WR)}function XV(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:KV(t,n?e===HR:e===VR,e===UR)}function ZV(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:f=!1,focusItemOnOpen:p=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=$R(D),j=ZR(O),M=dz(A),N=wB(),P=TB(S),F=W.useRef(p),I=W.useRef(o??-1),L=W.useRef(null),R=W.useRef(!0),z=Z(e=>{i(I.current===-1?null:I.current,e)}),B=W.useRef(!!D),ee=W.useRef(E),te=W.useRef(!1),ne=W.useRef(!1),re=W.useRef(null),ie=dz(g),ae=dz(E),V=dz(o),oe=dz(x),se=CF(),ce=CF(),le=Z(()=>{se.cancel();function e(e){f||(re.current=Qz(e,{sync:te.current,preventScroll:!0}))}let t=n.current[I.current],r=ne.current;t&&e(t),(te.current?e=>e():e=>se.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),he&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Q(()=>{k.current.orientation=_},[k,_]),Q(()=>{E||(L.current=null),E&&p===`auto`||(F.current=p)},[E,p]),Q(()=>{a&&(E&&D?(I.current=o??-1,F.current&&o!=null&&(ne.current=!0,z())):B.current&&(I.current=-1,z()))},[a,E,D,o,z]),Q(()=>{if(a){if(!E)te.current=!1;else if(D){if(r==null){if(te.current=!1,V.current!=null)return;if(B.current&&(I.current=-1,le()),(!ee.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ce.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||JV(L.current,v,u)||l?vz(n):yz(n),L.current=null,z())};t()}}else _z(n.current,r)||(I.current=r,le(),ne.current=!1)}}},[a,E,D,r,V,l,n,v,u,z,le,ce]),Q(()=>{if(!a||D||!P||f||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=FR(UI(O??t??null)),r=e.some(e=>e.context&&IR(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,O,P,N,f]),Q(()=>{ee.current=E,B.current=!!D});let ue=r!=null,de=Z(e=>{if(!ae.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),fe=Z(()=>y??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),pe=Z(()=>vz(n,ie.current)),me=Z(t=>{if(R.current=!1,te.current=!0,t.which===229||!ae.current&&t.currentTarget===M.current)return;if(l&&XV(t.key,_,u,T)){qV(t.key,fe())||kR(t),e.setOpen(!1,_R(CL,t.nativeEvent));let n=C?.current??O;d(n)&&n.focus();return}r!=null&&r!==I.current&&!_z(n.current,r)&&(I.current=r);let i=I.current,a=vz(n,g),o=yz(n,g);if(j||(t.key===`Home`&&(kR(t),I.current=a,z(t)),t.key===`End`&&(kR(t),I.current=o,z(t))),w!=null){let e=w(t,I.current,n,_,c,u,g,a,o);if(e!=null&&e!==I.current&&(I.current=e,z(t)),_===`both`)return}if(qV(t.key,_)){kR(t);let e=FR(t.currentTarget.ownerDocument);if(E&&!f&&IR(t.currentTarget,e)&&!n.current.some(t=>t!=null&&IR(t,e))){I.current=JV(t.key,_,u)?a:o,z(t),r===I.current&&le();return}let{index:l,wrapped:d}=bz(n.current,i,{decrement:!JV(t.key,_,u),loopFocus:c,allowEscape:s,disabledIndices:g,minIndex:a,maxIndex:o});d&&(te.current=!1),I.current=l,z(t)}}),he=W.useMemo(()=>({onFocus(e){te.current=!0,de(e)},onClick({currentTarget:e}){f||e.focus({preventScroll:!0})},onMouseMove(e){GV(e)||(te.current=!0,ne.current=!1,m&&de(e))},onPointerLeave(e){if(!ae.current||!R.current||e.pointerType===`touch`)return;te.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&oe.current&&(re.current?.(),re.current=null,I.current=-1,z(e),!f)){let e=M.current,t=FR(UI(e));e&&IR(e,t)&&e.focus({preventScroll:!0})}}}),[de,ae,M,m,n,z,oe,f]),ge=W.useMemo(()=>f&&E&&ue&&{"aria-activedescendant":`${b}-${r}`},[f,E,ue,b,r]),_e=W.useMemo(()=>({...j?{}:ge,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!f){let n=RR(t.nativeEvent);if(n&&!IR(M.current,n))return;kR(t);let r=_R(xL,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&d(i)&&i.focus()}else me(t)},onPointerMove(e){GV(e)||(R.current=!0)}}),[ge,me,M,j,e,E,f,O,C]),ve=W.useMemo(()=>{function t(t){e.setOpen(!0,_R(CL,t.nativeEvent,t.currentTarget))}function n(e){p===`auto`&&jR(e.nativeEvent)&&(F.current=!f)}function r(e){F.current=p,p===`auto`&&MR(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(n){let r=e.select(`open`);R.current=!1;let i=n.key.startsWith(`Arrow`),a=YV(n.key,fe(),u),o=qV(n.key,r?_:v),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(f&&r&&(!l||YR(n.currentTarget)))return me(n);if(r||h||!i){if(s){let e=qV(n.key,fe());L.current=l&&e?null:n.key}l?a&&(kR(n),r?(I.current=pe(),z(n),f&&M.current?.focus()):t(n)):o&&(V.current!=null&&(I.current=V.current),kR(n),!r&&h?t(n):me(n),r&&z(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!f&&(I.current=-1,z(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[me,p,pe,l,z,e,h,_,v,fe,u,V,f,M]),ye=W.useMemo(()=>({...ge,...ve}),[ge,ve]);return W.useMemo(()=>a?{reference:ye,floating:_e,item:he,trigger:ve}:{},[a,ye,_e,ve,he])}function QV(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=Z(s),f=e.useState(`open`),p=VF(),m=W.useRef(``),h=W.useRef(u??i??-1),g=W.useRef(null),_=Z(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!wz(n)||n?.matches(`:disabled`)?!1:o==null||!Sz(IP,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(kR(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(kR(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=Z(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);IR(r,n)||IR(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});Q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=W.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return W.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var $V=.1,eH=$V*$V,tH=.5;function nH(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function rH(e,t,n,r,i,a,o,s,c,l){let u=!1;return nH(e,t,n,r,i,a)&&(u=!u),nH(e,t,i,a,o,s)&&(u=!u),nH(e,t,o,s,c,l)&&(u=!u),nH(e,t,c,l,n,r)&&(u=!u),u}function iH(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function aH(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function oH(e={}){let{blockPointerEvents:t=!1}=e,n=new BF,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*eH;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=RR(r),g=r.type===`mouseleave`,_=IR(u,h),v=IR(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&S(r.relatedTarget)&&IR(u,r.relatedTarget))return;function y(){return!!(s&&Jz(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),C=u.getBoundingClientRect(),w=e>C.right-C.width/2,T=t>C.bottom-C.height/2,E=C.width>x.width,D=C.height>x.height,O=(E?x:C).left,k=(E?x:C).right,A=(D?x:C).top,j=(D?x:C).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let M=!1;switch(c){case`top`:M=aH(d,f,O,x.top+1,k,C.bottom-1);break;case`bottom`:M=aH(d,f,O,C.top+1,k,x.bottom-1);break;case`left`:M=aH(d,f,C.right-1,j,x.left+1,A);break;case`right`:M=aH(d,f,x.right-1,j,C.left+1,A)}if(M)return;if(l&&!iH(d,f,x)||!g&&p(d,f)){b();return}let N=!1;switch(c){case`top`:{let n=E?tH/2:tH*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t+tH+1,o=w||E?C.bottom-tH:C.top,s=w?E?C.bottom-tH:C.top:C.bottom-tH;N=rH(d,f,r,a,i,a,C.left,o,C.right,s);break}case`bottom`:{let n=E?tH/2:tH*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t-tH,o=w||E?C.top+tH:C.bottom,s=w?E?C.top+tH:C.bottom:C.top+tH;N=rH(d,f,r,a,i,a,C.left,o,C.right,s);break}case`left`:{let n=D?tH/2:tH*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e+tH+1,o=T||D?C.right-tH:C.left,s=T?D?C.right-tH:C.left:C.right-tH;N=rH(d,f,o,C.top,s,C.bottom,a,r,a,i);break}case`right`:{let n=D?tH/2:tH*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e-tH,o=T||D?C.left+tH:C.right,s=T?D?C.left+tH:C.right:C.left+tH;N=rH(d,f,a,r,a,i,o,C.top,s,C.bottom);break}}N?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var sH=W.createContext(void 0);function cH(e){let t=W.useContext(sH);if(t===void 0&&!e)throw Error(lF(69));return t}var lH=`ArrowUp`,uH=`ArrowDown`,dH=`ArrowLeft`,fH=`ArrowRight`,pH=new Set([lH,uH,dH,fH,`Home`,`End`]),mH=[`Shift`,`Control`,`Alt`,`Meta`];function hH(e){return d(e)&&e.tagName===`INPUT`}function gH(e){return!!(hH(e)&&e.selectionStart!=null||d(e)&&e.tagName===`TEXTAREA`)}function _H(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=vH(e,t,`left`),a=yH(e),o=yH(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=vH(e,t,`top`),r=yH(e),i=yH(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function vH(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function yH(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function bH(e){return e===`starting`?uB:LP}var xH=W.createContext(void 0);function SH(){return W.useContext(xH)}function CH(e,t){let n=aF(e.render);if(W.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function wH(e,t,n){let r=CH(e,t),i=r===t?void 0:r;return[r,W.useCallback(e=>n?.(e?i:void 0),[i,n])]}function TH(e,t,n){let r=aF(e.render),i=W.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var EH=W.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=QI(),m=SH(),{side:h,align:g}=XI(),_=cH(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,I]=wH(e,u,d),L=TH(e,C,N),R=w.type===`menu`?m:void 0,z=w.type===`context-menu`,B=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(B=()=>l.state.activeIndex===null&&P),jF({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),W.useEffect(()=>{function e(e){l.setOpen(!1,_R(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),HV(D,{enabled:A&&!j&&!z&&w.type!==`menubar`,closeDelay:k});let ee=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:te,handleFocus:ne}=(W.useContext(PL)?.useParentHandoff??OH)(l,w,v,f),re=tF(`div`,e,{state:{transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},ref:[t,l.context.popupRef,ee,I],stateAttributesMapping:fL,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){R?.onPopupKeyDown?.(e),_&&pH.has(e.key)&&e.stopPropagation()},onFocus:ne},bH(y),c,{"data-rootownerid":E}]}),ie=w.type===void 0||z;(C||w.type===`menubar`&&T!==`outside-press`)&&(ie=!0);let ae=R?.getReturnElement??te;return(0,G.jsx)(LB,{context:D,openInteractionType:M,modal:z,disabled:!x,returnFocus:a??ae??ie,explicitReturnFocus:a===void 0&&ae?!1:void 0,initialFocus:B,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:re})}),DH={parentVirtualFocusRef:void 0,handleFocus:void 0};function OH(){return DH}var kH=W.forwardRef(function(e,t){let n=FL()?.Popup??EH;return(0,G.jsx)(n,{...e,ref:t})}),AH=W.createContext(void 0);function jH(){let e=W.useContext(AH);if(e===void 0)throw Error(lF(32));return e}var MH=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=QI();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,G.jsx)(AH.Provider,{value:n,children:(0,G.jsx)(yB,{ref:t,...r,portalOwnerRole:o})})});function NH(e){return MP(19)?e:e?`true`:void 0}function PH(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=W.useState(null),d=W.useRef(null),f=TB(n),p=W.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=z({...e,elements:{...p,...l&&{reference:l}}}),h=W.useCallback(e=>{let t=S(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=W.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=W.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=W.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return Q(()=>{o&&(d.current=o)},[o]),Q(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),W.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var FH=W.createContext(void 0);function IH(){return W.useContext(FH)?.direction??`ltr`}var LH=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:d=0}=u(e,t)||{};if(l==null)return{};let f=x(d),p={x:n,y:r},m=v(i),h=y(m),g=await o.getDimensions(l),_=m===`y`,b=_?`top`:`left`,S=_?`bottom`:`right`,C=_?`clientHeight`:`clientWidth`,w=a.reference[h]+a.reference[m]-p[m]-a.floating[h],T=p[m]-a.reference[m],E=s.floating[C]||a.floating[h],D=w/2-T/2,O=E/2-g[h]/2-1,k=Math.min(f[b],O),A=Math.min(f[S],O),j=k,M=E-g[h]-A,N=E/2-g[h]/2+D,P=L(j,N,M),F=!c.arrow&&I(i)!=null&&N!==P&&a.reference[h]/2-(N<j?k:A)-g[h]/2<0,R=F?N<j?N-j:N-M:0;return{[m]:p[m]+R,data:{[m]:P,centerOffset:N-P-R,...F&&{alignmentOffset:R}},reset:F}}}),RH=(e,t)=>{let{name:n,fn:r}=LH(e);return{name:n,fn:r,options:[e,t]}},zH={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},BH={sideX:`left`,sideY:`top`},VH=`--available-width`,HH=`--available-height`,UH=`--anchor-width`,WH=`--anchor-height`,GH=`--transform-origin`,KH=VH,qH=HH;function JH(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function YH(e,t,n){let{rects:r,placement:i}=e;return{side:JH(t,h(i),n),align:I(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function XH(e){return ZH(e,PH)}function ZH(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:_,mounted:v,collisionAvoidance:y,shift:b,nodeId:x,adaptiveOrigin:S,lazyFlip:C=!1,externalTree:w}=e,T=y.side||`flip`,E=y.align||`flip`,D=y.fallbackAxisSide||`end`,O=b?.crossAxis??!1,k=b?.rootBoundary,M=typeof n==`function`?n:void 0,N=Z(M),F=M?N:n,L=dz(n),R=dz(v),z=IH()===`rtl`,[B,re]=W.useState(null);!v&&B!==null&&re(null);let ie=C===`placement`,ae=B?h(B):null,V=B&&ie?I(B)||`center`:null,se=ae||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":z?`left`:`right`,"inline-start":z?`right`:`left`}[i],ce=V||o,le=ce===`center`?se:`${se}-${ce}`,ue=l;typeof ue==`number`?ue={top:ue,right:ue,bottom:ue,left:ue}:ue&&={top:ue.top||0,right:ue.right||0,bottom:ue.bottom||0,left:ue.left||0};let de=+(i===`bottom`),fe=+(i===`top`),pe=+(i===`right`),me=+(i===`left`),he={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:ue},ge=W.useRef(null),_e=dz(a),ve=dz(s),ye=typeof a==`function`?0:a,be=typeof s==`function`?0:s,xe=[];p&&xe.push(p),xe.push(A(e=>{let t=YH(e,i,z),n=typeof _e.current==`function`?_e.current(t):_e.current,r=typeof ve.current==`function`?ve.current(t):ve.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[ye,be,z,i]));let Se=E===`none`&&T!==`shift`,Ce=!Se&&(u||O||T===`shift`),we=T===`none`?null:te({...he,padding:{top:ue.top+1+de,right:ue.right+1+me,bottom:ue.bottom+1+fe,left:ue.left+1+pe},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),Te=Se?null:j({...he,rootBoundary:k,mainAxis:E!==`none`,crossAxis:Ce,limiter:u||O?void 0:ne(e=>{if(!ge.current)return{};let{width:t,height:n}=ge.current.getBoundingClientRect(),r=g(h(e.placement)),i=r===`y`?t:n,a=r===`y`?ue.left+ue.right:ue.top+ue.bottom;return{offset:i/2+a/2}})},[he,u,O,k,ue,E]);T===`shift`||E===`shift`||ce===`center`?xe.push(Te,we):xe.push(we,Te),xe.push(ee({...he,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!R.current)return;let i=e.style;i.setProperty(KH,`${t}px`),i.setProperty(qH,`${n}px`);let a=oe(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(UH,`${u}px`),i.setProperty(WH,`${d}px`)}}),RH(e=>({element:ge.current||UI(e.elements.floating).createElement(`div`),padding:ge.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=h(r),u=I(r),d=g(l)===`y`,f=ge.current,p=typeof a==`function`?a(YH(e,i,z)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let _=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return Ce&&d&&Math.abs(n.shift?.y||0)>p&&(_=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(GH,d?`${m} ${_}`:`${_} ${m}`),{}}},zH,S),Q(()=>{!v&&_&&_.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,_]);let H=W.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:Ee,elements:De,x:Oe,y:ke,middlewareData:Ae,update:je,placement:Me,context:Ne,isPositioned:Pe,floatingStyles:Fe}=t({rootContext:_,open:m?v:void 0,placement:le,middleware:xe,strategy:r,whileElementsMounted:m?void 0:(...e)=>P(...e,H),nodeId:x,externalTree:w}),{sideX:Ie,sideY:Le}=Ae.adaptiveOrigin||BH,Re=Pe?r:`fixed`,ze=W.useMemo(()=>{let e;return e=Pe?S?{position:Re,[Ie]:Oe,[Le]:ke}:{...Fe,position:Re}:{position:Re,top:0,left:0},e[KH]=`100vw`,e[qH]=`100vh`,Pe||(e.opacity=0),e},[S,Re,Ie,Oe,Le,ke,Fe,Pe]),Be=W.useRef(null);Q(()=>{if(!v)return;let e=L.current,t=typeof e==`function`?e():e,n=(QH(t)?t.current:t)||null;n!==Be.current&&(Ee.setPositionReference(n),Be.current=n)},[v,Ee,F,L]),W.useEffect(()=>{if(!v)return;let e=L.current;typeof e!=`function`&&QH(e)&&e.current!==Be.current&&(Ee.setPositionReference(e.current),Be.current=e.current)},[v,Ee,F,L]),W.useEffect(()=>{if(m&&v&&De.reference&&De.floating)return P(De.reference,De.floating,je,H)},[m,v,De,je,H]);let Ve=h(Me),He=JH(i,Ve,z),Ue=I(Me)||`center`,We=!!Ae.hide?.referenceHidden;Q(()=>{C&&v&&Pe&&(Ve!==se||ie&&Ue!==ce)&&re(Me)},[C,ie,v,Pe,Me,Ve,Ue,se,ce]);let Ge=W.useMemo(()=>({position:`absolute`,top:Ae.arrow?.y,left:Ae.arrow?.x}),[Ae.arrow]),Ke=Ae.arrow?.centerOffset!==0;return W.useMemo(()=>({positionerStyles:ze,arrowStyles:Ge,arrowRef:ge,arrowUncentered:Ke,side:He,align:Ue,physicalSide:Ve,anchorHidden:We,refs:Ee,context:Ne,isPositioned:Pe,update:je}),[ze,Ge,ge,Ke,He,Ue,Ve,We,Ee,Ne,Pe,je])}function QH(e){return e!=null&&`current`in e}function $H(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=Z(i),[,o]=W.useState(0),s=wP(tU).current,c=wP(eU).current,l=W.useRef(0),u=W.useRef(!0),d=W.useRef(null),f=W.useRef(null),p=Z(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=Z((e,t)=>{c.set(e,t),p()}),h=Z(e=>{c.delete(e),p()}),g=Z(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!iU(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&aU(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=rU(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=Z(()=>{let[e,t]=nU(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Q(()=>{u.current&&v()}),Q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=Z(e=>(s.add(e),()=>{s.delete(e)})),b=W.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,G.jsx)(aR.Provider,{value:b,children:t})}function eU(){return new Map}function tU(){return new Set}function nU(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>aU(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function rU(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function iU(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function aU(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var oU=W.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,G.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function sU(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=W.useRef(null),o=W.useRef(null),s=AF(r);Q(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),Q(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}function cU(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),tF(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},bH(r),i],stateAttributesMapping:dL})}var lU={},uU={},dU=``;function fU(e,t){return p(e)?e:t}function pU(e,t,n){return/hidden|clip/.test(e.getComputedStyle(fU(t,n)).overflowY)}function mU(e){if(typeof document>`u`)return!1;let t=UI(e);return oe(t).innerWidth-t.documentElement.clientWidth>0}function hU(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=UI(e),n=t.documentElement,r=t.body,i=fU(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function gU(e){let t=UI(e),n=t.documentElement,r=t.body,i=fU(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function _U(e){let t=UI(e),n=t.documentElement,r=t.body,i=oe(n),a=0,o=0,s=!1,c=SF.create();if(QL&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,lU={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},dU=n.style.scrollBehavior,uU={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=fU(n,r);s=hU(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,lU),Object.assign(r.style,uU),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=dU)}function d(){u(),c.request(l)}l();let f=lz(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var vU=new class{lockCount=0;restore=null;timeoutLock=BF.create();timeoutUnlock=BF.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=UI(e),n=t.documentElement,r=t.body,i=oe(n);if(pU(i,n,r)){let t=new i.MutationObserver(()=>{pU(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=qL||!mU(e);this.restore=a?gU(e):_U(e)}};function yU(e=!0,t=null){Q(()=>{if(e)return vU.acquire(t)},[e,t])}var bU=20;function xU(e,t,n,r){let[i,a]=W.useState(!1);Q(()=>{if(!e||!t||n==null){a(!1);return}let r=UI(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-bU)},[e,t,n]),yU(e&&(!t||i),r)}var SU=W.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=fB,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=QI(),x=jH(),S=mL(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=w.useState(`domReferenceElement`),z=n,B=c,ee=l,te=s,ne=h;C.type===`context-menu`&&(z=n??C.context?.anchor,te??=`start`,!o&&te!==`center`&&(ee=e.alignOffset??2,B=e.sideOffset??-5));let re=o,ie=te;C.type===`menu`?(re??=`inline-end`,ie??=`start`,ne=e.collisionAvoidance??pB):C.type===`menubar`&&(re??=C.context.orientation===`vertical`?`inline-end`:`bottom`,ie??=`start`);let ae=C.type===`context-menu`,V=XH({anchor:z,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:re,sideOffset:B,align:ie,alignOffset:ee,arrowPadding:ae?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:ne,shift:ae?{crossAxis:!(`side`in ne&&ne.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});W.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,_R(DL)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,I]),W.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,_R(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let oe=VF();W.useEffect(()=>{D||oe.clear()},[D,oe]),W.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?oe.isStarted()||oe.start(e,()=>{v.setOpen(!1,_R(DL))}):v.setOpen(!1,_R(DL))}else oe.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,oe]),W.useEffect(()=>{let e={open:D,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,I,L]),sU({store:v,domReference:R,positionerElement:M,open:D});let se={open:D,side:V.side,align:V.align,anchorHidden:V.anchorHidden,nested:C.type===`menu`,instant:N},ce=C.type===`menubar`&&C.context.modal;xU(D&&(ce||O&&F!==`trigger-hover`),k===`touch`,M,A);let le=cU(e,se,{styles:V.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),ue=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),de=null;return C.type===`menubar`?de=C.context.contentElement:C.type===void 0&&(de=A),(0,G.jsxs)(YI.Provider,{value:V,children:[ue&&(0,G.jsx)(oU,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:NH(!D),cutout:de}),(0,G.jsx)(DB,{id:I,children:(0,G.jsx)($H,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:le})})]})}),CU=W.createContext(null);function wU(e){let t=W.useContext(CU);if(t===null&&!e)throw Error(lF(5));return t}function TU(e){let t=W.useRef(``),n=W.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:W.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function EU(e,t){let n=W.useRef(e),r=Z(t);Q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function DU(e,t){let{onClick:n,onPointerDown:r}=TU(Z((n,r)=>{(typeof e==`function`?e():e)||t(r||(qL?`touch`:``))}));return W.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function OU(e){let[t,n]=W.useState(null),r=DU(e,n);return EU(e,t=>{t&&!e&&n(null)}),W.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function kU(e){return e==null?hL:e.type.startsWith(`key`)?wL:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?TL:hL}var AU={...MV,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=MV.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>QL&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!MV.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},jU=class extends CV{constructor(e,t,n=!1){let r=new sV,i=NU(r,t,n,e);super(i,MU(r),AU),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function MU(e){return{positionerRef:W.createRef(),popupRef:W.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:W.createRef(),beforeTriggerFocusGuardRef:W.createRef(),beforeContentFocusGuardRef:W.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function NU(e,t,n=!1,r){return{...EV(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:LP,inputProps:LP,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new xB,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:LP,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var PU=W.createContext(null);function FU(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function IU(e,t){return e===`list-navigation`||FU(e,t)}var LU=fV(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:b=!0,resetOnPointerLeave:x=!0}=e,S=mL(!0),C=QI(!0),w=wU(!0),T=C?.store,E=C?.virtualFocus??!1,D=W.useMemo(()=>_&&T?{type:`menu`,store:T}:w?{type:`menubar`,context:w}:S&&!T?{type:`context-menu`,context:S}:{type:void 0},[S,T,w,_]),O=pR(),k=pR(),[A,j]=W.useState(void 0),M=(A??k)||void 0,N=wB(),P=D.type===`menu`?D.store:void 0,F=(n??o)&&P?.state.transitionStatus===`starting`,I=wP(()=>F?P?.state.instantType:void 0).current,L=wP(()=>{let e=new jU({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:D,disabled:s,highlightItemOnHover:g,modal:D.type===void 0?c:void 0,rootId:O,instantType:I},M,N!=null);return e.context.virtualFocusRef=y,e}).current;L.useControlledProp(`openProp`,n),L.useControlledProp(`triggerIdProp`,m),L.useContextCallback(`onOpenChangeComplete`,i);let R=L.useState(`floatingTreeRoot`),z=EB(R),B=L.useState(`open`),ee=L.useState(`activeTriggerElement`),te=L.useState(`positionerElement`),ne=L.useState(`hoverEnabled`),re=L.useState(`disabled`),ie=L.useState(`lastOpenChangeReason`),ae=L.useState(`parent`),V=L.useState(`activeIndex`),oe=L.useState(`keyboardOpen`),se=L.useState(`payload`),ce=L.useState(`floatingParentNodeId`),le=W.useRef(null),ue=W.useRef(ae.type!==`context-menu`),de=VF(),fe=W.useRef(!0),pe=VF(),me=ce!=null,{openMethod:he,triggerProps:ge}=OU(B);L.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:ae.type===void 0?c:void 0,openMethod:he,rootId:O}),rV(L);let{forceUnmount:_e,transitionStatus:ve}=iV(B,L,()=>{L.set(`allowMouseEnter`,!1)},F),ye=AF(L.context.popupRef);W.useEffect(()=>{if(I===void 0)return;let e=()=>{L.state.instantType===I&&L.set(`instantType`,void 0)};if(!B){e();return}if(ve!==void 0)return;if(L.context.popupRef.current==null){e();return}let t=new AbortController;return ye(e,t.signal),()=>{t.abort()}},[I,B,ve,ye,L]),Q(()=>{S&&!C?L.update({parent:{type:`context-menu`,context:S},floatingNodeId:z,floatingParentNodeId:N}):(C||!L.select(`activeTriggerElement`))&&L.update({floatingNodeId:z,floatingParentNodeId:N})},[S,C,z,N,ee,L]),W.useEffect(()=>{B||(le.current=null),ae.type===`context-menu`&&(B?de.start(500,()=>{ue.current=!0}):(de.clear(),ue.current=!1))},[de,B,ae.type]),Q(()=>{!B&&!ne&&L.set(`hoverEnabled`,!0)},[B,ne,L]);let be=Z((e,t)=>{let n=t.reason;if(!e&&!L.select(`open`)||B===e&&t.trigger===ee&&ie===n)return;let i=eV(t);if(!e&&t.trigger==null&&(t.trigger=ee??void 0),r?.(e,t),t.isCanceled)return;L.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!fe.current)return;e&&n===`trigger-focus`?(fe.current=!1,pe.start(300,()=>{fe.current=!0})):(fe.current=!0,pe.clear());let o=!e&&(n===`escape-key`||n==null);le.current=t.event;let s=$B(L.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&IU(n,a),s.instantType=ae.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:FU(n,a)?`click`:o?`dismiss`:void 0,L.update(s)}),xe=GB({popupStore:L,floatingRootContext:L.state.floatingRootContext,floatingId:M,nested:N!=null,onOpenChange:be}),Se=xe.context.events;Q(()=>{let e=({open:e,eventDetails:t})=>be(e,t);return Se.on(`setOpen`,e),()=>{Se?.off(`setOpen`,e)}},[Se,be]),Q(()=>L.subscribeToParentMenu(),[L]);let Ce=W.useCallback(()=>{L.setOpen(!1,_R(jL))},[L]);W.useImperativeHandle(d,()=>({unmount:_e,close:Ce}),[_e,Ce]);let we;ae.type===`context-menu`&&(we=ae.context),W.useImperativeHandle(we?.positionerRef,()=>te,[te]),W.useImperativeHandle(we?.actionsRef,()=>({setOpen:be}),[be]);let Te=WB(xe,{enabled:!re,bubbles:{escapeKey:f&&ae.type===`menu`},outsidePress(){return ae.type!==`context-menu`||le.current?.type===`contextmenu`||ue.current},externalTree:me?R:void 0}),H=IH(),Ee=ZV(xe,{enabled:!re,listRef:L.context.itemDomElements,activeIndex:V,virtual:v,nested:ae.type===`menubar`||!v&&ae.type!==void 0,parentOrientation:ae.type===`menubar`?ae.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?oe:void 0,allowEscape:v&&l&&b,orientation:u,triggerOrientation:v?`vertical`:u,rtl:H===`rtl`,disabledIndices:IP,onNavigate(e,t){L.setActiveIndex(e,kU(t),t?.nativeEvent)},openOnArrowKeyDown:ae.type!==`context-menu`&&!(v&&_),externalTree:!v&&me?R:void 0,nestedReturnFocusRef:P?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:x}),De=W.useCallback(e=>{L.context.typingRef.current=e},[L]),Oe=QV(xe,{enabled:!re&&!v,listRef:L.context.itemLabels,elementsRef:L.context.itemDomElements,activeIndex:V,resetMs:500,onMatch:(e,t)=>{B&&e!==V&&L.setActiveIndex(e,wL,t.nativeEvent)},onTyping:De}),ke=Z(a),Ae=W.useRef(-1),je=Z(()=>{let e=L.state.activeIndex,t=e===null?void 0:L.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ae.current===n&&L.context.reportedItem===t)return;Ae.current=n,L.context.reportedItem=t,v&&L.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=L.context;L.context.highlightReason=hL,L.context.highlightEvent=void 0,a&&ke(t,vR(r,i,{label:t===void 0?void 0:L.context.itemLabels.current[n]??void 0}))});Q(()=>{je()},[V,je]);let Me=W.useMemo(()=>{if(!v)return Ee.reference;if(!Ee.trigger)return LP;let{onFocus:e,...t}=Ee.trigger;return t},[v,Ee.reference,Ee.trigger]);L.useSyncedValue(`inputProps`,v?Ee.reference??LP:LP);let Ne=W.useMemo(()=>{let e=HP(Oe.reference,Me,Te.reference,{onMouseMove(){L.set(`allowMouseEnter`,!0)}},ge);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=B,e},[L,Oe.reference,Me,Te.reference,ge,B]),Pe=W.useMemo(()=>{let e=HP(Ee.trigger,Te.trigger,ge);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Ee.trigger,Te.trigger,ge]);wP(()=>(L.update({inactiveTriggerProps:Pe}),null)),aV(L,{floatingRootContext:xe,activeTriggerProps:Ne,inactiveTriggerProps:Pe,popupProps:W.useMemo(()=>HP(qB,{onMouseMove(){L.set(`allowMouseEnter`,!0),ae.type===`menu`&&L.set(`hoverEnabled`,!1)},onClick(){L.select(`hoverEnabled`)&&L.set(`hoverEnabled`,!1)},onKeyDown(e){let t=L.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Oe.floating,Ee.floating,Te.floating),[ae.type,L,Oe.floating,Ee.floating,Te.floating]),itemProps:Ee.item??LP});let Fe=W.useMemo(()=>({store:L,parent:D,orientation:u,loopFocus:l,allowEscape:b,defaultFloatingId:k,setRenderedFloatingId:j,virtualFocus:v,parentVirtualFocus:E,syncHighlightedItem:je}),[L,D,u,l,b,k,v,E,je]),Ie=typeof t==`function`?t({payload:se}):t,Le=(0,G.jsxs)(ZI.Provider,{value:Fe,children:[p&&(0,G.jsx)(XB,{handle:p,store:L}),Ie]});return(ae.type===void 0||ae.type===`context-menu`)&&(Le=(0,G.jsx)(OB,{externalTree:R,children:Le})),Le});function RU(e){let t=W.useContext(PU);if(t===null)return(0,G.jsx)(LU,{...e});let n=t.Root;return(0,G.jsx)(PU.Provider,{value:null,children:(0,G.jsx)(n,{...t.options,...e})})}var zU={};function BU(e){QI();let t=W.useContext(PU);if(t!==null){let n=t.SubmenuRoot;return(0,G.jsx)(PU.Provider,{value:null,children:(0,G.jsx)(n,{...t.options,...e})})}return(0,G.jsx)(xH.Provider,{value:zU,children:(0,G.jsx)(LU,{...e,isSubmenu:!0})})}var VU=5;function HU(e,t){let n=UU(t);return e.clientX>=n.left-VU&&e.clientX<=n.right+VU&&e.clientY>=n.top-VU&&e.clientY<=n.bottom+VU}function UU(e){let t=e.getBoundingClientRect(),n=oe(e);if(eR)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function WU(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=VI(),{ref:i,index:a}=sR(e),o=n===a,s=W.useRef(null),c=TP(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function GU(e){let{render:t,className:n,style:r,state:i=LP,props:a=IP,refs:o=IP,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=WU({metadata:s});return tF(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function KU(e){if(d(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!ae(e))return KU(D(e))}function qU(e,t){function n(n,r,i){let a=n.currentTarget;Zf.flushSync(()=>{e.setOpen(!1,_R(xL,n.nativeEvent,a))}),Wz(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&Gz(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function JU(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=W.useRef(!1);return W.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,UI(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:LP,[t,n,r])}var YU=pV(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=QI(!0),h=NV(d)??m?.store;if(!h)throw Error(lF(85));let g=pR(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerControlsId`,g),x=W.useRef(null),S=ZU(),C=VI(!0),w=TB(),T=W.useMemo(()=>w??new xB,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=nV(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:EB(T),floatingParentNodeId:wB(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=GI({disabled:A,native:o});W.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=W.useRef(null),P=VF(),F=Z(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;IR(N.current,t)||IR(h.select(`positionerElement`),t)||t===N.current||t!=null&&KU(t)===h.select(`rootId`)||HU(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:EL})});W.useEffect(()=>{let e=UI(N.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,F,{once:!0}),()=>{e.removeEventListener(`mouseup`,F)}},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,L=WV(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:oH({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=XU(y,h.select(`lastOpenChangeReason`)),z=RB(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),B=IV(v,{enabled:!A&&I}),ee=JU({open:y,enabled:O,mouseDownAction:`open`}),te=W.useMemo(()=>HP(B.reference,z.reference),[B.reference,z.reference]),ne=h.useState(`triggerProps`,D),re=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:ie,handleFocusTargetFocus:ae}=qU(h,x),V={disabled:A,open:y},oe=[N,t,M,E,x],se=[te,L??LP,ne,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),UI(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},re,O?{role:`menuitem`}:{},ee,p,j],ce=tF(`button`,e,{enabled:!O,stateAttributesMapping:uL,state:V,ref:oe,props:se});return O?(0,G.jsx)(GU,{tag:`button`,render:n,className:r,style:i,state:V,refs:oe,props:se,stateAttributesMapping:uL}):y?(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(gz,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:ie},`${g}-pre-focus-guard`),(0,G.jsx)(W.Fragment,{children:ce},g),(0,G.jsx)(gz,{ref:h.context.triggerFocusTargetRef,onFocus:ae},`${g}-post-focus-guard`)]}):(0,G.jsx)(W.Fragment,{children:ce},g)});function XU(e,t){let n=VF(),[r,i]=W.useState(!1);return Q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function ZU(){let e=wU(!0);return W.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}function QU(e){let[t,n]=W.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}var $U=W.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return tF(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function eW(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var tW={"aria-expanded":void 0},nW=W.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:o,nativeButton:s=!1,openOnHover:c=!0,delay:l=100,closeDelay:u=0,disabled:d=!1,...f}=e,p=QI(!0);if(p?.parent.type!==`menu`)throw Error(lF(37));let m=XI(),h=SH(),{store:g,parentVirtualFocus:_}=p,v=p.parent.store,y=sR({guess:!0,label:a}),b=pR(o),x=g.useState(`open`),S=W.useRef(!1),C=g.useState(`positionerElement`),w=g.useState(`floatingRootContext`),T=g.useState(`floatingTreeRoot`),E=g.useState(`triggerPopupId`,b),D=QB(b,g),O=Z(e=>{D(e);let t=g.select(`activeTriggerElement`);e!==null&&g.select(`open`)&&(t===e||g.select(`activeTriggerId`)==null)&&g.update({activeTriggerId:b??null,activeTriggerElement:e,closeDelay:u})}),k=W.useRef(null),A=W.useCallback(e=>{k.current=e,g.set(`activeTriggerElement`,e)},[g]);Q(()=>(O(k.current),()=>O(null)),[O,b,g]),Q(()=>{if(!x||!C)return;function e(e){RR(e)===g.context.beforeContentFocusGuardRef.current&&(S.current=e.relatedTarget===k.current)}return C.addEventListener(`focusout`,e,!0),()=>{S.current=!1,C.removeEventListener(`focusout`,e,!0)}},[x,C,g]),g.useSyncedValue(`closeDelay`,u);let j=g.useState(`disabled`),M=v.useState(`disabled`),N=d||j||M,P=v.useState(`itemProps`),F=v.useState(`isActive`,y.index),I=W.useMemo(()=>({type:`submenu-trigger`,setActive(e){v.select(`highlightItemOnHover`)&&v.setActiveIndex(y.index,TL,e)}}),[v,y.index]),{getItemProps:L,itemRef:R}=iR({closeOnClick:!1,disabled:N,highlighted:F,id:b,store:g,typingRef:v.context.typingRef,nativeButton:s,itemMetadata:I,nodeId:m?.context.nodeId}),z=WV(w,{enabled:g.useState(`hoverEnabled`)&&c&&!N,handleClose:oH({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:l,delay:{open:l,close:u},shouldOpen:l>0?()=>v.select(`allowMouseEnter`):void 0,triggerElementRef:k,externalTree:T,isClosing:()=>g.select(`transitionStatus`)===`ending`,guardStaleOpen:!0}),B=RB(w,{enabled:!N,event:`mousedown`,toggle:!0,ignoreMouse:c,stickIfOpen:c}).reference??LP,ee=g.useState(`triggerProps`,!0);delete ee.id;let te={disabled:N,highlighted:F,open:x},ne=g.useState(`openMethod`),re=g.useState(`lastOpenChangeReason`)===`list-navigation`||ne===`keyboard`,ie=x&&re&&$L;return tF(`div`,e,{state:te,stateAttributesMapping:lL,props:[B,z,ee,h?.onTriggerKeyDown?{onKeyDown:h.onTriggerKeyDown}:void 0,P,ie?tW:void 0,{"aria-controls":E,tabIndex:_||!(x||F)?-1:0,onFocus(e){g.select(`open`)&&S.current&&(S.current=!1,g.setOpen(!1,_R(xL,e.nativeEvent)))},onBlur(){F&&v.setActiveIndex(null,hL)}},f,L],ref:[t,y.ref,R,O,A]})}),rW=W.forwardRef(function(e,t){let n=RL(e,t,`submenu-trigger`);if(!n.visible)return null;let r=n.props?HP(n.props,e):e;return(0,G.jsx)(nW,{...r,ref:n.ref})});function iW(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function aW(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function oW(e){return aW(e?.[0])}function sW(e){return oW(e)?e.flatMap(e=>e.items):e}function cW(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(oW(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function lW(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return iW(e)}function uW(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?iW(e.value):iW(e)}function dW(e,t,n){function r(){return lW(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=sW(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function fW(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,G.jsx)(W.Fragment,{children:dW(r,t,n)},i)),e),[])}var pW=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),mW=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),hW=e=>{let t=mW(e);return t.charAt(0).toUpperCase()+t.slice(1)},gW=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),_W=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},vW={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},yW=(0,W.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,W.createElement)(`svg`,{ref:c,...vW,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:gW(`lucide`,i),...!a&&!_W(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,W.createElement)(e,t)),...Array.isArray(a)?a:[a]])),bW=(e,t)=>{let n=(0,W.forwardRef)(({className:n,...r},i)=>(0,W.createElement)(yW,{ref:i,iconNode:t,className:gW(`lucide-${pW(hW(e))}`,`lucide-${e}`,n),...r}));return n.displayName=hW(e),n},xW=bW(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),SW=bW(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),CW=bW(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),wW=bW(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),TW=`data-valid`,EW=`data-invalid`,DW={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},OW={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},kW={valid(e){return e===null?null:e?{[TW]:``}:{[EW]:``}}},AW={invalid:void 0,name:void 0,validityData:{state:DW,errors:[],error:``,value:``,initialValue:null},setValidityData:FP,disabled:void 0,setTouched:FP,setDirty:FP,setFilled:FP,setFocused:FP,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:OW,registerFieldControl:FP,validation:{getValidationProps:(e,t=LP)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:FP,getInputControl:()=>null,commit:async()=>{},change:FP}},jW=W.createContext(AW);function MW(e=!0){let t=W.useContext(jW);if(t.setValidityData===FP&&!e)throw Error(lF(28));return t}var NW=W.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:FP,validationMode:`onSubmit`,submitCountRef:{current:0}});function PW(){return W.useContext(NW)}var FW=W.createContext({controlId:void 0,registerControlId:FP,resetControlId:FP,labelId:void 0,setLabelId:FP,messageIds:[],setMessageIds:FP,getDescriptionProps:e=>e});function IW(){return W.useContext(FW)}function LW(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=IW(),o=pR(),s=wP(()=>Symbol()),c=W.useRef(!1),l=W.useRef(!1),u=Z(()=>{c.current&&i!==FP&&(c.current=!1,i(s.current,void 0))});return Q(()=>{if(!n||i===FP){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),Q(()=>u,[u]),(n?r:void 0)??t??o}function RW(e,t,n){let{setFocused:r,focusOwnerRef:i}=MW(),a=Z(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return Q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function zW(e,t,n,r,i=!0,a){let{registerFieldControl:o}=MW(),s=wP(()=>Symbol());Q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),Q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var BW=W.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=MW(),{clearErrors:S,elementRef:C,submitCountRef:w}=PW(),T=h||s,E=m??a,D={...p,disabled:T},{labelId:O}=IW(),k=LW({id:i}),A=o!==void 0,j=o==null?void 0:String(o),M=Z(()=>x.inputRef.current?.value);zW(x.inputRef,k,j,M,!T,a),Q(()=>{let e=j??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[j,l,x.inputRef,y]),EU(j,()=>{j!==void 0&&(S(E),_(j!==(v.initialValue??``)),x.change(j))});let N=W.useRef(null),P=RW(T,N),F=VF();return tF(`input`,e,{ref:[t,N],state:D,props:[{id:k,disabled:T,name:E,ref:x.inputRef,"aria-labelledby":O,autoFocus:u,...A?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=_R(hL,e.nativeEvent);c?.(t,n),!A&&(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(E),x.change(t)))},onFocus(){P(!0)},onBlur(e){if(g(!0),P(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),A&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===C.current&&!e.defaultPrevented){let t=e.currentTarget,n=w.current;F.start(0,()=>{w.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(T,e)],stateAttributesMapping:kW})}),VW=W.forwardRef(function(e,t){return(0,G.jsx)(BW,{ref:t,...e})}),HW=W.createContext(void 0);function UW(e){let t=W.useContext(HW);if(t===void 0&&!e)throw Error(lF(47));return t}var WW={...MV,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!MV.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&MV.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>MV.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},GW=class extends CV{constructor(e,t,n){let r=new sV;super(KW(e,r,t,n),qW(r),WW)}setOpen=(e,t)=>{let n=t.reason===_L,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=eV(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=$B(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),Zf.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function KW(e,t,n,r=!1){let i={...EV(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function qW(e){return{popupRef:W.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:W.createRef(),beforeTriggerFocusGuardRef:W.createRef(),beforeContentFocusGuardRef:W.createRef(),stickIfOpenTimeout:new BF,stickIfOpen:!0,triggerElements:e}}var JW=fV(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=XW(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),oV(u,d),rV(u);let{forceUnmount:m}=iV(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),W.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),W.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,_R(jL))}),[m,u]);let h=d||f||s!=null;return(0,G.jsxs)(HW.Provider,{value:u,children:[s&&(0,G.jsx)(XB,{handle:s,store:u}),h&&(0,G.jsx)(ZW,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function YW(e){return UW(!0)?(0,G.jsx)(JW,{props:e}):(0,G.jsx)(OB,{children:(0,G.jsx)(JW,{props:e})})}function XW(e,t){let n=YB((e,n)=>new GW(t,e,n));return W.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function ZW({store:e,modal:t}){let n=WB(e.useState(`floatingRootContext`),{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),r=n.reference,i=n.floating;return aV(e,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:i}),null}var QW=pV(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:c,openOnHover:l=!1,delay:u=300,closeDelay:d=0,id:f,...p}=e,m=UW(!0),h=NV(s)??m;if(!h)throw Error(lF(74));let g=pR(f),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerPopupId`,g),x=W.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=nV(g,x,h,{payload:c,disabled:a,openOnHover:l,closeDelay:d}),w=h.useState(`isPressOpenedByTrigger`,g),T=h.useState(`isTouchPressOpen`,l),E=h.useState(`hasTriggerFocusGuards`,g),D=WV(v,{enabled:!a&&l&&!T,mouseOnly:!0,move:!1,handleClose:oH(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=RB(v,{stickIfOpen:Z(()=>h.context.stickIfOpen)}),k=DU(()=>h.select(`open`),e=>{h.set(`openMethod`,e)}),A=h.useState(`triggerProps`,C),{getButtonProps:j,buttonRef:M}=GI({disabled:a,native:o}),N={open(e){return w?uL.open(e):lL.open(e)}},{handlePreFocusGuardFocus:P,handleFocusTargetFocus:F}=qU(h,x),I=tF(`button`,e,{state:{disabled:a,open:y},ref:[M,t,S,x],props:[O.reference,D,A,k,{[dB]:``,id:g,"aria-haspopup":`dialog`,"aria-expanded":y,"aria-controls":b},p,j],stateAttributesMapping:N}),L=(0,G.jsx)(W.Fragment,{children:I},g);return E?(0,G.jsxs)(W.Fragment,{children:[(0,G.jsx)(gz,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:P}),L,(0,G.jsx)(gz,{ref:h.context.triggerFocusTargetRef,onFocus:F})]}):L}),$W=W.createContext(void 0);function eG(){let e=W.useContext($W);if(e===void 0)throw Error(lF(45));return e}var tG=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return UW().useState(`mounted`)||n?(0,G.jsx)($W.Provider,{value:n,children:(0,G.jsx)(yB,{ref:t,...r})}):null}),nG=W.createContext(void 0);function rG(){let e=W.useContext(nG);if(!e)throw Error(lF(46));return e}var iG=W.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=pB,..._}=e,v=UW(),y=eG(),b=EB(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=XH({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:v.useState(`adaptiveOrigin`)});sU({store:v,domReference:x.useState(`domReferenceElement`),positionerElement:O,open:C});let M=E===!0&&w!==`trigger-hover`;xU(C&&M,D===`touch`,O,T);let N=v.useStateSetter(`positionerElement`),P=cU(e,{open:C,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:k},{styles:j.positionerStyles,transitionStatus:A,props:_,refs:[t,N],hidden:!S,inert:!C});return(0,G.jsxs)(nG.Provider,{value:j,children:[S&&M&&(0,G.jsx)(oU,{inert:NH(!C),cutout:T}),(0,G.jsx)(DB,{id:b,children:P})]})}),aG=W.createContext(void 0);function oG(){let[e,t]=W.useState(0),n=Z(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:W.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var sG=W.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=UW(),l=rG(),u=cH(!0)!=null,{context:f,hasClosePart:p}=oG(),m=c.useState(`open`),h=c.useState(`openMethod`),g=c.useState(`instantType`),_=c.useState(`transitionStatus`),v=c.useState(`popupProps`),y=c.useState(`titleElementId`),b=c.useState(`descriptionElementId`),x=c.useState(`modal`),S=c.useState(`mounted`),C=c.useState(`openChangeReason`),w=c.useState(`activeTriggerElement`),T=c.useState(`floatingRootContext`),E=T.useState(`floatingId`),D=c.useState(`disabled`),O=c.useState(`openOnHover`),k=c.useState(`closeDelay`);jF({open:m,ref:c.context.popupRef,onComplete(){m&&c.context.onOpenChangeComplete?.(!0)}}),HV(T,{enabled:O&&!D,closeDelay:k});let A=a===void 0?JB(c.context.popupRef):a,j=x!==!1&&p;c.useSyncedValue(`focusManagerModal`,j);let M=c.useStateSetter(`popupElement`),N=tF(`div`,e,{state:{open:m,side:l.side,align:l.align,instant:g,transitionStatus:_},ref:[t,c.context.popupRef,M],props:[v,{id:E,role:`dialog`,...qB,"aria-labelledby":y,"aria-describedby":b,onKeyDown(e){u&&pH.has(e.key)&&e.stopPropagation()}},bH(_),s],stateAttributesMapping:fL});return(0,G.jsx)(LB,{context:T,openInteractionType:h,modal:j,disabled:!S||C===`trigger-hover`,initialFocus:A,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[c.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:d(w)?w:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,G.jsx)(aG.Provider,{value:f,children:N})})});function cG(e){let t=W.useRef(!0);t.current&&(t.current=!1,e())}var lG=W.createContext(void 0),uG=W.createContext(void 0);function dG(){let e=W.useContext(lG);if(e===void 0)throw Error(lF(60));return e}function fG(){let e=W.useContext(uG);if(e===void 0)throw Error(lF(61));return e}function pG(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var mG=(e,t)=>Object.is(e,t);function hG(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function gG(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!pG(e,t,(e,t)=>hG(e,t,n)):e!==t}function _G(e,t,n){return e?e.some(e=>e!==void 0&&hG(t,e,n)):!1}function vG(e,t,n){return e?e.findIndex(e=>e!==void 0&&hG(e,t,n)):-1}function yG(e,t){if(t!==mG)return n=>_G(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function bG(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(yG(t,n)):vG(e,t,n);return i===-1?null:i}function xG(e,t,n,r,i,a){return _G(r,t,i)?a!=null&&e>a&&_G(r,n[a],i)?a:e:e===a?bG(n,r,i,!0):a}function SG(e,t,n){return e.filter(e=>!hG(t,e,n))}var CG={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:uW(t,r)!==``},hasNullItemLabel:(e,t)=>t?cW(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>hG(t,e,n)):hG(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function wG(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function TG(e,t){return Math.max(0,e-t)}function EG(e,t){if(t<=0)return 0;let n=wG(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function DG(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S=mG,highlightItemOnHover:C=!0,children:w}=e,{clearErrors:T}=PW(),{setDirty:E,setTouched:D,setFocused:O,validityData:k,setFilled:A,name:j,disabled:M,validation:N,validationMode:P}=MW(),F=LW({id:t}),I=M||d,L=j??c,[R,z]=NL({controlled:n,default:y?r??IP:r,name:`Select`,state:`value`}),[B,ee]=NL({controlled:a,default:o,name:`Select`,state:`open`}),te=W.useRef([]),ne=W.useRef([]),re=W.useRef(null),ie=W.useRef(null),ae=W.useRef(0),V=W.useRef(null),oe=W.useRef([]),se=W.useRef(!1),ce=W.useRef(null),le=W.useRef(null),ue=W.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),de=W.useRef(!1),fe=W.useRef(R),{openMethod:pe,triggerProps:me}=OU(B),he=wP(()=>new CV({id:F,labelId:void 0,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,value:R,open:B,mounted:B,transitionStatus:void 0,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:LP,triggerProps:LP,itemRoot:{props:LP,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:FP,setOpen:FP,handleScrollArrowVisibility:FP,onOpenChangeComplete:FP,listRef:te,popupRef:re,scrollHandlerRef:ie,scrollArrowsMountedCountRef:ae,valueRef:V,valuesRef:oe,labelsRef:ne,typingRef:se,selectionRef:ue,firstItemTextRef:ce,selectedItemTextRef:le,alignItemWithTriggerActiveRef:de,initialValueRef:fe},CG)).current,[ge,_e]=W.useState(!1),{mounted:ve,transitionStatus:ye,forceUnmount:be}=KB({open:B,ref:re,preventUnmountOnClose:ge,setPreventUnmountOnClose:_e,onUnmount(){he.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),_?.(!1)}}),xe=he.useState(`activeIndex`),Se=he.useState(`selectedIndex`),Ce=he.useState(`triggerElement`),we=he.useState(`positionerElement`),Te=QU(pe),H=pe??Te,Ee=W.useMemo(()=>y?``:uW(R,x),[y,R,x]),De=W.useMemo(()=>y&&Array.isArray(R)?R.map(e=>uW(e,x)):uW(R,x),[y,R,x]);zW(dz(Ce),F,R,Z(()=>De),!I,c);let Oe=y?Array.isArray(R)&&R.length>0:R!=null&&Ee!==``;Q(()=>{A(Oe)},[Oe,A]),Q(function(){let e=bG(oe.current,R,S,y);e===null&&(le.current=null),!B&&he.set(`selectedIndex`,e)},[y,B,R,S,he]),EU(R,()=>{T(L),E(gG(R,k.initialValue,S)),N.change(R)});let ke=Z((e,t)=>{let n=t,r=eV(n);s?.(e,n),!t.isCanceled&&(e||_e(r()),ee(e),e||t.reason!==`focus-out`&&t.reason!==`outside-press`||(D(!0),O(!1),P===`onBlur`&&N.commit(R)))});W.useImperativeHandle(h,()=>({unmount:be,close:()=>{he.state.open&&ke(!1,_R(jL))}}),[be,ke,he]);let Ae=Z((e,t)=>{i?.(e,t),!t.isCanceled&&z(e)}),je=Z(e=>{let t=TG(e.scrollHeight,e.clientHeight),n=EG(e.scrollTop,t),r=n>0,i=n<t;he.set(`scrollUpArrowVisible`,r),he.set(`scrollDownArrowVisible`,i)}),Me=PV({open:B,onOpenChange:ke,elements:{reference:Ce,floating:we}}),Ne=RB(Me,{enabled:!I,event:`mousedown`}),Pe=WB(Me),Fe=ZV(Me,{enabled:!I,listRef:te,activeIndex:xe,selectedIndex:Se,disabledIndices:IP,onNavigate(e){(e!==null||B)&&he.set(`activeIndex`,e)},focusItemOnHover:C}),Ie=QV(Me,{enabled:!I&&(B||!f&&!y),listRef:ne,activeIndex:xe,selectedIndex:Se,disabledIndices:e=>eW(te.current[e]),onMatch(e){B?he.set(`activeIndex`,e):Ae(oe.current[e],_R(hL))},onTyping(e){se.current=e}}),Le=W.useMemo(()=>HP(Ie.reference,Fe.reference,Pe.reference,Ne.reference,me),[Ne.reference,Ie.reference,Fe.reference,Pe.reference,me]),Re=W.useMemo(()=>HP(qB,Ie.floating,Fe.floating,Pe.floating),[Ie.floating,Fe.floating,Pe.floating]),ze=Fe.item??LP,Be=W.useMemo(()=>({props:ze,multiple:y,disabled:I,readOnly:f,isItemEqualToValue:S}),[ze,y,I,f,S]);he.useContextCallback(`setValue`,Ae),he.useContextCallback(`setOpen`,ke),he.useContextCallback(`handleScrollArrowVisibility`,je),he.useContextCallback(`onOpenChangeComplete`,_),cG(()=>{he.update({popupProps:Re,triggerProps:Le,itemRoot:Be})}),he.useSyncedValues({id:F,modal:m,multiple:y,disabled:I,readOnly:f,required:p,highlightItemOnHover:C,value:R,open:B,mounted:ve,transitionStatus:ye,popupProps:Re,triggerProps:Le,itemRoot:Be,items:v,itemToStringLabel:b,itemToStringValue:x,isItemEqualToValue:S,openMethod:H});let Ve=TP(g,N.inputRef),He=y?void 0:L,Ue=W.useMemo(()=>!y||!Array.isArray(R)||!L?null:R.map(e=>{let t=uW(e,x);return(0,G.jsx)(`input`,{type:`hidden`,form:l,name:L,value:t,disabled:I},t)}),[y,R,l,L,x,I]);return(0,G.jsxs)(lG.Provider,{value:he,children:[(0,G.jsx)(uG.Provider,{value:Me,children:w}),(0,G.jsx)(`input`,{...N.getValidationProps(I,{onFocus(){he.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||I||f)return;let t=e.currentTarget.value,n=_R(hL,e.nativeEvent);function r(){if(y)return;let e=t.toLowerCase(),r=oe.current.findIndex(t=>uW(t,x).toLowerCase()===e||lW(t,b).toLowerCase()===e);r===-1&&(r=oe.current.findIndex((t,n)=>{let r=ne.current[n];return r!=null&&r.toLowerCase()===e}));let i=oe.current[r];i!=null&&Ae(i,n)}he.set(`forceMount`,!0),queueMicrotask(r)}}),id:F&&He==null?`${F}-hidden-input`:void 0,form:l,name:He,autoComplete:u,value:Ee,disabled:I,required:p&&!(y&&Oe),readOnly:f,ref:Ve,style:L?hz:mz,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ue]})}function OG(e,t){return e??t}var kG=`data-popup-side`,AG=400,jG={...uL,...kW,popupSide:e=>e?{[kG]:e}:null,value:()=>null},MG=W.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,validationMode:u,validation:d,state:f,disabled:p}=MW(),{labelId:m}=IW(),h=dG(),g=h.useState(`readOnly`),_=h.useState(`required`),v=h.useState(`disabled`),y=p||v||a,b=h.useState(`open`),x=h.useState(`mounted`),S=h.useState(`value`),C=h.useState(`triggerProps`),w=h.useState(`positionerElement`),T=h.useState(`listElement`),E=h.useState(`popupSide`),D=h.useState(`id`),O=h.useState(`labelId`),k=h.useState(`hasSelectedValue`),A=x&&w?E:null,j=i??D,M=OG(m,O);LW({id:i});let N=dz(w),P=W.useRef(null),F=RW(y,P),{getButtonProps:I,buttonRef:L}=GI({disabled:y,native:o}),R=h.useStateSetter(`triggerElement`),z=VF(),B=VF(),ee=VF();W.useEffect(()=>{if(b)return ee.start(AG,()=>{h.context.selectionRef.current.allowUnselectedMouseUp=!0,h.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ee.clear()};h.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},B.clear()},[b,h,B,ee]);let te=HP(C,{id:j,role:`combobox`,"aria-expanded":b,"aria-haspopup":`listbox`,"aria-controls":b?T?.id??$R(w)?.id:void 0,"aria-labelledby":M,"aria-readonly":g||void 0,"aria-required":_||void 0,tabIndex:y?-1:0,onFocus(e){F(!0),b&&h.context.alignItemWithTriggerActiveRef.current&&h.context.setOpen(!1,_R(hL,e.nativeEvent)),z.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){IR(w,e.relatedTarget)||(l(!0),F(!1),u===`onBlur`&&d.commit(S))},onMouseDown(e){if(b)return;let t=UI(e.currentTarget);function n(e){if(!P.current)return;let t=e.target;IR(P.current,t)||IR(N.current,t)||HU(e,P.current)||h.context.setOpen(!1,_R(EL,e))}B.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},c,I),ne=d.getValidationProps(y,te);ne.role=`combobox`;let re={...f,open:b,disabled:y,value:S,readOnly:g,popupSide:A,placeholder:!k};return tF(`button`,e,{ref:[t,P,L,R],state:re,stateAttributesMapping:jG,props:ne})}),NG={value:()=>null},PG=W.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=dG(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?fW(l,u,d):dW(l,u,d)),tF(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:NG})}),FG=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return tF(`span`,e,{state:{open:dG().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:lL})}),IG=W.forwardRef(function(e,t){let n=dG(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,G.jsx)(yB,{ref:t,...e}):null}),LG=W.createContext(void 0);function RG(){let e=W.useContext(LG);if(!e)throw Error(lF(59));return e}function zG(e,t){e&&Object.assign(e.style,t)}var BG={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},VG={position:`fixed`},HG=W.forwardRef(function(e,t){let{anchor:n,className:r,render:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=fB,style:_,...v}=e,y=dG(),b=fG(),x=y.useState(`open`),S=y.useState(`mounted`),C=y.useState(`modal`),w=y.useState(`value`),T=y.useState(`openMethod`),E=y.useState(`positionerElement`),D=y.useState(`triggerElement`),O=y.useState(`isItemEqualToValue`),k=y.useState(`transitionStatus`),A=W.useRef(null),j=W.useRef(null),[M,N]=W.useState(h),P=S&&M&&T!==`touch`;!S&&M!==h&&N(h),W.useImperativeHandle(y.context.alignItemWithTriggerActiveRef,()=>P),xU((P||C)&&x,T===`touch`,E,D);let F=XH({anchor:n,floatingRootContext:b,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??P,collisionAvoidance:g,keepMounted:!0}),I=P?`none`:F.side,L=P?VG:F.positionerStyles,R={open:x,side:I,align:F.align,anchorHidden:F.anchorHidden};Q(()=>{y.set(`popupSide`,F.side)},[y,F.side]);let z=cU(e,R,{styles:L,transitionStatus:k,props:v,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!S,inert:!x}),B=W.useRef(0),ee=Z(e=>{if(y.context.valuesRef.current.length===0)return;let t=B.current;B.current=e.size;let n=_R(hL);if(t!==0&&!y.state.multiple&&w!==null&&vG(y.context.valuesRef.current,w,O)===-1){let e=y.context.initialValueRef.current,t=e!=null&&vG(y.context.valuesRef.current,e,O)!==-1?e:null;y.context.setValue(t,n),t===null&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null)}if(t!==0&&y.state.multiple&&Array.isArray(w)){let e=w.filter(e=>vG(y.context.valuesRef.current,e,O)!==-1);e.length!==w.length&&(y.context.setValue(e,n),e.length===0&&(y.set(`selectedIndex`,null),y.context.selectedItemTextRef.current=null))}if(x&&P){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};zG(E,e),zG(y.context.popupRef.current,e)}}),te=W.useMemo(()=>({...F,side:I,alignItemWithTriggerActive:P,setControlledAlignItemWithTrigger:N,scrollUpArrowRef:A,scrollDownArrowRef:j}),[F,I,P,N]);return(0,G.jsx)($H,{elementsRef:y.context.listRef,labelsRef:y.context.labelsRef,onMapChange:ee,children:(0,G.jsxs)(LG.Provider,{value:te,children:[S&&C&&(0,G.jsx)(oU,{inert:NH(!x),cutout:D}),z]})})}),UG=`base-ui-disable-scrollbar`,WG={className:UG,getElement(e){return(0,G.jsx)(`style`,{nonce:e,href:UG,precedence:`base-ui:low`,children:`.${UG}{scrollbar-width:none}.${UG}::-webkit-scrollbar{display:none}`})}},GG=W.createContext(void 0),KG={disableStyleElements:!1};function qG(){return W.useContext(GG)??KG}var JG=`--transform-origin`,YG={...dL,...PF},XG=W.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,s=dG(),c=s.useState(`multiple`),l=s.useState(`readOnly`),u=s.useState(`highlightItemOnHover`),d=fG(),{side:f,align:p,alignItemWithTriggerActive:m,isPositioned:h,setControlledAlignItemWithTrigger:g}=RG(),_=cH(!0)!=null,v=IH(),{nonce:y,disableStyleElements:b}=qG(),x=s.useState(`id`),S=s.useState(`open`),C=s.useState(`openMethod`),w=s.useState(`mounted`),T=s.useState(`popupProps`),E=s.useState(`transitionStatus`),D=s.useState(`triggerElement`),O=s.useState(`positionerElement`),k=s.useState(`listElement`),A=W.useRef(!1),j=W.useRef(!1),M=W.useRef({}),N=CF(),P=Z(e=>{if(!O||!s.context.popupRef.current||!j.current)return;let t=O.style.top===`0px`,n=O.style.bottom===`0px`;if(A.current||!m||!t&&!n){s.context.handleScrollArrowVisibility(e);return}let r=$G(O),i=eK(O.getBoundingClientRect().height,`y`,r),a=UI(O),o=oe(O),c=o.getComputedStyle(O),l=parseFloat(c.marginTop),u=parseFloat(c.marginBottom),d=ZG(o.getComputedStyle(s.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,h=QG(e),g=null,_=e=>{O.style.height=`${e}px`},v=t?h-p:p,y=Math.min(i+v,f);if(v<=1){let n=wG(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?h:0,f-(i+n)<=1&&(A.current=!0),s.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<h&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=wG(g,0,QG(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(A.current=!0),s.context.handleScrollArrowVisibility(e)});W.useImperativeHandle(s.context.scrollHandlerRef,()=>P,[P]),jF({open:S,ref:s.context.popupRef,onComplete(){S&&s.context.onOpenChangeComplete(!0)}});let F={open:S,transitionStatus:E,side:f,align:p};Q(()=>{O&&s.context.popupRef.current&&!Object.keys(M.current).length&&(M.current={top:O.style.top||`0`,left:O.style.left||`0`,right:O.style.right,height:O.style.height,bottom:O.style.bottom,minHeight:O.style.minHeight,maxHeight:O.style.maxHeight,marginTop:O.style.marginTop,marginBottom:O.style.marginBottom})},[s,O]),Q(()=>{S||m||(j.current=!1,A.current=!1,zG(O,M.current))},[S,m,O]),Q(()=>{let e=s.context.popupRef.current;if(!S||!D||!O||!e||m&&!h||s.state.transitionStatus===`ending`)return;if(j.current=!0,e.style.removeProperty(JG),!m){N.request(()=>s.context.handleScrollArrowVisibility(k||e));return}let t=rK(e);try{let t=s.context.selectedItemTextRef.current;t?.isConnected||(t=!s.select(`hasSelectedValue`)&&s.context.firstItemTextRef.current?.isConnected?s.context.firstItemTextRef.current:null);let n=s.context.valueRef.current,r=oe(O),i=r.getComputedStyle(O),a=r.getComputedStyle(e),o=UI(D),c=$G(D),l=tK(D.getBoundingClientRect(),c),d=tK(O.getBoundingClientRect(),c),f=l.height,p=k||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),_=parseFloat(i.marginTop)||10,y=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=ZG(a),S=o.documentElement.clientHeight-_-y,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=v===`rtl`?l.right-d.width:l.left,j=0;if(t&&n){let e=tK(n.getBoundingClientRect(),c);T=tK(t.getBoundingClientRect(),c),E=d.left+(v===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;j=T.top-d.top+T.height/2-r}let N=w+j+y+h,P=Math.min(S,N),F=S-_-y,I=N-P,L=C-5;O.style.left=`${wG(E,5,L-d.width)}px`,O.style.height=`${P}px`,O.style.maxHeight=`none`,O.style.marginTop=`${_}px`,O.style.marginBottom=`${y}px`,e.style.height=`100%`;let R=QG(p),z=I>=R-1;z&&(P=Math.min(S,d.height)-(I-R));let B=l.top<20||l.bottom>S-20||Math.ceil(P)+1<Math.min(m,b),ee=(r.visualViewport?.scale??1)!==1&&QL;if(B||ee){zG(O,M.current),g(!1);return}let te=Math.max(b,P);if(z){let e=Math.max(0,S-N);O.style.top=d.height>=F?`0`:`${e}px`,O.style.height=`${P}px`,p.scrollTop=QG(p)}else O.style.bottom=`0`,p.scrollTop=I;if(T){let t=d.top,n=d.height,r=T.top+T.height/2,i=wG(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(JG,`50% ${i}%`)}(te===S||P>=x)&&(A.current=!0),s.context.handleScrollArrowVisibility(p),u&&s.state.selectedIndex===null&&s.state.activeIndex===null&&s.context.listRef.current[0]!=null&&s.set(`activeIndex`,0)}finally{t()}},[s,S,O,D,m,g,N,k,u,v,h]),W.useEffect(()=>{if(!m||!O||!S)return;let e=oe(O);function t(e){s.context.setOpen(!1,_R(ML,e))}return lz(e,`resize`,t)},[s,m,O,S]);let I={...k?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":c||void 0,"aria-readonly":l||void 0,id:`${x}-list`},onKeyDown(e){_&&pH.has(e.key)&&e.stopPropagation()},onScroll(e){k||P(e.currentTarget)},...m&&{style:k?{height:`100%`}:BG},className:!k&&m?WG.className:void 0},L=tF(`div`,e,{ref:[t,s.context.popupRef],state:F,stateAttributesMapping:YG,props:[T,I,bH(E),o]});return(0,G.jsxs)(W.Fragment,{children:[!b&&WG.getElement(y),(0,G.jsx)(LB,{context:d,modal:!1,disabled:!w,openInteractionType:C,returnFocus:a,restoreFocus:!0,children:L})]})});function ZG(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function QG(e){return TG(e.scrollHeight,e.clientHeight)}function $G(e){return M.getScale(e)}function eK(e,t,n){return e/n[t]}function tK(e,t){return _({x:eK(e.x,`x`,t),y:eK(e.y,`y`,t),width:eK(e.width,`x`,t),height:eK(e.height,`y`,t)})}var nK=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function rK(e){let{style:t}=e,n={};for(let[e,r]of nK)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of nK){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var iK=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=dG(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=RG(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:BG},className:u&&d!==`touch`?WG.className:void 0};return tF(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),aK=W.createContext(void 0);function oK(){let e=W.useContext(aK);if(!e)throw Error(lF(57));return e}var sK=W.memo(W.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=W.useRef(null),d=sR({guess:!0,label:o,textRef:u}),f=dG(),{props:p,multiple:m,disabled:h,readOnly:g,isItemEqualToValue:_}=f.useState(`itemRoot`),v=h||s,y=f.useState(`isActive`,d.index),b=f.useState(`open`),x=f.useState(`isSelected`,a),S=f.useState(`isSelectedByFocus`,d.index),C=d.index,w=W.useRef(null);Q(()=>{let e=f.context.valuesRef.current;return e[C]=a,()=>{delete e[C]}},[C,a,f]),Q(()=>{let e=f.state.value,t=f.state.selectedIndex,n=t,r;m&&Array.isArray(e)?(n=xG(C,a,f.context.valuesRef.current,e,_,t),r=n===C,C===t&&!r&&(f.context.selectedItemTextRef.current=null)):(r=e!==void 0&&hG(a,e,_),r&&(n=C)),f.set(`selectedIndex`,n),r&&u.current&&(f.context.selectedItemTextRef.current=u.current)},[C,m,_,f,a]);let T=W.useRef(`mouse`),E=W.useRef(!1),{getButtonProps:D,buttonRef:O}=GI({disabled:v,focusableWhenDisabled:!0,native:c,composite:!0}),k={disabled:v,selected:x,highlighted:y};function A(e){if(h||g)return;let t=f.state.value;if(m){let n=Array.isArray(t)?t:[],r=x?SG(n,a,_):[...n,a];f.context.setValue(r,_R(bL,e))}else f.context.setValue(a,_R(bL,e)),f.context.setOpen(!1,_R(bL,e))}function j(){f.context.selectionRef.current.dragY=0}let M={role:`option`,"aria-selected":x,tabIndex:b&&y?0:-1,onKeyDown(e){f.set(`activeIndex`,C),e.key===` `&&f.context.typingRef.current&&e.preventDefault()},onClick(e){let t=T.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&jR(e.nativeEvent)&&(n!==void 0||y),i=t&&!r&&!E.current;E.current=!1,!(v||i)&&A(e.nativeEvent)},onPointerEnter(e){T.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=f.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){T.current=e.pointerType,E.current=!0,j()},onMouseUp(){if(j(),v||T.current===`touch`||E.current)return;let e=!f.context.selectionRef.current.allowSelectedMouseUp&&x,t=!f.context.selectionRef.current.allowUnselectedMouseUp&&!x;e||t||(E.current=!0,w.current?.click(),E.current=!1)}},N=tF(`div`,e,{ref:[O,t,d.ref,w],state:k,props:[p,M,l,D]}),P=W.useMemo(()=>({selected:x,index:C,textRef:u,selectedByFocus:S}),[x,C,u,S]);return(0,G.jsx)(aK.Provider,{value:P,children:N})})),cK=W.memo(W.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=W.useRef(null),{transitionStatus:l,setMounted:u}=FF(o),d=tF(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:PF});return jF({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),lK=W.forwardRef(function(e,t){let{selected:n}=oK();return e.keepMounted||n?(0,G.jsx)(cK,{...e,selected:n,ref:t}):null}),uK=W.memo(W.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i}=oK(),a=dG(),{render:o,className:s,style:c,...l}=e;return tF(`div`,e,{ref:[W.useCallback(e=>{e&&(n===0&&(a.context.firstItemTextRef.current=e),i&&(a.context.selectedItemTextRef.current=e))},[a,n,i]),t,r],props:l})})),dK=W.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=dG(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=RG(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=VF(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=FF(g);Q(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),jF({open:g,ref:v,onComplete(){g||x(!1)}});let S=tF(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=TG(e.scrollHeight,e.clientHeight),r=EG(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=fK(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:PF});return y||o?S:null});function fK(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?EG(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?EG(l.offsetTop+l.offsetHeight-r+i,a):a}var pK=W.forwardRef(function(e,t){return(0,G.jsx)(dK,{...e,ref:t,direction:`down`})}),mK=W.forwardRef(function(e,t){return(0,G.jsx)(dK,{...e,ref:t,direction:`up`})}),hK=W.createContext(void 0);function gK(){let e=W.useContext(hK);if(e===void 0)throw Error(lF(64));return e}var _K=`data-activation-direction`,vK={tabActivationDirection:e=>({[_K]:e})},yK=W.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a=`horizontal`,render:o,value:s,style:c,...l}=e,u=e.defaultValue!==void 0,d=W.useRef([]),[f,p]=W.useState(()=>new Map),[m,h]=NL({controlled:s,default:r,name:`Tabs`,state:`value`}),g=s!==void 0,[_,v]=W.useState(()=>new Map),y=W.useRef(void 0),b=W.useCallback(e=>bK(_,e),[_]),[x,S]=W.useState(()=>({previousValue:m,tabActivationDirection:`none`})),{previousValue:C,tabActivationDirection:w}=x,T=w,E=!1;C!==m&&(T=xK(C,m,a,_),E=C!=null&&m!=null&&b(m)==null);let D=E?C:m,O=C!==D||w!==T;Q(()=>{O&&S({previousValue:D,tabActivationDirection:T})},[D,O,T]);let k=Z((e,t)=>{t.activationDirection=xK(m,e,a,_),i?.(e,t),!t.isCanceled&&h(()=>e)}),A=Z((e,t)=>{i?.(e,_R(t,void 0,void 0,{activationDirection:`none`}))}),j=Z((e,t)=>(p(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{p(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),M=W.useCallback(e=>f.get(e),[f]),N=W.useCallback(e=>{for(let t of _.values())if(e===t.value)return t.id},[_]),P=W.useMemo(()=>({getTabElementBySelectedValue:b,getTabIdByPanelValue:N,getTabPanelIdByValue:M,onValueChange:k,orientation:a,registerMountedTabPanel:j,setTabMap:v,tabActivationDirection:T,value:m}),[b,N,M,k,a,j,v,T,m]),F=W.useMemo(()=>{for(let e of _.values())if(e.value===m)return e},[_,m]),I=W.useMemo(()=>{for(let e of _.values())if(!e.disabled)return e.value},[_]),L=W.useRef(!u),R=W.useRef(r),z=W.useRef(u),B=W.useRef(!1);Q(()=>{if(g)return;function e(e,t){h(()=>e),S({previousValue:e,tabActivationDirection:`none`}),A(e,t),L.current=!1}if(_.size===0){B.current&&m!==null&&!y.current?.isConnected&&e(null,kL);return}B.current=!0,y.current=_.keys().next().value;let t=F?.disabled,n=F==null&&m!==null;if(!t&&m===R.current&&(z.current=!1),z.current&&t&&m===R.current)return;let r=L.current;if(t||n){let n=I??null;if(m===n){L.current=!1;return}let i=kL;r?i=AL:t&&(i=OL),e(n,i)}else r&&F!=null&&(A(m,AL),L.current=!1)},[I,g,A,F,h,_,m]);let ee=tF(`div`,e,{state:{orientation:a,tabActivationDirection:T},ref:t,props:l,stateAttributesMapping:vK});return(0,G.jsx)(hK.Provider,{value:P,children:(0,G.jsx)($H,{elementsRef:d,children:ee})})});function bK(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function xK(e,t,n,r){if(e==null||t==null)return`none`;let[i,a,o]=n===`horizontal`?[`left`,`left`,`right`]:[`top`,`up`,`down`],s=bK(r,e),c=bK(r,t);if(s==null||c==null)return s!==c&&(typeof e==`number`||typeof e==`string`)&&typeof e==typeof t?t>e?o:a:`none`;let l=s.getBoundingClientRect()[i],u=c.getBoundingClientRect()[i];return u<l?a:u>l?o:`none`}var SK=`data-composite-item-active`,CK=W.createContext(void 0);function wK(){let e=W.useContext(CK);if(e===void 0)throw Error(lF(65));return e}var TK=W.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,style:c,...l}=e,{value:u,getTabPanelIdByValue:d,onValueChange:f,orientation:p,tabActivationDirection:m}=gK(),{activateOnFocus:h,registerTabResizeObserverElement:g,tabsListElement:_}=wK(),{highlightedIndex:v,onHighlightedIndexChange:y}=VI(),b=pR(o),{compositeProps:x,compositeRef:S,index:C}=WU({metadata:W.useMemo(()=>({disabled:r,id:b,value:a}),[r,b,a])}),w=a===u,T=W.useRef(!1),E=W.useRef(null),D=Z(e=>{E.current?.(),E.current=e?g(e):null});Q(()=>{if(T.current){T.current=!1;return}if(!(w&&C>-1&&v!==C))return;let e=_;if(e!=null){let t=FR(UI(e));if(t&&IR(e,t))return}r||y(C)},[w,C,v,y,r,_]);let{getButtonProps:O,buttonRef:k}=GI({disabled:r,native:s,focusableWhenDisabled:!0}),A=d(a),j=W.useRef(!1),M=W.useRef(!1);function N(e){f(a,_R(hL,e.nativeEvent,void 0,{activationDirection:`none`}))}function P(e){w||r||N(e)}function F(e){w||r||h&&(!j.current||M.current)&&N(e)}function I(e){if(w||r)return;j.current=!0,M.current=e.button===0;let t=UI(e.currentTarget);function n(){j.current=!1,M.current=!1,t.removeEventListener(`pointerup`,n),t.removeEventListener(`pointercancel`,n)}t.addEventListener(`pointerup`,n),t.addEventListener(`pointercancel`,n)}return tF(`button`,e,{state:{disabled:r,active:w,orientation:p,tabActivationDirection:m},ref:[t,k,S,D],props:[x,{role:`tab`,"aria-controls":A,"aria-selected":w,id:b,onClick:P,onFocus:F,onPointerDown:I,[SK]:w?``:void 0,onKeyDownCapture(){T.current=!0}},l,O],stateAttributesMapping:vK})}),EK=`data-index`,DK={...vK,...PF},OK=W.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:o,...s}=e,{value:c,getTabIdByPanelValue:l,orientation:u,tabActivationDirection:d,registerMountedTabPanel:f}=gK(),p=pR(),{ref:m,index:h}=sR(),g=r===c,{mounted:_,transitionStatus:v,setMounted:y}=FF(g),b=!_,x=l(r),S={hidden:b,orientation:u,tabActivationDirection:d,transitionStatus:v},C=W.useRef(null),w=tF(`div`,e,{state:S,ref:[t,m,C],props:[{"aria-labelledby":x,hidden:b,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:NH(!g),[EK]:h},s],stateAttributesMapping:DK});return jF({open:g,ref:C,onComplete(){g||y(!1)}}),Q(()=>{if(!(p==null||b&&!a))return f(r,p)},[b,a,r,p,f]),a||_?w:null});function kK(e){let{loopFocus:t=!0,orientation:n=`both`,grid:r,onLoop:i,direction:a,highlightedIndex:o,onHighlightedIndexChange:s,rootRef:c,enableHomeAndEndKeys:l=!1,stopEventPropagation:u,disabledIndices:d,modifierKeys:f=IP}=e,[p,m]=W.useState(0),h=r!=null,g=W.useRef(null),_=TP(g,c),v=W.useRef([]),y=W.useRef(!1),b=W.useRef(null),x=o??p,S=Z((e,t=!1)=>{if(b.current=v.current[e]??null,(s??m)(e),t){let t=v.current[e];_H(g.current,t,a,n)}}),C=Z(e=>{if(e.size===0)return;if(y.current){let e=v.current,t=e.indexOf(b.current);if(t===-1){let t=e[x];!t||Sz(e,x,d)?S(AK(e,d)):b.current=t}else t!==x&&S(t);return}y.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,i=r?e.get(r)?.index??-1:-1;if(i!==-1)S(i);else if(Sz(t,x,d)){let e=xz(t,{disabledIndices:d});_z(t,e)||S(e)}_H(g.current,r,a,n)});Q(()=>{if(d==null||o!=null||!y.current)return;let e=v.current;if(Sz(e,x,d)){let t=xz(e,{disabledIndices:d});_z(e,t)||S(t)}},[d,o,x,v,S]);let w=Z((e,t,n)=>i?i(e,t,n,v):n),T=Z(e=>{let o=e.key===`Home`||e.key===`End`;if(!pH.has(e.key)||!l&&o||jK(e,f)||!g.current)return;let s=a===`rtl`,c=s?dH:fH,p=s?fH:dH,m=n===`vertical`?uH:c,_=n===`vertical`?lH:p,y=RR(e.nativeEvent);if(y!=null&&gH(y)&&!eW(y)){let t=y.selectionStart,n=y.selectionEnd,r=y.value;if(t==null||e.shiftKey||t!==n||e.key!==_&&t<r.length||e.key!==m&&t>0)return}let b=x,C=vz(v,d),T=yz(v,d);r!=null&&(b=r({disabledIndices:d,elementsRef:v,event:e,highlightedIndex:x,loopFocus:t,maxIndex:T,minIndex:C,onLoop:w,orientation:n,rtl:s}));let E=n!==`vertical`&&e.key===c||n!==`horizontal`&&e.key===`ArrowDown`,D=n!==`vertical`&&e.key===p||n!==`horizontal`&&e.key===`ArrowUp`;l&&(e.key===`Home`?b=C:e.key===`End`&&(b=T)),b===x&&(E||D)&&(t&&b===T&&E?(b=C,i&&(b=i(e,x,b,v))):t&&b===C&&D?(b=T,i&&(b=i(e,x,b,v))):b=xz(v.current,{startingIndex:b,decrement:D,disabledIndices:d})),b!==x&&!_z(v.current,b)&&(u&&e.stopPropagation(),(h||o||E||D)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{v.current[b]?.focus()}))});return{props:{ref:_,onFocus(e){let t=g.current,n=RR(e.nativeEvent);t&&n!=null&&gH(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:T},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:C,relayKeyboardEvent:T}}function AK(e,t){let n=-1;for(let r=0;r<e.length;r+=1){let i=e[r];if(i&&!Sz(e,r,t)){if(i.hasAttribute(`data-composite-item-active`))return r;n===-1&&(n=r)}}return Math.max(n,0)}function jK(e,t){for(let n of mH)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function MK(e){let{render:t,className:n,style:r,refs:i=IP,props:a=IP,state:o=LP,stateAttributesMapping:s,highlightedIndex:c,onHighlightedIndexChange:l,orientation:u,grid:d,loopFocus:f,onLoop:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=kK({grid:d,loopFocus:f,onLoop:p,orientation:u,highlightedIndex:c,onHighlightedIndexChange:l,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:IH(),disabledIndices:v,modifierKeys:y}),k=tF(x,e,{state:o,ref:i,props:[C,...a,S],stateAttributesMapping:s}),A=W.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,G.jsx)(BI.Provider,{value:A,children:(0,G.jsx)($H,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}var NK=W.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:o,...s}=e,{orientation:c,setTabMap:l,tabActivationDirection:u}=gK(),[d,f]=W.useState(0),[p,m]=W.useState(null),h=W.useRef(new Set),g=W.useRef(new Set),_=W.useRef(null);Q(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{h.current.forEach(e=>{e()})});return _.current=e,p&&e.observe(p),g.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),_.current=null}},[p]);let v=Z(e=>(h.current.add(e),()=>{h.current.delete(e)})),y=Z(e=>(g.current.add(e),_.current?.observe(e),()=>{g.current.delete(e),_.current?.unobserve(e)})),b={orientation:c,tabActivationDirection:u},x={"aria-orientation":c===`vertical`?`vertical`:void 0,role:`tablist`},S=W.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:v,registerTabResizeObserverElement:y,tabsListElement:p}),[n,v,y,p]);return(0,G.jsx)(CK.Provider,{value:S,children:(0,G.jsx)(MK,{render:a,className:r,style:o,state:b,refs:[t,m],props:[x,s],stateAttributesMapping:vK,highlightedIndex:d,enableHomeAndEndKeys:!0,loopFocus:i,orientation:c,onHighlightedIndexChange:f,onMapChange:l,disabledIndices:IP})})}),PK=W.createContext(void 0);function FK(){return W.useContext(PK)}var IK=W.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:d=!0,style:f,...p}=e,m=pR(u||void 0),h=FK(),g=h?.value??[],_=(i||h?.disabled)??!1,[v,y]=NL({controlled:h?m!==void 0&&g.indexOf(m)>-1:s,default:r,name:`Toggle`,state:`pressed`}),{getButtonProps:b,buttonRef:x}=GI({disabled:_,native:d}),S={disabled:_,pressed:v},C=[x,t],w=[{"aria-pressed":v,onClick(e){let t=!v,n=_R(hL,e.nativeEvent);o?.(t,n),!n.isCanceled&&(m&&h?.setGroupValue?.(m,t,n),!n.isCanceled&&y(t))}},p,b],T=tF(`button`,e,{enabled:!h,state:S,ref:C,props:w}),E=W.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return h?(0,G.jsx)(GU,{tag:`button`,render:c,className:n,style:f,metadata:E,state:S,refs:C,props:w}):T}),LK=W.createContext(void 0);function RK(e){let t=W.useContext(LK);if(t===void 0&&!e)throw Error(lF(72));return t}var zK={...MV,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,appliedTriggerProps:(e,t)=>t?e.activeTriggerProps:void 0,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},BK=class extends CV{constructor(e,t,n){let r=new sV;super(VK(e,r,t,n),HK(r),zK)}setOpen=(e,t)=>{tV(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,_R(gL,e))}};function VK(e,t,n,r=!1){return{...EV(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function HK(e){return{popupRef:W.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var UK=fV(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=YB((e,t)=>new BK({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),rV(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=iV(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=W.useRef(null);Q(()=>{m&&t&&p.setOpen(!1,_R(OL))},[m,t,p]),Q(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),Q(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),W.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,_R(jL))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,G.jsxs)(LK.Provider,{value:p,children:[l&&(0,G.jsx)(XB,{handle:l,store:p}),T&&(0,G.jsx)(WK,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function WK({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=WB(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=VB(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=W.useMemo(()=>HP(a.reference,i.reference),[a.reference,i.reference]);return aV(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??LP}),null}var GK=W.createContext(void 0);function KK(){return W.useContext(GK)}var qK=`data-base-ui-tooltip-trigger`;function JK(e){let t=RR(e);return S(t)?t:null}var YK=pV(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=RK(!0),m=NV(a)??p;if(!m)throw Error(lF(82));let h=pR(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=W.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=nV(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=KK(),{activeIdRef:w,delayRef:T,isInstantPhase:E,hasProvider:D}=cz(v,{open:_}),O=VV(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),A=s??k,j=dz(A),M=m.useState(`trackCursorAxis`),N=m.useState(`disableHoverablePopup`),P=W.useRef(!1),F=VF(),I=W.useRef(void 0);function L(){return D&&w.current!=null?0:c??C??600}function R(e){let t=y.current;if(!t||!e)return!1;let n=LR(e,`[${qK}]`);return n!==null&&n!==t&&IR(t,n)}function z(e){let t=R(e);return P.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,F.clear()),t}let B=WV(v,{enabled:!A,mouseOnly:!0,move:!1,handleClose:!N&&M!==`both`?oH():null,restMs:L,delay(){return u==null&&D?{close:tz(T.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!P.current}}),ee=IV(v,{enabled:!A}).reference,te=e=>{let t=P.current,n=JK(e),r=z(n),i=y.current,a=i&&n&&IR(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,_R(_L,e));else if(t&&!r&&a&&!j.current&&!m.select(`open`)&&i&&NR(I.current)){let t=()=>{P.current||j.current||m.select(`open`)||m.setOpen(!0,_R(_L,e,i))},n=L();n===0?(F.clear(),t()):F.start(n,t)}},ne=m.useState(`appliedTriggerProps`,S||M!==`none`);return tF(`button`,e,{state:{open:_},ref:[t,x,y],props:[B,ee,ne,{onMouseOver(e){te(e.nativeEvent)},onFocus(e){R(JK(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){P.current=!1,F.clear(),I.current=void 0},onPointerEnter(e){I.current=e.pointerType},onPointerDown(e){I.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[GR]:A?``:void 0,[qK]:A?void 0:``},f],stateAttributesMapping:lL})}),XK=W.createContext(void 0);function ZK(){let e=W.useContext(XK);if(e===void 0)throw Error(lF(70));return e}var QK=W.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=vB({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,G.jsxs)(W.Fragment,{children:[l,c&&Zf.createPortal(n,c)]})}),$K=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return RK().useState(`mounted`)||n?(0,G.jsx)(XK.Provider,{value:n,children:(0,G.jsx)(QK,{ref:t,...r})}):null}),eq=W.createContext(void 0);function tq(){let e=W.useContext(eq);if(e===void 0)throw Error(lF(71));return e}var nq=W.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=pB,style:g,..._}=e,v=RK(),y=ZK(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=XH({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=cU(e,W.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,G.jsx)(eq.Provider,{value:D,children:O})}),rq=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=RK(),{side:s,align:c}=tq(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);jF({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),HV(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return tF(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[qB,f,bH(d),a],stateAttributesMapping:fL})}),iq=W.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=RK(),{arrowRef:s,side:c,align:l,arrowUncentered:u,arrowStyles:d}=tq();return tF(`div`,e,{state:{open:o.useState(`open`),side:c,align:l,uncentered:u,instant:o.useState(`instantType`)},ref:[t,s],props:[{style:d,"aria-hidden":!0},a],stateAttributesMapping:dL})}),aq=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=W.useMemo(()=>({open:t,close:n}),[t,n]);return(0,G.jsx)(GK.Provider,{value:t,children:(0,G.jsx)(sz,{delay:i,timeoutMs:r,children:e.children})})},oq=e=>{let{children:t,onSubmit:n,submitButton:r,...i}=e;return cb(i),(0,G.jsxs)(`form`,{className:`bn-form`,onSubmit:e=>{e.preventDefault(),n?.()},children:[t,r===`none`?null:r]})};function $(...e){return RI(F(e))}function sq({className:e,size:t=`default`,...n}){return(0,G.jsx)(pF,{"data-slot":`avatar`,"data-size":t,className:$(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function cq({className:e,...t}){return(0,G.jsx)(RF,{"data-slot":`avatar-image`,className:$(`aspect-square size-full rounded-full object-cover`,e),...t})}function lq({className:e,...t}){return(0,G.jsx)(HF,{"data-slot":`avatar-fallback`,className:$(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}var uq=B(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function dq({className:e,variant:t=`default`,render:n,...r}){return zI({defaultTagName:`span`,props:HP({className:$(uq({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var fq=B(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-9`,"icon-xs":`size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function pq({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,G.jsx)(JI,{"data-slot":`button`,className:$(fq({variant:t,size:n,className:e})),...r})}function mq({className:e,size:t=`default`,...n}){return(0,G.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:$(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground shadow-xs ring-1 ring-foreground/10 [--card-spacing:--spacing(6)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(4)] *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function hq({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`card-content`,className:$(`px-(--card-spacing)`,e),...t})}function gq({...e}){return(0,G.jsx)(RU,{"data-slot":`dropdown-menu`,...e})}function _q({...e}){return(0,G.jsx)(YU,{"data-slot":`dropdown-menu-trigger`,...e})}function vq({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,container:a,...o}){return(0,G.jsx)(MH,{container:a,children:(0,G.jsx)(SU,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,G.jsx)(kH,{"data-slot":`dropdown-menu-content`,className:$(`z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...o})})})}function yq({...e}){return(0,G.jsx)(TR,{"data-slot":`dropdown-menu-group`,...e})}function bq({className:e,inset:t,...n}){return(0,G.jsx)(ER,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:$(`px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8`,e),...n})}function xq({className:e,inset:t,variant:n=`default`,...r}){return(0,G.jsx)(OR,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:$(`group/dropdown-menu-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Sq({...e}){return(0,G.jsx)(BU,{"data-slot":`dropdown-menu-sub`,...e})}function Cq({className:e,inset:t,children:n,...r}){return(0,G.jsxs)(rW,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:$(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-8 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,G.jsx)(CW,{className:`ml-auto`})]})}function wq({align:e=`start`,alignOffset:t=-3,side:n=`right`,sideOffset:r=0,className:i,...a}){return(0,G.jsx)(vq,{"data-slot":`dropdown-menu-sub-content`,className:$(`w-auto min-w-[96px] rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,i),align:e,alignOffset:t,side:n,sideOffset:r,...a})}function Tq({className:e,children:t,checked:n,inset:r,...i}){return(0,G.jsxs)(bR,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":r,className:$(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,G.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,G.jsx)(xR,{children:(0,G.jsx)(xW,{})})}),t]})}function Eq({className:e,...t}){return(0,G.jsx)($U,{"data-slot":`dropdown-menu-separator`,className:$(`-mx-1 my-1 h-px bg-border`,e),...t})}function Dq({className:e,type:t,...n}){return(0,G.jsx)(VW,{type:t,"data-slot":`input`,className:$(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function Oq({className:e,...t}){return(0,G.jsx)(`label`,{"data-slot":`label`,className:$(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function kq({...e}){return(0,G.jsx)(YW,{"data-slot":`popover`,...e})}function Aq({...e}){return(0,G.jsx)(QW,{"data-slot":`popover-trigger`,...e})}function jq({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,container:a,...o}){return(0,G.jsx)(tG,{container:a,children:(0,G.jsx)(iG,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,G.jsx)(sG,{"data-slot":`popover-content`,className:$(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}var Mq=DG;function Nq({className:e,...t}){return(0,G.jsx)(PG,{"data-slot":`select-value`,className:$(`flex flex-1 text-left`,e),...t})}function Pq({className:e,size:t=`default`,children:n,...r}){return(0,G.jsxs)(MG,{"data-slot":`select-trigger`,"data-size":t,className:$(`flex w-fit items-center justify-between gap-1.5 rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,G.jsx)(FG,{render:(0,G.jsx)(SW,{className:`text-muted-foreground pointer-events-none size-4`})})]})}function Fq({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,container:s,...c}){return(0,G.jsx)(IG,{container:s,children:(0,G.jsx)(HG,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,G.jsxs)(XG,{"data-slot":`select-content`,"data-align-trigger":o,className:$(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...c,children:[(0,G.jsx)(Lq,{}),(0,G.jsx)(iK,{children:t}),(0,G.jsx)(Rq,{})]})})})}function Iq({className:e,children:t,...n}){return(0,G.jsxs)(sK,{"data-slot":`select-item`,className:$(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,G.jsx)(uK,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,G.jsx)(lK,{render:(0,G.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,G.jsx)(xW,{className:`pointer-events-none`})})]})}function Lq({className:e,...t}){return(0,G.jsx)(mK,{"data-slot":`select-scroll-up-button`,className:$(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,G.jsx)(wW,{})})}function Rq({className:e,...t}){return(0,G.jsx)(pK,{"data-slot":`select-scroll-down-button`,className:$(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,G.jsx)(SW,{})})}function zq({className:e,...t}){return(0,G.jsx)(`div`,{"data-slot":`skeleton`,className:$(`animate-pulse rounded-md bg-muted`,e),...t})}function Bq({className:e,orientation:t=`horizontal`,...n}){return(0,G.jsx)(yK,{"data-slot":`tabs`,"data-orientation":t,className:$(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Vq=B(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Hq({className:e,variant:t=`default`,...n}){return(0,G.jsx)(NK,{"data-slot":`tabs-list`,"data-variant":t,className:$(Vq({variant:t}),e),...n})}function Uq({className:e,...t}){return(0,G.jsx)(TK,{"data-slot":`tabs-trigger`,className:$(`relative 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 text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function Wq({className:e,...t}){return(0,G.jsx)(OK,{"data-slot":`tabs-content`,className:$(`flex-1 text-sm outline-none`,e),...t})}var Gq=B(`group/toggle inline-flex items-center justify-center gap-1 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent shadow-xs hover:bg-muted`},size:{default:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-10 min-w-10 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}});function Kq({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,G.jsx)(IK,{"data-slot":`toggle`,className:$(Gq({variant:t,size:n,className:e})),...r})}function qq({delay:e=0,...t}){return(0,G.jsx)(aq,{"data-slot":`tooltip-provider`,delay:e,...t})}function Jq({...e}){return(0,G.jsx)(UK,{"data-slot":`tooltip`,...e})}function Yq({...e}){return(0,G.jsx)(YK,{"data-slot":`tooltip-trigger`,...e})}function Xq({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,container:o,...s}){return(0,G.jsx)($K,{container:o,children:(0,G.jsx)(nq,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,G.jsxs)(rq,{"data-slot":`tooltip-content`,className:$(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[a,(0,G.jsx)(iq,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var Zq={Avatar:{Avatar:sq,AvatarFallback:lq,AvatarImage:cq},Badge:{Badge:dq},Button:{Button:pq},Card:{Card:mq,CardContent:hq},DropdownMenu:{DropdownMenu:gq,DropdownMenuCheckboxItem:Tq,DropdownMenuContent:vq,DropdownMenuGroup:yq,DropdownMenuItem:xq,DropdownMenuLabel:bq,DropdownMenuSeparator:Eq,DropdownMenuSub:Sq,DropdownMenuSubContent:wq,DropdownMenuSubTrigger:Cq,DropdownMenuTrigger:_q},Input:{Input:Dq},Label:{Label:Oq},Popover:{Popover:kq,PopoverContent:jq,PopoverTrigger:Aq},Select:{Select:Mq,SelectContent:Fq,SelectItem:Iq,SelectTrigger:Pq,SelectValue:Nq},Skeleton:{Skeleton:zq},Tabs:{Tabs:Bq,TabsContent:Wq,TabsList:Hq,TabsTrigger:Uq},Toggle:{Toggle:Kq},Tooltip:{Tooltip:Jq,TooltipContent:Xq,TooltipProvider:qq,TooltipTrigger:Yq}},Qq=(0,W.createContext)(void 0);function $q(){return(0,W.useContext)(Qq)}var eJ=(0,W.forwardRef)((e,t)=>{let{className:n,name:r,label:i,variant:a,icon:o,value:s,autoFocus:c,placeholder:l,disabled:u,onKeyDown:d,onChange:f,autoComplete:p,"aria-activedescendant":m,rightSection:h,...g}=e;cb(g);let _=xP([pP(c),t]),v=$q();return(0,G.jsxs)(`div`,{className:$(n,`border-input bg-background ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`,`text-foreground items-center gap-2`),children:[o,(0,G.jsxs)(`div`,{className:`flex-1`,children:[i&&(0,G.jsx)(v.Label.Label,{htmlFor:i,children:i}),(0,G.jsx)(v.Input.Input,{className:$(n,`h-auto border-none p-0`),id:i,name:r,placeholder:l,disabled:u,value:s,onKeyDown:d,onChange:f,ref:_,"aria-activedescendant":m})]}),h]})});function tJ(e){return e?{onFocusCapture(e){let t=e.relatedTarget;t instanceof HTMLElement&&!e.currentTarget.contains(t)&&t.focus({preventScroll:!0})}}:{}}var nJ=(0,W.createContext)({portalElement:null,preventFocusOnOpen:!1}),rJ=e=>{let{children:t,onOpenChange:n,position:r,portalElement:i,preventFocusOnOpen:a,sub:o,...s}=e;cb(s);let c=$q(),l={portalElement:i,preventFocusOnOpen:a??!1};return o?(0,G.jsx)(c.DropdownMenu.DropdownMenuSub,{onOpenChange:n,children:(0,G.jsx)(nJ.Provider,{value:l,children:t})}):(0,G.jsx)(c.DropdownMenu.DropdownMenu,{modal:!1,onOpenChange:n,children:(0,G.jsx)(nJ.Provider,{value:l,children:t})})},iJ=e=>{let{children:t,sub:n,...r}=e;cb(r);let i=$q();return n?(0,G.jsx)(i.DropdownMenu.DropdownMenuSubTrigger,{children:t}):(0,G.jsx)(i.DropdownMenu.DropdownMenuTrigger,{render:t})},aJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,sub:i,...a}=e;cb(a);let o=$q(),{portalElement:s,preventFocusOnOpen:c}=(0,W.useContext)(nJ);return i?(0,G.jsx)(o.DropdownMenu.DropdownMenuSubContent,{className:n,container:s,ref:t,children:r}):(0,G.jsx)(o.DropdownMenu.DropdownMenuContent,{className:n,container:s,ref:t,...tJ(c),children:r})}),oJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,checked:a,disabled:o,subTrigger:s,onClick:c,...l}=e;cb(l);let u=$q();return s?(0,G.jsxs)(G.Fragment,{children:[i,r]}):a===void 0?(0,G.jsxs)(u.DropdownMenu.DropdownMenuItem,{className:n,ref:t,onClick:c,disabled:o,onMouseDown:SP,...l,children:[i,r,s&&(0,G.jsx)(CW,{className:`ml-auto h-4 w-4`})]}):(0,G.jsxs)(u.DropdownMenu.DropdownMenuCheckboxItem,{className:$(n,`gap-1`,a?``:`px-2`),ref:t,checked:a,onClick:c,disabled:o,onMouseDown:SP,...l,children:[i,r]})}),sJ=(0,W.forwardRef)((e,t)=>{let{className:n,...r}=e;cb(r);let i=$q();return(0,G.jsx)(i.DropdownMenu.DropdownMenuSeparator,{className:n,ref:t})}),cJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;cb(i);let a=$q();return(0,G.jsx)(a.DropdownMenu.DropdownMenuGroup,{children:(0,G.jsx)(a.DropdownMenu.DropdownMenuLabel,{className:n,ref:t,children:r})})}),lJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,label:l,...u}=e;cb(u,!1);let d=$q();return(0,G.jsxs)(d.Button.Button,{variant:`ghost`,className:$(n,`text-gray-400`),ref:t,"aria-label":l,onClick:a,onDragStart:s,onDragEnd:o,draggable:c,...u,children:[i,r]})}),uJ=(0,W.forwardRef)((e,t)=>{let{className:n,tabs:r,defaultOpenTab:i,openTab:a,setOpenTab:o,loading:s,...c}=e;cb(c);let l=$q();return(0,G.jsxs)(l.Tabs.Tabs,{className:$(n,`bg-popover max-w-screen rounded-lg p-2`),ref:t,value:a,defaultValue:i,onValueChange:o,children:[(0,G.jsx)(l.Tabs.TabsList,{children:r.map(e=>(0,G.jsx)(l.Tabs.TabsTrigger,{value:e.name,children:e.name},e.name))}),r.map(e=>(0,G.jsx)(l.Tabs.TabsContent,{value:e.name,children:(0,G.jsx)(l.Card.Card,{children:(0,G.jsx)(l.Card.CardContent,{className:`p-4`,children:e.tabPanel})})},e.name))]})}),dJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return cb(i),(0,G.jsx)(`div`,{className:$(n,`flex flex-col items-start justify-center gap-2`),ref:t,children:r})}),fJ=(0,W.forwardRef)((e,t)=>{let{className:n,value:r,placeholder:i,onKeyDown:a,onChange:o,...s}=e;cb(s);let c=$q();return(0,G.jsx)(c.Input.Input,{"data-test":`embed-input`,className:$(n,`w-80 max-w-full`),ref:t,value:r,placeholder:i,onKeyDown:a,onChange:o})}),pJ=(0,W.createContext)(null),mJ=e=>{let{children:t,open:n,onOpenChange:r,position:i,portalElement:a,...o}=e;cb(o);let s=$q();return(0,G.jsx)(s.Popover.Popover,{open:n,onOpenChange:r,children:(0,G.jsx)(pJ.Provider,{value:a,children:t})})},hJ=(0,W.forwardRef)((e,t)=>{let{children:n,...r}=e;cb(r);let i=$q();return(0,G.jsx)(i.Popover.PopoverTrigger,{ref:t,render:n})}),gJ=(0,W.forwardRef)((e,t)=>{let{className:n,variant:r,children:i,...a}=e;cb(a);let o=$q(),s=(0,W.useContext)(pJ);return(0,G.jsx)(o.Popover.PopoverContent,{sideOffset:8,container:s,initialFocus:!1,className:$(n,`flex flex-col gap-2`,r===`panel-popover`?`w-fit max-w-none border-none p-0 shadow-none`:``),ref:t,children:i})}),_J=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return cb(i,!1),(0,G.jsx)(`div`,{className:n,ref:t,...i,children:r})}),vJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,icon:i,onClick:a,onDragEnd:o,onDragStart:s,draggable:c,label:l,...u}=e;cb(u,!1);let d=$q();return(0,G.jsxs)(d.Button.Button,{variant:`ghost`,className:$(n,`text-gray-400`),ref:t,"aria-label":l,onClick:a,onDragStart:s,onDragEnd:o,draggable:c,...u,children:[i,r]})}),yJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,id:i,columns:a,...o}=e;return cb(o),(0,G.jsx)(`div`,{className:$(`bg-popover text-popover-foreground z-50 min-w-32 overflow-x-hidden overflow-y-auto rounded-md p-1 shadow-md ring-1 ring-foreground/10`,`grid`,n),style:{gridTemplateColumns:`repeat(${a}, 1fr)`},ref:t,id:i,role:`grid`,children:r})}),bJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return cb(a),(0,G.jsx)(`div`,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:r})}),xJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,id:i,...a}=e;return cb(a),(0,G.jsx)(`div`,{id:i,role:`listbox`,className:$(`bg-popover text-popover-foreground z-50 min-w-32 overflow-x-hidden overflow-y-auto rounded-md p-1 shadow-md ring-1 ring-foreground/10`,n),ref:t,children:r})}),SJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return cb(i),(0,G.jsx)(`div`,{className:$(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,n),ref:t,children:(0,G.jsx)(`div`,{children:r})})}),CJ=(0,W.forwardRef)((e,t)=>{let n=$q(),{className:r,item:i,isSelected:a,onClick:o,id:s,...c}=e;cb(c);let l=(0,W.useRef)(null);return(0,W.useEffect)(()=>{l.current&&a&&yP(l.current,l.current.closest(`.bn-suggestion-menu, #ai-suggestion-menu`))!==`none`&&l.current.scrollIntoView({block:`nearest`})},[a]),(0,G.jsxs)(`div`,{className:$(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,e.item.size===`small`?`gap-3 py-1`:``,r),"data-highlighted":!0,ref:bP([t,l]),id:s,onMouseDown:e=>e.preventDefault(),onClick:o,role:`option`,"aria-selected":a||void 0,children:[i.icon&&(0,G.jsx)(`div`,{className:$(`p-3`,e.item.size===`small`?`p-0`:``,r),"data-position":`left`,children:i.icon}),(0,G.jsxs)(`div`,{className:`flex-1`,children:[(0,G.jsx)(`div`,{className:$(`text-base`,e.item.size===`small`?`text-sm`:``,r),children:i.title}),(0,G.jsx)(`div`,{className:$(`text-xs`,e.item.size===`small`?`hidden`:``,r),children:i.subtext})]}),i.badge&&(0,G.jsx)(`div`,{"data-position":`right`,className:`text-xs`,children:(0,G.jsx)(n.Badge.Badge,{variant:`secondary`,children:i.badge})})]})}),wJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return cb(i),(0,G.jsx)(`div`,{className:$(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,n),ref:t,children:r})}),TJ=(0,W.forwardRef)((e,t)=>{let{className:n,...r}=e;return cb(r),(0,G.jsx)(`div`,{className:$(n,`animate-spin`),ref:t,children:(0,G.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,height:`1em`,viewBox:`0 -960 960 960`,width:`1em`,fill:`#e8eaed`,children:(0,G.jsx)(`path`,{d:`M480-80q-82 0-155-31.5t-127.5-86Q143-252 111.5-325T80-480q0-83 31.5-155.5t86-127Q252-817 325-848.5T480-880q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800q-133 0-226.5 93.5T160-480q0 133 93.5 226.5T480-160q133 0 226.5-93.5T800-480q0-17 11.5-28.5T840-520q17 0 28.5 11.5T880-480q0 82-31.5 155t-86 127.5q-54.5 54.5-127 86T480-80Z`})})})}),EJ=(0,W.forwardRef)((e,t)=>{let{className:n,markClassName:r,backgroundColor:i,children:a,...o}=e;return cb(o),(0,G.jsx)(`span`,{className:$(n,r),style:r?void 0:{backgroundColor:i},ref:t,children:a})}),DJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,onMouseDown:i,onClick:a,...o}=e;cb(o,!1);let s=$q();return(0,G.jsx)(s.Button.Button,{variant:`ghost`,className:$(n,`h-full w-full p-0 text-gray-400`,n?.includes(`extend-button-add-remove-columns`)?`ml-1`:`mt-1`,n?.includes(`extend-button-editing`)?`bg-accent text-accent-foreground`:``),ref:t,onClick:a,onMouseDown:i,...o,children:r})}),OJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,draggable:i,onDragStart:a,onDragEnd:o,style:s,label:c,...l}=e;cb(l,!1);let u=$q();return(0,G.jsx)(u.Button.Button,{variant:`ghost`,className:$(n,`h-fit w-fit p-0 text-gray-400`),ref:t,"aria-label":c,draggable:i,onDragStart:a,onDragEnd:o,style:s,...l,children:r})}),kJ=(0,W.forwardRef)((e,t)=>{let{className:n,"aria-label":r,children:i,onMouseEnter:a,onMouseLeave:o,trapFocus:s,variant:c,...l}=e;cb(l);let u=$q();return(0,G.jsx)(u.Tooltip.TooltipProvider,{delay:0,children:(0,G.jsx)(`div`,{className:$(n,`bg-popover text-popover-foreground flex h-fit gap-1 rounded-lg border p-1 shadow-md`,c===`action-toolbar`?`w-fit`:``),role:`toolbar`,"aria-label":r,ref:t,onMouseEnter:a,onMouseLeave:o,children:i})})}),AJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,mainTooltip:i,secondaryTooltip:a,icon:o,isSelected:s,isDisabled:c,onClick:l,label:u,variant:d,onMouseDown:f,...p}=e;cb(p,!1);let m=$q(),h=pp(),g=e=>{SP(e),f?.(e)},_=s===void 0?(0,G.jsxs)(m.Button.Button,{className:$(n,d===`compact`?`h-6 min-w-6 p-0`:``),variant:`ghost`,size:d===`compact`?`sm`:`default`,disabled:c,onClick:l,ref:t,"aria-label":u,...p,onMouseDown:g,children:[o,r]}):(0,G.jsxs)(m.Toggle.Toggle,{className:$(n,`aria-expanded:bg-accent aria-expanded:text-accent-foreground`,d===`compact`?`h-6 min-w-6 p-0`:``),size:d===`compact`?`sm`:`default`,"aria-label":u,onClick:l,pressed:s,disabled:c,ref:t,...p,onMouseDown:g,children:[o,r]});return(0,G.jsxs)(m.Tooltip.Tooltip,{children:[(0,G.jsx)(m.Tooltip.TooltipTrigger,{render:_}),(0,G.jsxs)(m.Tooltip.TooltipContent,{container:h,className:`flex flex-col items-center whitespace-pre-wrap`,children:[(0,G.jsx)(`span`,{children:i}),a&&(0,G.jsx)(`span`,{children:a})]})]})}),jJ=(0,W.forwardRef)((e,t)=>{let{className:n,items:r,isDisabled:i,portalElement:a,preventFocusOnOpen:o,...s}=e;cb(s);let c=$q(),l=e=>(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.icon,e.text]}),u=r.filter(e=>e.isSelected)[0];return u?(0,G.jsxs)(c.Select.Select,{value:u.text,onValueChange:e=>r.find(t=>t.text===e).onClick?.(),disabled:i,children:[(0,G.jsx)(c.Select.SelectTrigger,{className:`border-none`,onMouseDown:SP,children:(0,G.jsx)(c.Select.SelectValue,{})}),(0,G.jsx)(c.Select.SelectContent,{className:n,container:a,alignItemWithTrigger:!1,ref:t,...tJ(o??!1),children:r.map(e=>(0,G.jsx)(c.Select.SelectItem,{disabled:e.isDisabled,value:e.text,onMouseDown:SP,children:(0,G.jsx)(l,{...e})},e.text))})]}):null}),MJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,selected:i,headerText:a,onFocus:o,onBlur:s,tabIndex:c,...l}=e;cb(l);let u=$q();return(0,G.jsxs)(u.Card.Card,{className:$(n,`w-[300px]`,i?`bg-accent text-accent-foreground`:``),onFocus:o,onBlur:s,tabIndex:c,ref:t,children:[a&&(0,G.jsx)(`div`,{className:`px-4 pt-4 text-sm italic`,children:a}),r]})}),NJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;return cb(i),(0,G.jsx)(`div`,{className:$(n,`p-4`,n?.includes(`thread-comments`)?`flex flex-col gap-6 border-b`:``),ref:t,children:r})}),PJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;cb(i,!1);let a=$q();return(0,G.jsx)(a.Button.Button,{className:$(n,`text-foreground w-fit bg-transparent p-0 hover:bg-transparent`),ref:t,children:r})}),FJ=(0,W.forwardRef)((e,t)=>{let{authorInfo:n,timeString:r,edited:i,...a}=e,o=wp();cb(a,!1);let s=$q();return n===`loading`?(0,G.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-4`,children:[(0,G.jsx)(s.Skeleton.Skeleton,{className:`size-7 animate-pulse rounded-full bg-neutral-400`}),(0,G.jsx)(s.Skeleton.Skeleton,{className:`h-3 w-32 animate-pulse rounded-full bg-neutral-400`})]}):(0,G.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-4`,children:[(0,G.jsxs)(s.Avatar.Avatar,{children:[(0,G.jsx)(s.Avatar.AvatarImage,{src:n.avatarUrl,alt:n.username,className:`h-7 rounded-full`}),(0,G.jsx)(s.Avatar.AvatarFallback,{children:n.username[0]})]}),(0,G.jsxs)(`div`,{className:`flex flex-row flex-nowrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:`text-sm font-bold`,children:n.username}),(0,G.jsxs)(`span`,{className:`text-xs`,children:[r,` `,i&&`(${o.comments.edited})`]})]})]})}),IJ=(0,W.forwardRef)((e,t)=>{let{className:n,showActions:r,authorInfo:i,timeString:a,actions:o,edited:s,emojiPickerOpen:c,children:l,...u}=e;cb(u);let[d,f]=(0,W.useState)(!1),{focused:p,ref:m}=hP(),h=o&&(r===!0||r===void 0||r===`hover`&&d||p||c);return(0,G.jsxs)(`div`,{ref:t,className:$(n,`relative flex flex-col gap-2`),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[h?(0,G.jsx)(`div`,{className:`absolute top-0 right-0 z-10`,ref:m,children:o}):null,(0,G.jsx)(FJ,{...e}),l]})}),LJ=(0,W.forwardRef)((e,t)=>{let{className:n,onFocus:r,onBlur:i,autoFocus:a,editor:o,editable:s,...c}=e;cb(c);let l=ep();return(0,G.jsx)(XJ,{autoFocus:a,className:$(n,``),theme:l?.colorSchemePreference,editor:e.editor,sideMenu:!1,slashMenu:!1,tableHandles:!1,filePanel:!1,formattingToolbar:!1,editable:s,ref:t,onFocus:r,onBlur:i,children:(0,G.jsx)(hM,{formattingToolbar:RJ})})}),RJ=()=>{let e=rM([]).filter(e=>e.key!==`nestBlockButton`&&e.key!==`unnestBlockButton`);return(0,G.jsx)(iM,{blockTypeSelectItems:[],children:e})},zJ=(0,W.forwardRef)((e,t)=>{let{className:n,text:r,icon:i,isSelected:a,mainTooltip:o,secondaryTooltip:s,onClick:c,onMouseEnter:l,...u}=e;cb(u,!1);let d=$q(),f=pp(),p=(0,G.jsxs)(d.Button.Button,{variant:a?`secondary`:`outline`,className:$(n,`flex h-7 items-center gap-1 rounded-full px-2.5`),onClick:c,onMouseEnter:l,ref:t,children:[(0,G.jsx)(`span`,{children:i}),(0,G.jsx)(`span`,{children:r})]});return o?(0,G.jsxs)(d.Tooltip.Tooltip,{children:[(0,G.jsx)(d.Tooltip.TooltipTrigger,{render:p}),(0,G.jsxs)(d.Tooltip.TooltipContent,{container:f,className:`flex flex-col items-center whitespace-pre-wrap`,children:[(0,G.jsx)(`span`,{children:o}),s&&(0,G.jsx)(`span`,{children:s})]})]}):p}),BJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,...i}=e;cb(i);let a=$q();return(0,G.jsx)(a.Tooltip.TooltipProvider,{delay:0,children:(0,G.jsx)(`div`,{className:$(n,`flex w-full flex-row flex-wrap gap-1`),ref:t,children:r})})}),VJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,"aria-label":i,...a}=e;return cb(a,!1),(0,G.jsx)(`div`,{className:$(n,`flex min-h-0 flex-1 flex-col overflow-hidden px-4`),ref:t,role:`region`,"aria-label":i,children:r})});function HJ(e){let{className:t,title:n,actions:r,closeAction:i,...a}=e;return cb(a,!1),(0,G.jsxs)(`div`,{className:$(t,`flex shrink-0 items-center justify-between pt-4 pb-2`),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`h2`,{className:`text-card-foreground m-0 text-lg font-bold`,children:n}),r]}),i]})}function UJ(e){let t=$q();return e.mode===`display`?(0,G.jsx)(`span`,{className:`bn-snapshot-name`,children:e.value}):(0,G.jsx)(`span`,{className:`bn-snapshot-name-sizer`,"data-value":e.value===``?e.placeholder:e.value,children:(0,G.jsx)(t.Input.Input,{ref:e.inputRef,className:`bn-snapshot-name h-auto shadow-none focus-visible:ring-0`,type:`text`,value:e.value,placeholder:e.placeholder,"aria-label":e[`aria-label`],onChange:e.onChange,onClick:e.onClick,onKeyDown:e.onKeyDown,onBlur:e.onBlur})})}var WJ=(0,W.forwardRef)((e,t)=>{let{className:n,id:r,"aria-label":i,state:a,tabIndex:o,"aria-busy":s,onClick:c,onKeyDown:l,onFocus:u,actions:d,name:f,date:p,restoredFrom:m,secondaryLabel:h,comparingLabel:g,comparingIcon:_,...v}=e;cb(v,!1);let y=$q();return(0,G.jsxs)(y.Card.Card,{className:$(n,`group relative mb-1 flex w-full cursor-pointer flex-col gap-1.5 overflow-visible rounded-lg border border-transparent px-3.5 py-3 text-card-foreground shadow-none transition-colors hover:bg-accent focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`,(a===`selected`||a===`comparison-source`)&&`selected bg-primary text-primary-foreground hover:bg-primary focus-visible:-outline-offset-4 focus-visible:outline-primary-foreground`,a===`comparison-baseline`&&`comparing bg-primary/10`,(a===`comparison-source`||a===`comparison-baseline`)&&`border-primary ring-1 ring-primary`),id:r,role:`listitem`,"aria-label":i,"aria-current":a===`selected`||a===`comparison-source`?`true`:void 0,"aria-busy":s,tabIndex:o,onClick:c,onKeyDown:l,onFocus:u,ref:t,children:[g&&(0,G.jsxs)(`div`,{className:`bn-snapshot-comparing-to text-primary dark:text-primary flex items-center gap-1 text-[13px] font-semibold`,children:[_,(0,G.jsx)(`span`,{children:g})]}),(0,G.jsxs)(`div`,{className:`bn-snapshot-body flex flex-col gap-0.5 text-[13px]`,children:[(0,G.jsx)(`div`,{className:`bn-snapshot-title-row flex min-h-5 min-w-0 items-center gap-1.5 pr-5`,children:f}),p&&(0,G.jsx)(`div`,{className:`bn-snapshot-date leading-[1.3]`,children:p}),m&&(0,G.jsx)(`div`,{className:`bn-snapshot-original-date text-muted-foreground leading-[1.3]`,children:m}),h&&(0,G.jsx)(`div`,{className:`bn-snapshot-secondary-label text-muted-foreground leading-[1.3]`,children:h})]}),d&&(0,G.jsx)(`div`,{className:`bn-snapshot-menu absolute top-2 right-2 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 group-focus-visible:opacity-100`,onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:d})]})}),GJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,type:i,onClick:a,label:o,...s}=e;cb(s);let c=$q();return(0,G.jsx)(c.Button.Button,{type:i,className:n,"aria-label":o,ref:t,onClick:a,children:r})}),KJ=(0,W.forwardRef)((e,t)=>{let{className:n,accept:r,value:i,placeholder:a,onChange:o,...s}=e;cb(s);let c=$q();return(0,G.jsx)(c.Input.Input,{type:`file`,className:n,ref:t,accept:r,value:i?i.name:void 0,onChange:async e=>o?.(e.target.files[0]),placeholder:a})}),qJ=(0,W.forwardRef)((e,t)=>{let{className:n,isSelected:r,onClick:i,item:a,id:o,...s}=e;cb(s);let c=(0,W.useRef)(null);return(0,W.useEffect)(()=>{c.current&&r&&yP(c.current,c.current.closest(`.bn-grid-suggestion-menu`))!==`none`&&c.current.scrollIntoView({block:`nearest`})},[r]),(0,G.jsx)(`div`,{className:$(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*=text-])]:text-muted-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm p-2 text-sm data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[disabled]:opacity-50 [&_svg:not([class*=size-])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,`hover:bg-accent hover:text-accent-foreground data-[variant=destructive]:hover:bg-destructive/10 dark:data-[variant=destructive]:hover:bg-destructive/20 data-[variant=destructive]:hover:text-destructive`,`aria-selected:bg-accent aria-selected:text-accent-foreground data-[variant=destructive]:aria-selected:bg-destructive/10 dark:data-[variant=destructive]:aria-selected:bg-destructive/20 data-[variant=destructive]:aria-selected:text-destructive`,`text-base!`,n),ref:bP([t,c]),id:o,role:`option`,onClick:i,"aria-selected":r||void 0,children:a.icon})}),JJ=(0,W.forwardRef)((e,t)=>{let{className:n,children:r,columns:i,...a}=e;return cb(a),(0,G.jsx)(`div`,{className:n,style:{gridColumn:`1 / ${i+1}`},ref:t,children:r})}),YJ={FormattingToolbar:{Root:kJ,Button:AJ,Select:jJ},FilePanel:{Root:uJ,Button:GJ,FileInput:KJ,TabPanel:dJ,TextInput:fJ},LinkToolbar:{Root:kJ,Button:AJ,Select:jJ},SideMenu:{Root:_J,Button:vJ},SuggestionMenu:{Root:xJ,Item:CJ,EmptyItem:SJ,Label:wJ,Loader:TJ},GridSuggestionMenu:{Root:yJ,Item:qJ,EmptyItem:bJ,Loader:JJ},TableHandle:{Root:OJ,ExtendButton:DJ},Comments:{Comment:IJ,Editor:LJ,Card:MJ,CardSection:NJ,ExpandSectionsPrompt:PJ},Versioning:{Sidebar:VJ,Header:HJ,Name:UJ,Snapshot:WJ,Loader:TJ},AttributionTooltip:{Root:EJ},Generic:{Badge:{Root:zJ,Group:BJ},Toolbar:{Root:kJ,Button:AJ,Select:jJ},Form:{Root:oq,TextInput:eJ},Menu:{Root:rJ,Trigger:iJ,Dropdown:aJ,Divider:sJ,Label:cJ,Item:oJ,Button:lJ},Popover:{Root:mJ,Trigger:hJ,Content:gJ}}},XJ=e=>{let{className:t,shadCNComponents:n,...r}=e,i=(0,W.useMemo)(()=>({...Zq,...n}),[n]);return(0,G.jsx)(Qq.Provider,{value:i,children:(0,G.jsx)(Sp.Provider,{value:YJ,children:(0,G.jsx)(LN,{className:db(`bn-shadcn`,t||``),...r})})})},ZJ={"doc/data":fe(ve({item:le}),ve({data:pe(be(),ye()),sources:ue(de({id:be()})).optional()}),`The numbers a doc's charts read from the project's files (a sheet's table, a CSV, a data file of rows): what its editor draws them with.`),"doc/pages":fe(ve({item:le,width:ge().min(100).max(2400).optional()}),ve({pages:ue(ve({n:ge().positive(),width:_e().positive(),height:_e().positive(),landscape:he(),image:me})),blocks:ue(ve({n:ge().nonnegative(),places:ue(ve({page:ge().positive(),top:_e(),bottom:_e(),left:_e(),right:_e()}))}))}),"A doc's pages as render prints them, each a picture, and where each of its blocks lies on them: what its page view shows, measured as `allyhub inspect pages` measures them.")},QJ=xe(ZJ);function $J(e){let t;try{t=JSON.parse(e)}catch{return[]}if(!Array.isArray(t))return[];let n=e=>typeof e==`string`&&e!==``?e:void 0;return t.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e,r=n(t.delta),i=n(t.note),a=Array.isArray(t.trend)?t.trend.filter(e=>typeof e==`number`):[];return[{label:typeof t.label==`string`?t.label:``,value:typeof t.value==`string`?t.value:``,...r===void 0?{}:{delta:r},...i===void 0?{}:{note:i},...t.downIsGood===!0?{downIsGood:!0}:{},...a.length<2?{}:{trend:a}}]})}function eY(e){return JSON.stringify(Object.fromEntries(Object.entries(e).filter(([e])=>e!==`type`)))}function tY(e){if(typeof e==`string`)try{let t=JSON.parse(e);return typeof t.of!=`string`||t.of===``?void 0:{type:`component`,of:t.of,...typeof t.width==`number`?{width:t.width}:{},...typeof t.height==`number`?{height:t.height}:{},...typeof t.at==`number`?{at:t.at}:{},...typeof t.alt==`string`?{alt:t.alt}:{},...typeof t.caption==`string`?{caption:t.caption}:{},...t.align===`center`||t.align===`right`?{align:t.align}:{},props:Object.fromEntries(Object.entries(t.props??{}).filter(e=>typeof e[1]==`string`))}}catch{return}}function nY(e){return JSON.stringify(Object.fromEntries(Object.entries(e).filter(([e])=>e!==`type`)))}var rY=[...Se,`none`];function iY(e){if(typeof e!=`string`)return;let t;try{t=JSON.parse(e)}catch{return}let n=t.kind;if(typeof n!=`string`||!Ce.includes(n))return;let r=e=>typeof t[e]==`string`?{[e]:t[e]}:{},i=e=>typeof t[e]==`number`&&Number.isFinite(t[e])?{[e]:t[e]}:{},a=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`)?e:void 0,o=Array.isArray(t.table)?t.table.map(a):void 0,s=a(t.series),c=a(t.colors),l=a(t.labels)?.filter(e=>ta.includes(e)),u=t.legend;return{type:`chart`,kind:n,...r(`title`),...o?.every(e=>e!==void 0)?{table:o}:{},...r(`data`),...r(`categories`),...s===void 0?{}:{series:s},...typeof u==`string`&&rY.includes(u)?{legend:u}:{},...l===void 0?{}:{labels:l},...r(`format`),...i(`min`),...i(`max`),...c===void 0?{}:{colors:c},...t.smooth===!0?{smooth:!0}:{},...i(`width`),...i(`height`),...r(`alt`),...r(`id`)}}var aY={[Va.math]:`math`,[Va.mermaid]:`diagram`},oY=`default`,sY=`💡`,cY={paragraph:`paragraph`,heading:`heading`,bullet:`bulletListItem`,numbered:`numberedListItem`,check:`checkListItem`,toggle:`toggleListItem`,quote:`quote`};function lY(e){let t=Object.keys(e).sort();return t.length===0?``:JSON.stringify(Object.fromEntries(t.map(t=>[t,e[t]])))}var uY=[`bold`,`italic`,`underline`,`strike`,`code`];function dY(e){if(typeof e!=`string`||e===``)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!=`object`||!t)return{};let n=t,r=n.color,i=n.background;return{...Object.fromEntries(uY.filter(e=>n[e]===!0).map(e=>[e,!0])),...typeof r==`string`?{color:r}:{},...typeof i==`string`?{background:i}:{}}}function fY(e){let t=[];for(let n of e){if(n.cite!==void 0){t.push({type:`citation`,props:{cite:n.cite,styles:lY(n.styles)}});continue}if(n.text===``&&n.href?.startsWith(`#`)===!0){t.push({type:`reference`,props:{target:n.href.slice(1),styles:lY(n.styles)}});continue}if(n.note!==void 0){t.push({type:`footnote`,props:{label:n.note,styles:lY(n.styles),href:n.href??``}});continue}let e=n.styles,r={type:`text`,text:n.text,styles:{...e.bold?{bold:!0}:{},...e.italic?{italic:!0}:{},...e.underline?{underline:!0}:{},...e.strike?{strike:!0}:{},...e.code?{code:!0}:{},...e.color===void 0?{}:{textColor:e.color},...e.background===void 0?{}:{backgroundColor:e.background},...e.tag===void 0?{}:{tag:e.tag}}};if(n.href===void 0){t.push(r);continue}let i=t.at(-1);i?.type===`link`&&i.href===n.href?i.content.push(r):t.push({type:`link`,href:n.href,content:[r]})}return t}var pY=e=>({textAlignment:e?.align??`left`,textColor:e?.color??oY,backgroundColor:e?.background??oY});function mY(e){let t={...e};delete t.children;let n=JSON.stringify(t),r=2166136261;for(let e=0;e<n.length;e++)r=Math.imul(r^n.charCodeAt(e),16777619)>>>0;return r.toString(36)}var hY=new Map,gY=e=>e.type===`image`&&e.id!==void 0?{id:e.id}:e.type===`table`&&(e.id!==void 0||e.caption!==void 0)?{...e.id===void 0?{}:{id:e.id},...e.caption===void 0?{}:{caption:e.caption}}:void 0;function _Y(e){let t=new Map,n=(e,r)=>e.map((e,i)=>{let a=r[i];if(!a)return e;let o=mY(a),s=t.get(o)??0;t.set(o,s+1);let c=`d${o}${s===0?``:`-${String(s)}`}`,l=gY(a);if(l&&hY.set(c,l),a.type===`columns`)return{...e,id:c,children:(e.children??[]).map((e,t)=>({...e,id:`${c}-c${String(t)}`,children:n(e.children??[],a.columns[t]?.blocks??[])}))};let u=`children`in a?a.children??[]:[];return{...e,id:c,...e.children?{children:n(e.children,u)}:{}}});return n(vY(e),e)}function vY(e){return e.map(e=>{switch(e.type){case`paragraph`:case`bullet`:case`toggle`:case`quote`:case`heading`:case`numbered`:case`check`:return{type:cY[e.type]??`paragraph`,props:{...pY(e.look),...e.type===`heading`?{level:e.level,isToggleable:e.toggle===!0}:{},...e.type===`numbered`&&e.start!==void 0?{start:e.start}:{},...e.type===`check`?{checked:e.checked}:{}},content:fY(e.content),children:vY(e.children??[])};case`card`:return{type:`card`,props:{subtitle:e.subtitle??``},content:e.title===void 0?[]:[{type:`text`,text:e.title,styles:{}}],children:vY(e.children??[])};case`stats`:return{type:`stats`,props:{data:JSON.stringify(e.stats)}};case`callout`:return{type:`callout`,props:{icon:e.icon??``,textColor:e.look?.color??oY,backgroundColor:e.look?.background??oY},content:fY(e.content),children:vY(e.children??[])};case`code`:{let t=e.language===void 0?void 0:aY[e.language];return t===void 0?{type:`codeBlock`,props:{language:e.language??`text`},content:[{type:`text`,text:e.code,styles:{}}]}:{type:t,props:{code:e.code}}}case`image`:return{type:`image`,props:{url:e.src,name:e.alt??``,caption:e.caption??``,textAlignment:e.align??`left`,...e.width===void 0?{}:{previewWidth:e.width}}};case`table`:{let t=Ga(e);return{type:`table`,content:{type:`tableContent`,headerRows:e.head===`none`||e.head===`column`?0:1,headerCols:+(e.head===`column`||e.head===`both`),columnWidths:Array.from({length:Math.max(0,...e.rows.map(e=>e.length))},(t,n)=>e.widths?.[n]??void 0),rows:e.rows.map(e=>({cells:e.map((e,n)=>t.size===0?fY(e):{type:`tableCell`,props:t.has(n)?{textAlignment:`right`}:{},content:fY(e)})}))}}}case`divider`:return{type:`divider`};case`pagebreak`:return{type:`pagebreak`,props:{orientation:e.orientation??``}};case`toc`:return{type:`toc`,props:{levels:e.levels??3,title:e.title??``,untitled:e.title===``}};case`bibliography`:return{type:`bibliography`};case`note`:return{type:`note`,props:{label:e.label},content:fY(e.content),children:vY(e.children??[])};case`component`:return{type:`component`,props:{data:eY(e)}};case`chart`:return{type:`chart`,props:{data:nY(e)}};case`columns`:return{type:`columns`,children:e.columns.map(e=>({type:`column`,props:{width:e.width??1},children:vY(e.blocks)}))};case`embed`:case`source`:return{type:`embed`,props:{source:e.source}}}})}function yY(e){if(typeof e!=`number`||!Number.isFinite(e)||e<=0)return;let t=Math.round(e*100)/100;return t===1||t<=0?void 0:t}var bY=(e,t)=>JSON.stringify(e,Object.keys(e).sort())===JSON.stringify(t,Object.keys(t).sort());function xY(e){if(typeof e==`string`)return e===``?[]:[{text:e,styles:{}}];if(!Array.isArray(e))return[];let t=[],n=(e,n,r)=>{if(e===``)return;let i=t.at(-1);i&&i.note===void 0&&i.cite===void 0&&i.href===r&&bY(i.styles,n)?i.text+=e:t.push({text:e,styles:n,...r===void 0?{}:{href:r}})},r=(e,t)=>{if(e.text===``)return;let r=e.styles,i=typeof r.textColor==`string`?r.textColor:oY,a=typeof r.backgroundColor==`string`?r.backgroundColor:oY,o={...r.bold===!0?{bold:!0}:{},...r.italic===!0?{italic:!0}:{},...r.underline===!0?{underline:!0}:{},...r.strike===!0?{strike:!0}:{},...r.code===!0?{code:!0}:{},...i===oY?{}:{color:i},...a===oY?{}:{background:a},...typeof r.tag==`string`&&r.tag!==``?{tag:r.tag}:{}};n(e.text,o,t)};for(let n of e)if(n.type===`text`)r(n);else if(n.type===`link`)for(let e of n.content)r(e,n.href);else if(n.type===`citation`){let{cite:e,styles:r}=n.props;e!==``&&t.push({text:`[${e}]`,styles:dY(r),cite:e})}else if(n.type===`reference`){let{target:e,styles:r}=n.props;e!==``&&t.push({text:``,styles:dY(r),href:`#${e}`})}else{let{label:e,styles:r,href:i}=n.props;if(e===``)continue;t.push({text:e,styles:dY(r),note:e,...typeof i==`string`&&i!==``?{href:i}:{}})}return ia(t)}function SY(e){let t=e?.textAlignment,n=e?.textColor,r=e?.backgroundColor,i={...t===`center`||t===`right`||t===`justify`?{align:t}:{},...typeof n==`string`&&n!==oY?{color:n}:{},...typeof r==`string`&&r!==oY?{background:r}:{}};return Object.keys(i).length>0?{look:i}:{}}var CY=e=>{let t=TY(e.children??[]);return t.length>0?{children:t}:{}},wY=e=>e===2||e===3||e===4||e===5||e===6?e:1;function TY(e){let t=[];for(let n of e){let e=n.props??{};switch(n.type){case`paragraph`:t.push({type:`paragraph`,...SY(e),content:xY(n.content),...CY(n)});break;case`heading`:t.push({type:`heading`,level:wY(e.level),...e.isToggleable===!0?{toggle:!0}:{},...SY(e),content:xY(n.content),...CY(n)});break;case`bulletListItem`:t.push({type:`bullet`,...SY(e),content:xY(n.content),...CY(n)});break;case`numberedListItem`:{let r=e.start;t.push({type:`numbered`,...typeof r==`number`?{start:r}:{},...SY(e),content:xY(n.content),...CY(n)});break}case`checkListItem`:t.push({type:`check`,checked:e.checked===!0,...SY(e),content:xY(n.content),...CY(n)});break;case`toggleListItem`:t.push({type:`toggle`,...SY(e),content:xY(n.content),...CY(n)});break;case`quote`:t.push({type:`quote`,...SY(e),content:xY(n.content),...CY(n)});break;case`card`:{let r=xY(n.content).map(e=>e.text).join(``),i=e.subtitle;t.push({type:`card`,...r===``?{}:{title:r},...typeof i==`string`&&i!==``?{subtitle:i}:{},...CY(n)});break}case`stats`:{let n=e.data,r=$J(typeof n==`string`?n:``);r.length>0&&t.push({type:`stats`,stats:r});break}case`callout`:{let r=e.icon,i=SY(e);t.push({type:`callout`,...typeof r==`string`&&r!==``?{icon:r}:{},...i.look?.color!==void 0||i.look?.background!==void 0?{look:{...i.look.color===void 0?{}:{color:i.look.color},...i.look.background===void 0?{}:{background:i.look.background}}}:{},content:xY(n.content),...CY(n)});break}case`codeBlock`:{let r=e.language;t.push({type:`code`,...typeof r==`string`&&r!==``&&r!==`text`?{language:r}:{},code:xY(n.content).map(e=>e.text).join(``)});break}case`image`:{let r=e.url,i=e.name,a=e.caption;if(typeof r!=`string`||r===``)break;let o=e.previewWidth,s=e.textAlignment;t.push({type:`image`,src:r,...typeof i==`string`&&i!==``?{alt:i}:{},...typeof a==`string`&&a!==``?{caption:a}:{},...typeof o==`number`&&o>0?{width:Math.round(o)}:{},...s===`center`||s===`right`?{align:s}:{},...n.id===void 0?{}:hY.get(n.id)});break}case`table`:{let e=n.content;if(e===void 0||typeof e==`string`||Array.isArray(e))break;let r=(e.headerRows??0)>0,i=(e.headerCols??0)>0,a=(e.columnWidths??[]).map(e=>typeof e==`number`&&e>0?Math.round(e):null);t.push({type:`table`,rows:e.rows.map(e=>e.cells.map(e=>xY(Array.isArray(e)?e:e.content))),...r&&i?{head:`both`}:i?{head:`column`}:r?{}:{head:`none`},...a.some(e=>e!==null)?{widths:a}:{},...n.id===void 0?{}:hY.get(n.id)});break}case`divider`:t.push({type:`divider`});break;case`pagebreak`:{let n=e.orientation;t.push({type:`pagebreak`,...n===`landscape`||n===`portrait`?{orientation:n}:{}});break}case`bibliography`:t.push({type:`bibliography`});break;case`toc`:{let n=e.levels,r=e.title;t.push({type:`toc`,...typeof n==`number`&&n!==3?{levels:n}:{},...e.untitled===!0?{title:``}:typeof r==`string`&&r!==``?{title:r}:{}});break}case`note`:{let r=e.label;t.push({type:`note`,label:typeof r==`string`?r:``,content:xY(n.content),...CY(n)});break}case`embed`:{let n=e.source;typeof n==`string`&&n!==``&&t.push({type:`embed`,source:n});break}case`component`:{let n=tY(e.data);n&&t.push(n);break}case`chart`:{let n=iY(e.data);n&&t.push(n);break}case`math`:case`diagram`:{let r=e.code;t.push({type:`code`,language:n.type===`math`?Va.math:Va.mermaid,code:typeof r==`string`?r:``});break}case`columns`:{let e=(n.children??[]).filter(e=>e.type===`column`).map(e=>{let t=yY(e.props?.width);return{...t===void 0?{}:{width:t},blocks:TY(e.children??[]).flatMap(e=>e.type===`columns`?e.columns.flatMap(e=>e.blocks):[e])}});e.length<2?t.push(...e.flatMap(e=>e.blocks)):t.push({type:`columns`,columns:e});break}}}return t.map((e,n)=>{if(e.type!==`numbered`||e.start!==1||t[n-1]?.type===`numbered`)return e;let r={...e};return delete r.start,r})}var EY=40,DY=5;function OY(e,t,n=0){if(t===``)return;let r=t.slice(0,EY),i=e.indexOf(r);for(let t=0;t<n&&i>=0;t++)i=e.indexOf(r,i+r.length);return i<0?void 0:e.slice(0,i).split(`
213
- `).length}function kY(e){let t=document.createRange();t.selectNodeContents(e);let n=[...t.getClientRects()];return n.length>0?n:[e.getBoundingClientRect()]}function AY(e,t,n,r,i){let a=[],o=new Map;for(let s of e.querySelectorAll(`.bn-block-content`)){let e=s.textContent.trim(),c=e===``?i?.(s):void 0,l=c?.written??e,u=o.get(l)??0;if(o.set(l,u+1),!(c?[s.getBoundingClientRect()]:kY(s)).some(e=>T(t,e)))continue;let d=OY(r,l,u);if(a.push({name:c?.name??`the block`,source:{path:n,...d===void 0?{}:{line:d}},...e===``?{}:{text:e}}),a.length===DY)break}return a}function jY(e){let{children:t,...n}=e;return delete n.id,{...n,...t?{children:t.map(jY)}:{}}}var MY=e=>Array.isArray(e.content)?e.content.map(e=>e.type===`text`?e.text:e.type===`link`?e.content.map(e=>e.text).join(``):e.type===`footnote`?e.props.label:e.type===`citation`?`[${e.props.cite}]`:``).join(``):``;function NY(e){let t=e.getSelection()?.blocks??[];return t.length>0?t:[e.getTextCursorPosition().block]}var PY=`.doc-scroll, .doc-body, .doc-column, .doc-title-row, .bn-container`,FY=`.doc-slash-menu, .bn-suggestion-menu, .bn-grid-suggestion-menu`;function IY(e,t){let n=document.createRange();n.selectNodeContents(e);let r=Array.from(n.getClientRects()),i=r[0];if(!i)return!0;let a=window.getSelection(),o=a&&a.rangeCount>0?a.getRangeAt(0).getClientRects()[0]:void 0;return o?o.top-i.top<i.height*.6:t||r.every(e=>Math.abs(e.top-i.top)<4)}function LY(e,t,n={}){let{onActions:r,onTitle:i}=n;(0,W.useEffect)(()=>{let n=t.current;if(!n)return;let a=e._tiptapEditor.view,o=a.dom,s=()=>{let t=window.getSelection();if(!t?.focusNode||!t.anchorNode||a.composing)return;let n=e=>o.contains(e)&&(e instanceof Element?e:e.parentElement)?.closest(`.bn-inline-content`)!=null;if(!n(t.focusNode)||!n(t.anchorNode))return;let r=a.state.selection;if(r.toJSON().type===`text`)try{let n=a.posAtDOM(t.anchorNode,t.anchorOffset),i=a.posAtDOM(t.focusNode,t.focusOffset);if(n===r.anchor&&i===r.head)return;e._tiptapEditor.commands.setTextSelection({from:Math.min(n,i),to:Math.max(n,i)})}catch{}},c=(t,n)=>{try{if(t!==n)return e.setSelection(t,n),!0;let r=o.querySelector(`.bn-block-outer[data-id="${CSS.escape(t)}"] .bn-inline-content`);return r?(e._tiptapEditor.commands.setTextSelection({from:a.posAtDOM(r,0),to:a.posAtDOM(r,r.childNodes.length)}),!0):!1}catch{return!1}},l=t=>{if(t.isComposing)return;s();let n=t.metaKey||t.ctrlKey;if(i&&!n&&!t.shiftKey&&!t.altKey&&(t.key===`ArrowUp`||t.key===`Backspace`)&&!document.querySelector(FY)){let n=e.getTextCursorPosition().block,r=e.document[0],s=a.state.selection,c=r?.id!==void 0&&n.id===r.id?o.querySelector(`.bn-block-outer[data-id="${CSS.escape(r.id)}"] .bn-inline-content`):null;if(r?.id!==void 0&&c&&s.anchor===s.head&&s.toJSON().type===`text`){let o=s.head===a.posAtDOM(c,0);if(t.key===`ArrowUp`&&IY(c,o)){t.preventDefault(),t.stopPropagation(),i();return}if(t.key===`Backspace`&&o&&n.type===`paragraph`&&(n.children?.length??0)===0){t.preventDefault(),t.stopPropagation();let a=MY(n);e.document.length>1?e.removeBlocks([r.id]):a!==``&&e.updateBlock(r.id,{type:`paragraph`,content:[]}),i(a);return}}}if(t.key===` `&&!n&&!t.altKey){let n=e.getTextCursorPosition().block;if(n.type===`paragraph`&&n.id!==void 0&&MY(n)===`"`&&(n.children?.length??0)===0){t.preventDefault(),t.stopPropagation(),e.updateBlock(n.id,{type:`quote`,content:[]});return}if(n.type===`paragraph`&&n.id!==void 0&&MY(n)===`>`&&(n.children?.length??0)===0){t.preventDefault(),t.stopPropagation();try{window.localStorage.setItem(`toggle-${n.id}`,`true`)}catch{}e.updateBlock(n.id,{type:`toggleListItem`,content:[]})}}else if(t.key===`Enter`&&!n&&!t.shiftKey&&!t.altKey){let n=e.getTextCursorPosition().block;if(n.type!==`callout`||n.id===void 0||MY(n)===``)return;let r=o.querySelector(`.bn-block-outer[data-id="${CSS.escape(n.id)}"] .bn-inline-content`),i=a.state.selection;if(!r||i.anchor!==i.head||i.head!==a.posAtDOM(r,r.childNodes.length))return;t.preventDefault(),t.stopPropagation();let s=n.children?.[0];s?.id===void 0?e.updateBlock(n.id,{type:n.type,children:[{type:`paragraph`}]}):e.insertBlocks([{type:`paragraph`}],s.id,`before`);let c=e.getBlock(n.id)?.children?.[0];c?.id!==void 0&&e.setTextCursorPosition(c.id,`start`)}else if(t.key===`Escape`&&!n&&!document.querySelector(FY)){let n=e.getTextCursorPosition().block;(e.getSelection()?.blocks??[]).length===0&&n.id!==void 0&&c(n.id,n.id)&&t.preventDefault()}else if(n&&!t.shiftKey&&!t.altKey&&t.key===`d`){let n=NY(e),r=n.at(-1);if(r?.id===void 0)return;t.preventDefault(),t.stopPropagation(),e.insertBlocks(n.map(jY),r.id,`after`)}else if(n&&!t.shiftKey&&!t.altKey&&t.key===`/`){let n=e.getTextCursorPosition().block;if(n.id===void 0||!r)return;t.preventDefault(),t.stopPropagation(),r(n.id)}},u=()=>Array.from(o.querySelectorAll(`:scope > .bn-block-group > .bn-block-outer`)).map(e=>({id:e.getAttribute(`data-id`)??``,box:e.getBoundingClientRect()})),d=(t,n)=>{let r=u(),a=r.at(-1);if(!a){e.focus();return}if(i&&r[0]&&n<r[0].box.top){i();return}let o=r.find(e=>n>=e.box.top&&n<=e.box.bottom),s=o??(n<(r[0]?.box.top??0)?r[0]:a);if(s){try{e.setTextCursorPosition(s.id,o&&t<s.box.left?`start`:`end`)}catch{}e.focus()}},f,p=e=>{if(!f)return;let t=e.clientX-f.x,n=e.clientY-f.y;if(!f.box&&Math.hypot(t,n)<6)return;f.box||(f.box=document.createElement(`div`),f.box.className=`doc-marquee`,document.body.append(f.box));let r=Math.min(f.y,e.clientY),i=Math.max(f.y,e.clientY);Object.assign(f.box.style,{left:`${String(Math.min(f.x,e.clientX))}px`,top:`${String(r)}px`,width:`${String(Math.abs(t))}px`,height:`${String(Math.abs(n))}px`});let a=u().filter(e=>e.box.bottom>=r&&e.box.top<=i),o=a[0],s=a.at(-1);o&&s&&c(o.id,s.id)},m=t=>{let n=f;f=void 0,window.removeEventListener(`mousemove`,p),window.removeEventListener(`mouseup`,m),n?.box?(n.box.remove(),e.focus()):n&&d(t.clientX,t.clientY)},h=e=>{if(e.button!==0)return;let t=e.target;t&&!o.contains(t)&&t.matches(PY)&&(e.preventDefault(),f={x:e.clientX,y:e.clientY,box:void 0},window.addEventListener(`mousemove`,p),window.addEventListener(`mouseup`,m))};return o.addEventListener(`keydown`,l,!0),n.addEventListener(`mousedown`,h),()=>{o.removeEventListener(`keydown`,l,!0),n.removeEventListener(`mousedown`,h),window.removeEventListener(`mousemove`,p),window.removeEventListener(`mouseup`,m),f?.box?.remove()}},[e,r,i,t])}var RY=/^([a-z][a-z0-9+.-]*:|\/\/|#)/i;function zY(e,t){let n=e.split(`/`).filter(Boolean),r=t.split(`/`).filter(Boolean),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i++;let a=n.slice(i).map(()=>`..`),o=[...a,...r.slice(i)].join(`/`);return a.length===0?`./${o}`:o}var BY=e=>e.slice(0,Math.max(0,e.lastIndexOf(`/`))),VY=e=>e.slice(e.lastIndexOf(`/`)+1);function HY(e,t){if(RY.test(t))return;let n=t.split(/[?#]/)[0]??``,r;try{r=decodeURIComponent(n)}catch{return}let i=[];for(let t of`${e}/${r}`.split(`/`))if(t!==``&&t!==`.`){if(t!==`..`)i.push(t);else if(i.pop()===void 0)return}return i.length===0?void 0:i.join(`/`)}function UY(e,t){let n=BY(e);return t.filter(t=>t.entry!==e).map(e=>({title:e.title??VY(hn(e.entry)),href:zY(n,e.entry),kind:e.kind,place:e.dir}))}var WY=(e,t)=>HY(BY(e),t);async function GY(e){let t=await fetch(e);if(!t.ok)return;let n=await t.blob(),r=new FileReader,i=await new Promise((t,i)=>{r.onload=()=>{t(typeof r.result==`string`?r.result:``)},r.onerror=()=>{i(Error(`The picture at ${e} could not be read.`))},r.readAsDataURL(n)}),a=i.indexOf(`,`),o=/^data:([^;,]+)/u.exec(i)?.[1];return o===void 0||a<0?void 0:{mime:o,data:i.slice(a+1)}}var KY=(0,W.createContext)(void 0);function qY({data:e,onData:t}){let n=(0,W.useContext)(KY),r=o(),i=tY(e),s=i?ha(i):void 0,c=Le(n?.item,void 0,s!==void 0),l=Fe(n?.item,void 0,c===void 0&&s?[s]:[]),u=(0,W.useRef)(null),d=(0,W.useRef)(void 0),[f,p]=(0,W.useState)(),[m,h]=(0,W.useState)(),[g,_]=(0,W.useState)(!1),v=JSON.stringify(s);(0,W.useEffect)(()=>{let e=u.current;if(!e||!c||!s)return;if(d.current?.url===c.url){d.current.mounted.draw(s);return}let t=d.current?.mounted,n=Ve(e,c,s,{onDrawn:e=>{t?.remove(),h(void 0),e&&p(e)},onError:e=>{t?.remove(),h(e)}});d.current={url:c.url,mounted:n,...t?{old:t}:{}}},[c,v]);let y=()=>{let e=u.current?.getBoundingClientRect();return e&&e.width>0&&e.height>0?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0};if(a({element:()=>c&&s?u.current:void 0,pictures:async()=>{let e=y();if(!e||!s||n===void 0)return[];let t=(await En(r,`components/stills`,{item:n.item,components:[{...s}]}).catch(()=>void 0))?.stills[0]?.url,i=t===void 0?void 0:await GY(t).catch(()=>void 0);return i?[{rect:e,...i}]:[]},locate:()=>{if(!i||n===void 0)return Promise.resolve({elements:[]});let e=i.of.split(`#`)[0]??i.of,t=HY(BY(n.path),e)??e;return Promise.resolve({elements:[{name:`the component ${ma(i)}`,source:{path:t},...i.alt===void 0?{}:{text:i.alt}}]})}}),(0,W.useEffect)(()=>()=>{d.current?.old?.remove(),d.current?.mounted.remove(),d.current=void 0},[]),!i||!s)return(0,G.jsxs)(`div`,{contentEditable:!1,className:`doc-embed`,children:[(0,G.jsx)(Zr,{size:18,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`doc-embed-note`,children:n?.words?.embed})]});let b=c===void 0?l.get(JSON.stringify(s)):void 0,x=(0,G.jsxs)(`div`,{ref:u,className:`doc-component-frame`,style:{width:`min(100%, ${String(s.width)}px)`,aspectRatio:`${String(s.width)} / ${String(s.height)}`},children:[b!==void 0&&(0,G.jsx)(`img`,{src:b,alt:i.alt??``,className:`doc-component-still`}),m!==void 0&&(0,G.jsxs)(`div`,{role:`alert`,className:`doc-component-error`,children:[(0,G.jsx)(Zr,{size:16,"aria-hidden":!0}),(0,G.jsx)(`span`,{children:ma(i)}),(0,G.jsx)(`span`,{className:`doc-component-error-text`,children:m})]})]}),S=!n?.readOnly&&f!==void 0&&Object.keys(f.props).length>0;return(0,G.jsxs)(`figure`,{contentEditable:!1,"data-doc-component":``,className:`doc-component`,style:i.align===void 0?void 0:{textAlign:i.align},children:[(0,G.jsxs)(Ge,{open:S&&g,onOpenChange:_,children:[(0,G.jsx)(qe,{asChild:!0,children:(0,G.jsx)(`button`,{type:`button`,className:`doc-component-button`,"aria-label":ma(i),disabled:!S,children:x})}),S&&(0,G.jsx)(Je,{align:`start`,className:`w-72`,children:(0,G.jsx)(ze,{types:f.props,values:i.props,locale:n?.locale??`en`,onChange:(e,n)=>{let r=Object.fromEntries(Object.entries(i.props).flatMap(([t,r])=>t===e?n===void 0?[]:[[t,n]]:[[t,r]]));n!==void 0&&!(e in r)&&(r[e]=n),t(eY({...i,props:r}))}})})]}),i.caption!==void 0&&(0,G.jsx)(`figcaption`,{children:i.caption})]})}var JY=qN({type:`component`,propSchema:{data:{default:``}},content:`none`},{render:e=>(0,G.jsx)(qY,{data:e.block.props.data,onData:t=>{e.editor.updateBlock(e.block,{props:{data:t}})}})}),YY=`--doc-col-gap`,XY=`--doc-col-share`,ZY=80,QY=e=>Math.round(e*100)/100,$Y=e=>yY(e?.props?.width)??1;function eX({editor:e,id:t}){let n=ZA(IE),r=(0,W.useRef)(null);return(0,W.useEffect)(()=>{let e=e=>{e.target===r.current&&(e.stopPropagation(),n.hideMenuIfNotFrozen())};return window.addEventListener(`mousemove`,e,!0),()=>{window.removeEventListener(`mousemove`,e,!0)}},[n]),(0,G.jsx)(`div`,{ref:r,contentEditable:!1,className:`doc-col-sizer`,onPointerDown:n=>{if(n.button!==0)return;let r=e.getParentBlock(t)?.children??[],i=r.findIndex(e=>e.id===t),a=r[i-1],o=n.currentTarget.parentElement,s=o?.closest(`.doc-cols`)?.querySelector(`[data-doc-col="${CSS.escape(a?.id??``)}"]`);if(!a?.id||!o||!s)return;n.preventDefault();let c=n.currentTarget;c.setPointerCapture(n.pointerId);let l=s.getBoundingClientRect().width,u=o.getBoundingClientRect().width,d=$Y(a)+$Y(r[i]),f=n.clientX,p=[$Y(a),$Y(r[i])],m=e=>{let t=Math.min(Math.max(l+e.clientX-f,ZY),l+u-ZY),n=QY(d*t/(l+u));p=[n,QY(d-n)],s.style.setProperty(XY,String(p[0])),o.style.setProperty(XY,String(p[1]))},h=()=>{c.removeEventListener(`pointermove`,m),c.removeEventListener(`pointerup`,h),c.removeEventListener(`pointercancel`,h),c.removeAttribute(`data-dragging`),s.style.setProperty(XY,String($Y(a))),o.style.setProperty(XY,String($Y(r[i])));let[n,l]=p;(n!==$Y(a)||l!==$Y(r[i]))&&e.transact(()=>{e.updateBlock(a.id??``,{type:`column`,props:{width:n}}),e.updateBlock(t,{type:`column`,props:{width:l}})})};c.setAttribute(`data-dragging`,``),c.addEventListener(`pointermove`,m),c.addEventListener(`pointerup`,h),c.addEventListener(`pointercancel`,h)},"aria-hidden":!0})}var tX=qN({type:`columns`,propSchema:{},content:`none`,layoutOnly:!0,children:{allow:[`column`],min:2}},{renderFrame:e=>(0,G.jsx)(`div`,{className:`doc-cols`,style:{[YY]:`32px`},ref:e.slotRef})});function nX({editor:e,id:t,width:n,slotRef:r}){let i=(0,W.useContext)(KY)?.readOnly??!1,a=sp({editor:e,selector:()=>e.getParentBlock(t)?.children?.[0]?.id===t});return(0,G.jsxs)(`div`,{className:`doc-col`,"data-doc-col":t,style:{[XY]:String(n)},children:[!a&&!i&&e.isEditable&&(0,G.jsx)(eX,{editor:e,id:t}),(0,G.jsx)(`div`,{className:`doc-col-blocks`,ref:r})]})}var rX=qN({type:`column`,propSchema:{width:{default:1}},content:`none`,layoutOnly:!0,placeable:`namedOnly`,children:{exclude:[`columns`]}},{renderFrame:e=>(0,G.jsx)(nX,{editor:e.editor,id:e.block.id,width:e.block.props.width,slotRef:e.slotRef})});function iX(e,t){for(let n=e.getParentBlock(t);n;n=n.id===void 0?void 0:e.getParentBlock(n.id))if(n.type===`column`)return!0;return!1}function aX(e,t){let n=e;return sp({editor:e,selector:()=>{let e=n.getParentBlock(t);for(;e?.id!==void 0&&e.type!==`column`;)e=n.getParentBlock(e.id);if(e?.type!==`column`||e.id===void 0)return;let r=n.getParentBlock(e.id),i=(r?.children??[]).map(e=>({width:$Y(e),blocks:[]}));return Pa({columns:i})[i.length===0?0:(r?.children??[]).findIndex(t=>t.id===e.id)]}})}var oX=(0,W.createContext)({page:{},base:``,data:void 0,wantData:()=>void 0,dark:!1}),sX=e=>Qa(e).text,cX=[`bottom`,`top`,`left`,`right`,`none`];function lX(e){return{type:`chart`,kind:`column-clustered`,table:[[``,e.series(1),e.series(2)],[e.category(1),`4`,`3`],[e.category(2),`6`,`5`],[e.category(3),`5`,`7`]]}}var uX=e=>Math.max(0,...e.map(e=>e.length)),dX=(e,t,n,r)=>e.map((e,i)=>i===t?Array.from({length:Math.max(e.length,n+1)},(t,i)=>i===n?r:e[i]??``):[...e]),fX=(e,t)=>[...e.map(e=>[...e]),[t.category(e.length),...Array.from({length:uX(e)-1},()=>``)]],pX=(e,t)=>{let n=uX(e);return e.map((e,r)=>[...Array.from({length:n},(t,n)=>e[n]??``),r===0?t.series(n):``])},mX=(e,t)=>e.length<=2||t<1?e.map(e=>[...e]):e.filter((e,n)=>n!==t).map(e=>[...e]),hX=(e,t)=>uX(e)<=2||t<1?e.map(e=>[...e]):e.map(e=>e.filter((e,n)=>n!==t));function gX(e){let[t,n]=(0,W.useState)(e.text),r=()=>{t!==e.text&&e.onCommit(t)},i=(t,n)=>{t.preventDefault(),r(),t.currentTarget.closest(`table`)?.querySelector(`[data-row="${String(e.row+n)}"][data-col="${String(e.col)}"]`)?.focus()};return(0,G.jsx)(`input`,{value:t,"aria-label":e.label,"data-row":e.row,"data-col":e.col,spellCheck:!1,className:N(`text-dense h-7 w-full min-w-14 bg-transparent px-1.5 outline-none`,`focus:bg-sheet focus:outline-pencil focus:outline-1 focus:-outline-offset-1`,e.row>0&&e.col>0&&`text-right tabular-nums`,(e.row===0||e.col===0)&&`font-medium`),onChange:e=>{n(e.target.value)},onFocus:t=>{t.target.select(),e.onFocus()},onBlur:r,onKeyDown:r=>{r.key===`Escape`&&t!==e.text?(r.preventDefault(),r.stopPropagation(),n(e.text)):r.key===`Enter`?i(r,r.shiftKey?-1:1):r.key===`ArrowDown`?i(r,1):r.key===`ArrowUp`&&i(r,-1)}})}function _X({table:e,w:t,sample:n,remove:r,onTable:i}){let[a,o]=(0,W.useState)(),s=uX(e);return(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,G.jsx)(`div`,{className:`border-rule max-h-56 overflow-auto rounded-md border`,children:(0,G.jsx)(`table`,{className:`w-full border-collapse`,children:(0,G.jsx)(`tbody`,{children:e.map((n,r)=>(0,G.jsx)(`tr`,{className:N(`border-rule border-b last:border-b-0`,r===0&&`bg-paper`),children:Array.from({length:s},(a,s)=>{let c=n[s]??``;return(0,G.jsx)(`td`,{className:`border-rule border-l p-0 first:border-l-0`,children:(0,G.jsx)(gX,{row:r,col:s,text:c,label:t.cell(r+1,s+1),onCommit:t=>{i(dX(e,r,s,t))},onFocus:()=>{o({row:r,col:s})}},c)},s)})},r))})})}),(0,G.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,G.jsx)(Dn,{icon:!0,"aria-label":t.addCategory,title:t.addCategory,onClick:()=>{i(fX(e,n))},children:(0,G.jsx)(Re,{})}),(0,G.jsx)(Dn,{icon:!0,"aria-label":t.addSeries,title:t.addSeries,onClick:()=>{i(pX(e,n))},children:(0,G.jsx)(Ie,{})}),(0,G.jsxs)(Tn,{children:[(0,G.jsx)(fn,{asChild:!0,children:(0,G.jsx)(Dn,{icon:!0,"aria-label":r,title:r,children:(0,G.jsx)(an,{})})}),(0,G.jsxs)(Sn,{align:`start`,className:`text-sm`,children:[(0,G.jsx)(Fn,{disabled:e.length<=2,onSelect:()=>{i(mX(e,a&&a.row>0?a.row:e.length-1)),o(void 0)},children:t.deleteCategory}),(0,G.jsx)(Fn,{disabled:s<=2,onSelect:()=>{i(hX(e,a&&a.col>0?a.col:s-1)),o(void 0)},children:t.deleteSeries})]})]})]})]})}function vX({block:e,legend:t,problems:n,words:r,onChange:i}){let a=r.chart,o=e.labels?.includes(`value`)===!0,[s,...c]=e.table??[],l=s?.length===2&&/^(column|bar)-/u.test(e.kind)?c.map(e=>e[0]??``):[],u=t=>{let n=e.colors?.[t];return n!==void 0&&PX.includes(n)?n:`default`},[d,f]=(0,W.useState)(e.title??``),p=t=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t));return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsxs)(gn,{value:e.kind,onValueChange:t=>{i({...e,kind:t})},children:[(0,G.jsx)(wn,{size:`sm`,className:`w-full`,"aria-label":a.type,children:(0,G.jsx)(Nn,{})}),(0,G.jsx)(On,{children:Ce.map(e=>(0,G.jsx)(An,{value:e,children:a.types[e]},e))})]}),(0,G.jsx)(kn,{value:d,placeholder:a.title,"aria-label":a.title,className:`h-8 text-sm`,onChange:t=>{f(t.target.value),i(t.target.value===``?p(`title`):{...e,title:t.target.value})}}),(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`span`,{className:`text-lead text-xs`,children:a.legend}),(0,G.jsxs)(gn,{value:t,onValueChange:t=>{i({...e,legend:t})},children:[(0,G.jsx)(wn,{size:`sm`,"aria-label":a.legend,children:(0,G.jsx)(Nn,{})}),(0,G.jsx)(On,{children:cX.map(e=>(0,G.jsx)(An,{value:e,children:a.legendAt[e]},e))})]}),(0,G.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-sm`,children:[(0,G.jsx)(`span`,{children:a.dataLabels}),(0,G.jsx)(on,{size:`sm`,checked:o,onCheckedChange:t=>{let n=(e.labels??[]).filter(e=>e!==`value`),r=t?[`value`,...n]:n;i(r.length===0?p(`labels`):{...e,labels:[...r]})}})]})]}),wa.has(e.kind)&&(0,G.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,G.jsx)(`span`,{children:a.smooth}),(0,G.jsx)(on,{size:`sm`,checked:e.smooth===!0,onCheckedChange:t=>{i(t?{...e,smooth:!0}:p(`smooth`))}})]}),l.length>0&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-lead text-xs`,children:a.barColors}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:l.map((t,n)=>(0,G.jsxs)(gn,{value:u(n),onValueChange:t=>{let r=l.map((e,r)=>r===n?t:u(r));i(r.every(e=>e==="default")?p(`colors`):{...e,colors:r})},children:[(0,G.jsxs)(wn,{size:`sm`,"aria-label":t,children:[(0,G.jsx)(`span`,{className:`truncate`,children:t}),(0,G.jsx)(Nn,{})]}),(0,G.jsxs)(On,{children:[(0,G.jsx)(An,{value:`default`,children:r.defaultColor}),PX.map(e=>(0,G.jsx)(An,{value:e,children:r.colorNames[e]},e))]})]},n))})]}),e.table===void 0?(0,G.jsx)(`p`,{className:`text-lead text-xs`,children:a.fromFile(e.data??``)}):(0,G.jsx)(_X,{table:e.table,w:a,sample:r.sample,remove:r.remove,onTable:t=>{i({...e,table:t})}}),n.length>0&&(0,G.jsx)(`p`,{role:`alert`,className:`text-problem-text max-h-24 overflow-auto font-mono text-xs whitespace-pre-wrap`,children:n.join(`
214
- `)})]})}function yX({data:e,room:t,onData:n}){let r=(0,W.useContext)(KY),i=(0,W.useContext)(oX),[a,o]=(0,W.useState)(!1),s=(0,W.useMemo)(()=>iY(e),[e]),c=s?.data!==void 0,{wantData:l}=i;(0,W.useEffect)(()=>{c&&l()},[c,l]);let u=c&&i.data===void 0,d=(0,W.useMemo)(()=>({page:i.page,base:i.base,data:e=>i.data?.[e],font:sX(i.page),dark:i.dark,...t===void 0?{}:{room:t}}),[i.page,i.base,i.data,i.dark,t]),f=(0,W.useMemo)(()=>s===void 0||u?void 0:Na(s,d),[s,u,d]),p=r?.words;if(!s||!p)return(0,G.jsxs)(`div`,{contentEditable:!1,className:`doc-embed`,children:[(0,G.jsx)(je,{size:18,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`doc-embed-note`,children:p?.embed})]});let m=Ea(s,t),h=!r.readOnly,g=s.legend??(a?Aa(s,d).chart?.legend??`none`:`none`);return(0,G.jsx)(`figure`,{contentEditable:!1,"data-doc-chart":``,className:`doc-component`,children:(0,G.jsxs)(Ge,{open:h&&a,onOpenChange:o,children:[(0,G.jsx)(qe,{asChild:!0,children:(0,G.jsx)(`button`,{type:`button`,className:`doc-component-button`,"aria-label":s.alt??s.title??p.blocks.chart,disabled:!h,children:(0,G.jsx)(`div`,{className:`doc-component-frame doc-chart-frame`,style:{width:`min(100%, ${String(m.width)}px)`,aspectRatio:`${String(m.width)} / ${String(m.height)}`},children:u?(0,G.jsx)(`div`,{className:`doc-chart-waiting`,children:p.chart.notHere(s.data??``)}):f?.svg===void 0?(0,G.jsxs)(`div`,{role:`alert`,className:`doc-component-error`,children:[(0,G.jsx)(je,{size:16,"aria-hidden":!0}),(0,G.jsx)(`span`,{children:p.chart.cannotDraw}),(0,G.jsx)(`span`,{className:`doc-component-error-text`,children:f?.problems.join(`
215
- `)})]}):(0,G.jsx)(`div`,{className:`doc-chart-svg`,dangerouslySetInnerHTML:{__html:f.svg}})})})}),h&&(0,G.jsx)(Je,{align:`start`,className:`w-[min(26rem,calc(100vw-2rem))]`,children:(0,G.jsx)(vX,{block:s,legend:g,problems:f?.svg===void 0?[]:f.problems,words:p,onChange:e=>{n(nY(e))}})})]})})}var bX=qN({type:`chart`,propSchema:{data:{default:``}},content:`none`},{render:function(e){return(0,G.jsx)(yX,{data:e.block.props.data,room:aX(e.editor,e.block.id),onData:t=>{e.editor.updateBlock(e.block,{props:{data:t}})}})}}),xX=e=>e.map(e=>e.note===void 0?e.text:``).join(``);function SX(e){let t=new Map;for(let n of ua(e)){if(n.type!==`note`)continue;let e=[...ua(n.children??[])].flatMap(e=>`content`in e?[xX(e.content)]:[]),r=n.label.toLowerCase();t.has(r)||t.set(r,[xX(n.content),...e].filter(e=>e!==``).join(` `))}return{numbers:da(e),words:t}}var CX=(e,t)=>JSON.stringify([[...e.numbers],[...e.words]])===JSON.stringify([[...t.numbers],[...t.words]]);function wX(e){let t=0,n=e=>{/^\d+$/.test(e)&&(t=Math.max(t,Number(e)))};for(let t of ua(e)){t.type===`note`&&n(t.label);let e=`content`in t?[t.content]:t.type===`table`?t.rows.flat():[];for(let t of e.flat())t.note!==void 0&&n(t.note)}return String(t+1)}function*TX(e){for(let t of e)yield t,yield*TX(t.children??[])}function EX(e,t){let n=t.toLowerCase();for(let t of TX(e)){let e=t.props?.label;if(t.type===`note`&&typeof e==`string`&&e.toLowerCase()===n)return t}}function DX(e,t){let n=da(TY(e)),r=t.map(e=>({label:e,n:n.get(e.toLowerCase())??0})).sort((e,t)=>t.n-e.n);for(let{label:t}of r){let n=EX(e,t)?.id;if(n!==void 0)return{id:n,placement:`after`}}let i=[...TX(e)].find(e=>e.type===`note`)?.id;if(i!==void 0)return{id:i,placement:`before`};let a=e.at(-1)?.id;return a===void 0?void 0:{id:a,placement:`after`}}function OX(e){let{doc:t,selection:n}=e._tiptapEditor.state,r=[];return t.nodesBetween(0,n.from,(e,t)=>{if(e.type.name===`note`)return!1;let i=e.attrs.label;return e.type.name===`footnote`&&t<n.from&&typeof i==`string`&&r.push(i),!0}),r}function kX(e){let t=wX(TY(e.document)),n=DX(e.document,OX(e));e.transact(()=>{e.insertInlineContent([{type:`footnote`,props:{label:t}}],{updateSelection:!0}),n!==void 0&&e.insertBlocks([{type:`note`,props:{label:t}}],n.id,n.placement)});let r=EX(e.document,t);r?.id!==void 0&&(e.setTextCursorPosition(r.id,`end`),e.focus())}var AX={bold:`bold`,italic:`italic`,underline:`underline`,strike:`strike`,code:`code`,textColor:`color`,backgroundColor:`background`};function jX(e){let t=[];return e.forEach((n,r)=>{n.steps.forEach((i,a)=>{let o=i.toJSON();if(o.stepType!==`addMark`&&o.stepType!==`removeMark`||o.from===void 0||o.to===void 0||o.mark?.type===void 0)return;let s=n.mapping.slice(a+1);for(let t of e.slice(r+1))s.appendMapping(t.mapping);t.push({from:s.map(o.from,1),to:s.map(o.to,-1),add:o.stepType===`addMark`,type:o.mark.type,attrs:o.mark.attrs??{}})})}),t}function MX(e,t){let n=typeof e.href==`string`?e.href:``,r=dY(e.styles);if(t.type===`link`){let e=t.add?t.attrs.href:``;return{styles:lY(r),href:typeof e==`string`?e:``}}let i=AX[t.type];if(i===void 0)return;let a=Object.fromEntries(Object.entries(r).filter(([e])=>e!==i)),o=a;if(t.add&&(i===`color`||i===`background`)){let e=t.attrs.stringValue;if(typeof e!=`string`)return;e!=="default"&&(o={...a,[i]:e})}else t.add&&(o={...a,[i]:!0});return{styles:lY(o),href:n}}var NX=w_(({editor:e})=>({key:`docFootnotes`,keyboardShortcuts:{"Mod-Alt-f":()=>(kX(e),!0)},prosemirrorPlugins:[new Tr({appendTransaction(e,t,n){let r=jX(e);if(r.length===0)return null;let i=n.tr;for(let e of r)e.from>=e.to||i.doc.nodesBetween(e.from,e.to,(t,n)=>{if(t.type.name!==`footnote`)return!0;let r=MX(t.attrs,e);return r&&(r.styles!==t.attrs.styles||r.href!==t.attrs.href)&&i.setNodeMarkup(n,void 0,{...t.attrs,...r}),!1});return i.docChanged?i:null}})]}))(),PX=[`gray`,`brown`,`red`,`orange`,`yellow`,`green`,`blue`,`purple`,`pink`];function FX(e){return{type:`columns`,children:Array.from({length:e},()=>({type:`column`,children:[{type:`paragraph`}]}))}}var IX=[{key:`paragraph`,icon:Kr,aliases:[`text`,`p`,`正文`,`文字`,`段落`],block:{type:`paragraph`}},{key:`heading1`,hint:`#`,icon:Fr,aliases:[`h1`,`title`,`标题`,`一级`],block:{type:`heading`,props:{level:1}}},{key:`heading2`,hint:`##`,icon:Ir,aliases:[`h2`,`标题`,`二级`],block:{type:`heading`,props:{level:2}}},{key:`heading3`,hint:`###`,icon:Lr,aliases:[`h3`,`标题`,`三级`],block:{type:`heading`,props:{level:3}}},{key:`bullet`,hint:`-`,icon:Ht,aliases:[`ul`,`list`,`bullet`,`列表`,`无序`],block:{type:`bulletListItem`}},{key:`numbered`,hint:`1.`,icon:Gt,aliases:[`ol`,`list`,`number`,`列表`,`有序`,`编号`],block:{type:`numberedListItem`}},{key:`check`,hint:`[]`,icon:Vr,aliases:[`todo`,`task`,`checkbox`,`待办`,`任务`,`清单`],block:{type:`checkListItem`}},{key:`toggle`,hint:`>`,icon:Br,aliases:[`fold`,`collapse`,`折叠`,`展开`],block:{type:`toggleListItem`}},{key:`quote`,hint:`"`,icon:Ct,aliases:[`blockquote`,`引用`],block:{type:`quote`}},{key:`callout`,icon:zr,aliases:[`note`,`tip`,`warning`,`提示`,`注意`,`标注`],block:{type:`callout`}},{key:`card`,icon:Gr,aliases:[`box`,`panel`,`卡片`,`面板`],block:{type:`card`,children:[{type:`paragraph`}]}},{key:`stats`,icon:Pr,aliases:[`kpi`,`metric`,`figures`,`numbers`,`scorecard`,`数字`,`指标`],block:{type:`stats`,props:{data:JSON.stringify([{label:``,value:``},{label:``,value:``},{label:``,value:``}])}}},{key:`code`,hint:"```",icon:St,aliases:[`pre`,`代码`],block:{type:`codeBlock`}},{key:`divider`,hint:`---`,icon:nn,aliases:[`hr`,`line`,`rule`,`分隔`,`横线`],block:{type:`divider`}},{key:`table`,icon:Vt,aliases:[`grid`,`表格`],block:{type:`table`,content:{type:`tableContent`,rows:[{cells:[[],[],[]]},{cells:[[],[],[]]}]}}},{key:`image`,icon:bn,aliases:[`picture`,`photo`,`img`,`图片`,`照片`],block:{type:`image`}},{key:`chart`,icon:je,aliases:[`graph`,`plot`,`bar`,`line`,`pie`,`图表`,`柱状图`],make:e=>({type:`chart`,props:{data:nY(lX(e.sample))}})},{key:`equation`,hint:`$$`,icon:Dt,aliases:[`math`,`tex`,`latex`,`formula`,`公式`,`数学`],block:{type:`math`,props:{code:String.raw`e^{i\pi} + 1 = 0`}}},{key:`diagram`,icon:ti,aliases:[`mermaid`,`flowchart`,`graph`,`图示`,`流程图`],block:{type:`diagram`,props:{code:`graph LR
216
- A --> B
217
- B --> C`}}},{key:`pagebreak`,icon:Yr,aliases:[`page`,`break`,`new page`,`分页`,`分页符`],block:{type:`pagebreak`}},{key:`pagebreakLandscape`,icon:qr,aliases:[`landscape`,`wide`,`orientation`,`section`,`横向`,`横排`],block:{type:`pagebreak`,props:{orientation:`landscape`}}},{key:`pagebreakPortrait`,icon:Jr,aliases:[`portrait`,`orientation`,`section`,`纵向`,`竖排`],block:{type:`pagebreak`,props:{orientation:`portrait`}}},{key:`toc`,icon:Hr,aliases:[`contents`,`table of contents`,`toc`,`outline`,`目录`],block:{type:`toc`}},{key:`bibliography`,icon:Rr,aliases:[`references`,`sources`,`citations`,`参考文献`,`文献`],block:{type:`bibliography`}},{key:`footnote`,icon:Qr,aliases:[`note`,`source`,`cite`,`reference`,`脚注`,`注释`],run:`footnote`},{key:`columns2`,icon:Mr,aliases:[`columns`,`side`,`layout`,`分栏`,`两栏`,`列`],block:FX(2)},{key:`columns3`,icon:Nr,aliases:[`columns`,`side`,`layout`,`分栏`,`三栏`,`列`],block:FX(3)}],LX=[`paragraph`,`heading1`,`heading2`,`heading3`,`bullet`,`numbered`,`check`,`toggle`,`quote`,`callout`];function RX(e){let t=IX.find(t=>t.key===e);return t&&LX.includes(e)?t.block:void 0}function zX(e,t,n=[]){let r=t.trim().toLowerCase(),i=e=>e.title.toLowerCase().includes(r)||e.key.includes(r)||e.aliases.some(e=>e.toLowerCase().includes(r)),a=[...IX.map(({make:t,...n})=>({...n,title:e.blocks[n.key],...t?{block:t(e)}:{}})),...n.map(t=>({key:`component:${t.of}`,title:t.title,icon:Zr,aliases:[`component`,`组件`,e.component,t.name],block:{type:`component`,props:{data:eY({type:`component`,of:t.of,props:{}})}}}))];if(r===``)return a;let o=LX.flatMap(t=>{let n=IX.find(e=>e.key===t);return n?.block?[{key:`turn:${t}`,title:`${e.turnInto} ${e.blocks[t]}`,icon:n.icon,aliases:[`turn`,`转换`,`变成`,e.turnInto],update:n.block}]:[]}),s=PX.flatMap(t=>[{key:`color:text:${t}`,title:`${e.colorNames[t]} ${e.text}`,icon:Xt,aliases:[t,`color`,`颜色`,e.colorNames[t]],update:{type:``,props:{textColor:t}}},{key:`color:background:${t}`,title:`${e.colorNames[t]} ${e.background}`,icon:Xt,aliases:[t,`background`,`背景`,e.colorNames[t]],update:{type:``,props:{backgroundColor:t}}}]),c=[...o,...s].filter(e=>e.aliases.some(e=>e.toLowerCase().startsWith(r))||e.title.toLowerCase().startsWith(r));return[...a.filter(i),...c]}function BX(){let e=tp();return t=>{if(t.run===`footnote`){kX(e);return}if(t.block){KC(e,t.block);return}if(!t.update)return;let n=e.getTextCursorPosition().block,{type:r,...i}=t.update;e.updateBlock(n,{...r===``?{}:{type:r},...i})}}var VX={doc:Wr,video:_n,slides:pn,sheet:Xr,scenery:Pn,model:Cn,website:Mn},HX=8;function UX(e,t){let n=t.trim().toLowerCase();return e.filter(e=>n===``||e.title.toLowerCase().includes(n)||e.place.toLowerCase().includes(n)).slice(0,HX).map(e=>({key:`link:${e.href}`,title:e.title,hint:e.place,icon:(e.kind!==void 0&&Object.hasOwn(VX,e.kind)?VX[e.kind]:void 0)??Wr,aliases:[]}))}function WX({items:e,selectedIndex:t,onItemClick:n,empty:r,testId:i=`doc-slash-menu`}){let a=(0,W.useRef)(null),[o,s]=(0,W.useState)(),[c,l]=(0,W.useState)(t);c!==t&&(l(t),s(void 0));let u=o??t,d=(0,W.useRef)(n);return(0,W.useEffect)(()=>{d.current=n}),(0,W.useEffect)(()=>{if(o===void 0)return;let t=e[o],n=e=>{e.key===`Enter`&&t&&(e.preventDefault(),e.stopImmediatePropagation(),d.current?.(t))};return window.addEventListener(`keydown`,n,!0),()=>{window.removeEventListener(`keydown`,n,!0)}},[o,e]),(0,W.useEffect)(()=>{a.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[t]),(0,G.jsx)(`div`,{ref:a,role:`listbox`,"data-testid":i,className:`doc-menu doc-slash-menu`,children:e.length===0?(0,G.jsx)(`p`,{className:`doc-menu-empty`,children:r}):e.map((e,t)=>{let r=e.icon;return(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===u,"data-item":e.key,className:`doc-menu-item`,onMouseMove:()=>{o!==t&&s(t)},onMouseDown:e=>{e.preventDefault()},onClick:()=>{n?.(e)},children:[(0,G.jsx)(r,{size:16,"aria-hidden":!0,className:`doc-menu-icon`}),(0,G.jsx)(`span`,{className:`doc-menu-title`,children:e.title}),e.hint!==void 0&&(0,G.jsx)(`span`,{className:`doc-menu-hint`,"aria-hidden":!0,children:e.hint})]},e.key)})})}var GX=[{value:`left`,icon:De},{value:`center`,icon:Ae},{value:`right`,icon:we},{value:`justify`,icon:He}];function KX({names:e}){let t=tp(),n=Cp(),r=pp(),i=sp({editor:t,selector:({editor:e})=>{let t=e.getTextCursorPosition().block,n=t.props?.textAlignment;return typeof n==`string`?`${n}:${t.content===void 0?`placed`:`text`}`:void 0}});if(!n||i===void 0)return null;let[a,o]=i.split(`:`),s=GX.filter(({value:e})=>o===`text`||e!==`justify`),c=s.find(e=>e.value===a)?.icon??De,l=e[a??`left`];return(0,G.jsxs)(n.Generic.Menu.Root,{position:`bottom-start`,portalElement:r,preventFocusOnOpen:!0,children:[(0,G.jsx)(n.Generic.Menu.Trigger,{children:(0,G.jsx)(n.FormattingToolbar.Button,{className:`doc-align-button`,label:l,mainTooltip:l,children:(0,G.jsx)(c,{size:15,"aria-hidden":!0})})}),(0,G.jsx)(n.Generic.Menu.Dropdown,{className:`bn-menu-dropdown doc-align-menu`,children:s.map(({value:r,icon:i})=>(0,G.jsx)(n.Generic.Menu.Item,{className:`bn-menu-item`,icon:(0,G.jsx)(i,{size:15,"aria-hidden":!0}),checked:a===r,onClick:()=>{let e=t.getSelection()?.blocks??[t.getTextCursorPosition().block];for(let n of e)t.updateBlock(n,{props:{textAlignment:r}})},children:e[r]},r))})]})}function qX({strings:e}){let t=tp(),n=Cp(),r=pp(),i=sp({editor:t,selector:({editor:e})=>{let t=e.getActiveStyles();return typeof t.tag==`string`?t.tag:``}});return n?(0,G.jsxs)(n.Generic.Menu.Root,{position:`bottom-start`,portalElement:r,preventFocusOnOpen:!0,children:[(0,G.jsx)(n.Generic.Menu.Trigger,{children:(0,G.jsx)(n.FormattingToolbar.Button,{className:`doc-tag-button`,label:e.tag,mainTooltip:e.tag,isSelected:i!==``,children:(0,G.jsx)($r,{size:15,"aria-hidden":!0})})}),(0,G.jsxs)(n.Generic.Menu.Dropdown,{className:`bn-menu-dropdown doc-tag-menu`,children:[(0,G.jsx)(n.Generic.Menu.Item,{className:`bn-menu-item`,checked:i===``,onClick:()=>{t.removeStyles({tag:i})},children:e.noTag}),PX.map(r=>(0,G.jsx)(n.Generic.Menu.Item,{className:`bn-menu-item`,icon:(0,G.jsx)(`span`,{className:`doc-tag doc-tag-swatch`,"data-tag":r}),checked:i===r,onClick:()=>{t.addStyles({tag:r})},children:e.colorNames[r]},r))]})]}):null}function JX({aligns:e,tags:t}){return(0,G.jsxs)(iM,{children:[(0,G.jsx)(Kj,{},`type`),(0,G.jsx)(Tj,{basicTextStyle:`bold`},`bold`),(0,G.jsx)(Tj,{basicTextStyle:`italic`},`italic`),(0,G.jsx)(Tj,{basicTextStyle:`underline`},`underline`),(0,G.jsx)(Tj,{basicTextStyle:`strike`},`strike`),(0,G.jsx)(Tj,{basicTextStyle:`code`},`code`),(0,G.jsx)(Mj,{},`color`),(0,G.jsx)(qX,{strings:t},`tag`),(0,G.jsx)(Lj,{},`link`),(0,G.jsx)(KX,{names:e},`align`)]})}function YX({strings:e,onActions:t}){let n=tp(),r=Cp(),i=QA(IE,{selector:e=>e?.block});return!r||!i?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(r.Generic.Menu.Item,{className:`bn-menu-item`,onClick:()=>{i.id!==void 0&&t(i.id)},children:[(0,G.jsx)(rn,{size:15,"aria-hidden":!0}),e.turnInto,`…`]}),(0,G.jsxs)(r.Generic.Menu.Item,{className:`bn-menu-item`,onClick:()=>{i.id!==void 0&&n.insertBlocks([jY(i)],i.id,`after`)},children:[(0,G.jsx)(Bt,{size:15,"aria-hidden":!0}),e.duplicate]})]})}function XX({label:e}){let t=tp(),n=Cp(),r=QA(IE,{selector:e=>e?.block});return!n||!r?null:(0,G.jsxs)(n.Generic.Menu.Item,{className:`bn-menu-item doc-menu-danger`,onClick:()=>{let e=t.getSelection()?.blocks;t.removeBlocks(e?.some(e=>e.id===r.id)?e:[r])},children:[(0,G.jsx)(an,{size:15,"aria-hidden":!0}),e]})}function ZX({strings:e,onActions:t,...n}){return(0,G.jsx)(jM,{...n,dragHandleMenu:()=>(0,G.jsxs)(kM,{children:[(0,G.jsx)(YX,{strings:e,onActions:t}),(0,G.jsxs)(TM,{children:[(0,G.jsx)(Xt,{size:15,"aria-hidden":!0}),e.colors]}),(0,G.jsx)(XX,{label:e.remove})]})})}function QX({actions:e,placeholder:t,empty:n,at:r,onClose:i}){let[a,o]=(0,W.useState)(``),[s,c]=(0,W.useState)(0),l=(0,W.useRef)(null),u=a.trim().toLowerCase(),d=e.filter(e=>u===``||e.title.toLowerCase().includes(u)||(e.group??``).toLowerCase().includes(u)||e.key.includes(u)),f=Math.min(s,Math.max(0,d.length-1));return(0,W.useEffect)(()=>{l.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`})},[f,a]),(0,G.jsxs)(`div`,{className:`doc-actions`,style:{left:r.x,top:r.y},"data-testid":`doc-actions`,onMouseDown:e=>{e.stopPropagation()},children:[(0,G.jsx)(`input`,{autoFocus:!0,value:a,placeholder:t,"aria-label":t,className:`doc-actions-find`,onChange:e=>{o(e.target.value),c(0)},onBlur:i,onKeyDown:e=>{if(e.key===`Escape`&&i(),e.key===`ArrowDown`&&(e.preventDefault(),c(Math.min(f+1,d.length-1))),e.key===`ArrowUp`&&(e.preventDefault(),c(Math.max(f-1,0))),e.key===`Enter`){e.preventDefault();let t=d[f];i(),t?.run()}}}),(0,G.jsx)(`div`,{ref:l,role:`listbox`,className:`doc-menu doc-actions-list`,children:d.length===0?(0,G.jsx)(`p`,{className:`doc-menu-empty`,children:n}):d.map((e,t)=>{let n=e.icon,r=e.group!==void 0&&d[t-1]?.group!==e.group;return(0,G.jsxs)(`div`,{children:[r?(0,G.jsx)(`p`,{className:`doc-menu-group`,children:e.group}):null,(0,G.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t===f,"data-item":e.key,className:`doc-menu-item`,onMouseDown:e=>{e.preventDefault()},onClick:()=>{i(),e.run()},children:[(0,G.jsx)(n,{size:16,"aria-hidden":!0,className:`doc-menu-icon`}),(0,G.jsx)(`span`,{className:`doc-menu-title`,children:e.title})]})]},e.key)})})]})}function $X(e){return IX.find(t=>t.key===e)?.icon??Kr}function eZ(e,t,n){for(let r of e){if(r.id===t)return{block:r,parent:n};let e=eZ(r.children??[],t,r);if(e)return e}}var tZ=(e,t)=>e.id===t||(e.children??[]).some(e=>tZ(e,t)),nZ=e=>({type:`column`,props:{width:1},children:e});function rZ(e,t){return e.flatMap(e=>{if(t.has(e))return[];if(!e.children)return[e];let n=rZ(e.children,t);if(e.type!==`columns`)return[{...e,children:n}];let r=n.filter(e=>(e.children??[]).length>0);return r.length<2?r.flatMap(e=>e.children??[]):[{...e,children:r}]})}function iZ(e,t){let n=eZ(e,t);if(n)return n.block.type===`column`?`column`:n.parent===void 0?`block`:void 0}function aZ(e,t,n){let r=t.map(t=>eZ(e,t)?.block);if(r.length===0||r.some(e=>e===void 0))return;let i=r;if(i.some(e=>e.type===`columns`||e.type===`column`)||i.some(e=>tZ(e,n.id)))return;let a=eZ(e,n.id);if(!a)return;let o=i.map(e=>({...e})),s=new Set(i),c=(e,t)=>e.flatMap(e=>e===a.block?t(e):e.children&&tZ(e,n.id)?[{...e,children:c(e.children,t)}]:[e]),l;if(a.block.type===`column`){if((a.block.children??[]).filter(e=>!s.has(e)).length===0)return;let t=nZ(o);l=c(e,e=>n.side===`left`?[t,e]:[e,t])}else{if(a.parent!==void 0)return;let t=nZ(o);l=c(e,e=>[{type:`columns`,children:n.side===`left`?[t,nZ([e])]:[nZ([e]),t]}])}return rZ(l,s)}var oZ={share:.2,most:96,least:24};function sZ(e){let t=e.dragging?.slice;if(!t||t.openStart>0)return[];let n=[];return t.content.forEach(e=>{let t=e.attrs.id;typeof t==`string`&&n.push(t)}),n}function cZ(e,t,n,r){let i=t.firstElementChild?.getBoundingClientRect();if(!i)return;let a=Math.min(Math.max(n,i.left+4),i.right-4),o;for(let e of t.ownerDocument.elementsFromPoint(a,r)){if(!t.contains(e))continue;let n=e.closest(`[data-id]`)?.getAttribute(`data-id`);if(n){o=n;break}}for(let n=o===void 0?void 0:e.getBlock(o);n;){if(n.id===void 0)return;let r=e.getParentBlock(n.id),i=n.type===`column`?n:r===void 0||r.type===`column`?r??n:void 0;if(i?.id!==void 0){let e=t.querySelector(i.type===`column`?`[data-doc-col="${CSS.escape(i.id)}"]`:`.bn-block-outer[data-id="${CSS.escape(i.id)}"]`);return e?{id:i.id,box:e.getBoundingClientRect()}:void 0}n=r}}function lZ(){let e;return{dropCursor:{color:`var(--allyhub-pencil)`,width:3,hooks:{computeDropPosition:({editor:t,event:n,view:r,defaultPosition:i})=>{e=void 0;let a=t,o=sZ(r);if(o.length===0||!a.isEditable)return i;let s=cZ(a,r.dom,n.clientX,n.clientY);if(!s)return i;let c=Math.min(oZ.most,Math.max(oZ.least,s.box.width*oZ.share)),l=n.clientX<s.box.left+c?`left`:n.clientX>s.box.right-c?`right`:void 0;if(l===void 0||!iZ(a.document,s.id))return i;let u={id:s.id,side:l};if(!aZ(a.document,o,u))return i;let d=mw(s.id,r.state.doc);return d?(e=u,{pos:d.posBeforeNode,orientation:l===`left`?`block-vertical-left`:`block-vertical-right`}):i}}},extension:w_(({editor:t})=>({key:`docColumnDrop`,prosemirrorPlugins:[new Tr({appendTransaction(e,t,n){if(!e.some(e=>e.getMeta(`uiEvent`)===`drop`))return null;let r=new Map;t.doc.descendants(e=>(e.type.name===`column`&&r.set(e.attrs.id,vD(e)),!e.isTextblock));let i=[];if(n.doc.descendants((e,t)=>{if(e.type.name!==`columns`)return!e.isTextblock;let n=[];return e.forEach(e=>n.push(e)),n.some(e=>vD(e)&&r.get(e.attrs.id)!==!0)&&i.push(t),!1}),i.length===0)return null;let a=n.tr;for(let e of i.reverse())yD(a,e);return a},props:{handleDrop(n,r,i){let a=e;if(e=void 0,!a)return!1;let o=t,s=sZ({dragging:{slice:i}}),c=aZ(o.document,s,a);if(!c)return!1;let l=o.document,u=xn(l,c,e=>JSON.stringify(e));return o.transact(()=>{for(let e of u){let t=l.slice(e.at,e.at+e.remove).flatMap(e=>e.id===void 0?[]:[e.id]);if(t.length>0)o.replaceBlocks(t,e.insert);else if(e.insert.length>0){let t=l[e.at]?.id,n=l.at(-1)?.id;t===void 0?n!==void 0&&o.insertBlocks(e.insert,n,`after`):o.insertBlocks(e.insert,t,`before`)}}}),!0}}})]}))()}}var uZ=/\.(png|jpe?g|gif|webp|avif|svg)$/iu;function dZ(e){let t=o(),[n,r]=(0,W.useState)();return(0,W.useEffect)(()=>{if(e===void 0)return;let n=!0;return t[`files/url`]({path:e}).then(t=>{n&&r({path:e,url:t.url})},()=>void 0),()=>{n=!1}},[t,e]),n!==void 0&&n.path===e?n.url:void 0}var fZ=e=>e.slice(0,Math.max(0,e.lastIndexOf(`/`)));async function pZ(e,t){let{files:n}=await e[`files/list`]({dir:``}),r=e=>fZ(e)===t;return n.map(e=>e.path).filter(e=>uZ.test(e)).sort((e,t)=>Number(r(t))-Number(r(e))||e.localeCompare(t))}async function mZ(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}async function hZ(e,t,n){return zY(t,(await e[`files/upload`]({dir:t,name:n.name,data:await mZ(n)})).path)}function gZ(e){let t=e=>e.slice(e.lastIndexOf(`/`)+1),n=new Map;for(let r of e)n.set(t(r),(n.get(t(r))??0)+1);return new Map(e.map(e=>[e,(n.get(t(e))??0)>1?e:t(e)]))}function _Z({path:e,label:t,chosen:n,onChoose:r}){let i=dZ(e);return(0,G.jsx)(vn,{aspect:`wide`,title:(0,G.jsx)(`span`,{className:`block truncate text-xs font-normal`,children:t}),"aria-label":e,"aria-pressed":n,className:`aria-pressed:bg-here`,"data-testid":`doc-cover-picture`,"data-path":e,picture:i===void 0?void 0:(0,G.jsx)(`img`,{src:i,alt:``,loading:`lazy`,draggable:!1}),onClick:r})}function vZ(e){return rf.map(t=>({key:t,label:e.cover.names[t],src:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(kf(t))}`,file:Af(t),bytes:()=>Promise.resolve(new Blob([kf(t)],{type:`image/svg+xml`}))}))}function yZ({cover:e,chosen:t,disabled:n,onChoose:r}){return(0,G.jsx)(`div`,{title:e.label,className:`contents`,children:(0,G.jsx)(vn,{"aria-label":e.label,"aria-pressed":t,disabled:n,className:`aspect-[3/1] p-1 aria-pressed:bg-here`,"data-testid":`doc-cover-gallery-picture`,"data-name":e.key,picture:(0,G.jsx)(`img`,{src:e.src,alt:``,loading:`lazy`,draggable:!1}),onClick:r})})}function bZ({dir:e,current:t,words:n,onPick:r}){let i=o(),[a,s]=(0,W.useState)(),[c,l]=(0,W.useState)(),[u,d]=(0,W.useState)(!1),f=(0,W.useRef)(null);(0,W.useEffect)(()=>{let t=!0;return pZ(i,e).then(e=>{t&&s(e)},()=>{t&&s([])}),()=>{t=!1}},[i,e]);let p=t=>e===``?t:`${e}/${t}`,m=a?.some(t=>fZ(t)===e)??!1,h=c??(m?`project`:`gallery`),g=async t=>{d(!0);try{r(await hZ(i,e,t))}catch{}finally{d(!1)}},_=t=>{let n=p(t.file);a?.includes(n)?r(zY(e,n)):(d(!0),t.bytes().then(e=>g(new File([e],t.file,{type:e.type})),()=>{d(!1)}))},v=gZ(a??[]);return(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-testid":`doc-cover-picker`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,G.jsx)(`div`,{role:`tablist`,className:`flex flex-1 gap-1`,children:[`gallery`,`project`].map(e=>(0,G.jsx)(Dn,{role:`tab`,"aria-selected":h===e,"data-testid":`doc-cover-tab-${e}`,onClick:()=>{l(e)},children:n.cover[e]},e))}),(0,G.jsxs)(Dn,{disabled:u,onClick:()=>f.current?.click(),"data-testid":`doc-cover-upload`,children:[(0,G.jsx)(ei,{}),n.cover.upload]}),(0,G.jsx)(`input`,{ref:f,type:`file`,accept:`image/*`,hidden:!0,onChange:e=>{let t=e.target.files?.[0];e.target.value=``,t&&g(t)}})]}),h===`gallery`?(0,G.jsx)(`div`,{role:`tabpanel`,className:`-mx-1 grid max-h-80 grid-cols-2 gap-1 overflow-y-auto`,"data-testid":`doc-cover-gallery`,children:vZ(n).map(e=>(0,G.jsx)(yZ,{cover:e,chosen:t===p(e.file),disabled:u,onChoose:()=>{_(e)}},e.key))}):a===void 0?(0,G.jsx)(`div`,{role:`tabpanel`,className:`h-24`}):a.length===0?(0,G.jsx)(`p`,{role:`tabpanel`,className:`px-1 pb-2 text-sm text-lead`,children:n.cover.none}):(0,G.jsx)(`div`,{role:`tabpanel`,className:`-mx-1 grid max-h-80 grid-cols-3 gap-1 overflow-y-auto`,children:a.map(n=>(0,G.jsx)(_Z,{path:n,label:v.get(n)??n,chosen:n===t,onChoose:()=>{r(zY(e,n))}},n))})]})}var xZ=`opacity-0 focus-visible:opacity-100 aria-expanded:opacity-100 motion-safe:transition-opacity`;function SZ({place:e,look:t,dir:n,words:r,editable:i,onLook:a}){let[o,s]=(0,W.useState)(!1),c=(0,W.useCallback)(e=>{s(!1),e!==t.cover&&a(Vf(t,e))},[t,a]),l=t.cover,u=l===void 0||RY.test(l)?void 0:HY(n,l),d=dZ(u),f=l===void 0?void 0:RY.test(l)?l:u===void 0?null:d,[p,m]=(0,W.useState)(),[h,g]=(0,W.useState)(),_=h!==void 0&&h.of===l?h.y:void 0,v=(0,W.useCallback)(e=>{g(e===void 0||l===void 0?void 0:{of:l,y:e})},[l]),y=(0,W.useRef)(null),b=(0,W.useRef)(null),x=(0,W.useRef)(void 0),S=_??t.coverY??50,C=(0,W.useCallback)(()=>{x.current=void 0,v(void 0)},[v]),w=(0,W.useCallback)(()=>{if(_!==void 0){let e=Hf(t,_);(e.coverY??50)!==(t.coverY??50)&&a(e)}C()},[C,t,_,a]);(0,W.useEffect)(()=>{if(_===void 0)return;let e=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),C())};return window.addEventListener(`keydown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0)}},[C,_]);let T=()=>{let e=y.current?.getBoundingClientRect(),t=b.current;if(!e||!t||t.naturalWidth===0)return 0;let n=t.naturalHeight*e.width/t.naturalWidth-e.height;return n>.5?100/n:0},E=e=>{_!==void 0&&e.button===0&&(e.preventDefault(),e.currentTarget.setPointerCapture(e.pointerId),x.current={y:e.clientY,from:_,pointer:e.pointerId})},D=e=>{let t=x.current;if(t?.pointer!==e.pointerId)return;let n=t.from-(e.clientY-t.y)*T();v(Math.min(100,Math.max(0,n)))},O=e=>{x.current?.pointer===e.pointerId&&(x.current=void 0)},k=e=>{if(_===void 0)return;let t=e.shiftKey?10:1;if(e.key===`ArrowUp`||e.key===`ArrowDown`){e.preventDefault();let n=_+(e.key===`ArrowUp`?t:-t);v(Math.min(100,Math.max(0,n)))}else e.key===`Enter`&&(e.preventDefault(),w())};if(e===`title`)return l===void 0&&i?(0,G.jsx)(`div`,{className:`doc-cover-add`,children:(0,G.jsxs)(Ge,{open:o,onOpenChange:s,children:[(0,G.jsx)(qe,{asChild:!0,children:(0,G.jsxs)(Dn,{className:`${xZ} group-hover/title:opacity-100`,"data-testid":`doc-cover-add`,children:[(0,G.jsx)(bn,{}),r.cover.add]})}),(0,G.jsx)(Je,{align:`start`,className:`w-[26rem] p-2`,children:(0,G.jsx)(bZ,{dir:n,current:void 0,words:r,onPick:c})})]})}):null;if(l===void 0)return null;let A=f===null||f!==void 0&&p===f;return(0,G.jsxs)(`div`,{ref:y,className:`doc-cover group/cover`,"data-testid":`doc-cover`,"data-missing":A?``:void 0,"data-moving":_===void 0?void 0:``,..._===void 0?{}:{role:`slider`,tabIndex:0,"aria-label":r.cover.drag,"aria-orientation":`vertical`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(S)},onPointerDown:E,onPointerMove:D,onPointerUp:O,onPointerCancel:O,onKeyDown:k,children:[A?(0,G.jsx)(`span`,{className:`doc-cover-path`,children:l}):f!==void 0&&(0,G.jsx)(`img`,{ref:b,src:f,alt:``,draggable:!1,style:{objectPosition:`50% ${String(S)}%`},onError:()=>{m(f)}}),_!==void 0&&(0,G.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 rounded-md bg-media/60 px-3 py-1.5 text-xs text-on-media`,children:r.cover.drag}),i&&(0,G.jsx)(`div`,{className:`absolute right-2 bottom-2 flex gap-0.5 rounded-lg border border-rule bg-sheet/95 p-0.5 shadow-float ${_===void 0?`opacity-0 group-hover/cover:opacity-100 group-focus-within/cover:opacity-100 has-[[aria-expanded=true]]:opacity-100 motion-safe:transition-opacity`:``}`,onPointerDown:e=>{e.stopPropagation()},children:_===void 0?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(Ge,{open:o,onOpenChange:s,children:[(0,G.jsx)(qe,{asChild:!0,children:(0,G.jsxs)(Dn,{"data-testid":`doc-cover-change`,children:[(0,G.jsx)(bn,{}),r.cover.change]})}),(0,G.jsx)(Je,{align:`end`,className:`w-[26rem] p-2`,children:(0,G.jsx)(bZ,{dir:n,current:u,words:r,onPick:c})})]}),!A&&(0,G.jsxs)(Dn,{"data-testid":`doc-cover-reposition`,onClick:()=>{v(t.coverY??50),requestAnimationFrame(()=>y.current?.focus())},children:[(0,G.jsx)(Ur,{}),r.cover.reposition]}),(0,G.jsxs)(Dn,{"data-testid":`doc-cover-remove`,onClick:()=>{a(Vf(t,void 0))},children:[(0,G.jsx)(an,{}),r.cover.remove]})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Dn,{"data-testid":`doc-cover-save`,onClick:w,children:r.cover.save}),(0,G.jsx)(Dn,{"data-testid":`doc-cover-cancel`,onClick:C,children:r.cover.cancel})]})})]})}var CZ=new hr(`docAgent`),wZ=w_(()=>({key:`docAgent`,prosemirrorPlugins:[new Tr({key:CZ,state:{init:()=>null,apply:(e,t)=>{let n=e.getMeta(CZ);return n===void 0?t:n}},props:{decorations(e){let t=CZ.getState(e);if(!t)return null;let n;return e.doc.descendants((e,r)=>n?!1:e.type.name!==`blockContainer`||e.attrs.id!==t.id||(n=Er.node(r,r+e.nodeSize,{class:`doc-agent`,"data-agent":t.label,"data-testid":`doc-agent`}),!1)),n?Cr.create(e.doc,[n]):null}}})]}))();function TZ(e,t){let n=e._tiptapEditor.view;n.dispatch(n.state.tr.setMeta(CZ,t))}var EZ=(0,W.createContext)({numbers:new Map,words:new Map});function DZ(e){let[t,n]=(0,W.useState)(()=>SX(TY(e.document)));return(0,W.useEffect)(()=>e.onChange(()=>{let t=SX(TY(e.document));n(e=>CX(e,t)?e:t)}),[e]),t}var OZ=()=>typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches;function kZ(e,t){let n=EX(e.document,t);if(n?.id!==void 0){try{e.setTextCursorPosition(n.id,`end`),e.focus()}catch{}document.querySelector(`.bn-block-outer[data-id="${CSS.escape(n.id)}"]`)?.scrollIntoView({block:`center`,behavior:OZ()?`auto`:`smooth`})}}function AZ({label:e,editor:t}){let n=(0,W.useContext)(EZ),r=e.toLowerCase(),i=n.words.get(r),a=n.numbers.get(r),o=i===void 0||a===void 0?`[${e}]`:String(a),s=(0,G.jsx)(`button`,{type:`button`,className:`doc-fn-mark`,"data-doc-footnote":e,onMouseDown:e=>{e.preventDefault()},onClick:()=>{kZ(t,e)},children:o});return(0,G.jsx)(`sup`,{className:`doc-fn`,contentEditable:!1,children:i===void 0||i===``?s:(0,G.jsxs)(ln,{children:[(0,G.jsx)(cn,{asChild:!0,children:s}),(0,G.jsx)(sn,{side:`top`,className:`doc-fn-words max-w-72 text-left`,"data-testid":`doc-footnote-words`,children:i})]})})}var jZ=_P({type:`footnote`,propSchema:{label:{default:``},styles:{default:``},href:{default:``}},content:`none`},{render:e=>(0,G.jsx)(AZ,{label:e.inlineContent.props.label,editor:e.editor})});function MZ({label:e}){let t=(0,W.useContext)(EZ).numbers.get(e.toLowerCase());return(0,G.jsx)(`span`,{contentEditable:!1,className:`doc-note-number`,"data-unmarked":t===void 0?``:void 0,children:t===void 0?`–`:`${String(t)}.`})}var NZ=qN({type:`note`,propSchema:{label:{default:``}},content:`inline`},{render:e=>(0,G.jsxs)(`div`,{className:`doc-note`,"data-doc-note":e.block.props.label,children:[(0,G.jsx)(MZ,{label:e.block.props.label}),(0,G.jsx)(`div`,{className:`doc-note-text`,ref:e.contentRef})]})});function PZ({orientation:e}){let t=(0,W.useContext)(KY)?.words;return(0,G.jsx)(`div`,{contentEditable:!1,className:`doc-pagebreak`,"data-doc-pagebreak":e,children:(0,G.jsx)(`span`,{children:e===`landscape`?t?.blocks.pagebreakLandscape:e===`portrait`?t?.blocks.pagebreakPortrait:t?.blocks.pagebreak})})}var FZ=qN({type:`pagebreak`,propSchema:{orientation:{default:``}},content:`none`},{render:e=>(0,G.jsx)(PZ,{orientation:e.block.props.orientation})}),IZ=e=>e===`sans`||e===`serif`||e===`mono`||e===`times`?`Ag`:`文`,LZ=[`sans`,`serif`,`mono`,`times`,`song`,`hei`,`fangsong`,`kai`],RZ=[`letter`,`legal`,`a4`,`a5`,`b5`],zZ={a3:`A3`,a4:`A4`,a5:`A5`,b5:`B5`,letter:`Letter`,legal:`Legal`},BZ={normal:25.4,narrow:12.7,wide:[25.4,50.8]},VZ=[10.5,11,12,14,16],HZ=[1.15,1.5,2],UZ=e=>Object.entries(Ni).find(([,t])=>t===e)?.[0],WZ=e=>{if(e===void 0)return``;for(let[t,n]of Object.entries(BZ))if(JSON.stringify(n)===JSON.stringify(e))return t};function GZ({label:e,value:t,options:n,onValue:r,testId:i}){return(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-sm`,children:[(0,G.jsx)(`span`,{className:`text-lead shrink-0`,children:e}),(0,G.jsxs)(gn,{value:t??`*`,onValueChange:r,children:[(0,G.jsx)(wn,{size:`sm`,className:`w-40`,"aria-label":e,"data-testid":i,children:(0,G.jsx)(Nn,{})}),(0,G.jsxs)(On,{children:[t===void 0&&(0,G.jsx)(An,{value:`*`,disabled:!0,children:`…`}),n.map(([e,t])=>(0,G.jsx)(An,{value:e===``?`-`:e,children:t},e===``?`-`:e))]})]})]})}function KZ({look:e,words:t,chinese:n,onLook:r}){let i=e.preset===void 0?{}:Li(e.preset),a=e.font??i.font??`sans`,o=(t,n)=>{let i=Object.fromEntries(Object.entries(e).filter(([e])=>e!==t));r(n===void 0?i:{...i,[t]:n})},s=e=>e===``?`-`:e,c=e=>e===`-`?``:e,l=e.size===void 0?``:typeof e.size==`number`?String(e.size):String(Ni[e.size]),u=e=>{let r=UZ(e);return n&&r!==void 0?r:t.page.pt(e)},d=t.page,f=e=>{let n=WZ(e);return n===``?t.defaultColor:n===void 0?`${(typeof e==`number`?[e]:[...e??[]]).join(` / `)} mm`:d.marginNames[n]};return(0,G.jsxs)(Ge,{children:[(0,G.jsx)(qe,{asChild:!0,children:(0,G.jsxs)(Dn,{"data-testid":`doc-style`,children:[(0,G.jsx)(Ar,{}),t.style]})}),(0,G.jsxs)(Je,{align:`start`,className:`flex max-h-[min(80vh,640px)] w-80 flex-col gap-3 overflow-y-auto p-3`,children:[(0,G.jsx)(`div`,{role:`radiogroup`,"aria-label":t.style,className:`grid grid-cols-4 gap-1.5`,children:LZ.map(e=>(0,G.jsxs)(Ue,{variant:`box`,checked:a===e,onClick:()=>{o(`font`,e===(i.font??`sans`)?void 0:e)},children:[(0,G.jsx)(`span`,{"aria-hidden":!0,className:`text-xl leading-tight`,style:{fontFamily:Qa({font:e}).text},children:IZ(e)}),(0,G.jsx)(`span`,{className:`text-lead text-xs`,children:t.fonts[e]})]},e))}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsx)(`span`,{className:`text-lead text-xs`,children:t.accent}),(0,G.jsxs)(`div`,{role:`radiogroup`,"aria-label":t.accent,className:`flex flex-wrap gap-1.5`,children:[(0,G.jsx)(Rn,{color:`var(--allyhub-ink)`,label:t.defaultColor,checked:e.accent===void 0,onClick:()=>{o(`accent`,void 0)}}),PX.map(n=>(0,G.jsx)(Rn,{color:xa(n)??n,label:t.colorNames[n],checked:e.accent===n,onClick:()=>{o(`accent`,n)}},n))]})]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-2 border-t pt-3`,children:[(0,G.jsx)(GZ,{label:d.preset,testId:`doc-preset`,value:s(e.preset??``),options:[[``,d.none],...Fi.map(e=>[e,d.presets[e]])],onValue:e=>{let t=c(e);o(`preset`,Fi.includes(t)?t:void 0)}}),(0,G.jsx)(GZ,{label:d.paper,testId:`doc-paper`,value:s(e.paper===void 0?``:typeof e.paper==`string`&&RZ.includes(e.paper)?e.paper:void 0),options:[[``,zZ[typeof i.paper==`string`?i.paper:Bi.paper]],...RZ.filter(e=>e!==Bi.paper).map(e=>[e,zZ[e]])],onValue:e=>{let t=c(e);o(`paper`,RZ.includes(t)?t:void 0)}}),(0,G.jsx)(GZ,{label:d.orientation,testId:`doc-orientation`,value:s(e.orientation===`landscape`?`landscape`:``),options:[[``,d.portrait],[`landscape`,d.landscape]],onValue:e=>{o(`orientation`,c(e)===`landscape`?`landscape`:void 0)}}),(0,G.jsx)(GZ,{label:d.margins,testId:`doc-margins`,value:s(WZ(e.margins)),options:[[``,f(i.margins)],[`normal`,d.marginNames.normal],[`narrow`,d.marginNames.narrow],[`wide`,d.marginNames.wide]],onValue:e=>{let t=c(e);o(`margins`,t in BZ?BZ[t]:void 0)}}),(0,G.jsx)(GZ,{label:d.size,testId:`doc-size`,value:s(l===``||VZ.includes(Number(l))?l===`11`?``:l:void 0),options:[[``,u(i.size===void 0?11:zi(i.size))],...VZ.filter(e=>e!==11).map(e=>[String(e),u(e)])],onValue:e=>{let t=c(e),r=Number(t),i=UZ(r);o(`size`,t===``?void 0:n&&i!==void 0?i:r)}}),(0,G.jsx)(GZ,{label:d.lineHeight,testId:`doc-line-height`,value:s(e.lineHeight===void 0||e.lineHeight===(i.lineHeight??Bi.lineHeight)?``:HZ.includes(e.lineHeight)?String(e.lineHeight):void 0),options:[[``,typeof i.lineHeight==`number`?String(i.lineHeight):i.grid===void 0?String(Bi.lineHeight):d.grid],...HZ.filter(e=>e!==(typeof i.lineHeight==`number`?i.lineHeight:Bi.lineHeight)).map(e=>[String(e),String(e)])],onValue:e=>{let t=c(e);o(`lineHeight`,t===``?void 0:Number(t))}})]}),(0,G.jsxs)(`label`,{className:`flex items-center justify-between gap-2 text-sm`,children:[(0,G.jsx)(`span`,{children:d.indent}),(0,G.jsx)(on,{size:`sm`,"data-testid":`doc-indent`,checked:(e.textIndent??i.textIndent??0)>0,onCheckedChange:e=>{let t=(i.textIndent??0)>0;o(`textIndent`,e===t?void 0:e?2:0)}})]}),(0,G.jsxs)(`label`,{className:`flex items-center justify-between gap-2 text-sm`,children:[(0,G.jsx)(`span`,{children:t.pageNumbers}),(0,G.jsx)(on,{size:`sm`,"data-testid":`doc-page-numbers`,checked:e.pageNumbers!==!1,onCheckedChange:t=>{r(Bf(e,t))}})]})]})]})}function qZ({className:e,...t}){return(0,G.jsx)(dn,{role:`status`,"aria-label":`Loading`,className:N(`size-4 animate-spin`,e),...t})}var JZ=600;function YZ({dir:e,stamp:t,words:n,onGo:r}){let i=o(),[a,s]=(0,W.useState)(),[c,l]=(0,W.useState)(!0),[u,d]=(0,W.useState)();(0,W.useEffect)(()=>{let t=!0,n=setTimeout(()=>{l(!0),QJ(i,`doc/pages`,{item:e}).then(e=>{t&&(s(e),d(void 0),l(!1))},e=>{t&&(d(e instanceof Error?e.message:String(e)),l(!1))})},JZ);return()=>{t=!1,clearTimeout(n)}},[i,e,t]);let f=a?.pages.length??0;return(0,G.jsxs)(`aside`,{className:`doc-pages`,"data-testid":`doc-pages`,"data-printing":c?``:void 0,"aria-label":n.pages,children:[c&&(0,G.jsxs)(`div`,{className:`doc-pages-state`,role:`status`,children:[(0,G.jsx)(qZ,{}),n.pagesPrinting]}),u!==void 0&&(0,G.jsx)(`div`,{className:`doc-pages-state`,role:`alert`,children:n.pagesFailed(u)}),a?.pages.map(e=>(0,G.jsxs)(`figure`,{className:`doc-pages-page`,"data-landscape":e.landscape?``:void 0,style:{aspectRatio:`${String(e.width)} / ${String(e.height)}`},children:[(0,G.jsx)(`img`,{src:`data:${e.image.mime};base64,${e.image.data}`,alt:n.pageOf(e.n,f),draggable:!1}),a.blocks.flatMap(t=>t.places.filter(t=>t.page===e.n).map((i,a)=>(0,G.jsx)(`button`,{type:`button`,className:`doc-page-block`,"aria-label":n.pageBlock(e.n),style:{left:`${String(i.left/e.width*100)}%`,top:`${String(i.top/e.height*100)}%`,width:`${String((i.right-i.left)/e.width*100)}%`,height:`${String((i.bottom-i.top)/e.height*100)}%`},onClick:()=>{r(t.n)}},`${String(t.n)}-${String(a)}`))),(0,G.jsx)(`figcaption`,{children:n.pageOf(e.n,f)})]},e.n))]})}var XZ=(0,W.createContext)(new Map);function ZZ(e,t){let n=new Map;for(let[t,r]of eo(e))t.type===`heading`&&n.set(r,t.content.map(e=>e.text).join(``));let r=za(e,t);for(let t of ua(e)){let e=La(t),i=r.get(t);e!==void 0&&i!==void 0&&n.set(e,i.label)}return n}var QZ=(e,t)=>e.size===t.size&&[...e].every(([e,n])=>t.get(e)===n);function $Z(e,t){let[n,r]=(0,W.useState)(()=>ZZ(TY(e.document),t));return(0,W.useEffect)(()=>e.onChange(()=>{let n=ZZ(TY(e.document),t);r(e=>QZ(e,n)?e:n)}),[e,t]),n}function eQ({target:e}){let t=(0,W.useContext)(XZ).get(decodeURIComponent(e));return(0,G.jsx)(`span`,{className:`doc-ref`,contentEditable:!1,"data-doc-ref":e,"data-unknown":t===void 0?``:void 0,children:t??`#${e}`})}var tQ=_P({type:`reference`,propSchema:{target:{default:``},styles:{default:``}},content:`none`},{render:e=>(0,G.jsx)(eQ,{target:e.inlineContent.props.target})}),nQ={items:[],style:`apa`,list:[],numbers:new Map},rQ=(0,W.createContext)(nQ),iQ=(e,t,n)=>{let r=ki(e,t,n);return{items:t,style:n,list:r,numbers:new Map(r.map(e=>[e.item.id,e.n]))}},aQ=(e,t)=>e.items===t.items&&e.style===t.style&&e.list.map(e=>e.text).join(`
218
- `)===t.list.map(e=>e.text).join(`
219
- `);function oQ(e,t,n){let[r,i]=(0,W.useState)(()=>iQ(TY(e.document),t,n));return(0,W.useEffect)(()=>{let r=()=>{let r=iQ(TY(e.document),t,n);i(e=>aQ(e,r)?e:r)},a=e.onChange(r);return queueMicrotask(r),a},[e,t,n]),r}function sQ({cite:e}){let t=(0,W.useContext)(rQ);return(0,G.jsx)(`span`,{className:`doc-cite`,contentEditable:!1,"data-doc-cite":e,children:t.items.length===0?`[${e}]`:Ai(e,t.items,t.numbers,t.style)})}var cQ=_P({type:`citation`,propSchema:{cite:{default:``},styles:{default:``}},content:`none`},{render:e=>(0,G.jsx)(sQ,{cite:e.inlineContent.props.cite})});function lQ(){let e=(0,W.useContext)(rQ),t=(0,W.useContext)(KY)?.words;return(0,G.jsxs)(`section`,{contentEditable:!1,className:`doc-sources`,"data-doc-sources":e.style,children:[(0,G.jsx)(`span`,{className:`doc-toc-name`,children:t?.blocks.bibliography}),e.list.length===0?(0,G.jsx)(`span`,{className:`doc-toc-empty`,children:t?.sourcesEmpty}):(0,G.jsx)(`ol`,{children:e.list.map(e=>(0,G.jsx)(`li`,{children:e.pieces.map((e,t)=>e.italic?(0,G.jsx)(`i`,{children:e.text},t):e.text)},e.item.id))})]})}var uQ=qN({type:`bibliography`,propSchema:{},content:`none`},{render:()=>(0,G.jsx)(lQ,{})});function dQ(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>e.type===`text`?e.text:e.type===`link`?e.content.map(e=>e.text).join(``):``).join(``):``}function fQ(e){let t=[];for(let n of e){if(n.type===`columns`||n.type===`column`){t.push(...fQ(n.children??[]));continue}let e=n.props?.level;if(n.type!==`heading`||typeof e!=`number`||e>3||n.id===void 0)continue;let r=dQ(n.content).trim();r!==``&&t.push({id:n.id,level:e,text:r})}return t}function pQ({entries:e,label:t,scroller:n,onGo:r}){let[i,a]=(0,W.useState)();return(0,W.useEffect)(()=>{let t=n.current;if(!t)return;let r=()=>{let n=t.getBoundingClientRect().top+96,r;for(let i of e){let e=t.querySelector(`.bn-block-outer[data-id="${CSS.escape(i.id)}"]`);if(e){if(e.getBoundingClientRect().top<=n)r=i.id;else break}}a(r??e[0]?.id)};return r(),t.addEventListener(`scroll`,r,{passive:!0}),()=>{t.removeEventListener(`scroll`,r)}},[e,n]),e.length<3?null:(0,G.jsxs)(`nav`,{"aria-label":t,className:`doc-outline`,"data-testid":`doc-outline`,children:[(0,G.jsx)(`p`,{className:`doc-outline-label`,children:t}),e.map(e=>(0,G.jsx)(`button`,{type:`button`,"data-level":e.level,"aria-current":i===e.id?`location`:void 0,className:`doc-outline-item`,onClick:()=>{r(e.id)},children:e.text},e.id))]})}var mQ,hQ=Promise.resolve(),gQ=0,_Q=()=>mQ??=jn(()=>import(`./mermaid.core-CEpvTOAe.js`).then(e=>e.default),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url);function vQ(e,t){let n=hQ.then(async()=>{let n=await _Q(),r=ui({font:t.font,accent:t.accent});n.initialize({...r,...t.dark?{theme:`dark`,themeVariables:{fontFamily:t.font,fontSize:`14px`}}:{},suppressErrorRendering:!0}),gQ+=1;let{svg:i}=await n.render(`doc-diagram-${String(gQ)}`,e);return yQ(i)});return hQ=n.catch(()=>void 0),n}function yQ(e){let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement;if(t.nodeName!==`svg`)return e;for(let e of t.querySelectorAll(`.today`))e.remove();let n=(t.getAttribute(`viewBox`)??``).trim().split(/[\s,]+/u).map(Number),[,,r,i]=n;return n.length===4&&r!==void 0&&i!==void 0&&r>0&&i>0&&(t.setAttribute(`width`,String(r)),t.setAttribute(`height`,String(i)),t.style.removeProperty(`max-width`)),new XMLSerializer().serializeToString(t)}function bQ(e){let t=(0,W.useMemo)(()=>e.trim()===``?void 0:Ba(e),[e]),[n,r]=(0,W.useState)();return t!==void 0&&t.error===void 0&&t.html!==n&&r(t.html),t===void 0?{}:t.error===void 0?{html:t.html}:{html:n??t.html,error:t.error}}var xQ=150;function SQ(e,t,n,r){let[i,a]=(0,W.useState)({});return(0,W.useEffect)(()=>{if(e.trim()===``)return;let i=!0,o=setTimeout(()=>{vQ(e,{font:t,dark:n,accent:r}).then(e=>{i&&a({html:e})},e=>{i&&a(t=>({...t.html===void 0?{}:{html:t.html},error:e instanceof Error?e.message:String(e)}))})},xQ);return()=>{i=!1,clearTimeout(o)}},[e,t,n,r]),e.trim()===``?{}:i}function CQ({kind:e,code:t,drawn:n,empty:r}){return t.trim()===``?(0,G.jsx)(`span`,{className:`doc-drawn-empty`,children:r}):n.html===void 0?(0,G.jsx)(`pre`,{className:`doc-drawn-code`,children:t}):(0,G.jsx)(`div`,{className:e===`equation`?`doc-math`:`doc-diagram`,dangerouslySetInnerHTML:{__html:n.html}})}function wQ({kind:e,code:t,onCode:n}){let r=(0,W.useContext)(KY),i=(0,W.useContext)(oX),[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(t);!a&&s!==t&&c(t);let l=bQ(e===`equation`?s:``),u=SQ(e===`diagram`?s:``,sX(i.page),i.dark,$a(i.page)),d=e===`equation`?l:u,f=r?.words,p=e===`equation`?f?.blocks.equation:f?.blocks.diagram,m=(e===`equation`?f?.emptyEquation:f?.emptyDiagram)??``,h=r?.readOnly!==!0;return(0,G.jsx)(`figure`,{contentEditable:!1,"data-doc-drawn":e,className:`doc-drawn`,children:(0,G.jsxs)(Ge,{open:h&&a,onOpenChange:o,children:[(0,G.jsx)(qe,{asChild:!0,children:(0,G.jsx)(`button`,{type:`button`,className:`doc-drawn-button`,"aria-label":p,disabled:!h,children:(0,G.jsx)(CQ,{kind:e,code:s,drawn:d,empty:m})})}),h&&(0,G.jsxs)(Je,{align:`center`,className:`flex w-[min(36rem,calc(100vw-2rem))] flex-col gap-2 p-2`,children:[(0,G.jsx)(lr,{value:s,"aria-label":p,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`max-h-[50vh] min-h-20 resize-none font-mono text-xs [font-variant-ligatures:none] md:text-xs`,onChange:e=>{c(e.target.value),n(e.target.value)}}),d.error!==void 0&&(0,G.jsx)(`p`,{role:`alert`,className:`text-problem-text max-h-32 overflow-auto font-mono text-xs whitespace-pre-wrap`,children:d.error})]})]})})}var TQ=qN({type:`math`,propSchema:{code:{default:``}},content:`none`},{render:e=>(0,G.jsx)(wQ,{kind:`equation`,code:e.block.props.code,onCode:t=>{e.editor.updateBlock(e.block,{props:{code:t}})}})}),EQ=qN({type:`diagram`,propSchema:{code:{default:``}},content:`none`},{render:e=>(0,G.jsx)(wQ,{kind:`diagram`,code:e.block.props.code,onCode:t=>{e.editor.updateBlock(e.block,{props:{code:t}})}})});function DQ({trend:e,placeholder:t,onTrend:n}){let[r,i]=(0,W.useState)(e?.join(`, `)??``),a=()=>{let e=r.split(/[,\s]+/u).filter(e=>e!==``).map(Number).filter(e=>Number.isFinite(e));n(e.length<2?void 0:e)};return(0,G.jsx)(`input`,{className:`doc-stat-trend-field`,value:r,placeholder:t,"aria-label":t,onChange:e=>{i(e.target.value)},onBlur:a,onKeyDown:e=>{e.key===`Enter`&&a()}})}function OQ({data:e,onData:t}){let n=(0,W.useContext)(KY),r=n?.words?.stats,i=n?.readOnly!==!0,a=$J(e),o=(e,n)=>{let r=a.flatMap((t,r)=>r===e?n===void 0?[]:[n]:[t]);t(JSON.stringify(r))},s=(e,t,n,a,s)=>i?(0,G.jsx)(`input`,{className:a,style:s,size:n===`delta`?Math.max(3,Array.from(t.delta??r?.delta??``).length):void 0,value:t[n]??``,placeholder:r?.[n],"aria-label":r?.[n],onChange:r=>{let i=r.target.value,a={...t};n===`label`||n===`value`||i!==``?a[n]=i:n===`delta`?delete a.delta:delete a.note,o(e,a)}}):(0,G.jsx)(`span`,{className:a,style:s,children:t[n]});return(0,G.jsxs)(`div`,{className:`doc-stats`,contentEditable:!1,style:{gridTemplateColumns:`repeat(${String(Math.max(1,a.length))}, minmax(0, 1fr))`},children:[a.map((e,t)=>(0,G.jsxs)(`div`,{className:`doc-stat`,children:[s(t,e,`label`,`doc-stat-label`),s(t,e,`value`,`doc-stat-value`),(0,G.jsxs)(`div`,{className:`doc-stat-foot`,children:[s(t,e,`delta`,`doc-stat-delta`,{color:ai[ea(e)]}),s(t,e,`note`,`doc-stat-note`)]}),e.trend!==void 0&&(0,G.jsx)(`div`,{className:`doc-stat-trend`,dangerouslySetInnerHTML:{__html:to(e.trend,ai[ea(e)])}}),i&&(0,G.jsx)(DQ,{trend:e.trend,placeholder:r?.trend,onTrend:n=>{let r={...e};n===void 0?delete r.trend:r.trend=n,o(t,r)}}),i&&a.length>1&&(0,G.jsx)(Dn,{icon:!0,className:`doc-stat-remove`,"aria-label":r?.remove,title:r?.remove,onClick:()=>{o(t,void 0)},children:(0,G.jsx)(an,{})})]},t)),i&&(0,G.jsx)(Dn,{icon:!0,className:`doc-stats-add`,"aria-label":r?.add,title:r?.add,onClick:()=>{t(JSON.stringify([...a,{label:``,value:``}]))},children:(0,G.jsx)(mn,{})})]})}var kQ=qN({type:`stats`,propSchema:{data:{default:`[]`}},content:`none`},{render:e=>(0,G.jsx)(OQ,{data:e.block.props.data,onData:t=>{e.editor.updateBlock(e.block,{props:{data:t}})}})});function AQ({subtitle:e,contentRef:t,onSubtitle:n}){let r=(0,W.useContext)(KY),i=r?.words?.card,a=r?.readOnly!==!0;return(0,G.jsxs)(`div`,{className:`doc-card-head`,children:[(0,G.jsx)(`div`,{className:`doc-card-title`,ref:t}),a?(0,G.jsx)(`input`,{className:`doc-card-subtitle`,contentEditable:!1,value:e,placeholder:i?.subtitle,"aria-label":i?.subtitle,onChange:e=>{n(e.target.value)}}):e!==``&&(0,G.jsx)(`p`,{className:`doc-card-subtitle`,children:e})]})}var jQ=qN({type:`card`,propSchema:{subtitle:{default:``}},content:`inline`},{render:e=>(0,G.jsx)(AQ,{subtitle:e.block.props.subtitle,contentRef:e.contentRef,onSubtitle:t=>{e.editor.updateBlock(e.block,{props:{subtitle:t}})}})}),MQ=vP({type:`tag`,propSchema:`string`},{render:e=>(0,G.jsx)(`span`,{className:`doc-tag`,"data-tag":e.value,ref:e.contentRef})});function NQ(e,t){let n=[],r=e=>{for(let i of e){let e=i.props?.level;if(i.type===`heading`&&typeof e==`number`&&e<=t&&i.id!==void 0){let t=(Array.isArray(i.content)?i.content:[]).map(e=>`text`in e&&typeof e.text==`string`?e.text:``).join(``);t.trim()!==``&&n.push({id:i.id,level:e,words:t})}r(i.children??[])}};return r(e),n}function PQ({editor:e,levels:t,title:n}){let r=(0,W.useContext)(KY)?.words,[i,a]=(0,W.useState)(()=>NQ(e.document,t));(0,W.useEffect)(()=>e.onChange(()=>{a(NQ(e.document,t))}),[e,t]);let o=Math.min(...i.map(e=>e.level));return(0,G.jsxs)(`nav`,{contentEditable:!1,className:`doc-toc`,"data-doc-toc":``,children:[(0,G.jsx)(`span`,{className:`doc-toc-name`,children:n===``?r?.blocks.toc:n}),i.length===0?(0,G.jsx)(`span`,{className:`doc-toc-empty`,children:r?.tocEmpty}):(0,G.jsx)(`ol`,{children:i.map(e=>(0,G.jsx)(`li`,{style:{paddingLeft:`${String((e.level-o)*1.25)}em`},children:(0,G.jsx)(Ln,{size:`dense`,onClick:()=>{document.querySelector(`[data-id="${CSS.escape(e.id)}"]`)?.scrollIntoView({behavior:`smooth`,block:`start`})},children:e.words})},e.id))})]})}var FQ=qN({type:`toc`,propSchema:{levels:{default:3},title:{default:``},untitled:{default:!1}},content:`none`},{render:e=>(0,G.jsx)(PQ,{editor:e.editor,levels:e.block.props.levels,title:e.block.props.title})}),IQ=(0,W.createContext)(void 0);function LQ(e){let t=(/^<\s*([A-Za-z][\w.]*)/.exec(e.trim())?.[1]??``).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}function RQ({source:e}){let t=(0,W.useContext)(IQ);return(0,G.jsxs)(`div`,{contentEditable:!1,"data-doc-embed":``,className:`doc-embed`,children:[(0,G.jsx)(Zr,{size:18,"aria-hidden":!0}),(0,G.jsx)(`span`,{className:`doc-embed-name`,children:LQ(e)}),(0,G.jsx)(`span`,{className:`doc-embed-note`,children:t?.embed})]})}var zQ=qN({type:`embed`,propSchema:{source:{default:``}},content:`none`},{render:e=>(0,G.jsx)(RQ,{source:e.block.props.source})}),BQ=[sY,`ℹ️`,`⚠️`,`❗`,`✅`,`📌`],VQ=qN({type:`callout`,propSchema:{icon:{default:sY},textColor:{default:`default`},backgroundColor:{default:`default`}},content:`inline`},{render:e=>(0,G.jsxs)(`div`,{className:`doc-callout`,"data-doc-callout":``,children:[e.block.props.icon===``?null:(0,G.jsx)(`button`,{type:`button`,contentEditable:!1,className:`doc-callout-icon`,"aria-label":e.block.props.icon,onMouseDown:e=>{e.preventDefault()},onClick:()=>{let t=BQ.indexOf(e.block.props.icon);e.editor.updateBlock(e.block,{props:{icon:BQ[(t+1)%BQ.length]??`💡`}})},children:e.block.props.icon}),(0,G.jsx)(`div`,{className:`doc-callout-text`,ref:e.contentRef})]})}),HQ=new Set([`audio`,`video`,`file`]),UQ=Object.fromEntries(Object.entries(YC).filter(([e])=>!HQ.has(e))),WQ=tw.create({blockSpecs:{...UQ,embed:zQ(),callout:VQ(),card:jQ(),stats:kQ(),component:JY(),chart:bX(),math:TQ(),diagram:EQ(),columns:tX(),column:rX(),note:NZ(),pagebreak:FZ(),toc:FQ(),bibliography:uQ()},inlineContentSpecs:{...$C,footnote:jZ,reference:tQ,citation:cQ},styleSpecs:{...QC,tag:MQ}});function GQ(e,t){let n=t.blocks,r=e.slash_menu,i=(e,t)=>({[e]:{...r[e],title:t}});return{...e,slash_menu:{...r,...i(`paragraph`,n.paragraph),...i(`heading`,n.heading1),...i(`heading_2`,n.heading2),...i(`heading_3`,n.heading3),...i(`bullet_list`,n.bullet),...i(`numbered_list`,n.numbered),...i(`check_list`,n.check),...i(`toggle_list`,n.toggle),...i(`quote`,n.quote),...i(`code_block`,n.code),...i(`table`,n.table),...i(`image`,n.image),...i(`divider`,n.divider)},placeholders:{...e.placeholders,default:t.placeholder,heading:t.heading,note:t.blocks.footnote}}}function KQ(e){let t=e[0];return e.length===1&&t?.type===`paragraph`&&t.content.every(e=>e.text===``)&&t.look===void 0&&(t.children?.length??0)===0}var qQ=e=>`doc-toggles:${e}`;function JQ(e){return typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`boolean`))}var YQ=e=>e.type===`toggleListItem`||e.type===`heading`&&e.props?.isToggleable===!0;function*XQ(e){for(let t of e)yield t,yield*XQ(t.children??[])}function ZQ(e,t){for(let n of XQ(e)){if(!YQ(n)||n.id===void 0)continue;let e=t[n.id.slice(1).replace(/-\d+$/,``)];if(e!==void 0)try{window.localStorage.setItem(`toggle-${n.id}`,String(e))}catch{return}}}function QQ(e,t){let n={};for(let r of XQ(e)){if(!YQ(r)||r.id===void 0)continue;let e=TY([r])[0];e&&(n[mY(e)]=t?.querySelector(`.bn-block-outer[data-id="${CSS.escape(r.id)}"] .bn-toggle-button`)?.getAttribute(`aria-expanded`)===`true`)}return n}var $Q=30,e$=8,t$=160,n$=3e4,r$=sN;function i$({words:e,components:t}){let n=BX(),r=tp(),i=(0,W.useCallback)(t=>(0,G.jsx)(WX,{...t,empty:e.nothing}),[e.nothing]);return(0,G.jsx)(r$,{triggerCharacter:`/`,getItems:async n=>{let i=zX(e,n,await t()),a=r.getTextCursorPosition().block.id;return iX(r,a)?i.filter(e=>e.block?.type!==`columns`):i},suggestionMenuComponent:i,onItemClick:e=>{n(e)}})}function a$({links:e,empty:t}){let n=tp(),r=(0,W.useCallback)(e=>(0,G.jsx)(WX,{...e,empty:t,testId:`doc-mention-menu`}),[t]),i=(0,W.useRef)([]);return(0,G.jsx)(r$,{triggerCharacter:`@`,shouldOpen:e=>{let t=e.selection.$from,n=t.parent.textBetween(0,t.parentOffset).replace(/@$/,``);return!/[A-Za-z0-9._-]$/.test(n)},getItems:async t=>(i.current=await e(),UX(i.current,t)),suggestionMenuComponent:r,onItemClick:e=>{let t=i.current.find(t=>`link:${t.href}`===e.key);t&&n.insertInlineContent([{type:`link`,href:t.href,content:t.title},` `])}})}function o$(e){let t=e instanceof Element?e:e?.contextElement;if(!t)return 0;let n=t.getBoundingClientRect().top,r=t.querySelector(`.bn-inline-content`);if(r){let e=document.createRange();e.selectNodeContents(r);let t=e.getClientRects()[0]??r.getBoundingClientRect();return t.top+t.height/2-n-$Q/2}let i=(t.querySelector(`.bn-block-content`)??t).getBoundingClientRect();return i.top-n+Math.max(0,Math.min(i.height,54)/2-$Q/2)}function s$({path:e,file:t,toggles:a,words:s,context:l,autoFocus:u,className:d,onUnreadable:f}){let p=o(),m=BY(e),[h]=(0,W.useState)(()=>new Wf(t.text)),[g]=(0,W.useState)(()=>qa(h.shown())),_=Pf(l.locale),[v]=(0,W.useState)(lZ),y=rj({schema:WQ,dropCursor:v.dropCursor,extensions:[v.extension,NX,wZ],sideMenu:{hoverMargin:t$},dictionary:GQ(_,s),tables:{headers:!0},...g.body.length>0?{initialContent:(()=>{let e=_Y(g.body);return ZQ(e,a),e})()}:{},uploadFile:e=>hZ(p,m,e),resolveFileUrl:async e=>{let t=HY(m,e);return t===void 0?e:(await p[`files/url`]({path:t})).url}},[h]),b=y,x=DZ(y),S=(0,W.useRef)(null),C=e=>S.current?.querySelector(`.bn-block-outer[data-id="${CSS.escape(e)}"]`)??void 0,w=(e,t)=>{let n=document.elementFromPoint(e,t)?.closest(`.bn-block-outer[data-id]`),r=[...S.current?.querySelectorAll(`.bn-block-outer[data-id]`)??[]],i=n?r.indexOf(n):-1;for(let e=i;e>=0;e--){let t=(r[e]?.querySelector(`[data-content-type="heading"]`))?.textContent.trim()??``;if(t!==``)return`under the heading ${JSON.stringify(t)}`}},T=e=>{let t=e.closest(`.bn-block-outer[data-id]`)?.getAttribute(`data-id`),n=t?y.getBlock(t):void 0;if(n?.type===`image`&&n.props.url!==``)return{name:`the picture ${n.props.url}`,written:n.props.url};if(n?.type===`component`){let e=tY(n.props.data);if(e)return{name:`the component ${ma(e)} (${e.of})`,written:e.of}}};c({hold:()=>Promise.resolve({key:`${e}@${String(t.text.length)}`,what:`The doc ${e}`,source:{path:e}}),locate:n=>{let r=V(n)[0],i=r?w(r.x,r.y):void 0;return Promise.resolve({elements:AY(document,n,e,t.text,T),...i===void 0?{}:{where:i}})}});let[E,D]=(0,W.useState)(t.state);(0,W.useEffect)(()=>t.onState(D),[t]);let[k,j]=(0,W.useState)(()=>h.page),M=(0,W.useRef)(void 0),N=$Z(y,k),P=(0,W.useCallback)(()=>{let e=M.current;e&&zf(e,h.page)&&(M.current=void 0)},[h]),F=(0,W.useCallback)(e=>{M.current=e,j(e),t.edited()},[t]),[I,L]=(0,W.useState)(!1),R=(0,W.useCallback)(()=>{L(!0)},[]),[z,B]=(0,W.useState)(0);r(`project/changed`,e=>{B(e.revision)});let[ee,te]=(0,W.useState)(),[ne,re]=(0,W.useState)([]),ae=k.bibliography!==void 0;(0,W.useEffect)(()=>{if(!I&&!ae)return;let e=!0;return QJ(p,`doc/data`,{item:m}).then(t=>{e&&(te(t.data),re(fi(t.sources??[])))},()=>void 0),()=>{e=!1}},[p,m,I,ae,z]);let oe=oQ(y,ne,k.citationStyle??`apa`),{font:se,accent:ce}=k,le=(0,W.useMemo)(()=>({...se===void 0?{}:{font:se},...ce===void 0?{}:{accent:ce}}),[se,ce]),ue=(0,W.useMemo)(()=>({page:le,base:m,data:ee,wantData:R,dark:l.theme===`dark`}),[le,m,ee,R,l.theme]),[de,fe]=(0,W.useState)(()=>fQ(b.document)),[pe,me]=(0,W.useState)(()=>({block:g.title,value:Ja(g.title)})),he=(0,W.useRef)(pe),ge=(0,W.useRef)(null),_e=(0,W.useCallback)((e,t)=>{he.current={block:e,value:t},me(he.current)},[]),ve=(0,W.useCallback)(()=>{let e=TY(b.document),t=KQ(e)&&!KQ(qa(h.shown()).body);return Xa(he.current.block,t?[]:e)},[b,h]),ye=(0,W.useCallback)(e=>e<0?void 0:h.lineOf(e+ +!!qa(h.shown()).title),[h]),be=(0,W.useCallback)(()=>b.document.map(e=>({id:e.id??``,model:TY([e])[0]})),[b]),[xe,Se]=(0,W.useState)(),Ce=(0,W.useCallback)((e,t=!1)=>{let n,{title:r,body:i}=qa(e),a=Ja(r),o=he.current.value;_e(r,o.replace(/\s+/g,` `).trim()===a?o:a);let s=be().filter(e=>e.model!==void 0),c=KQ(s.map(e=>e.model)),l=xn(c?[]:s.map(e=>e.model),i,sa);b.transact(e=>{e.setMeta(`addToHistory`,!1);for(let e of l){let t=s.slice(e.at,e.at+e.remove).map(e=>e.id),r=vY(e.insert);if(c){let e=s[0];e&&r.length>0&&b.replaceBlocks([e.id],r)}else if(t.length>0){let i=b.replaceBlocks(t,r).insertedBlocks;n??=i[0]?.id??s[e.at+e.remove]?.id}else if(r.length>0){let t=s[e.at],i=s.at(-1)??be().at(-1);t?n??=b.insertBlocks(r,t.id,`before`)[0]?.id:i&&(n??=b.insertBlocks(r,i.id,`after`)[0]?.id)}}}),t&&n!==void 0&&Se({id:n,at:Date.now()})},[b,_e,be]),we=(0,W.useCallback)((e,t)=>{let n=h.incoming(e,ve());h.unreadable?f(e):(n&&Ce(n,t?.kind===`agent`),P(),M.current===void 0&&j(e=>zf(e,h.page)?e:h.page))},[ve,h,f,P,Ce]),{agent:Te,following:Ee}=n(),De=We(),Oe=(()=>{if(Te?.doing===void 0)return;let e=xe&&xe.at>=Te.at-n$,n=Te.source?.path===t.path;if(e&&n)return xe.id;let r=n?Te.source?.from:void 0,i=r===void 0?void 0:h.indexAtLine(r);if(i!==void 0){let e=+!!qa(h.shown()).title,t=be()[Math.max(0,i-e)]?.id;if(t!==void 0&&t!==``)return t}return e?xe.id:void 0})(),ke=Te?De(Te):``;(0,W.useEffect)(()=>{TZ(y,Oe===void 0?null:{id:Oe,label:ke})},[y,Oe,ke]),(0,W.useEffect)(()=>{Ee&&Oe!==void 0&&C(Oe)?.scrollIntoView({block:`center`})},[Ee,Oe]);let Ae=(0,W.useRef)({held:ve,take:we,settleLook:P});(0,W.useLayoutEffect)(()=>{Ae.current={held:ve,take:we,settleLook:P}},[ve,we,P]),(0,W.useLayoutEffect)(()=>(t.attach({save:e=>(h.adopt(e),Ae.current.settleLook(),h.unreadable?void 0:h.textFor(Ae.current.held(),M.current)),take:(e,t,n)=>{h.adopt(t),Ae.current.take(e,n)}}),()=>{if(t.state!==`unsaved`||h.unreadable)return;let e;try{e=Ae.current.held()}catch{return}let n=M.current;t.attach({save:t=>(h.adopt(t),h.unreadable?void 0:h.textFor(e,n)),take:()=>void 0}),t.flush()}),[t,h]);let je=(0,W.useRef)(JSON.stringify(a)),Me=(0,W.useCallback)(()=>{let t=QQ(b.document,S.current),n=JSON.stringify(t);n!==je.current&&(je.current=n,p[`storage/set`]({key:qQ(e),value:Object.keys(t).length===0?null:t}).catch(()=>void 0))},[b,p,e]),Ne=(0,W.useCallback)(()=>{fe(fQ(b.document)),Me(),t.edited()},[t,b,Me]),Pe=(0,W.useCallback)(e=>{let t=e.replace(/\n/g,` `);_e(Ya(he.current.block,t),t),Ne()},[Ne,_e]);(0,W.useLayoutEffect)(()=>{let e=ge.current;if(!e)return;let t=()=>{e.style.height=`0`,e.style.height=`${String(e.scrollHeight)}px`};t();let n=new ResizeObserver(t);return e.parentElement&&n.observe(e.parentElement),()=>{n.disconnect()}},[pe.value]);let Fe=(0,W.useCallback)(e=>{let t=b.document[0];if(t?.id===void 0)return;let n=t.id;e===void 0||e===``&&KQ(TY([t]))||(b.insertBlocks([{type:`paragraph`,content:e===``?[]:[{type:`text`,text:e,styles:{}}]}],t.id,`before`),n=b.document[0]?.id??t.id);try{y.setTextCursorPosition(n,`start`)}catch{}y.focus()},[y,b]),Ie=(0,W.useCallback)(e=>{let t=ge.current;if(!t)return;let n=he.current.value.length;e!==void 0&&e!==``&&Pe(he.current.value+e),t.focus(),requestAnimationFrame(()=>{t.setSelectionRange(n,n)})},[Pe]),[Le]=(0,W.useState)(u);(0,W.useEffect)(()=>{if(!Le)return;let e=requestAnimationFrame(()=>{he.current.value.trim()===``?Ie():Fe()});return()=>{cancelAnimationFrame(e)}},[Le,Fe,Ie]);let Re=(0,W.useCallback)(e=>{if(e.nativeEvent.isComposing)return;let t=e.currentTarget;if(e.key===`Enter`){e.preventDefault();let n=t.value.slice(t.selectionEnd);n!==``&&Pe(t.value.slice(0,t.selectionStart)),Fe(n);return}let n=parseFloat(getComputedStyle(t).lineHeight)||0,r=t.selectionEnd===t.value.length||t.scrollHeight<n*1.5;(e.key===`ArrowDown`&&r||e.key===`Tab`&&!e.shiftKey)&&(e.preventDefault(),Fe())},[Pe,Fe]),ze=(0,W.useRef)([]),Be=(0,W.useCallback)(async()=>{try{ze.current=(await En(p,`project/items`,{})).items}catch{}return ze.current},[p]);(0,W.useEffect)(()=>{Be()},[Be]);let Ve=(0,W.useCallback)(async()=>UY(e,await Be()),[Be,e]),He=(0,W.useRef)([]),Ue=(0,W.useCallback)(async()=>{try{let e=O(l.locale);He.current=(await En(p,`components/list`,{item:m})).components.map(t=>({of:t.of,name:t.name,title:typeof t.label==`string`?t.label:t.label?.[e]??t.label?.en??t.name}))}catch{}return He.current},[p,m,l.locale]);(0,W.useEffect)(()=>{let t=S.current;if(!t)return;let n=e=>{if(e.button!==0)return;let t=e.target?.closest(`.bn-editor a[href]`)?.getAttribute(`href`);return t!=null&&t!==``&&!RY.test(t)?t:void 0},r=e=>{n(e)!==void 0&&(e.preventDefault(),e.stopPropagation())},i=t=>{let r=n(t);if(r===void 0)return;t.preventDefault(),t.stopPropagation();let i=WY(e,r);i!==void 0&&p[`items/open`]({target:{type:`file`,path:i}}).catch(()=>void 0)};return t.addEventListener(`mousedown`,r,!0),t.addEventListener(`mouseup`,r,!0),t.addEventListener(`click`,i,!0),()=>{t.removeEventListener(`mousedown`,r,!0),t.removeEventListener(`mouseup`,r,!0),t.removeEventListener(`click`,i,!0)}},[p,e]),(0,W.useEffect)(()=>{let e=S.current;if(!e)return;let t=e=>{e.target?.closest(`.bn-toggle-button`)&&Me()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}},[Me]);let Ge=(0,W.useCallback)(()=>(0,G.jsx)(JX,{aligns:s.aligns,tags:s}),[s]),[qe,Je]=(0,W.useState)(),Ye=(0,W.useCallback)(e=>{let t=S.current?.querySelector(`.bn-block-outer[data-id="${CSS.escape(e)}"]`),n=S.current?.closest(`.doc-sheet`);if(!t||!n)return;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();Je({id:e,at:{x:Math.max(8,r.left-i.left),y:Math.min(r.top-i.top+28,i.height-320)}})},[]);LY(y,S,(0,W.useMemo)(()=>({onActions:Ye,onTitle:Ie}),[Ye,Ie]));let Xe=(0,W.useMemo)(()=>{let t=qe?.id;if(t===void 0)return[];let n=()=>{let e=b.getSelection()?.blocks??[],n=b.document.find(e=>e.id===t);return e.some(e=>e.id===t)?e:n?[n]:[]};return[...LX.flatMap(e=>{let t=RX(e);return t?[{key:`turn:${e}`,title:s.blocks[e],icon:$X(e),group:s.turnInto,run:()=>{for(let e of n())e.id!==void 0&&b.updateBlock(e.id,t)}}]:[]}),{key:`duplicate`,title:s.duplicate,icon:Bt,run:()=>{let e=n(),t=e.at(-1);t?.id!==void 0&&b.insertBlocks(e.map(jY),t.id,`after`)}},{key:`place`,title:s.copyPlace,icon:Qt,run:()=>{let n=ye(b.document.findIndex(e=>e.id===t));navigator.clipboard.writeText(n===void 0?e:`${e}:${String(n)}`).catch(()=>void 0)}},{key:`delete`,title:s.remove,icon:an,run:()=>{b.removeBlocks(n().flatMap(e=>e.id===void 0?[]:[e.id]))}}]},[qe,b,ye,e,s]),Ze=(0,W.useCallback)(e=>(0,G.jsx)(ZX,{...e,strings:s,onActions:Ye}),[Ye,s]),Qe=(0,W.useMemo)(()=>({useFloatingOptions:{middleware:[A(({elements:e})=>({mainAxis:e$,crossAxis:o$(e.reference)}))]}}),[]),$e=(0,W.useCallback)(e=>{S.current?.querySelector(`.bn-block-outer[data-id="${CSS.escape(e)}"]`)?.scrollIntoView({block:`start`,behavior:`smooth`})},[]),[et,tt]=(0,W.useState)(!1),nt=(0,W.useCallback)(e=>{let t=wd(h.source).blocks,n=[...ua(t)][e];if(n===void 0)return;let r=t.find(e=>e===n||[...ua([e])].includes(n)),{title:i,body:a}=qa(pa(t));if(r===void 0)return;if(r===i){S.current?.scrollTo({top:0,behavior:`smooth`}),ge.current?.focus();return}let o=y.document[a.indexOf(r)]?.id;o!==void 0&&$e(o)},[h,y,$e]),rt=pe.block?.type===`heading`?pe.block.look?.align:void 0,it=l.readOnly===!0,{ask:at}=i(),ot=!it&&l.viewer!==!0,st=Qa(k),ct=$a(k),lt={"--doc-text":st.text,"--doc-heading":st.heading,"--doc-mono":st.mono,...ct===void 0?{}:{"--doc-accent":ct}};return(0,G.jsx)(oX.Provider,{value:ue,children:(0,G.jsx)(EZ.Provider,{value:x,children:(0,G.jsx)(XZ.Provider,{value:N,children:(0,G.jsx)(rQ.Provider,{value:oe,children:(0,G.jsx)(un,{children:(0,G.jsx)(`div`,{className:d,"data-testid":`doc-editor`,"data-state":E,"data-read-only":it?``:void 0,lang:ie[O(l.locale)],onKeyDownCapture:it?e=>{H(e.nativeEvent)&&at()}:void 0,onPasteCapture:it?at:void 0,onDropCapture:it?at:void 0,children:(0,G.jsxs)(`div`,{className:`doc-sheet`,style:lt,"data-font":k.font??`sans`,"data-accent":ct===void 0?void 0:``,children:[(0,G.jsx)(Ke,{saved:{state:E},start:l.viewer===!0?void 0:(0,G.jsxs)(G.Fragment,{children:[ot&&(0,G.jsx)(KZ,{look:k,words:s,chinese:O(l.locale).startsWith(`zh`),onLook:F}),(0,G.jsxs)(Dn,{"data-testid":`doc-pages-button`,"aria-pressed":et,"data-state":et?`on`:`off`,onClick:()=>{tt(e=>!e)},children:[(0,G.jsx)(jr,{}),s.pages]})]})}),qe!==void 0&&(0,G.jsx)(QX,{actions:Xe,placeholder:s.find,empty:s.nothing,at:qe.at,onClose:()=>{Je(void 0)}}),(0,G.jsxs)(`div`,{className:`doc-split`,children:[(0,G.jsxs)(`div`,{className:`doc-scroll`,ref:S,children:[(0,G.jsx)(SZ,{place:`top`,look:k,dir:m,words:s,editable:ot,onLook:F}),(0,G.jsxs)(`div`,{className:`doc-body`,children:[(0,G.jsxs)(`div`,{className:`doc-column`,children:[(0,G.jsxs)(`div`,{className:`doc-title-row group/title`,children:[(0,G.jsx)(SZ,{place:`title`,look:k,dir:m,words:s,editable:ot,onLook:F}),(0,G.jsx)(`textarea`,{ref:ge,className:`doc-title`,"data-testid":`doc-title-field`,rows:1,value:pe.value,placeholder:s.untitled,"aria-label":s.title,readOnly:it,style:rt?{textAlign:rt}:void 0,onChange:e=>{Pe(e.target.value)},onKeyDown:Re})]}),(0,G.jsxs)(XJ,{editor:y,editable:!it,theme:l.theme,formattingToolbar:!1,slashMenu:!1,sideMenu:!1,onChange:Ne,children:[(0,G.jsx)(hM,{formattingToolbar:Ge}),(0,G.jsx)(i$,{words:s,components:Ue}),(0,G.jsx)(a$,{links:Ve,empty:s.nothingToLink}),(0,G.jsx)(NM,{sideMenu:Ze,floatingUIOptions:Qe})]})]}),(0,G.jsx)(pQ,{entries:de,label:s.outline,scroller:S,onGo:$e})]})]}),et&&(0,G.jsx)(YZ,{dir:m,stamp:`${String(z)}:${E}`,words:s,onGo:nt})]})]})})})})})})})}function c$(e){let t=o(),n=s(),r=e.path??n?.item.entry,i=Nf.of(n?.locale),[a,c]=(0,W.useState)(),[l,u]=(0,W.useState)(),[d,f]=(0,W.useState)(),[p,m]=(0,W.useState)(0);(0,W.useEffect)(()=>{if(r===void 0)return;let e=!0,n;return Promise.all([Me.open(t,r),(e=>t[`storage/get`]({key:e}).then(e=>e.value,()=>null))(qQ(r))]).then(([t,i])=>{n=t,e?(c({path:r,file:t,toggles:JQ(i)}),f(Uf(wd(t.text))?t.text:void 0),u(void 0)):t.close()},t=>{e&&u(t instanceof Error?t.message:``)}),()=>{e=!1,n?.close()}},[t,r]);let h=a?.file;(0,W.useEffect)(()=>{h&&d!==void 0&&h.attach({save:()=>void 0,take:e=>{Uf(wd(e))?f(e):(f(void 0),m(e=>e+1))}})},[h,d]);let g=`doc-page${e.bare===!0?` doc-bare`:``} ${e.className??``}`,_=ie[O(n?.locale)];return l===void 0?!a||!n||a.path!==r?(0,G.jsx)(`div`,{className:g,lang:_,children:(0,G.jsx)(`div`,{className:`doc-sheet`,children:(0,G.jsx)(`p`,{className:`doc-message`,children:i.loading})})}):d===void 0?(0,G.jsx)(IQ.Provider,{value:i,children:(0,G.jsx)(KY.Provider,{value:{item:hn(r),path:r,locale:O(n.locale),readOnly:n.readOnly===!0,words:i},children:(0,G.jsx)(s$,{path:r,file:a.file,toggles:a.toggles,words:i,context:n,autoFocus:e.autoFocus??!1,className:g,onUnreadable:f},`${r}:${String(p)}`)})}):(0,G.jsx)(l$,{className:g,text:d,words:i,lang:_}):(0,G.jsx)(`div`,{className:g,lang:_,children:(0,G.jsx)(`div`,{className:`doc-sheet`,children:(0,G.jsx)(`p`,{role:`alert`,className:`doc-message doc-message-problem`,children:l})})})}function l$({className:e,text:t,words:n,lang:r}){let i=wd(t).problems[0]?.message;return(0,G.jsx)(`div`,{className:e,lang:r,children:(0,G.jsx)(`div`,{className:`doc-sheet`,children:(0,G.jsxs)(`div`,{className:`doc-scroll doc-unreadable`,"data-testid":`doc-unreadable`,children:[(0,G.jsx)(`p`,{className:`doc-message`,children:n.unreadable}),(0,G.jsx)(`p`,{className:`doc-message doc-message-problem`,children:i}),(0,G.jsx)(`pre`,{children:t})]})})})}export{c$ as DocEditor,c$ as default,Wf as DocModel,Nf as WORDS,Pf as blockNoteDictionary,AY as blocksAt,UY as docLinks,TY as fromEditor,OY as lineOf,WY as linkTarget,Lf as merge3,HY as projectPath,zY as relativePath,Rf as restoreSource,vY as toEditor};