@afbin/cli 0.4.1 → 0.4.2

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 (468) hide show
  1. package/README.md +5 -0
  2. package/dist/afbin.mjs +33 -12
  3. package/dist/index.mjs +11 -1
  4. package/dist/runtime/dist/web/.vite/manifest.json +216 -216
  5. package/dist/runtime/dist/web/assets/{Account-CvOF6jpD.js → Account-qnxwLep7.js} +1 -1
  6. package/dist/runtime/dist/web/assets/Account-qnxwLep7.js.br +0 -0
  7. package/dist/runtime/dist/web/assets/Account-qnxwLep7.js.gz +0 -0
  8. package/dist/runtime/dist/web/assets/{ArtifactAddress-DORDne01.js → ArtifactAddress-1ftOG9A5.js} +2 -2
  9. package/dist/runtime/dist/web/assets/ArtifactAddress-1ftOG9A5.js.br +0 -0
  10. package/dist/runtime/dist/web/assets/ArtifactAddress-1ftOG9A5.js.gz +0 -0
  11. package/dist/runtime/dist/web/assets/{ArtifactData-BdL9R2dA.js → ArtifactData-CZq-MLWc.js} +1 -1
  12. package/dist/runtime/dist/web/assets/ArtifactData-CZq-MLWc.js.br +0 -0
  13. package/dist/runtime/dist/web/assets/ArtifactData-CZq-MLWc.js.gz +0 -0
  14. package/dist/runtime/dist/web/assets/{ArtifactEditor-BZXbOk_F.js → ArtifactEditor-Cd_-Z6DK.js} +1 -1
  15. package/dist/runtime/dist/web/assets/ArtifactEditor-Cd_-Z6DK.js.br +0 -0
  16. package/dist/runtime/dist/web/assets/ArtifactEditor-Cd_-Z6DK.js.gz +0 -0
  17. package/dist/runtime/dist/web/assets/{AssetPageHeader-DX2RcYTv.js → AssetPageHeader-BqdRtu9K.js} +1 -1
  18. package/dist/runtime/dist/web/assets/AssetPageHeader-BqdRtu9K.js.br +0 -0
  19. package/dist/runtime/dist/web/assets/AssetPageHeader-BqdRtu9K.js.gz +0 -0
  20. package/dist/runtime/dist/web/assets/{Assets-dgdXIgAW.js → Assets-D6htDZnu.js} +1 -1
  21. package/dist/runtime/dist/web/assets/Assets-D6htDZnu.js.br +0 -0
  22. package/dist/runtime/dist/web/assets/Assets-D6htDZnu.js.gz +0 -0
  23. package/dist/runtime/dist/web/assets/{AvatarCircle-MNnIhRvg.js → AvatarCircle-CBpOuCGy.js} +1 -1
  24. package/dist/runtime/dist/web/assets/AvatarCircle-CBpOuCGy.js.br +0 -0
  25. package/dist/runtime/dist/web/assets/AvatarCircle-CBpOuCGy.js.gz +0 -0
  26. package/dist/runtime/dist/web/assets/{Chat-V1ku1-60.js → Chat-DueKnMAf.js} +1 -1
  27. package/dist/runtime/dist/web/assets/Chat-DueKnMAf.js.br +0 -0
  28. package/dist/runtime/dist/web/assets/Chat-DueKnMAf.js.gz +0 -0
  29. package/dist/runtime/dist/web/assets/{ConfirmDialog-Ph1VDgNN.js → ConfirmDialog-hdkXS1mg.js} +1 -1
  30. package/dist/runtime/dist/web/assets/ConfirmDialog-hdkXS1mg.js.br +0 -0
  31. package/dist/runtime/dist/web/assets/ConfirmDialog-hdkXS1mg.js.gz +0 -0
  32. package/dist/runtime/dist/web/assets/{DatasetCatalogView-DBJEPKFI.js → DatasetCatalogView-DKNdjYA_.js} +1 -1
  33. package/dist/runtime/dist/web/assets/DatasetCatalogView-DKNdjYA_.js.br +0 -0
  34. package/dist/runtime/dist/web/assets/DatasetCatalogView-DKNdjYA_.js.gz +0 -0
  35. package/dist/runtime/dist/web/assets/{DatasetEditor-CMqN1duq.js → DatasetEditor-C22-4oJL.js} +1 -1
  36. package/dist/runtime/dist/web/assets/DatasetEditor-C22-4oJL.js.br +0 -0
  37. package/dist/runtime/dist/web/assets/DatasetEditor-C22-4oJL.js.gz +0 -0
  38. package/dist/runtime/dist/web/assets/{Docs-DVoW7b7v.js → Docs-B80IZLN8.js} +1 -1
  39. package/dist/runtime/dist/web/assets/Docs-B80IZLN8.js.br +0 -0
  40. package/dist/runtime/dist/web/assets/Docs-B80IZLN8.js.gz +0 -0
  41. package/dist/runtime/dist/web/assets/{Document-udhy5mlX.js → Document-C6-E9V3_.js} +4 -4
  42. package/dist/runtime/dist/web/assets/Document-C6-E9V3_.js.br +0 -0
  43. package/dist/runtime/dist/web/assets/Document-C6-E9V3_.js.gz +0 -0
  44. package/dist/runtime/dist/web/assets/{DocumentChrome-EUbW_JvA.js → DocumentChrome-Bw4_z5yQ.js} +1 -1
  45. package/dist/runtime/dist/web/assets/DocumentChrome-Bw4_z5yQ.js.br +0 -0
  46. package/dist/runtime/dist/web/assets/DocumentChrome-Bw4_z5yQ.js.gz +0 -0
  47. package/dist/runtime/dist/web/assets/{DocumentSharing-BuTXuflA.js → DocumentSharing-BiTakFtn.js} +1 -1
  48. package/dist/runtime/dist/web/assets/DocumentSharing-BiTakFtn.js.br +0 -0
  49. package/dist/runtime/dist/web/assets/DocumentSharing-BiTakFtn.js.gz +0 -0
  50. package/dist/runtime/dist/web/assets/{FileUpload-D6RTOrHD.js → FileUpload-B-da-wki.js} +1 -1
  51. package/dist/runtime/dist/web/assets/FileUpload-B-da-wki.js.br +0 -0
  52. package/dist/runtime/dist/web/assets/FileUpload-B-da-wki.js.gz +0 -0
  53. package/dist/runtime/dist/web/assets/{Folder-DoNsFB2I.js → Folder-B-OlCz39.js} +1 -1
  54. package/dist/runtime/dist/web/assets/Folder-B-OlCz39.js.br +0 -0
  55. package/dist/runtime/dist/web/assets/Folder-B-OlCz39.js.gz +0 -0
  56. package/dist/runtime/dist/web/assets/{ForkArtifact-DDmXl1BZ.js → ForkArtifact-DXYU1-qL.js} +1 -1
  57. package/dist/runtime/dist/web/assets/ForkArtifact-DXYU1-qL.js.br +0 -0
  58. package/dist/runtime/dist/web/assets/ForkArtifact-DXYU1-qL.js.gz +0 -0
  59. package/dist/runtime/dist/web/assets/{GetStarted-YjltMEeN.js → GetStarted-CFsSvXR0.js} +1 -1
  60. package/dist/runtime/dist/web/assets/GetStarted-CFsSvXR0.js.br +0 -0
  61. package/dist/runtime/dist/web/assets/GetStarted-CFsSvXR0.js.gz +0 -0
  62. package/dist/runtime/dist/web/assets/{Home-DijnltFZ.js → Home-BSO7YYXA.js} +1 -1
  63. package/dist/runtime/dist/web/assets/Home-BSO7YYXA.js.br +0 -0
  64. package/dist/runtime/dist/web/assets/Home-BSO7YYXA.js.gz +0 -0
  65. package/dist/runtime/dist/web/assets/{Login-DLwn4aUr.js → Login-CszZ8VGu.js} +1 -1
  66. package/dist/runtime/dist/web/assets/Login-CszZ8VGu.js.br +0 -0
  67. package/dist/runtime/dist/web/assets/Login-CszZ8VGu.js.gz +0 -0
  68. package/dist/runtime/dist/web/assets/{NotFound-svz4wCeL.js → NotFound-D2MOGkIO.js} +1 -1
  69. package/dist/runtime/dist/web/assets/NotFound-D2MOGkIO.js.br +0 -0
  70. package/dist/runtime/dist/web/assets/NotFound-D2MOGkIO.js.gz +0 -0
  71. package/dist/runtime/dist/web/assets/{Notifications-BGeJKv2W.js → Notifications-M7BiDhSo.js} +1 -1
  72. package/dist/runtime/dist/web/assets/Notifications-M7BiDhSo.js.br +0 -0
  73. package/dist/runtime/dist/web/assets/Notifications-M7BiDhSo.js.gz +0 -0
  74. package/dist/runtime/dist/web/assets/{Profile-B38GeCbR.js → Profile-DqV5PMEi.js} +2 -2
  75. package/dist/runtime/dist/web/assets/Profile-DqV5PMEi.js.br +0 -0
  76. package/dist/runtime/dist/web/assets/Profile-DqV5PMEi.js.gz +0 -0
  77. package/dist/runtime/dist/web/assets/{Program-D3-Gfvjo.js → Program-CdwfK2zE.js} +1 -1
  78. package/dist/runtime/dist/web/assets/Program-CdwfK2zE.js.br +0 -0
  79. package/dist/runtime/dist/web/assets/Program-CdwfK2zE.js.gz +0 -0
  80. package/dist/runtime/dist/web/assets/{RowMenu-J4Gbci3B.js → RowMenu-B2c9LyOb.js} +1 -1
  81. package/dist/runtime/dist/web/assets/RowMenu-B2c9LyOb.js.br +0 -0
  82. package/dist/runtime/dist/web/assets/RowMenu-B2c9LyOb.js.gz +0 -0
  83. package/dist/runtime/dist/web/assets/Schedules-D05tndQ1.js +1 -0
  84. package/dist/runtime/dist/web/assets/Schedules-D05tndQ1.js.br +0 -0
  85. package/dist/runtime/dist/web/assets/Schedules-D05tndQ1.js.gz +0 -0
  86. package/dist/runtime/dist/web/assets/{ScreenshotEditor-CUmN5F2q.js → ScreenshotEditor-B8g3LiBx.js} +1 -1
  87. package/dist/runtime/dist/web/assets/ScreenshotEditor-B8g3LiBx.js.br +0 -0
  88. package/dist/runtime/dist/web/assets/ScreenshotEditor-B8g3LiBx.js.gz +0 -0
  89. package/dist/runtime/dist/web/assets/{ShareLink-n8KhtnaI.js → ShareLink-qbYss_Eh.js} +1 -1
  90. package/dist/runtime/dist/web/assets/ShareLink-qbYss_Eh.js.br +0 -0
  91. package/dist/runtime/dist/web/assets/ShareLink-qbYss_Eh.js.gz +0 -0
  92. package/dist/runtime/dist/web/assets/{Shelf-BgwHOaeW.js → Shelf-anhc5No9.js} +1 -1
  93. package/dist/runtime/dist/web/assets/Shelf-anhc5No9.js.br +0 -0
  94. package/dist/runtime/dist/web/assets/Shelf-anhc5No9.js.gz +0 -0
  95. package/dist/runtime/dist/web/assets/{SocialPreviewEditor-DwHHRW29.js → SocialPreviewEditor-B4nUY6FA.js} +1 -1
  96. package/dist/runtime/dist/web/assets/SocialPreviewEditor-B4nUY6FA.js.br +0 -0
  97. package/dist/runtime/dist/web/assets/SocialPreviewEditor-B4nUY6FA.js.gz +0 -0
  98. package/dist/runtime/dist/web/assets/{Starter-I01MNooi.js → Starter-DrID859q.js} +1 -1
  99. package/dist/runtime/dist/web/assets/Starter-DrID859q.js.br +0 -0
  100. package/dist/runtime/dist/web/assets/Starter-DrID859q.js.gz +0 -0
  101. package/dist/runtime/dist/web/assets/{Trash-Cu0KXeW7.js → Trash-DoKID_ux.js} +1 -1
  102. package/dist/runtime/dist/web/assets/Trash-DoKID_ux.js.br +0 -0
  103. package/dist/runtime/dist/web/assets/Trash-DoKID_ux.js.gz +0 -0
  104. package/dist/runtime/dist/web/assets/{Welcome-B8iPt_Nh.js → Welcome-Ct29u9Y9.js} +1 -1
  105. package/dist/runtime/dist/web/assets/Welcome-Ct29u9Y9.js.br +0 -0
  106. package/dist/runtime/dist/web/assets/Welcome-Ct29u9Y9.js.gz +0 -0
  107. package/dist/runtime/dist/web/assets/{WorkspaceLayout-fF_ot7EK.js → WorkspaceLayout-Qf3x5yOM.js} +1 -1
  108. package/dist/runtime/dist/web/assets/WorkspaceLayout-Qf3x5yOM.js.br +0 -0
  109. package/dist/runtime/dist/web/assets/WorkspaceLayout-Qf3x5yOM.js.gz +0 -0
  110. package/dist/runtime/dist/web/assets/{browser-artifact-write-ZsGe-hXr.js → browser-artifact-write-CG72iseh.js} +1 -1
  111. package/dist/runtime/dist/web/assets/browser-artifact-write-CG72iseh.js.br +0 -0
  112. package/dist/runtime/dist/web/assets/browser-artifact-write-CG72iseh.js.gz +0 -0
  113. package/dist/runtime/dist/web/assets/{chevron-down-COGO5cmx.js → chevron-down-M1fHuk7u.js} +1 -1
  114. package/dist/runtime/dist/web/assets/{chevron-left-BJZiR3W-.js → chevron-left-NHmvDJpN.js} +1 -1
  115. package/dist/runtime/dist/web/assets/{copy-PNNAtmJH.js → copy-v5iTV3kk.js} +1 -1
  116. package/dist/runtime/dist/web/assets/copy-v5iTV3kk.js.br +0 -0
  117. package/dist/runtime/dist/web/assets/copy-v5iTV3kk.js.gz +0 -0
  118. package/dist/runtime/dist/web/assets/{database-CKOnpvwb.js → database-BbH2eTSj.js} +1 -1
  119. package/dist/runtime/dist/web/assets/database-BbH2eTSj.js.br +2 -0
  120. package/dist/runtime/dist/web/assets/database-BbH2eTSj.js.gz +0 -0
  121. package/dist/runtime/dist/web/assets/{document-update-client-DUF0zs2Z.js → document-update-client-td73lQ81.js} +1 -1
  122. package/dist/runtime/dist/web/assets/document-update-client-td73lQ81.js.br +0 -0
  123. package/dist/runtime/dist/web/assets/document-update-client-td73lQ81.js.gz +0 -0
  124. package/dist/runtime/dist/web/assets/{dom-mounter-64phOf1s.js → dom-mounter-BSxIt5bC.js} +1 -1
  125. package/dist/runtime/dist/web/assets/dom-mounter-BSxIt5bC.js.br +0 -0
  126. package/dist/runtime/dist/web/assets/dom-mounter-BSxIt5bC.js.gz +0 -0
  127. package/dist/runtime/dist/web/assets/{download-j-nqks7p.js → download-Dk3mxCBK.js} +1 -1
  128. package/dist/runtime/dist/web/assets/download-Dk3mxCBK.js.br +0 -0
  129. package/dist/runtime/dist/web/assets/download-Dk3mxCBK.js.gz +0 -0
  130. package/dist/runtime/dist/web/assets/{eye-BNpzRKAK.js → eye-DEiYMLrO.js} +1 -1
  131. package/dist/runtime/dist/web/assets/eye-DEiYMLrO.js.br +0 -0
  132. package/dist/runtime/dist/web/assets/eye-DEiYMLrO.js.gz +0 -0
  133. package/dist/runtime/dist/web/assets/{file-up-DH-HiKEX.js → file-up-GoLKOXxO.js} +1 -1
  134. package/dist/runtime/dist/web/assets/file-up-GoLKOXxO.js.br +1 -0
  135. package/dist/runtime/dist/web/assets/file-up-GoLKOXxO.js.gz +0 -0
  136. package/dist/runtime/dist/web/assets/{git-fork-PQOXxmWW.js → git-fork-CN41g1lF.js} +1 -1
  137. package/dist/runtime/dist/web/assets/git-fork-CN41g1lF.js.br +0 -0
  138. package/dist/runtime/dist/web/assets/git-fork-CN41g1lF.js.gz +0 -0
  139. package/dist/runtime/dist/web/assets/{http-C2exCIpl.js → http-DEdzW08u.js} +1 -1
  140. package/dist/runtime/dist/web/assets/http-DEdzW08u.js.br +0 -0
  141. package/dist/runtime/dist/web/assets/http-DEdzW08u.js.gz +0 -0
  142. package/dist/runtime/dist/web/assets/{list-Dj3WErnh.js → list-CA_o21oZ.js} +1 -1
  143. package/dist/runtime/dist/web/assets/list-CA_o21oZ.js.br +0 -0
  144. package/dist/runtime/dist/web/assets/list-CA_o21oZ.js.gz +0 -0
  145. package/dist/runtime/dist/web/assets/{loader-circle-BXxJOPx-.js → loader-circle-2p_rsu6P.js} +1 -1
  146. package/dist/runtime/dist/web/assets/{lock-B1nhk71f.js → lock-BRsIxNP2.js} +1 -1
  147. package/dist/runtime/dist/web/assets/lock-BRsIxNP2.js.br +0 -0
  148. package/dist/runtime/dist/web/assets/lock-BRsIxNP2.js.gz +0 -0
  149. package/dist/runtime/dist/web/assets/{person-mentions-BEjAedYZ.js → person-mentions-C7vQd7Vr.js} +1 -1
  150. package/dist/runtime/dist/web/assets/person-mentions-C7vQd7Vr.js.br +0 -0
  151. package/dist/runtime/dist/web/assets/person-mentions-C7vQd7Vr.js.gz +0 -0
  152. package/dist/runtime/dist/web/assets/{plus-BtWrAD8F.js → plus-BNzHjmEg.js} +1 -1
  153. package/dist/runtime/dist/web/assets/{rotate-ccw-CSJ78xUE.js → rotate-ccw-CIMUmeuJ.js} +1 -1
  154. package/dist/runtime/dist/web/assets/rotate-ccw-CIMUmeuJ.js.br +0 -0
  155. package/dist/runtime/dist/web/assets/rotate-ccw-CIMUmeuJ.js.gz +0 -0
  156. package/dist/runtime/dist/web/assets/{search-agWZofH1.js → search-CmIkt7xE.js} +1 -1
  157. package/dist/runtime/dist/web/assets/{session-D__Apnw9.js → session-BsshdoaV.js} +1 -1
  158. package/dist/runtime/dist/web/assets/session-BsshdoaV.js.br +0 -0
  159. package/dist/runtime/dist/web/assets/session-BsshdoaV.js.gz +0 -0
  160. package/dist/runtime/dist/web/assets/{shelf-CeaX4iBg.js → shelf-DUXW45ap.js} +1 -1
  161. package/dist/runtime/dist/web/assets/shelf-DUXW45ap.js.br +0 -0
  162. package/dist/runtime/dist/web/assets/shelf-DUXW45ap.js.gz +0 -0
  163. package/dist/runtime/dist/web/assets/{solid-app-BtmRR9Ax.js → solid-app-BNcsMwv4.js} +2 -2
  164. package/dist/runtime/dist/web/assets/solid-app-BNcsMwv4.js.br +0 -0
  165. package/dist/runtime/dist/web/assets/solid-app-BNcsMwv4.js.gz +0 -0
  166. package/dist/runtime/dist/web/assets/solid-app-DRAhiXqs.css +2 -0
  167. package/dist/runtime/dist/web/assets/solid-app-DRAhiXqs.css.br +0 -0
  168. package/dist/runtime/dist/web/assets/solid-app-DRAhiXqs.css.gz +0 -0
  169. package/dist/runtime/dist/web/assets/{undo-2-Di8QrlfX.js → undo-2--XbU60MY.js} +1 -1
  170. package/dist/runtime/dist/web/assets/undo-2--XbU60MY.js.br +0 -0
  171. package/dist/runtime/dist/web/assets/undo-2--XbU60MY.js.gz +0 -0
  172. package/dist/runtime/dist/web/assets/{users-BJrdLUkX.js → users-Bm0xpNrq.js} +1 -1
  173. package/dist/runtime/dist/web/assets/users-Bm0xpNrq.js.br +0 -0
  174. package/dist/runtime/dist/web/assets/users-Bm0xpNrq.js.gz +0 -0
  175. package/dist/runtime/dist/web/solid-app.html +2 -2
  176. package/dist/runtime/draft-compile-worker.mjs +10 -0
  177. package/dist/runtime/host.mjs +12 -2
  178. package/dist/runtime/lambda-page-runtime.js +1 -1
  179. package/dist/runtime/lib/build-assets/.server-reader-cache.json +1 -1
  180. package/dist/runtime/lib/build-assets/offline/.build-cache.json +10 -7
  181. package/dist/runtime/lib/build-assets/offline/manifest.json +4 -4
  182. package/dist/runtime/lib/build-assets/offline/solid.js.gz +0 -0
  183. package/dist/runtime/lib/build-assets/prepared-sources.sha256 +1 -1
  184. package/dist/runtime/pool-worker.mjs +3 -0
  185. package/dist/runtime/preview/{ScreenshotEditor-R3UODF65.js → ScreenshotEditor-LHC3JZSA.js} +1 -1
  186. package/dist/runtime/preview/{annotate-U27XXRZK.js → annotate-THM7GL72.js} +1 -1
  187. package/dist/runtime/preview/chrome.css +1 -1
  188. package/dist/runtime/preview/{chunk-7RMKAFBO.js → chunk-4O7LVK2Q.js} +1 -1
  189. package/dist/runtime/preview/chunk-7T3V6PAW.js +1 -0
  190. package/dist/runtime/preview/{chunk-3KKU74WM.js → chunk-RDT3C3F6.js} +1 -1
  191. package/dist/runtime/preview/client.js +13 -13
  192. package/dist/runtime/preview/connect.js +1 -0
  193. package/dist/runtime/preview/{dom-mounter-3OQN7G4J.js → dom-mounter-2URPGP2F.js} +1 -1
  194. package/dist/runtime/preview/{engine-I6R47UTB.js → engine-5UO3LPN5.js} +1 -1
  195. package/dist/runtime/preview/{selection-actions-426G2H4N.js → selection-actions-LBFPODLD.js} +1 -1
  196. package/dist/runtime/preview/{session-UFN5GQK2.js → session-A2Z3M7QD.js} +1 -1
  197. package/dist/runtime/preview/update-parts-ZLXTYSVY.js +1 -0
  198. package/dist/runtime/preview.mjs +74496 -74135
  199. package/dist/runtime/public/chat/install.ps1 +1 -1
  200. package/dist/runtime/public/chat/install.sh +1 -1
  201. package/dist/runtime/public/chat/release.json +1 -1
  202. package/dist/runtime/public/islands/{boot-74e9143aa374c62b.js → boot-281adc05179334e6.js} +1 -1
  203. package/dist/runtime/public/islands/boot-281adc05179334e6.js.br +0 -0
  204. package/dist/runtime/public/islands/boot-281adc05179334e6.js.gz +0 -0
  205. package/dist/runtime/public/islands/{chunk-51a4b62dc42f3594.js → chunk-1af2f1c5f3e99805.js} +1 -1
  206. package/dist/runtime/public/islands/chunk-1af2f1c5f3e99805.js.br +0 -0
  207. package/dist/runtime/public/islands/chunk-1af2f1c5f3e99805.js.gz +0 -0
  208. package/dist/runtime/public/islands/{chunk-f451297257164687.js → chunk-2f5d885a7394f865.js} +1 -1
  209. package/dist/runtime/public/islands/chunk-2f5d885a7394f865.js.br +0 -0
  210. package/dist/runtime/public/islands/{chunk-f451297257164687.js.gz → chunk-2f5d885a7394f865.js.gz} +0 -0
  211. package/dist/runtime/public/islands/{chunk-68a083200dbd5bf7.js → chunk-3cb86bf7badbd2c3.js} +1 -1
  212. package/dist/runtime/public/islands/chunk-3cb86bf7badbd2c3.js.br +0 -0
  213. package/dist/runtime/public/islands/chunk-3cb86bf7badbd2c3.js.gz +0 -0
  214. package/dist/runtime/public/islands/{chunk-adcd632c8be50ba7.js → chunk-5e05b99cb275660b.js} +1 -1
  215. package/dist/runtime/public/islands/chunk-5e05b99cb275660b.js.br +0 -0
  216. package/dist/runtime/public/islands/{chunk-adcd632c8be50ba7.js.gz → chunk-5e05b99cb275660b.js.gz} +0 -0
  217. package/dist/runtime/public/islands/{chunk-e817ee4addba2d95.js → chunk-d924d4620b11b893.js} +1 -1
  218. package/dist/runtime/public/islands/chunk-d924d4620b11b893.js.br +0 -0
  219. package/dist/runtime/public/islands/chunk-d924d4620b11b893.js.gz +0 -0
  220. package/dist/runtime/public/islands/{chunk-1fa28532f51beb9c.js → chunk-dfe07cc2b19c50cc.js} +1 -1
  221. package/dist/runtime/public/islands/{frame-editor-6b8a50886fff8604.js → frame-editor-66b0c0d98283e912.js} +1 -1
  222. package/dist/runtime/public/islands/frame-editor-66b0c0d98283e912.js.br +0 -0
  223. package/dist/runtime/public/islands/frame-editor-66b0c0d98283e912.js.gz +0 -0
  224. package/dist/runtime/public/islands/{frame-editor-chunk-87b0311faf57261c.js → frame-editor-chunk-091e41cba1670be1.js} +1 -1
  225. package/dist/runtime/public/islands/frame-editor-chunk-091e41cba1670be1.js.br +0 -0
  226. package/dist/runtime/public/islands/frame-editor-chunk-091e41cba1670be1.js.gz +0 -0
  227. package/dist/runtime/public/islands/{frame-editor-chunk-69c553d9c4562981.js → frame-editor-chunk-5ea52db3a6d93294.js} +1 -1
  228. package/dist/runtime/public/islands/frame-editor-chunk-5ea52db3a6d93294.js.br +2 -0
  229. package/dist/runtime/public/islands/frame-editor-chunk-5ea52db3a6d93294.js.gz +0 -0
  230. package/dist/runtime/public/islands/{frame-editor-chunk-c2b9018371100824.js → frame-editor-chunk-a6db6db210776f5c.js} +1 -1
  231. package/dist/runtime/public/islands/frame-editor-chunk-a6db6db210776f5c.js.br +0 -0
  232. package/dist/runtime/public/islands/frame-editor-chunk-a6db6db210776f5c.js.gz +0 -0
  233. package/dist/runtime/public/islands/{frame-editor-chunk-a13dce46b9b8401f.js → frame-editor-chunk-c9facbfeee3c9bed.js} +1 -1
  234. package/dist/runtime/public/islands/frame-editor-chunk-c9facbfeee3c9bed.js.br +0 -0
  235. package/dist/runtime/public/islands/frame-editor-chunk-c9facbfeee3c9bed.js.gz +0 -0
  236. package/dist/runtime/public/islands/{frame-editor-chunk-b06f17fc7dae17e8.js → frame-editor-chunk-d6c77179f72db0ab.js} +1 -1
  237. package/dist/runtime/public/islands/frame-editor-chunk-d6c77179f72db0ab.js.br +0 -0
  238. package/dist/runtime/public/islands/frame-editor-chunk-d6c77179f72db0ab.js.gz +0 -0
  239. package/dist/runtime/public/islands/{image-map-a9f95f7e8d0712c1.js → image-map-7419ab54ff59434a.js} +1 -1
  240. package/dist/runtime/public/islands/image-map-7419ab54ff59434a.js.br +0 -0
  241. package/dist/runtime/public/islands/image-map-7419ab54ff59434a.js.gz +0 -0
  242. package/dist/runtime/public/islands/{kit-basic-cbabcc4b41d6132a.js → kit-basic-c22b54dcd2ea6161.js} +1 -1
  243. package/dist/runtime/public/islands/kit-basic-c22b54dcd2ea6161.js.br +2 -0
  244. package/dist/runtime/public/islands/kit-basic-c22b54dcd2ea6161.js.gz +0 -0
  245. package/dist/runtime/public/islands/{kit-cells-cefbceccdfd0dbe0.js → kit-cells-55ade213f1751716.js} +1 -1
  246. package/dist/runtime/public/islands/kit-cells-55ade213f1751716.js.br +0 -0
  247. package/dist/runtime/public/islands/kit-cells-55ade213f1751716.js.gz +0 -0
  248. package/dist/runtime/public/islands/{kit-controls-81d17a10f9d457f2.js → kit-controls-4f1b98d7d87c4b21.js} +1 -1
  249. package/dist/runtime/public/islands/kit-controls-4f1b98d7d87c4b21.js.br +0 -0
  250. package/dist/runtime/public/islands/kit-controls-4f1b98d7d87c4b21.js.gz +0 -0
  251. package/dist/runtime/public/islands/{kit-data-43947f36f1c501aa.js → kit-data-e1012fd12092b177.js} +1 -1
  252. package/dist/runtime/public/islands/kit-data-e1012fd12092b177.js.br +0 -0
  253. package/dist/runtime/public/islands/kit-data-e1012fd12092b177.js.gz +0 -0
  254. package/dist/runtime/public/islands/{kit-dialog-eedc51ce82feec4b.js → kit-dialog-1e427336472b2906.js} +1 -1
  255. package/dist/runtime/public/islands/kit-dialog-1e427336472b2906.js.br +0 -0
  256. package/dist/runtime/public/islands/kit-dialog-1e427336472b2906.js.gz +0 -0
  257. package/dist/runtime/public/islands/{kit-embed-3c8886cbfa06f74d.js → kit-embed-c7019820c5200806.js} +1 -1
  258. package/dist/runtime/public/islands/kit-embed-c7019820c5200806.js.br +0 -0
  259. package/dist/runtime/public/islands/kit-embed-c7019820c5200806.js.gz +0 -0
  260. package/dist/runtime/public/islands/{kit-files-b7a2cb758f00a68b.js → kit-files-dc0b71ca71f2151c.js} +1 -1
  261. package/dist/runtime/public/islands/kit-files-dc0b71ca71f2151c.js.br +0 -0
  262. package/dist/runtime/public/islands/kit-files-dc0b71ca71f2151c.js.gz +0 -0
  263. package/dist/runtime/public/islands/{kit-image-126e12fcae4215c1.js → kit-image-b31acf4d31a4eeaf.js} +1 -1
  264. package/dist/runtime/public/islands/kit-image-b31acf4d31a4eeaf.js.br +0 -0
  265. package/dist/runtime/public/islands/kit-image-b31acf4d31a4eeaf.js.gz +0 -0
  266. package/dist/runtime/public/islands/{kit-people-5b6f5dd4aa82b657.js → kit-people-6feb1b730c5fd37f.js} +1 -1
  267. package/dist/runtime/public/islands/kit-people-6feb1b730c5fd37f.js.br +0 -0
  268. package/dist/runtime/public/islands/kit-people-6feb1b730c5fd37f.js.gz +0 -0
  269. package/dist/runtime/public/islands/{kit-static-28174bd8f593f8c0.js → kit-static-853aed2cd04c1b4a.js} +1 -1
  270. package/dist/runtime/public/islands/kit-static-853aed2cd04c1b4a.js.br +0 -0
  271. package/dist/runtime/public/islands/kit-static-853aed2cd04c1b4a.js.gz +0 -0
  272. package/dist/runtime/public/islands/manifest.json +211 -211
  273. package/dist/runtime/public/islands/manifest.json.br +0 -0
  274. package/dist/runtime/public/islands/manifest.json.gz +0 -0
  275. package/dist/runtime/public/islands/{morph-engine-4e664485be475dbf.js → morph-engine-c61693caf767d9bd.js} +1 -1
  276. package/dist/runtime/public/islands/morph-engine-c61693caf767d9bd.js.br +0 -0
  277. package/dist/runtime/public/islands/morph-engine-c61693caf767d9bd.js.gz +0 -0
  278. package/dist/runtime/public/islands/offline-ba3717e06bc69a4e.json.gzip +0 -0
  279. package/dist/runtime/public/islands/{page-5f87c34c7c181387.js → page-c3ae4acf0988c2b6.js} +1 -1
  280. package/dist/runtime/public/islands/page-c3ae4acf0988c2b6.js.br +0 -0
  281. package/dist/runtime/public/islands/page-c3ae4acf0988c2b6.js.gz +0 -0
  282. package/dist/runtime/public/islands/{rt-30ff0d94ee3732a1.js → rt-2ab0fed85481c574.js} +1 -1
  283. package/dist/runtime/public/islands/rt-2ab0fed85481c574.js.br +0 -0
  284. package/dist/runtime/public/islands/rt-2ab0fed85481c574.js.gz +0 -0
  285. package/dist/runtime/public/islands/{sqlite-engine-9fc56fea8b1e2aaf.js → sqlite-engine-f3956693df7cfa5c.js} +8 -8
  286. package/dist/runtime/public/islands/sqlite-engine-f3956693df7cfa5c.js.br +0 -0
  287. package/dist/runtime/public/islands/sqlite-engine-f3956693df7cfa5c.js.gz +0 -0
  288. package/dist/runtime/public/islands/{ssr-456cabbcb26f723d.js → ssr-ce6931fb7bda9b08.js} +3 -0
  289. package/dist/runtime/public/islands/ssr-ce6931fb7bda9b08.js.br +0 -0
  290. package/dist/runtime/public/islands/ssr-ce6931fb7bda9b08.js.gz +0 -0
  291. package/dist/runtime/public/islands/{url-sync-74b5212f7b3417d7.js → url-sync-b179b054c9d958a7.js} +1 -1
  292. package/dist/runtime/public/islands/url-sync-b179b054c9d958a7.js.br +0 -0
  293. package/dist/runtime/public/islands/url-sync-b179b054c9d958a7.js.gz +0 -0
  294. package/dist/share/man/man1/afbin.1 +6 -4
  295. package/dist/skills/artifactbin/references/commands.md +4 -2
  296. package/dist/skills/artifactbin/references/publishing.md +5 -3
  297. package/npm-shrinkwrap.json +2 -2
  298. package/package.json +1 -1
  299. package/dist/runtime/dist/web/assets/Account-CvOF6jpD.js.br +0 -0
  300. package/dist/runtime/dist/web/assets/Account-CvOF6jpD.js.gz +0 -0
  301. package/dist/runtime/dist/web/assets/ArtifactAddress-DORDne01.js.br +0 -0
  302. package/dist/runtime/dist/web/assets/ArtifactAddress-DORDne01.js.gz +0 -0
  303. package/dist/runtime/dist/web/assets/ArtifactData-BdL9R2dA.js.br +0 -0
  304. package/dist/runtime/dist/web/assets/ArtifactData-BdL9R2dA.js.gz +0 -0
  305. package/dist/runtime/dist/web/assets/ArtifactEditor-BZXbOk_F.js.br +0 -0
  306. package/dist/runtime/dist/web/assets/ArtifactEditor-BZXbOk_F.js.gz +0 -0
  307. package/dist/runtime/dist/web/assets/AssetPageHeader-DX2RcYTv.js.br +0 -0
  308. package/dist/runtime/dist/web/assets/AssetPageHeader-DX2RcYTv.js.gz +0 -0
  309. package/dist/runtime/dist/web/assets/Assets-dgdXIgAW.js.br +0 -0
  310. package/dist/runtime/dist/web/assets/Assets-dgdXIgAW.js.gz +0 -0
  311. package/dist/runtime/dist/web/assets/AvatarCircle-MNnIhRvg.js.br +0 -0
  312. package/dist/runtime/dist/web/assets/AvatarCircle-MNnIhRvg.js.gz +0 -0
  313. package/dist/runtime/dist/web/assets/Chat-V1ku1-60.js.br +0 -0
  314. package/dist/runtime/dist/web/assets/Chat-V1ku1-60.js.gz +0 -0
  315. package/dist/runtime/dist/web/assets/ConfirmDialog-Ph1VDgNN.js.br +0 -0
  316. package/dist/runtime/dist/web/assets/ConfirmDialog-Ph1VDgNN.js.gz +0 -0
  317. package/dist/runtime/dist/web/assets/DatasetCatalogView-DBJEPKFI.js.br +0 -0
  318. package/dist/runtime/dist/web/assets/DatasetCatalogView-DBJEPKFI.js.gz +0 -0
  319. package/dist/runtime/dist/web/assets/DatasetEditor-CMqN1duq.js.br +0 -0
  320. package/dist/runtime/dist/web/assets/DatasetEditor-CMqN1duq.js.gz +0 -0
  321. package/dist/runtime/dist/web/assets/Docs-DVoW7b7v.js.br +0 -0
  322. package/dist/runtime/dist/web/assets/Docs-DVoW7b7v.js.gz +0 -0
  323. package/dist/runtime/dist/web/assets/Document-udhy5mlX.js.br +0 -0
  324. package/dist/runtime/dist/web/assets/Document-udhy5mlX.js.gz +0 -0
  325. package/dist/runtime/dist/web/assets/DocumentChrome-EUbW_JvA.js.br +0 -0
  326. package/dist/runtime/dist/web/assets/DocumentChrome-EUbW_JvA.js.gz +0 -0
  327. package/dist/runtime/dist/web/assets/DocumentSharing-BuTXuflA.js.br +0 -0
  328. package/dist/runtime/dist/web/assets/DocumentSharing-BuTXuflA.js.gz +0 -0
  329. package/dist/runtime/dist/web/assets/FileUpload-D6RTOrHD.js.br +0 -0
  330. package/dist/runtime/dist/web/assets/FileUpload-D6RTOrHD.js.gz +0 -0
  331. package/dist/runtime/dist/web/assets/Folder-DoNsFB2I.js.br +0 -0
  332. package/dist/runtime/dist/web/assets/Folder-DoNsFB2I.js.gz +0 -0
  333. package/dist/runtime/dist/web/assets/ForkArtifact-DDmXl1BZ.js.br +0 -0
  334. package/dist/runtime/dist/web/assets/ForkArtifact-DDmXl1BZ.js.gz +0 -0
  335. package/dist/runtime/dist/web/assets/GetStarted-YjltMEeN.js.br +0 -0
  336. package/dist/runtime/dist/web/assets/GetStarted-YjltMEeN.js.gz +0 -0
  337. package/dist/runtime/dist/web/assets/Home-DijnltFZ.js.br +0 -0
  338. package/dist/runtime/dist/web/assets/Home-DijnltFZ.js.gz +0 -0
  339. package/dist/runtime/dist/web/assets/Login-DLwn4aUr.js.br +0 -0
  340. package/dist/runtime/dist/web/assets/Login-DLwn4aUr.js.gz +0 -0
  341. package/dist/runtime/dist/web/assets/NotFound-svz4wCeL.js.br +0 -0
  342. package/dist/runtime/dist/web/assets/NotFound-svz4wCeL.js.gz +0 -0
  343. package/dist/runtime/dist/web/assets/Notifications-BGeJKv2W.js.br +0 -0
  344. package/dist/runtime/dist/web/assets/Notifications-BGeJKv2W.js.gz +0 -0
  345. package/dist/runtime/dist/web/assets/Profile-B38GeCbR.js.br +0 -0
  346. package/dist/runtime/dist/web/assets/Profile-B38GeCbR.js.gz +0 -0
  347. package/dist/runtime/dist/web/assets/Program-D3-Gfvjo.js.br +0 -0
  348. package/dist/runtime/dist/web/assets/Program-D3-Gfvjo.js.gz +0 -0
  349. package/dist/runtime/dist/web/assets/RowMenu-J4Gbci3B.js.br +0 -0
  350. package/dist/runtime/dist/web/assets/RowMenu-J4Gbci3B.js.gz +0 -0
  351. package/dist/runtime/dist/web/assets/Schedules-DK3-YUvJ.js +0 -1
  352. package/dist/runtime/dist/web/assets/Schedules-DK3-YUvJ.js.br +0 -0
  353. package/dist/runtime/dist/web/assets/Schedules-DK3-YUvJ.js.gz +0 -0
  354. package/dist/runtime/dist/web/assets/ScreenshotEditor-CUmN5F2q.js.br +0 -0
  355. package/dist/runtime/dist/web/assets/ScreenshotEditor-CUmN5F2q.js.gz +0 -0
  356. package/dist/runtime/dist/web/assets/ShareLink-n8KhtnaI.js.br +0 -0
  357. package/dist/runtime/dist/web/assets/ShareLink-n8KhtnaI.js.gz +0 -0
  358. package/dist/runtime/dist/web/assets/Shelf-BgwHOaeW.js.br +0 -0
  359. package/dist/runtime/dist/web/assets/Shelf-BgwHOaeW.js.gz +0 -0
  360. package/dist/runtime/dist/web/assets/SocialPreviewEditor-DwHHRW29.js.br +0 -0
  361. package/dist/runtime/dist/web/assets/SocialPreviewEditor-DwHHRW29.js.gz +0 -0
  362. package/dist/runtime/dist/web/assets/Starter-I01MNooi.js.br +0 -0
  363. package/dist/runtime/dist/web/assets/Starter-I01MNooi.js.gz +0 -0
  364. package/dist/runtime/dist/web/assets/Trash-Cu0KXeW7.js.br +0 -0
  365. package/dist/runtime/dist/web/assets/Trash-Cu0KXeW7.js.gz +0 -0
  366. package/dist/runtime/dist/web/assets/Welcome-B8iPt_Nh.js.br +0 -0
  367. package/dist/runtime/dist/web/assets/Welcome-B8iPt_Nh.js.gz +0 -0
  368. package/dist/runtime/dist/web/assets/WorkspaceLayout-fF_ot7EK.js.br +0 -0
  369. package/dist/runtime/dist/web/assets/WorkspaceLayout-fF_ot7EK.js.gz +0 -0
  370. package/dist/runtime/dist/web/assets/browser-artifact-write-ZsGe-hXr.js.br +0 -0
  371. package/dist/runtime/dist/web/assets/browser-artifact-write-ZsGe-hXr.js.gz +0 -0
  372. package/dist/runtime/dist/web/assets/copy-PNNAtmJH.js.br +0 -0
  373. package/dist/runtime/dist/web/assets/copy-PNNAtmJH.js.gz +0 -0
  374. package/dist/runtime/dist/web/assets/database-CKOnpvwb.js.br +0 -3
  375. package/dist/runtime/dist/web/assets/database-CKOnpvwb.js.gz +0 -0
  376. package/dist/runtime/dist/web/assets/document-update-client-DUF0zs2Z.js.br +0 -0
  377. package/dist/runtime/dist/web/assets/document-update-client-DUF0zs2Z.js.gz +0 -0
  378. package/dist/runtime/dist/web/assets/dom-mounter-64phOf1s.js.br +0 -0
  379. package/dist/runtime/dist/web/assets/dom-mounter-64phOf1s.js.gz +0 -0
  380. package/dist/runtime/dist/web/assets/download-j-nqks7p.js.br +0 -0
  381. package/dist/runtime/dist/web/assets/download-j-nqks7p.js.gz +0 -0
  382. package/dist/runtime/dist/web/assets/eye-BNpzRKAK.js.br +0 -0
  383. package/dist/runtime/dist/web/assets/eye-BNpzRKAK.js.gz +0 -0
  384. package/dist/runtime/dist/web/assets/file-up-DH-HiKEX.js.br +0 -0
  385. package/dist/runtime/dist/web/assets/file-up-DH-HiKEX.js.gz +0 -0
  386. package/dist/runtime/dist/web/assets/git-fork-PQOXxmWW.js.br +0 -0
  387. package/dist/runtime/dist/web/assets/git-fork-PQOXxmWW.js.gz +0 -0
  388. package/dist/runtime/dist/web/assets/http-C2exCIpl.js.br +0 -0
  389. package/dist/runtime/dist/web/assets/http-C2exCIpl.js.gz +0 -0
  390. package/dist/runtime/dist/web/assets/list-Dj3WErnh.js.br +0 -0
  391. package/dist/runtime/dist/web/assets/list-Dj3WErnh.js.gz +0 -0
  392. package/dist/runtime/dist/web/assets/lock-B1nhk71f.js.br +0 -0
  393. package/dist/runtime/dist/web/assets/lock-B1nhk71f.js.gz +0 -0
  394. package/dist/runtime/dist/web/assets/person-mentions-BEjAedYZ.js.br +0 -0
  395. package/dist/runtime/dist/web/assets/person-mentions-BEjAedYZ.js.gz +0 -0
  396. package/dist/runtime/dist/web/assets/rotate-ccw-CSJ78xUE.js.br +0 -0
  397. package/dist/runtime/dist/web/assets/rotate-ccw-CSJ78xUE.js.gz +0 -0
  398. package/dist/runtime/dist/web/assets/session-D__Apnw9.js.br +0 -0
  399. package/dist/runtime/dist/web/assets/session-D__Apnw9.js.gz +0 -0
  400. package/dist/runtime/dist/web/assets/shelf-CeaX4iBg.js.br +0 -0
  401. package/dist/runtime/dist/web/assets/shelf-CeaX4iBg.js.gz +0 -0
  402. package/dist/runtime/dist/web/assets/solid-app-BmdFnFpX.css +0 -2
  403. package/dist/runtime/dist/web/assets/solid-app-BmdFnFpX.css.br +0 -0
  404. package/dist/runtime/dist/web/assets/solid-app-BmdFnFpX.css.gz +0 -0
  405. package/dist/runtime/dist/web/assets/solid-app-BtmRR9Ax.js.br +0 -0
  406. package/dist/runtime/dist/web/assets/solid-app-BtmRR9Ax.js.gz +0 -0
  407. package/dist/runtime/dist/web/assets/undo-2-Di8QrlfX.js.br +0 -0
  408. package/dist/runtime/dist/web/assets/undo-2-Di8QrlfX.js.gz +0 -0
  409. package/dist/runtime/dist/web/assets/users-BJrdLUkX.js.br +0 -0
  410. package/dist/runtime/dist/web/assets/users-BJrdLUkX.js.gz +0 -0
  411. package/dist/runtime/preview/update-parts-OJC3ZSRW.js +0 -1
  412. package/dist/runtime/public/islands/boot-74e9143aa374c62b.js.br +0 -0
  413. package/dist/runtime/public/islands/boot-74e9143aa374c62b.js.gz +0 -0
  414. package/dist/runtime/public/islands/chunk-51a4b62dc42f3594.js.br +0 -0
  415. package/dist/runtime/public/islands/chunk-51a4b62dc42f3594.js.gz +0 -0
  416. package/dist/runtime/public/islands/chunk-68a083200dbd5bf7.js.br +0 -0
  417. package/dist/runtime/public/islands/chunk-68a083200dbd5bf7.js.gz +0 -0
  418. package/dist/runtime/public/islands/chunk-adcd632c8be50ba7.js.br +0 -0
  419. package/dist/runtime/public/islands/chunk-e817ee4addba2d95.js.br +0 -0
  420. package/dist/runtime/public/islands/chunk-e817ee4addba2d95.js.gz +0 -0
  421. package/dist/runtime/public/islands/chunk-f451297257164687.js.br +0 -0
  422. package/dist/runtime/public/islands/frame-editor-6b8a50886fff8604.js.br +0 -0
  423. package/dist/runtime/public/islands/frame-editor-6b8a50886fff8604.js.gz +0 -0
  424. package/dist/runtime/public/islands/frame-editor-chunk-69c553d9c4562981.js.br +0 -1
  425. package/dist/runtime/public/islands/frame-editor-chunk-69c553d9c4562981.js.gz +0 -0
  426. package/dist/runtime/public/islands/frame-editor-chunk-87b0311faf57261c.js.br +0 -0
  427. package/dist/runtime/public/islands/frame-editor-chunk-87b0311faf57261c.js.gz +0 -0
  428. package/dist/runtime/public/islands/frame-editor-chunk-a13dce46b9b8401f.js.br +0 -0
  429. package/dist/runtime/public/islands/frame-editor-chunk-a13dce46b9b8401f.js.gz +0 -0
  430. package/dist/runtime/public/islands/frame-editor-chunk-b06f17fc7dae17e8.js.br +0 -0
  431. package/dist/runtime/public/islands/frame-editor-chunk-b06f17fc7dae17e8.js.gz +0 -0
  432. package/dist/runtime/public/islands/frame-editor-chunk-c2b9018371100824.js.br +0 -0
  433. package/dist/runtime/public/islands/frame-editor-chunk-c2b9018371100824.js.gz +0 -0
  434. package/dist/runtime/public/islands/image-map-a9f95f7e8d0712c1.js.br +0 -0
  435. package/dist/runtime/public/islands/image-map-a9f95f7e8d0712c1.js.gz +0 -0
  436. package/dist/runtime/public/islands/kit-basic-cbabcc4b41d6132a.js.br +0 -0
  437. package/dist/runtime/public/islands/kit-basic-cbabcc4b41d6132a.js.gz +0 -0
  438. package/dist/runtime/public/islands/kit-cells-cefbceccdfd0dbe0.js.br +0 -0
  439. package/dist/runtime/public/islands/kit-cells-cefbceccdfd0dbe0.js.gz +0 -0
  440. package/dist/runtime/public/islands/kit-controls-81d17a10f9d457f2.js.br +0 -0
  441. package/dist/runtime/public/islands/kit-controls-81d17a10f9d457f2.js.gz +0 -0
  442. package/dist/runtime/public/islands/kit-data-43947f36f1c501aa.js.br +0 -0
  443. package/dist/runtime/public/islands/kit-data-43947f36f1c501aa.js.gz +0 -0
  444. package/dist/runtime/public/islands/kit-dialog-eedc51ce82feec4b.js.br +0 -0
  445. package/dist/runtime/public/islands/kit-dialog-eedc51ce82feec4b.js.gz +0 -0
  446. package/dist/runtime/public/islands/kit-embed-3c8886cbfa06f74d.js.br +0 -0
  447. package/dist/runtime/public/islands/kit-embed-3c8886cbfa06f74d.js.gz +0 -0
  448. package/dist/runtime/public/islands/kit-files-b7a2cb758f00a68b.js.br +0 -0
  449. package/dist/runtime/public/islands/kit-files-b7a2cb758f00a68b.js.gz +0 -0
  450. package/dist/runtime/public/islands/kit-image-126e12fcae4215c1.js.br +0 -0
  451. package/dist/runtime/public/islands/kit-image-126e12fcae4215c1.js.gz +0 -0
  452. package/dist/runtime/public/islands/kit-people-5b6f5dd4aa82b657.js.br +0 -0
  453. package/dist/runtime/public/islands/kit-people-5b6f5dd4aa82b657.js.gz +0 -0
  454. package/dist/runtime/public/islands/kit-static-28174bd8f593f8c0.js.br +0 -0
  455. package/dist/runtime/public/islands/kit-static-28174bd8f593f8c0.js.gz +0 -0
  456. package/dist/runtime/public/islands/morph-engine-4e664485be475dbf.js.br +0 -0
  457. package/dist/runtime/public/islands/morph-engine-4e664485be475dbf.js.gz +0 -0
  458. package/dist/runtime/public/islands/offline-4446a94ed9f706c3.json.gzip +0 -0
  459. package/dist/runtime/public/islands/page-5f87c34c7c181387.js.br +0 -0
  460. package/dist/runtime/public/islands/page-5f87c34c7c181387.js.gz +0 -0
  461. package/dist/runtime/public/islands/rt-30ff0d94ee3732a1.js.br +0 -0
  462. package/dist/runtime/public/islands/rt-30ff0d94ee3732a1.js.gz +0 -0
  463. package/dist/runtime/public/islands/sqlite-engine-9fc56fea8b1e2aaf.js.br +0 -0
  464. package/dist/runtime/public/islands/sqlite-engine-9fc56fea8b1e2aaf.js.gz +0 -0
  465. package/dist/runtime/public/islands/ssr-456cabbcb26f723d.js.br +0 -0
  466. package/dist/runtime/public/islands/ssr-456cabbcb26f723d.js.gz +0 -0
  467. package/dist/runtime/public/islands/url-sync-74b5212f7b3417d7.js.br +0 -0
  468. package/dist/runtime/public/islands/url-sync-74b5212f7b3417d7.js.gz +0 -0
@@ -1 +1 @@
1
- import{D as e,I as t,M as n,T as r,_ as i,a,b as o,i as s,k as c,l,o as u,p as d,s as f,z as p}from"./web-Ckpee-ZJ.js";import{t as m}from"./copy-PNNAtmJH.js";import{t as h}from"./AvatarCircle-MNnIhRvg.js";import{A as g,C as _,G as v,K as y,S as b,X as x,Y as S,Z as C,b as w,d as T,h as E,l as D,q as ee}from"./solid-app-BtmRR9Ax.js";import{t as te}from"./ConfirmDialog-Ph1VDgNN.js";import{t as ne}from"./copy-text-BWnoOWaK.js";var re=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]],ie=e=>r(v,t(e,{iconNode:re,name:`ban`})),O=d(`<p role=status>`),k=d(`<section><form class="mt-2 flex items-center gap-2"><span class="w-4 text-center font-mono text-sm text-muted">@</span><span class="min-w-0 flex-1 sm:max-w-72"><input aria-label=Username autocomplete=off class="w-full rounded-[4px] border border-edge bg-surface px-3 py-2 text-sm"></span><button type=submit aria-label="Save username"class="rounded-[4px] border border-fg bg-fg px-3 py-1.5 font-mono text-xs font-semibold text-bg">save</button></form><p class="mt-2 ml-6 font-mono text-[11px] text-faint">your documents live at <span class=text-muted>/@<!>/…</span></p><p class="mt-1 ml-6 font-mono text-xs leading-relaxed text-muted">Renaming is safe: links already shared keep working — every URL resolves by the document’s id and corrects itself to the new handle.`),A={username_taken:`that handle is taken — pick another`,invalid_username:`3–32 characters: lowercase letters, numbers, underscore (no hyphens)`};function j(t){let[i,a]=n(``),[d,f]=n(null),[p,m]=n(!1);e(()=>a(t.username??``));let h=async()=>{m(!0),f(null);let e=await D(`/api/my/profile`,`PATCH`,{username:i()}).catch(()=>null);if(m(!1),!e){f(`could not reach the server`);return}let t=await e.json().catch(()=>({}));if(e.ok&&t.username){a(t.username),f(`saved`),S(),x();return}f(A[t.error??``]??`could not save that handle`)};return(()=>{var e=k(),t=e.firstChild,n=t.firstChild.nextSibling,f=n.firstChild,m=n.nextSibling,g=t.nextSibling,_=g.firstChild.nextSibling,v=_.firstChild.nextSibling;return v.nextSibling,g.nextSibling,s(e,`${b} p-4`),u(e,r(w,{children:`handle`}),t),t.addEventListener(`submit`,e=>{e.preventDefault(),h()}),f.$$input=e=>a(e.currentTarget.value),l(f,`spellcheck`,!1),u(_,()=>i()||`handle`,v),u(e,r(o,{get when(){return d()},get children(){var e=O();return u(e,d),c(()=>s(e,`mt-2 ml-6 font-mono text-xs ${d()===`saved`?`text-accent`:`text-danger`}`)),e}}),null),c(()=>m.disabled=p()||!i().trim()),c(()=>f.value=i()),e})()}a([`input`]);var M=d(`<p role=alert class="mt-3 text-sm text-danger"> <button>Retry`),N=d(`<div class="mt-5 border-t border-edge pt-4"><h3 class="mb-3 text-sm font-medium">Invitations</h3><label class="flex cursor-pointer items-start gap-3 text-sm"><input type=checkbox class="mt-1 accent-accent"><span>Automatically accept invitations from people I follow.<span class="mt-1 block text-xs leading-5 text-muted">You can review invitations from everyone else before joining.`),P=d(`<fieldset class="mt-5 space-y-3 border-t border-edge pt-4"><legend class="text-sm font-medium">Email notifications`),F=d(`<p role=status class="mt-3 text-xs text-muted">`),I=d(`<div class="mt-5 border-t border-edge pt-4"><h3 class="mb-2 text-sm font-medium">Blocked people`),L=d(`<section id=notifications aria-label="Notification settings"class="rounded-lg border border-edge bg-surface p-5 font-sans"><div class="flex flex-wrap items-center justify-between gap-2"><h2 class="text-base font-semibold">Notification settings</h2><a href=/notifications class="text-sm text-muted hover:text-fg">All notifications</a></div><p class="mt-1 text-sm text-muted">Choose how invitations and updates reach you.`),R=d(`<label class="flex cursor-pointer items-start gap-3 text-sm"><input type=checkbox class="mt-1 accent-accent"><span>`),z=d(`<div class="flex items-center justify-between py-2"><span class=text-sm>@</span><button type=button>Unblock`),B=[`invitations`,`comments`,`activity`],V={invitations:`Invitations`,comments:`Unread comment updates`,activity:`Likes and follows`};function H(){let e=T(),[t,a]=n(null),[s,l]=n(!1),[d,f]=n(``);p(()=>{fetch(`/api/my/people/email`).then(e=>e.ok?e.json():null).then(e=>{e?.enabled&&e.preferences&&a(e.preferences)}).catch(()=>{})});let m=async e=>{l(!0),f(``);try{let t=await D(`/api/my/people/email`,`PATCH`,e);if(!t.ok)throw Error();let n=await t.json();a(n.preferences),f(`Saved`)}catch{f(`Could not save email preferences. Try again.`)}finally{l(!1)}};return(()=>{var n=L();return n.firstChild.nextSibling,u(n,r(o,{get when(){return e.error()},get children(){var t=M(),n=t.firstChild,r=n.nextSibling;return u(t,()=>e.error(),n),r.$$click=()=>void e.load(),t}}),null),u(n,r(o,{get when(){return e.state()},get children(){var t=N(),n=t.firstChild.nextSibling.firstChild;return n.addEventListener(`change`,t=>void e.load({autoAccept:t.currentTarget.checked})),c(()=>n.checked=e.state()?.autoAccept),t}}),null),u(n,r(o,{get when(){return t()},get children(){var e=P();return e.firstChild,u(e,r(i,{each:B,children:e=>(()=>{var n=R(),r=n.firstChild,i=r.nextSibling;return r.addEventListener(`change`,n=>void m({...t(),[e]:n.currentTarget.checked})),u(i,()=>V[e]),c(()=>r.checked=t()?.[e]),n})()}),null),c(()=>e.disabled=s()),e}}),null),u(n,r(o,{get when(){return d()},get children(){var e=F();return u(e,d),e}}),null),u(n,r(o,{get when(){return e.state()?.blocks.length},get children(){var t=I();return t.firstChild,u(t,r(i,{get each(){return e.state()?.blocks},children:t=>(()=>{var n=z(),r=n.firstChild;r.firstChild;var i=r.nextSibling;return u(r,()=>t.username??t.user_id,null),i.$$click=()=>void e.load({unblock:t.user_id}),n})()}),null),t}}),null),n})()}a([`click`]);var U=d(`<button type=button class="shrink-0 rounded-md p-1.5 text-muted hover:bg-raised">`),W=d(`<tr class="border-t border-edge align-top"><td class="py-2 pr-3 font-mono text-xs text-muted"></td><td class="py-2 pr-3"><span class="flex items-center gap-1 break-all font-mono text-xs"></span></td><td class=py-2><span class="flex items-center gap-1 break-all font-mono text-xs">`),G=d(`<section aria-labelledby=custom-domain-heading><h2 id=custom-domain-heading class="text-base font-semibold"><span class=text-accent>&gt;</span> custom domain</h2><p class="mt-2 font-mono text-sm leading-relaxed text-muted">Serve your public documents at your own domain: its home page lists them, and each one is a post without app chrome.</p><div>`),K=d(`<form class="flex items-center gap-2"><input aria-label="Custom domain"placeholder=blog.example.com autocomplete=off class="min-w-0 flex-1 rounded-[4px] border border-edge bg-surface px-3 py-2 text-sm"><button type=submit aria-label="Add custom domain">add`),q=d(`<div class="flex flex-wrap items-center gap-2"><span class="font-mono text-sm">`),J=d(`<p role=alert class="mt-2 font-mono text-xs text-danger">The TXT record is missing. Put it back within three days of <!> or the domain is detached.`),Y=d(`<p class="mt-3 font-mono text-xs leading-relaxed text-muted">`),ae=d(`<table class="mt-2 w-full border-collapse text-left"aria-label="DNS records"><thead><tr class="font-mono text-[11px] uppercase tracking-wide text-faint"><th scope=col class="pb-1 pr-3 font-normal">type</th><th scope=col class="pb-1 pr-3 font-normal">name</th><th scope=col class="pb-1 font-normal">value</th></tr></thead><tbody>`),oe=d(`<p class="mt-2 font-mono text-[11px] leading-relaxed text-faint">A bare domain cannot take a CNAME. Use ALIAS, ANAME or CNAME flattening if your DNS host offers it; otherwise add the A record.`),se=d(`<button type=button aria-label="Verify custom domain">verify`),ce=d(`<div class="mt-4 flex items-center gap-2"><button type=button aria-label="Remove custom domain">remove`),le=d(`<p class="mt-2 font-mono text-xs text-muted">Verification is paused on this server right now; your domain will wait.`),ue=d(`<p role=status>`),de={invalid_hostname:`enter a domain name like blog.example.com — no https://, path or port, and not an artifactbin address`,taken:`another account already uses that domain`,limit:`an account holds one domain — remove this one first`,disabled:`custom domains are not available on this server right now`};function fe(e,t,n){switch(e){case`txt_missing`:return`The TXT record at ${t.txtName} with the value shown was not found yet. DNS changes can take a few minutes to appear.`;case`not_pointing`:return`${t.hostname} does not point at ${n??`our servers`} yet. If your DNS host proxies it (Cloudflare's orange cloud), set the record to DNS only.`;case`caa_blocks`:return`A CAA record on ${t.hostname} does not allow Let's Encrypt, which issues its certificate. Add a CAA record: 0 issue "letsencrypt.org".`;case`taken`:return`Another account has already verified ${t.hostname}.`;case`disabled`:return`Verification is paused on this server right now; your domain will wait.`;default:return`Could not verify that domain.`}}var X=e=>e.split(`.`).length===2;function Z(e){let[t,i]=n(!1),a=e=>{ne(e).then(e=>{e&&i(!0)})};return(()=>{var n=W(),i=n.firstChild,o=i.nextSibling,s=o.firstChild,d=o.nextSibling.firstChild;return u(i,()=>e.type),u(s,()=>e.name,null),u(s,r(g,{get content(){return t()?`Copied`:`Copy`},get children(){var t=U();return t.$$click=()=>a(e.name),u(t,r(m,{size:13})),c(()=>l(t,`aria-label`,`Copy ${e.what} name`)),t}}),null),u(d,()=>e.value,null),u(d,r(g,{get content(){return t()?`Copied`:`Copy`},get children(){var t=U();return t.$$click=()=>a(e.value),u(t,r(m,{size:13})),c(()=>l(t,`aria-label`,`Copy ${e.what} value`)),t}}),null),n})()}function pe(){let[e,t]=n(null),[a,d]=n(``),[m,h]=n(null),[g,_]=n(!1),v=async()=>{let e=await fetch(`/api/my/domain`,{cache:`no-store`}).catch(()=>null),n=e?.ok?await e.json().catch(()=>null):null;t(n&&typeof n.enabled==`boolean`?{...n,targetAddresses:n.targetAddresses??[]}:null)};p(()=>void v());let y=async(e,t,n)=>{_(!0),h(null);let r=await fetch(t,{method:e,headers:{"Content-Type":`application/json`},...n===void 0?{}:{body:JSON.stringify(n)}}).catch(()=>null);return _(!1),r},x=async()=>{let e=await y(`POST`,`/api/my/domain`,{hostname:a()});if(!e){h({tone:`error`,text:`could not reach the server`});return}let t=await e.json().catch(()=>({}));if(!e.ok){h({tone:`error`,text:de[t.error??``]??`could not add that domain`});return}d(``),await v()},S=async()=>{let t=e()?.domain;if(!t)return;let n=await y(`POST`,`/api/my/domain/verify`,{hostname:t.hostname});if(!n){h({tone:`error`,text:`could not reach the server`});return}let r=await n.json().catch(()=>({}));if(!n.ok){h({tone:`error`,text:fe(r.error??``,t,e()?.target??t.target)});return}h({tone:`ok`,text:`Verified. ${t.hostname} now serves your public documents.`}),await v()},C=async()=>{if(!(await y(`DELETE`,`/api/my/domain`))?.ok){h({tone:`error`,text:`could not remove the domain`});return}await v()},T=()=>e()?.domain,D=()=>e()?.target??T()?.target??null;return r(o,{get when(){return f(()=>!!e())()&&(e().enabled||e().domain)},get children(){var t=G(),n=t.firstChild.nextSibling.nextSibling;return s(n,`${b} mt-4 p-4`),u(n,r(o,{get when(){return T()},get fallback(){return(()=>{var e=K(),t=e.firstChild,n=t.nextSibling;return e.addEventListener(`submit`,e=>{e.preventDefault(),x()}),t.$$input=e=>d(e.currentTarget.value),l(t,`spellcheck`,!1),c(()=>n.disabled=g()||!a().trim()),c(()=>t.value=a()),e})()},children:t=>[(()=>{var e=q(),n=e.firstChild;return u(e,r(w,{children:`domain`}),n),u(n,()=>t().hostname),u(e,r(E,{get tone(){return t().status===`verified`?`accent`:`dim`},get children(){return t().status}}),null),e})(),r(o,{get when(){return f(()=>t().status===`verified`)()&&t().missingSince},get children(){var e=J(),n=e.firstChild.nextSibling;return n.nextSibling,u(e,()=>new Date(t().missingSince).toLocaleDateString(),n),e}}),(()=>{var e=Y();return u(e,()=>t().status===`verified`?`Keep these records in place at your DNS host:`:`Add these two records at your DNS host, then press verify:`),e})(),(()=>{var n=ae(),a=n.firstChild.nextSibling;return u(a,r(o,{get when(){return D()},children:n=>r(o,{get when(){return X(t().hostname)},get fallback(){return r(Z,{type:`CNAME`,get name(){return t().hostname},get value(){return n()},what:`routing record`})},get children(){return[r(Z,{type:`ALIAS`,get name(){return t().hostname},get value(){return n()},what:`routing record`}),r(i,{get each(){return e()?.targetAddresses.filter(e=>!e.includes(`:`))},children:e=>r(Z,{type:`A`,get name(){return t().hostname},value:e,what:`A record`})})]}})}),null),u(a,r(Z,{type:`TXT`,get name(){return t().txtName},get value(){return t().txtValue},what:`TXT record`}),null),n})(),r(o,{get when(){return f(()=>!!D())()&&X(t().hostname)},get children(){return oe()}}),(()=>{var t=ce(),n=t.firstChild;return u(t,r(o,{get when(){return e()?.enabled},get children(){var e=se();return e.$$click=()=>void S(),c(()=>e.disabled=g()),e}}),n),n.$$click=()=>void C(),c(()=>n.disabled=g()),t})(),r(o,{get when(){return f(()=>!e()?.enabled)()&&t().status===`pending`},get children(){return le()}})]}),null),u(n,r(o,{get when(){return m()},children:e=>(()=>{var t=ue();return u(t,()=>e().text),c(()=>s(t,`mt-3 font-mono text-xs leading-relaxed ${e().tone===`ok`?`text-accent`:`text-danger`}`)),t})()}),null),t}})}a([`click`,`input`]);var me=d(`<section><div><table class="w-full table-fixed border-collapse text-left text-sm"><thead><tr></tr></thead><tbody>`),he=d(`<th class="px-2 py-2.5 sm:px-4">`),ge=d(`<button type=button class="inline-flex items-center gap-1 text-xs text-danger">revoke`),_e=d(`<tr><td class="px-2 py-2 sm:px-4"><span></span></td><td class="px-2 py-2 text-xs text-muted sm:px-4"></td><td class="px-2 py-2 text-xs text-muted sm:px-4"></td><td class="px-2 py-2 text-xs text-muted sm:px-4"></td><td class="px-2 py-2 sm:px-4">`),ve=d(`<span class="text-xs text-faint">—`);function Q(e){if(e===null)return`never`;let t=new Date(e).getTime()-Date.now(),n=Math.abs(t),[r,i]=n<36e5?[Math.max(1,Math.floor(n/6e4)),`m`]:n<864e5?[Math.floor(n/36e5),`h`]:[Math.floor(n/864e5),`d`];return t>0?`in ${r}${i}`:`${r}${i} ago`}function ye(){let e=y(`/api/my/tokens`),[t,a]=n(null),[d,f]=n(!1),[p,m]=n(``),h=async()=>{let n=t();if(!n||d())return;f(!0),m(``);let r=await fetch(`/api/my/tokens/${n.id}`,{method:`DELETE`}).catch(()=>null);if(f(!1),!r?.ok){m(`Could not revoke that token. Try again.`);return}a(null),await e.refresh(!0)};return r(o,{get when(){return e.data()?.tokens.length},get children(){var n=me(),f=n.firstChild,m=f.firstChild.firstChild,g=m.firstChild,v=m.nextSibling;return u(n,r(o,{get when(){return t()},children:e=>r(te,{get title(){return`Revoke “${e().name??e().id}”?`},description:`Agents using this token will stop working immediately. This cannot be undone.`,action:`Revoke token`,confirmLabel:`Confirm revoke`,danger:!0,get busy(){return d()},get error(){return p()},onCancel:()=>a(null),onConfirm:()=>void h()})}),f),s(f,b),u(g,r(i,{each:[`name`,`status`,`expires`,`last used`,`action`],children:e=>(()=>{var t=he();return u(t,r(w,{children:e})),t})()})),u(v,r(i,{get each(){return e.data()?.tokens},children:e=>(()=>{var t=_e(),n=t.firstChild,i=n.firstChild,d=n.nextSibling,f=d.nextSibling,p=f.nextSibling,m=p.nextSibling;return s(t,`${_} reveal`),u(n,()=>e.name??`(unnamed)`,null),u(d,()=>e.status),u(f,()=>Q(e.expires_at)),u(p,()=>Q(e.last_used_at)),u(m,r(o,{get when(){return e.status!==`revoked`},get fallback(){return ve()},get children(){var t=ge(),n=t.firstChild;return t.$$click=()=>a(e),u(t,r(ie,{size:11}),n),c(()=>l(t,`aria-label`,`Revoke token ${e.name??e.id}`)),t}})),c(n=>{var r=`Token row ${e.name??e.id}`,a=`Token ${e.name??e.id} ${e.status} status dot`,o=`mr-2 inline-block h-1.5 w-1.5 rounded-full ${e.status===`active`?`bg-accent`:e.status===`expired`?`bg-danger`:`bg-faint`}`,c=`Token ${e.name??e.id} status`,u=`Token ${e.name??e.id} expires`,m=`Token ${e.name??e.id} last used`;return r!==n.e&&l(t,`aria-label`,n.e=r),a!==n.t&&l(i,`aria-label`,n.t=a),o!==n.a&&s(i,n.a=o),c!==n.o&&l(d,`aria-label`,n.o=c),u!==n.i&&l(f,`aria-label`,n.i=u),m!==n.n&&l(p,`aria-label`,n.n=m),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()})),n}})}a([`click`]);var be=d(`<p class="mt-3 font-mono text-xs text-danger"aria-label="Upload error">`),xe=d(`<div class="rounded-[6px] border border-edge bg-surface p-4"><p class="font-mono text-xs text-fg">Add data</p><p class="mt-1 font-mono text-xs text-muted">A CSV file or a public Google Sheet. You’ll get a reference to use in a chart.</p><div class="mt-3 flex flex-col gap-2"><input type=text aria-label="Dataset name"placeholder="name (optional — defaults to the file or sheet)"class="rounded-[4px] border border-edge bg-surface px-3 py-2 text-sm"><label aria-label="Upload a CSV"class="cursor-pointer rounded-[4px] border border-dashed border-edge-bright px-3 py-2 text-center font-mono text-xs text-muted hover:text-accent"><input type=file accept=.csv,text/csv aria-label="CSV file"class=hidden></label><form class="flex gap-2"><input type=url aria-label="Google Sheet URL"placeholder="or paste a public Google Sheet link"class="min-w-0 flex-1 rounded-[4px] border border-edge bg-surface px-3 py-2 text-sm"><button type=submit aria-label="Import sheet"class="rounded-[4px] border border-fg bg-fg px-3 py-1.5 font-mono text-xs text-bg">import`),Se=d(`<span class=text-muted> · <!> rows`),Ce=d(`<span class=text-muted>copied`),we=d(`<p class="mt-2 font-mono text-xs text-muted"aria-label="Truncation notice">Kept the first <!> of <!> rows.`),Te=d(`<div class=mt-3 aria-label="Dataset preview"><div class="max-h-72 overflow-auto rounded-[4px] border border-edge"><table class="w-full border-collapse font-mono text-[11px]"><thead class="sticky top-0 bg-surface"><tr></tr></thead><tbody></tbody></table></div><p class="mt-1 font-mono text-[11px] text-faint"aria-label="Preview notice">Previewing <!> of <!> stored rows.`),Ee=d(`<p class="mt-2 font-mono text-[11px] text-muted"aria-label="Dataset columns">`),De=d(`<div class="mt-3 rounded-[4px] border border-edge bg-raised p-3"aria-label="Uploaded dataset"><p class="font-mono text-xs text-fg"></p><button type=button aria-label="Copy dataset reference"class="mt-2 w-full rounded-[4px] border border-edge px-2 py-1 text-left font-mono text-xs text-accent">ref:<!> `),$=d(`<th class="border-b border-edge px-2 py-1 text-left font-medium text-fg whitespace-nowrap"><span class="ml-1 font-normal text-faint">`),Oe=d(`<tr class=odd:bg-raised/40>`),ke=d(`<td class="border-b border-edge px-2 py-1 text-muted whitespace-nowrap">`);function Ae(){let[e,t]=n(!1),[a,s]=n(null),[l,d]=n(null),[p,m]=n(``),[h,g]=n(``),[_,v]=n(!1),[y,b]=n(null),x=async e=>{t(!0),s(null);try{let t=await D(`/api/my/artifacts`,`POST`,e),n=await t.json().catch(()=>({}));if(!t.ok){s(n.details?.[0]??n.error??`Upload failed.`);return}if(d({id:n.id,title:n.title??null,columns:n.columns??[],rowCount:n.rowCount??null,totalRows:n.totalRows,truncated:n.truncated}),b(null),n.id)try{let e=await(await fetch(`/a/${n.id}/raw`)).json();Array.isArray(e)&&b(e.slice(0,100))}catch{}}catch(e){s(e instanceof Error&&e.message?e.message:`Could not reach the server.`)}finally{t(!1)}},S=async e=>x({title:h().trim()||e.name.replace(/\.csv$/i,``),dataset:await e.text()}),C=()=>{if(h().trim())return h().trim();let e=/\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/.exec(p())?.[1];return e?`Sheet ${e.slice(0,8)}`:`Imported sheet`};return(()=>{var t=xe(),n=t.firstChild.nextSibling.nextSibling.firstChild,s=n.nextSibling,d=s.firstChild,b=s.nextSibling,w=b.firstChild,T=w.nextSibling;return n.$$input=e=>g(e.currentTarget.value),u(s,()=>e()?`uploading…`:`choose a CSV file`,d),d.addEventListener(`change`,e=>{let t=e.currentTarget.files?.[0];t&&S(t)}),b.addEventListener(`submit`,e=>{e.preventDefault(),x({title:C(),sheetUrl:p()})}),w.$$input=e=>m(e.currentTarget.value),u(t,r(o,{get when(){return a()},get children(){var e=be();return u(e,a),e}}),null),u(t,r(o,{get when(){return l()},children:e=>(()=>{var t=De(),n=t.firstChild,a=n.nextSibling,s=a.firstChild.nextSibling;return s.nextSibling,u(n,()=>e().title??`dataset`,null),u(n,r(o,{get when(){return e().rowCount!==null},get children(){var t=Se(),n=t.firstChild.nextSibling;return n.nextSibling,u(t,()=>e().rowCount,n),t}}),null),a.$$click=()=>{navigator.clipboard?.writeText(`ref:${e().id}`),v(!0)},u(a,()=>e().id,s),u(a,r(o,{get when(){return _()},get children(){return Ce()}}),null),u(t,r(o,{get when(){return e().truncated},get children(){var t=we(),n=t.firstChild.nextSibling,r=n.nextSibling.nextSibling;return r.nextSibling,u(t,()=>e().rowCount?.toLocaleString(),n),u(t,()=>e().totalRows?.toLocaleString(),r),t}}),null),u(t,r(o,{get when(){return y()?.length},get children(){var t=Te(),n=t.firstChild,a=n.firstChild.firstChild,o=a.firstChild,s=a.nextSibling,c=n.nextSibling,l=c.firstChild.nextSibling,d=l.nextSibling.nextSibling;return d.nextSibling,u(o,r(i,{get each(){return e().columns},children:e=>(()=>{var t=$(),n=t.firstChild;return u(t,()=>e.name,n),u(n,()=>e.type),t})()})),u(s,r(i,{get each(){return y()},children:t=>(()=>{var n=Oe();return u(n,r(i,{get each(){return e().columns},children:e=>(()=>{var n=ke();return u(n,(()=>{var n=f(()=>t[e.name]==null);return()=>n()?`—`:String(t[e.name])})()),n})()})),n})()})),u(c,()=>y()?.length,l),u(c,()=>e().rowCount?.toLocaleString(),d),t}}),null),u(t,r(o,{get when(){return e().columns.length},get children(){var t=Ee();return u(t,()=>e().columns.map(e=>`${e.name}:${e.type}`).join(` `)),t}}),null),t})()}),null),c(t=>{var n=e(),r=e()||!p();return n!==t.e&&(d.disabled=t.e=n),r!==t.t&&(T.disabled=t.t=r),t},{e:void 0,t:void 0}),c(()=>n.value=h()),c(()=>w.value=p()),t})()}a([`input`,`click`]);var je=d(`<button aria-label="Retry account">Could not refresh account. Retry`),Me=d(`<main class="mx-auto mt-8 max-w-3xl px-6 pb-24"><h1 class="text-base font-semibold"><span class=text-accent>&gt;</span> account</h1><div class=mt-6></div><div class=mt-6></div><div class=mt-8></div><div class="mt-8 empty:hidden"></div><h2 class="mt-8 text-base font-semibold"><span class=text-accent>&gt;</span> connections</h2><p class="mt-2 font-mono text-sm leading-relaxed text-muted">Each row is one afbin CLI connection, made by approving it in this browser. Revoke one and that agent stops. Run <code>afbin auth</code> on a machine to add another.</p><div class=mt-6></div><h2 class="mt-8 text-base font-semibold"><span class=text-accent>&gt;</span> data</h2><div class=mt-4>`);function Ne(){let{session:e}=ee(),t=y(`/api/page/account`);return r(o,{get when(){return!e()||!!e()?.user},get fallback(){return r(C,{href:`/login?callbackUrl=/account`})},get children(){var n=Me(),i=n.firstChild.nextSibling,a=i.nextSibling,s=a.nextSibling,c=s.nextSibling,l=c.nextSibling.nextSibling.nextSibling,d=l.nextSibling.nextSibling;return u(n,r(o,{get when(){return t.error()},get children(){var e=je();return e.$$click=()=>void t.refresh(!0),e}}),i),u(i,r(h,{get image(){return t.data()?.image??null},get initial(){return t.data()?.username??`a`},get userId(){return e()?.user?.id??``},onChange:()=>void t.refresh(!0),onRemove:()=>void t.refresh(!0)})),u(a,r(j,{get username(){return t.data()?.username??null}})),u(s,r(H,{})),u(c,r(pe,{})),u(l,r(ye,{})),u(d,r(Ae,{})),n}})}a([`click`]);export{Ne as AccountPage};
1
+ import{D as e,I as t,M as n,T as r,_ as i,a,b as o,i as s,k as c,l,o as u,p as d,s as f,z as p}from"./web-Ckpee-ZJ.js";import{t as m}from"./copy-v5iTV3kk.js";import{t as h}from"./AvatarCircle-CBpOuCGy.js";import{A as g,C as _,G as v,K as y,S as b,X as x,Y as S,Z as C,b as w,d as T,h as E,l as D,q as ee}from"./solid-app-BNcsMwv4.js";import{t as te}from"./ConfirmDialog-hdkXS1mg.js";import{t as ne}from"./copy-text-BWnoOWaK.js";var re=[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]],ie=e=>r(v,t(e,{iconNode:re,name:`ban`})),O=d(`<p role=status>`),k=d(`<section><form class="mt-2 flex items-center gap-2"><span class="w-4 text-center font-mono text-sm text-muted">@</span><span class="min-w-0 flex-1 sm:max-w-72"><input aria-label=Username autocomplete=off class="w-full rounded-[4px] border border-edge bg-surface px-3 py-2 text-sm"></span><button type=submit aria-label="Save username"class="rounded-[4px] border border-fg bg-fg px-3 py-1.5 font-mono text-xs font-semibold text-bg">save</button></form><p class="mt-2 ml-6 font-mono text-[11px] text-faint">your documents live at <span class=text-muted>/@<!>/…</span></p><p class="mt-1 ml-6 font-mono text-xs leading-relaxed text-muted">Renaming is safe: links already shared keep working — every URL resolves by the document’s id and corrects itself to the new handle.`),A={username_taken:`that handle is taken — pick another`,invalid_username:`3–32 characters: lowercase letters, numbers, underscore (no hyphens)`};function j(t){let[i,a]=n(``),[d,f]=n(null),[p,m]=n(!1);e(()=>a(t.username??``));let h=async()=>{m(!0),f(null);let e=await D(`/api/my/profile`,`PATCH`,{username:i()}).catch(()=>null);if(m(!1),!e){f(`could not reach the server`);return}let t=await e.json().catch(()=>({}));if(e.ok&&t.username){a(t.username),f(`saved`),S(),x();return}f(A[t.error??``]??`could not save that handle`)};return(()=>{var e=k(),t=e.firstChild,n=t.firstChild.nextSibling,f=n.firstChild,m=n.nextSibling,g=t.nextSibling,_=g.firstChild.nextSibling,v=_.firstChild.nextSibling;return v.nextSibling,g.nextSibling,s(e,`${b} p-4`),u(e,r(w,{children:`handle`}),t),t.addEventListener(`submit`,e=>{e.preventDefault(),h()}),f.$$input=e=>a(e.currentTarget.value),l(f,`spellcheck`,!1),u(_,()=>i()||`handle`,v),u(e,r(o,{get when(){return d()},get children(){var e=O();return u(e,d),c(()=>s(e,`mt-2 ml-6 font-mono text-xs ${d()===`saved`?`text-accent`:`text-danger`}`)),e}}),null),c(()=>m.disabled=p()||!i().trim()),c(()=>f.value=i()),e})()}a([`input`]);var M=d(`<p role=alert class="mt-3 text-sm text-danger"> <button>Retry`),N=d(`<div class="mt-5 border-t border-edge pt-4"><h3 class="mb-3 text-sm font-medium">Invitations</h3><label class="flex cursor-pointer items-start gap-3 text-sm"><input type=checkbox class="mt-1 accent-accent"><span>Automatically accept invitations from people I follow.<span class="mt-1 block text-xs leading-5 text-muted">You can review invitations from everyone else before joining.`),P=d(`<fieldset class="mt-5 space-y-3 border-t border-edge pt-4"><legend class="text-sm font-medium">Email notifications`),F=d(`<p role=status class="mt-3 text-xs text-muted">`),I=d(`<div class="mt-5 border-t border-edge pt-4"><h3 class="mb-2 text-sm font-medium">Blocked people`),L=d(`<section id=notifications aria-label="Notification settings"class="rounded-lg border border-edge bg-surface p-5 font-sans"><div class="flex flex-wrap items-center justify-between gap-2"><h2 class="text-base font-semibold">Notification settings</h2><a href=/notifications class="text-sm text-muted hover:text-fg">All notifications</a></div><p class="mt-1 text-sm text-muted">Choose how invitations and updates reach you.`),R=d(`<label class="flex cursor-pointer items-start gap-3 text-sm"><input type=checkbox class="mt-1 accent-accent"><span>`),z=d(`<div class="flex items-center justify-between py-2"><span class=text-sm>@</span><button type=button>Unblock`),B=[`invitations`,`comments`,`activity`],V={invitations:`Invitations`,comments:`Unread comment updates`,activity:`Likes and follows`};function H(){let e=T(),[t,a]=n(null),[s,l]=n(!1),[d,f]=n(``);p(()=>{fetch(`/api/my/people/email`).then(e=>e.ok?e.json():null).then(e=>{e?.enabled&&e.preferences&&a(e.preferences)}).catch(()=>{})});let m=async e=>{l(!0),f(``);try{let t=await D(`/api/my/people/email`,`PATCH`,e);if(!t.ok)throw Error();let n=await t.json();a(n.preferences),f(`Saved`)}catch{f(`Could not save email preferences. Try again.`)}finally{l(!1)}};return(()=>{var n=L();return n.firstChild.nextSibling,u(n,r(o,{get when(){return e.error()},get children(){var t=M(),n=t.firstChild,r=n.nextSibling;return u(t,()=>e.error(),n),r.$$click=()=>void e.load(),t}}),null),u(n,r(o,{get when(){return e.state()},get children(){var t=N(),n=t.firstChild.nextSibling.firstChild;return n.addEventListener(`change`,t=>void e.load({autoAccept:t.currentTarget.checked})),c(()=>n.checked=e.state()?.autoAccept),t}}),null),u(n,r(o,{get when(){return t()},get children(){var e=P();return e.firstChild,u(e,r(i,{each:B,children:e=>(()=>{var n=R(),r=n.firstChild,i=r.nextSibling;return r.addEventListener(`change`,n=>void m({...t(),[e]:n.currentTarget.checked})),u(i,()=>V[e]),c(()=>r.checked=t()?.[e]),n})()}),null),c(()=>e.disabled=s()),e}}),null),u(n,r(o,{get when(){return d()},get children(){var e=F();return u(e,d),e}}),null),u(n,r(o,{get when(){return e.state()?.blocks.length},get children(){var t=I();return t.firstChild,u(t,r(i,{get each(){return e.state()?.blocks},children:t=>(()=>{var n=z(),r=n.firstChild;r.firstChild;var i=r.nextSibling;return u(r,()=>t.username??t.user_id,null),i.$$click=()=>void e.load({unblock:t.user_id}),n})()}),null),t}}),null),n})()}a([`click`]);var U=d(`<button type=button class="shrink-0 rounded-md p-1.5 text-muted hover:bg-raised">`),W=d(`<tr class="border-t border-edge align-top"><td class="py-2 pr-3 font-mono text-xs text-muted"></td><td class="py-2 pr-3"><span class="flex items-center gap-1 break-all font-mono text-xs"></span></td><td class=py-2><span class="flex items-center gap-1 break-all font-mono text-xs">`),G=d(`<section aria-labelledby=custom-domain-heading><h2 id=custom-domain-heading class="text-base font-semibold"><span class=text-accent>&gt;</span> custom domain</h2><p class="mt-2 font-mono text-sm leading-relaxed text-muted">Serve your public documents at your own domain: its home page lists them, and each one is a post without app chrome.</p><div>`),K=d(`<form class="flex items-center gap-2"><input aria-label="Custom domain"placeholder=blog.example.com autocomplete=off class="min-w-0 flex-1 rounded-[4px] border border-edge bg-surface px-3 py-2 text-sm"><button type=submit aria-label="Add custom domain">add`),q=d(`<div class="flex flex-wrap items-center gap-2"><span class="font-mono text-sm">`),J=d(`<p role=alert class="mt-2 font-mono text-xs text-danger">The TXT record is missing. Put it back within three days of <!> or the domain is detached.`),Y=d(`<p class="mt-3 font-mono text-xs leading-relaxed text-muted">`),ae=d(`<table class="mt-2 w-full border-collapse text-left"aria-label="DNS records"><thead><tr class="font-mono text-[11px] uppercase tracking-wide text-faint"><th scope=col class="pb-1 pr-3 font-normal">type</th><th scope=col class="pb-1 pr-3 font-normal">name</th><th scope=col class="pb-1 font-normal">value</th></tr></thead><tbody>`),oe=d(`<p class="mt-2 font-mono text-[11px] leading-relaxed text-faint">A bare domain cannot take a CNAME. Use ALIAS, ANAME or CNAME flattening if your DNS host offers it; otherwise add the A record.`),se=d(`<button type=button aria-label="Verify custom domain">verify`),ce=d(`<div class="mt-4 flex items-center gap-2"><button type=button aria-label="Remove custom domain">remove`),le=d(`<p class="mt-2 font-mono text-xs text-muted">Verification is paused on this server right now; your domain will wait.`),ue=d(`<p role=status>`),de={invalid_hostname:`enter a domain name like blog.example.com — no https://, path or port, and not an artifactbin address`,taken:`another account already uses that domain`,limit:`an account holds one domain — remove this one first`,disabled:`custom domains are not available on this server right now`};function fe(e,t,n){switch(e){case`txt_missing`:return`The TXT record at ${t.txtName} with the value shown was not found yet. DNS changes can take a few minutes to appear.`;case`not_pointing`:return`${t.hostname} does not point at ${n??`our servers`} yet. If your DNS host proxies it (Cloudflare's orange cloud), set the record to DNS only.`;case`caa_blocks`:return`A CAA record on ${t.hostname} does not allow Let's Encrypt, which issues its certificate. Add a CAA record: 0 issue "letsencrypt.org".`;case`taken`:return`Another account has already verified ${t.hostname}.`;case`disabled`:return`Verification is paused on this server right now; your domain will wait.`;default:return`Could not verify that domain.`}}var X=e=>e.split(`.`).length===2;function Z(e){let[t,i]=n(!1),a=e=>{ne(e).then(e=>{e&&i(!0)})};return(()=>{var n=W(),i=n.firstChild,o=i.nextSibling,s=o.firstChild,d=o.nextSibling.firstChild;return u(i,()=>e.type),u(s,()=>e.name,null),u(s,r(g,{get content(){return t()?`Copied`:`Copy`},get children(){var t=U();return t.$$click=()=>a(e.name),u(t,r(m,{size:13})),c(()=>l(t,`aria-label`,`Copy ${e.what} name`)),t}}),null),u(d,()=>e.value,null),u(d,r(g,{get content(){return t()?`Copied`:`Copy`},get children(){var t=U();return t.$$click=()=>a(e.value),u(t,r(m,{size:13})),c(()=>l(t,`aria-label`,`Copy ${e.what} value`)),t}}),null),n})()}function pe(){let[e,t]=n(null),[a,d]=n(``),[m,h]=n(null),[g,_]=n(!1),v=async()=>{let e=await fetch(`/api/my/domain`,{cache:`no-store`}).catch(()=>null),n=e?.ok?await e.json().catch(()=>null):null;t(n&&typeof n.enabled==`boolean`?{...n,targetAddresses:n.targetAddresses??[]}:null)};p(()=>void v());let y=async(e,t,n)=>{_(!0),h(null);let r=await fetch(t,{method:e,headers:{"Content-Type":`application/json`},...n===void 0?{}:{body:JSON.stringify(n)}}).catch(()=>null);return _(!1),r},x=async()=>{let e=await y(`POST`,`/api/my/domain`,{hostname:a()});if(!e){h({tone:`error`,text:`could not reach the server`});return}let t=await e.json().catch(()=>({}));if(!e.ok){h({tone:`error`,text:de[t.error??``]??`could not add that domain`});return}d(``),await v()},S=async()=>{let t=e()?.domain;if(!t)return;let n=await y(`POST`,`/api/my/domain/verify`,{hostname:t.hostname});if(!n){h({tone:`error`,text:`could not reach the server`});return}let r=await n.json().catch(()=>({}));if(!n.ok){h({tone:`error`,text:fe(r.error??``,t,e()?.target??t.target)});return}h({tone:`ok`,text:`Verified. ${t.hostname} now serves your public documents.`}),await v()},C=async()=>{if(!(await y(`DELETE`,`/api/my/domain`))?.ok){h({tone:`error`,text:`could not remove the domain`});return}await v()},T=()=>e()?.domain,D=()=>e()?.target??T()?.target??null;return r(o,{get when(){return f(()=>!!e())()&&(e().enabled||e().domain)},get children(){var t=G(),n=t.firstChild.nextSibling.nextSibling;return s(n,`${b} mt-4 p-4`),u(n,r(o,{get when(){return T()},get fallback(){return(()=>{var e=K(),t=e.firstChild,n=t.nextSibling;return e.addEventListener(`submit`,e=>{e.preventDefault(),x()}),t.$$input=e=>d(e.currentTarget.value),l(t,`spellcheck`,!1),c(()=>n.disabled=g()||!a().trim()),c(()=>t.value=a()),e})()},children:t=>[(()=>{var e=q(),n=e.firstChild;return u(e,r(w,{children:`domain`}),n),u(n,()=>t().hostname),u(e,r(E,{get tone(){return t().status===`verified`?`accent`:`dim`},get children(){return t().status}}),null),e})(),r(o,{get when(){return f(()=>t().status===`verified`)()&&t().missingSince},get children(){var e=J(),n=e.firstChild.nextSibling;return n.nextSibling,u(e,()=>new Date(t().missingSince).toLocaleDateString(),n),e}}),(()=>{var e=Y();return u(e,()=>t().status===`verified`?`Keep these records in place at your DNS host:`:`Add these two records at your DNS host, then press verify:`),e})(),(()=>{var n=ae(),a=n.firstChild.nextSibling;return u(a,r(o,{get when(){return D()},children:n=>r(o,{get when(){return X(t().hostname)},get fallback(){return r(Z,{type:`CNAME`,get name(){return t().hostname},get value(){return n()},what:`routing record`})},get children(){return[r(Z,{type:`ALIAS`,get name(){return t().hostname},get value(){return n()},what:`routing record`}),r(i,{get each(){return e()?.targetAddresses.filter(e=>!e.includes(`:`))},children:e=>r(Z,{type:`A`,get name(){return t().hostname},value:e,what:`A record`})})]}})}),null),u(a,r(Z,{type:`TXT`,get name(){return t().txtName},get value(){return t().txtValue},what:`TXT record`}),null),n})(),r(o,{get when(){return f(()=>!!D())()&&X(t().hostname)},get children(){return oe()}}),(()=>{var t=ce(),n=t.firstChild;return u(t,r(o,{get when(){return e()?.enabled},get children(){var e=se();return e.$$click=()=>void S(),c(()=>e.disabled=g()),e}}),n),n.$$click=()=>void C(),c(()=>n.disabled=g()),t})(),r(o,{get when(){return f(()=>!e()?.enabled)()&&t().status===`pending`},get children(){return le()}})]}),null),u(n,r(o,{get when(){return m()},children:e=>(()=>{var t=ue();return u(t,()=>e().text),c(()=>s(t,`mt-3 font-mono text-xs leading-relaxed ${e().tone===`ok`?`text-accent`:`text-danger`}`)),t})()}),null),t}})}a([`click`,`input`]);var me=d(`<section><div><table class="w-full table-fixed border-collapse text-left text-sm"><thead><tr></tr></thead><tbody>`),he=d(`<th class="px-2 py-2.5 sm:px-4">`),ge=d(`<button type=button class="inline-flex items-center gap-1 text-xs text-danger">revoke`),_e=d(`<tr><td class="px-2 py-2 sm:px-4"><span></span></td><td class="px-2 py-2 text-xs text-muted sm:px-4"></td><td class="px-2 py-2 text-xs text-muted sm:px-4"></td><td class="px-2 py-2 text-xs text-muted sm:px-4"></td><td class="px-2 py-2 sm:px-4">`),ve=d(`<span class="text-xs text-faint">—`);function Q(e){if(e===null)return`never`;let t=new Date(e).getTime()-Date.now(),n=Math.abs(t),[r,i]=n<36e5?[Math.max(1,Math.floor(n/6e4)),`m`]:n<864e5?[Math.floor(n/36e5),`h`]:[Math.floor(n/864e5),`d`];return t>0?`in ${r}${i}`:`${r}${i} ago`}function ye(){let e=y(`/api/my/tokens`),[t,a]=n(null),[d,f]=n(!1),[p,m]=n(``),h=async()=>{let n=t();if(!n||d())return;f(!0),m(``);let r=await fetch(`/api/my/tokens/${n.id}`,{method:`DELETE`}).catch(()=>null);if(f(!1),!r?.ok){m(`Could not revoke that token. Try again.`);return}a(null),await e.refresh(!0)};return r(o,{get when(){return e.data()?.tokens.length},get children(){var n=me(),f=n.firstChild,m=f.firstChild.firstChild,g=m.firstChild,v=m.nextSibling;return u(n,r(o,{get when(){return t()},children:e=>r(te,{get title(){return`Revoke “${e().name??e().id}”?`},description:`Agents using this token will stop working immediately. This cannot be undone.`,action:`Revoke token`,confirmLabel:`Confirm revoke`,danger:!0,get busy(){return d()},get error(){return p()},onCancel:()=>a(null),onConfirm:()=>void h()})}),f),s(f,b),u(g,r(i,{each:[`name`,`status`,`expires`,`last used`,`action`],children:e=>(()=>{var t=he();return u(t,r(w,{children:e})),t})()})),u(v,r(i,{get each(){return e.data()?.tokens},children:e=>(()=>{var t=_e(),n=t.firstChild,i=n.firstChild,d=n.nextSibling,f=d.nextSibling,p=f.nextSibling,m=p.nextSibling;return s(t,`${_} reveal`),u(n,()=>e.name??`(unnamed)`,null),u(d,()=>e.status),u(f,()=>Q(e.expires_at)),u(p,()=>Q(e.last_used_at)),u(m,r(o,{get when(){return e.status!==`revoked`},get fallback(){return ve()},get children(){var t=ge(),n=t.firstChild;return t.$$click=()=>a(e),u(t,r(ie,{size:11}),n),c(()=>l(t,`aria-label`,`Revoke token ${e.name??e.id}`)),t}})),c(n=>{var r=`Token row ${e.name??e.id}`,a=`Token ${e.name??e.id} ${e.status} status dot`,o=`mr-2 inline-block h-1.5 w-1.5 rounded-full ${e.status===`active`?`bg-accent`:e.status===`expired`?`bg-danger`:`bg-faint`}`,c=`Token ${e.name??e.id} status`,u=`Token ${e.name??e.id} expires`,m=`Token ${e.name??e.id} last used`;return r!==n.e&&l(t,`aria-label`,n.e=r),a!==n.t&&l(i,`aria-label`,n.t=a),o!==n.a&&s(i,n.a=o),c!==n.o&&l(d,`aria-label`,n.o=c),u!==n.i&&l(f,`aria-label`,n.i=u),m!==n.n&&l(p,`aria-label`,n.n=m),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()})),n}})}a([`click`]);var be=d(`<p class="mt-3 font-mono text-xs text-danger"aria-label="Upload error">`),xe=d(`<div class="rounded-[6px] border border-edge bg-surface p-4"><p class="font-mono text-xs text-fg">Add data</p><p class="mt-1 font-mono text-xs text-muted">A CSV file or a public Google Sheet. You’ll get a reference to use in a chart.</p><div class="mt-3 flex flex-col gap-2"><input type=text aria-label="Dataset name"placeholder="name (optional — defaults to the file or sheet)"class="rounded-[4px] border border-edge bg-surface px-3 py-2 text-sm"><label aria-label="Upload a CSV"class="cursor-pointer rounded-[4px] border border-dashed border-edge-bright px-3 py-2 text-center font-mono text-xs text-muted hover:text-accent"><input type=file accept=.csv,text/csv aria-label="CSV file"class=hidden></label><form class="flex gap-2"><input type=url aria-label="Google Sheet URL"placeholder="or paste a public Google Sheet link"class="min-w-0 flex-1 rounded-[4px] border border-edge bg-surface px-3 py-2 text-sm"><button type=submit aria-label="Import sheet"class="rounded-[4px] border border-fg bg-fg px-3 py-1.5 font-mono text-xs text-bg">import`),Se=d(`<span class=text-muted> · <!> rows`),Ce=d(`<span class=text-muted>copied`),we=d(`<p class="mt-2 font-mono text-xs text-muted"aria-label="Truncation notice">Kept the first <!> of <!> rows.`),Te=d(`<div class=mt-3 aria-label="Dataset preview"><div class="max-h-72 overflow-auto rounded-[4px] border border-edge"><table class="w-full border-collapse font-mono text-[11px]"><thead class="sticky top-0 bg-surface"><tr></tr></thead><tbody></tbody></table></div><p class="mt-1 font-mono text-[11px] text-faint"aria-label="Preview notice">Previewing <!> of <!> stored rows.`),Ee=d(`<p class="mt-2 font-mono text-[11px] text-muted"aria-label="Dataset columns">`),De=d(`<div class="mt-3 rounded-[4px] border border-edge bg-raised p-3"aria-label="Uploaded dataset"><p class="font-mono text-xs text-fg"></p><button type=button aria-label="Copy dataset reference"class="mt-2 w-full rounded-[4px] border border-edge px-2 py-1 text-left font-mono text-xs text-accent">ref:<!> `),$=d(`<th class="border-b border-edge px-2 py-1 text-left font-medium text-fg whitespace-nowrap"><span class="ml-1 font-normal text-faint">`),Oe=d(`<tr class=odd:bg-raised/40>`),ke=d(`<td class="border-b border-edge px-2 py-1 text-muted whitespace-nowrap">`);function Ae(){let[e,t]=n(!1),[a,s]=n(null),[l,d]=n(null),[p,m]=n(``),[h,g]=n(``),[_,v]=n(!1),[y,b]=n(null),x=async e=>{t(!0),s(null);try{let t=await D(`/api/my/artifacts`,`POST`,e),n=await t.json().catch(()=>({}));if(!t.ok){s(n.details?.[0]??n.error??`Upload failed.`);return}if(d({id:n.id,title:n.title??null,columns:n.columns??[],rowCount:n.rowCount??null,totalRows:n.totalRows,truncated:n.truncated}),b(null),n.id)try{let e=await(await fetch(`/a/${n.id}/raw`)).json();Array.isArray(e)&&b(e.slice(0,100))}catch{}}catch(e){s(e instanceof Error&&e.message?e.message:`Could not reach the server.`)}finally{t(!1)}},S=async e=>x({title:h().trim()||e.name.replace(/\.csv$/i,``),dataset:await e.text()}),C=()=>{if(h().trim())return h().trim();let e=/\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/.exec(p())?.[1];return e?`Sheet ${e.slice(0,8)}`:`Imported sheet`};return(()=>{var t=xe(),n=t.firstChild.nextSibling.nextSibling.firstChild,s=n.nextSibling,d=s.firstChild,b=s.nextSibling,w=b.firstChild,T=w.nextSibling;return n.$$input=e=>g(e.currentTarget.value),u(s,()=>e()?`uploading…`:`choose a CSV file`,d),d.addEventListener(`change`,e=>{let t=e.currentTarget.files?.[0];t&&S(t)}),b.addEventListener(`submit`,e=>{e.preventDefault(),x({title:C(),sheetUrl:p()})}),w.$$input=e=>m(e.currentTarget.value),u(t,r(o,{get when(){return a()},get children(){var e=be();return u(e,a),e}}),null),u(t,r(o,{get when(){return l()},children:e=>(()=>{var t=De(),n=t.firstChild,a=n.nextSibling,s=a.firstChild.nextSibling;return s.nextSibling,u(n,()=>e().title??`dataset`,null),u(n,r(o,{get when(){return e().rowCount!==null},get children(){var t=Se(),n=t.firstChild.nextSibling;return n.nextSibling,u(t,()=>e().rowCount,n),t}}),null),a.$$click=()=>{navigator.clipboard?.writeText(`ref:${e().id}`),v(!0)},u(a,()=>e().id,s),u(a,r(o,{get when(){return _()},get children(){return Ce()}}),null),u(t,r(o,{get when(){return e().truncated},get children(){var t=we(),n=t.firstChild.nextSibling,r=n.nextSibling.nextSibling;return r.nextSibling,u(t,()=>e().rowCount?.toLocaleString(),n),u(t,()=>e().totalRows?.toLocaleString(),r),t}}),null),u(t,r(o,{get when(){return y()?.length},get children(){var t=Te(),n=t.firstChild,a=n.firstChild.firstChild,o=a.firstChild,s=a.nextSibling,c=n.nextSibling,l=c.firstChild.nextSibling,d=l.nextSibling.nextSibling;return d.nextSibling,u(o,r(i,{get each(){return e().columns},children:e=>(()=>{var t=$(),n=t.firstChild;return u(t,()=>e.name,n),u(n,()=>e.type),t})()})),u(s,r(i,{get each(){return y()},children:t=>(()=>{var n=Oe();return u(n,r(i,{get each(){return e().columns},children:e=>(()=>{var n=ke();return u(n,(()=>{var n=f(()=>t[e.name]==null);return()=>n()?`—`:String(t[e.name])})()),n})()})),n})()})),u(c,()=>y()?.length,l),u(c,()=>e().rowCount?.toLocaleString(),d),t}}),null),u(t,r(o,{get when(){return e().columns.length},get children(){var t=Ee();return u(t,()=>e().columns.map(e=>`${e.name}:${e.type}`).join(` `)),t}}),null),t})()}),null),c(t=>{var n=e(),r=e()||!p();return n!==t.e&&(d.disabled=t.e=n),r!==t.t&&(T.disabled=t.t=r),t},{e:void 0,t:void 0}),c(()=>n.value=h()),c(()=>w.value=p()),t})()}a([`input`,`click`]);var je=d(`<button aria-label="Retry account">Could not refresh account. Retry`),Me=d(`<main class="mx-auto mt-8 max-w-3xl px-6 pb-24"><h1 class="text-base font-semibold"><span class=text-accent>&gt;</span> account</h1><div class=mt-6></div><div class=mt-6></div><div class=mt-8></div><div class="mt-8 empty:hidden"></div><h2 class="mt-8 text-base font-semibold"><span class=text-accent>&gt;</span> connections</h2><p class="mt-2 font-mono text-sm leading-relaxed text-muted">Each row is one afbin CLI connection, made by approving it in this browser. Revoke one and that agent stops. Run <code>afbin auth</code> on a machine to add another.</p><div class=mt-6></div><h2 class="mt-8 text-base font-semibold"><span class=text-accent>&gt;</span> data</h2><div class=mt-4>`);function Ne(){let{session:e}=ee(),t=y(`/api/page/account`);return r(o,{get when(){return!e()||!!e()?.user},get fallback(){return r(C,{href:`/login?callbackUrl=/account`})},get children(){var n=Me(),i=n.firstChild.nextSibling,a=i.nextSibling,s=a.nextSibling,c=s.nextSibling,l=c.nextSibling.nextSibling.nextSibling,d=l.nextSibling.nextSibling;return u(n,r(o,{get when(){return t.error()},get children(){var e=je();return e.$$click=()=>void t.refresh(!0),e}}),i),u(i,r(h,{get image(){return t.data()?.image??null},get initial(){return t.data()?.username??`a`},get userId(){return e()?.user?.id??``},onChange:()=>void t.refresh(!0),onRemove:()=>void t.refresh(!0)})),u(a,r(j,{get username(){return t.data()?.username??null}})),u(s,r(H,{})),u(c,r(pe,{})),u(l,r(ye,{})),u(d,r(Ae,{})),n}})}a([`click`]);export{Ne as AccountPage};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Program-D3-Gfvjo.js","assets/web-Ckpee-ZJ.js","assets/DocumentSharing-BuTXuflA.js","assets/chevron-down-COGO5cmx.js","assets/solid-app-BtmRR9Ax.js","assets/solid-app-BmdFnFpX.css","assets/src-CcX8uAQo.js","assets/artifact-reference-ChS4TSVz.js","assets/sharing-X_H561x5.js","assets/ConfirmDialog-Ph1VDgNN.js","assets/dialog-shell-D1Dv5nY8.js","assets/share-roles-c4EwFuyA.js","assets/copy-text-BWnoOWaK.js","assets/urls-DtkapM59.js","assets/DialogShell-BA3tWbeJ.js","assets/runtime-id-CM5my_RX.js","assets/Folder-DoNsFB2I.js","assets/WorkspaceLayout-fF_ot7EK.js","assets/ShareLink-n8KhtnaI.js","assets/database-CKOnpvwb.js","assets/Shelf-BgwHOaeW.js","assets/RowMenu-J4Gbci3B.js","assets/shelf-CeaX4iBg.js","assets/list-Dj3WErnh.js","assets/lock-B1nhk71f.js","assets/person-mentions-BEjAedYZ.js","assets/serialize-n0A-pNlo.js","assets/escape-CVx3RLA2.js","assets/http-C2exCIpl.js","assets/sign-in-required-7zEVbzx2.js","assets/search-agWZofH1.js","assets/browser-artifact-write-ZsGe-hXr.js","assets/document-update-client-DUF0zs2Z.js","assets/jsx-vj4cHW_Q.js","assets/annotation-range-DqD0nTBm.js","assets/eye-BNpzRKAK.js","assets/file-up-DH-HiKEX.js","assets/git-fork-PQOXxmWW.js","assets/users-BJrdLUkX.js","assets/plus-BtWrAD8F.js","assets/GetStarted-YjltMEeN.js","assets/copy-PNNAtmJH.js","assets/loader-circle-BXxJOPx-.js","assets/default-server-CJjQV_9Y.js","assets/agent-discovery-tags-DYoCR4DA.js","assets/ArtifactData-BdL9R2dA.js","assets/title-BqVxKtqW.js","assets/ForkArtifact-DDmXl1BZ.js","assets/file-display-CJZlQncv.js","assets/DatasetCatalogView-DBJEPKFI.js","assets/Starter-I01MNooi.js","assets/DocumentChrome-EUbW_JvA.js","assets/download-j-nqks7p.js","assets/document-navigation-CED4GpXl.js","assets/DatasetEditor-CMqN1duq.js","assets/AssetPageHeader-DX2RcYTv.js"])))=>i.map(i=>d[i]);
2
- import{D as e,F as t,S as n,T as r,a as i,b as a,i as o,o as s,p as c,y as l}from"./web-Ckpee-ZJ.js";import{$ as u,K as d,pt as f,t as p,tt as m,x as h}from"./solid-app-BtmRR9Ax.js";import{t as g}from"./document-navigation-CED4GpXl.js";import{NotFoundPage as _}from"./NotFound-svz4wCeL.js";var v=c(`<button type=button aria-label="Retry artifact">Could not load artifact. Retry`),y=c(`<main aria-label="Loading artifact">`),b=t(()=>p(()=>import(`./Program-D3-Gfvjo.js`).then(e=>({default:e.ProgramPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))),x=t(()=>p(()=>import(`./Folder-DoNsFB2I.js`).then(e=>({default:e.FolderPage})),__vite__mapDeps([16,1,17,3,4,5,18,12,14,10,19,20,21,22,23,24,25,26,27,6,7,28,29,30,31,32,33,34,15,9,35,36,37,38,39,11,40,41,42,43,44]))),S=t(()=>p(()=>import(`./ArtifactData-BdL9R2dA.js`).then(e=>({default:e.ArtifactDataPage})),__vite__mapDeps([45,1,2,3,4,5,6,7,8,9,10,11,12,13,14,28,29,46,47,37,48,49]))),C=t(()=>p(()=>import(`./Starter-I01MNooi.js`).then(e=>({default:e.StarterPage})),__vite__mapDeps([50,1,41,4,5,2,3,6,7,8,9,10,11,12,13,14,51,52,37,38,25,26,27,28,29,47,43,32,33,34,15,46,53]))),w=t(()=>p(()=>import(`./DatasetEditor-CMqN1duq.js`).then(e=>({default:e.DatasetEditorPage})),__vite__mapDeps([54,33,26,27,1,3,4,5,18,12,14,10,19,39,15,49,13,6,7,55]))),T=[`image`,`pdf`,`file`,`viz`,`dataset`],E=e=>!!e?.surface&&T.includes(e.surface.format),D=e=>e?.surface?.format===`markup`&&e.surface.starter===!0;function O(t){let i=m(),c=u(),p=()=>t.id??i.id,T=()=>t.editing??/\/edit\/?$/.test(c.pathname),O=f(window.location.pathname,`artifact`);if(T())return O?.surface?.format===`program`?r(b,{get artifactId(){return p()},get owner(){return O.role===`owner`}}):O?.folder?r(x,{get folder(){return O.folder},get role(){return O.role},get workspace(){return O.workspace},get ownerUsername(){return O.ownerUsername}}):D(O)?r(C,{answer:O}):E(O)&&O.surface.format!==`dataset`?r(S,{answer:O}):r(w,{get artifactId(){return p()}});let k=d(()=>`/api/page/artifact/${p()}`,{seed:()=>O}),A=()=>{let e=k.data();return!!e?.surface&&!e.folder&&!E(e)&&!D(e)&&e.surface.format!==`program`};return e(()=>{A()&&!O&&g(window.location.pathname+window.location.search+window.location.hash)}),r(n,{get fallback(){return(()=>{var e=y();return o(e,`${h} mt-8 pb-24`),s(e,r(a,{get when(){return k.error()},fallback:`Loading artifact…`,get children(){var e=v();return e.$$click=()=>void k.refresh(!0),e}})),e})()},get children(){return[r(l,{get when(){return k.error()?.status===404},get children(){return r(_,{})}}),r(l,{get when(){return k.data()?.folder},children:e=>r(x,{get folder(){return e()},get role(){return k.data().role},get workspace(){return k.data()?.workspace},get ownerUsername(){return k.data()?.ownerUsername}})}),r(l,{get when(){return D(k.data())},get children(){return r(C,{get answer(){return k.data()}})}}),r(l,{get when(){return k.data()?.surface?.format===`program`},get children(){return r(b,{get artifactId(){return p()},get owner(){return k.data()?.role===`owner`}})}}),r(l,{get when(){return E(k.data())},get children(){return r(S,{get answer(){return k.data()}})}}),r(l,{get when(){return A()&&O},get children(){return r(_,{})}})]}})}i([`click`]);export{O as ArtifactAddressRoute};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Program-CdwfK2zE.js","assets/web-Ckpee-ZJ.js","assets/DocumentSharing-BiTakFtn.js","assets/chevron-down-M1fHuk7u.js","assets/solid-app-BNcsMwv4.js","assets/solid-app-DRAhiXqs.css","assets/src-CcX8uAQo.js","assets/artifact-reference-ChS4TSVz.js","assets/sharing-X_H561x5.js","assets/ConfirmDialog-hdkXS1mg.js","assets/dialog-shell-D1Dv5nY8.js","assets/share-roles-c4EwFuyA.js","assets/copy-text-BWnoOWaK.js","assets/urls-DtkapM59.js","assets/DialogShell-BA3tWbeJ.js","assets/runtime-id-CM5my_RX.js","assets/Folder-B-OlCz39.js","assets/WorkspaceLayout-Qf3x5yOM.js","assets/ShareLink-qbYss_Eh.js","assets/database-BbH2eTSj.js","assets/Shelf-anhc5No9.js","assets/RowMenu-B2c9LyOb.js","assets/shelf-DUXW45ap.js","assets/list-CA_o21oZ.js","assets/lock-BRsIxNP2.js","assets/person-mentions-C7vQd7Vr.js","assets/serialize-n0A-pNlo.js","assets/escape-CVx3RLA2.js","assets/http-DEdzW08u.js","assets/sign-in-required-7zEVbzx2.js","assets/search-CmIkt7xE.js","assets/browser-artifact-write-CG72iseh.js","assets/document-update-client-td73lQ81.js","assets/jsx-vj4cHW_Q.js","assets/annotation-range-DqD0nTBm.js","assets/eye-DEiYMLrO.js","assets/file-up-GoLKOXxO.js","assets/git-fork-CN41g1lF.js","assets/users-Bm0xpNrq.js","assets/plus-BNzHjmEg.js","assets/GetStarted-CFsSvXR0.js","assets/copy-v5iTV3kk.js","assets/loader-circle-2p_rsu6P.js","assets/default-server-CJjQV_9Y.js","assets/agent-discovery-tags-DYoCR4DA.js","assets/ArtifactData-CZq-MLWc.js","assets/title-BqVxKtqW.js","assets/ForkArtifact-DXYU1-qL.js","assets/file-display-CJZlQncv.js","assets/DatasetCatalogView-DKNdjYA_.js","assets/Starter-DrID859q.js","assets/DocumentChrome-Bw4_z5yQ.js","assets/download-Dk3mxCBK.js","assets/document-navigation-CED4GpXl.js","assets/DatasetEditor-C22-4oJL.js","assets/AssetPageHeader-BqdRtu9K.js"])))=>i.map(i=>d[i]);
2
+ import{D as e,F as t,S as n,T as r,a as i,b as a,i as o,o as s,p as c,y as l}from"./web-Ckpee-ZJ.js";import{$ as u,K as d,pt as f,t as p,tt as m,x as h}from"./solid-app-BNcsMwv4.js";import{t as g}from"./document-navigation-CED4GpXl.js";import{NotFoundPage as _}from"./NotFound-D2MOGkIO.js";var v=c(`<button type=button aria-label="Retry artifact">Could not load artifact. Retry`),y=c(`<main aria-label="Loading artifact">`),b=t(()=>p(()=>import(`./Program-CdwfK2zE.js`).then(e=>({default:e.ProgramPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))),x=t(()=>p(()=>import(`./Folder-B-OlCz39.js`).then(e=>({default:e.FolderPage})),__vite__mapDeps([16,1,17,3,4,5,18,12,14,10,19,20,21,22,23,24,25,26,27,6,7,28,29,30,31,32,33,34,15,9,35,36,37,38,39,11,40,41,42,43,44]))),S=t(()=>p(()=>import(`./ArtifactData-CZq-MLWc.js`).then(e=>({default:e.ArtifactDataPage})),__vite__mapDeps([45,1,2,3,4,5,6,7,8,9,10,11,12,13,14,28,29,46,47,37,48,49]))),C=t(()=>p(()=>import(`./Starter-DrID859q.js`).then(e=>({default:e.StarterPage})),__vite__mapDeps([50,1,41,4,5,2,3,6,7,8,9,10,11,12,13,14,51,52,37,38,25,26,27,28,29,47,43,32,33,34,15,46,53]))),w=t(()=>p(()=>import(`./DatasetEditor-C22-4oJL.js`).then(e=>({default:e.DatasetEditorPage})),__vite__mapDeps([54,33,26,27,1,3,4,5,18,12,14,10,19,39,15,49,13,6,7,55]))),T=[`image`,`pdf`,`file`,`viz`,`dataset`],E=e=>!!e?.surface&&T.includes(e.surface.format),D=e=>e?.surface?.format===`markup`&&e.surface.starter===!0;function O(t){let i=m(),c=u(),p=()=>t.id??i.id,T=()=>t.editing??/\/edit\/?$/.test(c.pathname),O=f(window.location.pathname,`artifact`);if(T())return O?.surface?.format===`program`?r(b,{get artifactId(){return p()},get owner(){return O.role===`owner`}}):O?.folder?r(x,{get folder(){return O.folder},get role(){return O.role},get workspace(){return O.workspace},get ownerUsername(){return O.ownerUsername}}):D(O)?r(C,{answer:O}):E(O)&&O.surface.format!==`dataset`?r(S,{answer:O}):r(w,{get artifactId(){return p()}});let k=d(()=>`/api/page/artifact/${p()}`,{seed:()=>O}),A=()=>{let e=k.data();return!!e?.surface&&!e.folder&&!E(e)&&!D(e)&&e.surface.format!==`program`};return e(()=>{A()&&!O&&g(window.location.pathname+window.location.search+window.location.hash)}),r(n,{get fallback(){return(()=>{var e=y();return o(e,`${h} mt-8 pb-24`),s(e,r(a,{get when(){return k.error()},fallback:`Loading artifact…`,get children(){var e=v();return e.$$click=()=>void k.refresh(!0),e}})),e})()},get children(){return[r(l,{get when(){return k.error()?.status===404},get children(){return r(_,{})}}),r(l,{get when(){return k.data()?.folder},children:e=>r(x,{get folder(){return e()},get role(){return k.data().role},get workspace(){return k.data()?.workspace},get ownerUsername(){return k.data()?.ownerUsername}})}),r(l,{get when(){return D(k.data())},get children(){return r(C,{get answer(){return k.data()}})}}),r(l,{get when(){return k.data()?.surface?.format===`program`},get children(){return r(b,{get artifactId(){return p()},get owner(){return k.data()?.role===`owner`}})}}),r(l,{get when(){return E(k.data())},get children(){return r(S,{get answer(){return k.data()}})}}),r(l,{get when(){return A()&&O},get children(){return r(_,{})}})]}})}i([`click`]);export{O as ArtifactAddressRoute};
@@ -1 +1 @@
1
- import{D as e,M as t,R as n,T as r,_ as i,a,b as o,k as s,l as c,o as l,p as u,s as d,z as f}from"./web-Ckpee-ZJ.js";import{t as p}from"./DocumentSharing-BuTXuflA.js";import{E as m,Y as h,i as g,r as _}from"./solid-app-BtmRR9Ax.js";import{n as v}from"./http-C2exCIpl.js";import{t as y}from"./title-BqVxKtqW.js";import{r as b,t as ee}from"./ForkArtifact-DDmXl1BZ.js";import{i as te,r as ne}from"./share-roles-c4EwFuyA.js";import{t as re}from"./copy-text-BWnoOWaK.js";import{t as ie}from"./file-display-CJZlQncv.js";import{n as x}from"./DatasetCatalogView-DBJEPKFI.js";var S=e=>e?.tables.find(t=>t.schema===e.defaultSchema)??e?.tables[0],C=e=>`"${e.replaceAll(`"`,`""`)}"`,w=e=>{let t=S(e);return`${C(t?.schema??`public`)}.${C(t?.name??`rows`)}`},T=e=>e.replaceAll(`\\`,`\\\\`).replaceAll("`","\\`").replaceAll("${","\\${"),E=`data`,D=(e,t)=>`${e}.${C(S(t)?.name??`rows`)}`,O=(e,t)=>`<Import name="${e}" src="ref:${t}" />`;function k(e,t,n=`rows`){if(t?.kind===`postgres`)return`<Query name="${n}" source="ref:${e}">{\`SELECT * FROM ${T(w(t))}\`}</Query>`;let r=n===E?`dataset`:E;return`${O(r,e)}<Query name="${n}">{\`SELECT * FROM ${T(D(r,t))}\`}</Query>`}var A=u(`<section aria-label="Document actions"><h2 class="mb-1 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-faint">Artifact`),j=u(`<button type=button aria-label="Copy dataset reference"class="flex w-full cursor-pointer items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted transition-colors hover:bg-raised hover:text-fg text-accent">`),M=u(`<section aria-label="Owner actions"><h2 class="mb-1 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-faint">owner`),N=u(`<div class=space-y-4>`),P=u(`<p data-mx-forked-from class="px-2 py-2 font-mono text-xs text-muted">forked from `),F=u(`<a aria-label="Open the artifact this was forked from"class=underline>`),I=u(`<div class="mt-4 rounded-[6px] border border-edge bg-surface p-4"><p class="font-sans text-xs text-muted"></p><a target=_blank rel="noopener noreferrer"class="mt-2 inline-block font-sans text-sm underline underline-offset-2"> `),ae=u(`<span class=text-faint> · showing the first 50`),L=u(`<p class="mt-4 font-sans text-xs text-muted"aria-label="Dataset summary"> rows · <!> columns`),R=u(`<div class="mt-2 max-h-[70vh] overflow-auto rounded-[6px] border border-edge"><table class="w-full border-collapse font-mono text-xs"><thead class="sticky top-0 z-10 bg-raised"><tr class="border-b border-edge text-left text-faint"></tr></thead><tbody>`),z=u(`<pre class="mt-4 overflow-x-auto rounded-[6px] border border-edge bg-surface p-4 font-mono text-xs text-muted">`),B=u(`<main class="mx-auto w-full max-w-5xl px-4 pt-6 pb-6">`),V=u(`<img class="mt-4 max-w-full rounded-[6px] border border-edge">`),H=u(`<span class="ml-1.5 text-[10px] text-faint">`),U=u(`<th class="whitespace-nowrap px-3 py-2 font-normal">`),W=u(`<tr class="border-b border-edge/50 text-muted">`),G=u(`<td class="whitespace-nowrap px-3 py-1.5">`),K=u(`<span class=text-faint>—`),q=e=>{try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}};function J(a){let u=a.answer.surface,S=u.id,C=u.format,w=!!a.answer.archived,T=()=>te(a.answer.role)&&!w,E=()=>ne(a.answer.role)&&!w,D=!!u.captureKey,O=g();f(()=>O?.(!1)),n(()=>O?.(!0));let J=b({backend:v(S),id:S,initialEditId:u.editId,initialVersion:u.version,enabled:!D&&typeof EventSource==`function`});e(()=>{J()&&h()});let[oe,se]=t(null);e(()=>{let e=J();if(C!==`dataset`||e?.format!==`dataset`)return;let t=!0,r=e.version;fetch(`/api/page/artifact/${encodeURIComponent(S)}`,{credentials:`same-origin`}).then(e=>e.ok?e.json():null).then(e=>{let n=e?.surface;t&&n?.catalog&&n.version>=r&&se({version:n.version,catalog:n.catalog})}).catch(()=>{}),n(()=>{t=!1})});let Y=()=>{let e=oe();return e&&e.version>=u.version?e.catalog:u.catalog},X=()=>y({title:J()?.title??u.title,source:null});e(()=>{document.title=X()});let Z=()=>J()?.dataPreview??u.dataPreview,Q=()=>J()?.editId??u.editId,$=()=>q(Z()),ce=()=>u.columns.length?u.columns:Object.keys($()[0]??{}).map(e=>({name:e,type:void 0})),[le,ue]=t(!1);return[r(_,{get title(){return X()},label:`Artifact controls`,get actions(){return r(ee,{id:S,get title(){return X()},variant:`bar`})},controls:()=>(()=>{var e=N();return l(e,r(o,{get when(){return u.author?.forkedFrom||E()},get children(){var e=A();return e.firstChild,l(e,r(o,{get when(){return u.author?.forkedFrom},children:e=>(()=>{var t=P();return t.firstChild,l(t,r(o,{get when(){return e().href},get fallback(){return e().label},children:t=>(()=>{var n=F();return l(n,()=>e().label),s(()=>c(n,`href`,t())),n})()}),null),t})()}),null),l(e,r(o,{get when(){return d(()=>!!E())()&&!T()},get children(){return r(p,{id:S,get title(){return X()},owner:!1,editable:!0,variant:`menu`,get version(){return J()?.version??u.version},format:C,get datasetKind(){return Y()?.kind}})}}),null),e}}),null),l(e,r(o,{get when(){return T()},get children(){var e=M();return e.firstChild,l(e,r(o,{when:C===`dataset`,get children(){var e=j();return e.$$click=()=>{re(Y()?k(S,Y()):`ref:${S}`),ue(!0)},l(e,(()=>{var e=d(()=>!!le());return()=>e()?`copied dataset reference`:Y()?`copy query · source="${S}"`:`copy ref:${S}`})()),e}}),null),l(e,r(p,{id:S,get title(){return X()},owner:!0,variant:`menu`,get version(){return J()?.version??u.version},format:C,get datasetKind(){return Y()?.kind}}),null),e}}),null),e})()}),(()=>{var e=B();return l(e,r(o,{when:C===`image`,get children(){return r(o,{get when(){return Q()},keyed:!0,children:e=>(()=>{var e=V();return s(t=>{var n=`/a/${S}/raw${D?`?key=${encodeURIComponent(u.captureKey)}`:``}`,r=X();return n!==t.e&&c(e,`src`,t.e=n),r!==t.t&&c(e,`alt`,t.t=r),t},{e:void 0,t:void 0}),e})()})}}),null),l(e,r(o,{when:C===`pdf`||C===`file`,get children(){var e=I(),t=e.firstChild,n=t.nextSibling,r=n.firstChild;return c(t,`aria-label`,C===`pdf`?`PDF summary`:`File summary`),l(t,C===`pdf`?`PDF`:`File`,null),l(t,(()=>{var e=d(()=>!!u.bytes);return()=>e()?` · ${ie(u.bytes)}`:``})(),null),l(t,(()=>{var e=d(()=>!!u.pages);return()=>e()?` · ${u.pages} page${u.pages===1?``:`s`}`:``})(),null),c(n,`aria-label`,C===`pdf`?`Open the PDF`:`Download file`),c(n,`href`,`/a/${S}/raw`),l(n,C===`pdf`?`Open`:`Download`,r),l(n,X,null),e}}),null),l(e,r(o,{get when(){return C===`dataset`&&Y()},children:e=>r(x,{id:S,get catalog(){return e()},get canEdit(){return E()}})}),null),l(e,r(o,{get when(){return C===`dataset`&&!Y()},get children(){return[(()=>{var e=L(),t=e.firstChild,n=t.nextSibling;return n.nextSibling,l(e,()=>m($().length),t),l(e,()=>u.columns.length,n),l(e,r(o,{get when(){return $().length>50},get children(){return ae()}}),null),e})(),(()=>{var e=R(),t=e.firstChild.firstChild,n=t.firstChild,a=t.nextSibling;return l(n,r(i,{get each(){return ce()},children:e=>(()=>{var t=U();return l(t,()=>e.name,null),l(t,r(o,{get when(){return e.type},get children(){var t=H();return l(t,()=>e.type),t}}),null),t})()})),l(a,r(i,{get each(){return $().slice(0,50)},children:e=>(()=>{var t=W();return l(t,r(i,{get each(){return d(()=>!!u.columns.length)()?u.columns.map(e=>e.name):Object.keys(e)},children:t=>(()=>{var n=G();return l(n,(()=>{var n=d(()=>e[t]===null||e[t]===void 0);return()=>n()?K():String(e[t])})()),n})()})),t})()})),e})()]}}),null),l(e,r(o,{when:C===`viz`,get children(){var e=z();return l(e,Z),e}}),null),e})()]}a([`click`]);export{J as ArtifactDataPage};
1
+ import{D as e,M as t,R as n,T as r,_ as i,a,b as o,k as s,l as c,o as l,p as u,s as d,z as f}from"./web-Ckpee-ZJ.js";import{t as p}from"./DocumentSharing-BiTakFtn.js";import{E as m,Y as h,i as g,r as _}from"./solid-app-BNcsMwv4.js";import{n as v}from"./http-DEdzW08u.js";import{t as y}from"./title-BqVxKtqW.js";import{r as b,t as ee}from"./ForkArtifact-DXYU1-qL.js";import{i as te,r as ne}from"./share-roles-c4EwFuyA.js";import{t as re}from"./copy-text-BWnoOWaK.js";import{t as ie}from"./file-display-CJZlQncv.js";import{n as x}from"./DatasetCatalogView-DKNdjYA_.js";var S=e=>e?.tables.find(t=>t.schema===e.defaultSchema)??e?.tables[0],C=e=>`"${e.replaceAll(`"`,`""`)}"`,w=e=>{let t=S(e);return`${C(t?.schema??`public`)}.${C(t?.name??`rows`)}`},T=e=>e.replaceAll(`\\`,`\\\\`).replaceAll("`","\\`").replaceAll("${","\\${"),E=`data`,D=(e,t)=>`${e}.${C(S(t)?.name??`rows`)}`,O=(e,t)=>`<Import name="${e}" src="ref:${t}" />`;function k(e,t,n=`rows`){if(t?.kind===`postgres`)return`<Query name="${n}" source="ref:${e}">{\`SELECT * FROM ${T(w(t))}\`}</Query>`;let r=n===E?`dataset`:E;return`${O(r,e)}<Query name="${n}">{\`SELECT * FROM ${T(D(r,t))}\`}</Query>`}var A=u(`<section aria-label="Document actions"><h2 class="mb-1 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-faint">Artifact`),j=u(`<button type=button aria-label="Copy dataset reference"class="flex w-full cursor-pointer items-center gap-2 rounded-[5px] border-0 bg-transparent px-2 py-2 text-left font-mono text-xs text-muted transition-colors hover:bg-raised hover:text-fg text-accent">`),M=u(`<section aria-label="Owner actions"><h2 class="mb-1 font-mono text-[10px] font-semibold uppercase tracking-[0.14em] text-faint">owner`),N=u(`<div class=space-y-4>`),P=u(`<p data-mx-forked-from class="px-2 py-2 font-mono text-xs text-muted">forked from `),F=u(`<a aria-label="Open the artifact this was forked from"class=underline>`),I=u(`<div class="mt-4 rounded-[6px] border border-edge bg-surface p-4"><p class="font-sans text-xs text-muted"></p><a target=_blank rel="noopener noreferrer"class="mt-2 inline-block font-sans text-sm underline underline-offset-2"> `),ae=u(`<span class=text-faint> · showing the first 50`),L=u(`<p class="mt-4 font-sans text-xs text-muted"aria-label="Dataset summary"> rows · <!> columns`),R=u(`<div class="mt-2 max-h-[70vh] overflow-auto rounded-[6px] border border-edge"><table class="w-full border-collapse font-mono text-xs"><thead class="sticky top-0 z-10 bg-raised"><tr class="border-b border-edge text-left text-faint"></tr></thead><tbody>`),z=u(`<pre class="mt-4 overflow-x-auto rounded-[6px] border border-edge bg-surface p-4 font-mono text-xs text-muted">`),B=u(`<main class="mx-auto w-full max-w-5xl px-4 pt-6 pb-6">`),V=u(`<img class="mt-4 max-w-full rounded-[6px] border border-edge">`),H=u(`<span class="ml-1.5 text-[10px] text-faint">`),U=u(`<th class="whitespace-nowrap px-3 py-2 font-normal">`),W=u(`<tr class="border-b border-edge/50 text-muted">`),G=u(`<td class="whitespace-nowrap px-3 py-1.5">`),K=u(`<span class=text-faint>—`),q=e=>{try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}};function J(a){let u=a.answer.surface,S=u.id,C=u.format,w=!!a.answer.archived,T=()=>te(a.answer.role)&&!w,E=()=>ne(a.answer.role)&&!w,D=!!u.captureKey,O=g();f(()=>O?.(!1)),n(()=>O?.(!0));let J=b({backend:v(S),id:S,initialEditId:u.editId,initialVersion:u.version,enabled:!D&&typeof EventSource==`function`});e(()=>{J()&&h()});let[oe,se]=t(null);e(()=>{let e=J();if(C!==`dataset`||e?.format!==`dataset`)return;let t=!0,r=e.version;fetch(`/api/page/artifact/${encodeURIComponent(S)}`,{credentials:`same-origin`}).then(e=>e.ok?e.json():null).then(e=>{let n=e?.surface;t&&n?.catalog&&n.version>=r&&se({version:n.version,catalog:n.catalog})}).catch(()=>{}),n(()=>{t=!1})});let Y=()=>{let e=oe();return e&&e.version>=u.version?e.catalog:u.catalog},X=()=>y({title:J()?.title??u.title,source:null});e(()=>{document.title=X()});let Z=()=>J()?.dataPreview??u.dataPreview,Q=()=>J()?.editId??u.editId,$=()=>q(Z()),ce=()=>u.columns.length?u.columns:Object.keys($()[0]??{}).map(e=>({name:e,type:void 0})),[le,ue]=t(!1);return[r(_,{get title(){return X()},label:`Artifact controls`,get actions(){return r(ee,{id:S,get title(){return X()},variant:`bar`})},controls:()=>(()=>{var e=N();return l(e,r(o,{get when(){return u.author?.forkedFrom||E()},get children(){var e=A();return e.firstChild,l(e,r(o,{get when(){return u.author?.forkedFrom},children:e=>(()=>{var t=P();return t.firstChild,l(t,r(o,{get when(){return e().href},get fallback(){return e().label},children:t=>(()=>{var n=F();return l(n,()=>e().label),s(()=>c(n,`href`,t())),n})()}),null),t})()}),null),l(e,r(o,{get when(){return d(()=>!!E())()&&!T()},get children(){return r(p,{id:S,get title(){return X()},owner:!1,editable:!0,variant:`menu`,get version(){return J()?.version??u.version},format:C,get datasetKind(){return Y()?.kind}})}}),null),e}}),null),l(e,r(o,{get when(){return T()},get children(){var e=M();return e.firstChild,l(e,r(o,{when:C===`dataset`,get children(){var e=j();return e.$$click=()=>{re(Y()?k(S,Y()):`ref:${S}`),ue(!0)},l(e,(()=>{var e=d(()=>!!le());return()=>e()?`copied dataset reference`:Y()?`copy query · source="${S}"`:`copy ref:${S}`})()),e}}),null),l(e,r(p,{id:S,get title(){return X()},owner:!0,variant:`menu`,get version(){return J()?.version??u.version},format:C,get datasetKind(){return Y()?.kind}}),null),e}}),null),e})()}),(()=>{var e=B();return l(e,r(o,{when:C===`image`,get children(){return r(o,{get when(){return Q()},keyed:!0,children:e=>(()=>{var e=V();return s(t=>{var n=`/a/${S}/raw${D?`?key=${encodeURIComponent(u.captureKey)}`:``}`,r=X();return n!==t.e&&c(e,`src`,t.e=n),r!==t.t&&c(e,`alt`,t.t=r),t},{e:void 0,t:void 0}),e})()})}}),null),l(e,r(o,{when:C===`pdf`||C===`file`,get children(){var e=I(),t=e.firstChild,n=t.nextSibling,r=n.firstChild;return c(t,`aria-label`,C===`pdf`?`PDF summary`:`File summary`),l(t,C===`pdf`?`PDF`:`File`,null),l(t,(()=>{var e=d(()=>!!u.bytes);return()=>e()?` · ${ie(u.bytes)}`:``})(),null),l(t,(()=>{var e=d(()=>!!u.pages);return()=>e()?` · ${u.pages} page${u.pages===1?``:`s`}`:``})(),null),c(n,`aria-label`,C===`pdf`?`Open the PDF`:`Download file`),c(n,`href`,`/a/${S}/raw`),l(n,C===`pdf`?`Open`:`Download`,r),l(n,X,null),e}}),null),l(e,r(o,{get when(){return C===`dataset`&&Y()},children:e=>r(x,{id:S,get catalog(){return e()},get canEdit(){return E()}})}),null),l(e,r(o,{get when(){return C===`dataset`&&!Y()},get children(){return[(()=>{var e=L(),t=e.firstChild,n=t.nextSibling;return n.nextSibling,l(e,()=>m($().length),t),l(e,()=>u.columns.length,n),l(e,r(o,{get when(){return $().length>50},get children(){return ae()}}),null),e})(),(()=>{var e=R(),t=e.firstChild.firstChild,n=t.firstChild,a=t.nextSibling;return l(n,r(i,{get each(){return ce()},children:e=>(()=>{var t=U();return l(t,()=>e.name,null),l(t,r(o,{get when(){return e.type},get children(){var t=H();return l(t,()=>e.type),t}}),null),t})()})),l(a,r(i,{get each(){return $().slice(0,50)},children:e=>(()=>{var t=W();return l(t,r(i,{get each(){return d(()=>!!u.columns.length)()?u.columns.map(e=>e.name):Object.keys(e)},children:t=>(()=>{var n=G();return l(n,(()=>{var n=d(()=>e[t]===null||e[t]===void 0);return()=>n()?K():String(e[t])})()),n})()})),t})()})),e})()]}}),null),l(e,r(o,{when:C===`viz`,get children(){var e=z();return l(e,Z),e}}),null),e})()]}a([`click`]);export{J as ArtifactDataPage};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SourceEditor-Gh0VS3Fs.js","assets/web-Ckpee-ZJ.js","assets/w3c-keyname-BOAvb0qz.js"])))=>i.map(i=>d[i]);
2
- import{c as e,d as t,i as n,l as r,n as i,r as a,s as o,u as s}from"./jsx-vj4cHW_Q.js";import{D as c,E as l,F as u,G as d,I as f,K as p,L as m,M as h,N as g,O as _,P as v,R as y,T as b,_ as x,a as S,b as C,f as w,i as T,k as E,l as D,m as O,n as ee,o as k,p as A,r as j,s as M,u as N,x as te,z as P}from"./web-Ckpee-ZJ.js";import{t as F}from"./chevron-down-COGO5cmx.js";import{t as ne}from"./database-CKOnpvwb.js";import{t as re}from"./eye-BNpzRKAK.js";import{a as I,i as L}from"./DocumentSharing-BuTXuflA.js";import{t as R}from"./lock-B1nhk71f.js";import{d as ie,p as ae,u as oe}from"./DocumentChrome-EUbW_JvA.js";import{_ as se,h as ce,v as le}from"./person-mentions-BEjAedYZ.js";import{t as ue}from"./rotate-ccw-CSJ78xUE.js";import{t as de}from"./undo-2-Di8QrlfX.js";import{A as z,D as fe,E as B,G as V,Q as pe,V as me,W as he,t as ge}from"./solid-app-BtmRR9Ax.js";import{t as _e}from"./escape-CVx3RLA2.js";import{n as ve,t as H}from"./serialize-n0A-pNlo.js";import"./src-CcX8uAQo.js";import{t as ye}from"./upload-limits-Cxiss8cy.js";import{a as be,c as xe,d as Se,l as Ce}from"./document-update-client-DUF0zs2Z.js";import{B as we,I as Te,P as Ee,_ as De,c as Oe,f as U,h as ke,l as Ae,r as je}from"./http-C2exCIpl.js";import{D as Me,E as W,c as Ne,m as G,n as K,p as q}from"./grid-layout-pVrfI_vF.js";import{t as J}from"./runtime-id-CM5my_RX.js";import{t as Pe}from"./node-names-DHdYya8V.js";import{t as Fe}from"./dialog-shell-D1Dv5nY8.js";import{a as Ie,i as Le,o as Re,r as ze,t as Y}from"./browser-artifact-write-ZsGe-hXr.js";import{n as Be}from"./title-BqVxKtqW.js";import{i as Ve,n as He,r as Ue}from"./story-themes-DOZK2BkF.js";import{r as We}from"./ForkArtifact-DDmXl1BZ.js";import{t as Ge}from"./copy-text-BWnoOWaK.js";import{a as Ke,c as qe,d as Je,f as Ye,h as Xe,i as Ze,l as Qe,m as $e,n as et,o as tt,p as X,r as nt,s as rt,t as it,u as at}from"./Document-udhy5mlX.js";var ot=[[`path`,{d:`m14 12 4 4 4-4`,key:`buelq4`}],[`path`,{d:`M18 16V7`,key:`ty0viw`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]],st=e=>b(V,f(e,{iconNode:ot,name:`a-arrow-down`})),Z=[[`path`,{d:`m14 11 4-4 4 4`,key:`1pu57t`}],[`path`,{d:`M18 16V7`,key:`ty0viw`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]],ct=e=>b(V,f(e,{iconNode:Z,name:`a-arrow-up`})),lt=[[`path`,{d:`M19 3H5`,key:`1236rx`}],[`path`,{d:`M12 21V7`,key:`gj6g52`}],[`path`,{d:`m6 15 6 6 6-6`,key:`h15q88`}]],ut=e=>b(V,f(e,{iconNode:lt,name:`arrow-down-from-line`})),dt=[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]],ft=e=>b(V,f(e,{iconNode:dt,name:`arrow-down-to-line`})),pt=[[`path`,{d:`m9 6-6 6 6 6`,key:`7v63n9`}],[`path`,{d:`M3 12h14`,key:`13k4hi`}],[`path`,{d:`M21 19V5`,key:`b4bplr`}]],mt=e=>b(V,f(e,{iconNode:pt,name:`arrow-left-from-line`})),ht=[[`path`,{d:`M3 19V5`,key:`rwsyhb`}],[`path`,{d:`m13 6-6 6 6 6`,key:`1yhaz7`}],[`path`,{d:`M7 12h14`,key:`uoisry`}]],gt=e=>b(V,f(e,{iconNode:ht,name:`arrow-left-to-line`})),_t=[[`path`,{d:`M3 5v14`,key:`1nt18q`}],[`path`,{d:`M21 12H7`,key:`13ipq5`}],[`path`,{d:`m15 18 6-6-6-6`,key:`6tx3qv`}]],vt=e=>b(V,f(e,{iconNode:_t,name:`arrow-right-from-line`})),yt=[[`path`,{d:`M17 12H3`,key:`8awo09`}],[`path`,{d:`m11 18 6-6-6-6`,key:`8c2y43`}],[`path`,{d:`M21 5v14`,key:`nzette`}]],bt=e=>b(V,f(e,{iconNode:yt,name:`arrow-right-to-line`})),xt=[[`path`,{d:`m18 9-6-6-6 6`,key:`kcunyi`}],[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]],St=e=>b(V,f(e,{iconNode:xt,name:`arrow-up-from-line`})),Ct=[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]],wt=e=>b(V,f(e,{iconNode:Ct,name:`arrow-up-to-line`})),Tt=[[`path`,{d:`M4 20h16`,key:`14thso`}],[`path`,{d:`m6 16 6-12 6 12`,key:`1b4byz`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],Et=e=>b(V,f(e,{iconNode:Tt,name:`baseline`})),Dt=[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],Ot=e=>b(V,f(e,{iconNode:Dt,name:`chart-column`})),kt=[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]],At=e=>b(V,f(e,{iconNode:kt,name:`files`})),jt=[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]],Mt=e=>b(V,f(e,{iconNode:jt,name:`hash`})),Nt=[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],Pt=e=>b(V,f(e,{iconNode:Nt,name:`house`})),Ft=[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]],It=e=>b(V,f(e,{iconNode:Ft,name:`image-plus`})),Lt=[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19.5 3-3 3 3`,key:`9vmjn0`}],[`path`,{d:`M17 22v-5.5`,key:`1aa6fl`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]],Rt=e=>b(V,f(e,{iconNode:Lt,name:`image-up`})),zt=[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]],Bt=e=>b(V,f(e,{iconNode:zt,name:`link-2-off`})),Vt=[[`path`,{d:`m14.622 17.897-10.68-2.913`,key:`vj2p1u`}],[`path`,{d:`M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z`,key:`18tc5c`}],[`path`,{d:`M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15`,key:`ytzfxy`}]],Ht=e=>b(V,f(e,{iconNode:Vt,name:`paintbrush`})),Ut=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]],Wt=e=>b(V,f(e,{iconNode:Ut,name:`panel-right-close`})),Gt=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]],Kt=e=>b(V,f(e,{iconNode:Gt,name:`panel-right-open`})),qt=[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]],Jt=e=>b(V,f(e,{iconNode:qt,name:`redo-2`})),Yt=[[`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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],Xt=e=>b(V,f(e,{iconNode:Yt,name:`rotate-ccw-clock`})),Zt=[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]],Qt=e=>b(V,f(e,{iconNode:Zt,name:`share-2`})),$t=[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]],en=e=>b(V,f(e,{iconNode:$t,name:`sliders-horizontal`})),tn=[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]],nn=e=>b(V,f(e,{iconNode:tn,name:`smartphone`})),rn=[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]],an=e=>b(V,f(e,{iconNode:rn,name:`text-align-center`})),on=[[`path`,{d:`M3 5h18`,key:`1u36vt`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}]],sn=e=>b(V,f(e,{iconNode:on,name:`text-align-justify`})),cn=[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]],ln=e=>b(V,f(e,{iconNode:cn,name:`text-align-end`})),un=[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],dn=e=>b(V,f(e,{iconNode:un,name:`text-align-start`})),fn=[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]],pn=e=>b(V,f(e,{iconNode:fn,name:`underline`})),mn=[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]],hn=e=>b(V,f(e,{iconNode:mn,name:`workflow`})),gn=(e,t)=>`/a/${e}/raw?v=${t}`,_n=`(max-width: 640px) 100vw, 768px`,vn=[[`img`,`src`,!1],[`File`,`src`,!0]],yn=/^https?:\/\//i;function bn(e){try{return new URL(e).href}catch{return e}}var xn=t=>e(bn(t)),Sn=e=>{let t=(e??``).split(`/`).pop()??``;return/^[0-9a-f]{8}/.test(t)?t.slice(0,8):null};function Cn(e,t){let n=`/assets/${xn(e)}`,r=t&&typeof t==`object`?Sn(t.object_key):null;return r?`${n}?v=${r}`:n}var wn=(e,t)=>{let n=Cn(e,t);return`${n}${n.includes(`?`)?`&`:`?`}w=${t.small_width}`};function Tn(e,t){let{width:n,small_width:r}=t;return!t.small_object_key||!r||!n||n<=r?null:`${wn(e,t)} ${r}w, ${Cn(e,t)} ${n}w`}var En=2,Dn=e=>yn.test(e),On=(e,t)=>{for(let n of e)n.type===`element`&&(t(n),On(n.children,t))},kn=e=>vn.filter(([t,,n])=>e.isComponent===n&&(n?e.tag===t:e.tag.toLowerCase()===t)).map(([,e])=>e),An=(e,t)=>e.attributes.find(e=>e.name.toLowerCase()===t.toLowerCase()),jn=(e,t)=>{let n=An(e,t);return!n||!n.value.static||typeof n.value.json!=`string`?null:yn.test(n.value.json)?n.value.json:null};function Mn(e,t,n){let r=An(e,t);if(r){r.value={static:!0,json:n};return}e.attributes.push({name:t,value:{static:!0,json:n},start:e.start,end:e.start})}function Nn(e,t,n={}){let r=!1;if(On(e,e=>{for(let n of kn(e)){let i=jn(e,n);i&&t(i)&&(r=!0)}}),!r)return e;let i=0,a=structuredClone(e);return On(a,e=>{let r=!e.isComponent&&e.tag.toLowerCase()===`img`?i++:-1;for(let i of kn(e)){let a=jn(e,i);if(!a)continue;let o=t(a);if(!o||(Mn(e,i,Cn(a,o)),i!==`src`||e.isComponent||typeof o!=`object`)||(o.width&&o.height&&!An(e,`width`)&&!An(e,`height`)&&(Mn(e,`width`,String(o.width)),Mn(e,`height`,String(o.height))),o.placeholder&&!An(e,`style`)&&Mn(e,`style`,{backgroundImage:`url(${o.placeholder})`,backgroundSize:`cover`,backgroundRepeat:`no-repeat`}),n.capture))continue;let s=An(e,`srcset`)||An(e,`sizes`)?null:Tn(a,o);s&&(Mn(e,`srcSet`,s),Mn(e,`sizes`,_n)),r>=En&&!An(e,`loading`)&&(Mn(e,`loading`,`lazy`),An(e,`decoding`)||Mn(e,`decoding`,`async`))}}),a}var Pn=/url\(\s*(['"]?)(https?:\/\/[^'")\s]+)\1\s*\)/gi;function Fn(e,t){return e.replace(Pn,(e,n,r)=>{let i=t(r);return i?`url(${n}${Cn(r,i)}${n})`:e})}function In(e,t,n){return Ln(r(e),t,n)}function Ln(e,t,n){if(!e.ok)return null;let{content:r,body:i}=Se(Ce(e.nodes));return t?{content:r.style?{...r,style:Fn(r.style,t)}:r,body:Nn(i,t,n)}:{content:r,body:i}}var Rn=6,zn=[];function Bn(e){let t=zn.findIndex(t=>t.source===e);if(t>=0){let[e]=zn.splice(t,1);return zn.unshift(e),e.result}let n=zn.find(e=>e.result.ok),i=n&&Hn(n.source,n.result,e)||r(e);return zn.unshift({source:e,result:i}),zn.length>Rn&&(zn.length=Rn),i}function Vn(e,t){return e.type===`element`?{...e,start:e.start+t,end:e.end+t,attributes:e.attributes.map(e=>({...e,start:e.start+t,end:e.end+t})),children:e.children.map(e=>Vn(e,t))}:{...e,start:e.start+t,end:e.end+t}}function Hn(e,t,n){if(!t.ok)return null;let i=Math.min(e.length,n.length),a=0;for(;a<i&&e.charCodeAt(a)===n.charCodeAt(a);)a++;let o=0;for(;o<i-a&&e.charCodeAt(e.length-1-o)===n.charCodeAt(n.length-1-o);)o++;let s=e.length-o,c=n.length-e.length,l=e=>{let t=e.findIndex(e=>e.start<=a&&s<=e.end),i=e[t];if(!i||i.type!==`element`||i.control)return null;let o=i.children,u=null;if(o.length&&o[0].start<=a&&s<=o.at(-1).end){let e=l(o);e&&(u={...i,end:i.end+c,children:e})}if(!u){if(!(i.start<a&&s<i.end))return null;let e=n.slice(i.start,i.end+c),t=r(e),o=t.ok&&t.nodes.length===1?t.nodes[0]:null;if(!o||o.type!==`element`||o.control||o.start!==0||o.end!==e.length)return null;u=Vn(o,i.start)}return[...e.slice(0,t),u,...e.slice(t+1).map(e=>Vn(e,c))]},u=l(t.nodes);return u?{ok:!0,nodes:u}:null}function Un(e,t){return Kn(In(e,t))}function Wn(e,t){let n=Gn.find(n=>n.source===e&&n.assets===t);if(n)return n.parts;let r=Kn(Ln(Bn(e),t));return Gn.unshift({source:e,assets:t,parts:r}),Gn.length>4&&(Gn.length=4),r}var Gn=[];function Kn(e){if(!e)return null;let{content:t,body:n}=e;return{nodes:n,authorCss:t.style??null,authorScript:t.script??null,declarations:JSON.stringify({imports:t.imports.map(e=>({...e,start:0,end:0})),values:t.values.map(e=>({...e,start:0,end:0})),queries:t.queries.map(e=>({...e,start:0,end:0})),notifications:(t.notifications??[]).map(e=>({...e,start:0,end:0})),mutations:t.mutations.map(e=>({...e,start:0,end:0}))})}}function qn(e,t){if(!/^[A-Za-z_$][\w$]*$/.test(t))return null;let n=r(e);if(!n.ok)return null;let{helmet:i}=Se(n.nodes),a=i?.children.find(e=>e.type===`element`&&e.tag===`script`),o=a?.type===`element`?a.children.find(e=>e.type===`expression`):void 0;if(!o)return null;let s=e.slice(o.start,o.end),c=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),l=RegExp(`\\bexport\\s+(?:default\\s+)?(?:async\\s+)?(?:function\\s*\\*?|const|let|var|class)\\s+${c}(?![\\w$])`).exec(s),u=l?null:RegExp(`\\bexport\\s*\\{[^}]*?(?:^|[\\s,{])${c}(?![\\w$])[^}]*\\}`).exec(s),d=l??u;if(!d)return null;let f=o.start+d.index;return{offset:f,line:e.slice(0,f).split(`
2
+ import{c as e,d as t,i as n,l as r,n as i,r as a,s as o,u as s}from"./jsx-vj4cHW_Q.js";import{D as c,E as l,F as u,G as d,I as f,K as p,L as m,M as h,N as g,O as _,P as v,R as y,T as b,_ as x,a as S,b as C,f as w,i as T,k as E,l as D,m as O,n as ee,o as k,p as A,r as j,s as M,u as N,x as te,z as P}from"./web-Ckpee-ZJ.js";import{t as F}from"./chevron-down-M1fHuk7u.js";import{t as ne}from"./database-BbH2eTSj.js";import{t as re}from"./eye-DEiYMLrO.js";import{a as I,i as L}from"./DocumentSharing-BiTakFtn.js";import{t as R}from"./lock-BRsIxNP2.js";import{d as ie,p as ae,u as oe}from"./DocumentChrome-Bw4_z5yQ.js";import{_ as se,h as ce,v as le}from"./person-mentions-C7vQd7Vr.js";import{t as ue}from"./rotate-ccw-CIMUmeuJ.js";import{t as de}from"./undo-2--XbU60MY.js";import{A as z,D as fe,E as B,G as V,Q as pe,V as me,W as he,t as ge}from"./solid-app-BNcsMwv4.js";import{t as _e}from"./escape-CVx3RLA2.js";import{n as ve,t as H}from"./serialize-n0A-pNlo.js";import"./src-CcX8uAQo.js";import{t as ye}from"./upload-limits-Cxiss8cy.js";import{a as be,c as xe,d as Se,l as Ce}from"./document-update-client-td73lQ81.js";import{B as we,I as Te,P as Ee,_ as De,c as Oe,f as U,h as ke,l as Ae,r as je}from"./http-DEdzW08u.js";import{D as Me,E as W,c as Ne,m as G,n as K,p as q}from"./grid-layout-pVrfI_vF.js";import{t as J}from"./runtime-id-CM5my_RX.js";import{t as Pe}from"./node-names-DHdYya8V.js";import{t as Fe}from"./dialog-shell-D1Dv5nY8.js";import{a as Ie,i as Le,o as Re,r as ze,t as Y}from"./browser-artifact-write-CG72iseh.js";import{n as Be}from"./title-BqVxKtqW.js";import{i as Ve,n as He,r as Ue}from"./story-themes-DOZK2BkF.js";import{r as We}from"./ForkArtifact-DXYU1-qL.js";import{t as Ge}from"./copy-text-BWnoOWaK.js";import{a as Ke,c as qe,d as Je,f as Ye,h as Xe,i as Ze,l as Qe,m as $e,n as et,o as tt,p as X,r as nt,s as rt,t as it,u as at}from"./Document-C6-E9V3_.js";var ot=[[`path`,{d:`m14 12 4 4 4-4`,key:`buelq4`}],[`path`,{d:`M18 16V7`,key:`ty0viw`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]],st=e=>b(V,f(e,{iconNode:ot,name:`a-arrow-down`})),Z=[[`path`,{d:`m14 11 4-4 4 4`,key:`1pu57t`}],[`path`,{d:`M18 16V7`,key:`ty0viw`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]],ct=e=>b(V,f(e,{iconNode:Z,name:`a-arrow-up`})),lt=[[`path`,{d:`M19 3H5`,key:`1236rx`}],[`path`,{d:`M12 21V7`,key:`gj6g52`}],[`path`,{d:`m6 15 6 6 6-6`,key:`h15q88`}]],ut=e=>b(V,f(e,{iconNode:lt,name:`arrow-down-from-line`})),dt=[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]],ft=e=>b(V,f(e,{iconNode:dt,name:`arrow-down-to-line`})),pt=[[`path`,{d:`m9 6-6 6 6 6`,key:`7v63n9`}],[`path`,{d:`M3 12h14`,key:`13k4hi`}],[`path`,{d:`M21 19V5`,key:`b4bplr`}]],mt=e=>b(V,f(e,{iconNode:pt,name:`arrow-left-from-line`})),ht=[[`path`,{d:`M3 19V5`,key:`rwsyhb`}],[`path`,{d:`m13 6-6 6 6 6`,key:`1yhaz7`}],[`path`,{d:`M7 12h14`,key:`uoisry`}]],gt=e=>b(V,f(e,{iconNode:ht,name:`arrow-left-to-line`})),_t=[[`path`,{d:`M3 5v14`,key:`1nt18q`}],[`path`,{d:`M21 12H7`,key:`13ipq5`}],[`path`,{d:`m15 18 6-6-6-6`,key:`6tx3qv`}]],vt=e=>b(V,f(e,{iconNode:_t,name:`arrow-right-from-line`})),yt=[[`path`,{d:`M17 12H3`,key:`8awo09`}],[`path`,{d:`m11 18 6-6-6-6`,key:`8c2y43`}],[`path`,{d:`M21 5v14`,key:`nzette`}]],bt=e=>b(V,f(e,{iconNode:yt,name:`arrow-right-to-line`})),xt=[[`path`,{d:`m18 9-6-6-6 6`,key:`kcunyi`}],[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]],St=e=>b(V,f(e,{iconNode:xt,name:`arrow-up-from-line`})),Ct=[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]],wt=e=>b(V,f(e,{iconNode:Ct,name:`arrow-up-to-line`})),Tt=[[`path`,{d:`M4 20h16`,key:`14thso`}],[`path`,{d:`m6 16 6-12 6 12`,key:`1b4byz`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]],Et=e=>b(V,f(e,{iconNode:Tt,name:`baseline`})),Dt=[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],Ot=e=>b(V,f(e,{iconNode:Dt,name:`chart-column`})),kt=[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]],At=e=>b(V,f(e,{iconNode:kt,name:`files`})),jt=[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]],Mt=e=>b(V,f(e,{iconNode:jt,name:`hash`})),Nt=[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],Pt=e=>b(V,f(e,{iconNode:Nt,name:`house`})),Ft=[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]],It=e=>b(V,f(e,{iconNode:Ft,name:`image-plus`})),Lt=[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19.5 3-3 3 3`,key:`9vmjn0`}],[`path`,{d:`M17 22v-5.5`,key:`1aa6fl`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]],Rt=e=>b(V,f(e,{iconNode:Lt,name:`image-up`})),zt=[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]],Bt=e=>b(V,f(e,{iconNode:zt,name:`link-2-off`})),Vt=[[`path`,{d:`m14.622 17.897-10.68-2.913`,key:`vj2p1u`}],[`path`,{d:`M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z`,key:`18tc5c`}],[`path`,{d:`M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15`,key:`ytzfxy`}]],Ht=e=>b(V,f(e,{iconNode:Vt,name:`paintbrush`})),Ut=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]],Wt=e=>b(V,f(e,{iconNode:Ut,name:`panel-right-close`})),Gt=[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]],Kt=e=>b(V,f(e,{iconNode:Gt,name:`panel-right-open`})),qt=[[`path`,{d:`m15 14 5-5-5-5`,key:`12vg1m`}],[`path`,{d:`M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13`,key:`6uklza`}]],Jt=e=>b(V,f(e,{iconNode:qt,name:`redo-2`})),Yt=[[`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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],Xt=e=>b(V,f(e,{iconNode:Yt,name:`rotate-ccw-clock`})),Zt=[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]],Qt=e=>b(V,f(e,{iconNode:Zt,name:`share-2`})),$t=[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]],en=e=>b(V,f(e,{iconNode:$t,name:`sliders-horizontal`})),tn=[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]],nn=e=>b(V,f(e,{iconNode:tn,name:`smartphone`})),rn=[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M17 12H7`,key:`16if0g`}],[`path`,{d:`M19 19H5`,key:`vjpgq2`}]],an=e=>b(V,f(e,{iconNode:rn,name:`text-align-center`})),on=[[`path`,{d:`M3 5h18`,key:`1u36vt`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}]],sn=e=>b(V,f(e,{iconNode:on,name:`text-align-justify`})),cn=[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M21 19H7`,key:`4cu937`}]],ln=e=>b(V,f(e,{iconNode:cn,name:`text-align-end`})),un=[[`path`,{d:`M21 5H3`,key:`1fi0y6`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M17 19H3`,key:`z6ezky`}]],dn=e=>b(V,f(e,{iconNode:un,name:`text-align-start`})),fn=[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]],pn=e=>b(V,f(e,{iconNode:fn,name:`underline`})),mn=[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]],hn=e=>b(V,f(e,{iconNode:mn,name:`workflow`})),gn=(e,t)=>`/a/${e}/raw?v=${t}`,_n=`(max-width: 640px) 100vw, 768px`,vn=[[`img`,`src`,!1],[`File`,`src`,!0]],yn=/^https?:\/\//i;function bn(e){try{return new URL(e).href}catch{return e}}var xn=t=>e(bn(t)),Sn=e=>{let t=(e??``).split(`/`).pop()??``;return/^[0-9a-f]{8}/.test(t)?t.slice(0,8):null};function Cn(e,t){let n=`/assets/${xn(e)}`,r=t&&typeof t==`object`?Sn(t.object_key):null;return r?`${n}?v=${r}`:n}var wn=(e,t)=>{let n=Cn(e,t);return`${n}${n.includes(`?`)?`&`:`?`}w=${t.small_width}`};function Tn(e,t){let{width:n,small_width:r}=t;return!t.small_object_key||!r||!n||n<=r?null:`${wn(e,t)} ${r}w, ${Cn(e,t)} ${n}w`}var En=2,Dn=e=>yn.test(e),On=(e,t)=>{for(let n of e)n.type===`element`&&(t(n),On(n.children,t))},kn=e=>vn.filter(([t,,n])=>e.isComponent===n&&(n?e.tag===t:e.tag.toLowerCase()===t)).map(([,e])=>e),An=(e,t)=>e.attributes.find(e=>e.name.toLowerCase()===t.toLowerCase()),jn=(e,t)=>{let n=An(e,t);return!n||!n.value.static||typeof n.value.json!=`string`?null:yn.test(n.value.json)?n.value.json:null};function Mn(e,t,n){let r=An(e,t);if(r){r.value={static:!0,json:n};return}e.attributes.push({name:t,value:{static:!0,json:n},start:e.start,end:e.start})}function Nn(e,t,n={}){let r=!1;if(On(e,e=>{for(let n of kn(e)){let i=jn(e,n);i&&t(i)&&(r=!0)}}),!r)return e;let i=0,a=structuredClone(e);return On(a,e=>{let r=!e.isComponent&&e.tag.toLowerCase()===`img`?i++:-1;for(let i of kn(e)){let a=jn(e,i);if(!a)continue;let o=t(a);if(!o||(Mn(e,i,Cn(a,o)),i!==`src`||e.isComponent||typeof o!=`object`)||(o.width&&o.height&&!An(e,`width`)&&!An(e,`height`)&&(Mn(e,`width`,String(o.width)),Mn(e,`height`,String(o.height))),o.placeholder&&!An(e,`style`)&&Mn(e,`style`,{backgroundImage:`url(${o.placeholder})`,backgroundSize:`cover`,backgroundRepeat:`no-repeat`}),n.capture))continue;let s=An(e,`srcset`)||An(e,`sizes`)?null:Tn(a,o);s&&(Mn(e,`srcSet`,s),Mn(e,`sizes`,_n)),r>=En&&!An(e,`loading`)&&(Mn(e,`loading`,`lazy`),An(e,`decoding`)||Mn(e,`decoding`,`async`))}}),a}var Pn=/url\(\s*(['"]?)(https?:\/\/[^'")\s]+)\1\s*\)/gi;function Fn(e,t){return e.replace(Pn,(e,n,r)=>{let i=t(r);return i?`url(${n}${Cn(r,i)}${n})`:e})}function In(e,t,n){return Ln(r(e),t,n)}function Ln(e,t,n){if(!e.ok)return null;let{content:r,body:i}=Se(Ce(e.nodes));return t?{content:r.style?{...r,style:Fn(r.style,t)}:r,body:Nn(i,t,n)}:{content:r,body:i}}var Rn=6,zn=[];function Bn(e){let t=zn.findIndex(t=>t.source===e);if(t>=0){let[e]=zn.splice(t,1);return zn.unshift(e),e.result}let n=zn.find(e=>e.result.ok),i=n&&Hn(n.source,n.result,e)||r(e);return zn.unshift({source:e,result:i}),zn.length>Rn&&(zn.length=Rn),i}function Vn(e,t){return e.type===`element`?{...e,start:e.start+t,end:e.end+t,attributes:e.attributes.map(e=>({...e,start:e.start+t,end:e.end+t})),children:e.children.map(e=>Vn(e,t))}:{...e,start:e.start+t,end:e.end+t}}function Hn(e,t,n){if(!t.ok)return null;let i=Math.min(e.length,n.length),a=0;for(;a<i&&e.charCodeAt(a)===n.charCodeAt(a);)a++;let o=0;for(;o<i-a&&e.charCodeAt(e.length-1-o)===n.charCodeAt(n.length-1-o);)o++;let s=e.length-o,c=n.length-e.length,l=e=>{let t=e.findIndex(e=>e.start<=a&&s<=e.end),i=e[t];if(!i||i.type!==`element`||i.control)return null;let o=i.children,u=null;if(o.length&&o[0].start<=a&&s<=o.at(-1).end){let e=l(o);e&&(u={...i,end:i.end+c,children:e})}if(!u){if(!(i.start<a&&s<i.end))return null;let e=n.slice(i.start,i.end+c),t=r(e),o=t.ok&&t.nodes.length===1?t.nodes[0]:null;if(!o||o.type!==`element`||o.control||o.start!==0||o.end!==e.length)return null;u=Vn(o,i.start)}return[...e.slice(0,t),u,...e.slice(t+1).map(e=>Vn(e,c))]},u=l(t.nodes);return u?{ok:!0,nodes:u}:null}function Un(e,t){return Kn(In(e,t))}function Wn(e,t){let n=Gn.find(n=>n.source===e&&n.assets===t);if(n)return n.parts;let r=Kn(Ln(Bn(e),t));return Gn.unshift({source:e,assets:t,parts:r}),Gn.length>4&&(Gn.length=4),r}var Gn=[];function Kn(e){if(!e)return null;let{content:t,body:n}=e;return{nodes:n,authorCss:t.style??null,authorScript:t.script??null,declarations:JSON.stringify({imports:t.imports.map(e=>({...e,start:0,end:0})),values:t.values.map(e=>({...e,start:0,end:0})),queries:t.queries.map(e=>({...e,start:0,end:0})),notifications:(t.notifications??[]).map(e=>({...e,start:0,end:0})),mutations:t.mutations.map(e=>({...e,start:0,end:0}))})}}function qn(e,t){if(!/^[A-Za-z_$][\w$]*$/.test(t))return null;let n=r(e);if(!n.ok)return null;let{helmet:i}=Se(n.nodes),a=i?.children.find(e=>e.type===`element`&&e.tag===`script`),o=a?.type===`element`?a.children.find(e=>e.type===`expression`):void 0;if(!o)return null;let s=e.slice(o.start,o.end),c=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),l=RegExp(`\\bexport\\s+(?:default\\s+)?(?:async\\s+)?(?:function\\s*\\*?|const|let|var|class)\\s+${c}(?![\\w$])`).exec(s),u=l?null:RegExp(`\\bexport\\s*\\{[^}]*?(?:^|[\\s,{])${c}(?![\\w$])[^}]*\\}`).exec(s),d=l??u;if(!d)return null;let f=o.start+d.index;return{offset:f,line:e.slice(0,f).split(`
3
3
  `).length}}var Jn={enabled:`enabled`,name:`name`,shortName:`short-name`,icon:`icon`,themeColor:`theme-color`,backgroundColor:`background-color`},Yn=(e,t)=>{let n=e.attributes.find(e=>e.name===t)?.value;return n?.static&&typeof n.json==`string`?n.json:null},Xn=(e,t)=>e===`enabled`?typeof t==`boolean`:typeof t==`string`?e===`icon`?/^[a-zA-Z0-9]{6,12}$/.test(t):e===`themeColor`||e===`backgroundColor`?/^#[0-9a-fA-F]{6}$/.test(t):t.trim().length>0&&t.length<=(e===`shortName`?30:100):!1,Zn=e=>`artifactbin:pwa-${Jn[e]}`,Qn=Object.keys(Jn);function $n(e){let t=typeof e==`string`?Bn(e):{ok:!0,nodes:e};if(!t.ok)return{};let{helmet:n}=Se(t.nodes),r={};for(let e of Qn){let t=n?.children.find(t=>t.type===`element`&&t.tag===`meta`&&Yn(t,`name`)===Zn(e)),i=t?Yn(t,`content`):null;e===`icon`&&(i=i?.startsWith(`ref:`)?i.slice(4):null),e===`enabled`?(i===`true`||i===`false`)&&(r.enabled=i===`true`):i&&Xn(e,i)&&(r[e]=i)}return r}function er(e,t){for(let e of Qn)if(t[e]!==void 0&&!Xn(e,t[e]))throw Error(`Invalid PWA ${e}`);let n=r(e);if(!n.ok)throw Error(`Fix the source before editing PWA settings.`);let{helmet:i}=Se(n.nodes),a=Qn.filter(e=>t[e]!==void 0).map(e=>`<meta name="${Zn(e)}" content="${_e((e===`icon`?`ref:`:``)+t[e])}" />`).join(``);if(!i)return a?`<Helmet>${a}</Helmet>\n${e}`:e;if(i.selfClosing)return e.slice(0,i.start)+`<Helmet>${a}</Helmet>`+e.slice(i.end);let o=i.children.filter(e=>e.type===`element`&&e.tag===`meta`&&Qn.some(t=>Yn(e,`name`)===Zn(t))),s=i.end-`</${i.tag}>`.length,c=e.slice(0,s)+a+e.slice(s);for(let e of o.reverse())c=c.slice(0,e.start)+c.slice(e.end);return c}var tr=A(`<button type=button class="text-sm text-accent underline">Use generated icon`),nr=A(`<p role=status class="text-sm text-muted">Uploading icon…`),rr=A(`<p role=alert class="text-sm text-danger">`),ir=A(`<section aria-label="PWA settings"class="mx-auto max-w-3xl space-y-8"><header><h2 class="text-xl font-semibold text-fg">Install as an app</h2><p class="mt-2 text-sm text-muted">This artifact is ready to install. Give it a name and icon for the home screen or desktop.</p></header><div class="flex items-center gap-4"><img alt="App icon preview"class="h-20 w-20 rounded-xl border border-edge object-contain"><div><p class="font-semibold text-fg"></p><p class="mt-1 text-sm text-muted"></p></div></div><div class="grid gap-5 sm:grid-cols-2"><label class="text-sm text-muted">App name<input aria-label="App name"class="mt-1 w-full rounded-md border border-edge bg-ground px-3 py-2 text-sm text-fg"maxlength=100></label><label class="text-sm text-muted">Short name<input aria-label="Short name"class="mt-1 w-full rounded-md border border-edge bg-ground px-3 py-2 text-sm text-fg"maxlength=30 placeholder="Uses app name"></label></div><div class=space-y-3><label class="block text-sm text-muted">App icon<input type=file aria-label="Upload app icon"accept=image/png,image/jpeg,image/webp,image/gif,image/svg+xml class="mt-1 w-full rounded-md border border-edge bg-ground px-3 py-2 text-sm text-fg"></label><p class="text-xs text-muted">A separate image from your social preview. Square artwork works best; we pad it and create the required icon sizes.</p></div><div class="grid gap-5 sm:grid-cols-2"><label class="text-sm text-muted">Theme color<input type=color aria-label="Theme color"class="mt-1 h-10 w-full cursor-pointer rounded-md border border-edge bg-ground p-1"><span class="mt-1 block text-xs">App title bar and browser toolbar, where supported.</span></label><label class="text-sm text-muted">Background color<input type=color aria-label="Background color"class="mt-1 h-10 w-full cursor-pointer rounded-md border border-edge bg-ground p-1"><span class="mt-1 block text-xs">Loading screen and padding around your app icon.</span></label></div><div class="space-y-3 border-t border-edge pt-5"><p class="text-sm text-muted">Opens the latest saved version in its own window. Internet access and the artifact’s existing sharing permissions still apply.</p><p class="text-xs text-muted">Names and icons may take time to update in installed apps. Reinstall to see changes immediately.</p><a target=_self class="block break-all text-xs text-muted underline">`),ar=A(`<p class="mt-2 text-xs text-muted">Customize its name, icon and colors in the PWA tab.`),or=A(`<section aria-label="App installation"class="mx-auto max-w-3xl border-t border-edge pt-5"><label class="flex cursor-pointer items-center justify-between gap-4 text-sm font-medium text-fg"><span>Allow installation as a PWA</span><span class="relative inline-flex shrink-0"><input type=checkbox role=switch aria-label="Allow installation as a PWA"class="peer absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0"><span aria-hidden=true class="relative h-6 w-11 rounded-full bg-raised ring-1 ring-edge transition-colors peer-checked:bg-accent peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-accent"><span class="absolute left-0.5 top-0.5 h-5 w-5 rounded-full bg-white shadow-sm transition-transform"></span></span></span></label><p class="mt-2 text-sm text-muted">Let readers install this artifact on their home screen or desktop. Sharing permissions still apply.`);function sr(e){let t=_(()=>$n(e.source)),[n,r]=h(!1),[i,a]=h(``),[o,s]=h(null),c=n=>{try{e.onChange(er(e.source,{...t(),...n})),a(``)}catch(e){a(e instanceof Error?e.message:`Could not update PWA settings.`)}},l=async t=>{r(!0),a(``);try{let n=await e.onUpload(t);if(!n.ok){a(n.error);return}s({id:n.image.id,url:n.image.rawUrl??`/a/${n.image.id}/raw`}),c({icon:n.image.id})}catch{a(`Could not upload the icon. Try again.`)}finally{r(!1)}},u=()=>o()&&o().id===t().icon?o().url:t().icon?`/a/${t().icon}/raw`:`${ie(e.id)}icon-192.png`;return(()=>{var r=ir(),a=r.firstChild.nextSibling,o=a.firstChild,s=o.nextSibling.firstChild,d=s.nextSibling,f=a.nextSibling,p=f.firstChild,m=p.firstChild.nextSibling,h=p.nextSibling.firstChild.nextSibling,g=f.nextSibling,_=g.firstChild,v=_.firstChild.nextSibling;_.nextSibling;var y=g.nextSibling,x=y.firstChild,S=x.firstChild.nextSibling,w=x.nextSibling.firstChild.nextSibling,T=y.nextSibling,O=T.firstChild,ee=O.nextSibling.nextSibling;return k(s,()=>t().name??e.title??`Untitled artifact`),k(d,()=>t().icon?`Custom app icon`:`Generated icon · unique to this artifact`),m.addEventListener(`blur`,e=>c({name:e.currentTarget.value.trim()||void 0})),h.addEventListener(`blur`,e=>c({shortName:e.currentTarget.value.trim()||void 0})),v.addEventListener(`change`,e=>{let t=e.currentTarget.files?.[0];t&&l(t),e.currentTarget.value=``}),k(g,b(C,{get when(){return t().icon},get children(){var e=tr();return e.$$click=()=>c({icon:void 0}),E(()=>e.disabled=n()),e}}),null),k(g,b(C,{get when(){return n()},get children(){return nr()}}),null),S.addEventListener(`change`,e=>c({themeColor:e.currentTarget.value})),w.addEventListener(`change`,e=>c({backgroundColor:e.currentTarget.value})),k(r,b(C,{get when(){return i()},get children(){var e=rr();return k(e,i),e}}),T),k(T,b(oe,{get id(){return e.id},get beforeNavigate(){return e.beforeInstall},class:`inline-flex items-center gap-2 text-sm font-semibold text-accent`}),O),k(ee,()=>window.location.origin,null),k(ee,()=>ie(e.id),null),E(t=>{var r=u(),i=e.title||`Untitled artifact`,a=n(),s=ie(e.id);return r!==t.e&&D(o,`src`,t.e=r),i!==t.t&&D(m,`placeholder`,t.t=i),a!==t.a&&(v.disabled=t.a=a),s!==t.o&&D(ee,`href`,t.o=s),t},{e:void 0,t:void 0,a:void 0,o:void 0}),E(()=>m.value=t().name??``),E(()=>h.value=t().shortName??``),E(()=>S.value=t().themeColor??`#ffffff`),E(()=>w.value=t().backgroundColor??`#ffffff`),r})()}function cr(e){let t=()=>$n(e.source);return(()=>{var n=or(),r=n.firstChild,i=r.firstChild.nextSibling.firstChild,a=i.nextSibling.firstChild;return r.nextSibling,i.addEventListener(`change`,n=>e.onChange(er(e.source,{...t(),enabled:n.currentTarget.checked}))),k(n,b(C,{get when(){return t().enabled},get children(){return ar()}}),null),E(e=>N(a,`transform`,t().enabled?`translateX(20px)`:`translateX(0)`)),E(()=>i.checked=t().enabled===!0),n})()}S([`click`]);var lr=Me,ur=`data-mx-ast`;function dr(e,t){let n=r(e);if(!n.ok)return e;let i=!1;for(let e of t){let t=lr(n.nodes,e.astPath);if(!(!t||t.type!==`element`||t.isComponent)&&(e.className!==void 0&&(pr(t,e.className.trim()),i=!0),e.style!==void 0)){let n=e.style.trim();Q(t,`style`,n===``?void 0:n),i=!0}}return i?H(n.nodes):e}function fr(e,t){if(t.length===0)return e;let n=r(e);if(!n.ok)return e;let i=!1;for(let e of t){let t=lr(n.nodes,e.astPath);!t||t.type!==`element`||!t.isComponent||t.tag!==`GridItem`||(Q(t,`x`,e.x),Q(t,`y`,e.y),Q(t,`w`,e.w),Q(t,`h`,e.h),i=!0)}return i?H(n.nodes):e}function pr(e,t){let n=e=>e.name===`className`||e.name===`class`,r=e.attributes.findIndex(n);for(let t=e.attributes.length-1;t>=0;t--)n(e.attributes[t])&&e.attributes.splice(t,1);if(t===``)return;let i={name:`className`,value:{static:!0,json:t},start:0,end:0};e.attributes.splice(r===-1?e.attributes.length:r,0,i)}function Q(e,t,n){let r=e.attributes.findIndex(e=>e.name===t);if(n===void 0){r!==-1&&e.attributes.splice(r,1);return}let i={name:t,value:{static:!0,json:n},start:0,end:0};r===-1?e.attributes.push(i):e.attributes[r]=i}var mr=t([`span`,`strong`,`b`,`em`,`i`,`a`,`code`,`br`,`small`,`sup`,`sub`,`s`,`del`,`u`,`mark`,`kbd`,`abbr`,`time`]),hr=t([`thead`,`tbody`,`tfoot`,`tr`,`td`,`th`,`caption`,`colgroup`,`col`,`li`]),gr=t([`Card`,`CardContent`,`CardHeader`,`CardFooter`,`GridItem`,`Slide`]),_r=t([`div`,`section`,`article`,`main`,`aside`,`header`,`footer`,`figure`,`nav`]);function vr(e,t){if(t.nodeId){let n=[],r=(e,i)=>e.forEach((e,a)=>{if(e.type!==`element`)return;let o=e.attributes.find(e=>e.name===`id`);o?.value.static&&o.value.json===t.nodeId&&n.push({node:e,parts:[...i,a]}),r(e.children,[...i,a])});return r(e,[]),n.length===1?n[0]:null}let n=t.path.split(`.`).map(Number);if(!t.path||n.some(e=>!Number.isInteger(e)||e<0))return null;let r=lr(e,t.path);return r?.type===`element`?{node:r,parts:n}:null}var yr=(e,t)=>{let n=t.length?lr(e,t.join(`.`)):null;return n?.type===`element`?n:null};function br(e,t,n,i={}){let a={source:e,path:null};if(!/^[A-Za-z0-9]{6,12}$/.test(t))return a;let o=r(e);if(!o.ok)return a;let s=i.nodeId&&xr.test(i.nodeId)?` id="${i.nodeId}"`:``,c=r(`<img src="ref:${t}" alt="" className="my-6 block w-full rounded-md"${s} />`),l=c.ok?c.nodes.find(e=>e.type===`element`):void 0;if(!l)return a;let u=o.nodes,d=n?vr(u,n):null;for(;d&&(mr.has(d.node.tag)||hr.has(d.node.tag)||yr(u,d.parts.slice(0,-1))?.tag===`li`)&&d.parts.length>1;){let e=d.parts.slice(0,-1),t=yr(u,e);d=t?{node:t,parts:e}:null}if(d){let{node:e,parts:t}=d,r=e.isComponent?gr.has(e.tag):_r.has(e.tag)&&!W(e),i=n?.side??(r?`inside`:`after`);if(e.tag===`GridItem`&&(i=`inside`),i===`inside`){if(e.tag===`Card`){let n=e.children.findLastIndex(e=>e.type===`element`&&e.tag===`CardContent`);if(n!==-1){let r=e.children[n];return r.children.push(l),r.selfClosing=!1,{source:H(u),path:[...t,n,r.children.length-1].join(`.`)}}}return e.children.push(l),e.selfClosing=!1,{source:H(u),path:[...t,e.children.length-1].join(`.`)}}let a=t.length>1?yr(u,t.slice(0,-1))?.children:u;if(a){let e=t[t.length-1]+ +(i===`after`);return a.splice(e,0,l),{source:H(u),path:[...t.slice(0,-1),e].join(`.`)}}}let f=u.findIndex(e=>e.type===`element`&&!e.isComponent),p=f===-1?null:u[f];return p?(p.children.push(l),p.selfClosing=!1,{source:H(u),path:`${f}.${p.children.length-1}`}):(u.push(l),{source:H(u),path:String(u.length-1)})}var xr=/^[A-Za-z][A-Za-z0-9]{3}$/,Sr=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,Cr=`${Sr}0123456789`,wr=e=>{let t=256-256%e.length;for(;;){let[n]=globalThis.crypto.getRandomValues(new Uint8Array(1));if(n<t)return e[n%e.length]}},Tr=()=>[Sr,Cr,Cr,Cr].map(wr).join(``);function Er(e,t=Tr){let n=new Set([...e.matchAll(/\bid="([^"]*)"/g)].map(e=>e[1]));for(let e=0;e<64;e++){let e=t();if(xr.test(e)&&!n.has(e))return e}return Tr()}function Dr(e,t){let n=r(e);if(!n.ok)return null;let i=lr(n.nodes,t);if(!i||i.type!==`element`)return null;let a=i.attributes.find(e=>e.name===`id`);return a?.value.static&&typeof a.value.json==`string`&&a.value.json?{path:t,nodeId:a.value.json}:{path:t}}function Or(e,t){let n=e=>!!e&&e.type===`element`&&!e.isComponent&&e.tag===`img`;if(t.nodeId){let r=[],i=e=>{for(let n of e){if(n.type!==`element`)continue;let e=n.attributes.find(e=>e.name===`id`);e?.value.static&&e.value.json===t.nodeId&&r.push(n),i(n.children)}};return i(e),r.length===1&&n(r[0])?r[0]:null}let r=lr(e,t.path);return n(r)?r:null}function kr(e,t,n){if(!/^[A-Za-z0-9]{6,12}$/.test(n))return e;let i=r(e);if(!i.ok)return e;let a=Or(i.nodes,t);return a?(Q(a,`src`,`ref:${n}`),a.attributes=a.attributes.filter(e=>![`srcset`,`sizes`].includes(e.name.toLowerCase())),H(i.nodes)):e}function Ar(e,t,n){let i=r(e);if(!i.ok)return e;let a=Or(i.nodes,t);if(!a)return e;let o=n.trim();return Q(a,`alt`,o===``?void 0:o),H(i.nodes)}function jr(e,t){let n=r(e);if(!n.ok)return null;let i=Or(n.nodes,{path:t});if(!i)return null;let a=i.attributes.find(e=>e.name===`id`);return a?.value.static&&typeof a.value.json==`string`&&a.value.json?{path:t,nodeId:a.value.json}:{path:t}}function Mr(e,t){let n=r(e);if(!n.ok)return null;let i=Or(n.nodes,t)?.attributes.find(e=>e.name===`alt`);return i?.value.static&&typeof i.value.json==`string`&&i.value.json.trim()!==``?i.value.json:null}function Nr(e,t){let n=r(e);if(!n.ok)return e;let i=t.split(`.`).map(Number);if(i.length===0||i.some(e=>!Number.isInteger(e)||e<0))return e;let a=n.nodes;for(let t of i.slice(0,-1)){let n=a[t];if(!n||n.type!==`element`)return e;a=n.children}let o=i[i.length-1],s=a[o];return!s||s.type!==`element`||a===n.nodes&&n.nodes.filter(e=>e.type===`element`).length<=1?e:(a.splice(o,1),H(n.nodes))}function Pr(e,t,n,i){let a=r(e);if(!a.ok)return e;let o=lr(a.nodes,t);return!o||o.type!==`element`||!o.isComponent||o.tag!==n||i(o)===!1?e:H(a.nodes)}var Fr=t([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),Ir=t([`script`,`style`,`textarea`,`title`,`xmp`]),Lr=t([`script`,`iframe`,`object`,`embed`,`base`,`meta`,`link`,`form`,`frame`,`frameset`,`applet`,`noscript`]),Rr=t([`dangerouslysetinnerhtml`,`ref`,`key`,`srcdoc`,`is`]),zr=t([`style`,`labelstyle`]),Br=t([`href`,`src`,`action`,`formaction`,`poster`,`background`,`cite`,`data`,`xlink:href`,`ping`]),Vr=t([`srcset`,`ping`]),Hr=t(ve.map(e=>e.toLowerCase())),Ur={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,nbsp:`\xA0`};function Wr(e){return e.replace(/&(#[xX]?[0-9a-fA-F]+|[a-zA-Z]+);/g,(e,t)=>{if(t[0]===`#`){let n=t[1]===`x`||t[1]===`X`,r=parseInt(t.slice(n?2:1),n?16:10);return Number.isFinite(r)&&r>=0&&r<=1114111?String.fromCodePoint(r):e}return Ur[t.toLowerCase()]??e})}function Gr(e){let t={kind:`el`,tag:`#root`,attrs:[],children:[]},n=[t],r=()=>n[n.length-1],i=e=>{e&&r().children.push({kind:`text`,value:Wr(e)})},a=0;for(;a<e.length;){let t=e.indexOf(`<`,a);if(t===-1){i(e.slice(a));break}if(t>a&&i(e.slice(a,t)),e.startsWith(`<!--`,t)){let n=e.indexOf(`-->`,t+4);a=n===-1?e.length:n+3;continue}if(e[t+1]===`!`||e[t+1]===`?`){let n=e.indexOf(`>`,t);a=n===-1?e.length:n+1;continue}if(e[t+1]===`/`){let r=e.indexOf(`>`,t),i=e.slice(t+2,r===-1?e.length:r).trim().toLowerCase();for(let e=n.length-1;e>=1;e--)if(n[e].tag===i){n.length=e;break}a=r===-1?e.length:r+1;continue}let o=/^<([a-zA-Z][a-zA-Z0-9-]*)/.exec(e.slice(t));if(!o){i(`<`),a=t+1;continue}let s=o[1].toLowerCase(),c=t+o[0].length,l=[],u=!1;for(;c<e.length;){for(;c<e.length&&/\s/.test(e[c]);)c++;if(e[c]===`>`){c++;break}if(e[c]===`/`){if(e[c+1]===`>`){u=!0,c+=2;break}c++;continue}let t=/^[^\s=/>]+/.exec(e.slice(c));if(!t){c++;continue}let n=t[0];for(c+=t[0].length;c<e.length&&/\s/.test(e[c]);)c++;if(e[c]===`=`){for(c++;c<e.length&&/\s/.test(e[c]);)c++;let t=``,r=e[c];if(r===`"`||r===`'`){let n=e.indexOf(r,c+1);t=e.slice(c+1,n===-1?e.length:n),c=n===-1?e.length:n+1}else{let n=/^[^\s>]*/.exec(e.slice(c));t=n?n[0]:``,c+=t.length}l.push({name:n,value:Wr(t)})}else l.push({name:n,value:!0})}let d={kind:`el`,tag:s,attrs:l,children:[]};if(r().children.push(d),Ir.has(s)){let t=e.slice(c),n=RegExp(`</${s}\\s*>`,`i`).exec(t),r=n?t.slice(0,n.index):t;r&&d.children.push({kind:`text`,value:r}),a=n?c+n.index+n[0].length:e.length;continue}!u&&!Fr.has(s)&&n.push(d),a=c}return t.children}function Kr(e,t){let n=[];for(let r of e.attrs){let o=r.name.toLowerCase();if(o.startsWith(`data-mx-`)||o===`contenteditable`)continue;if(o.startsWith(`on`)||Rr.has(o)||zr.has(o)){t.push({message:`Dropped attribute "${r.name}" on pasted <${e.tag}>`,attr:r.name,tag:e.tag});continue}if(typeof r.value==`string`&&(Vr.has(o)?a(r.value,o):Br.has(o)&&i(r.value))){t.push({message:`Dropped attribute "${r.name}" with a disallowed URL scheme on <${e.tag}>`,attr:r.name,tag:e.tag});continue}let s=o===`class`?`className`:r.name;n.push({name:s,value:{static:!0,json:r.value},start:0,end:0})}return n}function qr(e,t,n){let r=[];for(let i of e){if(i.kind===`text`){r.push({type:`text`,value:i.value,start:0,end:0});continue}let e=i.attrs.find(e=>e.name.toLowerCase()===ur);if(e&&typeof e.value==`string`){let n=lr(t,e.value);if(n&&n.type===`element`&&n.isComponent){r.push(structuredClone(n));continue}}if(Lr.has(i.tag)){n.push({message:`Dropped pasted <${i.tag}> element`,tag:i.tag});continue}let a=qr(i.children,t,n);if(!Hr.has(i.tag)){n.push({message:`Unwrapped pasted <${i.tag}> element (not in the story tag allowlist)`,tag:i.tag}),r.push(...a);continue}r.push({type:`element`,tag:i.tag,isComponent:!1,attributes:Kr(i,n),children:a,selfClosing:a.length===0,start:0,end:0})}return r}function Jr(e,t){let i=r(e);if(!i.ok)return{source:e,errors:[s(e,i)]};let a=[],o=t.map(e=>({edit:e,host:lr(i.nodes,e.astPath)})),c=!1;for(let{edit:e,host:t}of o){if(!t||t.type!==`element`){a.push({message:`No element at AST path "${e.astPath}" — edit skipped`});continue}let r=qr(Gr(e.innerHtml),i.nodes,a),o=n(r,{components:se,allowedHtmlTags:ve,stylePolicy:`no-inline-style`});if(o.length>0){a.push(...o);continue}t.children=r,r.length>0&&(t.selfClosing=!1),c=!0}return{source:c?H(i.nodes):e,errors:a}}function Yr(e){let t=e[0];return t&&t.type===`element`&&t.tag===`Helmet`?1:0}function Xr(e,t){let n=r(e);if(!n.ok)return t;let i=Yr(n.nodes);if(!i)return t;let[a,...o]=t.split(`.`),s=Number(a);return!Number.isInteger(s)||s<0?t:[String(s+i),...o].join(`.`)}function Zr(e,t){let n=r(e);if(!n.ok)return t;let i=Yr(n.nodes);if(!i)return t;let[a,...o]=t.split(`.`),s=Number(a);return!Number.isInteger(s)||s<0?t:s<i?null:[String(s-i),...o].join(`.`)}function Qr(e){return e.text.size>0||e.format.size>0||e.layout.size>0}function $r(e,t){if(!Qr(t))return e;let n=r(e),i=n.ok?Yr(n.nodes):0,a=e=>{if(!i)return e;let[t,...n]=e.split(`.`),r=Number(t);return Number.isInteger(r)&&r>=0?[String(r+i),...n].join(`.`):e},o=e=>{if(!n.ok)return!1;let t=Me(n.nodes,e);return!!t&&t.type===`element`&&!t.isComponent&&W(t)},s=Jr(e,[...t.text].map(([e,t])=>({astPath:a(e),innerHtml:t})).filter(e=>o(e.astPath))).source;return fr(dr(s,[...t.format].map(([e,t])=>({astPath:a(e),...t}))),[...t.layout].map(([e,t])=>({astPath:a(e),...t})))}function ei(e,t){let n=r(e);if(!n.ok)return e;let i=t=>{let r=Xr(e,t).split(`.`),i=Number(r.pop()),a=r.length?Me(n.nodes,r.join(`.`)):null,o=r.length?a?.type===`element`?a.children:[]:n.nodes,s=o[i];return s?.type===`element`?{node:s,index:i,siblings:o,parent:a}:null};if(t.kind===`delete`){if(!t.paths.length)return e;let a=t.paths.map(i);if(a.some(e=>!e))return e;let o=new Set(a.map(e=>e.node)),s=e=>e.filter(e=>!o.has(e)).map(e=>{if(e.type!==`element`)return e;let t=s(e.children);return[`GridItem`,`Slide`,`div`,`section`,`article`,`td`,`th`].includes(e.tag)&&e.children.length>0&&!t.some(e=>e.type===`element`||e.type===`text`&&e.value.trim())&&t.push({type:`element`,tag:`p`,isComponent:!1,attributes:[{name:`id`,value:{static:!0,json:`e${J().replaceAll(`-`,``)}`},start:0,end:0}],children:[],selfClosing:!1,start:0,end:0}),{...e,children:t}}),c=s(n.nodes);if(!c.some(e=>e.type===`element`&&e.tag!==`Helmet`||e.type===`text`&&e.value.trim())){let e=r(`<p id="e${J().replaceAll(`-`,``)}"></p>`);e.ok&&c.push(...e.nodes)}return H(c)}let a=i(t.path);if(!a)return e;let o=a.node;if(t.kind===`divider`){if(a.parent?.type!==`element`||a.parent.tag!==`Grid`||ni(a.parent,`mode`)!==`flow`||o.tag!==`GridItem`||!Number.isFinite(t.width))return e;let n=a.siblings.slice(a.index+1).find(e=>e.type===`element`);if(n?.type!==`element`||n.tag!==`GridItem`)return e;let r=K(ni(a.parent,`cols`)),i=e=>Math.min(r,Math.max(1,Number(ni(e,`w`))||r)),s=0;for(let e of a.siblings.slice(0,a.index)){if(e.type!==`element`||e.tag!==`GridItem`)continue;let t=i(e);s=s+t>r?t:s+t,s===r&&(s=0)}if(s+i(o)+i(n)>r)return e;let c=i(o)+i(n),l=Math.max(1,Math.min(c-1,Math.round(t.width)));Q(o,`w`,l),Q(n,`w`,c-l)}else if(t.kind===`move`){let n=i(t.target);if(!n||a.siblings!==n.siblings||a.node===n.node)return e;a.siblings.splice(a.index,1),a.siblings.splice(n.index,0,o)}else if(t.kind===`resize`){if(!Number.isFinite(t.width)||!Number.isFinite(t.height))return e;if(t.grid){if(o.tag!==`GridItem`)return e;if(t.axis!==`height`&&Q(o,`w`,Math.max(1,Math.min(K(a.parent?.type===`element`?ni(a.parent,`cols`):void 0),Math.round(t.width)))),t.axis===`width`)return H(n.nodes);a.parent?.type===`element`&&ni(a.parent,`mode`)===`flow`?Q(o,`minHeight`,Math.max(0,Math.min(1e4,Math.round(t.height)))):Q(o,`h`,Math.max(1,Math.min(1e3,Math.round(t.height))))}else{let e=Math.max(40,Math.min(4e3,Math.round(t.width))),n=Math.max(0,Math.min(1e4,Math.round(t.height))),r=ti(o).filter(e=>!(t.axis!==`height`&&/^w-|^max-w-/.test(e))&&!(t.axis!==`width`&&/^h-|^min-h-|^max-h-|^overflow-(?:hidden|clip)$/.test(e)));t.axis!==`height`&&r.push(`w-[${e}px]`,`max-w-full`),t.axis!==`width`&&r.push(`min-h-[${n}px]`),Q(o,`className`,r.join(` `))}}else o.tag===`GridItem`?Q(o,`minHeight`,void 0):Q(o,`className`,ti(o).filter(e=>!/^min-h-\[/.test(e)).join(` `));return H(n.nodes)}function ti(e){let t=e.attributes.find(e=>[`className`,`class`].includes(e.name))?.value;return t?.static&&typeof t.json==`string`?t.json.split(/\s+/).filter(Boolean):[]}function ni(e,t){let n=e.attributes.find(e=>e.name===t)?.value;return n?.static?n.json:void 0}function ri(e,t,n){return Pr(e,t,`Question`,e=>{Q(e,`viz`,n)})}function ii(e,t,n){if(n===null)return Pr(e,t,`Question`,e=>{Q(e,`data`,void 0)});let r=n.trim();if(!r)return e;let i=r.startsWith(`$`)?r:`$${r}`;return Pr(e,t,`Question`,e=>{Q(e,`data`,i)})}function ai(e,t,n){return ri(ii(e,t,n.table),t,n.viz)}function oi(e,t,n){let r=n?.trim()??``;return Pr(e,t,`Question`,e=>{Q(e,`title`,r?n:void 0)})}var si={kind:`dynamic`};function ci(e,t){let n=r(e);if(!n.ok)return null;let i=Me(n.nodes,t);if(!i||i.type!==`element`||!i.isComponent||i.tag!==`Question`)return null;let a=e=>i.attributes.find(t=>t.name===e)?.value,o=a(`viz`),s=a(`data`),c=a(`title`);return{viz:o===void 0?void 0:o.static?o.json:si,table:s?.static?li(s.json):null,title:c?.static&&typeof c.json==`string`?c.json:null}}function li(e){return typeof e==`string`?ce(e.trim()):null}function ui(e,t){let n=r(e);if(!n.ok)return null;let i=Me(n.nodes,t);if(!i||i.type!==`element`||!i.isComponent||i.tag!==`Number`)return null;let a=e=>i.attributes.find(t=>t.name===e)?.value,o=e=>{let t=a(e);return t?.static&&typeof t.json==`string`?t.json:null},s=a(`data`);return{table:s?.static?li(s.json):null,col:o(`col`),agg:o(`agg`),prefix:o(`prefix`),suffix:o(`suffix`),format:o(`format`)}}function di(e,t,n){return typeof n.table==`string`&&!n.table.trim()?e:Pr(e,t,`Number`,e=>{if(n.table!==void 0){let t=n.table?.trim();Q(e,`data`,t?t.startsWith(`$`)?t:`$${t}`:void 0)}for(let t of[`col`,`agg`,`prefix`,`suffix`,`format`])n[t]!==void 0&&Q(e,t,n[t]??void 0)})}function fi(e,t){let n=r(e);if(!n.ok)return null;let i=Me(n.nodes,t);if(!i||i.type!==`element`||!i.isComponent||i.tag!==`Mermaid`)return null;let a=e=>{let t=i.attributes.find(t=>t.name===e)?.value;return t?.static&&typeof t.json==`string`?t.json:null};return{code:a(`code`)??``,title:a(`title`)}}function pi(e,t,n){return n.code!==void 0&&o(n.code)?e:Pr(e,t,`Mermaid`,e=>{n.code!==void 0&&Q(e,`code`,n.code),n.title!==void 0&&Q(e,`title`,n.title?.trim()?n.title:void 0)})}function mi(e,t,n){let r=n.trim();return Pr(e,t,`Slide`,e=>{Q(e,`title`,r||void 0)})}function hi(e,t){let n=Bn(e);if(!n.ok)return[];let{content:r}=Se(n.nodes),i=[];for(let e of r.values)e.kind===`table`&&i.push({name:e.name,kind:`value`,columns:t?.tables[e.name]?.columns??e.columns});for(let e of r.queries)i.push({name:e.name,kind:`query`,columns:t?.tables[e.name]?.columns??[],sql:e.sql});return i}var gi=new Set([`data`,`options`]),_i=(e,t)=>{let n=e.attributes.find(e=>e.name===t);return n?.value.static&&typeof n.value.json==`string`?n.value.json:null};function vi(e){let t=new Map,n=Yr(e),r=(e,n)=>{if(e.type===`element`){for(let r of e.attributes){if(!gi.has(r.name)||!r.value.static||typeof r.value.json!=`string`)continue;let i=ce(r.value.json.trim());if(!i)continue;let a=t.get(i)??[];a.push({tag:e.tag,label:_i(e,`title`),path:n}),t.set(i,a)}e.children.forEach((e,t)=>r(e,`${n}.${t}`))}};return e.forEach((e,t)=>{t>=n&&r(e,String(t-n))}),t}var yi=(e,t)=>{if(e.source)return e.source;let n=t?.queries.find(t=>t.name===e.name)?.reads.imports[0];return n?t.imports.find(e=>e.name===n)?.ref??null:null},bi=(e,t,n,r,i)=>({name:e.name,sql:e.sql,source:yi(e,i),result:t?.tables[e.name]??null,error:t?.errors?.[e.name]??null,pending:n,bound:r});function xi(e,t,n=!1,r){let i=Bn(e);if(!i.ok)return[];let a=vi(i.nodes);return Se(i.nodes).content.queries.map(e=>bi(e,t,n,a.get(e.name)??[],r))}function Si(e,t){for(let n of e)if(!(n.type!==`element`||!n.isComponent||n.tag!==`Helmet`)){for(let e of n.children)if(e.type===`element`&&e.tag===`Query`&&_i(e,`name`)===t)return e}return null}function Ci(e,t,n){if(n.trim()===``)return e;let i=r(e);if(!i.ok)return e;let a=Si(i.nodes,t)?.children.find(e=>e.type===`expression`);return!a||a.type!==`expression`||!a.value.static||typeof a.value.json!=`string`||a.value.json===n?e:(a.value={static:!0,json:n},H(i.nodes))}function wi(e,t,i,a){let o=i&&/\bid=["{]/.test(i)?e.indexOf(i):-1;if(o>=0&&e.indexOf(i,o+1)<0){let t=r(a);return!t.ok||!t.nodes.every(Ne)||n(t.nodes,{components:[]}).length?e:e.slice(0,o)+H(t.nodes)+e.slice(o+i.length)}let s=r(e),c=r(i),l=r(a);if(!s.ok||!c.ok||!l.ok||!c.nodes.length||!l.nodes.every(Ne)||n(l.nodes,{components:[]}).length)return e;let u=Xr(e,t).split(`.`),d=Number(u.pop()),f=u.length?Me(s.nodes,u.join(`.`)):null,p=(u.length?f?.type===`element`?f.children:[]:s.nodes).slice(d,d+c.nodes.length);return!p.length||H(p)!==H(c.nodes)||!p.every(Ne)?e:e.slice(0,p[0].start)+H(l.nodes)+e.slice(p.at(-1).end)}var Ti=new Set([`before`,`after`,`inside`]);function Ei(e){let t=e;return t&&typeof t.path==`string`&&typeof t.side==`string`&&Ti.has(t.side)?{path:t.path,side:t.side}:null}function Di(e){let[t,n]=h(null),[r,i]=h(!1),a=!1,o=!1,s=null,l=null,u=t=>{at({runtimeRef:e.runtimeRef},t)};c(m([()=>e.runtimeRef,()=>e.sourceRef,()=>e.sessionNonce],([r,c])=>{y(Je({runtimeRef:r},r=>{let l=e.sessionNonce;if(!(!l||!we(r.data,l)))switch(r.data.type){case`mx:history`:e.onHistory?.(r.data.direction);break;case`mx:edit-flush`:e.onFlush?.();break;case`mx:comment-key`:e.onCommentKey?.();break;case`mx:open-script`:typeof r.data.component==`string`&&e.onOpenScript?.(r.data.component);break;case`mx:block-edit`:{let t=ei(c.current,r.data.command);t!==c.current&&e.onSourceEdited(t,!0);break}case`mx:edit-error`:e.onError?.(r.data.message);break;case`mx:edit-ready`:i(!0);break;case`mx:typing`:a=r.data.active;break;case`mx:selection`:n(r.data.selection);break;case`mx:flow-edit`:{let{path:t,expected:n,replacement:i}=r.data,a=wi(c.current,t,n,i);a===c.current?n!==i&&(o=!0,e.onRejectedEdit?.(i)):e.onSourceEdited(a,!0,r.data.group,r.data.selection);break}case`mx:text-edit`:{let t=$r(c.current,{text:new Map([[r.data.path,r.data.innerHtml]]),format:new Map,layout:new Map});t!==c.current&&e.onSourceEdited(t);break}case`mx:committed`:s?.();break;case`mx:layout-edit`:{let t=$r(c.current,{text:new Map,format:new Map,layout:new Map(r.data.rects.map(e=>[e.path,{x:e.x,y:e.y,w:e.w,h:e.h}]))});t!==c.current&&e.onSourceEdited(t,!0);break}case`mx:slide-title`:e.onSlideTitle?.(r.data.path,r.data.title);break;case`mx:edit-key`:e.onEditKey?.(r.data.key,t());break;case`mx:image-drop`:{let t=r.data.file,n=typeof r.data.target==`string`?r.data.target:null,i=n?{replace:n}:`at`in r.data?{at:Ei(r.data.at)}:null;_().then(()=>i?e.onImageDrop?.(t,i):e.onImageDrop?.(t));break}case`mx:image-replace`:typeof r.data.path==`string`&&e.onImageReplaceRequest?.(r.data.path)}}))}));let d=!1;c(m(()=>e.editing,e=>{e!==d&&(d=e,u({type:De,on:e}),e||(i(!1),n(null),a=!1))}));let f=(n,r)=>{let i=t(),a=i?.path===n&&i.editor===`prose`;if(u({type:Oe,path:n,...r}),a)return;let o=$r(e.sourceRef.current,{text:new Map,format:new Map([[n,r]]),layout:new Map});o!==e.sourceRef.current&&e.onSourceEdited(o)},p=(e,t)=>{u({type:Ae,path:e,href:t})},g=(e,t)=>{e===null&&n(null),u({type:Ee,path:e,...t?.reveal?{reveal:!0}:{},...t?.nodeId?{nodeId:t.nodeId}:{}})},_=async(t=!1)=>{if(o)throw Error(`Recover the uncommitted text before leaving the editor.`);if(!Qe({runtimeRef:e.runtimeRef})){if(t)throw Error(`editor is unavailable`);return}l||=new Promise(e=>{let t=window.setTimeout(()=>n(!1),1200);function n(n=!0){window.clearTimeout(t),s=null,l=null,e(n)}s=n,u({type:U})});let n=await l;if(t&&!n)throw Error(`editor commit timed out`)};return{selection:t,ready:r,discardRejectedEdit:()=>{o=!1},isUserEditing:()=>a||o,applyFormat:f,applyLink:p,applyInline:e=>u({type:`mx:inline`,tag:e}),pasteMarkdown:e=>u({type:`mx:paste`,kind:`markdown`,value:e}),select:g,spotlight:e=>u({type:Te,paths:e}),commitPending:_,restoreSelection:e=>u({type:U,restore:e})}}function Oi(e,t,n){if(t===n)return{ok:!1,reason:`identical`};if(t===``)return{ok:!1,reason:`multiple_matches`};let r=e.indexOf(t);return r===-1?{ok:!1,reason:`no_match`}:e.indexOf(t,r+1)===-1?{ok:!0,splice:{start:r,removed:t,inserted:n}}:{ok:!1,reason:`multiple_matches`}}var ki=e=>e>=55296&&e<=56319,Ai=e=>e>=56320&&e<=57343;function ji(e,t){if(e===t)return null;let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;r>0&&r<n&&Ai(t.charCodeAt(r))&&r--;let i=0;for(;i<n-r&&e[e.length-1-i]===t[t.length-1-i];)i++;return i>0&&ki(t.charCodeAt(t.length-i))&&i--,{start:r,removed:e.slice(r,e.length-i),inserted:t.slice(r,t.length-i)}}function Mi(e,t){for(let n of e){if(!(n.start<t&&t<n.end))continue;if(n.type!==`element`)return{start:n.start,end:n.end};let e=Mi(n.children,t);if(e)return e;if(n.children.length>0){let e=n.children[0].start,r=n.children[n.children.length-1].end;if(e<=t&&t<=r)return{start:t,end:t}}return{start:n.start,end:n.end}}return null}function Ni(e,t){let n=t.start+t.removed.length,r=Mi(e,t.start),i=n===t.start?r:Mi(e,n),a=t.start,o=n;for(let e of[r,i])e&&(a=Math.min(a,e.start),o=Math.max(o,e.end));return{start:a,end:o}}function Pi(e,t){let n=Bn(e);return n.ok?Ni(n.nodes,t):{start:0,end:e.length}}var Fi=256;function Ii(e,t){if(t.start===0)return null;let n=e[t.start-1]+t.inserted;return{start:t.start-1,removed:e.slice(t.start-1,t.start-1+t.removed.length),inserted:n.slice(0,t.inserted.length)}}function Li(e,t){let n=t.start+t.removed.length;if(n>=e.length)return null;let r=t.inserted+e[n];return{start:t.start+1,removed:e.slice(t.start+1,t.start+1+t.removed.length),inserted:r.slice(1)}}function Ri(e,t){let n=Bn(e);if(!n.ok)return t;let r=e=>{let t=Ni(n.nodes,e);return t.end-t.start},i=(t,n)=>{let r=Math.min(t.start,n.start),i=Math.max(t.start+t.removed.length,n.start+n.removed.length),a=t=>e.slice(r,t.start)+t.inserted+e.slice(t.start+t.removed.length,i);return t.inserted.length-t.removed.length===n.inserted.length-n.removed.length&&a(t)===a(n)},a=t,o=r(t);for(let n of[Ii,Li]){let s=t;for(let c=0;c<Fi;c++){let c=n(e,s);if(!c||!i(t,c))break;let l=r(c);l<o&&(a=c,o=l),s=c}}return a}function zi(e,t){return e.start<t.end&&t.start<e.end}function Bi(e,t){return e.slice(0,t.start)+t.inserted+e.slice(t.start+t.removed.length)}function Vi(e,t){let{start:n,removed:r,inserted:i}=e.splice,a={...e.span};for(let e of t){if(zi(a,e.span))return{ok:!1,conflictWith:e};if(e.splice.start+e.splice.removed.length<=n){let t=e.splice.inserted.length-e.splice.removed.length;n+=t,a={start:a.start+t,end:a.end+t}}}return{ok:!0,splice:{start:n,removed:r,inserted:i},span:a}}var Hi=e=>new TextEncoder().encode(e).length;function Ui(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r],a=n+i.text.length;if(t===n)return r;if(t<a){let a=t-n;return e.splice(r,1,{text:i.text.slice(0,a),baseStart:i.baseStart},{text:i.text.slice(a),baseStart:i.baseStart===null?null:i.baseStart+a}),r+1}n=a}return e.length}function Wi(e,t,n,r){let i=Ui(e,t),a=Ui(e,t+n);e.splice(i,a-i,...r?[{text:r,baseStart:null}]:[]);for(let t=e.length-1;t>0;t--){let n=e[t-1],r=e[t],i=n.baseStart!==null&&r.baseStart===n.baseStart+n.text.length;(n.baseStart===null&&r.baseStart===null||i)&&(n.text+=r.text,e.splice(t,1))}}function Gi(e,t){let n=[],r=0,i=``,a=t=>{let a=ji(e.slice(r,t),i);if(a){let t={...a,start:r+a.start};n.push({splice:t,span:Pi(e,t)})}r=t,i=``};for(let e of t){if(e.baseStart===null){i+=e.text;continue}(e.baseStart!==r||i)&&a(e.baseStart),r=e.baseStart+e.text.length}return(r!==e.length||i)&&a(e.length),n}function Ki(e,t){if(t.length===0)return{ok:!1,reason:`empty_batch`};if(t.length>64)return{ok:!1,reason:`too_many_edits`};let n=Hi(e);if(n>2e6)return{ok:!1,reason:`too_large`};let r=e,i=e?[{text:e,baseStart:0}]:[];for(let e=0;e<t.length;e++){let a=t[e];if(n+=Hi(a.oldString)+Hi(a.newString),n>2e6)return{ok:!1,reason:`too_large`};let o=Oi(r,a.oldString,a.newString);if(!o.ok)return{ok:!1,reason:o.reason,editIndex:e};Wi(i,o.splice.start,o.splice.removed.length,o.splice.inserted),r=Bi(r,o.splice)}return{ok:!0,source:r,changes:Gi(e,i)}}function qi(e,t,n){let r=[];for(let e of t){let t=Vi(e,n);if(!t.ok)return{ok:!1};r.push({splice:t.splice,span:t.span})}r.sort((e,t)=>e.splice.start-t.splice.start);for(let t=0;t<r.length;t++){let n=r[t].splice;if(e.slice(n.start,n.start+n.removed.length)!==n.removed)return{ok:!1};if(t>0){let e=r[t-1].splice;if(e.start+e.removed.length>n.start)return{ok:!1}}}let i=e;for(let e=r.length-1;e>=0;e--)i=Bi(i,r[e].splice);return{ok:!0,source:i,changes:r}}function Ji(e,t){if(e===t)return[];let n=[],r=(t,r,i)=>{let a=ji(t,r);if(!a)return;let o=Ri(e,{...a,start:i+a.start});n.push({splice:o,span:Pi(e,o)})},i=Bn(e),a=Bn(t),o=(n,i)=>{if(n.length!==i.length)return!1;for(let a=0;a<n.length;a++){let s=n[a],c=i[a],l=e.slice(s.start,s.end),u=t.slice(c.start,c.end);if(l!==u){if(s.type===`element`&&c.type===`element`&&s.tag===c.tag&&s.children.length&&c.children.length){let n=e.slice(s.start,s.children[0].start),r=t.slice(c.start,c.children[0].start),i=e.slice(s.children.at(-1).end,s.end),a=t.slice(c.children.at(-1).end,c.end);if(n===r&&i===a&&o(s.children,c.children))continue}r(l,u,s.start)}}return!0};return(!i.ok||!a.ok||!o(i.nodes,a.nodes))&&r(e,t,0),n.sort((e,t)=>e.splice.start-t.splice.start),[...n].reverse().reduce((e,t)=>Bi(e,t.splice),e)!==t&&(n.length=0,r(e,t,0)),n}var Yi=class{past=[];future=[];get canUndo(){return this.past.length>0}get canRedo(){return this.future.length>0}record(e,t,n={}){let{group:r,before:i,after:a,annotationOps:o=[]}=n;if(e===t)return;let s=o.slice().reverse().map(e=>({id:e.id,kind:`undo`})),c=this.past.at(-1),l=Date.now();r&&c?.group===r&&c.base===e&&c.original!==void 0&&l-(c.time??0)<750?this.past[this.past.length-1]={base:t,changes:Ji(t,c.original),original:c.original,group:r,time:l,bookmark:c.bookmark,oppositeBookmark:a,undoOps:[...s,...c.undoOps??[]],redoOps:[...c.redoOps??[],...o]}:this.past.push({base:t,changes:Ji(t,e),original:e,group:r,time:l,bookmark:i,oppositeBookmark:a,undoOps:s,redoOps:o}),this.past.length>100&&this.past.shift(),this.future=[]}apply(e,t,n){let r=t.at(-1);if(!r)return{ok:!1,reason:`empty`};let i=Ji(r.base,e).reverse().map((e,t)=>({...e,seq:t,editId:`external-${t}`})),a=qi(e,r.changes,i);return a.ok?(t.pop(),n.push({base:a.source,changes:Ji(a.source,e),bookmark:r.oppositeBookmark,oppositeBookmark:r.bookmark,undoOps:r.redoOps,redoOps:r.undoOps}),{ok:!0,source:a.source,...r.bookmark?{bookmark:r.bookmark}:{},...r.undoOps?.length?{annotationOps:r.undoOps}:{}}):{ok:!1,reason:`conflict`}}undo(e){return this.apply(e,this.past,this.future)}redo(e){return this.apply(e,this.future,this.past)}};function Xi(e,t){if(e===t)return[];let n=Ji(e,t),r=Bn(e),i=(e,t)=>{let n=null,i=r=>{for(let a of r)a.type===`element`&&a.start<=e&&a.end>=t&&(n={start:a.start,end:a.end},i(a.children))};return r.ok&&i(r.nodes),n},a=[];for(let{span:e,splice:t}of n){let n=i(t.start,t.start+t.removed.length)??{start:Math.min(e.start,t.start),end:Math.max(e.end,t.start+t.removed.length)},r=a.at(-1);r&&n.start<=r.end?r.end=Math.max(r.end,n.end):a.push(n)}let o=a.map(r=>{let i=n.filter(e=>e.splice.start<r.start).reduce((e,t)=>e+t.splice.inserted.length-t.splice.removed.length,0),a=n.filter(e=>e.splice.start>=r.start&&e.splice.start<=r.end).reduce((e,t)=>e+t.splice.inserted.length-t.splice.removed.length,0);return{oldString:e.slice(r.start,r.end),newString:t.slice(r.start+i,r.end+i+a)}}),s=Ki(e,o);return s.ok&&s.source===t?o:[{oldString:e,newString:t}]}var Zi=1500,Qi=100;function $i(e,t){return{...e,...t,annotationOps:G(e?.annotationOps,t?.annotationOps)}}function ea(e){let t=e(),n={editId:t.initialEditId,version:t.initialVersion,status:``,pending:!1},r=new Set,i=e=>{n=typeof e==`function`?e(n):e;for(let e of r)e(n)},a=!0,o=t.initialEditId,s={document:t.initialDocument,version:t.initialVersion,meta:t.initialMetadata??{}},c=t.initialSource,l=null,u=!1,d=null,f=null,p=0,m=!1,h=!1,g=null,_=!1,v=[],y=null,b=e=>e===o||v.includes(e),x=()=>e().isUserEditing?.()??!1,S=typeof window>`u`?0:window.setTimeout(()=>{let e=s;!a||d||f||!e.document||Re({...e,document:e.document,title:e.meta.title,description:e.meta.description})},Zi),C=(e,t,n)=>{let{source:r,annotationOps:i,...a}=n;return Le(e,{...t,document:t.document,title:t.meta.title,description:t.meta.description},{source:r,annotationOps:i,metadata:a})},w=null,T=!1,E=!1,D=()=>{let t=d,n=s,r=e().backend;if(!a||!t||!n.document||f||h||!Ie()||w&&w.change===t&&w.snapshot===n&&w.backend===r||t.source!==void 0&&c!==void 0&&t.source===c&&t.title===void 0&&t.theme===void 0&&t.colorMode===void 0&&!t.annotationOps?.length)return;if(T){E=!0;return}T=!0;let i=C(r,{...n,document:n.document},t);w={change:t,snapshot:n,backend:r,result:i},i.catch(()=>{}).finally(()=>{T=!1,E&&(E=!1,D())})},O=t=>e().onRemoteDocument(t,o),ee=(e,t)=>{let n=Ji(t.local,t.server).reverse().map((e,t)=>({...e,seq:t,editId:o}));return qi(t.server,Ji(t.local,e),n)},k=async()=>{if(f)return f;let t=d;if(!t)return;d=null,h=!1,_=!1;let n=t;if(l&&t.source!==void 0&&c!==void 0){let e=ee(t.source,l);if(!e.ok){h=!0,g=t,i(e=>({...e,status:`not saved — newer typing conflicts with the accepted document`,pending:!1}));return}n={...t,source:e.source}}if((n.source!==void 0&&c!==void 0?Xi(c,n.source):void 0)?.length===0&&n.title===void 0&&n.theme===void 0&&n.colorMode===void 0){g=null,i(e=>({...e,pending:!1,status:``}));return}let r=e().backend,u=(async()=>{let e=!1;try{let u=s;if(!u.document)throw Error(`Refresh the document before saving.`);let f=w&&w.change===n&&n===t&&w.snapshot===u&&w.backend===r?w.result:null;w=null;let p=await(f??C(r,{...u,document:u.document},n));e=!0;let m=r.commitEdit({edit_id:o,document_update:p}),_=m.then(e=>{e.ok&&e.body.edit_id&&(v.push(e.body.edit_id),v.length>8&&v.shift()),y===_&&(y=null)},()=>{y===_&&(y=null)});y=_;let b=await m,S=b.body;if(b.ok){let e={document:S.document,source:S.markup};if(!S.document&&S.patch){let t=S.version===u.version+1?[]:S.remote_patches,n=t&&t.length===S.version-u.version-1&&t.every((e,t)=>e.version===u.version+1+t)?[...t,{version:S.version,patch:S.patch}]:null,r=n?{document:u.document,source:``}:null;for(let e of n??[])if(r=await ze(r.document,e.version-1,e.patch),!r)break;e=r??{}}if(!e.document&&S.patch){let t=await r.load().catch(()=>null);e={document:t?.document?.kind===`graph`?t.document:void 0,source:t?.markup}}for(;a&&x();)await new Promise(e=>window.setTimeout(e,30));if(!a)return;if(g=null,o=S.edit_id,s={document:e.document,version:S.version,meta:{title:S.title,theme:S.theme,template:S.template,colorMode:S.colorMode}},c!==void 0&&n.source!==void 0&&t.source!==void 0){let r=e.source??n.source;l=r===t.source?null:{local:t.source,server:r},c=r,l&&F()}i({editId:S.edit_id,version:S.version,status:``,pending:!1})}else if(S.detail===`identical`)g=null,i(e=>({...e,status:``,pending:!1}));else{h=!0,g=$i(n,d);let e=S.details?.find(e=>typeof e?.message==`string`)?.message,t=(S.details?.length??0)-1;i(n=>({...n,status:e?`not saved — ${e}${t>0?` (+${t} more)`:``}`:`not saved (${S.error??b.status})`,pending:!1}))}}catch(t){h=!0,g=$i(n,d),_=e,e&&(d=$i(n,d)),i(n=>({...n,status:e?`offline — will retry`:`not saved — ${t instanceof Error?t.message:`Document validation failed`}`,pending:!1}))}finally{f=null,a&&d&&!m&&(window.clearTimeout(p),p=window.setTimeout(()=>void k(),500),D())}})();return f=u,i(e=>({...e,pending:!0,status:`saving…`})),u},A=e=>{d={...d??{},...e,annotationOps:G(d?.annotationOps,e.annotationOps)},i(e=>({...e,pending:!0})),window.clearTimeout(p),p=window.setTimeout(()=>void k(),e.annotationOps?.some(e=>e.kind===`map`)?0:500),D()},j=async()=>{do if(window.clearTimeout(p),await(f??k()),h&&(_||!d))break;while(d||f)},M=async e=>{m=!0;try{return window.clearTimeout(p),await e(),g&&(d=$i(g,d)),g=null,await j(),!h&&!d&&!f}catch{return i(e=>({...e,status:`not saved — editor did not finish; retry navigation`,pending:!1})),!1}finally{m=!1}},N=()=>d===null&&f===null&&g===null,te=()=>d===null&&f===null&&!x(),P=()=>te()?Promise.resolve():new Promise(e=>{let t=()=>{!a||te()?e():window.setTimeout(t,Qi)};window.setTimeout(t,Qi)});function F(){u||(u=!0,P().then(()=>{if(u=!1,!a||!l||g)return;if(!te()){F();return}let e=l.server;l=null,O(e)}))}return{getState:()=>n,subscribe(e){return r.add(e),()=>{r.delete(e)}},queue:A,flushNow:j,flushForNavigation:M,adoptRemote:(e,t,n=null,r,a,u={})=>e===o||!N()||x()?!1:(o=e,s={document:r,version:a??s.version,meta:u},i(t=>({...t,editId:e,status:n?`updated by @${n}`:t.status})),c!==void 0&&(c=t),l=null,O(t),!0),recover:async t=>{window.clearTimeout(p),f&&await f;let n=$i(g,d);try{let r=await e().backend.load();if(!r)throw Error(`Could not read the latest document.`);if(typeof r.markup!=`string`||!r.edit_id)throw Error(`The latest document is unavailable.`);let a=r.markup,u=l?.local??c;if(t===`retry`&&n.source!==void 0&&u!==void 0){let e=Ji(u,r.markup).reverse().map((e,t)=>({...e,seq:t,editId:r.edit_id})),t=qi(r.markup,Ji(u,n.source),e);if(!t.ok){i(e=>({...e,status:`not saved — overlapping edits need review; your draft is preserved`,pending:!1}));return}a=t.source}else t===`retry`&&n.source!==void 0&&(a=n.source);c=r.markup,l=null,o=r.edit_id,s={document:r.document,version:r.version,meta:{title:r.title,theme:r.theme,template:r.template,colorMode:r.colorMode}},d=null,g=null,h=!1,i({editId:r.edit_id,version:r.version,status:``,pending:!1}),O(a),t===`retry`&&(d={...n,source:a},await k())}catch(e){i(t=>({...t,status:`not saved — ${e instanceof Error?e.message:`recovery failed`}`,pending:!1}))}},isIdle:N,whenIdle:P,isOwnEdit:e=>{if(b(e))return!0;let t=y;return t?t.then(()=>b(e)):!1},dispose(){a=!1,window.clearTimeout(S),window.clearTimeout(p)}}}function ta(e){let t=ea(()=>e),[n,r]=h(t.getState()),i=t.subscribe(r);return v()&&y(()=>{i(),t.dispose()}),{get state(){return n()},queue:t.queue,recover:t.recover,flushNow:t.flushNow,flushForNavigation:t.flushForNavigation,adoptRemote:t.adoptRemote,isIdle:t.isIdle,whenIdle:t.whenIdle,isOwnEdit:t.isOwnEdit,dispose:t.dispose}}function na(e){let t=e.initial,[n,r]=h(t),[i,a]=h(0),o=new Yi,[s,c]=h(!1),[l,u]=h(!1),d=()=>{c(o.canUndo),u(o.canRedo)},f=null,p=()=>{f!==null&&clearTimeout(f),f=null,r(t)},m=(e,n=!1)=>{if(t=e,!n){p();return}f!==null&&clearTimeout(f),f=setTimeout(p,600)},g=(n,r)=>{if(n===t)return;let i=r.selection?.annotationOperation?[r.selection.annotationOperation]:void 0;o.record(t,n,{group:r.group,before:r.selection?.before,after:r.selection?.after,annotationOps:i}),d();let a=r.origin===`local`&&!!r.group?.startsWith(`typing:`);m(n,a),e.live.queue(i?{source:n,annotationOps:i}:{source:n}),r.redraw&&e.draw(n,void 0,a?{typing:!0}:void 0)},_=(t,n)=>{m(t),a(e=>e+1),e.draw(t,n)},v=async n=>{try{await e.commitPending()}catch(e){return{ok:!1,reason:`unavailable`,message:e instanceof Error?e.message:`Editor is unavailable.`}}let r=o[n](t);return d(),r.ok?(m(r.source),a(e=>e+1),e.live.queue(r.annotationOps?{source:r.source,annotationOps:r.annotationOps}:{source:r.source}),e.draw(r.source),r):r};return{source:n,revision:i,canUndo:s,canRedo:l,current:()=>t,apply:g,replaceFromRemote:_,undo:()=>v(`undo`),redo:()=>v(`redo`)}}var ra=Dn;function ia(e,t){let n=null,r=null,i=()=>{r!==null&&clearTimeout(r),r=null,n=null},a=(n,r)=>{let i=Wn(n,ra);if(!i)return;let a={type:ke,nodes:i.nodes,source:n,editId:t.editId(),theme:t.theme(),colorMode:t.colorMode(),...r.preview?{preview:!0}:{},...r.typing?{typing:!0}:{},...r.redraw?{redraw:!0}:{}};at({runtimeRef:e},a)},o=()=>{let e=n;i(),e!==null&&a(e,{typing:!0})};return Object.assign((e,t={})=>{if(t.typing&&!t.preview){n=e,r!==null&&clearTimeout(r),r=setTimeout(o,300);return}i(),a(e,t)},{flush:o,cancel:i})}function aa(e){let[t,n]=h([]),[r,i]=h(!1),a=null,o=!1,s=()=>e.backend.unavailable(`versions`)?Promise.resolve():a?(o=!0,a):(a=(async()=>{do{o=!1;let t=await e.backend.versions();t&&!o&&n(t)}while(o)})().finally(()=>{a=null}),a),l=!0,u;return c(()=>{if(e.currentVersion,e.backend,l){l=!1,s();return}clearTimeout(u),u=setTimeout(()=>void s(),300)}),y(()=>clearTimeout(u)),{versions:t,busy:r,refresh:s,fetchVersion:t=>e.backend.version(t),restore:async t=>{i(!0);try{return await Y(e.backend,t)}finally{i(!1)}}}}var oa=A(`<span aria-hidden=true class="absolute right-0.5 top-0.5 h-1.5 w-1.5 rounded-full bg-accent">`),sa=A(`<button type=button aria-label="Collapse panel"aria-expanded=true class="inline-flex h-7 w-7 shrink-0 cursor-pointer items-center justify-center rounded-[4px] text-muted hover:bg-raised hover:text-fg">`),ca=A(`<aside aria-label="Edit panel"class="fixed right-0 bottom-0 z-30 flex flex-col border-l border-edge bg-surface"><div class="flex h-10 shrink-0 items-center gap-1 border-b border-edge px-2"><div role=tablist aria-label="Edit panel tabs"class="flex min-w-0 flex-1 items-center gap-0.5"></div></div><div role=tabpanel class="flex min-h-0 flex-1 flex-col">`),la=A(`<button type=button aria-label="Expand panel"aria-expanded=false class="inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-[4px] text-muted hover:bg-raised hover:text-fg">`),ua=A(`<aside aria-label="Edit panel"class="fixed right-0 bottom-0 z-30 flex flex-col items-center gap-1 border-l border-edge bg-surface py-2"><div role=tablist aria-label="Edit panel tabs"aria-orientation=vertical class="flex flex-col gap-1 border-t border-edge pt-1">`),da=A(`<button type=button role=tab>`),fa=A(`<span hidden>`),pa=A(`<button type=button role=tab><span>`),ma=[{tab:`selection`,label:`Selection`,Icon:en},{tab:`history`,label:`History`,Icon:Xt},{tab:`comments`,label:`Comments`,Icon:ae}],ha=`Select a chart, image or block to see its settings.`;function ga(e){let t=g(),n=()=>ma.filter(t=>t.tab!==`comments`||e.commentsAvailable),r=t=>t===`history`?e.historyUnavailable??null:null,i=oa();return b(C,{get when(){return!e.collapsed},get fallback(){return(()=>{var a=ua(),o=a.firstChild;return N(a,`width`,`44px`),k(a,b(z,{content:`Expand panel`,side:`left`,get children(){var t=la();return t.$$click=()=>e.onCollapsedChange(!1),k(t,b(Kt,{size:15})),t}}),o),k(o,b(x,{get each(){return n()},children:({tab:n,label:a,Icon:o})=>{let s=()=>r(n),c=(()=>{var r=da();return r.$$click=()=>e.onTab(n),D(r,`aria-label`,a),k(r,b(o,{size:14}),null),k(r,()=>n===`selection`&&e.selectionDot&&i,null),E(i=>{var a=e.tab===n,o=n===`selection`&&e.selectionDot?`true`:void 0,c=!!s()||void 0,l=s()?`${t}-${n}-reason`:void 0,u=`relative inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-[4px] disabled:cursor-default disabled:opacity-50 ${e.tab===n?`bg-accent-soft text-accent`:`text-muted hover:bg-raised hover:text-fg`}`;return a!==i.e&&D(r,`aria-selected`,i.e=a),o!==i.t&&D(r,`data-new-selection`,i.t=o),c!==i.a&&(r.disabled=i.a=c),l!==i.o&&D(r,`aria-describedby`,i.o=l),u!==i.i&&T(r,i.i=u),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),r})();return[b(C,{get when(){return s()},get fallback(){return b(z,{content:a,side:`left`,children:c})},children:c}),b(C,{get when(){return s()},children:e=>(()=>{var r=fa();return D(r,`id`,`${t}-${n}-reason`),k(r,e),r})()})]}})),E(t=>N(a,`top`,`${e.top}px`)),a})()},get children(){var a=ca(),o=a.firstChild,s=o.firstChild,c=o.nextSibling;return N(a,`width`,`320px`),k(s,b(x,{get each(){return n()},children:({tab:n,label:a,Icon:o})=>{let s=()=>r(n);return[(()=>{var r=pa(),c=r.firstChild;return r.$$click=()=>e.onTab(n),D(r,`id`,`${t}-${n}`),D(r,`aria-label`,a),D(r,`aria-controls`,`${t}-body`),k(r,b(o,{size:13,class:`shrink-0`}),c),k(c,a),k(r,()=>n===`selection`&&e.selectionDot&&i,null),E(i=>{var a=e.tab===n,o=n===`selection`&&e.selectionDot?`true`:void 0,c=!!s()||void 0,l=s()?`${t}-${n}-reason`:void 0,u=`relative inline-flex h-7 cursor-pointer items-center gap-1.5 rounded-[4px] px-2 font-mono text-[11px] disabled:cursor-default disabled:opacity-50 ${e.tab===n?`bg-accent-soft text-accent`:`text-muted hover:bg-raised hover:text-fg`}`;return a!==i.e&&D(r,`aria-selected`,i.e=a),o!==i.t&&D(r,`data-new-selection`,i.t=o),c!==i.a&&(r.disabled=i.a=c),l!==i.o&&D(r,`aria-describedby`,i.o=l),u!==i.i&&T(r,i.i=u),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),r})(),b(C,{get when(){return s()},children:e=>(()=>{var r=fa();return D(r,`id`,`${t}-${n}-reason`),k(r,e),r})()})]}})),k(o,b(z,{content:`Collapse panel`,side:`bottom`,get children(){var t=sa();return t.$$click=()=>e.onCollapsedChange(!0),k(t,b(Wt,{size:15})),t}}),null),D(c,`id`,`${t}-body`),k(c,()=>e.children),E(n=>{var r=`${e.top}px`,i=`${t}-${e.tab}`;return r!==n.e&&N(a,`top`,n.e=r),i!==n.t&&D(c,`aria-labelledby`,n.t=i),n},{e:void 0,t:void 0}),a}})}S([`click`]);var _a=[`text-xs`,`text-sm`,`text-base`,`text-lg`,`text-xl`,`text-2xl`,`text-3xl`,`text-4xl`,`text-5xl`,`text-6xl`,`text-7xl`,`text-8xl`,`text-9xl`],va={size:_a,weight:[`font-bold`],fontStyle:[`italic`],decoration:[`underline`],align:[`text-left`,`text-center`,`text-right`,`text-justify`]},ya=[`0`,`1`,`2`,`3`,`4`,`6`,`8`,`10`,`12`,`16`,`20`,`24`],ba=ya.map(e=>`mt-${e}`),xa=ya.map(e=>`mb-${e}`),Sa=[`max-w-sm`,`max-w-md`,`max-w-lg`,`max-w-xl`,`max-w-prose`,`max-w-2xl`,`max-w-3xl`,`max-w-4xl`,`max-w-5xl`,`max-w-6xl`,`max-w-7xl`,`max-w-full`],Ca=ya.map(e=>`pl-${e}`),wa=ya.map(e=>`pr-${e}`),Ta=[`-mx-6`,`@2xl:-mx-12`,`px-6`,`@2xl:px-12`];[...new Set([...Object.values(va).flat(),...ba,...xa,...Sa,...Ca,...wa,...Ta])];var Ea=e=>e.split(/\s+/).filter(Boolean),Da=e=>e===`text`?`text`:`bg`;function Oa(e,t){return`${Da(e)}-[${t.toLowerCase()}]!`}function ka(e,t){let n=Da(t),r=RegExp(`^${n}-\\[(#[0-9a-f]{6})\\]!?$`,`i`);for(let t of Ea(e)){let e=r.exec(t);if(e)return e[1].toLowerCase()}return null}function Aa(e,t,n){let r=Da(t),i=RegExp(`^${r}-\\[#[0-9a-f]{6}\\]!?$`,`i`),a=Ea(e).filter(e=>!i.test(e));return n!==null&&a.push(Oa(t,n)),a.join(` `)}var ja=e=>e.slice(e.lastIndexOf(`:`)+1),Ma=e=>/^text-\[[0-9.]/.test(e);function Na(e,t){let n=ja(e);return va[t].includes(n)?!0:t===`size`&&Ma(n)}function Pa(e,t){let n=va[t];return Ea(e).find(e=>n.includes(e))??null}function Fa(e,t,n){let r=Ea(e).filter(e=>!Na(e,t)||e===n);return n!==null&&!r.includes(n)&&r.push(n),r.join(` `)}function Ia(e,t,n){let r=e=>t.tokens[Math.min(t.tokens.length-1,Math.max(0,t.tokens.indexOf(e)+n))],i=!1,a=[];for(let n of Ea(e)){let e=ja(n);if(t.tokens.includes(e)){e===n&&(i=!0),a.push(n.slice(0,n.length-e.length)+r(e));continue}t.arbitraryRe.test(e)||a.push(n)}if(!i){let e=r(t.defaultToken);e!==t.defaultToken&&a.push(e)}return a.join(` `)}var La={tokens:_a,defaultToken:`text-base`,arbitraryRe:/^text-\[[0-9.]/},Ra={above:{tokens:ba,defaultToken:`mt-0`,arbitraryRe:/^mt-\[/},below:{tokens:xa,defaultToken:`mb-0`,arbitraryRe:/^mb-\[/}};function za(e,t){return Ia(e,La,t)}function Ba(e,t,n){return Ia(e,Ra[t],n)}function Va(e,t){let n=Ra[t],r=Ea(e).find(e=>n.tokens.includes(e));return r?r.slice(r.indexOf(`-`)+1):null}var Ha={left:{tokens:Ca,defaultToken:`pl-0`,arbitraryRe:/^pl-\[/},right:{tokens:wa,defaultToken:`pr-0`,arbitraryRe:/^pr-\[/}};function Ua(e,t,n){return Ia(e,Ha[t],n)}function Wa(e,t){let n=Ha[t],r=Ea(e).find(e=>n.tokens.includes(e));return r?r.slice(r.indexOf(`-`)+1):null}var Ga=[`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`li`,`blockquote`,`span`,`a`,`td`,`th`];function Ka(e){return e.kind===`embed`?{text:!1,format:!1,color:!1,link:!1,image:!1}:e.tag.toLowerCase()===`img`?{text:!1,format:!0,color:!1,link:!1,image:!0}:e.mode===`block`?{text:!1,format:!0,color:!1,link:!1,image:!1}:{text:e.kind===`text`||Ga.includes(e.tag.toLowerCase()),format:!0,color:!0,link:e.kind===`text`,image:!1}}var qa=A(`<button type=button>`);function Ja(e){let t=()=>e.name??e.label;return b(I,{get open(){return e.open},get onOpenChange(){return e.onOpenChange},get label(){return`${t()} options`},class:`z-[200] max-w-[calc(100vw-16px)] rounded-lg p-2 text-fg`,sideOffset:6,trigger:n=>(()=>{var r=qa();r.$$click=()=>e.onOpenChange(!e.open),r.$$mousedown=e=>e.preventDefault();var i=n.ref;return typeof i==`function`?O(i,r):n.ref=r,k(r,()=>e.label,null),k(r,b(F,{size:12}),null),E(n=>{var i=t(),a=`inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md px-2 font-mono text-[11px] font-normal leading-none hover:bg-surface ${e.hint?`text-muted underline decoration-dotted underline-offset-4 hover:text-fg`:`text-fg`}`;return i!==n.e&&D(r,`aria-label`,n.e=i),a!==n.t&&T(r,n.t=a),n},{e:void 0,t:void 0}),r})(),get children(){return e.children}})}S([`mousedown`,`click`]);var Ya=A(`<button type=button>`),Xa=A(`<span class="mx-1 h-4 w-px shrink-0 bg-edge">`),Za=A(`<span class="text-[11px] text-muted">Height: custom`),Qa=A(`<button type=button aria-label="Auto height"class="rounded border border-edge px-1.5 py-1 text-[11px]">Auto height`),$a=A(`<span class="mx-0.5 h-4 w-px bg-edge">`),eo=A(`<div class=flex>`),to=A(`<label aria-label="Text color"class="inline-flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-[3px] text-fg hover:bg-raised"><input type=color aria-label="Pick text color"class="absolute h-0 w-0 opacity-0">`),no=A(`<div class="flex flex-wrap items-center gap-0.5"aria-label="Spacing controls"><span class="min-w-[26px] text-center font-mono text-[10px] text-muted">px</span><span class="mx-0.5 h-4 w-px bg-edge"></span><span class="min-w-[26px] text-center font-mono text-[10px] text-muted">px</span><span class="mx-0.5 h-4 w-px bg-edge"></span><span class="min-w-[26px] text-center font-mono text-[10px] text-muted">px</span><span class="mx-0.5 h-4 w-px bg-edge"></span><span class="min-w-[26px] text-center font-mono text-[10px] text-muted">px</span><span class="mx-0.5 h-4 w-px bg-edge">`),ro=A(`<div aria-label="Typography toolbar"><div aria-label="Selection breadcrumb"><div class="flex min-w-0 items-center gap-1 overflow-x-auto whitespace-nowrap"><button type=button aria-label="Document options"class="shrink-0 rounded px-1.5 py-1 text-[11px] text-muted hover:bg-raised">Document</button><span class="text-[11px] text-muted">></span><span class="shrink-0 px-1 text-[11px] text-accent"></span></div></div><div aria-label="Primary formatting controls"></div><div aria-label="Selection actions">`),io=A(`<button type=button class="cursor-pointer rounded-[3px] px-1 text-[11px] text-muted hover:bg-raised hover:text-fg">`),ao=A(`<span class="text-[11px] text-muted">>`),oo=A(`<button type=button aria-label="Replace image"class="inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-md px-2 font-mono text-[11px] leading-none text-fg hover:bg-surface"><span class="hidden sm:inline">Replace`),so=A(`<div class="flex w-72 max-w-full gap-1.5"><input aria-label="Image alt text"autofocus placeholder="Describe the image for people who can't see it"class="min-w-0 flex-1 rounded-[4px] border border-edge bg-transparent px-1.5 py-1 text-[12px] text-fg focus:border-edge-bright focus:outline-none"><button type=button aria-label="Save alt text"class="cursor-pointer rounded-[4px] border border-edge px-2 py-1 font-mono text-[11px] text-fg hover:border-edge-bright hover:bg-raised">save`),co=A(`<div aria-label="People to mention"class="flex max-w-64 flex-wrap gap-1">`),lo=A(`<form class="flex items-center gap-1"><input aria-label="Link URL"placeholder=https://… class="w-44 rounded-[3px] border border-edge bg-raised px-1.5 py-0.5 font-mono text-[11px] text-fg focus:border-edge-bright focus:outline-none"><button type=submit aria-label="Apply link"class="cursor-pointer rounded-[3px] px-1 font-mono text-[10px] text-accent hover:bg-raised">ok`),uo=A(`<button type=button class="rounded-md bg-accent-soft px-2 py-1 text-xs text-accent">@`),fo=A(`<span tabindex=0 data-feature-unavailable class="inline-flex [&amp;>:disabled]:pointer-events-none"><button type=button aria-label="Mention person"disabled class="inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[3px] text-fg opacity-50">@</button><span hidden>`),po=A(`<button type=button aria-label="Comment on selection"class="inline-flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-md px-2 font-mono text-[11px] font-normal leading-none text-fg hover:bg-surface"><span class="hidden sm:inline">Comment`);function $(e){return b(z,{get content(){return e.label},get children(){var t=Ya();return j(t,`click`,e.onClick,!0),t.$$mousedown=e=>e.preventDefault(),k(t,()=>e.children),E(n=>{var r=e.label,i=e.on,a=`inline-flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-[3px] ${e.on?`bg-accent-soft text-accent`:`text-fg hover:bg-raised`}`;return r!==n.e&&D(t,`aria-label`,n.e=r),i!==n.t&&D(t,`aria-pressed`,n.t=i),a!==n.a&&T(t,n.a=a),n},{e:void 0,t:void 0,a:void 0}),t}})}function mo(e){let[t,n]=h([]),[r,i]=h(null),[a,o]=h(!1),[s,l]=h(!1),[u,d]=h(null),f,p,_=()=>e.backend?.mentionsUnavailable??`Not available.`,v=g();c(m(()=>e.selection?.path,()=>{p&&(p.scrollLeft=p.scrollWidth)})),c(m(()=>e.selection?.path,()=>{i(null),l(!1),o(!1),d(null)},{defer:!0})),c(m(r,()=>{r()!==null&&f?.focus()},{defer:!0})),c(()=>{let t=r();if(!e.artifactId||_()||!t?.startsWith(`@`)||!e.backend?.members){n([]);return}let i=new AbortController;return e.backend.members(t.slice(1),{signal:i.signal}).then(e=>e??{people:[]}).then(e=>n(e.people??[])).catch(()=>{}),i.abort()});let y=()=>e.selection?.className??``,S=t=>e.onApply(e.selection.path,{className:t}),w=(t,n)=>e.onApplyInline?e.onApplyInline(t===`weight`?`strong`:t===`fontStyle`?`em`:`u`):S(Fa(y(),t,Pa(y(),t)===n?null:n)),ee=()=>{let t=u();t===null||!e.image||(t.trim()!==(e.image.alt??``)&&e.image.onAlt(t),d(null))},A=e=>e.preventDefault();return b(C,{get when(){return e.selection},children:n=>{let c=()=>Ka(n());return(()=>{var m=ro(),h=m.firstChild,g=h.firstChild,N=g.firstChild,te=N.nextSibling.nextSibling,P=h.nextSibling,F=P.nextSibling,ne=p;return typeof ne==`function`?O(ne,g):p=g,N.$$click=()=>e.onSelect(null),k(g,b(x,{get each(){return n().ancestors},children:t=>[b(z,{get content(){return t.hint||t.tag},get children(){var n=io();return n.$$click=()=>e.onSelect(t.path),n.$$mousedown=A,k(n,()=>Pe(t.tag)),E(()=>D(n,`aria-label`,`Select ${Pe(t.tag)}`)),n}}),ao()]}),te),k(te,()=>Pe(n().tag)),k(P,()=>e.historyControls,null),k(P,b(C,{get when(){return e.historyControls},get children(){return Xa()}}),null),k(P,b(C,{get when(){return M(()=>!!e.onAutoHeight)()&&n().customHeight},get children(){return[Za(),(()=>{var t=Qa();return j(t,`click`,e.onAutoHeight,!0),t})()]}}),null),k(P,b(C,{get when(){return c().text},get children(){return[b($,{label:`Decrease font size`,onClick:()=>S(za(y(),-1)),get children(){return b(st,{size:14})}}),b($,{label:`Increase font size`,onClick:()=>S(za(y(),1)),get children(){return b(ct,{size:14})}}),b($,{label:`Toggle bold`,get on(){return n().inline?.strong??Pa(y(),`weight`)===`font-bold`},onClick:()=>w(`weight`,`font-bold`),get children(){return b(Xe,{size:14})}}),b($,{label:`Toggle italic`,get on(){return n().inline?.em??Pa(y(),`fontStyle`)===`italic`},onClick:()=>w(`fontStyle`,`italic`),get children(){return b(X,{size:14})}}),b($,{label:`Toggle underline`,get on(){return n().inline?.u??Pa(y(),`decoration`)===`underline`},onClick:()=>w(`decoration`,`underline`),get children(){return b(pn,{size:14})}}),$a()]}}),null),k(P,b(C,{get when(){return M(()=>!!c().image)()&&e.image},children:e=>[(()=>{var t=oo(),n=t.firstChild;return t.$$click=()=>e().onReplace(),t.$$mousedown=A,k(t,b(Rt,{size:12}),n),t})(),b(Ja,{get label(){return e().alt===null?`Add alt text`:`Alt text`},get hint(){return e().alt===null},get open(){return u()!==null},onOpenChange:t=>d(t?e().alt??``:null),get children(){var e=so(),t=e.firstChild,n=t.nextSibling;return t.$$keydown=e=>{e.key===`Enter`?(e.preventDefault(),ee()):e.key===`Escape`&&(e.preventDefault(),d(null))},t.$$input=e=>d(e.currentTarget.value),O(e=>queueMicrotask(()=>e.focus()),t),n.$$click=ee,E(()=>t.value=u()??``),e}}),$a()]}),null),k(P,b(C,{get when(){return c().format},get children(){return[b(Ja,{label:`Align`,name:`Alignment`,get open(){return a()},onOpenChange:o,get children(){var e=eo();return e.$$click=()=>o(!1),k(e,b(x,{each:[[`text-left`,dn,`Align left`],[`text-center`,an,`Align center`],[`text-right`,ln,`Align right`],[`text-justify`,sn,`Align justify`]],children:([e,t,n])=>b($,{label:n,get on(){return Pa(y(),`align`)===e},onClick:()=>S(Fa(y(),`align`,Pa(y(),`align`)===e?null:e)),get children(){return b(t,{size:14})}})})),e}}),b(C,{get when(){return c().color},get children(){return[$a(),b(z,{content:`text color`,get children(){var e=to(),t=e.firstChild;return k(e,b(Et,{size:14}),t),t.$$input=e=>S(Aa(y(),`text`,e.currentTarget.value)),E(()=>t.value=ka(y(),`text`)??`#000000`),e}})]}})]}}),null),k(P,b(C,{get when(){return c().link},get children(){return[$a(),b(C,{get when(){return r()===null},get fallback(){return(()=>{var a=lo(),o=a.firstChild,s=o.nextSibling;a.addEventListener(`submit`,t=>{t.preventDefault();let a=r();if(a.startsWith(`@`))return;let o=q(a);o&&e.onApplyLink(n().path,o),i(null)}),o.$$keydown=e=>{e.key===`Escape`&&i(null)},o.$$input=e=>i(e.currentTarget.value);var c=f;return typeof c==`function`?O(c,o):f=o,k(a,b(C,{get when(){return r()?.startsWith(`@`)},get children(){var r=co();return k(r,b(x,{get each(){return t()},children:t=>(()=>{var r=uo();return r.firstChild,r.$$click=()=>{e.onApplyLink(n().path,`/people/${t.user_id}`),i(null)},r.$$mousedown=e=>e.preventDefault(),k(r,()=>t.username,null),r})()})),r}}),s),E(()=>o.value=r()??``),a})()},get children(){return[b($,{label:`Insert link`,onClick:()=>i(``),get children(){return b(Ye,{size:14})}}),b(C,{get when(){return e.artifactId},get children(){return b(C,{get when(){return!_()},get fallback(){return(()=>{var e=fo(),t=e.firstChild,n=t.nextSibling;return D(t,`aria-describedby`,v),D(n,`id`,v),k(n,_),e})()},get children(){return b($,{label:`Mention person`,onClick:()=>i(`@`),children:`@`})}})}}),b($,{label:`Remove link`,onClick:()=>e.onApplyLink(n().path,null),get children(){return b(Bt,{size:14})}})]}})]}}),null),k(P,b(C,{get when(){return c().format},get children(){return b(Ja,{label:`Spacing`,name:`More formatting controls`,get open(){return s()},onOpenChange:l,get children(){var e=no(),t=e.firstChild,n=t.firstChild,r=t.nextSibling,i=r.nextSibling,a=i.firstChild,o=i.nextSibling,s=o.nextSibling,c=s.firstChild,l=s.nextSibling,u=l.nextSibling,d=u.firstChild,f=u.nextSibling;return k(e,b($,{label:`Decrease space above`,onClick:()=>S(Ba(y(),`above`,-1)),get children(){return b(wt,{size:14})}}),t),k(t,()=>Number(Va(y(),`above`)??`0`)*4,n),k(e,b($,{label:`Increase space above`,onClick:()=>S(Ba(y(),`above`,1)),get children(){return b(St,{size:14})}}),r),k(e,b($,{label:`Decrease space below`,onClick:()=>S(Ba(y(),`below`,-1)),get children(){return b(ft,{size:14})}}),i),k(i,()=>Number(Va(y(),`below`)??`0`)*4,a),k(e,b($,{label:`Increase space below`,onClick:()=>S(Ba(y(),`below`,1)),get children(){return b(ut,{size:14})}}),o),k(e,b($,{label:`Decrease space left`,onClick:()=>S(Ua(y(),`left`,-1)),get children(){return b(gt,{size:14})}}),s),k(s,()=>Number(Wa(y(),`left`)??`0`)*4,c),k(e,b($,{label:`Increase space left`,onClick:()=>S(Ua(y(),`left`,1)),get children(){return b(mt,{size:14})}}),l),k(e,b($,{label:`Decrease space right`,onClick:()=>S(Ua(y(),`right`,-1)),get children(){return b(bt,{size:14})}}),u),k(u,()=>Number(Wa(y(),`right`)??`0`)*4,d),k(e,b($,{label:`Increase space right`,onClick:()=>S(Ua(y(),`right`,1)),get children(){return b(vt,{size:14})}}),f),e}})}}),null),k(P,()=>e.insertionControls,null),k(F,b(C,{get when(){return e.onComment},children:e=>b(z,{content:`comment on this (⌘⌥M)`,get children(){var t=po(),r=t.firstChild;return t.$$click=()=>e()(n()),t.$$mousedown=A,k(t,b(ae,{size:11}),r),t}})}),null),k(F,b($,{label:`Delete element`,get onClick(){return e.onDelete},get children(){return b(le,{size:14})}}),null),E(t=>{var n=e.layout===`panel`?`flex min-w-0 flex-col gap-2`:`flex h-9 min-w-0 flex-1 items-center rounded-lg bg-raised`,r=e.layout===`panel`?`flex h-8 min-w-0 max-w-full items-center gap-1`:`flex h-8 max-w-[50%] shrink-0 items-center gap-1 border-r border-edge px-2`,i=e.layout===`panel`?`flex min-w-0 flex-wrap items-center gap-1 rounded-lg bg-raised p-2`:`flex h-9 min-w-0 flex-1 items-center gap-1 overflow-x-auto px-2`,a=e.layout===`panel`?`flex items-center justify-end gap-2`:`ml-auto flex shrink-0 items-center gap-2 border-l border-edge px-2`;return n!==t.e&&T(m,t.e=n),r!==t.t&&T(h,t.t=r),i!==t.a&&T(P,t.a=i),a!==t.o&&T(F,t.o=a),t},{e:void 0,t:void 0,a:void 0,o:void 0}),m})()}})}S([`mousedown`,`click`,`input`,`keydown`]);var ho=l({editor:()=>ge(()=>import(`./SourceEditor-Gh0VS3Fs.js`),__vite__mapDeps([0,1,2])),formatter:()=>ge(()=>import(`./format-jsx-preview-B3iaRIlJ.js`),[]),formatterUnavailable:null});ho.Provider;function go(){return p(ho)}var _o=A(`<div class="flex h-full w-full flex-col"style=background-color:#1e1e1e;color:#d4d4d4><div class="relative flex min-h-0 flex-1 overflow-hidden"style="font-family:Menlo, Monaco, Consolas, monospace;font-size:12px;line-height:18px"><div aria-hidden=true class="w-12 shrink-0 overflow-hidden text-right"style=color:#858585><pre data-source-line-numbers class="m-0 py-2 pr-3"style=font:inherit></pre></div><textarea class="min-h-0 min-w-0 flex-1 resize-none border-0 px-1 py-2 outline-none"wrap=off autocapitalize=off style=background-color:#1e1e1e;color:#d4d4d4;font:inherit;tab-size:2></textarea></div><div class="px-3 py-2 text-xs"role=status style="color:#a0a0a0;border-top:1px solid #333">Loading rich editor… You can keep editing.`),vo=A(`<div class="min-h-0 flex-1">`),yo=A(`<div class="flex h-full flex-col"style=background-color:#1e1e1e;color:#d4d4d4><div class="flex shrink-0 items-center justify-between gap-3 px-3 py-2 text-xs"style="border-bottom:1px solid #333"><span></span><button type=button class="cursor-pointer rounded border border-current px-2 py-1 disabled:cursor-default disabled:opacity-50"></button></div><div>`),bo=A(`<span hidden>`),xo=A(`<p role=alert class="p-3 text-sm">Couldn’t format this draft. Check the JSX syntax in Edit source and try again.`),So=A(`<p role=status class="p-3 text-sm">Formatting preview…`);function Co(e){let t;return y(()=>{let n=t?.getRootNode();t&&n?.activeElement===t&&e.remember({start:t.selectionStart,end:t.selectionEnd})}),(()=>{var n=_o(),r=n.firstChild,i=r.firstChild,a=i.firstChild,o=i.nextSibling;r.nextSibling,k(a,()=>e.value.split(`
4
4
  `).map((e,t)=>t+1).join(`
5
5
  `)),j(o,`scroll`,e=>{let t=e.currentTarget.parentElement?.querySelector(`[data-source-line-numbers]`);t&&(t.style.transform=`translateY(${-e.currentTarget.scrollTop}px)`)}),j(o,`input`,t=>{e.remember({start:t.currentTarget.selectionStart,end:t.currentTarget.selectionEnd}),e.onChange(t.currentTarget.value)});var s=t;return typeof s==`function`?O(s,o):t=o,D(o,`spellcheck`,!1),E(t=>{var n=e.ariaLabel??`Markup source`,r=e.readOnly;return n!==t.e&&D(o,`aria-label`,t.e=n),r!==t.t&&(o.readOnly=t.t=r),t},{e:void 0,t:void 0}),E(()=>o.value=e.value),n})()}function wo(e){let t=go(),n=u(t.editor),r=g(),[i,a]=h(!1),[o,s]=h(null),[l,d]=h(!1),p=null,[m,_]=h(null);c(()=>{t.formatterUnavailable&&a(!1)}),c(()=>{if(!i())return;let n=e.value,r=!1;d(!1),t.formatter().then(({formatJsxPreview:e})=>e(n)).then(e=>{r||s({source:n,text:e})}).catch(()=>{r||d(!0)}),y(()=>{r=!0})});let v=()=>i()?null:t.formatterUnavailable;return(()=>{var t=yo(),s=t.firstChild,c=s.firstChild,u=c.nextSibling,d=s.nextSibling;return k(c,()=>i()?`Formatted preview · read-only`:`JSX source`),j(u,`click`,()=>a(e=>!e)),k(u,()=>i()?`Edit source`:`View formatted`),k(s,b(C,{get when(){return v()},children:e=>(()=>{var t=bo();return D(t,`id`,r),k(t,e),t})()}),null),k(d,b(te,{get fallback(){return b(Co,f(e,{onChange:t=>{_({text:t,revision:e.revision}),e.onChange(t)},remember:e=>{e&&(p=e)}}))},get children(){return b(n,f(e,{get value(){return M(()=>m()?.revision===e.revision)()?m().text:e.value},initialSelection:()=>p??e.initialSelection?.()??null}))}})),k(t,b(C,{get when(){return i()},get children(){var t=vo();return k(t,b(C,{get when(){return!l()},get fallback(){return xo()},get children(){return b(C,{get when(){return M(()=>o()?.source===e.value)()?o():null},get fallback(){return So()},children:t=>b(te,{get children(){return b(n,{get value(){return t().text},get revision(){return e.revision},onChange:()=>{},readOnly:!0,ariaLabel:`Formatted JSX`})}})})}})),t}}),null),E(e=>{var t=i()?`Edit source`:`View formatted`,n=!!v(),a=v()?r:void 0,o=`min-h-0 flex-1 ${i()?`hidden`:``}`;return t!==e.e&&D(u,`aria-label`,e.e=t),n!==e.t&&(u.disabled=e.t=n),a!==e.a&&D(u,`aria-describedby`,e.a=a),o!==e.o&&T(d,e.o=o),e},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()}var To=A(`<div class="overflow-x-auto rounded-[4px] border border-edge"><table aria-label="Referenced files"class="w-full border-collapse text-left font-mono text-xs"><thead class="bg-raised text-[11px] text-muted"><tr><th scope=col class="border-b border-edge px-3 py-2 font-medium">File</th><th scope=col class="border-b border-edge px-3 py-2 font-medium">Type</th></tr></thead><tbody>`),Eo=A(`<section><h2 class="mb-3 font-mono text-sm font-semibold text-fg">Files`),Do=A(`<p class="text-sm text-muted">No referenced files.`),Oo=A(`<tr class="border-b border-edge last:border-b-0"><th scope=row class="px-3 py-3 font-normal"><a target=_blank rel=noreferrer class="text-accent underline-offset-2 hover:underline"></a></th><td class="px-3 py-3 text-muted">`),ko={image:`Image`,pdf:`PDF`,file:`File`,asset:`Asset`,viz:`Visualization`};function Ao(e){let t=()=>[...new Map(e.refs.filter(e=>e.kind!==`dataset`).map(e=>[e.id,e])).values()];return(()=>{var e=Eo();return e.firstChild,k(e,b(C,{get when(){return t().length>0},get fallback(){return Do()},get children(){var e=To(),n=e.firstChild.firstChild.nextSibling;return k(n,b(x,{get each(){return t()},children:e=>(()=>{var t=Oo(),n=t.firstChild,r=n.firstChild,i=n.nextSibling;return k(r,()=>e.title||e.id),k(i,()=>ko[e.kind]??e.kind),E(()=>D(r,`href`,`/a/${e.id}`)),t})()})),e}}),null),e})()}var jo=A(`<div class="flex flex-col gap-1"aria-label="Bound query"><div class="flex items-baseline justify-between"><span class="font-mono text-[11px] text-faint">query</span></div><pre aria-label="Bound query SQL"class="max-h-40 overflow-auto whitespace-pre rounded-[4px] border border-edge bg-raised p-2 font-mono text-[11px] leading-[1.5] text-fg">`),Mo=A(`<button type=button class="cursor-pointer font-mono text-[11px] text-muted hover:text-fg">edit in queries`);function No(e){return b(C,{get when(){return M(()=>e.table?.kind===`query`&&e.table.sql!==void 0)()?e.table:null},children:t=>(()=>{var n=jo(),r=n.firstChild;r.firstChild;var i=r.nextSibling;return k(r,b(C,{get when(){return e.onOpenQuery},children:e=>(()=>{var n=Mo();return n.$$click=()=>e()(t().name),E(()=>D(n,`aria-label`,`Open $${t().name} in queries`)),n})()}),null),k(i,()=>t().sql),n})()})}S([`click`]);var Po=[`layer`,`hconcat`,`vconcat`,`concat`,`repeat`,`facet`,`spec`];function Fo(e){return`mark`in e&&!Po.some(t=>t in e)}function Io(e){let t=e.encoding,n=!!t&&Object.keys(t).length>0;return!e.mark&&!n&&!Po.some(t=>t in e)}function Lo(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:null;if(!t)return!1;let n=Ko(t);if(n!==`rule`&&n!==`rect`&&n!==`text`)return!1;let r=t.encoding;return typeof r!=`object`||!r||Array.isArray(r)?!1:Object.values(r).every(e=>typeof e!=`object`||!e||Array.isArray(e)?!1:!(`field`in e))}function Ro(e){if(Fo(e))return{unit:e,annotations:[]};if(Po.some(t=>t!==`layer`&&t in e))return null;let t=e.layer;if(!Array.isArray(t)||t.length<2)return null;let[n,...r]=t,i=n&&typeof n==`object`&&!Array.isArray(n)?n:null;return!i||!Fo(i)||!r.every(Lo)?null:{unit:i,annotations:r}}var zo=e=>Ro(e)?.unit??null,Bo=e=>zo(e)??e;function Vo(e,t){let n=Bo(e).encoding?.[t];return n&&typeof n.field==`string`?n.field:null}var Ho={quantitative:`quantitative`,temporal:`temporal`,nominal:`nominal`,boolean:`nominal`,unknown:`nominal`};function Uo(e,t,n){let r=JSON.parse(JSON.stringify(e)),i=Bo(r.source.spec),a={...i.encoding};if(n==null)delete a[t];else{let e=a[t],r=e&&typeof e==`object`&&!Array.isArray(e)?e:{},o=(t===`x`||t===`y`)&&Ko(i)===`rect`&&n.kind===`temporal`?`ordinal`:Ho[n.kind],s={...r,field:n.name,type:o};delete s.datum,delete s.value,a[t]=s}return i.encoding=a,r}var Wo=e=>{let t=JSON.parse(JSON.stringify(e));return{next:t,spec:t.source.spec}},Go=(e,t)=>{let n=Bo(e).encoding?.[t];return n&&typeof n==`object`&&!Array.isArray(n)?n:null};function Ko(e){let t=e.mark;if(typeof t==`string`)return t;if(t&&typeof t==`object`){let e=t.type;return typeof e==`string`?e:null}return null}var qo={bar:`bar`,line:`line`,area:`area`,scatter:`point`,boxplot:`boxplot`};function Jo(e){e=Bo(e);let t=Ko(e);if(t===`arc`)return`pie`;if(t===`rect`)return`heatmap`;if(t===`point`)return`scatter`;if(t===`boxplot`)return`boxplot`;if(t===`bar`){let t=Go(e,`x`),n=Go(e,`y`);return t!=null&&t.bin!=null&&t.bin!==!1?`histogram`:t?.type===`quantitative`&&n!=null&&n.type!==`quantitative`?`row`:`bar`}return t===`line`||t===`area`?t:null}var Yo=(e,t)=>{e.mark=typeof e.mark==`object`&&e.mark!=null?{...e.mark,type:t}:{type:t}};function Xo(e,t){let{next:n,spec:r}=Wo(e),i=Bo(r),a={...i.encoding??{}},o=Jo(i);if(o===`pie`&&t!==`pie`&&(a.color&&!a.x&&(a.x={...a.color}),a.theta&&!a.y&&(a.y={...a.theta}),delete a.theta),o===`histogram`&&t!==`histogram`){let e=a.x?{...a.x}:void 0;delete a.x,delete a.y,e&&(delete e.bin,a.y=e)}if(o===`heatmap`&&t!==`heatmap`){let e=a.color,t=a.y;e&&(a.y={...e}),t?a.color={...t}:delete a.color}if(t===`pie`){let e=a.y??a.theta,t=a.color??a.x;if(e){let t={...e};delete t.axis,delete t.stack,t.aggregate??=`sum`,a.theta=t}t&&(a.color={...t}),delete a.x,delete a.y,delete a.tooltip,delete a.detail,delete a.order,Yo(i,`arc`)}else if(t===`heatmap`){let e=a.y,t=a.color;if(e){let t={...e};delete t.axis,delete t.stack,t.aggregate??=`sum`,a.color=t}if(t){let e={...t};delete e.scale,a.y=e}else delete a.y;delete a.tooltip,delete a.detail,delete a.order,Yo(i,`rect`)}else if(t===`histogram`){if(o===`row`){let e=a.x;a.x=a.y,a.y=e}let e=a.y;if(e){let t={...e};delete t.aggregate,delete t.stack,t.bin=!0,t.type=`quantitative`,a.x=t}else delete a.x;a.y={aggregate:`count`,type:`quantitative`},delete a.tooltip,delete a.detail,delete a.order,Yo(i,`bar`)}else if(t===`row`){let e=a.x;a.x=a.y,a.y=e,Yo(i,`bar`)}else{if(o===`row`){let e=a.x;a.x=a.y,a.y=e}t===`boxplot`&&a.y&&(a.y={...a.y},delete a.y.aggregate,delete a.y.stack),Yo(i,qo[t])}if(t!==`pie`&&i.mark&&typeof i.mark==`object`){let e=i.mark;delete e.innerRadius,delete e.cornerRadius,delete e.padAngle}for(let e of[`x`,`y`]){let t=a[e];t&&typeof t==`object`&&!Array.isArray(t)&&delete t.legend}let s=a.color;s&&typeof s==`object`&&!Array.isArray(s)&&delete s.axis,(t===`line`||t===`area`)&&s?.field!=null&&s.field===a.x?.field&&delete a.color;for(let e of Object.keys(a))a[e]===void 0&&delete a[e];return i.encoding=a,n}function Zo(e){return e===`heatmap`?[{channel:`x`,label:`X-Axis`},{channel:`y`,label:`Y-Axis`},{channel:`color`,label:`Value`}]:e===`pie`?[{channel:`color`,label:`Slices`},{channel:`theta`,label:`Value`}]:e===`histogram`?[{channel:`x`,label:`Values`},{channel:`color`,label:`Color / Split`}]:[{channel:`x`,label:`X-Axis`},{channel:`y`,label:`Y-Axis`},{channel:`color`,label:`Color / Series`}]}var Qo=new Set([`vega-lite`]);function $o(e){let t=e?.kind;return e==null||typeof t==`string`&&Qo.has(t)}function es(e){return{version:2,source:{kind:`vega-lite`,spec:(e??{}).spec??{}},dataBindings:null,viewParams:null,interactions:null,assets:null}}function ts(e){let t=e.source,n=t?.spec??{};if(!Io(n))return{kind:t?.kind??`vega-lite`,spec:n}}function ns(e){switch(e){case`number`:return`quantitative`;case`timestamp`:case`date`:return`temporal`;case`boolean`:return`boolean`;case`string`:return`nominal`;default:return`unknown`}}function rs(e,t){return{name:e,kind:ns(t)}}var is=A(`<label class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint">title</span><input type=text aria-label="Chart title"placeholder="— no title —"class="w-full rounded-[4px] border border-edge bg-surface px-2 py-1 font-mono text-xs text-fg">`),as=A(`<div class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint">spec</span><textarea aria-label="Chart spec"wrap=off rows=14 class="w-full resize-y overflow-auto rounded-[4px] border border-edge bg-surface p-2 font-mono text-[11px] leading-[1.5] text-fg"></textarea><button type=button aria-label="Apply chart spec"class="cursor-pointer self-end rounded-[4px] border border-edge px-2 py-0.5 font-mono text-[11px] text-fg hover:bg-raised disabled:cursor-default disabled:opacity-40">update`),os=A(`<p class="font-sans text-[11px] text-red-500"aria-label="Chart spec error">`),ss=A(`<p class="font-sans text-[11px] text-amber-600"aria-label="Missing table notice">This chart points at a table the document does not declare — add a &lt;Query&gt; or &lt;Value&gt; in &lt;Helmet&gt;.`),cs=A(`<p class="font-sans text-xs text-muted"aria-label="Custom chart notice">This chart&apos;s spec is more than the pickers can describe, so they stay out of its way — edit the spec below directly.`),ls=A(`<p class="font-sans text-[11px] text-muted"aria-label="No table notice">Pick a table to choose fields.`),us=A(`<div class="flex flex-col gap-3"aria-label="Chart editor"><div class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint">data`),ds=A(`<div class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint">data</span><span aria-label=Table class="font-mono text-xs text-fg">$`),fs=A(`<div class="flex flex-col gap-3"aria-label="Chart editor"><p class="font-sans text-xs text-muted"aria-label="Chart not editable">`),ps=A(`<div class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint">chart`),ms=A(`<div class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint">`),hs=[`table`,`bar`,`line`,`area`,`scatter`,`pie`];function gs(e){let[t,n]=h(e.title??``);c(m(()=>e.title,e=>n(e??``),{defer:!0}));let r=()=>{let n=t().trim()?t():null;n!==(e.title??null)&&e.onCommit(n)};return(()=>{var e=is(),i=e.firstChild.nextSibling;return i.$$keydown=e=>{e.key===`Enter`&&r()},i.addEventListener(`blur`,r),i.$$input=e=>n(e.currentTarget.value),E(()=>i.value=t()),e})()}function _s(e){let[t,n]=h(e.specJson),[r,i]=h(null);c(m(()=>e.specJson,e=>{n(e),i(null)},{defer:!0}));let a=()=>t()!==e.specJson,o=()=>{let n;try{n=JSON.parse(t())}catch{i(`not valid JSON`);return}if(typeof n!=`object`||!n||Array.isArray(n)){i(`the spec must be a JSON object`);return}i(e.onApply(n))};return(()=>{var e=as(),s=e.firstChild.nextSibling,c=s.nextSibling;return s.$$input=e=>{n(e.currentTarget.value),i(null)},D(s,`spellcheck`,!1),k(e,b(C,{get when(){return r()},children:e=>(()=>{var t=os();return k(t,e),t})()}),c),c.$$click=o,E(()=>c.disabled=!a()),E(()=>s.value=t()),e})()}function vs(e){let t=()=>e.tables.find(t=>t.name===e.table)??null,n=()=>t()?.columns??[],r=()=>$o(e.viz),i=()=>e.viz?.kind===`dynamic`,a=()=>es(e.viz),o=()=>a().source.spec,s=()=>Jo(o()),c=()=>s()==null&&!Io(o()),l=()=>s()??`table`,u=()=>c()||l()===`table`?[]:Zo(l()),d=(t,n=e.table)=>e.onChange({viz:ts(t),table:n}),f=e=>{let t=e===`y`||e===`theta`;return[...n()].sort((e,n)=>{let r=e.type===`number`?0:1,i=n.type===`number`?0:1;return t?r-i:i-r})};return b(C,{get when(){return r()},get fallback(){return(()=>{var n=fs(),r=n.firstChild;return k(n,b(gs,{get title(){return e.title},get onCommit(){return e.onTitleChange}}),r),k(n,b(C,{get when(){return e.table},get children(){var t=ds(),n=t.firstChild.nextSibling;return n.firstChild,k(n,()=>e.table,null),t}}),r),k(n,b(No,{get table(){return t()},get onOpenQuery(){return e.onOpenQuery}}),r),k(r,()=>i()?`This chart is computed by an expression. Edit it in code mode.`:`This chart is hand-written, so the pickers stay out of its way — edit the spec below directly.`),k(n,b(C,{get when(){return!i()},get children(){return b(_s,{get specJson(){return JSON.stringify(e.viz,null,2)},onApply:t=>typeof t.kind==`string`?(e.onChange({viz:t,table:e.table}),null):`the spec needs a "kind" string`})}}),null),n})()},get children(){var r=us(),i=r.firstChild;return i.firstChild,k(r,b(gs,{get title(){return e.title},get onCommit(){return e.onTitleChange}}),i),k(i,b(L,{ariaLabel:`Table`,get value(){return e.table??``},onChange:e=>d(a(),e||null),get options(){return[{value:``,label:`— pick a table —`},...e.tables.map(e=>({value:e.name,label:`$${e.name}`})),...e.table&&!t()?[{value:e.table,label:`$${e.table} (not declared)`}]:[]]}}),null),k(r,b(No,{get table(){return t()},get onOpenQuery(){return e.onOpenQuery}}),null),k(r,b(C,{get when(){return M(()=>!!e.table)()&&!t()},get children(){return ss()}}),null),k(r,b(C,{get when(){return c()},get fallback(){return(()=>{var e=ps();return e.firstChild,k(e,b(L,{ariaLabel:`Chart type`,get value(){return l()},onChange:e=>{d(e===`table`?es(void 0):Xo(a(),e))},get options(){return hs.map(e=>({value:e,label:e}))}}),null),e})()},get children(){return cs()}}),null),k(r,b(x,{get each(){return u()},children:e=>{let t=()=>Vo(o(),e.channel)??``;return(()=>{var r=ms(),i=r.firstChild;return k(i,()=>e.label.toLowerCase()),k(r,b(L,{get ariaLabel(){return e.label},get value(){return t()},get disabled(){return n().length===0},onChange:t=>{let r=n().find(e=>e.name===t);d(Uo(a(),e.channel,t?rs(t,r?.type):null))},get options(){return[{value:``,label:`— none —`},...f(e.channel).map(e=>({value:e.name,label:e.name,hint:e.type}))]}}),null),r})()}}),null),k(r,b(C,{get when(){return M(()=>l()!==`table`)()&&n().length===0},get children(){return ls()}}),null),k(r,b(_s,{get specJson(){return JSON.stringify(o(),null,2)},onApply:e=>(d({...a(),source:{kind:`vega-lite`,spec:e}}),null)}),null),r}})}S([`input`,`keydown`,`click`]);var ys=A(`<label class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint"></span><input type=text class="w-full rounded-[4px] border border-edge bg-surface px-2 py-1 font-mono text-xs text-fg">`),bs=A(`<p class="font-sans text-[11px] text-amber-600"aria-label="Missing table notice">This number points at a table the document does not declare.`),xs=A(`<div class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint">column`),Ss=A(`<div class="flex flex-col gap-3"aria-label="Number editor"><div class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint">data</span></div><div class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint">aggregate`);function Cs(e){let[t,n]=h(e.value??``);c(m(()=>e.value,e=>n(e??``),{defer:!0}));let r=()=>{let n=t().trim()?t():null;n!==(e.value??null)&&e.onCommit(n)};return(()=>{var i=ys(),a=i.firstChild,o=a.nextSibling;return k(a,()=>e.label),o.$$keydown=e=>{e.key===`Enter`&&r()},o.addEventListener(`blur`,r),o.$$input=e=>n(e.currentTarget.value),E(t=>{var n=e.aria,r=e.placeholder??`— none —`;return n!==t.e&&D(o,`aria-label`,t.e=n),r!==t.t&&D(o,`placeholder`,t.t=r),t},{e:void 0,t:void 0}),E(()=>o.value=t()),i})()}function ws(e){let t=()=>e.binding.table?e.tables.find(t=>t.name===e.binding.table)??null:null,n=()=>[...t()?.columns??[]].sort((e,t)=>(e.type===`number`?0:1)-(t.type===`number`?0:1));return(()=>{var r=Ss(),i=r.firstChild;i.firstChild;var a=i.nextSibling;return a.firstChild,k(i,b(L,{ariaLabel:`Table`,get value(){return e.binding.table??``},onChange:t=>{(t||null)!==e.binding.table&&e.onChange({table:t||null})},get options(){return[{value:``,label:`— pick a table —`},...e.tables.map(e=>({value:e.name,label:`$${e.name}`})),...e.binding.table&&!t()?[{value:e.binding.table,label:`$${e.binding.table} (not declared)`}]:[]]}}),null),k(r,b(No,{get table(){return t()},get onOpenQuery(){return e.onOpenQuery}}),a),k(r,b(C,{get when(){return M(()=>!!e.binding.table)()&&!t()},get children(){return bs()}}),a),k(r,b(C,{get when(){return t()},get fallback(){return b(Cs,{label:`column`,aria:`Number column`,get value(){return e.binding.col},placeholder:`— first column —`,onCommit:t=>e.onChange({col:t})})},get children(){var t=xs();return t.firstChild,k(t,b(L,{ariaLabel:`Column`,get value(){return e.binding.col??``},onChange:t=>{(t||null)!==e.binding.col&&e.onChange({col:t||null})},get options(){return[{value:``,label:`— first column —`},...n().map(e=>({value:e.name,label:e.name,hint:e.type}))]}}),null),t}}),a),k(a,b(L,{ariaLabel:`Aggregation`,get value(){return e.binding.agg??`first`},onChange:t=>{let n=t===`first`?null:t;n!==e.binding.agg&&e.onChange({agg:n})},get options(){return xe.map(e=>({value:e,label:e}))}}),null),k(r,b(Cs,{label:`prefix`,aria:`Number prefix`,get value(){return e.binding.prefix},placeholder:`$`,onCommit:t=>e.onChange({prefix:t})}),null),k(r,b(Cs,{label:`suffix`,aria:`Number suffix`,get value(){return e.binding.suffix},placeholder:`%`,onCommit:t=>e.onChange({suffix:t})}),null),k(r,b(Cs,{label:`format`,aria:`Number format`,get value(){return e.binding.format},placeholder:`d3-format, e.g. ,.1f`,onCommit:t=>e.onChange({format:t})}),null),r})()}S([`input`,`keydown`]);var Ts=A(`<label class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint">title</span><input type=text aria-label="Diagram title"placeholder="— none —"class="w-full rounded-[4px] border border-edge bg-surface px-2 py-1 font-mono text-xs text-fg">`),Es=A(`<p class="font-sans text-[11px] text-red-500"aria-label="Diagram source error">`),Ds=A(`<div class="flex flex-col gap-1"><span class="font-mono text-[11px] text-faint">source</span><textarea aria-label="Diagram source"wrap=off rows=16 class="w-full resize-y overflow-auto rounded-[4px] border border-edge bg-surface p-2 font-mono text-[11px] leading-[1.5] text-fg"></textarea><p class="font-sans text-[11px] text-faint">Flowchart, sequence or state syntax. Applies when you leave the field or press ⌘⏎.`),Os=A(`<div class="flex flex-col gap-3"aria-label="Diagram editor">`);function ks(e){let[t,n]=h(e.value??``);c(()=>n(e.value??``));let r=()=>{let n=t().trim()?t():null;n!==(e.value??null)&&e.onCommit(n)};return(()=>{var e=Ts(),i=e.firstChild.nextSibling;return i.$$keydown=e=>{e.key===`Enter`&&r()},i.addEventListener(`blur`,r),i.$$input=e=>n(e.currentTarget.value),E(()=>i.value=t()),e})()}function As(e){let[t,n]=h(e.code),[r,i]=h(null);c(()=>{n(e.code),i(null)});let a=()=>{if(t()===e.code)return;let n=o(t());i(n),n||e.onCommit(t())};return(()=>{var e=Ds(),o=e.firstChild.nextSibling,s=o.nextSibling;return o.$$keydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&a()},o.addEventListener(`blur`,a),o.$$input=e=>{n(e.currentTarget.value),i(null)},D(o,`spellcheck`,!1),k(e,b(C,{get when(){return r()},get children(){var e=Es();return k(e,r),e}}),s),E(()=>o.value=t()),e})()}function js(e){return(()=>{var t=Os();return k(t,b(ks,{get value(){return e.embed.title},onCommit:t=>e.onChange({title:t})}),null),k(t,b(As,{get code(){return e.embed.code},onCommit:t=>e.onChange({code:t})}),null),t})()}S([`input`,`keydown`]);var Ms=A(`<textarea wrap=off class="w-full resize-y overflow-auto border-0 bg-surface px-3 py-2 font-mono text-[11px] leading-[1.5] text-fg focus:outline-none">`),Ns=A(`<span class="inline-flex cursor-default items-baseline gap-1 rounded-[4px] border border-edge bg-raised px-1.5 py-0.5 text-fg hover:border-edge-bright"><span>`),Ps=A(`<span class=text-faint>`),Fs=A(`<div class="flex flex-wrap items-center gap-1 font-mono text-[11px]"><span class=text-faint>powers`),Is=A(`<span class="font-mono text-[11px] text-faint">powers nothing yet`),Ls=A(`<div class="flex flex-col"><div class="max-h-64 overflow-auto"><table class="w-full border-collapse font-mono text-[11px] leading-[1.4]"><thead class="sticky top-0 bg-raised"><tr></tr></thead><tbody></tbody></table></div><span class="px-3 py-1.5 font-mono text-[11px] text-faint">`),Rs=A(`<th scope=col class="whitespace-nowrap border-b border-edge px-1.5 py-1 text-left font-normal text-muted">`),zs=A(`<tr class="border-b border-edge last:border-b-0">`),Bs=A(`<td>`),Vs=A(`<section><header class="flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b border-accent/20 bg-accent-soft px-3 py-1.5"><span class="font-mono text-xs font-medium text-accent">$</span></header><div class="border-t border-edge">`),Hs=A(`<span class="block px-3 py-2 font-mono text-[11px] text-muted">`),Us=A(`<p class="m-3 rounded-[4px] border border-red-300 bg-red-50 px-2 py-1 font-mono text-[11px] text-red-800">`),Ws=A(`<section aria-label=Datasets class=mb-6><h2 class="mb-2 font-mono text-[11px] uppercase tracking-wide text-faint">datasets</h2><div class="overflow-x-auto rounded-[4px] border border-edge"><table aria-label=Datasets class="w-full border-collapse text-left font-mono text-xs"><thead class="bg-raised text-[11px] text-muted"><tr></tr></thead><tbody>`),Gs=A(`<div class="flex gap-8"aria-label="Data and queries"><nav aria-label="Data index"class="sticky top-0 hidden w-60 shrink-0 self-start lg:block"></nav><div class="min-w-0 flex-1"><section aria-label=Queries><h2 class="mb-2 font-mono text-[11px] uppercase tracking-wide text-faint">queries</h2><div class="flex flex-col"><p class="pt-3 font-sans text-[11px] text-faint">Edits apply when you leave a cell or press ⌘⏎; the document re-runs and charts bound to the query redraw.`),Ks=A(`<div class=mb-5><p class="font-mono text-[11px] uppercase tracking-wide text-faint"></p><p class="mb-1.5 font-sans text-[10px] leading-snug text-faint"></p><div class="flex items-baseline justify-between gap-2 border-b border-edge px-1.5 pb-0.5 font-mono text-[10px] uppercase tracking-wide text-faint"><span>query</span><span>rows`),qs=A(`<button type=button><span class=truncate></span><span class="shrink-0 tabular-nums text-faint">`),Js=A(`<th scope=col class="border-b border-edge px-3 py-2 font-medium">`),Ys=A(`<p class="mt-1 text-[10px] text-faint">`),Xs=A(`<tr class="border-b border-edge align-top last:border-b-0"><th scope=row class="px-3 py-3 text-left font-normal"><a target=_blank rel=noreferrer class="text-accent underline-offset-2 hover:underline"></a></th><td class="whitespace-nowrap px-3 py-3 tabular-nums text-muted"></td><td class="px-3 py-3 text-muted"></td><td class="px-3 py-3 text-muted">`),Zs=A(`<div class=scroll-mt-4>`),Qs={Question:`chart`,Number:`number`,DataTable:`table`,select:`select`,Select:`select`},$s=e=>Qs[e]??e.toLowerCase(),ec=10;function tc(e){let[t,n]=h(e.sql);c(m(()=>e.sql,e=>n(e),{defer:!0}));let r=()=>{t()!==e.sql&&t().trim()!==``&&e.onCommit(t())};return(()=>{var i=Ms();return i.$$keydown=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&r()},i.addEventListener(`blur`,()=>{r(),e.onBlur()}),j(i,`focus`,e.onFocus),i.$$input=e=>n(e.currentTarget.value),D(i,`spellcheck`,!1),E(t=>{var n=`Query $${e.name} SQL`,r=Math.min(12,Math.max(3,e.sql.split(`
@@ -1 +1 @@
1
- import{T as e,i as t,k as n,l as r,o as i,p as a}from"./web-Ckpee-ZJ.js";import{y as o}from"./solid-app-BtmRR9Ax.js";var s=a(`<header class="mb-7 flex flex-wrap items-center justify-between gap-4"><div class="flex min-w-0 items-center gap-3"><span class="rounded-xl border border-edge bg-surface p-2.5 text-accent"></span><div class=min-w-0><p class="mb-1 text-[10px] font-medium tracking-widest text-muted uppercase"></p><h1 class="truncate text-2xl font-semibold tracking-tight text-fg"></h1></div></div><div class="flex flex-wrap items-center gap-3"><a> →`);function c(a){let c=a.icon;return(()=>{var l=s(),u=l.firstChild,d=u.firstChild,f=d.nextSibling.firstChild,p=f.nextSibling,m=u.nextSibling,h=m.firstChild,g=h.firstChild;return i(d,e(c,{size:22})),i(f,()=>a.eyebrow),i(p,()=>a.title),i(m,()=>a.actions,h),t(h,`font-mono text-xs ${o}`),i(h,()=>a.link.text,g),n(e=>{var t=a.link.href,n=a.link.label;return t!==e.e&&r(h,`href`,e.e=t),n!==e.t&&r(h,`aria-label`,e.t=n),e},{e:void 0,t:void 0}),l})()}export{c as t};
1
+ import{T as e,i as t,k as n,l as r,o as i,p as a}from"./web-Ckpee-ZJ.js";import{y as o}from"./solid-app-BNcsMwv4.js";var s=a(`<header class="mb-7 flex flex-wrap items-center justify-between gap-4"><div class="flex min-w-0 items-center gap-3"><span class="rounded-xl border border-edge bg-surface p-2.5 text-accent"></span><div class=min-w-0><p class="mb-1 text-[10px] font-medium tracking-widest text-muted uppercase"></p><h1 class="truncate text-2xl font-semibold tracking-tight text-fg"></h1></div></div><div class="flex flex-wrap items-center gap-3"><a> →`);function c(a){let c=a.icon;return(()=>{var l=s(),u=l.firstChild,d=u.firstChild,f=d.nextSibling.firstChild,p=f.nextSibling,m=u.nextSibling,h=m.firstChild,g=h.firstChild;return i(d,e(c,{size:22})),i(f,()=>a.eyebrow),i(p,()=>a.title),i(m,()=>a.actions,h),t(h,`font-mono text-xs ${o}`),i(h,()=>a.link.text,g),n(e=>{var t=a.link.href,n=a.link.label;return t!==e.e&&r(h,`href`,e.e=t),n!==e.t&&r(h,`aria-label`,e.t=n),e},{e:void 0,t:void 0}),l})()}export{c as t};
@@ -1 +1 @@
1
- import{D as e,M as t,O as n,T as r,_ as i,a,b as o,i as s,k as c,l,o as u,p as d}from"./web-Ckpee-ZJ.js";import{t as f}from"./chevron-left-BJZiR3W-.js";import{n as p}from"./ShareLink-n8KhtnaI.js";import{t as m}from"./database-CKOnpvwb.js";import{r as h,t as g}from"./Shelf-BgwHOaeW.js";import{t as _}from"./file-up-DH-HiKEX.js";import{t as v}from"./search-agWZofH1.js";import{D as y,K as b,S as x,U as S,Z as C,_ as w,b as T,q as E}from"./solid-app-BtmRR9Ax.js";var D=d(`<section aria-label="Assets unavailable">could not load assets <button type=button aria-label="Retry assets"class="text-accent underline">retry`),O=d(`<main class="mx-auto mt-8 max-w-[80rem] px-4 pb-24 sm:px-6"><div class="mb-2 flex flex-wrap items-center gap-x-2 gap-y-1"><span class="font-mono text-[10px] text-faint">the material documents are built from</span><div class="ml-auto flex items-center gap-2"><a href=/files/new aria-label="Upload file"class="inline-flex items-center gap-1.5 rounded border border-edge-bright px-3 py-1.5 font-mono text-xs text-accent hover:border-accent">Upload file</a><a href=/datasets/new aria-label="Create dataset"class="inline-flex items-center gap-1.5 rounded border border-edge-bright px-3 py-1.5 font-mono text-xs text-accent hover:border-accent">Create dataset`),k=d(`<button type=button aria-label="Retry assets">Could not refresh assets. Retry`),A=d(`<table class="w-full border-collapse text-left text-sm"><thead class="hidden sm:table-header-group"><tr></tr></thead><tbody>`),j=d(`<div class="flex items-center justify-between border-t border-edge px-4 py-2"><span aria-label="Page range"class="font-mono text-[10px] text-faint">-<!> of </span><span class="flex gap-2"><button type=button aria-label="Previous page"></button><button type=button aria-label="Next page">`),M=d(`<section aria-label=Assets><div class="flex flex-wrap items-center gap-2 border-b border-edge px-4 py-2"><input aria-label="Search assets"placeholder="search assets"class="min-w-32 flex-1 border-0 bg-transparent font-mono text-xs text-fg placeholder:text-faint focus:outline-none">`),N=d(`<button type=button class="rounded-full border border-edge px-2 py-0.5 font-mono text-[10px] text-muted">`),P=d(`<p class="px-4 py-8 text-center font-mono text-xs text-faint">no assets yet`),F=d(`<th class="px-4 py-2.5">`),I=d(`<tr class="border-t border-edge"><td class="w-full max-w-0 px-4 py-2.5"><span class="flex items-center gap-2"><a class="min-w-0 flex-1 truncate font-semibold text-fg hover:text-accent"></a></span></td><td class="px-4 py-2.5"></td><td class="px-4 py-2.5"><span class="rounded border border-edge px-1.5 font-mono text-[10px] text-faint">v</span></td><td class="whitespace-nowrap px-4 py-2.5 font-mono text-xs text-muted"></td><td class="px-4 py-2.5">`),L=d(`<section aria-label="Loading assets"aria-busy=true>loading assets…`);function R(){let{session:a}=E(),[d,R]=t({page:0,query:``,formats:[],visibilities:[]}),z=n(()=>{let e=d(),t=new URLSearchParams;return e.page&&t.set(`page`,String(e.page)),e.query&&t.set(`q`,e.query),e.formats.forEach(e=>t.append(`formats`,e)),e.visibilities.forEach(e=>t.append(`visibilities`,e)),`/api/page/assets${t.size?`?${t}`:``}`}),B=b(z,{enabled:()=>!!a()?.user}),[V,H]=t(null),[U,W]=t([]);e(()=>{let e=B.data(),t=a()?.user?.id;e&&t&&H({owner:t,data:e})});let G=()=>B.data()??(V()?.owner===a()?.user?.id?V()?.data??null:null),K=()=>d(),q=(e,t)=>R(n=>({...n,page:0,[e]:n[e].includes(t)?n[e].filter(e=>e!==t):[...n[e],t]})),J=()=>Math.max(1,Math.ceil((G()?.total??0)/(G()?.perPage??50))),Y=()=>G()?.page??K().page;return r(o,{get when(){return!a()||a()?.user},get fallback(){return r(C,{href:`/login?callbackUrl=/assets`})},get children(){var e=O(),t=e.firstChild,n=t.firstChild,a=n.nextSibling.firstChild,d=a.firstChild,b=a.nextSibling,C=b.firstChild;return u(t,r(m,{"aria-hidden":`true`,class:`size-3 stroke-[1.8] text-accent`}),n),u(t,r(T,{children:`assets`}),n),u(a,r(_,{"aria-hidden":`true`,size:13}),d),u(b,r(p,{"aria-hidden":`true`,size:13}),C),u(e,r(o,{get when(){return!G()},get fallback(){return(()=>{var e=M(),t=e.firstChild,n=t.firstChild;return s(e,x),u(e,r(o,{get when(){return B.error()},get children(){var e=k();return e.$$click=()=>void B.refresh(!0),e}}),t),u(t,r(v,{size:13,class:`text-faint`}),n),n.$$input=e=>R(t=>({...t,query:e.currentTarget.value,page:0})),u(t,r(o,{get when(){return(G()?.formats.length??0)>=2},get children(){return r(i,{get each(){return G()?.formats??[]},children:e=>(()=>{var t=N();return t.$$click=()=>q(`formats`,e),l(t,`aria-label`,`Filter ${e}`),u(t,e),c(()=>l(t,`aria-pressed`,K().formats.includes(e))),t})()})}}),null),u(t,r(o,{get when(){return(G()?.visibilities.length??0)>=2},get children(){return r(i,{get each(){return G()?.visibilities??[]},children:e=>(()=>{var t=N();return t.$$click=()=>q(`visibilities`,e),l(t,`aria-label`,`Filter ${e}`),u(t,e),c(()=>l(t,`aria-pressed`,K().visibilities.includes(e))),t})()})}}),null),u(e,r(o,{get when(){return(G()?.assets.length??0)>0||K().query||K().formats.length||K().visibilities.length},get fallback(){return P()},get children(){return[(()=>{var e=A(),t=e.firstChild,n=t.firstChild,a=t.nextSibling;return u(n,r(i,{each:[`title`,`type`,`ver`,`updated`,``],children:e=>(()=>{var t=F();return u(t,r(T,{children:e})),t})()})),u(a,r(i,{get each(){return(G()?.assets??[]).filter(e=>!U().includes(e.id))},children:e=>(()=>{var t=I(),n=t.firstChild,i=n.firstChild,a=i.firstChild,s=n.nextSibling,d=s.nextSibling,f=d.firstChild;f.firstChild;var p=d.nextSibling,m=p.nextSibling;return u(a,()=>e.title??`Untitled`),u(i,r(o,{get when(){return e.visibility===`public`},get children(){return r(h,{get"aria-label"(){return`${e.title??`Untitled`} is public`},size:13,class:`text-accent`})}}),null),u(s,r(w,{get format(){return e.format}})),u(f,()=>e.version,null),u(p,()=>y(e.updated_at)),u(m,r(g,{row:e,level:`full`,get folders(){return G()?.folders??[]},childCount:0,showEdit:!1,onRemoved:e=>W(t=>[...t,e]),onChanged:()=>void B.refresh(!0)})),c(t=>{var n=`Open ${e.title??`Untitled`}`,r=e.url;return n!==t.e&&l(a,`aria-label`,t.e=n),r!==t.t&&l(a,`href`,t.t=r),t},{e:void 0,t:void 0}),t})()})),e})(),r(o,{get when(){return J()>1},get children(){var e=j(),t=e.firstChild,n=t.firstChild,i=n.nextSibling;i.nextSibling;var a=t.nextSibling.firstChild,o=a.nextSibling;return u(t,()=>Y()*(G()?.perPage??50)+1,n),u(t,()=>Math.min((Y()+1)*(G()?.perPage??50),G()?.total??0),i),u(t,()=>G()?.total,null),a.$$click=()=>R(e=>({...e,page:Y()-1})),u(a,r(f,{size:14})),o.$$click=()=>R(e=>({...e,page:Y()+1})),u(o,r(S,{size:14})),c(e=>{var t=Y()===0,n=Y()+1>=J();return t!==e.e&&(a.disabled=e.e=t),n!==e.t&&(o.disabled=e.t=n),e},{e:void 0,t:void 0}),e}})]}}),null),c(()=>l(e,`aria-busy`,B.pending())),c(()=>n.value=K().query),e})()},get children(){return r(o,{get when(){return B.error()},get fallback(){return(()=>{var e=L();return s(e,`${x} flex h-24 items-center justify-center font-mono text-xs text-faint`),e})()},get children(){var e=D(),t=e.firstChild.nextSibling;return s(e,`${x} flex h-24 items-center justify-center gap-3 px-4 font-mono text-xs text-faint`),t.$$click=()=>void B.refresh(!0),e}})}}),null),e}})}a([`click`,`input`]);export{R as AssetsPage};
1
+ import{D as e,M as t,O as n,T as r,_ as i,a,b as o,i as s,k as c,l,o as u,p as d}from"./web-Ckpee-ZJ.js";import{t as f}from"./chevron-left-NHmvDJpN.js";import{n as p}from"./ShareLink-qbYss_Eh.js";import{t as m}from"./database-BbH2eTSj.js";import{r as h,t as g}from"./Shelf-anhc5No9.js";import{t as _}from"./file-up-GoLKOXxO.js";import{t as v}from"./search-CmIkt7xE.js";import{D as y,K as b,S as x,U as S,Z as C,_ as w,b as T,q as E}from"./solid-app-BNcsMwv4.js";var D=d(`<section aria-label="Assets unavailable">could not load assets <button type=button aria-label="Retry assets"class="text-accent underline">retry`),O=d(`<main class="mx-auto mt-8 max-w-[80rem] px-4 pb-24 sm:px-6"><div class="mb-2 flex flex-wrap items-center gap-x-2 gap-y-1"><span class="font-mono text-[10px] text-faint">the material documents are built from</span><div class="ml-auto flex items-center gap-2"><a href=/files/new aria-label="Upload file"class="inline-flex items-center gap-1.5 rounded border border-edge-bright px-3 py-1.5 font-mono text-xs text-accent hover:border-accent">Upload file</a><a href=/datasets/new aria-label="Create dataset"class="inline-flex items-center gap-1.5 rounded border border-edge-bright px-3 py-1.5 font-mono text-xs text-accent hover:border-accent">Create dataset`),k=d(`<button type=button aria-label="Retry assets">Could not refresh assets. Retry`),A=d(`<table class="w-full border-collapse text-left text-sm"><thead class="hidden sm:table-header-group"><tr></tr></thead><tbody>`),j=d(`<div class="flex items-center justify-between border-t border-edge px-4 py-2"><span aria-label="Page range"class="font-mono text-[10px] text-faint">-<!> of </span><span class="flex gap-2"><button type=button aria-label="Previous page"></button><button type=button aria-label="Next page">`),M=d(`<section aria-label=Assets><div class="flex flex-wrap items-center gap-2 border-b border-edge px-4 py-2"><input aria-label="Search assets"placeholder="search assets"class="min-w-32 flex-1 border-0 bg-transparent font-mono text-xs text-fg placeholder:text-faint focus:outline-none">`),N=d(`<button type=button class="rounded-full border border-edge px-2 py-0.5 font-mono text-[10px] text-muted">`),P=d(`<p class="px-4 py-8 text-center font-mono text-xs text-faint">no assets yet`),F=d(`<th class="px-4 py-2.5">`),I=d(`<tr class="border-t border-edge"><td class="w-full max-w-0 px-4 py-2.5"><span class="flex items-center gap-2"><a class="min-w-0 flex-1 truncate font-semibold text-fg hover:text-accent"></a></span></td><td class="px-4 py-2.5"></td><td class="px-4 py-2.5"><span class="rounded border border-edge px-1.5 font-mono text-[10px] text-faint">v</span></td><td class="whitespace-nowrap px-4 py-2.5 font-mono text-xs text-muted"></td><td class="px-4 py-2.5">`),L=d(`<section aria-label="Loading assets"aria-busy=true>loading assets…`);function R(){let{session:a}=E(),[d,R]=t({page:0,query:``,formats:[],visibilities:[]}),z=n(()=>{let e=d(),t=new URLSearchParams;return e.page&&t.set(`page`,String(e.page)),e.query&&t.set(`q`,e.query),e.formats.forEach(e=>t.append(`formats`,e)),e.visibilities.forEach(e=>t.append(`visibilities`,e)),`/api/page/assets${t.size?`?${t}`:``}`}),B=b(z,{enabled:()=>!!a()?.user}),[V,H]=t(null),[U,W]=t([]);e(()=>{let e=B.data(),t=a()?.user?.id;e&&t&&H({owner:t,data:e})});let G=()=>B.data()??(V()?.owner===a()?.user?.id?V()?.data??null:null),K=()=>d(),q=(e,t)=>R(n=>({...n,page:0,[e]:n[e].includes(t)?n[e].filter(e=>e!==t):[...n[e],t]})),J=()=>Math.max(1,Math.ceil((G()?.total??0)/(G()?.perPage??50))),Y=()=>G()?.page??K().page;return r(o,{get when(){return!a()||a()?.user},get fallback(){return r(C,{href:`/login?callbackUrl=/assets`})},get children(){var e=O(),t=e.firstChild,n=t.firstChild,a=n.nextSibling.firstChild,d=a.firstChild,b=a.nextSibling,C=b.firstChild;return u(t,r(m,{"aria-hidden":`true`,class:`size-3 stroke-[1.8] text-accent`}),n),u(t,r(T,{children:`assets`}),n),u(a,r(_,{"aria-hidden":`true`,size:13}),d),u(b,r(p,{"aria-hidden":`true`,size:13}),C),u(e,r(o,{get when(){return!G()},get fallback(){return(()=>{var e=M(),t=e.firstChild,n=t.firstChild;return s(e,x),u(e,r(o,{get when(){return B.error()},get children(){var e=k();return e.$$click=()=>void B.refresh(!0),e}}),t),u(t,r(v,{size:13,class:`text-faint`}),n),n.$$input=e=>R(t=>({...t,query:e.currentTarget.value,page:0})),u(t,r(o,{get when(){return(G()?.formats.length??0)>=2},get children(){return r(i,{get each(){return G()?.formats??[]},children:e=>(()=>{var t=N();return t.$$click=()=>q(`formats`,e),l(t,`aria-label`,`Filter ${e}`),u(t,e),c(()=>l(t,`aria-pressed`,K().formats.includes(e))),t})()})}}),null),u(t,r(o,{get when(){return(G()?.visibilities.length??0)>=2},get children(){return r(i,{get each(){return G()?.visibilities??[]},children:e=>(()=>{var t=N();return t.$$click=()=>q(`visibilities`,e),l(t,`aria-label`,`Filter ${e}`),u(t,e),c(()=>l(t,`aria-pressed`,K().visibilities.includes(e))),t})()})}}),null),u(e,r(o,{get when(){return(G()?.assets.length??0)>0||K().query||K().formats.length||K().visibilities.length},get fallback(){return P()},get children(){return[(()=>{var e=A(),t=e.firstChild,n=t.firstChild,a=t.nextSibling;return u(n,r(i,{each:[`title`,`type`,`ver`,`updated`,``],children:e=>(()=>{var t=F();return u(t,r(T,{children:e})),t})()})),u(a,r(i,{get each(){return(G()?.assets??[]).filter(e=>!U().includes(e.id))},children:e=>(()=>{var t=I(),n=t.firstChild,i=n.firstChild,a=i.firstChild,s=n.nextSibling,d=s.nextSibling,f=d.firstChild;f.firstChild;var p=d.nextSibling,m=p.nextSibling;return u(a,()=>e.title??`Untitled`),u(i,r(o,{get when(){return e.visibility===`public`},get children(){return r(h,{get"aria-label"(){return`${e.title??`Untitled`} is public`},size:13,class:`text-accent`})}}),null),u(s,r(w,{get format(){return e.format}})),u(f,()=>e.version,null),u(p,()=>y(e.updated_at)),u(m,r(g,{row:e,level:`full`,get folders(){return G()?.folders??[]},childCount:0,showEdit:!1,onRemoved:e=>W(t=>[...t,e]),onChanged:()=>void B.refresh(!0)})),c(t=>{var n=`Open ${e.title??`Untitled`}`,r=e.url;return n!==t.e&&l(a,`aria-label`,t.e=n),r!==t.t&&l(a,`href`,t.t=r),t},{e:void 0,t:void 0}),t})()})),e})(),r(o,{get when(){return J()>1},get children(){var e=j(),t=e.firstChild,n=t.firstChild,i=n.nextSibling;i.nextSibling;var a=t.nextSibling.firstChild,o=a.nextSibling;return u(t,()=>Y()*(G()?.perPage??50)+1,n),u(t,()=>Math.min((Y()+1)*(G()?.perPage??50),G()?.total??0),i),u(t,()=>G()?.total,null),a.$$click=()=>R(e=>({...e,page:Y()-1})),u(a,r(f,{size:14})),o.$$click=()=>R(e=>({...e,page:Y()+1})),u(o,r(S,{size:14})),c(e=>{var t=Y()===0,n=Y()+1>=J();return t!==e.e&&(a.disabled=e.e=t),n!==e.t&&(o.disabled=e.t=n),e},{e:void 0,t:void 0}),e}})]}}),null),c(()=>l(e,`aria-busy`,B.pending())),c(()=>n.value=K().query),e})()},get children(){return r(o,{get when(){return B.error()},get fallback(){return(()=>{var e=L();return s(e,`${x} flex h-24 items-center justify-center font-mono text-xs text-faint`),e})()},get children(){var e=D(),t=e.firstChild.nextSibling;return s(e,`${x} flex h-24 items-center justify-center gap-3 px-4 font-mono text-xs text-faint`),t.$$click=()=>void B.refresh(!0),e}})}}),null),e}})}a([`click`,`input`]);export{R as AssetsPage};