allyhub 0.20.0 → 0.22.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 (323) hide show
  1. package/dist/commands/cloud-tools.js +5 -5
  2. package/dist/commands/export.js +1 -1
  3. package/dist/commands/frames.js +8 -8
  4. package/dist/commands/index.js +1 -1
  5. package/dist/commands/run.js +2 -0
  6. package/dist/commands.json +1 -1
  7. package/dist/help.js +3 -3
  8. package/dist/main.js +4 -4
  9. package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
  10. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  11. package/dist/node_modules/@allyhub/blocks/dist/elements.js +1 -1
  12. package/dist/node_modules/@allyhub/blocks/dist/layout.js +1 -1
  13. package/dist/node_modules/@allyhub/blocks/dist/palette.js +1 -1
  14. package/dist/node_modules/@allyhub/blocks/dist/resolve.js +1 -1
  15. package/dist/node_modules/@allyhub/blocks/package.json +1 -1
  16. package/dist/node_modules/@allyhub/browser/package.json +1 -1
  17. package/dist/node_modules/@allyhub/build/dist/migrate.js +1 -1
  18. package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
  19. package/dist/node_modules/@allyhub/build/dist/project-root.js +1 -1
  20. package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
  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/call.js +2 -2
  27. package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
  28. package/dist/node_modules/@allyhub/cloud/package.json +1 -1
  29. package/dist/node_modules/@allyhub/components/package.json +1 -1
  30. package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
  31. package/dist/node_modules/@allyhub/dev-server/dist/record.js +2 -1
  32. package/dist/node_modules/@allyhub/dev-server/dist/validate.js +2 -2
  33. package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
  34. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  35. package/dist/node_modules/@allyhub/doc/dist/block-shapes.js +2 -0
  36. package/dist/node_modules/@allyhub/doc/dist/blocks.js +1 -1
  37. package/dist/node_modules/@allyhub/doc/dist/docx.js +5 -5
  38. package/dist/node_modules/@allyhub/doc/dist/shapes.js +2 -2
  39. package/dist/node_modules/@allyhub/doc/package.json +1 -1
  40. package/dist/node_modules/@allyhub/doc-extension/dist/cli/import.js +1 -1
  41. package/dist/node_modules/@allyhub/doc-extension/dist/export.js +1 -1
  42. package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
  43. package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
  44. package/dist/node_modules/@allyhub/export/package.json +1 -1
  45. package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
  46. package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
  47. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +3 -3
  48. package/dist/node_modules/@allyhub/formats/dist/data/page-data.d.ts +9 -1
  49. package/dist/node_modules/@allyhub/formats/dist/data/page-data.js +1 -1
  50. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +151 -151
  51. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +173 -173
  52. package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +1 -2
  53. package/dist/node_modules/@allyhub/formats/dist/data/work.js +1 -1
  54. package/dist/node_modules/@allyhub/formats/dist/index.d.ts +1 -1
  55. package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
  56. package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +2 -0
  57. package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
  58. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +106 -101
  59. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  60. package/dist/node_modules/@allyhub/formats/dist/tolerant.d.ts +26 -1
  61. package/dist/node_modules/@allyhub/formats/dist/tolerant.js +1 -1
  62. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  63. package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
  64. package/dist/node_modules/@allyhub/i18n/package.json +1 -1
  65. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  66. package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
  67. package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +1 -1
  68. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  69. package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
  70. package/dist/node_modules/@allyhub/image-render/package.json +1 -1
  71. package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
  72. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  73. package/dist/node_modules/@allyhub/jobs/package.json +1 -1
  74. package/dist/node_modules/@allyhub/linkedin-extension/package.json +1 -1
  75. package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
  76. package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
  77. package/dist/node_modules/@allyhub/linkedin-view/src/style.css +1 -1
  78. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  79. package/dist/node_modules/@allyhub/media/package.json +1 -1
  80. package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
  81. package/dist/node_modules/@allyhub/model/package.json +1 -1
  82. package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
  83. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  84. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  85. package/dist/node_modules/@allyhub/project/package.json +1 -1
  86. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  87. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  88. package/dist/node_modules/@allyhub/registry/package.json +1 -1
  89. package/dist/node_modules/@allyhub/render/package.json +1 -1
  90. package/dist/node_modules/@allyhub/report-extension/LICENSE +241 -0
  91. package/dist/node_modules/@allyhub/report-extension/dist/build.js +3 -0
  92. package/dist/node_modules/@allyhub/report-extension/dist/check.js +37 -0
  93. package/dist/node_modules/@allyhub/report-extension/dist/cli/index.js +4 -0
  94. package/dist/node_modules/@allyhub/report-extension/dist/export.js +2 -0
  95. package/dist/node_modules/@allyhub/report-extension/dist/inline.js +58 -0
  96. package/dist/node_modules/@allyhub/report-extension/dist/page.js +23 -0
  97. package/dist/node_modules/@allyhub/report-extension/dist/project-tools.js +33 -0
  98. package/dist/node_modules/@allyhub/report-extension/dist/styles.js +2 -0
  99. package/dist/node_modules/@allyhub/report-extension/dist/theme.js +2 -0
  100. package/dist/node_modules/@allyhub/report-extension/dist/tools.js +2 -0
  101. package/dist/node_modules/@allyhub/report-extension/dist/workspace.js +2 -0
  102. package/dist/node_modules/@allyhub/report-extension/package.json +185 -0
  103. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/STYLE.md +180 -0
  104. package/dist/node_modules/@allyhub/report-extension/styles/allyhub/style.json +15 -0
  105. package/dist/node_modules/@allyhub/runtime/package.json +1 -1
  106. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  107. package/dist/node_modules/@allyhub/scaffold/dist/index.js +8 -8
  108. package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
  109. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  110. package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
  111. package/dist/node_modules/@allyhub/sheet/dist/file.js +2 -2
  112. package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
  113. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  114. package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
  115. package/dist/node_modules/@allyhub/sheet/dist/theme.js +1 -1
  116. package/dist/node_modules/@allyhub/sheet/dist/tiles.js +1 -1
  117. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  118. package/dist/node_modules/@allyhub/sheet/dist/xlsx/tile-shapes.js +2 -0
  119. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  120. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  121. package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
  122. package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +1 -1
  123. package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
  124. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  125. package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
  126. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  127. package/dist/node_modules/@allyhub/slides-extension/dist/build.js +2 -2
  128. package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +1 -1
  129. package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
  130. package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
  131. package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
  132. package/dist/node_modules/@allyhub/stage/package.json +1 -1
  133. package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
  134. package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +2 -2
  135. package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
  136. package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
  137. package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
  138. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  139. package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
  140. package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
  141. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  142. package/dist/node_modules/@allyhub/website/package.json +1 -1
  143. package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
  144. package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
  145. package/dist/node_modules/@allyhub/x-model/package.json +1 -1
  146. package/dist/node_modules/@allyhub/x-view/package.json +1 -1
  147. package/dist/package.json +15 -14
  148. package/dist/run-register.js +2 -0
  149. package/dist/works.js +1 -1
  150. package/editor-web/assets/{abnfDiagram-WEYOIA3C-BkVJMd53.js → abnfDiagram-WEYOIA3C-D6qI3rai.js} +1 -1
  151. package/editor-web/assets/{architecture-WOLXFQ4H-C6rnaynZ.js → architecture-WOLXFQ4H-B3V6ggq8.js} +1 -1
  152. package/editor-web/assets/{architectureDiagram-ZHVYKT53-D3vrh8LK.js → architectureDiagram-ZHVYKT53-IauNyxXn.js} +1 -1
  153. package/editor-web/assets/article-BHjKp5We.js +3 -0
  154. package/editor-web/assets/article-BlNKv1Cn.js +7 -0
  155. package/editor-web/assets/bar-button-CJmpgNg4.js +1 -0
  156. package/editor-web/assets/{blockDiagram-RJAE7QA3-BKngt8H7.js → blockDiagram-RJAE7QA3-yXhlfxbH.js} +1 -1
  157. package/editor-web/assets/{c4Diagram-XDPPPE54-j7sUELqF.js → c4Diagram-XDPPPE54-B-anrhvt.js} +1 -1
  158. package/editor-web/assets/{calc-worker-Cr4a0xmt.js → calc-worker-BpAgQE9E.js} +3 -3
  159. package/editor-web/assets/channel-Bhb-_8v6.js +1 -0
  160. package/editor-web/assets/chip-pNQlYa2W.js +1 -0
  161. package/editor-web/assets/{chunk-2E7WHVMD-BXa-uRSi.js → chunk-2E7WHVMD-QPOni4XB.js} +1 -1
  162. package/editor-web/assets/{chunk-4EMNKR2T-B3ntcsZN.js → chunk-4EMNKR2T-DG1FCRRI.js} +1 -1
  163. package/editor-web/assets/{chunk-55XCU76K-AMvnFwUg.js → chunk-55XCU76K-mKuMXpnC.js} +1 -1
  164. package/editor-web/assets/{chunk-7S6XSTFO-BA6esfFu.js → chunk-7S6XSTFO-CgZAazgt.js} +1 -1
  165. package/editor-web/assets/{chunk-AQDTSKZB-BT_vANXs.js → chunk-AQDTSKZB-BRU84phF.js} +1 -1
  166. package/editor-web/assets/{chunk-DSNLSHJZ-DoUgmzGB.js → chunk-DSNLSHJZ-zku9oeG3.js} +1 -1
  167. package/editor-web/assets/{chunk-HAGFOTED-DtnIrCZb.js → chunk-HAGFOTED-CaUkBv_0.js} +1 -1
  168. package/editor-web/assets/{chunk-HNE4Q36P-BlPwQx3_.js → chunk-HNE4Q36P-BQz4ZCJf.js} +1 -1
  169. package/editor-web/assets/{chunk-NQOKRVIF-D2r7jp2r.js → chunk-NQOKRVIF-CHVBEDkg.js} +1 -1
  170. package/editor-web/assets/{chunk-UHW7PFBP-Cmc0_F5o.js → chunk-UHW7PFBP-DrYeJo1e.js} +1 -1
  171. package/editor-web/assets/{chunk-VQ5W62QI-nJSMqAr0.js → chunk-VQ5W62QI-D8ToVCUe.js} +1 -1
  172. package/editor-web/assets/{chunk-WQQL4CDK-Btq2nbF6.js → chunk-WQQL4CDK-DZ0tyi9F.js} +1 -1
  173. package/editor-web/assets/{chunk-YZO67HFG-DTbcCoGt.js → chunk-YZO67HFG-BLe7PXER.js} +1 -1
  174. package/editor-web/assets/{chunk-ZAUX2LTX-DVwkg-2N.js → chunk-ZAUX2LTX-ByaeSIre.js} +1 -1
  175. package/editor-web/assets/{chunk-ZCHMQSOR-BV39jOOE.js → chunk-ZCHMQSOR-DdMJr_t5.js} +1 -1
  176. package/editor-web/assets/{classDiagram-v2-4MYWR3UA-Cj74-fhM.js → classDiagram-v2-4MYWR3UA-DDpq7fFC.js} +1 -1
  177. package/editor-web/assets/collaborator-CbTacvkB.js +1 -0
  178. package/editor-web/assets/color-picker-CDeICDN5.js +1 -0
  179. package/editor-web/assets/{cynefin-EF2NZ3EQ-C0CkiipV.js → cynefin-EF2NZ3EQ-CMivy2fr.js} +1 -1
  180. package/editor-web/assets/{cynefinDiagram-WF24UDRP-hdsnJ4cI.js → cynefinDiagram-WF24UDRP-GtxT_9wW.js} +1 -1
  181. package/editor-web/assets/{dagre-NK4GIZVX-CC7WSgaK.js → dagre-NK4GIZVX-Bn1O2Hjl.js} +1 -1
  182. package/editor-web/assets/deck-Cohd-G5m.js +1 -0
  183. package/editor-web/assets/{diagram-CBK3MWTC-DmaVm13J.js → diagram-CBK3MWTC-W715PWZw.js} +1 -1
  184. package/editor-web/assets/{diagram-I5XIIV2D-De8jqp7b.js → diagram-I5XIIV2D-BKObZPn2.js} +1 -1
  185. package/editor-web/assets/{diagram-ODIL2UCW-B5pBTulX.js → diagram-ODIL2UCW-UtQxEPoW.js} +1 -1
  186. package/editor-web/assets/{diagram-PFBEJUXE-BYsXg5_w.js → diagram-PFBEJUXE-CpLGEK-k.js} +1 -1
  187. package/editor-web/assets/{diagram-RJA3I4VV-DZ8f6bYe.js → diagram-RJA3I4VV-DGyMXoHb.js} +1 -1
  188. package/editor-web/assets/{diagram-TYUNFSNR-qXHUsauD.js → diagram-TYUNFSNR-Dy_Ewr8V.js} +1 -1
  189. package/editor-web/assets/dist-0I0Obj60.js +19 -0
  190. package/editor-web/assets/dist-6ugUm4dS.js +6 -0
  191. package/editor-web/assets/dist-B0rUvCi2.js +1 -0
  192. package/editor-web/assets/{dist-DAhe-kFC.js → dist-B8_6sJ_V.js} +1 -1
  193. package/editor-web/assets/dist-CKD_paj_.js +1 -0
  194. package/editor-web/assets/dist-CKUW5NzS.js +3 -0
  195. package/editor-web/assets/dist-Ca9Gsuu0.js +24 -0
  196. package/editor-web/assets/dist-Cc8v9lfc.js +1 -0
  197. package/editor-web/assets/dist-CynBNzYv.js +1 -0
  198. package/editor-web/assets/{dist-9kuRjUTN.js → dist-D7M5YTq2.js} +6 -6
  199. package/editor-web/assets/dist-D9tsFc2N.js +16 -0
  200. package/editor-web/assets/dist-DNMKDcLg.js +35 -0
  201. package/editor-web/assets/dist-Doj7_HUI.js +547 -0
  202. package/editor-web/assets/dist-DptBQzJR.js +1 -0
  203. package/editor-web/assets/dist-DzKB210A.js +5 -0
  204. package/editor-web/assets/{dist-B3rd02Cg.js → dist-H9rTuNhb.js} +6 -6
  205. package/editor-web/assets/{dist-DA72-4WB.js → dist-QLXI7XGS.js} +1 -1
  206. package/editor-web/assets/dist-RyGsFHE0.js +4 -0
  207. package/editor-web/assets/dist-oeSWr2LE.js +19 -0
  208. package/editor-web/assets/dist-wD_hHJ8_.js +19 -0
  209. package/editor-web/assets/{docx-draw-L54blreB.js → docx-draw-B5cM77hc.js} +1 -1
  210. package/editor-web/assets/{ebnfDiagram-V4P3TTPT-B7-IfVI-.js → ebnfDiagram-V4P3TTPT-GPYcx6dU.js} +1 -1
  211. package/editor-web/assets/{elk-QONTBCTQ-Gj_WaeBn.js → elk-QONTBCTQ-Bi0r4UFM.js} +1 -1
  212. package/editor-web/assets/{erDiagram-KYQIGQAA-BDF6Qoqx.js → erDiagram-KYQIGQAA-DrOSrnci.js} +1 -1
  213. package/editor-web/assets/esm-jIPnpbBD.js +21 -0
  214. package/editor-web/assets/{eventmodeling-K75KTNOO-elxVXXEe.js → eventmodeling-K75KTNOO-Dw-MjgUb.js} +1 -1
  215. package/editor-web/assets/eye-DwfE1USj.js +1 -0
  216. package/editor-web/assets/flowDiagram-IUGLLWBU-DbZTfPEP.js +1 -0
  217. package/editor-web/assets/{ganttDiagram-R7GPNTJY-CEogW3jW.js → ganttDiagram-R7GPNTJY-Bwe8cQqi.js} +1 -1
  218. package/editor-web/assets/{gitGraph-VSP46ZUC-Bh9cRWFa.js → gitGraph-VSP46ZUC-DsAcAKP0.js} +1 -1
  219. package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BQAvdM_V.js → gitGraphDiagram-PDYL7XHY-aObRwdru.js} +1 -1
  220. package/editor-web/assets/hint-F4fIBnVU.js +1 -0
  221. package/editor-web/assets/index-Cah2zchD.css +2 -0
  222. package/editor-web/assets/index-D-MNVykg.js +28 -0
  223. package/editor-web/assets/{info-OHQRW6UA-CdPrqere.js → info-OHQRW6UA-DBPN8JFr.js} +1 -1
  224. package/editor-web/assets/{infoDiagram-MVDRKAX5-uwIMeP44.js → infoDiagram-MVDRKAX5-Bx26Hq7M.js} +1 -1
  225. package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-rtfvqK7E.js → ishikawaDiagram-HPEHV2GE-BJ_MCDwA.js} +1 -1
  226. package/editor-web/assets/{journeyDiagram-BOSHW7O7-mmhfIyVG.js → journeyDiagram-BOSHW7O7-B5g4W2Dx.js} +1 -1
  227. package/editor-web/assets/{kanban-definition-FNSA4HC5-Fe7jBsi-.js → kanban-definition-FNSA4HC5-U8YNlxN7.js} +1 -1
  228. package/editor-web/assets/layout-CuWN7_3k.js +1 -0
  229. package/editor-web/assets/{mermaid-parser.core-BxOSjBH9.js → mermaid-parser.core-DYLQlYDo.js} +3 -3
  230. package/editor-web/assets/{mermaid.core-BOln9YdH.js → mermaid.core-qNJmZ0b4.js} +4 -4
  231. package/editor-web/assets/{mindmap-definition-6OY57UG3-M3Q1LOtO.js → mindmap-definition-6OY57UG3-CI5aBWbK.js} +1 -1
  232. package/editor-web/assets/{packet-JDAUHWVQ-Dbb0TUG6.js → packet-JDAUHWVQ-BBclMGlJ.js} +1 -1
  233. package/editor-web/assets/palette-DchDLJj6.js +1 -0
  234. package/editor-web/assets/panes-BShVq38A.js +3 -0
  235. package/editor-web/assets/{pegDiagram-ECIUJNBX-BZMRpSFC.js → pegDiagram-ECIUJNBX-B3pljPTu.js} +1 -1
  236. package/editor-web/assets/{pie-XZMESJXO-Ctm9XdKp.js → pie-XZMESJXO-B7WzimHm.js} +1 -1
  237. package/editor-web/assets/{pieDiagram-GNMPY74T-cGbs5ZTl.js → pieDiagram-GNMPY74T-tM1Da50-.js} +1 -1
  238. package/editor-web/assets/progress-D1Uv3d1b.js +6 -0
  239. package/editor-web/assets/{quadrantDiagram-D57K4MC3-BUe_zsxT.js → quadrantDiagram-D57K4MC3-BEq_Shj9.js} +1 -1
  240. package/editor-web/assets/{radar-ABXABTNO-CCmKtqLs.js → radar-ABXABTNO-v2jJSW5T.js} +1 -1
  241. package/editor-web/assets/{railroad-I3PHUGI6-k-yhjhjA.js → railroad-I3PHUGI6-6W3Z4F8Y.js} +1 -1
  242. package/editor-web/assets/{railroad-abnf-LNEFI6M7-B-PvntB3.js → railroad-abnf-LNEFI6M7-DxIN7Zrt.js} +1 -1
  243. package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-Ds2rua1h.js → railroad-ebnf-DWYD2UWJ-Bb5O7tAx.js} +1 -1
  244. package/editor-web/assets/{railroad-peg-JR7BVNR7-jNZ2wEp2.js → railroad-peg-JR7BVNR7-i2LjEP5t.js} +1 -1
  245. package/editor-web/assets/{railroadDiagram-Y72NRBL7-CTqSQ15w.js → railroadDiagram-Y72NRBL7-DhsyVKbG.js} +1 -1
  246. package/editor-web/assets/{requirementDiagram-EQYSW5RA-CUblhR5M.js → requirementDiagram-EQYSW5RA-Du2k7i1E.js} +1 -1
  247. package/editor-web/assets/ribbon-tabs-Bxuj_hct.js +1 -0
  248. package/editor-web/assets/row-DqS4-5b1.js +1 -0
  249. package/editor-web/assets/{sankeyDiagram-SY24JHO5-nSz6zDX3.js → sankeyDiagram-SY24JHO5-CDnRMu7J.js} +1 -1
  250. package/editor-web/assets/schemas-CnlOL0u4.js +1 -0
  251. package/editor-web/assets/{sequenceDiagram-BLEHNHQU-DxTpOYuo.js → sequenceDiagram-BLEHNHQU-BUXBhWYW.js} +1 -1
  252. package/editor-web/assets/{session-BhClkDyr.js → session--OJYv_B7.js} +1 -1
  253. package/editor-web/assets/{snapshots-DwGHDN3t.js → snapshots-DYooVfOx.js} +1 -1
  254. package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-C3e14iHY.js → stateDiagram-v2-A6IESKWZ-Enb8LZUA.js} +1 -1
  255. package/editor-web/assets/surface-BUoi7cmR.js +1 -0
  256. package/editor-web/assets/swatch-DCmD1gZl.js +1 -0
  257. package/editor-web/assets/{swimlanes-B3ENRKFQ-DPPdzNzu.js → swimlanes-B3ENRKFQ-pnpjgTrl.js} +1 -1
  258. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B-B2Eoc8.js +8 -0
  259. package/editor-web/assets/switch-b6GCy_ix.js +1 -0
  260. package/editor-web/assets/syntax-Bqyhj0dw.js +1 -0
  261. package/editor-web/assets/tablet-C6oePHEW.js +1 -0
  262. package/editor-web/assets/textarea-Bu6uPEqT.js +1 -0
  263. package/editor-web/assets/themes-D_ISkWVz.js +1 -0
  264. package/editor-web/assets/{timeline-definition-JXYKGLGB-DRTJ1_Er.js → timeline-definition-JXYKGLGB-C4pR18kd.js} +1 -1
  265. package/editor-web/assets/trash-2-SFReAxVM.js +1 -0
  266. package/editor-web/assets/{treeView-D4JQ5SDB-BYJ_m-i5.js → treeView-D4JQ5SDB-kzNGeAv6.js} +1 -1
  267. package/editor-web/assets/{treemap-SAJKECNS-BcU6I6Rg.js → treemap-SAJKECNS-Buhb5wzt.js} +1 -1
  268. package/editor-web/assets/updating-Cbxw83_O.js +1 -0
  269. package/editor-web/assets/{usecaseDiagram-WPOLBNNX-YV92pS4o.js → usecaseDiagram-WPOLBNNX-CL-xLQWl.js} +1 -1
  270. package/editor-web/assets/{vennDiagram-Q3Y3IDCW-oAvfHZtf.js → vennDiagram-Q3Y3IDCW-bwsyCcdK.js} +1 -1
  271. package/editor-web/assets/{video-SJvDRCJK.js → video-8MxWX9f5.js} +1 -1
  272. package/editor-web/assets/{wardley-7MLQ67FV-BLNiqxtt.js → wardley-7MLQ67FV-DXsLgedI.js} +1 -1
  273. package/editor-web/assets/{wardleyDiagram-IVAIDKWA-SppgC6xW.js → wardleyDiagram-IVAIDKWA-Cn0ph953.js} +1 -1
  274. package/editor-web/assets/{words-BUlNNuH2.js → words-B2jQwWpp.js} +1 -1
  275. package/editor-web/assets/{words-zMedmPWc.js → words-DgMuEmDO.js} +1 -1
  276. package/editor-web/assets/workbook-BDWkQ149.js +41 -0
  277. package/editor-web/assets/x-BAJilkKD.js +41 -0
  278. package/editor-web/assets/{xychartDiagram-4URNHDU4-BHMn_jwJ.js → xychartDiagram-4URNHDU4-CfXnqGWZ.js} +1 -1
  279. package/editor-web/index.html +6 -6
  280. package/package.json +5 -2
  281. package/editor-web/assets/article-DHf6mOY_.js +0 -7
  282. package/editor-web/assets/article-Dns1-Xh-.js +0 -3
  283. package/editor-web/assets/bar-button-CKPfx2AB.js +0 -1
  284. package/editor-web/assets/channel-CVWSV3su.js +0 -1
  285. package/editor-web/assets/chip-Bn_9JRRG.js +0 -1
  286. package/editor-web/assets/collaborator-XiHOxwGM.js +0 -1
  287. package/editor-web/assets/deck-DQpNIS2p.js +0 -1
  288. package/editor-web/assets/dist--z0ZHp4T.js +0 -16
  289. package/editor-web/assets/dist-B5GOGGEe.js +0 -1
  290. package/editor-web/assets/dist-Bx6q9kCu.js +0 -1
  291. package/editor-web/assets/dist-C4hHtrJr.js +0 -1
  292. package/editor-web/assets/dist-CCXJewsi.js +0 -19
  293. package/editor-web/assets/dist-CfK2BLl8.js +0 -4
  294. package/editor-web/assets/dist-Cmux3oJ_.js +0 -1
  295. package/editor-web/assets/dist-Cspf85KV.js +0 -6
  296. package/editor-web/assets/dist-DOrGo1GD.js +0 -19
  297. package/editor-web/assets/dist-DjiCHlSu.js +0 -35
  298. package/editor-web/assets/dist-Do4a40Wn.js +0 -19
  299. package/editor-web/assets/dist-FKEWS3Co.js +0 -547
  300. package/editor-web/assets/dist-QKd2i6kG.js +0 -5
  301. package/editor-web/assets/dist-SGnOfLhx.js +0 -24
  302. package/editor-web/assets/dist-VmVB7tl4.js +0 -3
  303. package/editor-web/assets/esm-PQD5Pn8a.js +0 -21
  304. package/editor-web/assets/flowDiagram-IUGLLWBU-B-25n8zE.js +0 -1
  305. package/editor-web/assets/hint-CbwoSBMw.js +0 -1
  306. package/editor-web/assets/index-CXisi0Cj.css +0 -2
  307. package/editor-web/assets/index-wMlfx8aT.js +0 -28
  308. package/editor-web/assets/layout-SWqqA0yV.js +0 -1
  309. package/editor-web/assets/progress-DZQTiRLv.js +0 -6
  310. package/editor-web/assets/ribbon-DajdQ_Ya.js +0 -1
  311. package/editor-web/assets/row-Bei9HNEe.js +0 -1
  312. package/editor-web/assets/schemas-C21MyseF.js +0 -1
  313. package/editor-web/assets/split-DBAbwPZ5.js +0 -3
  314. package/editor-web/assets/surface-CIF0Ae0z.js +0 -1
  315. package/editor-web/assets/swatch-BUzr_XmH.js +0 -1
  316. package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B8n3zOw_.js +0 -8
  317. package/editor-web/assets/switch-DrZxoPQS.js +0 -1
  318. package/editor-web/assets/syntax-emXV4DnN.js +0 -1
  319. package/editor-web/assets/tabs-BwU2E7bU.js +0 -1
  320. package/editor-web/assets/textarea-BX_ax3X8.js +0 -1
  321. package/editor-web/assets/tolerant-DM9s0Mt1.js +0 -1
  322. package/editor-web/assets/type-CvZ0HZsV.js +0 -41
  323. package/editor-web/assets/workbook-BZKYx4WB.js +0 -41
@@ -0,0 +1,6 @@
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,b as n,c as r,i,l as a,s as o,t as s}from"./react-Byupo4pA.js";import{$ as c,B as l,G as u,H as d,J as f,K as p,Q as m,U as h,V as g,W as _,X as v,Y as y,Z as b,a as x,et as S,ft as C,gt as w,ht as T,i as ee,it as E,jt as D,mt as O,n as te,nt as k,o as ne,ot as A,q as re,r as ie,rt as j,s as M,st as N,t as ae,ut as P,yt as oe,z as se}from"./x-BAJilkKD.js";import{o as ce,w as le}from"./snapshots-DYooVfOx.js";import{t as ue}from"./jsx-runtime-DePvh3-m.js";import{B as de,C as fe,D as pe,E as me,F as he,G as ge,H as _e,I as ve,L as ye,M as be,N as xe,P as Se,R as Ce,T as we,U as Te,V as Ee,W as De,a as Oe,c as ke,f as Ae,i as je,j as Me,k as Ne,l as Pe,m as Fe,o as Ie,s as Le,t as F,u as Re,v as ze,z as Be}from"./bar-button-CJmpgNg4.js";import{n as Ve,t as He}from"./progress-D1Uv3d1b.js";import{t as I}from"./createLucideIcon-euu7Wcd9.js";import{P as L}from"./index-D-MNVykg.js";var R=e(n(),1),z=ue(),Ue=Object.defineProperty,B=(e,t)=>Ue(e,`name`,{value:t,configurable:!0}),We=`Checkbox`,[Ge,Ke]=N(We),[qe,Je]=Ge(We);function Ye(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=E({prop:n,defaultProp:i??!1,onChange:c,caller:We}),[m,h]=R.useState(null),[g,_]=R.useState(null),v=R.useRef(!1),[y,b]=R.useReducer(e=>e+1,0),x=!m||!!o||!!m.closest(`form`),S={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:b,required:l,defaultChecked:!V(i)&&i,isFormControl:x,bubbleInput:g,setBubbleInput:_};return(0,z.jsx)(qe,{scope:t,...S,children:rt(d)?d(S):r})}B(Ye,`CheckboxProvider`);var Xe=`CheckboxTrigger`,Ze=R.forwardRef(B(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=Je(Xe,e),g=O(i,u),_=R.useRef(c);return R.useEffect(()=>{let e=a?.form;if(e){let t=B(()=>d(_.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,z.jsx)(P.button,{type:`button`,role:`checkbox`,"aria-checked":V(c)?`mixed`:c,"aria-required":l,"data-state":it(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:A(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:A(n,e=>{p(),d(e=>V(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),Qe=R.forwardRef(B(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,z.jsx)(Ye,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Ze,{...d,ref:t,__scopeCheckbox:n}),e&&(0,z.jsx)(nt,{__scopeCheckbox:n})]})})},`Checkbox`)),$e=`CheckboxIndicator`,et=R.forwardRef(B(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Je($e,n);return(0,z.jsx)(j,{present:r||V(a.checked)||a.checked===!0,children:(0,z.jsx)(P.span,{"data-state":it(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),tt=`CheckboxBubbleInput`,nt=R.forwardRef(B(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=Je(tt,e),g=O(r,h),_=se(i),v=R.useRef(!1),y=R.useRef(s),b=R.useRef(o);R.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==b.current;b.current=o;let i=y.current!==s;y.current=s;let c=!(r&&a.current);if(i&&n){v.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=V(s),n.call(e,!V(s)&&s),e.dispatchEvent(t),v.current=!1}},[m,s,a,o]);let x=R.useRef(!V(s)&&s);return(0,z.jsx)(P.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??x.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:A(t,e=>{v.current&&e.stopPropagation()}),style:{...n.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function rt(e){return typeof e==`function`}B(rt,`isFunction`);function V(e){return e===`indeterminate`}B(V,`isIndeterminate`);function it(e){return V(e)?`indeterminate`:e?`checked`:`unchecked`}B(it,`getState`);var at=Object.defineProperty,H=(e,t)=>at(e,`name`,{value:t,configurable:!0}),ot=`ContextMenu`,[st,ct]=N(ot,[Ee]),U=Ee(),[lt,ut]=st(ot),dt=H(e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,dir:a,modal:o=!0}=e,s=R.useRef(!1),[c,l]=E({prop:i,defaultProp:!1,onChange:r,caller:ot}),u=U(t);return(0,z.jsx)(lt,{scope:t,open:c,onOpenChange:l,modal:o,hasInteractedRef:s,children:(0,z.jsx)(be,{...u,dir:a,open:c,onOpenChange:l,modal:o,children:n})})},`ContextMenu`),ft=`ContextMenuTrigger`,pt=R.forwardRef(H(function(e,t){let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=ut(ft,n),o=U(n),[s,c]=R.useState({x:0,y:0}),l=R.useMemo(()=>({current:{getBoundingClientRect:H(()=>DOMRect.fromRect({width:0,height:0,...s}),`getBoundingClientRect`)}}),[s]),u=R.useRef(0),d=R.useCallback(()=>window.clearTimeout(u.current),[]),f=H(e=>{a.hasInteractedRef.current=!0,c({x:e.clientX,y:e.clientY}),a.onOpenChange(!0)},`handleOpen`);return R.useEffect(()=>d,[d]),R.useEffect(()=>void(r&&d()),[r,d]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(xe,{...o,virtualRef:l}),(0,z.jsx)(P.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:A(e.onContextMenu,e=>{d(),f(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:A(e.onPointerDown,W(e=>{d(),a.open&&a.onOpenChange(!1),u.current=window.setTimeout(()=>f(e),700)})),onPointerMove:r?e.onPointerMove:A(e.onPointerMove,W(d)),onPointerCancel:r?e.onPointerCancel:A(e.onPointerCancel,W(d)),onPointerUp:r?e.onPointerUp:A(e.onPointerUp,W(d))})]})},`ContextMenuTrigger`)),mt=H(e=>{let{__scopeContextMenu:t,...n}=e,r=U(t);return(0,z.jsx)(ve,{...r,...n})},`ContextMenuPortal`),ht=`ContextMenuContent`,gt=R.forwardRef(H(function(e,t){let{__scopeContextMenu:n,...r}=e,i=ut(ht,n),a=U(n),o=R.useRef(!1);return(0,z.jsx)(Se,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`ContextMenuContent`)),_t=R.forwardRef(H(function(e,t){let{__scopeContextMenu:n,...r}=e,i=U(n);return(0,z.jsx)(he,{...i,...r,ref:t})},`ContextMenuItem`)),vt=R.forwardRef(H(function(e,t){let{__scopeContextMenu:n,...r}=e,i=U(n);return(0,z.jsx)(ye,{...i,...r,ref:t})},`ContextMenuSeparator`)),yt=`ContextMenuSub`,bt=H(e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=U(t),[s,c]=E({prop:i,defaultProp:a??!1,onChange:r,caller:yt});return(0,z.jsx)(Ce,{...o,open:s,onOpenChange:c,children:n})},`ContextMenuSub`),xt=R.forwardRef(H(function(e,t){let{__scopeContextMenu:n,...r}=e,i=U(n);return(0,z.jsx)(de,{...i,...r,ref:t})},`ContextMenuSubTrigger`)),St=R.forwardRef(H(function(e,t){let{__scopeContextMenu:n,...r}=e,i=U(n);return(0,z.jsx)(Be,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`ContextMenuSubContent`));function W(e){return t=>t.pointerType===`mouse`?void 0:e(t)}H(W,`whenTouchOrPen`);var Ct=Object.defineProperty,G=(e,t)=>Ct(e,`name`,{value:t,configurable:!0}),wt=`Popover`,[Tt,Et]=N(wt,[M]),Dt=M(),[Ot,K]=Tt(wt),kt=G(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Dt(t),c=R.useRef(null),[l,u]=R.useState(!1),[d,f]=R.useState(0),[p,m]=R.useState(0),[h,g]=E({prop:r,defaultProp:i??!1,onChange:a,caller:wt});return(0,z.jsx)(ie,{...s,children:(0,z.jsx)(Ot,{scope:t,contentId:k(),titleId:k(),descriptionId:k(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:R.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:R.useCallback(()=>u(!0),[]),onCustomAnchorRemove:R.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),At=`PopoverAnchor`,jt=R.forwardRef(G(function(e,t){let{__scopePopover:n,...r}=e,i=K(At,n),a=Dt(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return R.useEffect(()=>(o(),()=>s()),[o,s]),(0,z.jsx)(ee,{...a,...r,ref:t})},`PopoverAnchor`)),Mt=`PopoverTrigger`,Nt=R.forwardRef(G(function(e,t){let{__scopePopover:n,...r}=e,i=K(Mt,n),a=Dt(n),o=O(t,i.triggerRef),s=(0,z.jsx)(P.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Gt(i.open),...r,ref:o,onClick:A(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,z.jsx)(ee,{asChild:!0,...a,children:s})},`PopoverTrigger`)),Pt=`PopoverPortal`,[Ft,It]=Tt(Pt,{forceMount:void 0}),Lt=G(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=K(Pt,t);return(0,z.jsx)(Ft,{scope:t,forceMount:n,children:(0,z.jsx)(j,{present:n||a.open,children:(0,z.jsx)(y,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),Rt=`PopoverContent`,zt=R.forwardRef(G(function(e,t){let n=It(Rt,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=K(Rt,e.__scopePopover);return(0,z.jsx)(j,{present:r||a.open,children:a.modal?(0,z.jsx)(Vt,{...i,ref:t}):(0,z.jsx)(Ht,{...i,ref:t})})},`PopoverContent`)),Bt=C(`PopoverContent.RemoveScroll`),Vt=R.forwardRef(G(function(e,t){let n=K(Rt,e.__scopePopover),r=R.useRef(null),i=O(t,r),a=R.useRef(!1),{nodes:o,registry:s}=c();return R.useEffect(()=>{let e=r.current;if(e)return p(e)},[]),(0,z.jsx)(re,{as:Bt,allowPinchZoom:!0,shards:R.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:(0,z.jsx)(Ut,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:A(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:A(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:A(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),Ht=R.forwardRef(G(function(e,t){let n=K(Rt,e.__scopePopover),r=R.useRef(!1),i=R.useRef(!1);return(0,z.jsx)(Ut,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),Ut=R.forwardRef(G(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:p,branchRegistry:h,...g}=e,_=K(Rt,n),y=Dt(n),[x,C]=R.useState(null),w=O(t,C);return m(x),f(),(0,z.jsx)(b,{registry:h,children:(0,z.jsx)(v,{asChild:!0,loop:!0,trapped:r,branches:p,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,z.jsx)(S,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>_.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,z.jsx)(ne,{"data-state":Gt(_.open),role:`dialog`,id:_.contentId,"aria-labelledby":_.titlePresent?_.titleId:void 0,"aria-describedby":_.descriptionPresent?Kt(d,_.descriptionId):d,...y,...g,ref:w,style:{...g.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`)),Wt=R.forwardRef(G(function(e,t){let{__scopePopover:n,...r}=e,i=Dt(n);return(0,z.jsx)(x,{...i,...r,ref:t})},`PopoverArrow`));function Gt(e){return e?`open`:`closed`}G(Gt,`getState`);function Kt(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}G(Kt,`concatAriaDescribedby`);var qt=Object.defineProperty,Jt=(e,t)=>qt(e,`name`,{value:t,configurable:!0}),Yt=`Toggle`,Xt=R.forwardRef(Jt(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=E({prop:n,onChange:i,defaultProp:r??!1,caller:Yt});return(0,z.jsx)(P.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:A(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Zt=Object.defineProperty,q=(e,t)=>Zt(e,`name`,{value:t,configurable:!0}),J=`ToggleGroup`,Qt={Single:`single`,Multiple:`multiple`},[$t,en]=N(J,[De]),tn=De(),nn=R.forwardRef(q(function(e,t){let{type:n,...r}=e;if(n===Qt.Single)return(0,z.jsx)(on,{role:`radiogroup`,...r,ref:t});if(n===Qt.Multiple)return(0,z.jsx)(sn,{role:`toolbar`,...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${J}\``)},`ToggleGroup`)),[rn,an]=$t(J),on=R.forwardRef(q(function(e,t){let{value:n,defaultValue:r,onValueChange:i=q(()=>{},`onValueChange`),...a}=e,[o,s]=E({prop:n,defaultProp:r??``,onChange:i,caller:J});return(0,z.jsx)(rn,{scope:e.__scopeToggleGroup,type:Qt.Single,value:R.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:R.useCallback(()=>s(``),[s]),children:(0,z.jsx)(un,{...a,ref:t})})},`ToggleGroupImplSingle`)),sn=R.forwardRef(q(function(e,t){let{value:n,defaultValue:r,onValueChange:i=q(()=>{},`onValueChange`),...a}=e,[o,s]=E({prop:n,defaultProp:r??[],onChange:i,caller:J}),c=R.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=R.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,z.jsx)(rn,{scope:e.__scopeToggleGroup,type:Qt.Multiple,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,z.jsx)(un,{...a,ref:t})})},`ToggleGroupImplMultiple`)),[cn,ln]=$t(J),un=R.forwardRef(q(function(e,t){let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=tn(n),u=ge(o),d={dir:u,...c};return(0,z.jsx)(cn,{scope:n,rovingFocus:i,disabled:r,children:i?(0,z.jsx)(_e,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,z.jsx)(P.div,{...d,ref:t})}):(0,z.jsx)(P.div,{...d,ref:t})})},`ToggleGroupImpl`)),dn=`ToggleGroupItem`,fn=R.forwardRef(q(function(e,t){let n=an(dn,e.__scopeToggleGroup),r=ln(dn,e.__scopeToggleGroup),i=tn(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=R.useRef(null);return r.rovingFocus?(0,z.jsx)(Te,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,z.jsx)(pn,{...s,ref:t})}):(0,z.jsx)(pn,{...s,ref:t})},`ToggleGroupItem`)),pn=R.forwardRef(q(function(e,t){let{__scopeToggleGroup:n,value:r,...i}=e,a=an(dn,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0},s=a.type===Qt.Single?o:void 0;return(0,z.jsx)(Xt,{...s,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})},`ToggleGroupItemImpl`)),mn=I(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),hn=I(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),gn=I(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),_n=I(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),vn=I(`file-box`,[[`path`,{d:`M14.5 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.8`,key:`1kchwa`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M11.7 14.2 7 17l-4.7-2.8`,key:`1yk8tc`}],[`path`,{d:`M3 13.1a2 2 0 0 0-.999 1.76v3.24a2 2 0 0 0 .969 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01z`,key:`19flxy`}],[`path`,{d:`M7 17v5`,key:`1yj1jh`}]]),yn=I(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),bn=I(`file-chart-column`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 18v-1`,key:`zg0ygc`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}],[`path`,{d:`M16 18v-3`,key:`j5jt4h`}]]),xn=I(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),Sn=I(`file-image`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),Cn=I(`file-pen-line`,[[`path`,{d:`M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z`,key:`ukzhwg`}],[`path`,{d:`M14.487 7.858A1 1 0 0 1 14 7V2`,key:`1klhew`}],[`path`,{d:`M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516`,key:`rxaxab`}],[`path`,{d:`M8 18h1`,key:`13wk12`}]]),wn=I(`file-output`,[[`path`,{d:`M4.226 20.925A2 2 0 0 0 6 22h12a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v3.127`,key:`wfxp4w`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 11-3 3`,key:`1dgrs4`}],[`path`,{d:`m5 17-3-3h10`,key:`1mvvaf`}]]),Tn=I(`file-play`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z`,key:`1tzo1f`}]]),En=I(`file-spreadsheet`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]),Dn=I(`file-stack`,[[`path`,{d:`M11 21a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-8a1 1 0 0 1 1-1`,key:`likhh7`}],[`path`,{d:`M16 16a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1`,key:`17ky3x`}],[`path`,{d:`M21 6a2 2 0 0 0-.586-1.414l-2-2A2 2 0 0 0 17 2h-3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1z`,key:`1hyeo0`}]]),On=I(`file-type`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M11 18h2`,key:`12mj7e`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5`,key:`qbrxap`}]]),kn=I(`file-video-camera`,[[`path`,{d:`M4 12V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2`,key:`jrl274`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m10 17.843 3.033-1.755a.64.64 0 0 1 .967.56v4.704a.65.65 0 0 1-.967.56L10 20.157`,key:`17aeo9`}],[`rect`,{width:`7`,height:`6`,x:`3`,y:`16`,rx:`1`,key:`s27ndx`}]]),An=I(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Y=I(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),jn=I(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Mn=I(`share`,[[`path`,{d:`M12 2v13`,key:`1km8f5`}],[`path`,{d:`m16 6-4-4-4 4`,key:`13yo43`}],[`path`,{d:`M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8`,key:`1b2hhj`}]]),X=oe({en:{saved:{saved:`Saved`,saving:`Saving…`,unsaved:`Not saved yet`,error:`Not saved`},agentDoing:{editing:e=>`${e} is editing`,looking:e=>`${e} is looking`},follow:e=>`Follow ${e}`,unfollow:e=>`Stop following ${e}`,markUp:`Mark up`,markUpHint:`Mark up what is on show, and AI makes the changes`,moreTools:`More`,download:`Download`,share:`Share`,ready:`Ready`,failed:`Download failed`,format:`Format`,versions:`Languages`,include:`Include`,onShow:`On show`,all:e=>`All ${String(e)} languages`,choose:`Choose…`,chosen:e=>`${String(e)} chosen`,back:`Back`,checking:`Checking…`,blocked:e=>e===1?`1 must-fix problem stops the download`:`${String(e)} must-fix problems stop the download`,queued:`Waiting`,queuedAhead:e=>`Waiting, ${String(e)} ahead`,preparing:e=>`Preparing ${String(e)}%`,cancel:`Cancel`,retry:`Try again`,failedHelp:e=>`Try again, or ask ${e} what went wrong.`,partial:`Some files could not be made.`,nVersions:e=>`${String(e)} versions`,show:`Show in folder`,notStarted:`The download did not start`,option:{pptx:{label:`Slides`,values:{native:`Editable`,picture:`Pictures`}},steps:{label:`Each animation step`},changes:{label:`Changes since its Word original`},scale:{label:`Size`}},type:{mov:`MOV (ProRes)`,srt:`Captions`,cover:`Cover image`,pptx:`PowerPoint`,zip:`ZIP (each board as a PNG)`}},"zh-cn":{saved:{saved:`已保存`,saving:`正在保存…`,unsaved:`尚未保存`,error:`没能保存`},agentDoing:{editing:e=>`${e} 正在编辑`,looking:e=>`${e} 正在查看`},follow:e=>`跟随 ${e}`,unfollow:e=>`停止跟随 ${e}`,markUp:`批改`,markUpHint:`在画面上批改,AI 照着改`,moreTools:`更多`,download:`下载`,share:`分享`,ready:`已就绪`,failed:`下载失败`,format:`格式`,versions:`语言`,include:`附带`,onShow:`当前`,all:e=>`全部 ${String(e)} 种语言`,choose:`选择…`,chosen:e=>`已选 ${String(e)} 个`,back:`返回`,checking:`检查中…`,blocked:e=>`有 ${String(e)} 个必修问题,暂时不能下载`,queued:`排队中`,queuedAhead:e=>`排队中,前面还有 ${String(e)} 个`,preparing:e=>`正在准备 ${String(e)}%`,cancel:`取消`,retry:`重试`,failedHelp:e=>`请重试,或让 ${e} 看看哪里出了问题。`,partial:`部分文件没能生成。`,nVersions:e=>`${String(e)} 个版本`,show:`在文件夹中显示`,notStarted:`无法开始下载`,option:{pptx:{label:`幻灯片`,values:{native:`可编辑`,picture:`图片`}},steps:{label:`每个动画步骤`},changes:{label:`相对原 Word 文件的修订`},scale:{label:`尺寸`}},type:{mov:`MOV(ProRes)`,srt:`字幕`,cover:`封面图`,pptx:`PowerPoint`,zip:`ZIP(每个画板一张 PNG)`}},"zh-tw":{saved:{saved:`已儲存`,saving:`正在儲存…`,unsaved:`尚未儲存`,error:`沒能儲存`},agentDoing:{editing:e=>`${e} 正在編輯`,looking:e=>`${e} 正在查看`},follow:e=>`跟隨 ${e}`,unfollow:e=>`停止跟隨 ${e}`,markUp:`批改`,markUpHint:`在畫面上批改,AI 照著改`,moreTools:`更多`,download:`下載`,share:`分享`,ready:`已就緒`,failed:`下載失敗`,format:`格式`,versions:`語言`,include:`附帶`,onShow:`目前`,all:e=>`全部 ${String(e)} 種語言`,choose:`選擇…`,chosen:e=>`已選 ${String(e)} 個`,back:`返回`,checking:`檢查中…`,blocked:e=>`有 ${String(e)} 個必須修正的問題,暫時無法下載`,queued:`排隊中`,queuedAhead:e=>`排隊中,前面還有 ${String(e)} 個`,preparing:e=>`正在準備 ${String(e)}%`,cancel:`取消`,retry:`重試`,failedHelp:e=>`請重試,或讓 ${e} 看看哪裡出了問題。`,partial:`部分檔案沒能產生。`,nVersions:e=>`${String(e)} 個版本`,show:`在資料夾中顯示`,notStarted:`無法開始下載`,option:{pptx:{label:`投影片`,values:{native:`可編輯`,picture:`圖片`}},steps:{label:`每個動畫步驟`},changes:{label:`相對原 Word 檔案的修訂`},scale:{label:`尺寸`}},type:{mov:`MOV(ProRes)`,srt:`字幕`,cover:`封面圖`,pptx:`PowerPoint`,zip:`ZIP(每個畫板一張 PNG)`}},ja:{saved:{saved:`保存済み`,saving:`保存中…`,unsaved:`未保存`,error:`保存できませんでした`},agentDoing:{editing:e=>`${e}が編集中`,looking:e=>`${e}が表示中`},follow:e=>`${e}をフォロー`,unfollow:e=>`${e}のフォローをやめる`,markUp:`赤入れ`,markUpHint:`画面に赤を入れると、AI が直します`,moreTools:`その他`,download:`ダウンロード`,share:`共有`,ready:`準備完了`,failed:`ダウンロードに失敗`,format:`形式`,versions:`言語`,include:`追加`,onShow:`表示中`,all:e=>`全 ${String(e)} 言語`,choose:`選択…`,chosen:e=>`${String(e)} 件選択`,back:`戻る`,checking:`チェック中…`,blocked:e=>`要修正の問題が ${String(e)} 件あるためダウンロードできません`,queued:`待機中`,queuedAhead:e=>`待機中、前に ${String(e)} 件`,preparing:e=>`準備中 ${String(e)}%`,cancel:`キャンセル`,retry:`再試行`,failedHelp:e=>`もう一度試すか、${e} に原因を確認してください。`,partial:`一部のファイルを作成できませんでした。`,nVersions:e=>`${String(e)} 個のバージョン`,show:`フォルダに表示`,notStarted:`ダウンロードを開始できませんでした`,option:{pptx:{label:`スライド`,values:{native:`編集可能`,picture:`画像`}},steps:{label:`アニメーションの各ステップ`},changes:{label:`元の Word ファイルからの変更履歴`},scale:{label:`サイズ`}},type:{mov:`MOV(ProRes)`,srt:`字幕`,cover:`カバー画像`,pptx:`PowerPoint`,zip:`ZIP(各ボードを PNG で)`}},ko:{saved:{saved:`저장됨`,saving:`저장 중…`,unsaved:`아직 저장되지 않음`,error:`저장되지 않음`},agentDoing:{editing:e=>`${e} 편집 중`,looking:e=>`${e} 보는 중`},follow:e=>`${e} 따라가기`,unfollow:e=>`${e} 따라가기 중지`,markUp:`첨삭`,markUpHint:`화면에 첨삭하면 AI가 고쳐 줍니다`,moreTools:`더보기`,download:`다운로드`,share:`공유`,ready:`준비됨`,failed:`다운로드 실패`,format:`형식`,versions:`언어`,include:`포함`,onShow:`현재`,all:e=>`${String(e)}개 언어 모두`,choose:`선택…`,chosen:e=>`${String(e)}개 선택`,back:`뒤로`,checking:`확인 중…`,blocked:e=>`수정이 필요한 문제 ${String(e)}개 때문에 다운로드할 수 없습니다`,queued:`대기 중`,queuedAhead:e=>`대기 중, 앞에 ${String(e)}개`,preparing:e=>`준비 중 ${String(e)}%`,cancel:`취소`,retry:`다시 시도`,failedHelp:e=>`다시 시도하거나 ${e}에게 원인을 물어보세요.`,partial:`일부 파일을 만들지 못했습니다.`,nVersions:e=>`버전 ${String(e)}개`,show:`폴더에서 보기`,notStarted:`다운로드를 시작하지 못했습니다`,option:{pptx:{label:`슬라이드`,values:{native:`편집 가능`,picture:`이미지`}},steps:{label:`애니메이션 단계별로`},changes:{label:`원본 Word 파일 이후의 변경 내용`},scale:{label:`크기`}},type:{mov:`MOV (ProRes)`,srt:`자막`,cover:`표지 이미지`,pptx:`PowerPoint`,zip:`ZIP (보드마다 PNG)`}},es:{saved:{saved:`Guardado`,saving:`Guardando…`,unsaved:`Aún sin guardar`,error:`No guardado`},agentDoing:{editing:e=>`${e} está editando`,looking:e=>`${e} está mirando`},follow:e=>`Seguir a ${e}`,unfollow:e=>`Dejar de seguir a ${e}`,markUp:`Corregir`,markUpHint:`Corrige lo que ves y la IA hace los cambios`,moreTools:`Más`,download:`Descargar`,share:`Compartir`,ready:`Listo`,failed:`Error al descargar`,format:`Formato`,versions:`Idiomas`,include:`Incluir`,onShow:`Actual`,all:e=>`Los ${String(e)} idiomas`,choose:`Elegir…`,chosen:e=>`${String(e)} elegidos`,back:`Atrás`,checking:`Comprobando…`,blocked:e=>`${String(e)} problemas obligatorios impiden la descarga`,queued:`En espera`,queuedAhead:e=>`En espera, ${String(e)} delante`,preparing:e=>`Preparando ${String(e)} %`,cancel:`Cancelar`,retry:`Reintentar`,failedHelp:e=>`Reinténtalo o pregunta a ${e} qué ha fallado.`,partial:`No se pudieron crear algunos archivos.`,nVersions:e=>`${String(e)} versiones`,show:`Mostrar en la carpeta`,notStarted:`La descarga no se inició`,option:{pptx:{label:`Diapositivas`,values:{native:`Editables`,picture:`Imágenes`}},steps:{label:`Cada paso de animación`},changes:{label:`Cambios desde su Word original`},scale:{label:`Tamaño`}},type:{mov:`MOV (ProRes)`,srt:`Subtítulos`,cover:`Imagen de portada`,pptx:`PowerPoint`,zip:`ZIP (cada mesa de trabajo en PNG)`}},fr:{saved:{saved:`Enregistré`,saving:`Enregistrement…`,unsaved:`Pas encore enregistré`,error:`Non enregistré`},agentDoing:{editing:e=>`${e} modifie`,looking:e=>`${e} regarde`},follow:e=>`Suivre ${e}`,unfollow:e=>`Ne plus suivre ${e}`,markUp:`Annoter`,markUpHint:`Annotez ce qui est affiché, et l'IA fait les changements`,moreTools:`Plus`,download:`Télécharger`,share:`Partager`,ready:`Prêt`,failed:`Échec du téléchargement`,format:`Format`,versions:`Langues`,include:`Inclure`,onShow:`Affichée`,all:e=>`Les ${String(e)} langues`,choose:`Choisir…`,chosen:e=>`${String(e)} choisies`,back:`Retour`,checking:`Vérification…`,blocked:e=>`${String(e)} problèmes à corriger bloquent le téléchargement`,queued:`En attente`,queuedAhead:e=>`En attente, ${String(e)} avant celui-ci`,preparing:e=>`Préparation ${String(e)}\u00a0%`,cancel:`Annuler`,retry:`Réessayer`,failedHelp:e=>`Réessayez ou demandez à ${e} ce qui n’a pas marché.`,partial:`Certains fichiers n’ont pas pu être créés.`,nVersions:e=>`${String(e)} versions`,show:`Afficher dans le dossier`,notStarted:`Le téléchargement n’a pas démarré`,option:{pptx:{label:`Diapositives`,values:{native:`Modifiables`,picture:`Images`}},steps:{label:`Chaque étape d'animation`},changes:{label:`Modifications depuis le Word d'origine`},scale:{label:`Taille`}},type:{mov:`MOV (ProRes)`,srt:`Sous-titres`,cover:`Image de couverture`,pptx:`PowerPoint`,zip:`ZIP (chaque plan de travail en PNG)`}},de:{saved:{saved:`Gespeichert`,saving:`Wird gespeichert…`,unsaved:`Noch nicht gespeichert`,error:`Nicht gespeichert`},agentDoing:{editing:e=>`${e} bearbeitet`,looking:e=>`${e} schaut sich um`},follow:e=>`${e} folgen`,unfollow:e=>`${e} nicht mehr folgen`,markUp:`Korrigieren`,markUpHint:`Korrigieren Sie, was zu sehen ist, und die KI setzt es um`,moreTools:`Mehr`,download:`Herunterladen`,share:`Teilen`,ready:`Bereit`,failed:`Download fehlgeschlagen`,format:`Format`,versions:`Sprachen`,include:`Dazu`,onShow:`Aktuell`,all:e=>`Alle ${String(e)} Sprachen`,choose:`Auswählen…`,chosen:e=>`${String(e)} ausgewählt`,back:`Zurück`,checking:`Wird geprüft…`,blocked:e=>`${String(e)} Probleme verhindern den Download`,queued:`Wartet`,queuedAhead:e=>`Wartet, ${String(e)} davor`,preparing:e=>`Wird vorbereitet: ${String(e)} %`,cancel:`Abbrechen`,retry:`Erneut versuchen`,failedHelp:e=>`Versuche es erneut oder frage ${e}, was schiefgelaufen ist.`,partial:`Einige Dateien konnten nicht erstellt werden.`,nVersions:e=>`${String(e)} Versionen`,show:`Im Ordner zeigen`,notStarted:`Der Download wurde nicht gestartet`,option:{pptx:{label:`Folien`,values:{native:`Bearbeitbar`,picture:`Bilder`}},steps:{label:`Jeden Animationsschritt`},changes:{label:`Änderungen seit dem Word-Original`},scale:{label:`Größe`}},type:{mov:`MOV (ProRes)`,srt:`Untertitel`,cover:`Titelbild`,pptx:`PowerPoint`,zip:`ZIP (jede Zeichenfläche als PNG)`}},pt:{saved:{saved:`Salvo`,saving:`Salvando…`,unsaved:`Ainda não salvo`,error:`Não salvo`},agentDoing:{editing:e=>`${e} está editando`,looking:e=>`${e} está olhando`},follow:e=>`Seguir ${e}`,unfollow:e=>`Parar de seguir ${e}`,markUp:`Corrigir`,markUpHint:`Corrija o que vê e a IA faz as alterações`,moreTools:`Mais`,download:`Baixar`,share:`Compartilhar`,ready:`Pronto`,failed:`Falha ao baixar`,format:`Formato`,versions:`Idiomas`,include:`Incluir`,onShow:`Atual`,all:e=>`Todos os ${String(e)} idiomas`,choose:`Escolher…`,chosen:e=>`${String(e)} escolhidos`,back:`Voltar`,checking:`Verificando…`,blocked:e=>`${String(e)} problemas obrigatórios impedem o download`,queued:`Aguardando`,queuedAhead:e=>`Aguardando, ${String(e)} na frente`,preparing:e=>`Preparando ${String(e)}%`,cancel:`Cancelar`,retry:`Tentar novamente`,failedHelp:e=>`Tente novamente ou pergunte a ${e} o que deu errado.`,partial:`Não foi possível criar alguns arquivos.`,nVersions:e=>`${String(e)} versões`,show:`Mostrar na pasta`,notStarted:`O download não começou`,option:{pptx:{label:`Slides`,values:{native:`Editáveis`,picture:`Imagens`}},steps:{label:`Cada etapa da animação`},changes:{label:`Alterações desde o Word original`},scale:{label:`Tamanho`}},type:{mov:`MOV (ProRes)`,srt:`Legendas`,cover:`Imagem de capa`,pptx:`PowerPoint`,zip:`ZIP (cada prancheta em PNG)`}}});function Nn(){let e=r(),t=X.of(e?.locale);return e=>e.doing===void 0?e.name:t.agentDoing[e.doing](e.name)}function Pn(){let e=r(),n=Nn(),{agent:i,following:a,follow:o,unfollow:c}=t();if(i?.doing===void 0)return null;let l=X.of(e?.locale);return(0,z.jsxs)(F,{[s]:``,"data-testid":`agent-here`,"data-doing":i.doing,"aria-pressed":a,title:a?l.unfollow(i.name):l.follow(i.name),className:`text-agent-text hover:text-agent-text aria-pressed:text-agent-text`,onClick:()=>{a?c():o()},children:[(0,z.jsx)(`span`,{"aria-hidden":!0,className:T(`size-2 flex-none rounded-full`,a?`bg-agent motion-safe:animate-pulse`:`border-agent border`)}),n(i)]})}function Fn(){let e=o(),{agent:n,following:r,follow:i,unfollow:s}=t(),c=n?.doing,l=n?.name;return(0,R.useEffect)(()=>{e[`agent/here`]({...c===void 0||l===void 0?{}:{agent:{name:l,doing:c}},following:r}).catch(()=>void 0)},[e,c,l,r]),a(`editor/command`,({command:e})=>{e===`follow`?i():e===`unfollow`&&s()}),null}function In({checked:e,multiple:t=!1,variant:n=`row`,className:r,children:i,...a}){return(0,z.jsxs)(`button`,{type:`button`,role:t?`checkbox`:`radio`,"aria-checked":e,"data-slot":`choice`,...a,className:T(`text-sm text-ink transition-colors focus-visible:outline focus-visible:-outline-offset-1 focus-visible:outline-pencil disabled:cursor-default disabled:opacity-50`,n===`row`?`flex min-h-8 items-center gap-2.5 rounded-md px-2 py-1 text-left`:`flex flex-col items-center rounded-md border px-2 py-2.5`,e?T(`bg-pencil-wash`,n===`box`&&`border-pencil`):T(`hover:bg-hover active:bg-press`,n===`box`&&`border-rule hover:border-rule-strong`),r),children:[n===`row`&&(0,z.jsx)(`span`,{"aria-hidden":!0,className:T(`flex size-4 flex-none items-center justify-center border text-on-pencil`,t?`rounded-sm`:`rounded-full`,e?t?`border-pencil bg-pencil`:`border-4 border-pencil`:`border-rule-strong`),children:t&&e&&(0,z.jsx)(Me,{className:`size-3`})}),i]})}var Z=16,Ln=8;function Rn(){return(0,z.jsx)(Wt,{asChild:!0,width:Z,height:Ln,children:(0,z.jsxs)(`svg`,{viewBox:`0 0 ${String(Z)} ${String(Ln)}`,"aria-hidden":!0,className:`-mt-px block overflow-visible`,children:[(0,z.jsx)(`path`,{d:`M0 -1 L${String(Z/2)} 7 L${String(Z)} -1 Z`,className:`fill-popover`}),(0,z.jsx)(`path`,{d:`M0 0 L${String(Z/2)} 7 L${String(Z)} 0`,className:`fill-none stroke-border`})]})})}function zn({className:e,...t}){return(0,z.jsx)(Qe,{"data-slot":`checkbox`,className:T(`peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary`,e),...t,children:(0,z.jsx)(et,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none`,children:(0,z.jsx)(Me,{className:`size-3.5`})})})}function Bn({...e}){return(0,z.jsx)(kt,{"data-slot":`popover`,...e})}function Vn({...e}){return(0,z.jsx)(Nt,{"data-slot":`popover-trigger`,...e})}function Hn({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,z.jsx)(Lt,{children:(0,z.jsx)(zt,{"data-slot":`popover-content`,align:t,sideOffset:n,className:T(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...r})})}function Un({...e}){return(0,z.jsx)(jt,{"data-slot":`popover-anchor`,...e})}function Wn({...e}){return(0,z.jsx)(l,{"data-slot":`sheet`,...e})}function Gn({...e}){return(0,z.jsx)(_,{"data-slot":`sheet-portal`,...e})}function Kn({className:e,...t}){return(0,z.jsx)(h,{"data-slot":`sheet-overlay`,className:T(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function qn({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,z.jsxs)(Gn,{children:[(0,z.jsx)(Kn,{}),(0,z.jsxs)(d,{"data-slot":`sheet-content`,className:T(`fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...i,children:[t,r&&(0,z.jsxs)(g,{className:`absolute top-2.5 right-2.5 grid size-7 place-items-center rounded-md text-lead ring-offset-background hover:bg-hover hover:text-ink focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus:outline-hidden active:bg-press disabled:pointer-events-none motion-safe:transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,z.jsx)(ae,{className:`size-4`}),(0,z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Jn({className:e,...t}){return(0,z.jsx)(u,{"data-slot":`sheet-title`,className:T(`font-semibold text-foreground`,e),...t})}var Yn=w(`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-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 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground 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-accent hover:text-accent-foreground`},size:{default:`h-9 min-w-9 px-2`,sm:`h-8 min-w-8 px-1.5`,lg:`h-10 min-w-10 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}}),Xn=R.createContext({size:`default`,variant:`default`,spacing:0});function Zn({className:e,variant:t,size:n,spacing:r=0,children:i,...a}){return(0,z.jsx)(nn,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:T(`group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs`,e),...a,children:(0,z.jsx)(Xn.Provider,{value:{variant:t,size:n,spacing:r},children:i})})}function Qn({className:e,children:t,variant:n,size:r,...i}){let a=R.useContext(Xn);return(0,z.jsx)(fn,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:T(Yn({variant:a.variant||n,size:a.size||r}),`w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10`,`data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l`,e),...i,children:t})}function $n(e){if(e?.mode!==`edit`)return{gives:`nothing`};let t=e.commands!==!0,n=le(e.item);return n===`formats`?{gives:`formats`,button:t}:n===`file as it is`?{gives:`file as it is`,path:e.item.entry,button:t}:{gives:`nothing`}}function er(e,t,n){if(!n&&e.state===`done`&&t.has(e.id))return e.files.length===1?e.files[0]:void 0}var tr=5;function nr(e,t){let n=new Set;return e.filter(e=>e.item===t&&e.state!==`cancelled`).reverse().filter(e=>{if(e.state!==`done`||e.files.length===0)return!0;let t=[...e.files].sort().join(`
2
+ `);return!n.has(t)&&(n.add(t),!0)}).slice(0,tr)}var Q=e=>e.state===`queued`||e.state===`running`,rr=e=>e.state===`running`&&e.progress===0,ir=6,ar=.95,or=e=>ar*(1-Math.exp(-Math.max(0,e)/ir));function sr(e,t){return e.map(e=>{let n=t.get(e.id);return e.state===`running`&&n!==void 0&&n>e.progress?{...e,progress:Math.min(1,n)}:e})}function cr(e,t,n,r={}){let i=(e,t)=>e.length===t.length&&e.every(e=>t.includes(e));return Q(e)&&i(e.versions,t)&&i(e.types,n)&&lr(e.options??{},r)}var lr=(e,t)=>Object.keys({...e,...t}).every(n=>e[n]===t[n]);function ur(e,t,n){return Object.fromEntries(e.flatMap(e=>{let r=n[e.name];return!e.only.includes(t)||r===void 0?[]:e.values?e.values.includes(String(r))?[[e.name,r]]:[]:r===!0?[[e.name,!0]]:[]}))}function dr(e,t){return Math.max(0,e.filter(Q).map(e=>e.id).indexOf(t))}function fr(e,t,n,r){if(n.length!==0)return e===`all`?[...n]:e===`some`?n.filter(e=>r.includes(e)):t===void 0?[...n]:[t]}function pr(e,t){let n=e.findLast(Q);if(n)return n.state===`running`?{at:`running`,percent:Math.round(n.progress*100)}:{at:`queued`};let r=e[0];return r===void 0||!t.has(r.id)?{at:`idle`}:r.state===`failed`?{at:`failed`}:{at:`done`}}var mr=e=>e.slice(e.lastIndexOf(`/`)+1);async function hr(e,t){let{url:n}=await e[`files/url`]({path:t}),r=document.createElement(`a`);r.href=n,r.download=mr(t),r.click()}var gr={mp4:`MP4`,gif:`GIF`,png:`PNG`,jpeg:`JPEG`,webp:`WebP`,avif:`AVIF`,pdf:`PDF`,html:`HTML`,zip:`ZIP`,psd:`PSD`,docx:`Word`,md:`Markdown`,xlsx:`Excel`,csv:`CSV`,json:`JSON`,glb:`GLB`},_r=(e,t)=>gr[t]??(t in e.type?e.type[t]:t);function vr(){let e=r(),t=X.of(e?.locale),n=e?.item.kindInfo.exports?.names,i=e?.locale??`en`;return e=>{let r=n?.[e];return r?.[i]??r?.en??_r(t,e)}}function yr(){let[e,t]=(0,R.useState)(()=>window.matchMedia(`(max-width: 479px)`).matches);return(0,R.useEffect)(()=>{let e=window.matchMedia(`(max-width: 479px)`),n=()=>{t(e.matches)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}},[]),e}function br(e,t){let n=o(),[r,i]=(0,R.useState)([]),[s,c]=(0,R.useState)(new Set),[l,u]=(0,R.useState)(!1),d=(0,R.useRef)(new Set),f=(0,R.useRef)(new Map),p=e=>{let r=er(e,d.current,l);r!==void 0&&(d.current.delete(e.id),hr(n,r).catch(e=>{we.error(t.notStarted,{description:e instanceof Error?e.message:String(e)})}))},m=(0,R.useRef)(new Map),[h,g]=(0,R.useState)(new Map),_=e=>{rr(e)?m.current.has(e.id)||m.current.set(e.id,performance.now()):(m.current.delete(e.id),Q(e)||g(t=>{if(!t.has(e.id))return t;let n=new Map(t);return n.delete(e.id),n}))},v=r.some(rr);(0,R.useEffect)(()=>{if(!v)return;let e=setInterval(()=>{let e=performance.now();g(t=>{let n=new Map(t);for(let[r,i]of m.current)n.set(r,Math.max(t.get(r)??0,or((e-i)/1e3)));return n})},250);return()=>{clearInterval(e)}},[v]);let y=e=>{d.current.add(e.id),p(f.current.get(e.id)??e)};(0,R.useEffect)(()=>{let e=!0;return L(n,`export/list`,{}).then(t=>{e&&(t.jobs.forEach(_),i(t.jobs),u(t.reveal))},()=>void 0),()=>{e=!1}},[n]),a(`export/changed`,({job:t})=>{_(t),i(e=>{let n=e.findIndex(e=>e.id===t.id);return n<0?[...e,t]:e.map((e,r)=>r===n?t:e)}),!Q(t)&&!e&&c(e=>new Set(e).add(t.id)),f.current.set(t.id,t),p(t)});let[b,x]=(0,R.useState)(e);return b!==e&&(x(e),e&&c(new Set)),{all:(0,R.useMemo)(()=>sr(r,h),[r,h]),fresh:s,reveals:l,asked:y}}function xr(e,t){let n=o(),r=`item-bar.export.${e}`,[i,a]=(0,R.useState)({type:t.types[0]??``,extras:[],options:{}});return(0,R.useEffect)(()=>{let e=!0;return n[`storage/get`]({key:r}).then(({value:n})=>{let r=n;if(!e||!r)return;let i=t.types.find(e=>e===r.type);i!==void 0&&a({type:i,extras:t.extras.filter(e=>r.extras?.includes(e)),options:r.options??{}})},()=>void 0),()=>{e=!1}},[n,r,t]),[i,e=>{a(e),n[`storage/set`]({key:r,value:e}).catch(()=>void 0)}]}async function Sr(e,t,n){n&&await L(e,`export/reveal`,{path:t}).then(()=>!0,()=>!1)||await hr(e,t)}function Cr({job:e,versions:t,ahead:n,words:i,reveals:a,onAsked:s}){let c=vr(),l=o(),u=r()?.agent?.name??`AllyHub`,d=Math.round(e.progress*100),f=a?An:hn,p=a?i.show:i.download,m=e.versions.length===0?void 0:e.versions.length>2?i.nVersions(e.versions.length):e.versions.map(e=>t.find(t=>t.key===e)?.label??e).join(`, `),h=[e.types.map(e=>c(e)).join(`, `),...t.length>1&&m!==void 0?[m]:[]].join(` · `);return(0,z.jsxs)(`div`,{className:`border-t py-2 pr-2 pl-4`,"data-testid":`export-job`,"data-state":e.state,children:[Q(e)&&(0,z.jsxs)(`div`,{className:`pr-2`,children:[(0,z.jsxs)(`div`,{className:`flex h-7 items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`text-dense min-w-0 flex-1 truncate`,children:h}),(0,z.jsx)(`span`,{className:`text-lead text-xs tabular-nums`,children:e.state===`running`?`${String(d)}%`:n>0?i.queuedAhead(n):i.queued}),(0,z.jsx)(F,{icon:!0,"aria-label":i.cancel,title:i.cancel,"data-testid":`export-cancel`,onClick:()=>{L(l,`export/cancel`,{job:e.id}).catch(()=>void 0)},children:(0,z.jsx)(ae,{"aria-hidden":!0})})]}),(0,z.jsx)(He,{value:d,className:`mt-1 h-1`})]}),e.state===`failed`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`flex h-7 items-center gap-2`,children:[(0,z.jsx)(me,{className:`text-destructive size-3.5 flex-none`,"aria-hidden":!0}),(0,z.jsxs)(`span`,{className:`text-dense text-destructive min-w-0 flex-1 truncate`,children:[i.failed,` · `,h]}),(0,z.jsx)(F,{icon:!0,"aria-label":i.retry,title:i.retry,"data-testid":`export-retry`,onClick:()=>{L(l,`export/start`,{item:e.item,versions:e.versions,types:e.types,...e.options?{options:e.options}:{}}).then(e=>{s(e.job)},e=>{we.error(i.notStarted,{description:e instanceof Error?e.message:String(e)})})},children:(0,z.jsx)(jn,{"aria-hidden":!0})})]}),(0,z.jsx)(`p`,{className:`text-lead pr-2 pl-5.5 text-xs`,title:e.error,children:i.failedHelp(u)})]}),e.files.map(e=>(0,z.jsxs)(`div`,{className:`flex h-7 items-center gap-2`,"data-testid":`export-file`,children:[(0,z.jsx)(Me,{className:`text-success size-3.5 flex-none`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`text-dense min-w-0 flex-1 truncate`,title:e,children:mr(e)}),(0,z.jsx)(F,{icon:!0,"aria-label":p,title:p,"data-testid":`export-give`,onClick:()=>{Sr(l,e,a)},children:(0,z.jsx)(f,{"aria-hidden":!0})})]},e)),e.state===`done`&&e.error!==void 0&&(0,z.jsx)(`p`,{className:`text-lead pr-2 pl-5.5 text-xs`,title:e.error,children:i.partial})]})}function wr({versions:e,shown:t,picked:n,onPick:r,onBack:i,words:a}){return(0,z.jsxs)(`div`,{"data-testid":`export-choose`,children:[(0,z.jsxs)(`div`,{className:`flex h-11 items-center gap-1 border-b pr-4 pl-2`,children:[(0,z.jsx)(F,{icon:!0,"aria-label":a.back,title:a.back,onClick:i,children:(0,z.jsx)(mn,{"aria-hidden":!0})}),(0,z.jsx)(`span`,{className:`text-sm font-medium`,children:a.versions}),(0,z.jsxs)(`span`,{className:`text-lead ml-auto text-xs tabular-nums`,children:[n.length,`/`,e.length]})]}),(0,z.jsx)(`ul`,{className:`max-h-64 overflow-y-auto p-2`,children:e.map(e=>(0,z.jsx)(`li`,{children:(0,z.jsxs)(`label`,{className:`pressable flex h-8 items-center gap-2 rounded-md px-2 text-sm`,children:[(0,z.jsx)(zn,{checked:n.includes(e.key),"data-version":e.key,onCheckedChange:t=>{r(t===!0?[...n,e.key]:n.filter(t=>t!==e.key))}}),(0,z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.key===t&&(0,z.jsx)(`span`,{className:`text-lead text-xs`,children:a.onShow})]})},e.key))})]})}function Tr({kind:e,offer:t,item:n,props:r,jobs:i,all:a,words:s,reveals:c,onAsked:l,startRef:u}){let d=vr(),f=o(),p=r.versions??[],m=p.map(e=>e.key),h=p.find(e=>e.key===r.shown)?.label,g=r.unavailable??{},[_,v]=xr(e,t),[y,b]=(0,R.useState)(`shown`),[x,S]=(0,R.useState)(r.shown===void 0?[]:[r.shown]),[C,w]=(0,R.useState)(!1),[ee,E]=(0,R.useState)(!1),D=fr(y,r.shown,m,x),O=D?.length??1,k=[_.type,..._.extras.filter(e=>g[e]===void 0)],ne=t.options.filter(e=>e.only.includes(_.type)),A=ur(ne,_.type,_.options),re=ne.filter(e=>e.values===void 0),ie=(e,t)=>{v({..._,options:{..._.options,[e]:t}})},j=r.check?.waiting===!0,M=j?0:r.check?.problems(D)??0,N=i.some(e=>cr(e,D??[],k,A)),ae=async()=>{E(!0);try{l((await L(f,`export/start`,{item:n,...D?{versions:D}:{},types:k,...Object.keys(A).length>0?{options:A}:{}})).job)}catch(e){if(ce(e))return;we.error(s.notStarted,{description:e instanceof Error?e.message:String(e)})}finally{E(!1)}},P=(0,z.jsx)(Dr,{label:s.format,types:t.types,chosen:_.type,name:d,onChoose:e=>{v({..._,type:e})}}),oe=(0,z.jsx)(te,{ref:u,size:`sm`,disabled:j||M>0||ee||O===0||N,"data-testid":`export-start`,onClick:()=>{ae()},children:j?s.checking:s.download});return(0,z.jsxs)(`div`,{className:`overflow-hidden rounded-lg text-sm`,"data-testid":`export-panel`,children:[C?(0,z.jsx)(wr,{versions:p,shown:r.shown,picked:x,onPick:S,onBack:()=>{w(!1)},words:s}):(0,z.jsxs)(z.Fragment,{children:[t.types.length>1&&(0,z.jsx)(`div`,{className:`px-4 pt-4`,children:P}),(m.length>1||t.extras.length+ne.length>0)&&(0,z.jsxs)(`div`,{className:`grid grid-cols-[max-content_minmax(0,1fr)] items-center gap-x-4 gap-y-3 px-4 pt-4`,children:[ne.map(e=>e.values?(0,z.jsxs)(R.Fragment,{children:[(0,z.jsx)(`span`,{className:`text-lead`,children:s.option[e.name]?.label}),(0,z.jsx)(Zn,{type:`single`,variant:`outline`,size:`sm`,className:`w-full`,"aria-label":s.option[e.name]?.label,"data-testid":`export-option-${e.name}`,value:String(_.options[e.name]??e.values[0]),onValueChange:t=>{t!==``&&ie(e.name,t)},children:e.values.map(t=>(0,z.jsx)(Qn,{value:t,"data-value":t,className:`flex-1`,children:s.option[e.name]?.values?.[t]??t},t))})]},e.name):null),m.length>1&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`text-lead`,children:s.versions}),(0,z.jsxs)(je,{value:y,onValueChange:e=>{b(e),e===`some`&&w(!0)},children:[(0,z.jsx)(ke,{size:`sm`,"aria-label":s.versions,className:`w-full min-w-0`,"data-testid":`export-scope`,children:(0,z.jsx)(Pe,{})}),(0,z.jsxs)(Oe,{position:`popper`,align:`start`,children:[(0,z.jsx)(Ie,{value:`shown`,children:h??s.onShow}),(0,z.jsx)(Ie,{value:`all`,children:s.all(m.length)}),(0,z.jsx)(Le,{}),(0,z.jsx)(Ie,{value:`some`,onPointerUp:()=>{w(!0)},children:y===`some`?s.chosen(x.length):s.choose})]})]})]}),t.extras.length+re.length>0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`text-lead self-start`,children:s.include}),(0,z.jsxs)(`div`,{className:`grid gap-1.5`,"data-testid":`export-include`,children:[re.map(e=>(0,z.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(zn,{checked:_.options[e.name]===!0,"data-option":e.name,onCheckedChange:t=>{ie(e.name,t===!0)}}),(0,z.jsx)(`span`,{className:`truncate`,children:s.option[e.name]?.label})]},e.name)),t.extras.map(e=>{let t=g[e];return(0,z.jsxs)(`label`,{title:t,className:T(`flex items-center gap-2`,t!==void 0&&`text-lead-soft`),children:[(0,z.jsx)(zn,{checked:t===void 0&&_.extras.includes(e),disabled:t!==void 0,"data-type":e,onCheckedChange:t=>{v({..._,extras:t===!0?[..._.extras,e]:_.extras.filter(t=>t!==e)})}}),(0,z.jsx)(`span`,{className:`truncate`,children:d(e)})]},e)})]})]})]}),M>0&&(0,z.jsxs)(`p`,{className:`text-dense text-destructive flex items-start gap-1.5 px-4 pt-3`,"data-testid":`export-blocked`,children:[(0,z.jsx)(me,{className:`mt-0.5 size-3.5 flex-none`,"aria-hidden":!0}),s.blocked(M)]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-3 p-4`,children:[(0,z.jsx)(`span`,{className:`text-lead min-w-0 flex-1 truncate text-xs`,children:r.facts??(t.types.length===1?d(_.type):void 0)}),oe]})]}),i.length>0&&(0,z.jsx)(`div`,{className:`max-h-56 overflow-y-auto`,children:i.map(e=>(0,z.jsx)(Cr,{job:e,versions:p,ahead:dr(a,e.id),words:s,reveals:c,onAsked:l},e.id))})]})}var Er={png:Sn,jpeg:Sn,webp:Sn,avif:Sn,gif:Tn,mp4:kn,mov:kn,pdf:pe,docx:Cn,md:On,txt:On,html:xn,xlsx:En,csv:En,json:yn,pptx:bn,zip:_n,psd:Dn,glb:vn};function Dr(e){let t=(0,R.useRef)(null),n=e.types.length,r=n<=4?n:Math.min(4,Math.ceil(n/2));return(0,z.jsx)(`div`,{ref:t,role:`radiogroup`,"aria-label":e.label,"data-testid":`export-format`,className:`grid gap-2`,style:{gridTemplateColumns:`repeat(${String(r)}, minmax(0, 1fr))`},onKeyDown:r=>{let i=r.key===`ArrowRight`||r.key===`ArrowDown`?1:r.key===`ArrowLeft`||r.key===`ArrowUp`?-1:0;if(i===0)return;r.preventDefault();let a=e.types[(e.types.indexOf(e.chosen)+i+n)%n];a!==void 0&&(e.onChoose(a),t.current?.querySelector(`[data-type="${a}"]`)?.focus())},children:e.types.map(t=>{let n=Er[t]??wn,r=e.chosen===t;return(0,z.jsxs)(In,{variant:`box`,checked:r,tabIndex:r?0:-1,"data-type":t,title:e.name(t),className:`min-h-16 min-w-0 justify-center gap-1.5 rounded-lg px-1.5 py-2.5`,onClick:()=>{e.onChoose(t)},children:[(0,z.jsx)(n,{"aria-hidden":!0,strokeWidth:1.5,className:T(`size-5`,r?`text-pencil`:`text-lead`)}),(0,z.jsx)(`span`,{className:`line-clamp-2 w-full text-center text-xs leading-tight text-balance break-words`,children:e.name(t)})]},t)})})}function Or(e){let t=/Mac|iPhone|iPad/u.test(navigator.userAgent),n=e.target;return e.code===`KeyE`&&(t?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.shiftKey&&!e.altKey&&!(n instanceof HTMLElement&&(n.isContentEditable||n.tagName===`INPUT`||n.tagName===`TEXTAREA`))}function kr(e){let t=$n(r());return t.gives===`nothing`?null:t.gives===`file as it is`?(0,z.jsx)(Ar,{path:t.path,hosted:!t.button}):(0,z.jsx)(jr,{...e})}function Ar({path:e,hosted:t}){let n=o(),i=X.of(r()?.locale),s=()=>{hr(n,e).catch(e=>{we.error(i.notStarted,{description:e instanceof Error?e.message:String(e)})})};a(`editor/command`,({command:e,open:t})=>{e===`export`&&t!==!1&&s()});let c=(0,R.useEffectEvent)(e=>{Or(e)&&(e.preventDefault(),s())});return(0,R.useEffect)(()=>(window.addEventListener(`keydown`,c),()=>{window.removeEventListener(`keydown`,c)}),[]),(0,R.useEffect)(()=>{t&&n[`export/state`]({at:`idle`,open:!1}).catch(()=>void 0)},[n,t]),t?null:(0,z.jsxs)(F,{"data-testid":`export`,"data-state":`idle`,"aria-label":i.download,title:i.download,onClick:s,children:[(0,z.jsx)(hn,{"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`@max-lg/item:hidden`,children:i.download})]})}function jr(e){let t=o(),n=r(),i=n?.commands===!0,s=n?.item.kind,c=n?.item.kindInfo.exports,l=n?.item.id,u=X.of(n?.locale),d=yr(),f=(0,R.useRef)(null),[p,m]=(0,R.useState)(!1),{all:h,fresh:g,reveals:_,asked:v}=br(p,u);a(`editor/command`,({command:e,open:t})=>{e===`export`&&m(e=>t??!e)}),(0,R.useEffect)(()=>{let e=e=>{Or(e)&&(e.preventDefault(),m(e=>!e))};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[]),(0,R.useEffect)(()=>{if(!p||d)return;let e=()=>{m(!1)};return window.addEventListener(`blur`,e),()=>{window.removeEventListener(`blur`,e)}},[p,d]);let y=c!==void 0,b=l===void 0?[]:nr(h,l),x=pr(b,g),S=x.at===`running`?x.percent:void 0;if((0,R.useEffect)(()=>{i&&y&&t[`export/state`]({at:x.at,...S===void 0?{}:{percent:S},open:p}).catch(()=>void 0)},[t,i,y,x.at,S,p]),s===void 0||l===void 0||c===void 0)return null;let C=x.at===`running`?`${String(x.percent)}%`:x.at===`queued`?u.queued:x.at===`done`?u.ready:x.at===`failed`?u.failed:u.download,w=(0,z.jsxs)(F,{"data-testid":`export`,"data-state":x.at,"aria-pressed":p,"aria-label":x.at===`running`?u.preparing(x.percent):C,title:C,onClick:()=>{d&&m(!0)},children:[x.at===`running`&&(0,z.jsx)(Ve,{value:x.percent/100}),x.at===`queued`&&(0,z.jsx)(Ve,{value:0}),x.at===`done`&&(0,z.jsx)(Me,{className:`text-success`,"aria-hidden":!0}),x.at===`failed`&&(0,z.jsx)(me,{className:`text-destructive`,"aria-hidden":!0}),x.at===`idle`&&(0,z.jsx)(hn,{"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`@max-lg/item:hidden`,children:C})]}),T=(0,z.jsx)(Tr,{kind:s,offer:c,item:l,props:e,jobs:b,all:h,words:u,reveals:_,onAsked:v,startRef:f});return d?(0,z.jsxs)(z.Fragment,{children:[!i&&w,(0,z.jsx)(Wn,{open:p,onOpenChange:m,children:(0,z.jsxs)(qn,{side:`bottom`,showCloseButton:!1,className:`gap-0 rounded-t-lg`,children:[(0,z.jsx)(Jn,{className:`sr-only`,children:u.download}),T]})})]}):(0,z.jsxs)(Bn,{open:p,onOpenChange:m,children:[i?(0,z.jsx)(Un,{className:`pointer-events-none fixed top-0 right-2 size-0`}):(0,z.jsx)(Vn,{asChild:!0,children:w}),(0,z.jsxs)(Hn,{align:`end`,sideOffset:i?4:8,className:`w-88 p-0`,onOpenAutoFocus:e=>{f.current&&!f.current.disabled&&(e.preventDefault(),f.current.focus())},children:[!i&&(0,z.jsx)(Rn,{}),T]})]})}function Mr({...e}){return(0,z.jsx)(dt,{"data-slot":`context-menu`,...e})}function Nr({...e}){return(0,z.jsx)(pt,{"data-slot":`context-menu-trigger`,...e})}function Pr({...e}){return(0,z.jsx)(bt,{"data-slot":`context-menu-sub`,...e})}function Fr({className:e,inset:t,children:n,...r}){return(0,z.jsxs)(xt,{"data-slot":`context-menu-sub-trigger`,"data-inset":t,className:T(`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 data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,z.jsx)(Ne,{className:`ml-auto`})]})}function Ir({className:e,...t}){return(0,z.jsx)(St,{"data-slot":`context-menu-sub-content`,className:T(`z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...t})}var Lr=R.createContext(null),Rr=4;function zr(e){let t=R.useRef(!1);return R.useEffect(()=>{let n=e?.ownerDocument??document,r=0,i=e=>{r+=Math.abs(e.movementX)+Math.abs(e.movementY),r>=Rr&&(t.current=!0,n.removeEventListener(`pointermove`,i,!0))};return n.addEventListener(`pointermove`,i,!0),()=>{n.removeEventListener(`pointermove`,i,!0)}},[e]),t}function Br(e){let t=zr(e.container);return(0,z.jsx)(Lr,{value:t,children:e.children})}function Vr(e){let t=R.useContext(Lr);return n=>{e?.(n),t&&!t.current&&n.preventDefault()}}function Hr({className:e,container:t,children:n,...r}){return(0,z.jsx)(mt,{container:t,children:(0,z.jsx)(gt,{"data-slot":`context-menu-content`,className:T(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...r,children:(0,z.jsx)(Br,{container:t,children:n})})})}function Ur({className:e,inset:t,variant:n=`default`,onPointerUp:r,...i}){let a=Vr(r);return(0,z.jsx)(_t,{onPointerUp:a,"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:T(`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 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...i})}function Wr({className:e,...t}){return(0,z.jsx)(vt,{"data-slot":`context-menu-separator`,className:T(`-mx-1 my-1 h-px bg-border`,e),...t})}function Gr({className:e,...t}){return(0,z.jsx)(`span`,{"data-slot":`context-menu-shortcut`,className:T(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}var Kr=150,qr=e=>{if(!(e.currentTarget instanceof Element))return;let t=e.currentTarget.getBoundingClientRect();return{x:t.x,y:t.y,width:t.width,height:t.height}},Jr=(e,t,n=!0)=>{let r=qr(t);setTimeout(()=>{e.begin(r,n)},Kr)};function $(){let e=o(),t=r();if(t?.notes!==!0)return;let n=X.of(t.locale);return{label:n.markUp,hint:n.markUpHint,begin:(t,n)=>{e[`note/begin`]({...t?{from:t}:{},...n===!0?{selection:n}:{}}).catch(()=>void 0)}}}function Yr(){let e=$();return e?(0,z.jsxs)(F,{title:e.hint,"data-testid":`mark-up`,className:`text-ink`,onClick:t=>{e.begin(qr(t))},children:[(0,z.jsx)(Y,{"aria-hidden":!0}),e.label]}):null}function Xr(e){let t=$();return t?(0,z.jsx)(`div`,{role:`toolbar`,"aria-label":t.label,"data-note-chrome":``,"data-testid":`mark-up-bar`,className:`border-rule bg-sheet shadow-overlay flex items-center rounded-lg border p-0.5 ${e.className??``}`,style:e.style,onPointerDown:e=>{e.stopPropagation()},children:(0,z.jsxs)(F,{title:t.hint,"data-testid":`mark-up-selected`,className:`text-ink`,onClick:e=>{t.begin(qr(e),!0)},children:[(0,z.jsx)(Y,{"aria-hidden":!0}),t.label]})}):null}function Zr({selection:e=!0}={}){let t=$();return t?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(ze,{}),(0,z.jsxs)(Fe,{title:t.hint,"data-testid":`mark-up-item`,onSelect:n=>{Jr(t,n,e)},children:[(0,z.jsx)(Y,{className:`size-3.5`,"aria-hidden":!0}),t.label]})]}):null}function Qr(){let e=$();return e?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Wr,{}),(0,z.jsxs)(Ur,{title:e.hint,"data-testid":`mark-up-item`,onSelect:t=>{Jr(e,t)},children:[(0,z.jsx)(Y,{className:`size-3.5`,"aria-hidden":!0}),e.label]})]}):null}var $r=e=>e instanceof Element&&e.closest(`input, textarea`)!==null;function ei(){let e=$(),t=e!==void 0,[n,r]=(0,R.useState)();return(0,R.useEffect)(()=>{if(!t)return;let e=e=>{e.defaultPrevented||$r(e.target)||(e.preventDefault(),r({x:e.clientX,y:e.clientY}))};return document.addEventListener(`contextmenu`,e),()=>{document.removeEventListener(`contextmenu`,e)}},[t]),!e||!n?null:(0,z.jsxs)(Re,{open:!0,onOpenChange:e=>{e||r(void 0)},children:[(0,z.jsx)(fe,{asChild:!0,children:(0,z.jsx)(`span`,{style:{position:`fixed`,left:n.x,top:n.y,width:0,height:0}})}),(0,z.jsx)(Ae,{align:`start`,className:`text-xs`,children:(0,z.jsxs)(Fe,{title:e.hint,"data-testid":`mark-up-item`,onSelect:t=>{Jr(e,t)},children:[(0,z.jsx)(Y,{className:`size-3.5`,"aria-hidden":!0}),e.label]})})]})}function ti(){let e=r();return e?.share===!0&&e.mode===`edit`&&e.item.kindInfo.share===!0}function ni(){let e=o(),t=r();if(!ti())return null;let n=X.of(t?.locale);return(0,z.jsxs)(F,{"data-testid":`share`,"aria-label":n.share,title:n.share,onClick:()=>{e[`share/begin`]({}).catch(()=>void 0)},children:[(0,z.jsx)(Mn,{"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`@max-lg/item:hidden`,children:n.share})]})}var ri=800;function ii(e){let t=e?.state===`saving`||e?.state===`unsaved`,[n,r]=(0,R.useState)(!1);return(0,R.useEffect)(()=>{if(!t)return;let e=setTimeout(()=>{r(!0)},ri);return()=>{clearTimeout(e),r(!1)}},[t]),e!==void 0&&e.state!==`saved`&&(!t||n)}function ai({saved:e,words:t}){return(0,z.jsx)(`span`,{"data-testid":`save-state`,"data-state":e.state,title:e.message,className:T(`px-1 text-xs`,e.state===`error`?`text-destructive`:`text-lead`),children:t.saved[e.state]})}function oi({start:e,saved:t,exports:n}){let a=r(),o=ti(),s=X.of(a?.locale),c=ii(t),l=i()?.doing!==void 0;if(a?.mode!==`edit`)return e?(0,z.jsx)(`div`,{className:`bg-background flex min-h-9 flex-none items-center gap-1 border-b px-1 font-sans text-sm`,"data-testid":`item-bar`,children:e}):null;if(a.commands===!0)return(0,z.jsxs)(z.Fragment,{children:[e?(0,z.jsx)(`div`,{className:`bg-background @container/item flex min-h-9 flex-none items-center gap-1 border-b px-1 font-sans text-sm`,"data-testid":`item-bar`,children:e}):null,(0,z.jsx)(Fn,{}),(0,z.jsx)(kr,{...n}),(0,z.jsx)(ei,{})]});let u=$n(a).gives!==`nothing`;return!e&&!c&&!u&&!o&&!l?(0,z.jsx)(ei,{}):(0,z.jsxs)(`div`,{className:`bg-background @container/item flex min-h-9 flex-none items-center gap-1 border-b px-1 font-sans text-sm`,"data-testid":`item-bar`,children:[e,(0,z.jsxs)(`div`,{className:`ml-auto flex flex-none items-center gap-1`,children:[(0,z.jsx)(Pn,{}),t&&c&&(0,z.jsx)(ai,{saved:t,words:s}),(0,z.jsx)(Yr,{}),(0,z.jsx)(kr,{...n}),(0,z.jsx)(ni,{})]}),(0,z.jsx)(ei,{})]})}var si=e(D(),1),ci=`group-data-[compact]/bar:hidden`,li=32,ui={compact:!1,out:[],firsts:[],order:{}},di=(0,R.createContext)(null),fi=(e,t)=>e.compact===t.compact&&e.out.join(`
3
+ `)===t.out.join(`
4
+ `)&&e.firsts.join(`
5
+ `)===t.firsts.join(`
6
+ `)&&JSON.stringify(e.order)===JSON.stringify(t.order);function pi({children:e,id:t,priority:n=0,keep:r=!1,ruled:i=!0}){let a=(0,R.useContext)(di),o=(0,R.useId)(),s=t??o,c=a?.fit.firsts.includes(s)??!1,l=a?.touch;(0,R.useLayoutEffect)(()=>(l?.(),l),[l]);let u=(0,z.jsx)(`span`,{className:T(`relative flex h-8 flex-none items-center gap-0.5`,!c&&`pl-2`,!c&&i&&`before:bg-rule before:absolute before:top-2 before:bottom-2 before:left-0.75 before:w-px`),children:e});if(!a)return u;let d=a.fit.out.includes(s);return(0,z.jsx)(`span`,{"data-group":s,"data-priority":n,"data-keep":r?``:void 0,className:d?`hidden`:`flex flex-none`,children:d?a.panel?(0,si.createPortal)((0,z.jsx)(`span`,{"data-group":s,"data-away":``,className:`flex flex-none`,style:{order:a.fit.order[s]??0},children:u}),a.panel):null:u})}function mi({testid:e,className:t,children:n,...i}){let a=r(),o=X.of(a?.locale),s=(0,R.useRef)(null),[c,l]=(0,R.useState)(null),u=(0,R.useRef)(new Map),[d,f]=(0,R.useState)(ui),[p,m]=(0,R.useState)(!1),[h,g]=(0,R.useState)(0),_=(0,R.useCallback)(()=>{g(e=>e+1)},[]),v=(0,R.useRef)(null);return(0,R.useLayoutEffect)(()=>{let e=new ResizeObserver(()=>{g(e=>e+1)});return v.current=e,s.current&&e.observe(s.current),()=>{e.disconnect(),v.current=null}},[]),(0,R.useLayoutEffect)(()=>{let e=s.current;if(!e)return;let t=[],n=new Set,r=!0;for(let i of e.querySelectorAll(`[data-group]:not([data-away]), [data-spacer]`)){if(i.dataset.spacer!==void 0){r=!0;continue}let e=i.dataset.group??``;if(t.push({key:e,priority:Number(i.dataset.priority??0),keep:i.dataset.keep!==void 0,at:t.length}),d.out.includes(e))continue;r&&n.add(e),r=!1,v.current?.observe(i);let a=i.getBoundingClientRect().width;a>0&&u.current.set(`${String(d.compact)}:${e}`,a)}for(let e of c?.querySelectorAll(`[data-away]`)??[]){let t=e.getBoundingClientRect().width;t>0&&u.current.set(`${String(d.compact)}:${e.dataset.group??``}`,t)}let i=e.clientWidth,a=(e,t)=>u.current.get(`${String(e)}:${t.key}`),o=e=>t.every(t=>a(e,t)!==void 0),l=e=>t.reduce((t,n)=>t+(a(e,n)??0),0),h=!1,g=[];if(!o(!1)||l(!1)<=i)h=!1;else if(!o(!0)||l(!0)<=i)h=!0;else{h=!0;let e=t.filter(e=>!e.keep).sort((e,t)=>e.priority-t.priority||t.at-e.at),n=new Set,r=l(!0)+li;for(let t of e){if(r<=i)break;n.add(t.key),r-=a(!0,t)??0}g=t.filter(e=>n.has(e.key)).map(e=>e.key)}let _={compact:h,out:g,firsts:[...n],order:Object.fromEntries(t.map(e=>[e.key,e.at]))};fi(_,d)||f(_),g.length===0&&p&&m(!1)},[d,p,h,c,n]),(0,z.jsx)(di.Provider,{value:{fit:d,panel:p?c:null,touch:_},children:(0,z.jsxs)(`div`,{...i,ref:s,role:i.role??`toolbar`,"data-testid":e,"data-compact":d.compact?``:void 0,className:T(`group/bar relative flex h-8 min-w-0 flex-1 items-center overflow-hidden`,t),children:[n,d.out.length>0?(0,z.jsxs)(Bn,{open:p,onOpenChange:m,children:[(0,z.jsx)(Vn,{asChild:!0,children:(0,z.jsx)(F,{icon:!0,className:`ml-auto flex-none`,"aria-label":o.moreTools,title:o.moreTools,"data-testid":`${e}-more`,onMouseDown:e=>{e.preventDefault()},children:(0,z.jsx)(gn,{})})}),(0,z.jsx)(Hn,{align:`end`,collisionPadding:8,role:`toolbar`,"aria-label":o.moreTools,"data-testid":`${e}-panel`,"data-compact":d.compact?``:void 0,onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onInteractOutside:e=>{let t=e.target;t instanceof Element&&t.closest(`[data-radix-popper-content-wrapper]`)&&e.preventDefault()},className:`group/bar w-auto max-w-[calc(100vw-1rem)] overflow-hidden p-1`,children:(0,z.jsx)(`div`,{ref:l,className:`-ml-2 flex flex-wrap items-center`})})]}):null]})})}export{Vn as C,jn as D,Nn as E,Y as O,Hn as S,In as T,Nr as _,Xr as a,Bn as b,$ as c,Ur as d,Wr as f,Fr as g,Ir as h,oi as i,Cn as k,Mr as l,Pr as m,pi as n,Qr as o,Gr as p,mi as r,Zr as s,ci as t,Hr as u,Zn as v,zn as w,Un as x,Qn as y};
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{b as t,c as n,d as r,f as i,m as a,o,s,u as c}from"./react-Byupo4pA.js";import{Dt as l,Et as u,bt as d,ht as f,n as ee,yt as p}from"./x-BAJilkKD.js";import{C as m,S as h,_ as g,s as _}from"./schemas-DlRAoVtq.js";import{F as v,j as y,o as b,x}from"./snapshots-DYooVfOx.js";import{t as S}from"./jsx-runtime-DePvh3-m.js";import{i as te,v as ne,y as C}from"./dist-6ugUm4dS.js";import{i as w,n as T,r as E,t as D}from"./hint-F4fIBnVU.js";import{n as O,r as k,t as A}from"./tablet-C6oePHEW.js";import{P as re}from"./index-D-MNVykg.js";import{t as ie}from"./updating-Cbxw83_O.js";var j=e(t(),1),M=S(),N=h({file:y}),P={width:g().int().positive().max(4096),height:g().int().positive().max(4096)},F={scroll:h({x:g().min(0),y:g().min(0)}).optional()},I=h({selector:m(),tag:m(),text:m()}),L={"html/still":v(N.extend({...P,...F,scale:g().positive().max(4).default(1),hold:m().optional()}),h({image:h({mime:m(),data:m()})}),`An HTML file's page drawn at a frame's size, where its frame's page is scrolled, as its frame shows it: what Mark up lays over the frame, which the window cannot read.`),"html/hold":v(N.extend({...P,scale:g().positive().max(4).default(1)}),h({hold:m()}),`An HTML file's page opened at a frame's size and kept as it is while a person marks it: html/still and html/at draw and read it as it was, until html/release.`),"html/release":v(h({hold:m()}),h({}),`Lets a page held for notes go.`),"html/at":v(N.extend({...P,...F,points:_(h({x:g(),y:g()})).min(1).max(24),hold:m().optional()}),h({elements:_(I)}),`What is at places of an HTML file's page drawn at a frame's size, where its frame's page is scrolled (as html/still draws it): what a person's mark on its frame is on.`),"html/pick":v(N.extend({...P,...F,x:g(),y:g(),hold:m().optional()}),h({element:I.extend({box:h({x:g(),y:g(),width:g().positive(),height:g().positive()})}).optional()}),`The one element in front at a place of an HTML file's page drawn at a frame's size, where its frame's page is scrolled (as html/still draws it), with its box: what Mark up's Select picks there.`)},R=x(L),z=p({en:{starting:`Opening the page…`,asleep:`Showing the page needs the agent awake.`,edit:`Edit`,width:`Width`,fit:`Fit the window`,tablet:`Tablet`,phone:`Phone`,wide:(e,t)=>`${e}, ${String(t)} px`},"zh-cn":{starting:`正在打开网页…`,asleep:`显示网页需要 Agent 处于唤醒状态。`,edit:`编辑`,width:`宽度`,fit:`适应窗口`,tablet:`平板`,phone:`手机`,wide:(e,t)=>`${e}, ${String(t)} px`},"zh-tw":{starting:`正在開啟網頁…`,asleep:`顯示網頁需要 Agent 處於喚醒狀態。`,edit:`編輯`,width:`寬度`,fit:`符合視窗`,tablet:`平板`,phone:`手機`,wide:(e,t)=>`${e}, ${String(t)} px`},ja:{starting:`ページを開いています…`,asleep:`ページを表示するにはエージェントの起動が必要です。`,edit:`編集`,width:`幅`,fit:`ウィンドウに合わせる`,tablet:`タブレット`,phone:`スマートフォン`,wide:(e,t)=>`${e}, ${String(t)} px`},ko:{starting:`페이지를 여는 중…`,asleep:`페이지를 표시하려면 에이전트가 깨어 있어야 합니다.`,edit:`편집`,width:`너비`,fit:`창에 맞추기`,tablet:`태블릿`,phone:`휴대폰`,wide:(e,t)=>`${e}, ${String(t)} px`},es:{starting:`Abriendo la página…`,asleep:`Para mostrar la página, el agente debe estar activo.`,edit:`Editar`,width:`Ancho`,fit:`Ajustar a la ventana`,tablet:`Tableta`,phone:`Teléfono`,wide:(e,t)=>`${e}, ${String(t)} px`},fr:{starting:`Ouverture de la page…`,asleep:`Afficher la page nécessite que l’agent soit actif.`,edit:`Modifier`,width:`Largeur`,fit:`Ajuster à la fenêtre`,tablet:`Tablette`,phone:`Téléphone`,wide:(e,t)=>`${e}, ${String(t)} px`},de:{starting:`Seite wird geöffnet…`,asleep:`Um die Seite anzuzeigen, muss der Agent wach sein.`,edit:`Bearbeiten`,width:`Breite`,fit:`An Fenster anpassen`,tablet:`Tablet`,phone:`Smartphone`,wide:(e,t)=>`${e}, ${String(t)} px`},pt:{starting:`Abrindo a página…`,asleep:`Para mostrar a página, o agente precisa estar ativo.`,edit:`Editar`,width:`Largura`,fit:`Ajustar à janela`,tablet:`Tablet`,phone:`Celular`,wide:(e,t)=>`${e}, ${String(t)} px`}}),B={tablet:768,phone:375},V={fit:k,tablet:A,phone:O};function H({className:e}){let t=n();if(t===void 0)return null;let{id:r,entry:i}=t.item;return(0,M.jsx)(W,{id:r,file:i,w:z.of(d(t.locale)),className:e},r)}function U(e){let[t,n]=(0,j.useState)({width:0,height:0});return(0,j.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(([e])=>{e&&n({width:e.contentRect.width,height:e.contentRect.height})});return r.observe(t),()=>{r.disconnect()}},[e]),t}function W({id:e,file:t,w:n,className:d}){let p=s(),m=t.slice(t.lastIndexOf(`/`)+1),[h,g]=(0,j.useState)({at:`starting`}),[_,v]=(0,j.useState)(`fit`),[y,x]=(0,j.useState)(0);c(e,()=>{x(e=>e+1)});let[S,O]=(0,j.useState)(0),k=a(),A=(0,j.useRef)(null),N=U(A),P=(0,j.useRef)(null),F=o(P),I=h.at===`asleep`?k:void 0,L=h.at===`failed`?y:void 0;(0,j.useEffect)(()=>{let t=!0;return re(p,`items/page`,{item:e}).then(({url:e})=>{t&&g({at:`ready`,url:e})},e=>{t&&g(b(e)?{at:`asleep`}:{at:`failed`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!1}},[p,e,L,I]);let z=_!==`fit`,H=z?16:0,W=_===`fit`?Math.max(1,Math.round(N.width)):B[_],G=Math.max(1,N.width-2*H),K=N.width>0?Math.min(1,G/W):1,q=Math.max(1,Math.round((N.height-H)/K));i({hold:()=>Promise.resolve({key:`html@${e}@${crypto.randomUUID()}`,what:m,source:{path:t}}),locate:()=>Promise.resolve({elements:[]})});let J=()=>{let e=P.current?.getBoundingClientRect();return e&&e.width>0&&e.height>0?{x:e.x,y:e.y,width:e.width,height:e.height}:void 0},Y=e=>({name:`the element ${e.selector} of the page ${t}`,source:{path:t},...e.text===``?{}:{text:e.text}}),X=()=>{let{y:e}=F.at();return`on the page ${t}, ${String(W)} px wide, ${e>0?`scrolled ${String(Math.round(e))} px down`:`from its top`}`},Z=(0,j.useRef)(void 0),Q=()=>Z.current??Promise.resolve(void 0),$=()=>Math.min(4,Math.max(1,window.devicePixelRatio*K));return r({element:()=>P.current,hold:()=>(Z.current=R(p,`html/hold`,{file:t,width:W,height:q,scale:$()}).then(e=>e.hold,()=>void 0),Z.current.then(()=>void 0)),release:()=>{let e=Z.current;Z.current=void 0,e?.then(e=>e===void 0?void 0:R(p,`html/release`,{hold:e}).catch(()=>void 0))},pictures:async()=>{let e=J();if(!e)return[];let n=await Q(),{image:r}=await R(p,`html/still`,{file:t,width:W,height:q,scale:$(),scroll:F.at(),...n===void 0?{}:{hold:n}});return[{...r,rect:e}]},locate:async e=>{let n=J(),r=n?u(e).map(e=>({x:(e.x-n.x)/K,y:(e.y-n.y)/K})).filter(e=>e.x>=0&&e.y>=0&&e.x<=W&&e.y<=q):[],i=await Q(),a=r.length>0?await R(p,`html/at`,{file:t,width:W,height:q,points:r,scroll:F.at(),...i===void 0?{}:{hold:i}}).catch(()=>void 0):void 0;return{elements:a&&a.elements.length>0?a.elements.map(Y):[{name:`the page ${t}`,source:{path:t}}],where:X()}},pick:async e=>{let n=J();if(!n)return;let r=(e.x-n.x)/K,i=(e.y-n.y)/K;if(r<0||i<0||r>W||i>q)return;let a=await Q(),{element:o}=await R(p,`html/pick`,{file:t,width:W,height:q,x:r,y:i,scroll:F.at(),...a===void 0?{}:{hold:a}});if(!o)return;let s=o.box,c=Math.max(0,s.x),u=Math.max(0,s.y),d=Math.min(W,s.x+s.width),f=Math.min(q,s.y+s.height);if(!(d<=c||f<=u))return{element:Y(o),outline:l({x:n.x+c*K,y:n.y+u*K,width:(d-c)*K,height:(f-u)*K}),where:X()}}}),h.at===`asleep`?(0,M.jsxs)(`div`,{className:f(`absolute inset-0 flex flex-col items-center justify-center gap-3 p-6`,d),children:[(0,M.jsx)(`p`,{className:`text-sm text-lead`,children:n.asleep}),(0,M.jsx)(ee,{size:`xs`,onClick:()=>{p[`edit/request`]({}).catch(()=>void 0)},children:n.edit})]}):(0,M.jsxs)(`div`,{className:f(`absolute inset-0 flex flex-col`,d),"data-testid":`html-viewer`,children:[(0,M.jsx)(te,{start:(0,M.jsx)(D,{children:(0,M.jsx)(ne,{type:`single`,size:`sm`,"aria-label":n.width,value:_,onValueChange:e=>{(e===`fit`||e in B)&&v(e)},children:[`fit`,`tablet`,`phone`].map(e=>{let t=V[e],r=e===`fit`?n.fit:n.wide(n[e],B[e]);return(0,M.jsxs)(E,{children:[(0,M.jsx)(T,{asChild:!0,children:(0,M.jsx)(C,{value:e,"aria-label":r,children:(0,M.jsx)(t,{className:`size-4`})})}),(0,M.jsx)(w,{children:r})]},e)})})})}),(0,M.jsxs)(`div`,{ref:A,className:`relative min-h-0 flex-1 overflow-hidden bg-stone`,children:[h.at===`ready`&&N.width>0&&(S===y?[y]:[S,y]).map(e=>{let t=e===S;return(0,M.jsx)(`iframe`,{ref:t?P:void 0,title:m,src:h.url,"data-testid":t?`html-page`:void 0,"aria-hidden":!t||void 0,tabIndex:t?void 0:-1,sandbox:`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox`,className:f(`absolute border-0 bg-page`,z&&`shadow-[0_0_0_1px_rgb(0_0_0/0.06),0_1px_3px_rgb(0_0_0/0.12)]`),onLoad:t?void 0:t=>{F.to(t.currentTarget,F.at()),setTimeout(()=>{O(t=>e>t?e:t)},250)},style:{width:W,height:q,top:H,left:Math.max(0,(N.width-W*K)/2),transform:`scale(${String(K)})`,transformOrigin:`top left`,zIndex:+!!t}},e)}),h.at===`starting`&&(0,M.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm text-lead`,children:(0,M.jsx)(`span`,{className:`motion-safe:animate-pulse`,children:n.starting})}),h.at===`failed`&&(0,M.jsx)(ie,{className:`absolute inset-0 flex items-center justify-center`})]})]})}export{H as HtmlViewer,H as default,z as WORDS};
@@ -1,4 +1,4 @@
1
- import{a as e,i as t,n,r}from"./dist-DQ6RpEJD.js";import{$ as i,A as a,B as o,C as s,D as c,E as l,F as u,G as d,K as f,M as p,O as m,Q as h,T as g,U as _,V as ee,W as v,X as y,Y as b,Z as x,_ as te,ct as ne,d as re,et as ie,f as ae,h as oe,it as se,j as ce,k as le,lt as S,nt as C,ot as ue,p as de,q as fe,rt as pe,tt as me,x as he,y as ge,z as _e}from"./dist-DA72-4WB.js";import{M as ve,S as ye,c as w,d as T,h as be,k as xe,l as Se,n as E,o as Ce,s as D,t as we}from"./dist-DIJnhQFK.js";function Te(e={}){return new D({view(t){return new Ee(t,e)}})}var Ee=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=ye(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};g.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new D({key:new w(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var De=g.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[Te(this.options)]}});g.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new D({key:new w(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return E.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(we.node(t,t+e.nodeSize,{class:this.options.className}))}),E.create(e,a)}}})]}});var Oe=g.create({name:`gapCursor`,addProseMirrorPlugins(){return[re()]},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:a(ee(e,`allowGapCursor`,t))??null}}}),ke=`placeholder`,Ae=new w(`tiptap__placeholder`);function je(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),we.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function Me(e,t){return typeof e==`function`?e(t):e}function Ne({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&h(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(je({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:Me(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function Pe({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&h(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(je({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:Me(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...Ne({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return E.create(r,o)}function O(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function k(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function Fe(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;s<n&&c>t&&r.push({from:a,to:o})}),r}function Ie(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;e<t.length;e+=1){let r=n[n.length-1],i=t[e];i.from<=r.to?r.to=Math.max(r.to,i.to):n.push({...i})}return n}function Le(e,t){let n=Fe(e,t.from,t.to);return n.push(k(e,O(e,t.from))),t.to>t.from?n.push(k(e,O(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(k(e,O(e,Math.min(t.from+1,e.content.size)))),n}function Re(e,t,n){let r=[];if(e.docChanged){let t=o(e);for(let e of t)r.push(...Le(n.doc,e.newRange))}return e.selectionSet&&(r.push(k(n.doc,O(n.doc,e.mapping.map(t.selection.anchor)))),r.push(k(n.doc,O(n.doc,n.selection.anchor)))),Ie(r)}function ze(e,t,n){let r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function Be({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:a,selection:o}){let s=e;for(let e of t){let{from:t,to:c}=ze(e.from,e.to,a),l=s.find(t,c).filter(e=>e.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=Ne({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function Ve({editor:e,options:t,dataAttribute:n}){return{init(r,i){return Pe({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??E.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:Be({decorations:i.map(r.mapping,r.doc),ranges:Re(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function He(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function Ue({editor:e,options:t}){let n=t.dataAttribute?`data-${He(t.dataAttribute)}`:`data-${ke}`,r=t.showOnlyCurrent&&!t.includeChildren;return new D({key:Ae,...r?{}:{state:Ve({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>Pe({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?E.empty:Ae.getState(n)??E.empty}})}var We=g.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:ke,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[Ue({editor:this.editor,options:this.options})]}});function Ge(e,t){return!e.selection.empty&&!i(e.selection)&&t.isEditable}function Ke(e,t){return Ge(e,t)&&!t.isFocused&&!t.view.dragging}function qe(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function Je(e){e.focus()}g.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new D({key:new w(`selection`),props:{decorations(n){return Ke(n,e)?E.create(n.doc,[we.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return Ge(t.state,e)&&qe(),!1},focus(t){return Ge(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&Je(t)}),!1}}}})]}});function Ye({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Xe=g.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new w(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new D({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!Ye({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!Ye({node:r,types:n})}}})]}}),Ze=g.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:n})=>e(t,n),redo:()=>({state:e,dispatch:n})=>t(e,n)}},addProseMirrorPlugins(){return[n(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Qe=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new ve(n,0,0);return e.replace(l,i.after(),r),e.setSelection(T.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},$e=/^\s*>\s$/,et=m.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return s(`blockquote`,{...C(this.options.HTMLAttributes,e),children:s(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
1
+ import{a as e,i as t,n,r}from"./dist-DQ6RpEJD.js";import{$ as i,A as a,B as o,C as s,D as c,E as l,F as u,G as d,K as f,M as p,O as m,Q as h,T as g,U as _,V as ee,W as v,X as y,Y as b,Z as x,_ as te,ct as ne,d as re,et as ie,f as ae,h as oe,it as se,j as ce,k as le,lt as S,nt as C,ot as ue,p as de,q as fe,rt as pe,tt as me,x as he,y as ge,z as _e}from"./dist-QLXI7XGS.js";import{M as ve,S as ye,c as w,d as T,h as be,k as xe,l as Se,n as E,o as Ce,s as D,t as we}from"./dist-DIJnhQFK.js";function Te(e={}){return new D({view(t){return new Ee(t,e)}})}var Ee=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else this.updateOverlay()}}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.appendChild(document.createElement(`div`)),this.class&&(this.element.className=this.class),this.element.style.cssText=`position: absolute; z-index: 50; pointer-events: none;`,this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle(`prosemirror-dropcursor-block`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(!t||i)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=ye(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};g.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new D({key:new w(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var De=g.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[Te(this.options)]}});g.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new D({key:new w(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return E.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(we.node(t,t+e.nodeSize,{class:this.options.className}))}),E.create(e,a)}}})]}});var Oe=g.create({name:`gapCursor`,addProseMirrorPlugins(){return[re()]},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:a(ee(e,`allowGapCursor`,t))??null}}}),ke=`placeholder`,Ae=new w(`tiptap__placeholder`);function je(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),we.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function Me(e,t){return typeof e==`function`?e(t):e}function Ne({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&h(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(je({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:Me(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function Pe({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&h(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(je({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:Me(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...Ne({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return E.create(r,o)}function O(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function k(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function Fe(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;s<n&&c>t&&r.push({from:a,to:o})}),r}function Ie(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;e<t.length;e+=1){let r=n[n.length-1],i=t[e];i.from<=r.to?r.to=Math.max(r.to,i.to):n.push({...i})}return n}function Le(e,t){let n=Fe(e,t.from,t.to);return n.push(k(e,O(e,t.from))),t.to>t.from?n.push(k(e,O(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(k(e,O(e,Math.min(t.from+1,e.content.size)))),n}function Re(e,t,n){let r=[];if(e.docChanged){let t=o(e);for(let e of t)r.push(...Le(n.doc,e.newRange))}return e.selectionSet&&(r.push(k(n.doc,O(n.doc,e.mapping.map(t.selection.anchor)))),r.push(k(n.doc,O(n.doc,n.selection.anchor)))),Ie(r)}function ze(e,t,n){let r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function Be({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:a,selection:o}){let s=e;for(let e of t){let{from:t,to:c}=ze(e.from,e.to,a),l=s.find(t,c).filter(e=>e.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=Ne({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function Ve({editor:e,options:t,dataAttribute:n}){return{init(r,i){return Pe({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??E.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:Be({decorations:i.map(r.mapping,r.doc),ranges:Re(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function He(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function Ue({editor:e,options:t}){let n=t.dataAttribute?`data-${He(t.dataAttribute)}`:`data-${ke}`,r=t.showOnlyCurrent&&!t.includeChildren;return new D({key:Ae,...r?{}:{state:Ve({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>Pe({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?E.empty:Ae.getState(n)??E.empty}})}var We=g.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:ke,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[Ue({editor:this.editor,options:this.options})]}});function Ge(e,t){return!e.selection.empty&&!i(e.selection)&&t.isEditable}function Ke(e,t){return Ge(e,t)&&!t.isFocused&&!t.view.dragging}function qe(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function Je(e){e.focus()}g.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new D({key:new w(`selection`),props:{decorations(n){return Ke(n,e)?E.create(n.doc,[we.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return Ge(t.state,e)&&qe(),!1},focus(t){return Ge(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&Je(t)}),!1}}}})]}});function Ye({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Xe=g.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new w(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new D({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!Ye({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!Ye({node:r,types:n})}}})]}}),Ze=g.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:n})=>e(t,n),redo:()=>({state:e,dispatch:n})=>t(e,n)}},addProseMirrorPlugins(){return[n(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Qe=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new ve(n,0,0);return e.replace(l,i.after(),r),e.setSelection(T.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},$e=/^\s*>\s$/,et=m.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return s(`blockquote`,{...C(this.options.HTMLAttributes,e),children:s(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
2
2
  `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
3
3
  `))}),n.join(`
4
4
  >
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{b as t,c as n,d as r,f as i,s as a,y as o}from"./react-Byupo4pA.js";import{Dt as s,Ot as c,ht as l,kt as u,yt as d}from"./x-BAJilkKD.js";import{t as f}from"./jsx-runtime-DePvh3-m.js";import{i as p}from"./dist-6ugUm4dS.js";import{t as m}from"./audio-lines-BFoW_IeO.js";import{f as h}from"./index-D-MNVykg.js";import{n as g,r as _,t as v}from"./updating-Cbxw83_O.js";import{t as y}from"./surface-BUoi7cmR.js";var b=e(t(),1),x=f(),S={png:`picture`,jpg:`picture`,jpeg:`picture`,gif:`picture`,webp:`picture`,avif:`picture`,bmp:`picture`,ico:`picture`,svg:`picture`,mp4:`video`,m4v:`video`,mov:`video`,webm:`video`,mp3:`sound`,wav:`sound`,m4a:`sound`,aac:`sound`,ogg:`sound`,oga:`sound`,opus:`sound`,flac:`sound`,pdf:`pdf`},C=Object.keys(S);function w(e){let t=e.slice(e.lastIndexOf(`/`)+1),n=t.lastIndexOf(`.`);return n<=0?void 0:S[t.slice(n+1).toLowerCase()]}var T=d({en:{loading:`Opening the file…`,page:(e,t)=>`Page ${String(e)} of ${String(t)}`},"zh-cn":{loading:`正在打开文件…`,page:(e,t)=>`第 ${String(e)} 页,共 ${String(t)} 页`},"zh-tw":{loading:`正在開啟檔案…`,page:(e,t)=>`第 ${String(e)} 頁,共 ${String(t)} 頁`},ja:{loading:`ファイルを開いています…`,page:(e,t)=>`${String(t)} ページ中 ${String(e)} ページ`},ko:{loading:`파일을 여는 중…`,page:(e,t)=>`${String(t)}페이지 중 ${String(e)}페이지`},es:{loading:`Abriendo el archivo…`,page:(e,t)=>`Página ${String(e)} de ${String(t)}`},fr:{loading:`Ouverture du fichier…`,page:(e,t)=>`Page ${String(e)} sur ${String(t)}`},de:{loading:`Datei wird geöffnet …`,page:(e,t)=>`Seite ${String(e)} von ${String(t)}`},pt:{loading:`Abrindo o arquivo…`,page:(e,t)=>`Página ${String(e)} de ${String(t)}`}}),E=300,D=1200,O=16;async function k(e){let[t,n]=await Promise.all([h(()=>import(`./pdf-BHx8b9rl.js`),[],import.meta.url),h(()=>import(`./pdf.worker.min-DI4FfYVf.js`),[],import.meta.url)]);t.GlobalWorkerOptions.workerSrc=n.default;let r=t.getDocument({url:e});return{pdf:await r.promise,close:()=>r.destroy()}}var A=e=>{let t=e.getBoundingClientRect();return{x:t.x,y:t.y,width:t.width,height:t.height}};function j({pdf:e,number:t,width:n,drawing:r}){let i=(0,b.useRef)(null),[a,o]=(0,b.useState)(),[s,c]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{let r=!0;return e.getPage(t).then(e=>{if(!r)return;let t=e.getViewport({scale:1});o({width:n,height:n*t.height/t.width})}),()=>{r=!1}},[e,t,n]),(0,b.useEffect)(()=>{let e=i.current;if(!e||s)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&c(!0)},{rootMargin:`800px 0px`});return t.observe(e),()=>{t.disconnect()}},[s,a]),(0,b.useEffect)(()=>{let n=i.current;if(!n||!s||!a)return;let o;return r((async()=>{let r=await e.getPage(t),i=window.devicePixelRatio||1,s=r.getViewport({scale:1}),c=r.getViewport({scale:a.width/s.width*i});n.width=Math.round(c.width),n.height=Math.round(c.height);let l=r.render({canvas:n,viewport:c});o=l,await l.promise.catch(()=>void 0)})()),()=>{o?.cancel()}},[e,t,s,a,r]),(0,x.jsx)(`canvas`,{ref:i,"data-page":t,"data-testid":`media-viewer-pdf-page`,className:`border-rule border bg-white`,style:{width:a?.width??n,height:a?.height??n*1.3}})}function M({path:e,url:t,version:r}){let a=T.of(n()?.locale),o=(0,b.useRef)(null),[c,d]=(0,b.useState)(),[f,p]=(0,b.useState)(),[m,h]=(0,b.useState)(0),g=(0,b.useRef)(new Set),_=(0,b.useCallback)(e=>{g.current.add(e),e.finally(()=>g.current.delete(e))},[]);(0,b.useEffect)(()=>{let e=!0,n;return k(t).then(t=>{e?(n=t.close,d(t.pdf)):t.close()},t=>{e&&p(t instanceof Error?t.message:String(t))}),()=>{e=!1,n?.()}},[t]),(0,b.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(()=>{h(Math.max(0,Math.min(e.clientWidth-32,960)))});return t.observe(e),()=>{t.disconnect()}},[]);let y=()=>[...o.current?.querySelectorAll(`canvas[data-page]`)??[]],S=e=>`page ${e.dataset.page??`?`}`;i({hold:async()=>(await Promise.all([...g.current]),{key:`${e}@${String(r)}`,what:`The PDF ${e}`,source:{path:e}}),locate:t=>{let n=y().filter(e=>u(t,A(e)));return Promise.resolve({elements:n.map(t=>({name:`${S(t)} of the PDF ${e}`,source:{path:e}})),...n.length===0?{}:{where:`on ${n.map(S).join(`, `)}`}})},pick:t=>{let n=y().find(e=>{let n=A(e);return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height});return Promise.resolve(n&&{element:{name:`${S(n)} of the PDF ${e}`,source:{path:e}},outline:s(A(n)),where:`on ${S(n)}`})}});let C=Math.min(c?.numPages??0,E),[w,M]=(0,b.useState)(),N=(0,b.useRef)(void 0);return(0,b.useEffect)(()=>()=>{clearTimeout(N.current)},[]),(0,x.jsxs)(`div`,{ref:o,onScroll:()=>{let e=o.current;if(!e)return;let t=e.getBoundingClientRect().top+e.clientHeight/2,n=1;for(let e of y())e.getBoundingClientRect().top<=t&&(n=Number(e.dataset.page));M({at:n,live:!0}),clearTimeout(N.current),N.current=setTimeout(()=>{M(e=>e&&{...e,live:!1})},D)},className:`size-full overflow-auto`,"data-testid":`media-viewer-pdf`,"data-state":f===void 0?c?`open`:`loading`:`updating`,children:[f===void 0?!c&&(0,x.jsx)(`p`,{className:`text-lead p-6 text-center text-sm`,children:a.loading}):(0,x.jsx)(v,{}),(0,x.jsx)(`div`,{className:`flex flex-col items-center`,style:{gap:O,padding:O},children:c&&m>0&&Array.from({length:C},(e,t)=>(0,x.jsx)(j,{pdf:c,number:t+1,width:m,drawing:_},t))}),w&&C>1&&(0,x.jsx)(`p`,{className:l(`bg-background text-lead shadow-overlay pointer-events-none absolute bottom-4 left-1/2 -translate-x-1/2 rounded-md px-2.5 py-1 text-xs tabular-nums motion-safe:transition-opacity`,w.live?`opacity-100`:`opacity-0`),"data-testid":`media-viewer-pdf-page-number`,"aria-live":`polite`,children:a.page(w.at,C)})]})}function N(e){let t=a(),[n,r]=(0,b.useState)(0),[i,o]=(0,b.useState)({});return(0,b.useEffect)(()=>{let n=!0,i,a=t.on(`files/changed`,t=>{t.watch===i&&t.changes.some(t=>t.path===e)&&r(e=>e+1)});return t[`files/watch`]({paths:[e]}).then(e=>{n?i=e.watch:t[`files/unwatch`]({watch:e.watch}).catch(()=>void 0)},()=>void 0),()=>{n=!1,a(),i!==void 0&&t[`files/unwatch`]({watch:i}).catch(()=>void 0)}},[t,e]),(0,b.useEffect)(()=>{let r=!0;return t[`files/url`]({path:e}).then(({url:e})=>{if(!r)return;let t=new URL(e,location.href);n>0&&t.searchParams.set(`v`,String(n)),o({url:t.href})},e=>{r&&o({failed:e instanceof Error?e.message:String(e)})}),()=>{r=!1}},[t,e,n]),{url:i.url,version:n,failed:i.failed}}function P(e,t){let n=e.getBoundingClientRect();if(t.width<=0||t.height<=0||n.width<=0)return;let r=Math.min(n.width/t.width,n.height/t.height),i=t.width*r,a=t.height*r;return{x:n.x+(n.width-i)/2,y:n.y+(n.height-a)/2,width:i,height:a}}var F=(e,t)=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height;function I({path:e,url:t,version:n}){let r=(0,b.useRef)(null),[a,o]=(0,b.useState)(!1),d=()=>{let e=r.current;if(!e?.complete)return;let t={width:e.naturalWidth,height:e.naturalHeight},n=P(e,t);return n&&{box:n,...t}},f=()=>({name:`the picture ${e}`,source:{path:e}});return i({hold:()=>Promise.resolve({key:`${e}@${String(n)}`,what:`The picture ${e}`,source:{path:e}}),locate:t=>{let n=d();if(!n||!u(t,n.box))return Promise.resolve({elements:[]});let r=n.width/n.box.width,i=e=>({x:(e.x-n.box.x)*r,y:(e.y-n.box.y)*r});return Promise.resolve({elements:[{...f(),regions:[{in:`the picture`,file:e,width:n.width,height:n.height,...c(t,i),scale:r}]}]})},pick:e=>{let t=d();return Promise.resolve(t&&F(e,t.box)?{element:f(),outline:s(t.box)}:void 0)}}),(0,x.jsx)(`div`,{className:l(`size-full`,a?`overflow-auto`:`flex items-center justify-center p-6`),onDoubleClick:()=>{o(e=>!e)},"data-testid":`media-viewer-stage`,"data-size":a?`actual`:`fit`,children:(0,x.jsx)(`img`,{ref:r,src:t,alt:``,draggable:!1,className:l(`select-none`,a?`m-auto block max-w-none p-6`:`size-full object-contain`),"data-testid":`media-viewer-picture`})})}function L({path:e,url:t,version:n}){let a=(0,b.useRef)(null),s=(0,b.useRef)(!1),c=()=>(a.current?.currentTime??0).toFixed(2);return i({hold:()=>Promise.resolve({key:`${e}@${String(n)}`,what:`The video ${e}`,source:{path:e}}),locate:()=>Promise.resolve({elements:[]})}),r({element:()=>a.current,hold:()=>{let e=a.current;return s.current=e!==null&&!e.paused,e?.pause(),Promise.resolve()},release:()=>{s.current&&a.current?.play().catch(()=>void 0),s.current=!1},pictures:()=>{let e=a.current,t=e?o(e):void 0;return Promise.resolve(t?[t]:[])},locate:()=>Promise.resolve({elements:[{name:`the video ${e}`,source:{path:e}}],where:`on the video ${e} at ${c()} s`})}),(0,x.jsx)(`video`,{ref:a,src:t,controls:!0,playsInline:!0,preload:`metadata`,className:`size-full object-contain`,"data-testid":`media-viewer-video`})}function R({path:e,url:t,version:n}){let r=(0,b.useRef)(null),a=(0,b.useRef)(!1);return i({hold:()=>{let t=r.current;return a.current=t!==null&&!t.paused,t?.pause(),Promise.resolve({key:`${e}@${String(n)}`,what:`The sound ${e}`,source:{path:e}})},locate:()=>Promise.resolve({elements:[{name:`the sound ${e}`,source:{path:e}}],where:`at ${(r.current?.currentTime??0).toFixed(2)} s`}),release:()=>{a.current&&r.current?.play().catch(()=>void 0),a.current=!1}}),(0,x.jsxs)(y,{className:`flex w-full max-w-sm flex-col items-center gap-2 p-5 text-center`,children:[(0,x.jsx)(m,{className:`text-lead-soft size-5`,strokeWidth:1.5,"aria-hidden":!0}),(0,x.jsx)(`p`,{className:`text-ink font-serif text-sm font-semibold`,children:e.slice(e.lastIndexOf(`/`)+1)}),(0,x.jsx)(`audio`,{ref:r,src:t,controls:!0,preload:`metadata`,className:`mt-1 w-full`,"data-testid":`media-viewer-sound`})]})}var z={picture:I,video:L,sound:R,pdf:M};function B(){let e=n()?.item.entry??``,t=w(e),{url:r,version:i,failed:a}=N(e),{shown:o}=_(a===void 0?r:void 0),s=t===void 0?void 0:z[t];return(0,x.jsxs)(`div`,{className:`flex size-full flex-col`,"data-testid":`media-viewer`,children:[(0,x.jsx)(p,{}),(0,x.jsx)(`div`,{className:l(`bg-stone relative min-h-0 flex-1`,(t===`video`||t===`sound`)&&`flex items-center justify-center p-6`),children:o!==void 0&&s?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s,{path:e,url:o,version:i},o),a===void 0?null:(0,x.jsx)(g,{})]}):a===void 0?null:(0,x.jsx)(v,{})})]})}export{C as MEDIA_EXTENSIONS,B as MediaViewer,B as default,T as WORDS,w as mediaOf};
@@ -0,0 +1,3 @@
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{a as t,b as n,c as r,f as i,m as a,s as o}from"./react-Byupo4pA.js";import{ht as s,kt as c,n as l,t as u}from"./x-BAJilkKD.js";import{C as d,D as f,S as p,a as m,l as h,s as g}from"./schemas-DlRAoVtq.js";import{t as _}from"./session--OJYv_B7.js";import{t as ee}from"./jsx-runtime-DePvh3-m.js";import{A as te,C as ne,D as re,_ as ie,f as ae,g as oe,u as se}from"./bar-button-CJmpgNg4.js";import{C as v,E as ce,S as le,b as y,i as ue}from"./dist-6ugUm4dS.js";import{t as b}from"./createLucideIcon-euu7Wcd9.js";import{t as de}from"./chart-no-axes-column-Dyy25XZ_.js";import{a as x,d as S,i as fe,l as pe,n as me,o as he,r as ge,s as _e,t as ve,u as C}from"./panes-BShVq38A.js";import{t as ye}from"./link-CFOv3nz-.js";import{n as be,t as xe}from"./undo-2-DCbMWoug.js";import{b as Se,h as w}from"./index-D-MNVykg.js";import{n as Ce,r as we,t as T}from"./updating-Cbxw83_O.js";import{t as E}from"./collaborator-CbTacvkB.js";import{c as D,d as O,i as k,n as A,p as j,s as M}from"./browser-DEGNhKTV.js";import{_ as N,a as Te,b as Ee,c as De,f as Oe,g as P,h as F,i as ke,m as Ae,n as I,o as L,p as je,t as R,u as Me,v as z,y as B}from"./words-DgMuEmDO.js";var Ne=b(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),V=d().min(1),H=p({file:V,title:d().optional(),altText:d().optional()},{error:e=>e.code===`invalid_type`?`content.media is { file: ./demo.mp4, title: …, altText: … }`:void 0}),Pe=p({file:V,altText:d().optional()},{error:e=>e.code===`invalid_type`?`a picture of multiImage is { file: ./a.png, altText: … }`:void 0}),Fe=p({images:g(Pe)},{error:e=>e.code===`invalid_type`?`content.multiImage is { images: [ { file: ./a.png }, … ] }`:void 0}),Ie=p({question:d(),options:g(p({text:d()},{error:`a poll's option is { text: … }`})),settings:p({duration:m(N).optional()}).optional()},{error:e=>e.code===`invalid_type`?`content.poll is { question: …, options: [ { text: … }, … ], settings: { duration: SEVEN_DAYS } }`:void 0}),U=p({source:f({error:`an article's source is a web address`}),title:d().optional(),description:d().optional(),thumbnail:V.optional()},{error:e=>e.code===`invalid_type`?`content.article is { source: https://…, title: …, description: …, thumbnail: ./card.png }`:void 0}),W=p({media:H.optional(),multiImage:Fe.optional(),poll:Ie.optional(),article:U.optional()},{error:e=>e.code===`invalid_type`?`content is one of media, multiImage, poll or article`:void 0}).superRefine((e,t)=>{let n=Object.keys(e).filter(t=>e[t]!==void 0);n.length>1&&t.addIssue({code:`custom`,message:`content holds one kind, and holds ${n.join(` and `)}: a post is pictures, a video, a document, a poll or a link, never two`})}),Le=p({commentary:d().default(``).transform(e=>e.replace(/\n+$/u,``)),visibility:m(Ee).optional(),content:W.optional(),isReshareDisabledByAuthor:h().optional()},{error:e=>e.code===`invalid_type`?`a linkedin-post's file is { commentary: …, content: … }, with visibility beside them`:void 0});function G(e,t){let n=e;for(let e of t)if(O(n)){let t=n.items.find(t=>t.key?.value===e);if(!t)return n;n=t.value??t.key}else if(j(n)&&typeof e==`number`){let t=n.items[e];if(!t)return n;n=t}else return n;return n}function K(e){let t=new k,n=A(e,{lineCounter:t,prettyErrors:!1}),r=e=>{let r=G(n.contents,e)?.range?.[0];return r===void 0?void 0:t.linePos(r).line};if(n.errors.length>0)return{errors:n.errors.map(e=>({path:[],message:e.message})),line:e=>e.length===0&&n.errors[0]?.linePos?.[0]?n.errors[0].linePos[0].line:r(e)};let i=Le.safeParse(n.toJS()??{});return i.success?{value:i.data,errors:[],line:r}:{errors:i.error.issues.map(e=>({path:e.path.filter(e=>typeof e==`string`||typeof e==`number`),message:e.message})),line:r}}function Re(e){let t=e.content;return t===void 0?[]:t.media?[{file:t.media.file,path:[`content`,`media`,`file`],role:`media`,altText:t.media.altText}]:t.multiImage?t.multiImage.images.map((e,t)=>({file:e.file,path:[`content`,`multiImage`,`images`,t,`file`],role:`picture`,altText:e.altText})):t.article?.thumbnail===void 0?[]:[{file:t.article.thumbnail,path:[`content`,`article`,`thumbnail`],role:`thumbnail`}]}function ze(e){let t=e.toLowerCase();for(let e of[`picture`,`video`,`document`])if(B[e].includes(t))return e}var Be=[`commentary`,`visibility`,`content`],Ve=e=>JSON.stringify(e,(e,t)=>typeof t==`object`&&t&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e<t?-1:+(e>t))):t),q=(e,t)=>Ve(e)===Ve(t);function He(e,t){let n=e.createNode(t);return t.includes(`
2
+ `)&&(n.type=D.BLOCK_LITERAL),n}function Ue(e,t){let n=K(e).value;if(n!==void 0&&q(n,t))return e;let r=A(e);O(r.contents)||(r.contents=new M);let i=r.contents;for(let e of Be){let n=t[e],a=i.get(e,!0);if(n===void 0||e===`commentary`&&n===``)a!==void 0&&i.delete(e);else if(e===`commentary`){let t=i.get(e);(typeof t!=`string`||t.replace(/\n+$/u,``)!==n)&&i.set(e,He(r,n))}else q(a?.toJSON?.(),n)||i.set(e,r.createNode(n))}if(i.items.length>1){let e=i.items.findIndex(e=>e.key?.value===`commentary`);if(e>0){let[t]=i.items.splice(e,1);t&&i.items.unshift(t)}}return r.toString({flowCollectionPadding:!1,lineWidth:0})}function We(e,t,n){let r=r=>q(t[r],e[r])?n[r]:t[r],i=r(`visibility`),a=r(`content`);return{...n.isReshareDisabledByAuthor===void 0?{}:{isReshareDisabledByAuthor:n.isReshareDisabledByAuthor},commentary:r(`commentary`),...i===void 0?{}:{visibility:i},...a===void 0?{}:{content:a}}}var J=e(n(),1),Y=ee(),Ge=(e,t)=>JSON.stringify(e)===JSON.stringify(t),Ke=class e{session;file;unreadable=!1;landed;snapshot;listeners=new Set;amending;stops=[];constructor(e){this.session=e,this.read(e.text),this.snapshot=this.make(),e.attach({save:e=>{if(this.file===void 0||this.unreadable)return;let t=Ue(e,this.file);return t===e?void 0:t},take:(e,t,n)=>{let r=K(e),i=K(t).value;n?.kind===`agent`&&r.value&&!Ge(i,r.value)&&(this.landed=Date.now()),r.value?(this.file=this.file===void 0||i===void 0?r.value:We(i,this.file,r.value),this.unreadable=!1):(this.file=void 0,this.unreadable=!0),this.emit()}}),this.stops.push(e.onState(()=>{this.emit()}),e.onUndo(()=>{this.emit()}))}read(e){let t=K(e);this.file=t.value,this.unreadable=t.value===void 0}static async open(t,n){return new e(await _.open(t,n))}make(){return{file:this.file,state:this.session.state,canUndo:this.session.canUndo,canRedo:this.session.canRedo,unreadable:this.unreadable,landed:this.landed}}emit(){this.snapshot=this.make();for(let e of this.listeners)e()}get text(){return this.session.text}get(){return this.snapshot}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}edit(e,t,n){let r=this.file;if(r===void 0||this.unreadable)return;let i=t(r);if(i!==r){if(n!==void 0&&this.amending?.key===n&&this.session.canUndo){let e=this.amending.from;this.session.undo(),this.push(this.amending.label,e,i)}else this.amending=n===void 0?void 0:{key:n,from:r,label:e},this.push(e,r,i)}}settle(){this.amending=void 0}push(e,t,n){this.file=n,this.session.pushEdit({label:e,undo:()=>{this.file=t,this.emit()},redo:()=>{this.file=n,this.emit()}}),this.emit()}undo(){this.amending=void 0,this.session.undo()}redo(){this.amending=void 0,this.session.redo()}async close(){for(let e of this.stops.splice(0))e();await this.session.close()}},qe=3e4;function X(e,t){let n={...e};return t===void 0?delete n.content:n.content=t,n}function Z(e){return x(e)?e.includes(`#`)?`picture`:void 0:ze(e.split(`.`).pop()??``)}function Je(e,t){if(Z(t)===`picture`){if(e?.multiImage)return{multiImage:{images:[...e.multiImage.images,{file:t}]}};if(e?.media&&Z(e.media.file)===`picture`)return{multiImage:{images:[{file:e.media.file,...e.media.altText===void 0?{}:{altText:e.media.altText}},{file:t}]}}}return{media:{file:t}}}function Ye({text:e}){let t=R(),{left:n}=P(e);return n>100?null:(0,Y.jsx)(`span`,{className:s(`text-sm tabular-nums`,n<0?`text-destructive font-semibold`:`text-muted-foreground`),"aria-label":n>=0?t.left(n):t.over(-n),"data-testid":`linkedin-count`,children:n})}function Q(e){return(0,Y.jsx)(l,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,title:e.label,disabled:e.disabled,onClick:e.onClick,children:e.children})}function Xe(e){let t=R();return(0,Y.jsxs)(`div`,{className:`absolute top-2 right-2 flex gap-1`,children:[e.alt===void 0?null:(0,Y.jsx)(C,{alt:e.alt.value??``,onAlt:e.alt.onAlt,most:z.alt,trigger:(0,Y.jsx)(l,{variant:`secondary`,size:`xs`,className:`bg-media/75 text-on-media font-bold`,children:t.alt})}),(0,Y.jsx)(l,{variant:`secondary`,size:`icon-sm`,className:`bg-media/75 text-on-media rounded-full`,"aria-label":t.remove,title:t.remove,onClick:e.onRemove,children:(0,Y.jsx)(u,{})})]})}function Ze(e){let t=R(),n=`aria-invalid:border-destructive h-10 w-full rounded-md border border-[var(--ak-li-border)] bg-transparent px-3 text-sm outline-none focus:border-[var(--ak-li-link)]`,r=F(e.poll.question)-z.poll.question;return(0,Y.jsxs)(`div`,{className:`mx-3 flex flex-col gap-2 rounded-lg border border-[var(--ak-li-border)] p-3`,"data-testid":`linkedin-poll`,children:[(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-[var(--ak-li-muted)]`,children:[t.question,(0,Y.jsx)(`input`,{className:n,value:e.poll.question,readOnly:e.locked,"aria-invalid":r>0||void 0,maxLength:z.poll.question,onChange:t=>{e.onChange({...e.poll,question:t.target.value},`question`)}})]}),e.poll.options.map((r,i)=>{let a=F(r.text)-z.poll.option;return(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-[var(--ak-li-muted)]`,children:[t.option(i+1),(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(`input`,{className:n,value:r.text,readOnly:e.locked,"aria-invalid":a>0||void 0,maxLength:z.poll.option,onChange:t=>{e.onChange({...e.poll,options:e.poll.options.map((e,n)=>n===i?{text:t.target.value}:e)},`option-${String(i)}`)}}),a>0?(0,Y.jsx)(`span`,{className:`text-destructive text-xs`,children:t.over(a)}):null,!e.locked&&e.poll.options.length>z.poll.least?(0,Y.jsx)(l,{variant:`ghost`,size:`icon-sm`,"aria-label":t.removeOption,title:t.removeOption,onClick:()=>{e.onChange({...e.poll,options:e.poll.options.filter((e,t)=>t!==i)})},children:(0,Y.jsx)(u,{})}):null]})]},i)}),!e.locked&&e.poll.options.length<z.poll.most?(0,Y.jsxs)(l,{variant:`outline`,size:`sm`,className:`self-start rounded-full`,onClick:()=>{e.onChange({...e.poll,options:[...e.poll.options,{text:``}]})},children:[(0,Y.jsx)(w,{}),t.addOption]}):null,(0,Y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-[var(--ak-li-border)] pt-2 text-sm`,children:[(0,Y.jsxs)(`label`,{className:`mr-auto flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[var(--ak-li-muted)]`,children:t.duration}),(0,Y.jsx)(`select`,{className:`h-8 rounded-md border border-[var(--ak-li-border)] bg-transparent px-2`,value:e.poll.settings?.duration??`SEVEN_DAYS`,disabled:e.locked,onChange:t=>{e.onChange({...e.poll,settings:{duration:t.target.value}})},children:N.map(e=>(0,Y.jsx)(`option`,{value:e,children:t.durations[e]},e))})]}),e.locked?null:(0,Y.jsx)(l,{variant:`ghost`,size:`sm`,className:`text-destructive`,onClick:e.onRemove,children:t.removePoll})]})]})}function Qe(e){let t=R(),n=(t,n)=>(0,Y.jsxs)(`label`,{className:`flex flex-col gap-1 text-xs text-[var(--ak-li-muted)]`,children:[n,(0,Y.jsx)(`input`,{className:`h-9 w-full rounded-md border border-[var(--ak-li-border)] bg-transparent px-3 text-sm text-[var(--ak-li-fg)] outline-none focus:border-[var(--ak-li-link)]`,value:e.article[t]??``,readOnly:e.locked,onChange:n=>{let r=n.target.value,{title:i,description:a,...o}={...e.article,[t]:r};e.onChange({...o,...i===void 0||i===``?{}:{title:i},...a===void 0||a===``?{}:{description:a}},t)}})]});return(0,Y.jsxs)(`div`,{className:`mx-3 mb-2 flex flex-col gap-2 rounded-lg border border-[var(--ak-li-border)] p-3`,"data-testid":`linkedin-link`,children:[n(`source`,t.link.source),n(`title`,t.link.title),n(`description`,t.link.description)]})}function $e({doc:e,dir:n,entry:o}){let s=R(),u=r(),d=a(),[f,p]=ge(),m=(0,J.useSyncExternalStore)(t=>e.subscribe(t),()=>e.get()),[h,g]=(0,J.useState)(),[_,ee]=(0,J.useState)(!1),{shown:b,updating:C}=we(m.file),w=d||C,{agent:D,following:O}=t(),k=ce(),A=D?.doing!==void 0&&(D.source?.path===o||m.landed!==void 0&&m.landed>=D.at-qe),j=(0,J.useRef)(null),M=(0,J.useRef)(null);(0,J.useEffect)(()=>{O&&A&&(j.current?.scrollIntoView({block:`nearest`}),M.current?.scrollIntoView({block:`nearest`}))},[O,A,m.landed]);let N=he(n,b?Re(b).map(e=>e.file):[]);i({hold:()=>Promise.resolve({key:`${o}@${String(e.text.length)}`,what:`The LinkedIn post ${o}`,source:{path:o}}),locate:e=>{let t=e=>{let t=e?.getBoundingClientRect();return t&&t.width>0&&t.height>0?{x:t.x,y:t.y,width:t.width,height:t.height}:void 0},n=t(j.current),r=t(M.current),i=n!==void 0&&c(e,n),a=r!==void 0&&c(e,r);if(!i&&!a)return Promise.resolve({elements:[]});let s=new Map;for(let n of[j.current,M.current])n?.querySelectorAll(`.ak-li-content img`).forEach((n,r)=>{let i=t(n);i!==void 0&&c(e,i)&&s.set(r,n.alt)});return Promise.resolve({elements:[{name:`the post`,source:{path:o},...b?.commentary?{text:b.commentary}:{}},...[...s].map(([e,t])=>({name:`picture ${String(e+1)} of the post`,source:{path:o},...t===``?{}:{text:t}}))],where:i?`where the post is written`:`as LinkedIn's feed will show it`})}});let Ee=t=>{(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`z`&&(t.preventDefault(),t.shiftKey?e.redo():e.undo())},P=(t,n,r)=>{w||e.edit(t,n,r)},F=(0,Y.jsx)(ue,{start:(0,Y.jsxs)(Y.Fragment,{children:[w||f!==`edit`?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Q,{label:s.undo,disabled:!m.canUndo,onClick:()=>{e.undo()},children:(0,Y.jsx)(xe,{})}),(0,Y.jsx)(Q,{label:s.redo,disabled:!m.canRedo,onClick:()=>{e.redo()},children:(0,Y.jsx)(be,{})})]}),(0,Y.jsx)(`span`,{className:`flex-1`}),(0,Y.jsx)(ve,{pane:f,onPane:p})]}),saved:{state:m.state},exports:{}}),I=u?.theme===`dark`;if(b===void 0)return(0,Y.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`linkedin-post-editor`,children:[F,(0,Y.jsx)(T,{className:`flex min-h-0 flex-1 items-center justify-center`})]});let B=b.content,V=(e,t)=>{let n=N.get(e),r=Z(e);return r===`document`?{kind:`document`,file:e,label:e.split(`/`).pop()}:n===void 0?{kind:`made`,label:x(e)?`${e} · ${s.made}`:e,file:e}:{kind:r??`picture`,src:n,alt:t,file:e}},H=B?.media?{type:`media`,medium:V(B.media.file,B.media.altText),title:B.media.title}:B?.multiImage?{type:`multiImage`,images:B.multiImage.images.map(e=>V(e.file,e.altText))}:B?.poll?{type:`poll`,question:B.poll.question,options:B.poll.options.map(e=>e.text),duration:B.poll.settings?.duration}:B?.article?{type:`article`,source:B.article.source,title:B.article.title,description:B.article.description,thumbnail:B.article.thumbnail===void 0?void 0:V(B.article.thumbnail)}:void 0,Pe=e=>{P(s.steps.media,t=>{let n=t.content;if(n?.multiImage){let r=n.multiImage.images.filter((t,n)=>n!==e),[i]=r;return X(t,r.length>1?{multiImage:{images:r}}:i?{media:i}:void 0)}if(n?.article){let e={...n.article};return delete e.thumbnail,X(t,{article:e})}return X(t,void 0)})},Fe=e=>{let t=(B?.multiImage?B.multiImage.images:B?.media&&Z(B.media.file)===`picture`?[B.media]:[])[e];if(t!==void 0)return{value:t.altText,onAlt:t=>{P(s.steps.alt,n=>{let r=e=>{let n={...e};return t.trim()===``?delete n.altText:n.altText=t,n},i=n.content;return i?.multiImage?X(n,{multiImage:{images:i.multiImage.images.map((t,n)=>n===e?r(t):t)}}):i?.media?X(n,{media:r(i.media)}):n})}}},Ie=B?.poll!==void 0||B?.article!==void 0||(B?.multiImage?.images.length??0)>=z.pictures.most||B?.media!==void 0&&Z(B.media.file)!==`picture`,U=(e,t)=>(0,Y.jsx)(le,{className:`w-auto`,align:`start`,children:(0,Y.jsx)(fe,{self:o,types:e,testId:`linkedin-picker`,onPick:e=>{g(void 0),t(_e(n,e))}})}),W=b.visibility??`PUBLIC`,Le=(0,Y.jsxs)(`div`,{ref:j,className:`ak-li ak-li-composer relative`,"data-theme":I?`dark`:`light`,"data-testid":`linkedin-composer`,children:[(0,Y.jsxs)(`div`,{className:`ak-li-c-head`,children:[(0,Y.jsx)(De,{visibility:W,avatar:64}),(0,Y.jsxs)(se,{children:[(0,Y.jsx)(ne,{asChild:!0,disabled:w,children:(0,Y.jsxs)(l,{variant:`secondary`,size:`sm`,className:`ak-li-pill`,"data-testid":`linkedin-visibility`,children:[W===`CONNECTIONS`?(0,Y.jsx)(Ne,{}):(0,Y.jsx)(Se,{}),s.postTo(W===`CONNECTIONS`?s.connections:s.anyone),(0,Y.jsx)(te,{})]})}),(0,Y.jsx)(ae,{align:`start`,children:(0,Y.jsxs)(oe,{value:W,onValueChange:e=>{P(s.steps.visibility,t=>{let n={...t};return e===`PUBLIC`?delete n.visibility:n.visibility=`CONNECTIONS`,n})},children:[(0,Y.jsx)(ie,{value:`PUBLIC`,children:s.anyone}),(0,Y.jsx)(ie,{value:`CONNECTIONS`,children:s.connections})]})})]})]}),(0,Y.jsxs)(`div`,{className:`ak-li-field`,children:[(0,Y.jsxs)(`div`,{className:`ak-li-field-words`,"aria-hidden":`true`,children:[(0,Y.jsx)(Ae,{text:b.commentary}),b.commentary.endsWith(`
3
+ `)?`​`:null]}),(0,Y.jsx)(`textarea`,{dir:`auto`,value:b.commentary,placeholder:s.share,"aria-label":s.share,readOnly:w,"data-testid":`linkedin-commentary`,onChange:e=>{let t=e.target.value;P(s.steps.text,e=>({...e,commentary:t}),`commentary`)},onBlur:()=>{e.settle()}})]}),B?.poll?(0,Y.jsx)(Ze,{poll:B.poll,locked:w,onChange:(e,t)=>{P(s.steps.poll,t=>X(t,{poll:e}),t===void 0?void 0:`poll-${t}`)},onRemove:()=>{P(s.steps.poll,e=>X(e,void 0))}}):(0,Y.jsxs)(Y.Fragment,{children:[B?.article?(0,Y.jsx)(Qe,{article:B.article,locked:w,onChange:(e,t)=>{P(s.steps.link,t=>X(t,{article:e}),`link-${t??``}`)}}):null,(0,Y.jsx)(Me,{content:H,onMedium:w?void 0:e=>(0,Y.jsx)(Xe,{alt:Fe(e),onRemove:()=>{Pe(e)}})}),B?.media&&Z(B.media.file)!==`picture`?(0,Y.jsx)(`input`,{className:`ak-li-doc-title-field`,value:B.media.title??``,placeholder:s.documentTitle,"aria-label":s.documentTitle,readOnly:w,onChange:e=>{let t=e.target.value;P(s.steps.title,e=>{let n=e.content?.media;if(!n)return e;let r={...n};return t===``?delete r.title:r.title=t,X(e,{media:r})},`title`)}}):null]}),w?null:(0,Y.jsxs)(`div`,{className:`ak-li-c-tools`,children:[(0,Y.jsxs)(y,{open:h===`media`,onOpenChange:e=>{g(e?`media`:void 0)},children:[(0,Y.jsx)(v,{asChild:!0,children:(0,Y.jsx)(l,{variant:`ghost`,size:`icon-sm`,"aria-label":B?.multiImage?s.addPicture:s.addMedia,title:B?.multiImage?s.addPicture:s.addMedia,disabled:Ie,children:(0,Y.jsx)(S,{})})}),U(B?.multiImage||B?.media?L:Te,e=>{P(s.steps.media,t=>X(t,Je(t.content,e)))})]}),(0,Y.jsxs)(y,{open:h===`document`,onOpenChange:e=>{g(e?`document`:void 0)},children:[(0,Y.jsx)(v,{asChild:!0,children:(0,Y.jsx)(l,{variant:`ghost`,size:`icon-sm`,"aria-label":s.addDocument,title:s.addDocument,disabled:B!==void 0,children:(0,Y.jsx)(re,{})})}),U(ke,e=>{P(s.steps.media,t=>X(t,{media:{file:e}}))})]}),(0,Y.jsx)(Q,{label:s.addPoll,disabled:B!==void 0,onClick:()=>{P(s.steps.poll,e=>X(e,{poll:{question:``,options:[{text:``},{text:``}]}}))},children:(0,Y.jsx)(de,{})}),(0,Y.jsx)(Q,{label:s.addLink,disabled:B!==void 0,onClick:()=>{P(s.steps.link,e=>X(e,{article:{source:`https://`}}))},children:(0,Y.jsx)(ye,{})}),B?.article&&B.article.thumbnail===void 0?(0,Y.jsxs)(y,{open:h===`thumbnail`,onOpenChange:e=>{g(e?`thumbnail`:void 0)},children:[(0,Y.jsx)(v,{asChild:!0,children:(0,Y.jsxs)(l,{variant:`ghost`,size:`sm`,children:[(0,Y.jsx)(S,{}),s.link.thumbnail]})}),U(L,e=>{P(s.steps.link,t=>t.content?.article?X(t,{article:{...t.content.article,thumbnail:e}}):t)})]}):null,(0,Y.jsx)(`span`,{className:`flex-1`}),(0,Y.jsx)(Ye,{text:b.commentary})]}),D&&A?(0,Y.jsx)(E,{"data-testid":`linkedin-agent-box`,label:k(D),className:`inset-1`}):null]}),G={commentary:b.commentary,visibility:W,content:H},K=(0,Y.jsxs)(`div`,{ref:M,className:`ak-li ak-li-previews relative`,"data-theme":I?`dark`:`light`,children:[(0,Y.jsx)(Oe,{post:G,lines:3,onFolded:ee}),_?(0,Y.jsx)(Oe,{post:G}):null,D&&A?(0,Y.jsx)(E,{"data-testid":`linkedin-agent-shown`,className:`inset-0`}):null]});return(0,Y.jsxs)(`div`,{className:`bg-background flex size-full flex-col`,"data-testid":`linkedin-post-editor`,onKeyDown:Ee,children:[F,(0,Y.jsx)(je.Provider,{value:pe,children:(0,Y.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[C?(0,Y.jsx)(Ce,{}):null,(0,Y.jsx)(me,{pane:f,edit:Le,preview:K,width:552,background:I?`#000000`:`#f4f2ee`,testId:`linkedin-preview`})]})})]})}function $(){let e=R(),t=o(),n=r(),i=n?.item.entry,a=n?.item.dir??``,[s,c]=(0,J.useState)(),[l,u]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{if(i===void 0)return;let e,n=!0;return Ke.open(t,i).then(t=>{n?(e=t,c(t)):t.close()},e=>{reportError(e),n&&u(!0)}),()=>{n=!1,e?.close()}},[t,i]),l?(0,Y.jsx)(`div`,{className:`flex size-full`,"data-testid":`linkedin-post-editor`,"data-state":`updating`,children:(0,Y.jsx)(T,{})}):!s||i===void 0?(0,Y.jsx)(`div`,{className:`text-muted-foreground flex size-full items-center justify-center text-sm`,"data-testid":`linkedin-post-editor`,"data-state":`loading`,children:e.loading}):(0,Y.jsx)($e,{doc:s,dir:a,entry:i})}export{$ as LinkedInPostEditor,$ as default,Ke as PostDocument,I as WORDS};