@protobase/ui 0.123.1 → 0.123.3

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 (208) hide show
  1. package/dist/account/messages.d.ts +2 -2
  2. package/dist/app/charts/messages.d.ts +2 -2
  3. package/dist/app/confirm-sign-in-messages.d.ts +2 -2
  4. package/dist/app/conversation-page/messages.d.ts +2 -2
  5. package/dist/app/create/messages.d.ts +2 -2
  6. package/dist/app/delete/messages.d.ts +2 -2
  7. package/dist/app/displays/messages.d.ts +2 -2
  8. package/dist/app/embedded-list/messages.d.ts +2 -2
  9. package/dist/app/export/messages.d.ts +2 -2
  10. package/dist/app/field-messages.d.ts +2 -2
  11. package/dist/app/field-types/custom-step-container/messages.d.ts +2 -2
  12. package/dist/app/field-types/runner-install/messages.d.ts +2 -2
  13. package/dist/app/field-types/workflow/messages.d.ts +2 -2
  14. package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
  15. package/dist/app/field-types/workflow-run/messages.d.ts +2 -2
  16. package/dist/app/field-types/workflow-status/messages.d.ts +2 -2
  17. package/dist/app/file-viewers/messages.d.ts +2 -2
  18. package/dist/app/focus/messages.d.ts +2 -2
  19. package/dist/app/gallery/messages.d.ts +2 -2
  20. package/dist/app/hand-order/messages.d.ts +2 -2
  21. package/dist/app/history/messages.d.ts +2 -2
  22. package/dist/app/import/messages.d.ts +2 -2
  23. package/dist/app/list-edit/messages.d.ts +2 -2
  24. package/dist/app/list-messages.d.ts +2 -2
  25. package/dist/app/messages.d.ts +2 -2
  26. package/dist/app/new-version/messages.d.ts +2 -2
  27. package/dist/app/pages/messages.d.ts +2 -2
  28. package/dist/app/record-chart/messages.d.ts +2 -2
  29. package/dist/app/record-messages.d.ts +2 -2
  30. package/dist/app/record-row/messages.d.ts +2 -2
  31. package/dist/app/related-cards/messages.d.ts +2 -2
  32. package/dist/app/runtime/messages.d.ts +2 -2
  33. package/dist/app/saved/messages.d.ts +2 -2
  34. package/dist/app/searches/messages.d.ts +2 -2
  35. package/dist/app-shell/messages.d.ts +2 -2
  36. package/dist/assistant-dock/messages.d.ts +2 -2
  37. package/dist/auth/messages.d.ts +2 -2
  38. package/dist/calls/messages.d.ts +2 -2
  39. package/dist/data/use-live-updates.d.ts +1 -1
  40. package/dist/data/use-live-updates.js +3 -1
  41. package/dist/data-grid/column-spec.d.ts +1 -1
  42. package/dist/data-grid/messages.d.ts +2 -2
  43. package/dist/filter-panel/messages.d.ts +2 -2
  44. package/dist/format/messages.d.ts +2 -2
  45. package/dist/forms/messages.d.ts +2 -2
  46. package/dist/inline-child-table/messages.d.ts +2 -2
  47. package/dist/invitations/messages.d.ts +2 -2
  48. package/dist/live/messages.d.ts +2 -2
  49. package/dist/mailbox/messages.d.ts +2 -2
  50. package/dist/mentions/messages.d.ts +2 -2
  51. package/dist/mocks/customers.d.ts +1 -1
  52. package/dist/mocks/invoices.d.ts +2 -2
  53. package/dist/mocks/orders.d.ts +1 -1
  54. package/dist/notifications/bell/messages.d.ts +2 -2
  55. package/dist/organizations/messages.d.ts +2 -2
  56. package/dist/package.js +1 -1
  57. package/dist/primitives/messages.d.ts +2 -2
  58. package/dist/relay/relay-store.d.ts +2 -0
  59. package/dist/relay/relay-store.js +6 -0
  60. package/dist/shell/assets/{account-page-DS2lZVD1.js → account-page-IZQQcp3C.js} +2 -2
  61. package/dist/shell/assets/{app-1IZYQXW2.js → app-CgllsYQy.js} +5 -5
  62. package/dist/shell/assets/{assistant-shell-BIpWuqnT.js → assistant-shell-ClWlf9GV.js} +2 -2
  63. package/dist/shell/assets/{board-display-Buo0YyZ5.js → board-display-DhHkhSdi.js} +2 -2
  64. package/dist/shell/assets/{calendar-display-10AgoW3N.js → calendar-display-C_X68Umc.js} +2 -2
  65. package/dist/shell/assets/{call-rings-BUUwC1QU.js → call-rings-B0-gGLW5.js} +2 -2
  66. package/dist/shell/assets/{calls-eQ3_Fp6k.js → calls-VTUC3xS7.js} +2 -2
  67. package/dist/shell/assets/{circle-alert-D7B_KeB7.js → circle-alert-D8UYAgz6.js} +2 -2
  68. package/dist/shell/assets/{composed-page-Btkd6u0m.js → composed-page-FL2hq-qi.js} +2 -2
  69. package/dist/shell/assets/{composer-section-DUmPQLgo.js → composer-section-DBsqoWhe.js} +2 -2
  70. package/dist/shell/assets/{connect-route-DQIlzdmb.js → connect-route-DI8OFx4L.js} +2 -2
  71. package/dist/shell/assets/{copy-field-BfYo47Io.js → copy-field-DBuqCBWo.js} +2 -2
  72. package/dist/shell/assets/{create-route-CSTAtNAw.js → create-route-CCx6gOjR.js} +2 -2
  73. package/dist/shell/assets/{custom-step-container-field-Dxltzn8J.js → custom-step-container-field-tmox-exj.js} +2 -2
  74. package/dist/shell/assets/{embedded-list-7l7TUHug.js → embedded-list-BIvz_g-b.js} +3 -3
  75. package/dist/shell/assets/{export-dialog-DWcXdfEj.js → export-dialog-cqfMEBd7.js} +2 -2
  76. package/dist/shell/assets/{first-organization-page-77PHesxY.js → first-organization-page-CC7DrhYu.js} +2 -2
  77. package/dist/shell/assets/{graph-view-DQOQDrmJ.js → graph-view-DRWl6A2P.js} +2 -2
  78. package/dist/shell/assets/{group-donut-BGfuQ6iU.js → group-donut-D1l1-O4a.js} +2 -2
  79. package/dist/shell/assets/{guest-call-page-BdV2Hwhv.js → guest-call-page-BLh17iiD.js} +3 -3
  80. package/dist/shell/assets/{html-viewer-CXABej3u.js → html-viewer-BeLoV4vw.js} +2 -2
  81. package/dist/shell/assets/{import-dialog-Cqu_xO6L.js → import-dialog-CwnPFP3s.js} +2 -2
  82. package/dist/shell/assets/{import-table-dialog-MwfAiAmM.js → import-table-dialog-D__S72Yl.js} +2 -2
  83. package/dist/shell/assets/{index-DJQ4glyU.js → index-Nvo-_PXE.js} +1 -1
  84. package/dist/shell/assets/{invitations-page-C6LjToJR.js → invitations-page-MQ6ujhc1.js} +2 -2
  85. package/dist/shell/assets/{layout-grid-C_uTX3Tb.js → layout-grid-B4X2fG6K.js} +2 -2
  86. package/dist/shell/assets/{legend-item-DzqFlC4D.js → legend-item-BoMo0Yub.js} +2 -2
  87. package/dist/shell/assets/{list-page-CTGtveKF.js → list-page-BceXf9dP.js} +4 -4
  88. package/dist/shell/assets/{maplibre-aCJmOb1H.js → maplibre-BZGHDnqB.js} +2 -2
  89. package/dist/shell/assets/{markdown-content-CDmFTB6r.js → markdown-content-CB2LNHPp.js} +2 -2
  90. package/dist/shell/assets/{members-page-Defqhu24.js → members-page-DnPAIXBn.js} +2 -2
  91. package/dist/shell/assets/{message-content-CeLDUud8.js → message-content-C6ld-XsS.js} +2 -2
  92. package/dist/shell/assets/{messages-XnV72On0.js → messages-CWURrUB-.js} +2 -2
  93. package/dist/shell/assets/{organization-page-Cdfaqvsh.js → organization-page-DnmV85sX.js} +2 -2
  94. package/dist/shell/assets/{organizations-page-C37kxzUq.js → organizations-page-CKJB2qGB.js} +2 -2
  95. package/dist/shell/assets/{pending-invitation-row-Cyu7Ucej.js → pending-invitation-row-DAXBo7SZ.js} +2 -2
  96. package/dist/shell/assets/{period-chart-T4rBI9Y2.js → period-chart-CbzGqkpY.js} +2 -2
  97. package/dist/shell/assets/{person-row-DjxZAaa3.js → person-row-BNM1LeOM.js} +2 -2
  98. package/dist/shell/assets/{public-form-page-DaPFaXOT.js → public-form-page-BTILqkb8.js} +2 -2
  99. package/dist/shell/assets/{record-lines-CSeqYQnm.js → record-lines-BuGPIPkM.js} +2 -2
  100. package/dist/shell/assets/{record-map-l-E3DvxV.js → record-map-H5uvOI5d.js} +2 -2
  101. package/dist/shell/assets/{record-opens-DPMtZw1p.js → record-opens-BLwJhTqE.js} +2 -2
  102. package/dist/shell/assets/{record-page-DK2-zwXx.js → record-page-CCfn7bkb.js} +3 -3
  103. package/dist/shell/assets/{record-preview-0BdCZkO9.js → record-preview-CWciJJ5e.js} +2 -2
  104. package/dist/shell/assets/{records-map-DSg2fbqb.js → records-map-CPYxm3fv.js} +2 -2
  105. package/dist/shell/assets/{render-node-qPc-4XAK.js → render-node-BiDgPc8P.js} +3 -3
  106. package/dist/shell/assets/{reorder-button-Z_evPIxl.js → reorder-button-CeZV0Cqx.js} +2 -2
  107. package/dist/shell/assets/{run-trace-view-ChuThRe4.js → run-trace-view-CsT4mLDc.js} +2 -2
  108. package/dist/shell/assets/{runner-install-field-8Ap9WvhK.js → runner-install-field-8Oz3ILhl.js} +2 -2
  109. package/dist/shell/assets/{runtime-update-B4DPgHIL.js → runtime-update-CQ7qAQHh.js} +2 -2
  110. package/dist/shell/assets/{shared-protobase-ui-ClTsd7Ce.js → shared-protobase-ui-C3HDx4Ie.js} +1 -1
  111. package/dist/shell/assets/{sheet-source-D0v07JHr.js → sheet-source-Ch5uFlt5.js} +2 -2
  112. package/dist/shell/assets/{sign-in-policy-page-CV3iE_o8.js → sign-in-policy-page-DyroONcf.js} +2 -2
  113. package/dist/shell/assets/{start-block-queries-DJX-JI2P.js → start-block-queries-heBbb7IN.js} +2 -2
  114. package/dist/shell/assets/{step-catalog-DSHlXxWA.js → step-catalog-C7zY05CI.js} +2 -2
  115. package/dist/shell/assets/{step-panel-CF6x9K8Y.js → step-panel-DifkdQUN.js} +2 -2
  116. package/dist/shell/assets/{timeline-display-DpVKeXjG.js → timeline-display-DgD-tH2t.js} +2 -2
  117. package/dist/shell/assets/{trash-Ccs0JhuD.js → trash-sDDKsEVa.js} +2 -2
  118. package/dist/shell/assets/{update-set-L1kw--38.js → update-set-t56Pch6F.js} +2 -2
  119. package/dist/shell/assets/{use-calendar-move-DHCS22jF.js → use-calendar-move-B5Nd4WqC.js} +2 -2
  120. package/dist/shell/assets/{use-display-rows-DcY7w9cN.js → use-display-rows-Evx7hciH.js} +2 -2
  121. package/dist/shell/assets/{use-my-invitations-Dodu_ib9.js → use-my-invitations-BeEVmA84.js} +2 -2
  122. package/dist/shell/assets/{use-paged-search-Crpqw2e-.js → use-paged-search-CHtW6YbU.js} +2 -2
  123. package/dist/shell/assets/{use-run-trace-Cozaxsfl.js → use-run-trace-B0JxFskZ.js} +2 -2
  124. package/dist/shell/assets/{use-workflow-page-eP9jGrad.js → use-workflow-page-3QycD-Ie.js} +2 -2
  125. package/dist/shell/assets/{use-workflow-types-DjJ87TLL.js → use-workflow-types-7sud5u7m.js} +2 -2
  126. package/dist/shell/assets/{workflow-canvas-NJSHRDav.js → workflow-canvas-CzzTk8Bv.js} +2 -2
  127. package/dist/shell/assets/{workflow-field-D_pqVGeK.js → workflow-field-ehSWu4Iq.js} +3 -3
  128. package/dist/shell/assets/{workflow-graph-editor-D4zxMPy4.js → workflow-graph-editor-89M8HZOe.js} +2 -2
  129. package/dist/shell/assets/{workflow-run-field-DcL-8XS_.js → workflow-run-field-Dxg2lHnv.js} +3 -3
  130. package/dist/shell/assets/{workflow-status-field-15bq7T5K.js → workflow-status-field-Bws1hFJF.js} +2 -2
  131. package/dist/shell/assets/{workflow-workbench-CC_mXUfW.js → workflow-workbench-D2Piourk.js} +2 -2
  132. package/dist/shell/index.html +3 -3
  133. package/dist/shell/protobase.shell.json +2 -2
  134. package/dist/shell/protobase.sw.js +2 -2
  135. package/dist/shell-source-maps/assets/{account-page-DS2lZVD1.js.map → account-page-IZQQcp3C.js.map} +1 -1
  136. package/dist/shell-source-maps/assets/app-CgllsYQy.js.map +1 -0
  137. package/dist/shell-source-maps/assets/{assistant-shell-BIpWuqnT.js.map → assistant-shell-ClWlf9GV.js.map} +1 -1
  138. package/dist/shell-source-maps/assets/{board-display-Buo0YyZ5.js.map → board-display-DhHkhSdi.js.map} +1 -1
  139. package/dist/shell-source-maps/assets/{calendar-display-10AgoW3N.js.map → calendar-display-C_X68Umc.js.map} +1 -1
  140. package/dist/shell-source-maps/assets/{call-rings-BUUwC1QU.js.map → call-rings-B0-gGLW5.js.map} +1 -1
  141. package/dist/shell-source-maps/assets/{calls-eQ3_Fp6k.js.map → calls-VTUC3xS7.js.map} +1 -1
  142. package/dist/shell-source-maps/assets/{circle-alert-D7B_KeB7.js.map → circle-alert-D8UYAgz6.js.map} +1 -1
  143. package/dist/shell-source-maps/assets/{composed-page-Btkd6u0m.js.map → composed-page-FL2hq-qi.js.map} +1 -1
  144. package/dist/shell-source-maps/assets/{composer-section-DUmPQLgo.js.map → composer-section-DBsqoWhe.js.map} +1 -1
  145. package/dist/shell-source-maps/assets/{connect-route-DQIlzdmb.js.map → connect-route-DI8OFx4L.js.map} +1 -1
  146. package/dist/shell-source-maps/assets/{copy-field-BfYo47Io.js.map → copy-field-DBuqCBWo.js.map} +1 -1
  147. package/dist/shell-source-maps/assets/{create-route-CSTAtNAw.js.map → create-route-CCx6gOjR.js.map} +1 -1
  148. package/dist/shell-source-maps/assets/{custom-step-container-field-Dxltzn8J.js.map → custom-step-container-field-tmox-exj.js.map} +1 -1
  149. package/dist/shell-source-maps/assets/{embedded-list-7l7TUHug.js.map → embedded-list-BIvz_g-b.js.map} +1 -1
  150. package/dist/shell-source-maps/assets/{export-dialog-DWcXdfEj.js.map → export-dialog-cqfMEBd7.js.map} +1 -1
  151. package/dist/shell-source-maps/assets/{first-organization-page-77PHesxY.js.map → first-organization-page-CC7DrhYu.js.map} +1 -1
  152. package/dist/shell-source-maps/assets/{graph-view-DQOQDrmJ.js.map → graph-view-DRWl6A2P.js.map} +1 -1
  153. package/dist/shell-source-maps/assets/{group-donut-BGfuQ6iU.js.map → group-donut-D1l1-O4a.js.map} +1 -1
  154. package/dist/shell-source-maps/assets/{guest-call-page-BdV2Hwhv.js.map → guest-call-page-BLh17iiD.js.map} +1 -1
  155. package/dist/shell-source-maps/assets/{html-viewer-CXABej3u.js.map → html-viewer-BeLoV4vw.js.map} +1 -1
  156. package/dist/shell-source-maps/assets/{import-dialog-Cqu_xO6L.js.map → import-dialog-CwnPFP3s.js.map} +1 -1
  157. package/dist/shell-source-maps/assets/{import-table-dialog-MwfAiAmM.js.map → import-table-dialog-D__S72Yl.js.map} +1 -1
  158. package/dist/shell-source-maps/assets/{invitations-page-C6LjToJR.js.map → invitations-page-MQ6ujhc1.js.map} +1 -1
  159. package/dist/shell-source-maps/assets/{layout-grid-C_uTX3Tb.js.map → layout-grid-B4X2fG6K.js.map} +1 -1
  160. package/dist/shell-source-maps/assets/{legend-item-DzqFlC4D.js.map → legend-item-BoMo0Yub.js.map} +1 -1
  161. package/dist/shell-source-maps/assets/{list-page-CTGtveKF.js.map → list-page-BceXf9dP.js.map} +1 -1
  162. package/dist/shell-source-maps/assets/{maplibre-aCJmOb1H.js.map → maplibre-BZGHDnqB.js.map} +1 -1
  163. package/dist/shell-source-maps/assets/{markdown-content-CDmFTB6r.js.map → markdown-content-CB2LNHPp.js.map} +1 -1
  164. package/dist/shell-source-maps/assets/{members-page-Defqhu24.js.map → members-page-DnPAIXBn.js.map} +1 -1
  165. package/dist/shell-source-maps/assets/{message-content-CeLDUud8.js.map → message-content-C6ld-XsS.js.map} +1 -1
  166. package/dist/shell-source-maps/assets/{messages-XnV72On0.js.map → messages-CWURrUB-.js.map} +1 -1
  167. package/dist/shell-source-maps/assets/{organization-page-Cdfaqvsh.js.map → organization-page-DnmV85sX.js.map} +1 -1
  168. package/dist/shell-source-maps/assets/{organizations-page-C37kxzUq.js.map → organizations-page-CKJB2qGB.js.map} +1 -1
  169. package/dist/shell-source-maps/assets/{pending-invitation-row-Cyu7Ucej.js.map → pending-invitation-row-DAXBo7SZ.js.map} +1 -1
  170. package/dist/shell-source-maps/assets/{period-chart-T4rBI9Y2.js.map → period-chart-CbzGqkpY.js.map} +1 -1
  171. package/dist/shell-source-maps/assets/{person-row-DjxZAaa3.js.map → person-row-BNM1LeOM.js.map} +1 -1
  172. package/dist/shell-source-maps/assets/{public-form-page-DaPFaXOT.js.map → public-form-page-BTILqkb8.js.map} +1 -1
  173. package/dist/shell-source-maps/assets/{record-lines-CSeqYQnm.js.map → record-lines-BuGPIPkM.js.map} +1 -1
  174. package/dist/shell-source-maps/assets/{record-map-l-E3DvxV.js.map → record-map-H5uvOI5d.js.map} +1 -1
  175. package/dist/shell-source-maps/assets/{record-opens-DPMtZw1p.js.map → record-opens-BLwJhTqE.js.map} +1 -1
  176. package/dist/shell-source-maps/assets/{record-page-DK2-zwXx.js.map → record-page-CCfn7bkb.js.map} +1 -1
  177. package/dist/shell-source-maps/assets/{record-preview-0BdCZkO9.js.map → record-preview-CWciJJ5e.js.map} +1 -1
  178. package/dist/shell-source-maps/assets/{records-map-DSg2fbqb.js.map → records-map-CPYxm3fv.js.map} +1 -1
  179. package/dist/shell-source-maps/assets/{render-node-qPc-4XAK.js.map → render-node-BiDgPc8P.js.map} +1 -1
  180. package/dist/shell-source-maps/assets/{reorder-button-Z_evPIxl.js.map → reorder-button-CeZV0Cqx.js.map} +1 -1
  181. package/dist/shell-source-maps/assets/{run-trace-view-ChuThRe4.js.map → run-trace-view-CsT4mLDc.js.map} +1 -1
  182. package/dist/shell-source-maps/assets/{runner-install-field-8Ap9WvhK.js.map → runner-install-field-8Oz3ILhl.js.map} +1 -1
  183. package/dist/shell-source-maps/assets/{runtime-update-B4DPgHIL.js.map → runtime-update-CQ7qAQHh.js.map} +1 -1
  184. package/dist/shell-source-maps/assets/{sheet-source-D0v07JHr.js.map → sheet-source-Ch5uFlt5.js.map} +1 -1
  185. package/dist/shell-source-maps/assets/{sign-in-policy-page-CV3iE_o8.js.map → sign-in-policy-page-DyroONcf.js.map} +1 -1
  186. package/dist/shell-source-maps/assets/{start-block-queries-DJX-JI2P.js.map → start-block-queries-heBbb7IN.js.map} +1 -1
  187. package/dist/shell-source-maps/assets/{step-catalog-DSHlXxWA.js.map → step-catalog-C7zY05CI.js.map} +1 -1
  188. package/dist/shell-source-maps/assets/{step-panel-CF6x9K8Y.js.map → step-panel-DifkdQUN.js.map} +1 -1
  189. package/dist/shell-source-maps/assets/{timeline-display-DpVKeXjG.js.map → timeline-display-DgD-tH2t.js.map} +1 -1
  190. package/dist/shell-source-maps/assets/{trash-Ccs0JhuD.js.map → trash-sDDKsEVa.js.map} +1 -1
  191. package/dist/shell-source-maps/assets/{update-set-L1kw--38.js.map → update-set-t56Pch6F.js.map} +1 -1
  192. package/dist/shell-source-maps/assets/{use-calendar-move-DHCS22jF.js.map → use-calendar-move-B5Nd4WqC.js.map} +1 -1
  193. package/dist/shell-source-maps/assets/{use-display-rows-DcY7w9cN.js.map → use-display-rows-Evx7hciH.js.map} +1 -1
  194. package/dist/shell-source-maps/assets/{use-my-invitations-Dodu_ib9.js.map → use-my-invitations-BeEVmA84.js.map} +1 -1
  195. package/dist/shell-source-maps/assets/{use-paged-search-Crpqw2e-.js.map → use-paged-search-CHtW6YbU.js.map} +1 -1
  196. package/dist/shell-source-maps/assets/{use-run-trace-Cozaxsfl.js.map → use-run-trace-B0JxFskZ.js.map} +1 -1
  197. package/dist/shell-source-maps/assets/{use-workflow-page-eP9jGrad.js.map → use-workflow-page-3QycD-Ie.js.map} +1 -1
  198. package/dist/shell-source-maps/assets/{use-workflow-types-DjJ87TLL.js.map → use-workflow-types-7sud5u7m.js.map} +1 -1
  199. package/dist/shell-source-maps/assets/{workflow-canvas-NJSHRDav.js.map → workflow-canvas-CzzTk8Bv.js.map} +1 -1
  200. package/dist/shell-source-maps/assets/{workflow-field-D_pqVGeK.js.map → workflow-field-ehSWu4Iq.js.map} +1 -1
  201. package/dist/shell-source-maps/assets/{workflow-graph-editor-D4zxMPy4.js.map → workflow-graph-editor-89M8HZOe.js.map} +1 -1
  202. package/dist/shell-source-maps/assets/{workflow-run-field-DcL-8XS_.js.map → workflow-run-field-Dxg2lHnv.js.map} +1 -1
  203. package/dist/shell-source-maps/assets/{workflow-status-field-15bq7T5K.js.map → workflow-status-field-Bws1hFJF.js.map} +1 -1
  204. package/dist/shell-source-maps/assets/{workflow-workbench-CC_mXUfW.js.map → workflow-workbench-D2Piourk.js.map} +1 -1
  205. package/dist/status/messages.d.ts +2 -2
  206. package/dist/users/messages.d.ts +2 -2
  207. package/package.json +5 -5
  208. package/dist/shell-source-maps/assets/app-1IZYQXW2.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"maplibre-aCJmOb1H.js","names":["useState","_Fragment","maplibre.setWorkerUrl","workerUrl","maplibre.addProtocol","Protocol","maplibre","n","a","t","__toESM","require_react","require_jsx_runtime","guarded","Segmented","createLucideIcon","messages","maplibre_gl_exports","An","UF","maplibre_gl_worker_default","Source","useMap","Layer","B","__iconData","MapPin","import_react","mapLayerStorageKey","chosenMapLayer","layers","layer","id","readMapLayer","storage","writeMapLayer","text","import_jsx_runtime","styleValue","MapLayerSwitch","chosenId","setChosenId","map","chosen","choose","value","beforeId","below","mapLib"],"sources":["../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/map-pin.mjs","../../../src/app/map/map-layer-choice.ts","../../../src/app/map/messages.ts","../../../src/app/map/map-layer-switch.tsx","../../../src/app/map/maplibre.ts"],"sourcesContent":["/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"map-pin\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0\",\n key: \"1r0f0z\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"10\", r: \"3\", key: \"ilqhr7\" }]\n ]\n};\n__iconData.node;\nconst MapPin = createLucideIcon(__iconData);\n\nexport { __iconData, MapPin as default };\n//# sourceMappingURL=map-pin.mjs.map\n","import type { MapLayerModel } from '@protobase/client'\nimport { guarded } from '../../lib/guarded'\n\nexport const mapLayerStorageKey = 'protobase:map-layer'\n\n/** The layer the browser last chose, if the app still offers it: else the style's own map, which is the default. */\nexport const chosenMapLayer = (layers: MapLayerModel[], id: string | null | undefined) => layers.find((layer) => layer.id === id)\n\n/** The id of the layer chosen in this browser, if any; unavailable storage reads as the default map. */\nexport const readMapLayer = (storage: Pick<Storage, 'getItem'>) => guarded(() => storage.getItem(mapLayerStorageKey), null)\n\n/** Remembers a layer by its id, and the default map by forgetting the choice, so the default costs no storage. */\nexport const writeMapLayer = (storage: Pick<Storage, 'setItem' | 'removeItem'>, id: string | undefined) =>\n guarded(() => (id === undefined ? storage.removeItem(mapLayerStorageKey) : storage.setItem(mapLayerStorageKey, id)), undefined)\n","import { messages } from '../../locale/messages'\n\nexport const text = messages('app/map')\n","import { useState } from 'react'\nimport { Layer, Source, useMap } from 'react-map-gl/maplibre'\nimport type { MapLayerModel } from '@protobase/client'\nimport { Segmented } from '../../primitives/segmented'\nimport { chosenMapLayer, readMapLayer, writeMapLayer } from './map-layer-choice'\nimport { text } from './messages'\n\n// The default map's value in the switch: no layer id can be empty.\nconst styleValue = ''\n\n/**\n * Inside a map, a switch in its top left corner between the style's map and each of `layers`, and the chosen layer's\n * tiles drawn over the style's, under `below` when the map has that layer, such as the areas around records. The\n * layer's credit joins the map's attribution while it shows. Outside its bounds the style's map shows through. The\n * choice is remembered in this browser, for every map. Nothing without layers.\n */\nexport const MapLayerSwitch = ({ layers, below }: { layers: MapLayerModel[] | undefined; below?: string }) => {\n const [chosenId, setChosenId] = useState(() => readMapLayer(localStorage))\n const { current: map } = useMap()\n if (!layers || layers.length === 0) return null\n const chosen = chosenMapLayer(layers, chosenId)\n const choose = (value: string) => {\n const id = value === styleValue ? undefined : value\n writeMapLayer(localStorage, id)\n setChosenId(id ?? null)\n }\n const beforeId = below && map?.getLayer(below) ? below : undefined\n return (\n <>\n {chosen && (\n <Source key={chosen.id} id={`map-layer-${chosen.id}`} type=\"raster\" tiles={[chosen.tiles]} tileSize={256} attribution={chosen.attribution} maxzoom={chosen.maxzoom ?? 22} {...(chosen.bounds && { bounds: chosen.bounds })}>\n <Layer id={`map-layer-${chosen.id}`} type=\"raster\" {...(beforeId && { beforeId })} />\n </Source>\n )}\n <div className=\"absolute left-2.5 top-2.5 z-10 rounded-md shadow\">\n <Segmented label={text('mapLayer')} value={chosen?.id ?? styleValue} onChange={choose} options={[{ value: styleValue, label: text('map') }, ...layers.map((layer) => ({ value: layer.id, label: layer.label }))]} />\n </div>\n </>\n )\n}\n","import * as maplibre from 'maplibre-gl'\nimport workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'\nimport 'maplibre-gl/dist/maplibre-gl.css'\nimport { Protocol } from 'pmtiles'\n\n// This module loads the first time a map is drawn, and once: MapLibre runs its worker from the bundled file, as its\n// docs say for Vite, and reads `pmtiles://` sources in a style by range requests to the one archive. A map takes\n// MapLibre from here, so a build that drops modules imported only for their effects keeps this one.\nmaplibre.setWorkerUrl(workerUrl)\nmaplibre.addProtocol('pmtiles', new Protocol().tile)\n\n/** MapLibre, set up to run its worker and read PMTiles archives: what a map draws with. */\nexport const mapLib = maplibre\n"],"ignoreList":[0],"mappings":"uzBASA,IAAMyB,EAAa,CACjB,KAAM,UACN,KAAM,GACN,KAAM,CACJ,CACE,OACA,CACE,EAAG,uGACH,IAAK,QACP,CACF,EACA,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,IAAK,IAAK,QAAS,CAAC,CAC1D,CACF,EACAA,EAAW,KACX,IAAMC,EAASX,EAAiBU,CAAU,aCrB7BG,EAAqB,sBAGrBC,GAAkB,EAAyB,IAAkCC,EAAO,KAAM,GAAUC,EAAM,KAAOC,CAAE,EAGnHC,EAAgB,GAAsCpB,MAAcqB,EAAQ,QAAQN,CAAkB,EAAG,IAAI,EAG7GO,GAAiB,EAAkD,IAC9EtB,MAAemB,IAAO,IAAA,GAAYE,EAAQ,WAAWN,CAAkB,EAAIM,EAAQ,QAAQN,EAAoBI,CAAE,EAAI,IAAA,EAAS,ECXnHI,EAAOpB,EAAS,SAAS,aCMhCsB,EAAa,GAQNC,GAAkB,CAAE,SAAQ,WAAqE,CAC5G,GAAM,CAACC,EAAUC,IAAA,EAAezC,EAAAA,SAAAA,KAAeiC,EAAa,YAAY,CAAC,EACnE,CAAE,QAASS,GAAQpB,EAAO,EAChC,GAAI,CAACQ,GAAUA,EAA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ment","maplibre.setWorkerUrl","workerUrl","maplibre.addProtocol","Protocol","maplibre","n","a","t","__toESM","require_react","require_jsx_runtime","guarded","Segmented","createLucideIcon","messages","maplibre_gl_exports","An","UF","maplibre_gl_worker_default","Source","useMap","Layer","B","__iconData","MapPin","import_react","mapLayerStorageKey","chosenMapLayer","layers","layer","id","readMapLayer","storage","writeMapLayer","text","import_jsx_runtime","styleValue","MapLayerSwitch","chosenId","setChosenId","map","chosen","choose","value","beforeId","below","mapLib"],"sources":["../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/map-pin.mjs","../../../src/app/map/map-layer-choice.ts","../../../src/app/map/messages.ts","../../../src/app/map/map-layer-switch.tsx","../../../src/app/map/maplibre.ts"],"sourcesContent":["/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"map-pin\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0\",\n key: \"1r0f0z\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"10\", r: \"3\", key: \"ilqhr7\" }]\n ]\n};\n__iconData.node;\nconst MapPin = createLucideIcon(__iconData);\n\nexport { __iconData, MapPin as default };\n//# sourceMappingURL=map-pin.mjs.map\n","import type { MapLayerModel } from '@protobase/client'\nimport { guarded } from '../../lib/guarded'\n\nexport const mapLayerStorageKey = 'protobase:map-layer'\n\n/** The layer the browser last chose, if the app still offers it: else the style's own map, which is the default. */\nexport const chosenMapLayer = (layers: MapLayerModel[], id: string | null | undefined) => layers.find((layer) => layer.id === id)\n\n/** The id of the layer chosen in this browser, if any; unavailable storage reads as the default map. */\nexport const readMapLayer = (storage: Pick<Storage, 'getItem'>) => guarded(() => storage.getItem(mapLayerStorageKey), null)\n\n/** Remembers a layer by its id, and the default map by forgetting the choice, so the default costs no storage. */\nexport const writeMapLayer = (storage: Pick<Storage, 'setItem' | 'removeItem'>, id: string | undefined) =>\n guarded(() => (id === undefined ? storage.removeItem(mapLayerStorageKey) : storage.setItem(mapLayerStorageKey, id)), undefined)\n","import { messages } from '../../locale/messages'\n\nexport const text = messages('app/map')\n","import { useState } from 'react'\nimport { Layer, Source, useMap } from 'react-map-gl/maplibre'\nimport type { MapLayerModel } from '@protobase/client'\nimport { Segmented } from '../../primitives/segmented'\nimport { chosenMapLayer, readMapLayer, writeMapLayer } from './map-layer-choice'\nimport { text } from './messages'\n\n// The default map's value in the switch: no layer id can be empty.\nconst styleValue = ''\n\n/**\n * Inside a map, a switch in its top left corner between the style's map and each of `layers`, and the chosen layer's\n * tiles drawn over the style's, under `below` when the map has that layer, such as the areas around records. The\n * layer's credit joins the map's attribution while it shows. Outside its bounds the style's map shows through. The\n * choice is remembered in this browser, for every map. Nothing without layers.\n */\nexport const MapLayerSwitch = ({ layers, below }: { layers: MapLayerModel[] | undefined; below?: string }) => {\n const [chosenId, setChosenId] = useState(() => readMapLayer(localStorage))\n const { current: map } = useMap()\n if (!layers || layers.length === 0) return null\n const chosen = chosenMapLayer(layers, chosenId)\n const choose = (value: string) => {\n const id = value === styleValue ? undefined : value\n writeMapLayer(localStorage, id)\n setChosenId(id ?? null)\n }\n const beforeId = below && map?.getLayer(below) ? below : undefined\n return (\n <>\n {chosen && (\n <Source key={chosen.id} id={`map-layer-${chosen.id}`} type=\"raster\" tiles={[chosen.tiles]} tileSize={256} attribution={chosen.attribution} maxzoom={chosen.maxzoom ?? 22} {...(chosen.bounds && { bounds: chosen.bounds })}>\n <Layer id={`map-layer-${chosen.id}`} type=\"raster\" {...(beforeId && { beforeId })} />\n </Source>\n )}\n <div className=\"absolute left-2.5 top-2.5 z-10 rounded-md shadow\">\n <Segmented label={text('mapLayer')} value={chosen?.id ?? styleValue} onChange={choose} options={[{ value: styleValue, label: text('map') }, ...layers.map((layer) => ({ value: layer.id, label: layer.label }))]} />\n </div>\n </>\n )\n}\n","import * as maplibre from 'maplibre-gl'\nimport workerUrl from 'maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url'\nimport 'maplibre-gl/dist/maplibre-gl.css'\nimport { Protocol } from 'pmtiles'\n\n// This module loads the first time a map is drawn, and once: MapLibre runs its worker from the bundled file, as its\n// docs say for Vite, and reads `pmtiles://` sources in a style by range requests to the one archive. A map takes\n// MapLibre from here, so a build that drops modules imported only for their effects keeps this one.\nmaplibre.setWorkerUrl(workerUrl)\nmaplibre.addProtocol('pmtiles', new Protocol().tile)\n\n/** MapLibre, set up to run its worker and read PMTiles archives: what a map draws with. */\nexport const mapLib = maplibre\n"],"ignoreList":[0],"mappings":"uzBASA,IAAMyB,EAAa,CACjB,KAAM,UACN,KAAM,GACN,KAAM,CACJ,CACE,OACA,CACE,EAAG,uGACH,IAAK,QACP,CACF,EACA,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,IAAK,IAAK,QAAS,CAAC,CAC1D,CACF,EACAA,EAAW,KACX,IAAMC,EAASX,EAAiBU,CAAU,aCrB7BG,EAAqB,sBAGrBC,GAAkB,EAAyB,IAAkCC,EAAO,KAAM,GAAUC,EAAM,KAAOC,CAAE,EAGnHC,EAAgB,GAAsCpB,MAAcqB,EAAQ,QAAQN,CAAkB,EAAG,IAAI,EAG7GO,GAAiB,EAAkD,IAC9EtB,MAAemB,IAAO,IAAA,GAAYE,EAAQ,WAAWN,CAAkB,EAAIM,EAAQ,QAAQN,EAAoBI,CAAE,EAAI,IAAA,EAAS,ECXnHI,EAAOpB,EAAS,SAAS,aCMhCsB,EAAa,GAQNC,GAAkB,CAAE,SAAQ,WAAqE,CAC5G,GAAM,CAACC,EAAUC,IAAA,EAAezC,EAAAA,SAAAA,KAAeiC,EAAa,YAAY,CAAC,EACnE,CAAE,QAASS,GAAQpB,EAAO,EAChC,GAAI,CAAC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CDmFTB6r.js","names":["Marked","useMemo","DOMPurify","n","a","t","__toESM","require_react","require_jsx_runtime","useHeadingLevel","cn","purify_default","U","safeAddress","newTabLink","imageSchemes","titled","linkSchemes","escapeHtml","import_react","nestedHeadingLevel","under","depth","parser","block","text","tokens","address","inLink","href","title","parsers","markdownHtml","markdown","source","token","headingsUnder","import_jsx_runtime","page","MarkdownContent","insideLink","html","className"],"sources":["../../../src/markdown/nested-heading-level.ts","../../../src/markdown/markdown-html.ts","../../../src/markdown/markdown-content.tsx"],"sourcesContent":["/**\n * The level a markdown heading of `depth` takes under a heading of level `under`: one below it at the least, so `#` and\n * `##` both become the level under it and `###` the one after, and never past h6. With nothing above it, `depth` stays.\n */\nexport const nestedHeadingLevel = (depth: number, under: number) => {\n if (under === 0) return depth\n return Math.min(6, Math.max(under + 1, depth + under - 1))\n}\n","import { Marked, type Tokens } from 'marked'\nimport { nestedHeadingLevel } from './nested-heading-level'\nimport { escapeHtml, imageSchemes, linkSchemes, newTabLink, safeAddress, titled } from './safe-html'\n\nexport type MarkdownHtmlOptions = {\n /** The HTML goes inside a link, such as a card: its links become their text and its images their alt text. */\n inLink?: boolean\n /** The level of the heading the HTML sits under, whose level its own headings go below; 0, the default, keeps them. */\n headingsUnder?: number\n}\n\nconst parser = ({ inLink = false }: MarkdownHtmlOptions) =>\n new Marked({\n gfm: true,\n // A line break in the text is one on the page, as in a comment on GitHub\n breaks: true,\n renderer: {\n // Raw HTML shows as the text it is, never as markup\n html: ({ text, block }: Tokens.HTML | Tokens.Tag) => (block ? `<p>${escapeHtml(text)}</p>` : escapeHtml(text)),\n link({ href, title, tokens }: Tokens.Link) {\n const text = this.parser.parseInline(tokens)\n const address = inLink ? null : safeAddress(href, linkSchemes)\n if (address === null) return text\n return newTabLink(address, title, text)\n },\n image({ href, title, text }: Tokens.Image) {\n const address = inLink ? null : safeAddress(href, imageSchemes)\n if (address === null) return escapeHtml(text)\n return `<img src=\"${escapeHtml(address)}\" alt=\"${escapeHtml(text)}\"${titled(title)} loading=\"lazy\">`\n },\n },\n })\n\nconst parsers = { inLink: parser({ inLink: true }), page: parser({}) }\n\n/**\n * Markdown as HTML (GitHub's flavour, line breaks kept): raw HTML escaped, links and images only to http(s), mailto and\n * tel addresses or relative ones, links opening in a new tab and headings below `headingsUnder`. The page sanitises the\n * result again before showing it.\n */\nexport const markdownHtml = (source: string, { inLink = false, headingsUnder = 0 }: MarkdownHtmlOptions = {}) => {\n const markdown = inLink ? parsers.inLink : parsers.page\n const tokens = markdown.lexer(source)\n markdown.walkTokens(tokens, (token) => {\n if (token.type === 'heading') token.depth = nestedHeadingLevel(token.depth, headingsUnder)\n })\n return markdown.parser(tokens)\n}\n","import { useMemo } from 'react'\nimport DOMPurify from 'dompurify'\nimport { cn } from '../lib/cn'\nimport { useHeadingLevel } from '../lib/heading-level'\nimport { markdownHtml } from './markdown-html'\n\n// The parts markdown makes, in the theme's colours; code and tables wrap rather than scroll inside\nconst page = cn(\n 'break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0',\n '[&_p]:my-2 [&_ul]:my-2 [&_ol]:my-2 [&_pre]:my-2 [&_blockquote]:my-2 [&_table]:my-2 [&_hr]:my-3',\n '[&_h1]:mt-4 [&_h1]:mb-2 [&_h1]:text-lg [&_h1]:font-semibold [&_h2]:mt-4 [&_h2]:mb-2 [&_h2]:text-base [&_h2]:font-semibold',\n '[&_h3]:mt-3 [&_h3]:mb-1 [&_h3]:font-semibold [&_h4]:mt-3 [&_h4]:mb-1 [&_h4]:font-semibold [&_h5]:font-semibold [&_h6]:font-semibold',\n '[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_li:has(>input)]:list-none [&_li>input]:mr-1.5 [&_li>input]:-ml-5 [&_li>input]:align-middle',\n '[&_a]:text-primary-text [&_a]:underline [&_a]:underline-offset-2 hover:[&_a]:text-primary-hover',\n '[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.9em]',\n '[&_pre]:whitespace-pre-wrap [&_pre]:rounded-md [&_pre]:bg-muted [&_pre]:p-3 [&_pre_code]:bg-transparent [&_pre_code]:p-0',\n '[&_blockquote]:border-l-2 [&_blockquote]:border-border-strong [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground',\n '[&_table]:w-full [&_table]:border-collapse [&_th]:border [&_th]:border-border [&_th]:bg-surface [&_th]:px-2 [&_th]:py-1 [&_th]:text-left [&_th]:font-semibold',\n '[&_td]:border [&_td]:border-border [&_td]:px-2 [&_td]:py-1 [&_td]:[overflow-wrap:anywhere]',\n '[&_hr]:border-border [&_img]:inline [&_img]:max-w-full [&_img]:rounded [&_del]:text-muted-foreground',\n)\n\n// Inside a link, such as a card, it reads as running text: no gaps between blocks and headings no larger\nconst inLink = cn('[&_*]:my-0 [&_h1]:font-semibold [&_h2]:font-semibold [&_h3]:font-semibold [&_ul]:list-inside [&_ol]:list-inside [&_pre]:whitespace-pre-wrap [&_code]:font-mono [&_code]:text-[0.9em]')\n\nexport type MarkdownContentProps = {\n source: string\n /** It is shown inside a link, such as a card: its own links and images show as their text. */\n inLink?: boolean\n className?: string\n}\n\n/**\n * Markdown rendered, sanitised before it reaches the page: raw HTML shows as text, links open in a new tab and headings\n * sit below the heading the markdown is under, such as a record page section's.\n */\nexport const MarkdownContent = ({ source, inLink: insideLink = false, className }: MarkdownContentProps) => {\n const headingsUnder = useHeadingLevel()\n const html = useMemo(() => DOMPurify.sanitize(markdownHtml(source, { inLink: insideLink, headingsUnder }), { ADD_ATTR: ['target'] }), [source, insideLink, headingsUnder])\n return <div className={cn(insideLink ? inLink : page, className)} dangerouslySetInnerHTML={{ __html: html }} />\n}\n"],"mappings":"kyBAIaoB,GAAsB,EAAe,IAC5CC,IAAU,EAAUC,EACjB,KAAK,IAAI,EAAG,KAAK,IAAID,EAAQ,EAAGC,EAAQD,EAAQ,CAAC,CAAC,ECKrDE,GAAU,CAAE,SAAS,MACzB,IAAIvB,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,EAAaE,EAAQ,CAAE,OAAQM,EAAY,eAAc,CAAC,EAAG,CAAE,SAAU,CAAC,QAAQ,CAAE,CAAC,EAAG,CAACN,EAAQM,EAAYJ,CAAa,CAAC,EACzK,OAAO,EAAAC,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW3B,EAAG8B,EAAaZ,EAASU,EAAMI,CAAS,EAAG,wBAAyB,CAAE,OAAQD,CAAK,CAAI,CAAA,CAChH","debugId":"839854c1-eab3-494c-959e-e0991f129488"}
1
+ {"version":3,"file":"markdown-content-CB2LNHPp.js","names":["Marked","useMemo","DOMPurify","n","a","t","__toESM","require_react","require_jsx_runtime","useHeadingLevel","cn","purify_default","U","safeAddress","newTabLink","imageSchemes","titled","linkSchemes","escapeHtml","import_react","nestedHeadingLevel","under","depth","parser","block","text","tokens","address","inLink","href","title","parsers","markdownHtml","markdown","source","token","headingsUnder","import_jsx_runtime","page","MarkdownContent","insideLink","html","className"],"sources":["../../../src/markdown/nested-heading-level.ts","../../../src/markdown/markdown-html.ts","../../../src/markdown/markdown-content.tsx"],"sourcesContent":["/**\n * The level a markdown heading of `depth` takes under a heading of level `under`: one below it at the least, so `#` and\n * `##` both become the level under it and `###` the one after, and never past h6. With nothing above it, `depth` stays.\n */\nexport const nestedHeadingLevel = (depth: number, under: number) => {\n if (under === 0) return depth\n return Math.min(6, Math.max(under + 1, depth + under - 1))\n}\n","import { Marked, type Tokens } from 'marked'\nimport { nestedHeadingLevel } from './nested-heading-level'\nimport { escapeHtml, imageSchemes, linkSchemes, newTabLink, safeAddress, titled } from './safe-html'\n\nexport type MarkdownHtmlOptions = {\n /** The HTML goes inside a link, such as a card: its links become their text and its images their alt text. */\n inLink?: boolean\n /** The level of the heading the HTML sits under, whose level its own headings go below; 0, the default, keeps them. */\n headingsUnder?: number\n}\n\nconst parser = ({ inLink = false }: MarkdownHtmlOptions) =>\n new Marked({\n gfm: true,\n // A line break in the text is one on the page, as in a comment on GitHub\n breaks: true,\n renderer: {\n // Raw HTML shows as the text it is, never as markup\n html: ({ text, block }: Tokens.HTML | Tokens.Tag) => (block ? `<p>${escapeHtml(text)}</p>` : escapeHtml(text)),\n link({ href, title, tokens }: Tokens.Link) {\n const text = this.parser.parseInline(tokens)\n const address = inLink ? null : safeAddress(href, linkSchemes)\n if (address === null) return text\n return newTabLink(address, title, text)\n },\n image({ href, title, text }: Tokens.Image) {\n const address = inLink ? null : safeAddress(href, imageSchemes)\n if (address === null) return escapeHtml(text)\n return `<img src=\"${escapeHtml(address)}\" alt=\"${escapeHtml(text)}\"${titled(title)} loading=\"lazy\">`\n },\n },\n })\n\nconst parsers = { inLink: parser({ inLink: true }), page: parser({}) }\n\n/**\n * Markdown as HTML (GitHub's flavour, line breaks kept): raw HTML escaped, links and images only to http(s), mailto and\n * tel addresses or relative ones, links opening in a new tab and headings below `headingsUnder`. The page sanitises the\n * result again before showing it.\n */\nexport const markdownHtml = (source: string, { inLink = false, headingsUnder = 0 }: MarkdownHtmlOptions = {}) => {\n const markdown = inLink ? parsers.inLink : parsers.page\n const tokens = markdown.lexer(source)\n markdown.walkTokens(tokens, (token) => {\n if (token.type === 'heading') token.depth = nestedHeadingLevel(token.depth, headingsUnder)\n })\n return markdown.parser(tokens)\n}\n","import { useMemo } from 'react'\nimport DOMPurify from 'dompurify'\nimport { cn } from '../lib/cn'\nimport { useHeadingLevel } from '../lib/heading-level'\nimport { markdownHtml } from './markdown-html'\n\n// The parts markdown makes, in the theme's colours; code and tables wrap rather than scroll inside\nconst page = cn(\n 'break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0',\n '[&_p]:my-2 [&_ul]:my-2 [&_ol]:my-2 [&_pre]:my-2 [&_blockquote]:my-2 [&_table]:my-2 [&_hr]:my-3',\n '[&_h1]:mt-4 [&_h1]:mb-2 [&_h1]:text-lg [&_h1]:font-semibold [&_h2]:mt-4 [&_h2]:mb-2 [&_h2]:text-base [&_h2]:font-semibold',\n '[&_h3]:mt-3 [&_h3]:mb-1 [&_h3]:font-semibold [&_h4]:mt-3 [&_h4]:mb-1 [&_h4]:font-semibold [&_h5]:font-semibold [&_h6]:font-semibold',\n '[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_li:has(>input)]:list-none [&_li>input]:mr-1.5 [&_li>input]:-ml-5 [&_li>input]:align-middle',\n '[&_a]:text-primary-text [&_a]:underline [&_a]:underline-offset-2 hover:[&_a]:text-primary-hover',\n '[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.9em]',\n '[&_pre]:whitespace-pre-wrap [&_pre]:rounded-md [&_pre]:bg-muted [&_pre]:p-3 [&_pre_code]:bg-transparent [&_pre_code]:p-0',\n '[&_blockquote]:border-l-2 [&_blockquote]:border-border-strong [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground',\n '[&_table]:w-full [&_table]:border-collapse [&_th]:border [&_th]:border-border [&_th]:bg-surface [&_th]:px-2 [&_th]:py-1 [&_th]:text-left [&_th]:font-semibold',\n '[&_td]:border [&_td]:border-border [&_td]:px-2 [&_td]:py-1 [&_td]:[overflow-wrap:anywhere]',\n '[&_hr]:border-border [&_img]:inline [&_img]:max-w-full [&_img]:rounded [&_del]:text-muted-foreground',\n)\n\n// Inside a link, such as a card, it reads as running text: no gaps between blocks and headings no larger\nconst inLink = cn('[&_*]:my-0 [&_h1]:font-semibold [&_h2]:font-semibold [&_h3]:font-semibold [&_ul]:list-inside [&_ol]:list-inside [&_pre]:whitespace-pre-wrap [&_code]:font-mono [&_code]:text-[0.9em]')\n\nexport type MarkdownContentProps = {\n source: string\n /** It is shown inside a link, such as a card: its own links and images show as their text. */\n inLink?: boolean\n className?: string\n}\n\n/**\n * Markdown rendered, sanitised before it reaches the page: raw HTML shows as text, links open in a new tab and headings\n * sit below the heading the markdown is under, such as a record page section's.\n */\nexport const MarkdownContent = ({ source, inLink: insideLink = false, className }: MarkdownContentProps) => {\n const headingsUnder = useHeadingLevel()\n const html = useMemo(() => DOMPurify.sanitize(markdownHtml(source, { inLink: insideLink, headingsUnder }), { ADD_ATTR: ['target'] }), [source, insideLink, headingsUnder])\n return <div className={cn(insideLink ? inLink : page, className)} dangerouslySetInnerHTML={{ __html: html }} />\n}\n"],"mappings":"kyBAIaoB,GAAsB,EAAe,IAC5CC,IAAU,EAAUC,EACjB,KAAK,IAAI,EAAG,KAAK,IAAID,EAAQ,EAAGC,EAAQD,EAAQ,CAAC,CAAC,ECKrDE,GAAU,CAAE,SAAS,MACzB,IAAIvB,EAAO,CACT,IAAK,GAEL,OAAQ,GACR,SAAU,CAER,MAAO,CAAE,OAAM,WAAuCwB,EAAQ,MAAMN,EAAWO,CAAI,EAAE,MAAQP,EAAWO,CAAI,EAC5G,KAAK,CAAE,OAAM,QAAO,UAAuB,CACzC,IAAMA,EAAO,KAAK,OAAO,YAAYC,CAAM,EACrCC,EAAUC,EAAS,KAAOf,EAAYgB,EAAMZ,CAAW,EAE7D,OADIU,IAAY,KAAaF,EACtBX,EAAWa,EAASG,EAAOL,CAAI,CACxC,EACA,MAAM,CAAE,OAAM,QAAO,QAAsB,CACzC,IAAME,EAAUC,EAAS,KAAOf,EAAYgB,EAAMd,CAAY,EAE9D,OADIY,IAAY,KAAaT,EAAWO,CAAI,EACrC,aAAaP,EAAWS,CAAO,EAAE,SAAST,EAAWO,CAAI,EAAE,GAAGT,EAAOc,CAAK,EAAE,iBACrF,CACF,CACF,CAAC,EAEGC,EAAU,CAAE,OAAQR,EAAO,CAAE,OAAQ,EAAK,CAAC,EAAG,KAAMA,EAAO,CAAC,CAAC,CAAE,EAOxDS,GAAgB,EAAgB,CAAE,SAAS,GAAO,gBAAgB,GAA2B,CAAC,IAAM,CAC/G,IAAMC,EAAWL,EAASG,EAAQ,OAASA,EAAQ,KAC7CL,EAASO,EAAS,MAAMC,CAAM,EAIpC,OAHAD,EAAS,WAAWP,EAAS,GAAU,CACjCS,EAAM,OAAS,YAAW,EAAM,MAAQf,EAAmBe,EAAM,MAAOC,CAAa,EAC3F,CAAC,EACMH,EAAS,OAAOP,CAAM,CAC/B,aCxCMY,EAAO5B,EACX,2DACA,iGACA,4HACA,sIACA,6JACA,kGACA,4GACA,2HACA,yHACA,gKACA,6FACA,sGACF,EAGMkB,EAASlB,EAAG,sLAAsL,EAa3L6B,GAAmB,CAAE,SAAQ,OAAQC,EAAa,GAAO,eAAsC,CAC1G,IAAMJ,EAAgB3B,EAAgB,EAChCgC,GAAA,EAAOxC,EAAAA,QAAAA,KAAcC,EAAU,SAAS8B,EAAaE,EAAQ,CAAE,OAAQM,EAAY,eAAc,CAAC,EAAG,CAAE,SAAU,CAAC,QAAQ,CAAE,CAAC,EAAG,CAACN,EAAQM,EAAYJ,CAAa,CAAC,EACzK,OAAO,EAAAC,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW3B,EAAG8B,EAAaZ,EAASU,EAAMI,CAAS,EAAG,wBAAyB,CAAE,OAAQD,CAAK,CAAI,CAAA,CAChH","debugId":"81d8b347-3e9b-4d72-aa09-337d0ea26054"}
@@ -1 +1 @@
1
- {"version":3,"file":"members-page-Defqhu24.js","names":["_Fragment","useCallback","n","a","t","__toESM","require_react","require_jsx_runtime","keys","text","Spinner","useOrganizationText","AuthError","useAuth","Button","authMessage","presenceOf","AccountSection","organizationRoleLabel","useAction","grantableRoles","SectionError","StatusMark","useQuery","PageHeader","AppRolesPicker","PersonRow","import_react","import_jsx_runtime","assignableOrganizationRoles","current","MemberRow","organizationId","roles","organizations","self","member","organizationRoles","roleLocked","membershipRoles","role","status","presence","busy","run","session","event","onChanged","selected","MembersPage","query","members","error","load","refetch","statuses"],"sources":["../../../src/organizations/members-page.tsx"],"sourcesContent":["import { useQuery } from '@tanstack/react-query'\nimport { useCallback, useState } from 'react'\nimport { keys } from '../data/query-keys'\nimport { AuthError, type CurrentOrganization, type OrganizationMember, type OrganizationRole, type PersonStatus } from '@protobase/client'\nimport { AccountSection, SectionError } from '../account/account-section'\nimport { PageHeader } from '../app-shell'\nimport { authMessage } from '../auth/auth-messages'\nimport { useAuth } from '../auth/auth-provider'\nimport { PersonRow } from '../people/person-row'\nimport { presenceOf, type Presence, type PresenceByUser } from '../presence/presence'\nimport { StatusMark } from '../status/status-mark'\nimport { Button } from '../primitives/button'\nimport { Spinner } from '../primitives/spinner'\nimport { AppRolesPicker } from './app-roles-picker'\nimport { grantableRoles, organizationRoleLabel } from './organization-paths'\nimport { useAction } from './use-action'\nimport { text } from './messages'\nimport { useOrganizationText } from './organization-word'\n\n/** The organization roles the person may set: owners every one, admins those below owner. */\nexport const assignableOrganizationRoles = (current?: CurrentOrganization): OrganizationRole[] => (current?.role === 'owner' ? ['owner', 'admin', 'member'] : ['admin', 'member'])\n\nconst MemberRow = ({ member, current, status, presence, onChanged }: { member: OrganizationMember; current: CurrentOrganization; status?: PersonStatus | undefined; presence?: Presence | undefined; onChanged: () => void }) => {\n const { session, organizations } = useAuth()\n const t = useOrganizationText()\n const organizationId = current.organization!.id\n const { busy, error, run } = useAction()\n const roles = organizations?.roles ?? []\n const self = member.id === current.memberId\n const organizationRoles = assignableOrganizationRoles(current)\n // Only an owner changes an owner, as the server checks too.\n const roleLocked = member.role === 'owner' && current.role !== 'owner'\n const membershipRoles = roles.filter((role) => role.membership)\n return (\n <PersonRow\n name={member.name}\n email={member.email}\n self={self}\n error={error}\n {...((status || presence) && { status: <StatusMark status={status} presence={presence} /> })}\n actions={\n <>\n <select\n aria-label={t('roleOf', { name: member.name })}\n value={member.role}\n disabled={busy || roleLocked}\n onChange={(event) => void run(async () => { await session.organizations.setRole(organizationId, member.id, event.target.value as OrganizationRole); onChanged() })}\n className=\"h-7 rounded-md border border-border-strong bg-background px-2 text-body\"\n >\n {(roleLocked ? [member.role] : organizationRoles).map((role) => <option key={role} value={role}>{organizationRoleLabel(role)}</option>)}\n </select>\n {!self && (\n <Button size=\"sm\" variant=\"danger\" loading={busy} disabled={roleLocked} onClick={() => void run(async () => { await session.organizations.removeMember(organizationId, member.id); onChanged() })}>\n {text('remove')}\n </Button>\n )}\n </>\n }\n >\n <AppRolesPicker roles={membershipRoles} selected={member.appRoles} grantable={grantableRoles(roles, current)} disabled={busy} onChange={(selected) => void run(async () => { await session.organizations.setAppRoles(member.id, selected); onChanged() })} />\n </PersonRow>\n )\n}\n\n/**\n * The members of the organization one works in, for its owners and admins: organization roles, which decide who\n * manages it, and app roles, which decide what each sees and does; only roles the person may give can change. In an\n * app with status, `statuses` puts each member's beside their name (see `useStatuses`), and `presence`, the app's, puts\n * whether they are online or away before it (see `usePresence`).\n */\nexport const MembersPage = ({ current, statuses, presence }: { current?: CurrentOrganization; statuses?: readonly PersonStatus[] | undefined; presence?: PresenceByUser | undefined }) => {\n const { session } = useAuth()\n const t = useOrganizationText()\n const organizationId = current?.organization?.id\n // A query, so the start cache keeps the members and the page's first frame lists them\n const query = useQuery({ queryKey: keys.organizationMembers(organizationId ?? ''), queryFn: () => session.organizations.members(organizationId!), enabled: Boolean(organizationId), retry: false })\n const members = query.data\n const error = query.error ? (query.error instanceof AuthError ? authMessage(query.error) : text('couldNotReadMembers')) : undefined\n const { refetch } = query\n const load = useCallback(() => void refetch(), [refetch])\n if (!current?.organization) return null\n return (\n <div className=\"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-6 md:px-6\">\n <PageHeader title={text('members')} subtitle={text('whoWorks', { organization: current.organization.name })} />\n <AccountSection title={text('members')} description={t('membersDescription')}>\n <SectionError message={error} />\n {members ? (\n <ul className=\"divide-y rounded-md border\">\n {members.map((member) => <MemberRow key={`${member.id}/${member.role}/${member.appRoles.join()}`} member={member} current={current} status={statuses?.find((status) => status.userId === member.userId)} presence={presenceOf(presence, member.userId)} onChanged={load} />)}\n </ul>\n ) : (\n !error && <div className=\"flex items-center gap-2 text-muted-foreground\"><Spinner /> {text('loading')}</div>\n )}\n </AccountSection>\n </div>\n )\n}\n"],"mappings":"q3BAoBa6B,EAA+B,GAAuDC,GAAS,OAAS,QAAU,CAAC,QAAS,QAAS,QAAQ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AAS,EAAG,YAAaL,EAAE,oBAAoB,EAA3E,SAAA,EACE,EAAAwB,EAAA,IAAA,CAACP,EAAD,CAAc,QAAS+B,CAAQ,CAAA,EAC9BD,GACC,EAAAvB,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,6BACX,SAAAuB,EAAQ,IAAK,IAAW,EAAAvB,EAAA,IAAA,CAACG,EAAD,CAAiF,SAAiB,UAAS,OAAQwB,GAAU,KAAM,GAAWd,EAAO,SAAWL,EAAO,MAAM,EAAG,SAAUpB,EAAW0B,EAAUN,EAAO,MAAM,EAAG,UAAWiB,CAAO,EAAjO,GAAGjB,EAAO,GAAG,GAAGA,EAAO,KAAK,GAAGA,EAAO,SAAS,KAAK,GAA6K,CAAC,CACzQ,CAAA,EAEJ,CAACgB,IAAS,EAAAxB,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,gDAAf,SAAA,EAA+D,EAAAA,EAAA,IAAA,CAAClB,EAAD,CAAU,CAAA,EAAC,IAAED,EAAK,SAAS,CAAO,CAE/F,CAAA,CAAA,CACb,CAAA,CAAA,IAd4B,IAgBrC","debugId":"de7ea86e-db86-41c2-a440-4e13abd2a534"}
1
+ {"version":3,"file":"members-page-DnPAIXBn.js","names":["_Fragment","useCallback","n","a","t","__toESM","require_react","require_jsx_runtime","keys","text","Spinner","useOrganizationText","AuthError","useAuth","Button","authMessage","presenceOf","AccountSection","organizationRoleLabel","useAction","grantableRoles","SectionError","StatusMark","useQuery","PageHeader","AppRolesPicker","PersonRow","import_react","import_jsx_runtime","assignableOrganizationRoles","current","MemberRow","organizationId","roles","organizations","self","member","organizationRoles","roleLocked","membershipRoles","role","status","presence","busy","run","session","event","onChanged","selected","MembersPage","query","members","error","load","refetch","statuses"],"sources":["../../../src/organizations/members-page.tsx"],"sourcesContent":["import { useQuery } from '@tanstack/react-query'\nimport { useCallback, useState } from 'react'\nimport { keys } from '../data/query-keys'\nimport { AuthError, type CurrentOrganization, type OrganizationMember, type OrganizationRole, type PersonStatus } from '@protobase/client'\nimport { AccountSection, SectionError } from '../account/account-section'\nimport { PageHeader } from '../app-shell'\nimport { authMessage } from '../auth/auth-messages'\nimport { useAuth } from '../auth/auth-provider'\nimport { PersonRow } from '../people/person-row'\nimport { presenceOf, type Presence, type PresenceByUser } from '../presence/presence'\nimport { StatusMark } from '../status/status-mark'\nimport { Button } from '../primitives/button'\nimport { Spinner } from '../primitives/spinner'\nimport { AppRolesPicker } from './app-roles-picker'\nimport { grantableRoles, organizationRoleLabel } from './organization-paths'\nimport { useAction } from './use-action'\nimport { text } from './messages'\nimport { useOrganizationText } from './organization-word'\n\n/** The organization roles the person may set: owners every one, admins those below owner. */\nexport const assignableOrganizationRoles = (current?: CurrentOrganization): OrganizationRole[] => (current?.role === 'owner' ? ['owner', 'admin', 'member'] : ['admin', 'member'])\n\nconst MemberRow = ({ member, current, status, presence, onChanged }: { member: OrganizationMember; current: CurrentOrganization; status?: PersonStatus | undefined; presence?: Presence | undefined; onChanged: () => void }) => {\n const { session, organizations } = useAuth()\n const t = useOrganizationText()\n const organizationId = current.organization!.id\n const { busy, error, run } = useAction()\n const roles = organizations?.roles ?? []\n const self = member.id === current.memberId\n const organizationRoles = assignableOrganizationRoles(current)\n // Only an owner changes an owner, as the server checks too.\n const roleLocked = member.role === 'owner' && current.role !== 'owner'\n const membershipRoles = roles.filter((role) => role.membership)\n return (\n <PersonRow\n name={member.name}\n email={member.email}\n self={self}\n error={error}\n {...((status || presence) && { status: <StatusMark status={status} presence={presence} /> })}\n actions={\n <>\n <select\n aria-label={t('roleOf', { name: member.name })}\n value={member.role}\n disabled={busy || roleLocked}\n onChange={(event) => void run(async () => { await session.organizations.setRole(organizationId, member.id, event.target.value as OrganizationRole); onChanged() })}\n className=\"h-7 rounded-md border border-border-strong bg-background px-2 text-body\"\n >\n {(roleLocked ? [member.role] : organizationRoles).map((role) => <option key={role} value={role}>{organizationRoleLabel(role)}</option>)}\n </select>\n {!self && (\n <Button size=\"sm\" variant=\"danger\" loading={busy} disabled={roleLocked} onClick={() => void run(async () => { await session.organizations.removeMember(organizationId, member.id); onChanged() })}>\n {text('remove')}\n </Button>\n )}\n </>\n }\n >\n <AppRolesPicker roles={membershipRoles} selected={member.appRoles} grantable={grantableRoles(roles, current)} disabled={busy} onChange={(selected) => void run(async () => { await session.organizations.setAppRoles(member.id, selected); onChanged() })} />\n </PersonRow>\n )\n}\n\n/**\n * The members of the organization one works in, for its owners and admins: organization roles, which decide who\n * manages it, and app roles, which decide what each sees and does; only roles the person may give can change. In an\n * app with status, `statuses` puts each member's beside their name (see `useStatuses`), and `presence`, the app's, puts\n * whether they are online or away before it (see `usePresence`).\n */\nexport const MembersPage = ({ current, statuses, presence }: { current?: CurrentOrganization; statuses?: readonly PersonStatus[] | undefined; presence?: PresenceByUser | undefined }) => {\n const { session } = useAuth()\n const t = useOrganizationText()\n const organizationId = current?.organization?.id\n // A query, so the start cache keeps the members and the page's first frame lists them\n const query = useQuery({ queryKey: keys.organizationMembers(organizationId ?? ''), queryFn: () => session.organizations.members(organizationId!), enabled: Boolean(organizationId), retry: false })\n const members = query.data\n const error = query.error ? (query.error instanceof AuthError ? authMessage(query.error) : text('couldNotReadMembers')) : undefined\n const { refetch } = query\n const load = useCallback(() => void refetch(), [refetch])\n if (!current?.organization) return null\n return (\n <div className=\"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-6 md:px-6\">\n <PageHeader title={text('members')} subtitle={text('whoWorks', { organization: current.organization.name })} />\n <AccountSection title={text('members')} description={t('membersDescription')}>\n <SectionError message={error} />\n {members ? (\n <ul className=\"divide-y rounded-md border\">\n {members.map((member) => <MemberRow key={`${member.id}/${member.role}/${member.appRoles.join()}`} member={member} current={current} status={statuses?.find((status) => status.userId === member.userId)} presence={presenceOf(presence, member.userId)} onChanged={load} />)}\n </ul>\n ) : (\n !error && <div className=\"flex items-center gap-2 text-muted-foreground\"><Spinner /> {text('loading')}</div>\n )}\n </AccountSection>\n </div>\n )\n}\n"],"mappings":"q3BAoBa6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AC9G,EAAAF,EAAA,KAAA,CAACX,EAAD,CAAgB,MAAOR,EAAK,SAAS,EAAG,YAAaL,EAAE,oBAAoB,EAA3E,SAAA,EACE,EAAAwB,EAAA,IAAA,CAACP,EAAD,CAAc,QAAS+B,CAAQ,CAAA,EAC9BD,GACC,EAAAvB,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,6BACX,SAAAuB,EAAQ,IAAK,IAAW,EAAAvB,EAAA,IAAA,CAACG,EAAD,CAAiF,SAAiB,UAAS,OAAQwB,GAAU,KAAM,GAAWd,EAAO,SAAWL,EAAO,MAAM,EAAG,SAAUpB,EAAW0B,EAAUN,EAAO,MAAM,EAAG,UAAWiB,CAAO,EAAjO,GAAGjB,EAAO,GAAG,GAAGA,EAAO,KAAK,GAAGA,EAAO,SAAS,KAAK,GAA6K,CAAC,CACzQ,CAAA,EAEJ,CAACgB,IAAS,EAAAxB,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,gDAAf,SAAA,EAA+D,EAAAA,EAAA,IAAA,CAAClB,EAAD,CAAU,CAAA,EAAC,IAAED,EAAK,SAAS,CAAO,CAE/F,CAAA,CAAA,CACb,CAAA,CAAA,IAd4B,IAgBrC","debugId":"e73c0217-0675-4d18-b09f-ce2926692c9a"}
@@ -1 +1 @@
1
- {"version":3,"file":"message-content-CeLDUud8.js","names":["Marked","useMemo","DOMPurify","n","a","t","__toESM","require_react","require_jsx_runtime","bodyParts","cn","mentionClass","purify_default","U","safeAddress","newTabLink","linkSchemes","escapeHtml","import_react","addressLike","hostOf","address","misleadingLinkText","named","text","namedHost","href","fence","closesFence","open","line","quote","quoteAsTyped","listItem","rule","indented","lineBreak","chatLines","lines","inFence","inBlock","marker","typed","match","blank","opensBlock","asTyped","plainText","tokens","token","marked","block","misleading","title","raw","withMentions","mentions","part","messageHtml","import_jsx_runtime","message","MessageContent","html"],"sources":["../../../src/mentions/link-text.ts","../../../src/mentions/message-lines.ts","../../../src/mentions/message-html.ts","../../../src/mentions/message-content.tsx"],"sourcesContent":["// Link text that reads as a web address: a scheme, `www.` or a dotted host, then a path, query or nothing\nconst addressLike = /^(?:[a-z][a-z0-9+.-]*:\\/\\/)?((?:[\\p{L}\\p{N}-]+\\.)+[\\p{L}]{2,})(?::\\d+)?(?:[/?#]\\S*)?$/iu\n\nconst hostOf = (address: string) => {\n if (!URL.canParse(address)) return\n return new URL(address).hostname.toLowerCase()\n}\n\n/**\n * Whether a link's text names a web address on another host than the link opens, such as\n * `[https://example.com](https://elsewhere.example)`, so the reader would be misled about where it goes.\n */\nexport const misleadingLinkText = (text: string, href: string) => {\n const named = addressLike.exec(text.trim())?.[1]\n if (!named) return false\n // A name no browser takes as a host, such as one mixing writing directions, may still read as one: show the link's own\n const namedHost = hostOf(`http://${named}`)\n if (!namedHost) return true\n return hostOf(href) !== namedHost\n}\n","// Markdown's line rules that chat habits beat, applied line by line outside code fences:\n// - a line under a quote or a list item that is neither starts a block of its own, rather than joining it lazily;\n// - a quote needs `> ` with a space, so `>5 failed logins` stays as typed;\n// - a `---` or `___` line under text stays a line of that text.\n// A backtick fence's info string holds no backtick, so ```inline``` is code within a line\nconst fence = /^ {0,3}(`{3,}(?=[^`]*$)|~{3,})/\n// A fence closes on a line of its marker, at least as long, and nothing after it but spaces\nconst closesFence = (line: string, open: string) => new RegExp(`^ {0,3}${open}[~\\`]* *$`).test(line)\nconst quote = /^ {0,3}>/\nconst quoteAsTyped = /^( {0,3})>(?=[^ \\t>])/\nconst listItem = /^ {0,3}([-*+]|\\d{1,9}[.)])([ \\t]|$)/\nconst rule = /^ {0,3}([-_])[ \\t]*(\\1[ \\t]*){2,}$/\nconst indented = /^[ \\t]/\n// Text from the API or an import can end its lines with `\\r\\n` or a lone `\\r`\nconst lineBreak = /\\r\\n?|\\n/\n\n/** A message's text with the chat line rules above made explicit for the markdown parser. */\nexport const chatLines = (text: string) => {\n const lines: string[] = []\n let inFence: string | undefined\n let inBlock = false\n for (const line of text.split(lineBreak)) {\n if (inFence) {\n if (closesFence(line, inFence)) inFence = undefined\n lines.push(line)\n continue\n }\n const marker = fence.exec(line)?.[1]\n if (marker) {\n inFence = marker\n inBlock = false\n lines.push(line)\n continue\n }\n const typed = line.replace(quoteAsTyped, '$1\\\\>').replace(rule, (match) => match.replace(/^ */, '$&\\\\'))\n const blank = typed.trim() === ''\n const opensBlock = quote.test(typed) || listItem.test(typed)\n if (inBlock && !blank && !opensBlock && !indented.test(typed)) lines.push('')\n inBlock = opensBlock || (inBlock && !blank && indented.test(typed))\n lines.push(typed)\n }\n return lines.join('\\n')\n}\n","import { Marked, type Token, type Tokens } from 'marked'\nimport { escapeHtml, linkSchemes, newTabLink, safeAddress } from '../markdown/safe-html'\nimport { misleadingLinkText } from './link-text'\nimport { bodyParts, mentionClass } from './mention-text'\nimport { chatLines } from './message-lines'\n\n// What a chat message leaves as typed: headings, rules, tables, link definitions and indented code, which a message\n// rarely means; code blocks come only from ``` fences\nconst asTyped = () => undefined\n\n// A link whose text names another address than the link's, marked before mentions turn its text into markup\ntype CheckedLink = Tokens.Link & { misleading?: boolean }\n\n// Text as it reads, with all formatting inside it flattened\nconst plainText = (tokens: Token[]): string =>\n tokens.map((token) => ('tokens' in token && token.tokens ? plainText(token.tokens) : 'text' in token ? token.text : '')).join('')\n\nconst marked = new Marked({\n gfm: true,\n // A line break in the text is one on the page, as in a chat message\n breaks: true,\n tokenizer: { heading: asTyped, lheading: asTyped, hr: asTyped, table: asTyped, def: asTyped, code: asTyped },\n renderer: {\n // Raw HTML shows as the text it is, never as markup\n html: ({ text, block }: Tokens.HTML | Tokens.Tag) => (block ? `<p>${escapeHtml(text)}</p>` : escapeHtml(text)),\n link({ href, title, tokens, misleading }: CheckedLink) {\n const text = this.parser.parseInline(tokens)\n const address = safeAddress(href, linkSchemes)\n if (address === null) return text\n // Text naming another address than the link's shows the link's own, so it cannot pass for a trusted one\n if (misleading) return newTabLink(address, title, escapeHtml(href))\n return newTabLink(address, title, text)\n },\n // An image shows as the markdown written for it\n image: ({ raw }: Tokens.Image) => escapeHtml(raw),\n },\n})\n\nconst withMentions = (text: string, mentions: readonly { name?: string }[]) =>\n bodyParts(text, mentions)\n .map((part) => ('mention' in part ? `<span class=\"${escapeHtml(mentionClass)}\">@${escapeHtml(part.mention)}</span>` : escapeHtml(part.text)))\n .join('')\n\n/**\n * A message's text as HTML: bold, italic, strikethrough, code, code blocks, lists and quotes, by chat's line rules\n * (`chatLines`), web addresses as links opening in a new tab, and each `@{name}` of someone it mentions picked out,\n * outside code. Raw HTML shows as text and\n * links go only to http(s), mailto and tel addresses or relative ones; the page sanitises the result again.\n */\nexport const messageHtml = (text: string, mentions: readonly { name?: string }[]) => {\n const tokens = marked.lexer(chatLines(text))\n marked.walkTokens(tokens, (token) => {\n // A link is reached before the text inside it\n if (token.type === 'link') (token as CheckedLink).misleading = misleadingLinkText(plainText(token.tokens ?? []), token.href)\n // Bold comes only from `**`, so `__init__` stays as typed\n if (token.type === 'strong' && token.raw.startsWith('__')) Object.assign(token, { type: 'text', text: token.raw, tokens: undefined })\n if (token.type !== 'text' || token.tokens) return\n token.text = withMentions(token.text, mentions)\n token.escaped = true\n })\n return marked.parser(tokens)\n}\n","import { useMemo } from 'react'\nimport DOMPurify from 'dompurify'\nimport { cn } from '../lib/cn'\nimport { messageHtml } from './message-html'\n\n// The parts a message's markdown makes, close together as in a chat with a line's gap between paragraphs, in the theme's colours; code wraps rather than scrolls\nconst message = cn(\n 'break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0',\n '[&_p]:my-2 [&_ul]:my-1 [&_ol]:my-1 [&_pre]:my-1 [&_blockquote]:my-1',\n '[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_li:has(>input)]:list-none [&_li>input]:mr-1.5 [&_li>input]:-ml-5 [&_li>input]:align-middle',\n '[&_a]:text-primary-text [&_a]:underline [&_a]:underline-offset-2 hover:[&_a]:text-primary-hover',\n '[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.9em]',\n '[&_pre]:whitespace-pre-wrap [&_pre]:rounded-md [&_pre]:bg-muted [&_pre]:p-3 [&_pre_code]:bg-transparent [&_pre_code]:p-0',\n '[&_blockquote]:border-l-2 [&_blockquote]:border-border-strong [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground [&_del]:text-muted-foreground',\n)\n\nexport type MessageContentProps = { text: string; mentions: readonly { name?: string }[] }\n\n/** A message's text with its markdown and mentions rendered, sanitised before it reaches the page. */\nexport const MessageContent = ({ text, mentions }: MessageContentProps) => {\n const html = useMemo(() => DOMPurify.sanitize(messageHtml(text, mentions), { ADD_ATTR: ['target'] }), [text, mentions])\n return <div className={message} dangerouslySetInnerHTML={{ __html: html }} />\n}\n"],"mappings":"6xBACMmB,EAAc,0FAEdC,EAAU,GAAoB,CAClC,GAAK,IAAI,SAASC,CAAO,EACzB,OAAO,IAAI,IAAIA,CAAO,CAAC,CAAC,SAAS,YAAY,CAC/C,EAMaC,GAAsB,EAAc,IAAiB,CAChE,IAAMC,EAAQJ,EAAY,KAAKK,EAAK,KAAK,CAAC,CAAC,GAAG,GAC9C,GAAI,CAACD,EAAO,MAAO,GAEnB,IAAME,EAAYL,EAAO,UAAUG,GAAO,EAE1C,MADA,CAAKE,GACEL,EAAOM,CAAI,IAAMD,CAC1B,ECdME,EAAQ,iCAERC,GAAe,EAAc,IAAqB,OAAO,UAAUC,EAAK,UAAU,CAAC,CAAC,KAAKC,CAAI,EAC7FC,EAAQ,WACRC,EAAe,wBACfC,EAAW,sCACXC,EAAO,qCACPC,EAAW,SAEXC,EAAY,WAGLC,EAAa,GAAiB,CACzC,IAAMC,EAAkB,CAAC,EACrBC,EACAC,EAAU,GACd,IAAK,IAAMV,KAAQN,EAAK,MAAMY,CAAS,EAAG,CACxC,GAAIG,EAAS,CACPX,EAAYE,EAAMS,CAAO,IAAG,EAAU,IAAA,IAC1CD,EAAM,KAAKR,CAAI,EACf,QACF,CACA,I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urify","n","a","t","__toESM","require_react","require_jsx_runtime","bodyParts","cn","mentionClass","purify_default","U","safeAddress","newTabLink","linkSchemes","escapeHtml","import_react","addressLike","hostOf","address","misleadingLinkText","named","text","namedHost","href","fence","closesFence","open","line","quote","quoteAsTyped","listItem","rule","indented","lineBreak","chatLines","lines","inFence","inBlock","marker","typed","match","blank","opensBlock","asTyped","plainText","tokens","token","marked","block","misleading","title","raw","withMentions","mentions","part","messageHtml","import_jsx_runtime","message","MessageContent","html"],"sources":["../../../src/mentions/link-text.ts","../../../src/mentions/message-lines.ts","../../../src/mentions/message-html.ts","../../../src/mentions/message-content.tsx"],"sourcesContent":["// Link text that reads as a web address: a scheme, `www.` or a dotted host, then a path, query or nothing\nconst addressLike = /^(?:[a-z][a-z0-9+.-]*:\\/\\/)?((?:[\\p{L}\\p{N}-]+\\.)+[\\p{L}]{2,})(?::\\d+)?(?:[/?#]\\S*)?$/iu\n\nconst hostOf = (address: string) => {\n if (!URL.canParse(address)) return\n return new URL(address).hostname.toLowerCase()\n}\n\n/**\n * Whether a link's text names a web address on another host than the link opens, such as\n * `[https://example.com](https://elsewhere.example)`, so the reader would be misled about where it goes.\n */\nexport const misleadingLinkText = (text: string, href: string) => {\n const named = addressLike.exec(text.trim())?.[1]\n if (!named) return false\n // A name no browser takes as a host, such as one mixing writing directions, may still read as one: show the link's own\n const namedHost = hostOf(`http://${named}`)\n if (!namedHost) return true\n return hostOf(href) !== namedHost\n}\n","// Markdown's line rules that chat habits beat, applied line by line outside code fences:\n// - a line under a quote or a list item that is neither starts a block of its own, rather than joining it lazily;\n// - a quote needs `> ` with a space, so `>5 failed logins` stays as typed;\n// - a `---` or `___` line under text stays a line of that text.\n// A backtick fence's info string holds no backtick, so ```inline``` is code within a line\nconst fence = /^ {0,3}(`{3,}(?=[^`]*$)|~{3,})/\n// A fence closes on a line of its marker, at least as long, and nothing after it but spaces\nconst closesFence = (line: string, open: string) => new RegExp(`^ {0,3}${open}[~\\`]* *$`).test(line)\nconst quote = /^ {0,3}>/\nconst quoteAsTyped = /^( {0,3})>(?=[^ \\t>])/\nconst listItem = /^ {0,3}([-*+]|\\d{1,9}[.)])([ \\t]|$)/\nconst rule = /^ {0,3}([-_])[ \\t]*(\\1[ \\t]*){2,}$/\nconst indented = /^[ \\t]/\n// Text from the API or an import can end its lines with `\\r\\n` or a lone `\\r`\nconst lineBreak = /\\r\\n?|\\n/\n\n/** A message's text with the chat line rules above made explicit for the markdown parser. */\nexport const chatLines = (text: string) => {\n const lines: string[] = []\n let inFence: string | undefined\n let inBlock = false\n for (const line of text.split(lineBreak)) {\n if (inFence) {\n if (closesFence(line, inFence)) inFence = undefined\n lines.push(line)\n continue\n }\n const marker = fence.exec(line)?.[1]\n if (marker) {\n inFence = marker\n inBlock = false\n lines.push(line)\n continue\n }\n const typed = line.replace(quoteAsTyped, '$1\\\\>').replace(rule, (match) => match.replace(/^ */, '$&\\\\'))\n const blank = typed.trim() === ''\n const opensBlock = quote.test(typed) || listItem.test(typed)\n if (inBlock && !blank && !opensBlock && !indented.test(typed)) lines.push('')\n inBlock = opensBlock || (inBlock && !blank && indented.test(typed))\n lines.push(typed)\n }\n return lines.join('\\n')\n}\n","import { Marked, type Token, type Tokens } from 'marked'\nimport { escapeHtml, linkSchemes, newTabLink, safeAddress } from '../markdown/safe-html'\nimport { misleadingLinkText } from './link-text'\nimport { bodyParts, mentionClass } from './mention-text'\nimport { chatLines } from './message-lines'\n\n// What a chat message leaves as typed: headings, rules, tables, link definitions and indented code, which a message\n// rarely means; code blocks come only from ``` fences\nconst asTyped = () => undefined\n\n// A link whose text names another address than the link's, marked before mentions turn its text into markup\ntype CheckedLink = Tokens.Link & { misleading?: boolean }\n\n// Text as it reads, with all formatting inside it flattened\nconst plainText = (tokens: Token[]): string =>\n tokens.map((token) => ('tokens' in token && token.tokens ? plainText(token.tokens) : 'text' in token ? token.text : '')).join('')\n\nconst marked = new Marked({\n gfm: true,\n // A line break in the text is one on the page, as in a chat message\n breaks: true,\n tokenizer: { heading: asTyped, lheading: asTyped, hr: asTyped, table: asTyped, def: asTyped, code: asTyped },\n renderer: {\n // Raw HTML shows as the text it is, never as markup\n html: ({ text, block }: Tokens.HTML | Tokens.Tag) => (block ? `<p>${escapeHtml(text)}</p>` : escapeHtml(text)),\n link({ href, title, tokens, misleading }: CheckedLink) {\n const text = this.parser.parseInline(tokens)\n const address = safeAddress(href, linkSchemes)\n if (address === null) return text\n // Text naming another address than the link's shows the link's own, so it cannot pass for a trusted one\n if (misleading) return newTabLink(address, title, escapeHtml(href))\n return newTabLink(address, title, text)\n },\n // An image shows as the markdown written for it\n image: ({ raw }: Tokens.Image) => escapeHtml(raw),\n },\n})\n\nconst withMentions = (text: string, mentions: readonly { name?: string }[]) =>\n bodyParts(text, mentions)\n .map((part) => ('mention' in part ? `<span class=\"${escapeHtml(mentionClass)}\">@${escapeHtml(part.mention)}</span>` : escapeHtml(part.text)))\n .join('')\n\n/**\n * A message's text as HTML: bold, italic, strikethrough, code, code blocks, lists and quotes, by chat's line rules\n * (`chatLines`), web addresses as links opening in a new tab, and each `@{name}` of someone it mentions picked out,\n * outside code. Raw HTML shows as text and\n * links go only to http(s), mailto and tel addresses or relative ones; the page sanitises the result again.\n */\nexport const messageHtml = (text: string, mentions: readonly { name?: string }[]) => {\n const tokens = marked.lexer(chatLines(text))\n marked.walkTokens(tokens, (token) => {\n // A link is reached before the text inside it\n if (token.type === 'link') (token as CheckedLink).misleading = misleadingLinkText(plainText(token.tokens ?? []), token.href)\n // Bold comes only from `**`, so `__init__` stays as typed\n if (token.type === 'strong' && token.raw.startsWith('__')) Object.assign(token, { type: 'text', text: token.raw, tokens: undefined })\n if (token.type !== 'text' || token.tokens) return\n token.text = withMentions(token.text, mentions)\n token.escaped = true\n })\n return marked.parser(tokens)\n}\n","import { useMemo } from 'react'\nimport DOMPurify from 'dompurify'\nimport { cn } from '../lib/cn'\nimport { messageHtml } from './message-html'\n\n// The parts a message's markdown makes, close together as in a chat with a line's gap between paragraphs, in the theme's colours; code wraps rather than scrolls\nconst message = cn(\n 'break-words [&>*:first-child]:mt-0 [&>*:last-child]:mb-0',\n '[&_p]:my-2 [&_ul]:my-1 [&_ol]:my-1 [&_pre]:my-1 [&_blockquote]:my-1',\n '[&_ul]:list-disc [&_ul]:pl-5 [&_ol]:list-decimal [&_ol]:pl-5 [&_li:has(>input)]:list-none [&_li>input]:mr-1.5 [&_li>input]:-ml-5 [&_li>input]:align-middle',\n '[&_a]:text-primary-text [&_a]:underline [&_a]:underline-offset-2 hover:[&_a]:text-primary-hover',\n '[&_code]:rounded [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.9em]',\n '[&_pre]:whitespace-pre-wrap [&_pre]:rounded-md [&_pre]:bg-muted [&_pre]:p-3 [&_pre_code]:bg-transparent [&_pre_code]:p-0',\n '[&_blockquote]:border-l-2 [&_blockquote]:border-border-strong [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground [&_del]:text-muted-foreground',\n)\n\nexport type MessageContentProps = { text: string; mentions: readonly { name?: string }[] }\n\n/** A message's text with its markdown and mentions rendered, sanitised before it reaches the page. */\nexport const MessageContent = ({ text, mentions }: MessageContentProps) => {\n const html = useMemo(() => DOMPurify.sanitize(messageHtml(text, mentions), { ADD_ATTR: ['target'] }), [text, mentions])\n return <div className={message} dangerouslySetInnerHTML={{ __html: html }} />\n}\n"],"mappings":"6xBACMmB,EAAc,0FAEdC,EAAU,GAAoB,CAClC,GAAK,IAAI,SAASC,CAAO,EACzB,OAAO,IAAI,IAAIA,CAAO,CAAC,CAAC,SAAS,YAAY,CAC/C,EAMaC,GAAsB,EAAc,IAAiB,CAChE,IAAMC,EAAQJ,EAAY,KAAKK,EAAK,KAAK,CAAC,CAAC,GAAG,GAC9C,GAAI,CAACD,EAAO,MAAO,GAEnB,IAAME,EAAYL,EAAO,UAAUG,GAAO,EAE1C,MADA,CAAKE,GACEL,EAAOM,CAAI,IAAMD,CAC1B,ECdME,EA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AE,OAAM,cAAoC,CACzE,IAAMC,GAAA,EAAO7D,EAAAA,QAAAA,KAAcC,EAAU,SAASwD,EAAYlC,EAAMgC,CAAQ,EAAG,CAAE,SAAU,CAAC,QAAQ,CAAE,CAAC,EAAG,CAAChC,EAAMgC,CAAQ,CAAC,EACtH,OAAO,EAAAG,EAAA,IAAA,CAAC,MAAD,CAAK,UAAWC,EAAS,wBAAyB,CAAE,OAAQE,CAAK,CAAI,CAAA,CAC9E","debugId":"ba95df97-b12d-4e29-9fdc-1c261583ac79"}
@@ -1 +1 @@
1
- {"version":3,"file":"messages-XnV72On0.js","names":["text","text","n","a","t","encodeKey","parseSort","recordTitle","recordKey","printFilter","can","isApiError","messages","refusalReason","where","writablePosition","position","model","permissions","field","listHandOrder","relatedHandOrder","item","dragsRank","view","filter","sort","orderBy","text$1","moveRefusal","error","fallback","title","undoOps","writes","changed","fields","before","record","everyRecord","records","pageToken","page","client","resource","narrowed","extra","rankBounds","after","id","self","encoded","value","links","other","link","from","to","dependsOn","dependents","pending","waiting","bound","key","found","selfPending","anchoredMove","keyAt","order","at","unknown","more","index","numberedBefore","written","results","entry","idOf","text"],"sources":["../../../src/app/hand-order/hand-order.ts","../../../src/app/hand-order/messages.ts","../../../src/app/hand-order/move-refusal.ts","../../../src/app/hand-order/undo-ops.ts","../../../src/app/rank-after/rank-bounds.ts","../../../src/app/hand-order/anchored-move.ts","../../../src/app/hand-order/numbered-before.ts","../../../src/app/rank-after/messages.ts"],"sourcesContent":["import type { ResourcePermissions } from '@protobase/client'\nimport type { RelatedModel, ResourceModel, ViewModel } from '@protobase/schema'\nimport { parseSort } from '../list-order'\nimport { can } from '../permissions'\n\n/** The records loaded per request to reorder them by hand, the list API's largest page; all pages load. */\nexport const handOrderPage = 500\n\n/** The field a user may sort `model`'s records by hand in: its `position`, when they may update it. */\nconst writablePosition = (model: ResourceModel, permissions: ResourcePermissions) => {\n const position = model.position\n if (!position || !can(permissions, 'update')) return undefined\n const field = model.fields[position.field]\n return field && !field.readOnly ? position.field : undefined\n}\n\n/**\n * The field the list page sorts all of `model`'s records by hand in. A resource whose records are ordered within a\n * parent is sorted in the parent's related section instead, since its list mixes the parents.\n */\nexport const listHandOrder = (model: ResourceModel, permissions: ResourcePermissions) =>\n model.position?.within === undefined ? writablePosition(model, permissions) : undefined\n\n/**\n * The field a related section sorts its records by hand in: those of one parent, when the section lists every record\n * whose `within` relation points at the page's record, no filter or join resource leaving some out.\n */\nexport const relatedHandOrder = (item: RelatedModel, model: ResourceModel, permissions: ResourcePermissions) =>\n model.position?.within !== undefined && item.field === model.position.within && !item.through && !item.from && !item.filter ? writablePosition(model, permissions) : undefined\n\n/**\n * Whether the list page's table moves its rows by dragging at any time, without **Reorder**: its list turns\n * `drag.rank` on, and it shows every record in the order of `field`, from `listHandOrder`, without a filter or search.\n */\nexport const dragsRank = (view: ViewModel | undefined, field: string | undefined, orderBy: string, filter: string) => {\n if (field === undefined || view?.list?.drag?.rank !== true || filter !== '') return false\n const sort = parseSort(orderBy)\n return sort.columnId === field && sort.direction === 'asc'\n}\n","import { messages } from '../../locale/messages'\n\nexport const text = messages('app/hand-order')\n","import { isApiError } from '@protobase/client'\nimport { refusalReason } from '../displays/board-columns'\nimport { text } from './messages'\n\n/** What was refused: a move of the record titled `title`, or an undo (no title), on a list or a board. */\nexport type Refused = { title?: string | undefined; place: 'list' | 'board' }\n\n/**\n * The toast of a refused move or undo. When the order changed where it was dropped (412), a warning that it was not\n * saved and that the list, which reloads by itself, shows the current order; otherwise an error with `fallback` and the\n * server's reason.\n */\nexport const moveRefusal = (error: unknown, fallback: string, { title, place }: Refused) => {\n if (!isApiError(error) || error.status !== 412) return { state: 'error' as const, title: fallback, description: refusalReason(error) }\n if (title === undefined) return { state: 'warning' as const, title: fallback, description: text('orderChangedSince', { place }) }\n return { state: 'warning' as const, title: text('notSaved', { title }), description: text('orderChangedThere', { place }) }\n}\n","import type { BatchOp } from '@protobase/client'\nimport type { ResourceModel } from '@protobase/schema'\nimport { recordKey } from '../../live/model-helpers'\n\n/** A record a drag saved: its values before the drag, and the record and ETag the server gave back. */\nexport type DragWrite = { before: Record<string, unknown>; record: Record<string, unknown>; etag: string }\n\n/**\n * The batch that undoes a drag: an update of each record it saved putting back those of `fields` it changed, with the\n * ETag the save gave it, so a record changed again since is refused rather than overwritten.\n */\nexport const undoOps = (model: ResourceModel, writes: DragWrite[], fields: string[]): BatchOp[] =>\n writes.flatMap(({ before, record, etag }) => {\n const changed = fields.filter((field) => Object.hasOwn(before, field) && before[field] !== record[field])\n if (changed.length === 0) return []\n return [{ op: 'update', resource: model.name, key: recordKey(model, record), data: Object.fromEntries(changed.map((field) => [field, before[field]])), etag }]\n })\n","import type { Client } from '@protobase/client'\nimport { printFilter, where, type ResourceModel, type ViewModel } from '@protobase/schema'\nimport { encodeKey } from '@protobase/schema/internal'\nimport { recordKey, recordTitle } from '../../live/model-helpers'\n\n/** A record a re-ranked record must stay below or above: its key as the API encodes it, its rank and its title. */\nexport type RankBound = { key: string; rank: unknown; title: string }\n\n/**\n * What a re-ranked record must keep to, by its position's `after`: `after`, the pending records it depends on, which it\n * must rank below; `before`, the records that depend on it while it is pending, which must rank below it.\n */\nexport type RankBounds = { after: RankBound[]; before: RankBound[] }\n\n// A record's dependencies are few, but all of them count\nconst everyRecord = async (client: Client, resource: string, filter: string) => {\n const records: Record<string, unknown>[] = []\n let pageToken = ''\n do {\n const page = await client.search(resource, { filter, pageSize: 100, ...(pageToken && { pageToken }) })\n records.push(...page.items)\n pageToken = page.nextPageToken\n } while (pageToken)\n return records\n}\n\nconst narrowed = (filter: string, extra: string | undefined) => (extra === undefined ? filter : `(${filter}) AND (${extra})`)\n\n/**\n * The records `record` must rank between, through the list API: the join records that hold its key on either side,\n * then the records they name, those it depends on narrowed to the pending ones. Without `after` on the resource's\n * position there are none.\n */\nexport const rankBounds = async (client: Client, model: ResourceModel, view: ViewModel | undefined, record: Record<string, unknown>): Promise<RankBounds> => {\n const after = model.position?.after\n if (!after) return { after: [], before: [] }\n const id = model.primaryKey[0]!\n // `after` takes a key of one field\n const self = recordKey(model, record) as string | number\n const encoded = (value: unknown) => encodeKey([value as string | number])\n const links = await everyRecord(client, after.resource, narrowed(printFilter(where.or(where.eq(after.field, self), where.eq(after.key, self))), after.filter))\n const other = (from: string, to: string) => links.flatMap((link) => (encoded(link[from]) === encoded(self) && encoded(link[to]) !== encoded(self) ? [link[to] as string | number] : []))\n const dependsOn = other(after.field, after.key)\n const dependents = other(after.key, after.field)\n\n const [pending, waiting] = await Promise.all([\n everyRecord(client, model.name, narrowed(printFilter(where.in(id, [self, ...dependsOn])), after.while)),\n dependents.length === 0 ? [] : everyRecord(client, model.name, printFilter(where.in(id, dependents))),\n ])\n const bound = (found: Record<string, unknown>): RankBound => {\n const key = encodeKey(recordKey(model, found))\n return { key, rank: found[model.position!.field], title: recordTitle(model, view, found, key) }\n }\n const selfPending = pending.some((found) => encoded(found[id]) === encoded(self))\n return { after: pending.filter((found) => encoded(found[id]) !== encoded(self)).map(bound), before: selfPending ? waiting.map(bound) : [] }\n}\n","import type { BatchOp } from '@protobase/client'\nimport type { ResourceModel } from '@protobase/schema'\nimport { recordKey } from '../../live/model-helpers'\n\n/**\n * The `move` that saves the record at `index` of `order`, the list as shown once it was dropped: anchored to the record\n * above it and the one below, so it saves while the record after that anchor is still the one below, whatever else\n * changed. `filter` is the list's, so the server reads the same list. With `more` records after `order` not loaded, a\n * record dropped last does not know the one below it, so only its anchor is checked.\n */\nexport const anchoredMove = (model: ResourceModel, field: string, filter: string, order: Record<string, unknown>[], index: number, more = false): BatchOp => {\n const keyAt = (at: number) => (order[at] ? recordKey(model, order[at]) : null)\n const unknown = more && index === order.length - 1\n return { op: 'move', resource: model.name, field, key: recordKey(model, order[index]!), after: keyAt(index - 1), ...(!unknown && { before: keyAt(index + 1) }), ...(filter && { filter }) }\n}\n","import type { BatchResult } from '@protobase/client'\n\n/**\n * The value of the order field each record numbered by a batch's `reorder` and `move` operations had before the first\n * of them, as the server had it, by `idOf` the record: what an undo puts back, rather than the order the list loaded with.\n */\nexport const numberedBefore = (results: BatchResult['results'], idOf: (record: Record<string, unknown>) => string) => {\n const before = new Map<string, unknown>()\n for (const written of results) {\n if (written.op !== 'reorder' && written.op !== 'move') continue\n for (const entry of written.records) {\n const id = idOf(entry.record)\n if (!before.has(id)) before.set(id, entry.previous)\n }\n }\n return before\n}\n","import { messages } from '../../locale/messages'\n\nexport const text = messages('app/rank-after')\n"],"mappings":"skBASA,IAAMe,GAAoB,EAAsB,IAAqC,CACnF,IAAMC,EAAWC,EAAM,SACvB,GAAI,CAACD,GAAY,CAACN,EAAIQ,EAAa,QAAQ,EAAG,OAC9C,IAAMC,EAAQF,EAAM,OAAOD,EAAS,OACpC,OAAOG,GAAS,CAACA,EAAM,SAAWH,EAAS,MAAQ,IAAA,EACrD,EAMaI,GAAiB,EAAsB,IAClDH,EAAM,UAAU,SAAW,IAAA,GAAYF,EAAiBE,EAAOC,CAAW,EAAI,IAAA,GAMnEG,GAAoB,EAAoB,EAAsB,IACzEJ,EAAM,UAAU,SAAW,IAAA,IAAaK,EAAK,QAAUL,EAAM,SAAS,QAAU,CAACK,EAAK,SAAW,CAACA,EAAK,MAAQ,CAACA,EAAK,OAASP,EAAiBE,EAAOC,CAAW,EAAI,IAAA,GAM1JK,GAAa,EAA6B,EAA2B,EAAiB,IAAmB,CACpH,GAAIJ,IAAU,IAAA,IAAaK,GAAM,MAAM,MAAM,OAAS,IAAQC,IAAW,GAAI,MAAO,GACpF,IAAMC,EAAOpB,EAAUqB,CAAO,EAC9B,OAAOD,EAAK,WAAaP,GAASO,EAAK,YAAc,KACvD,ECpCa1B,EAAOY,EAAS,gBAAgB,ECUhCiB,GAAe,EAAgB,EAAkB,CAAE,QAAO,WACjE,CAAClB,EAAWmB,CAAK,GAAKA,EAAM,SAAW,IAAY,CAAE,MAAO,QAAkB,MAAOC,EAAU,YAAalB,EAAciB,CAAK,CAAE,EACjIE,IAAU,IAAA,GAAkB,CA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AAQ,IAAIC,CAAK,EAAI,CAAC,CAAE,CAC5I,EC7CaI,GAAgB,EAAsB,EAAe,EAAgB,EAAkC,EAAe,EAAO,KAAmB,CAC3J,IAAMC,EAAS,GAAgBC,EAAMC,GAAM7D,EAAUS,EAAOmD,EAAMC,EAAG,EAAI,KACnEC,EAAUC,GAAQC,IAAUJ,EAAM,OAAS,EACjD,MAAO,CAAE,GAAI,OAAQ,SAAUnD,EAAM,KAAM,QAAO,IAAKT,EAAUS,EAAOmD,EAAMI,EAAO,EAAG,MAAOL,EAAMK,EAAQ,CAAC,EAAG,GAAI,CAACF,GAAW,CAAE,OAAQH,EAAMK,EAAQ,CAAC,CAAE,EAAI,GAAI/C,GAAU,CAAE,QAAO,CAAG,CAC5L,ECRagD,GAAkB,EAAiC,IAAsD,CACpH,IAAMpC,EAAS,IAAI,IACnB,IAAK,IAAMqC,KAAWC,EACpB,GAAID,EAAQ,KAAO,WAAaA,EAAQ,KAAO,OAC/C,IAAK,IAAME,KAASF,EAAQ,QAAS,CACnC,IAAMzB,EAAK4B,EAAKD,EAAM,MAAM,EACvBvC,EAAO,IAAIY,CAAE,GAAGZ,EAAO,IAAIY,EAAI2B,EAAM,QAAQ,CACpD,CAEF,OAAOvC,CACT,ECdayC,EAAOlE,EAAS,gBAAgB","debugId":"179d5ef6-3a7d-49b4-a2f7-9ee80b493ee5"}
1
+ {"version":3,"file":"messages-CWURrUB-.js","names":["text","text","n","a","t","encodeKey","parseSort","recordTitle","recordKey","printFilter","can","isApiError","messages","refusalReason","where","writablePosition","position","model","permissions","field","listHandOrder","relatedHandOrder","item","dragsRank","view","filter","sort","orderBy","text$1","moveRefusal","error","fallback","title","undoOps","writes","changed","fields","before","record","everyRecord","records","pageToken","page","client","resource","narrowed","extra","rankBounds","after","id","self","encoded","value","links","other","link","from","to","dependsOn","dependents","pending","waiting","bound","key","found","selfPending","anchoredMove","keyAt","order","at","unknown","more","index","numberedBefore","written","results","entry","idOf","text"],"sources":["../../../src/app/hand-order/hand-order.ts","../../../src/app/hand-order/messages.ts","../../../src/app/hand-order/move-refusal.ts","../../../src/app/hand-order/undo-ops.ts","../../../src/app/rank-after/rank-bounds.ts","../../../src/app/hand-order/anchored-move.ts","../../../src/app/hand-order/numbered-before.ts","../../../src/app/rank-after/messages.ts"],"sourcesContent":["import type { ResourcePermissions } from '@protobase/client'\nimport type { RelatedModel, ResourceModel, ViewModel } from '@protobase/schema'\nimport { parseSort } from '../list-order'\nimport { can } from '../permissions'\n\n/** The records loaded per request to reorder them by hand, the list API's largest page; all pages load. */\nexport const handOrderPage = 500\n\n/** The field a user may sort `model`'s records by hand in: its `position`, when they may update it. */\nconst writablePosition = (model: ResourceModel, permissions: ResourcePermissions) => {\n const position = model.position\n if (!position || !can(permissions, 'update')) return undefined\n const field = model.fields[position.field]\n return field && !field.readOnly ? position.field : undefined\n}\n\n/**\n * The field the list page sorts all of `model`'s records by hand in. A resource whose records are ordered within a\n * parent is sorted in the parent's related section instead, since its list mixes the parents.\n */\nexport const listHandOrder = (model: ResourceModel, permissions: ResourcePermissions) =>\n model.position?.within === undefined ? writablePosition(model, permissions) : undefined\n\n/**\n * The field a related section sorts its records by hand in: those of one parent, when the section lists every record\n * whose `within` relation points at the page's record, no filter or join resource leaving some out.\n */\nexport const relatedHandOrder = (item: RelatedModel, model: ResourceModel, permissions: ResourcePermissions) =>\n model.position?.within !== undefined && item.field === model.position.within && !item.through && !item.from && !item.filter ? writablePosition(model, permissions) : undefined\n\n/**\n * Whether the list page's table moves its rows by dragging at any time, without **Reorder**: its list turns\n * `drag.rank` on, and it shows every record in the order of `field`, from `listHandOrder`, without a filter or search.\n */\nexport const dragsRank = (view: ViewModel | undefined, field: string | undefined, orderBy: string, filter: string) => {\n if (field === undefined || view?.list?.drag?.rank !== true || filter !== '') return false\n const sort = parseSort(orderBy)\n return sort.columnId === field && sort.direction === 'asc'\n}\n","import { messages } from '../../locale/messages'\n\nexport const text = messages('app/hand-order')\n","import { isApiError } from '@protobase/client'\nimport { refusalReason } from '../displays/board-columns'\nimport { text } from './messages'\n\n/** What was refused: a move of the record titled `title`, or an undo (no title), on a list or a board. */\nexport type Refused = { title?: string | undefined; place: 'list' | 'board' }\n\n/**\n * The toast of a refused move or undo. When the order changed where it was dropped (412), a warning that it was not\n * saved and that the list, which reloads by itself, shows the current order; otherwise an error with `fallback` and the\n * server's reason.\n */\nexport const moveRefusal = (error: unknown, fallback: string, { title, place }: Refused) => {\n if (!isApiError(error) || error.status !== 412) return { state: 'error' as const, title: fallback, description: refusalReason(error) }\n if (title === undefined) return { state: 'warning' as const, title: fallback, description: text('orderChangedSince', { place }) }\n return { state: 'warning' as const, title: text('notSaved', { title }), description: text('orderChangedThere', { place }) }\n}\n","import type { BatchOp } from '@protobase/client'\nimport type { ResourceModel } from '@protobase/schema'\nimport { recordKey } from '../../live/model-helpers'\n\n/** A record a drag saved: its values before the drag, and the record and ETag the server gave back. */\nexport type DragWrite = { before: Record<string, unknown>; record: Record<string, unknown>; etag: string }\n\n/**\n * The batch that undoes a drag: an update of each record it saved putting back those of `fields` it changed, with the\n * ETag the save gave it, so a record changed again since is refused rather than overwritten.\n */\nexport const undoOps = (model: ResourceModel, writes: DragWrite[], fields: string[]): BatchOp[] =>\n writes.flatMap(({ before, record, etag }) => {\n const changed = fields.filter((field) => Object.hasOwn(before, field) && before[field] !== record[field])\n if (changed.length === 0) return []\n return [{ op: 'update', resource: model.name, key: recordKey(model, record), data: Object.fromEntries(changed.map((field) => [field, before[field]])), etag }]\n })\n","import type { Client } from '@protobase/client'\nimport { printFilter, where, type ResourceModel, type ViewModel } from '@protobase/schema'\nimport { encodeKey } from '@protobase/schema/internal'\nimport { recordKey, recordTitle } from '../../live/model-helpers'\n\n/** A record a re-ranked record must stay below or above: its key as the API encodes it, its rank and its title. */\nexport type RankBound = { key: string; rank: unknown; title: string }\n\n/**\n * What a re-ranked record must keep to, by its position's `after`: `after`, the pending records it depends on, which it\n * must rank below; `before`, the records that depend on it while it is pending, which must rank below it.\n */\nexport type RankBounds = { after: RankBound[]; before: RankBound[] }\n\n// A record's dependencies are few, but all of them count\nconst everyRecord = async (client: Client, resource: string, filter: string) => {\n const records: Record<string, unknown>[] = []\n let pageToken = ''\n do {\n const page = await client.search(resource, { filter, pageSize: 100, ...(pageToken && { pageToken }) })\n records.push(...page.items)\n pageToken = page.nextPageToken\n } while (pageToken)\n return records\n}\n\nconst narrowed = (filter: string, extra: string | undefined) => (extra === undefined ? filter : `(${filter}) AND (${extra})`)\n\n/**\n * The records `record` must rank between, through the list API: the join records that hold its key on either side,\n * then the records they name, those it depends on narrowed to the pending ones. Without `after` on the resource's\n * position there are none.\n */\nexport const rankBounds = async (client: Client, model: ResourceModel, view: ViewModel | undefined, record: Record<string, unknown>): Promise<RankBounds> => {\n const after = model.position?.after\n if (!after) return { after: [], before: [] }\n const id = model.primaryKey[0]!\n // `after` takes a key of one field\n const self = recordKey(model, record) as string | number\n const encoded = (value: unknown) => encodeKey([value as string | number])\n const links = await everyRecord(client, after.resource, narrowed(printFilter(where.or(where.eq(after.field, self), where.eq(after.key, self))), after.filter))\n const other = (from: string, to: string) => links.flatMap((link) => (encoded(link[from]) === encoded(self) && encoded(link[to]) !== encoded(self) ? [link[to] as string | number] : []))\n const dependsOn = other(after.field, after.key)\n const dependents = other(after.key, after.field)\n\n const [pending, waiting] = await Promise.all([\n everyRecord(client, model.name, narrowed(printFilter(where.in(id, [self, ...dependsOn])), after.while)),\n dependents.length === 0 ? [] : everyRecord(client, model.name, printFilter(where.in(id, dependents))),\n ])\n const bound = (found: Record<string, unknown>): RankBound => {\n const key = encodeKey(recordKey(model, found))\n return { key, rank: found[model.position!.field], title: recordTitle(model, view, found, key) }\n }\n const selfPending = pending.some((found) => encoded(found[id]) === encoded(self))\n return { after: pending.filter((found) => encoded(found[id]) !== encoded(self)).map(bound), before: selfPending ? waiting.map(bound) : [] }\n}\n","import type { BatchOp } from '@protobase/client'\nimport type { ResourceModel } from '@protobase/schema'\nimport { recordKey } from '../../live/model-helpers'\n\n/**\n * The `move` that saves the record at `index` of `order`, the list as shown once it was dropped: anchored to the record\n * above it and the one below, so it saves while the record after that anchor is still the one below, whatever else\n * changed. `filter` is the list's, so the server reads the same list. With `more` records after `order` not loaded, a\n * record dropped last does not know the one below it, so only its anchor is checked.\n */\nexport const anchoredMove = (model: ResourceModel, field: string, filter: string, order: Record<string, unknown>[], index: number, more = false): BatchOp => {\n const keyAt = (at: number) => (order[at] ? recordKey(model, order[at]) : null)\n const unknown = more && index === order.length - 1\n return { op: 'move', resource: model.name, field, key: recordKey(model, order[index]!), after: keyAt(index - 1), ...(!unknown && { before: keyAt(index + 1) }), ...(filter && { filter }) }\n}\n","import type { BatchResult } from '@protobase/client'\n\n/**\n * The value of the order field each record numbered by a batch's `reorder` and `move` operations had before the first\n * of them, as the server had it, by `idOf` the record: what an undo puts back, rather than the order the list loaded with.\n */\nexport const numberedBefore = (results: BatchResult['results'], idOf: (record: Record<string, unknown>) => string) => {\n const before = new Map<string, unknown>()\n for (const written of results) {\n if (written.op !== 'reorder' && written.op !== 'move') continue\n for (const entry of written.records) {\n const id = idOf(entry.record)\n if (!before.has(id)) before.set(id, entry.previous)\n }\n }\n return before\n}\n","import { messages } from '../../locale/messages'\n\nexport const text = messages('app/rank-after')\n"],"mappings":"skBASA,IAAMe,GAAoB,EAAsB,IAAqC,CACnF,IAAMC,EAAWC,EAAM,SACvB,GAAI,CAACD,GAAY,CAACN,EAAIQ,EAAa,QAAQ,EAAG,OAC9C,IAAMC,EAAQF,EAAM,OAAOD,EAAS,OACpC,OAAOG,GAAS,CAACA,EAAM,SAAWH,EAAS,MAAQ,IAAA,EACrD,EAMaI,GAAiB,EAAsB,IAClDH,EAAM,UAAU,SAAW,IAAA,GAAYF,EAAiBE,EAAOC,CAAW,EAAI,IAAA,GAMnEG,GAAoB,EAAoB,EAAsB,IACzEJ,EAAM,UAAU,SAAW,IAAA,IAAaK,EAAK,QAAUL,EAAM,SAAS,QAAU,CAACK,EAAK,SA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2B,EAAM,QAAQ,CACpD,CAEF,OAAOvC,CACT,ECdayC,EAAOlE,EAAS,gBAAgB","debugId":"96511ad4-07e8-4040-9d87-cc03c57338ee"}
@@ -1 +1 @@
1
- {"version":3,"file":"organization-page-Cdfaqvsh.js","names":["useState","_Fragment","n","a","t","__toESM","require_react","require_jsx_runtime","useMeta","text","useOrganizationText","useAuth","useClient","Switch","Button","reopenIn","Input","AccountSection","organizationRoleLabel","useAction","Dialog","SectionError","managesOrganization","PageHeader","import_react","import_jsx_runtime","Details","name","setName","organization","slug","setSlug","changed","editable","error","event","run","session","onSaved","busy","HandOver","members","setMembers","target","setTarget","list","member","memberId","Delete","confirming","setConfirming","typed","setTyped","remove","basePath","GuestLinks","client","allowed","setAllowed","next","Leave","owner","OrganizationPage","calls","current","onChanged"],"sources":["../../../src/organizations/organization-page.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport type { CurrentOrganization, OrganizationMember } from '@protobase/client'\nimport { AccountSection, SectionError } from '../account/account-section'\nimport { PageHeader } from '../app-shell'\nimport { useAuth } from '../auth/auth-provider'\nimport { Button } from '../primitives/button'\nimport { Dialog } from '../primitives/dialog'\nimport { Input } from '../primitives/input'\nimport { Switch } from '../primitives/switch'\nimport { useClient } from '../data/api-provider'\nimport { useMeta } from '../data/use-meta'\nimport { managesOrganization, organizationRoleLabel } from './organization-paths'\nimport { useAction } from './use-action'\nimport { reopenIn } from './use-organizations'\nimport { text } from './messages'\nimport { useOrganizationText } from './organization-word'\n\ntype Organization = NonNullable<CurrentOrganization['organization']>\n\nconst Details = ({ organization, editable, onSaved }: { organization: Organization; editable: boolean; onSaved: () => void }) => {\n const { session } = useAuth()\n const [name, setName] = useState(organization.name)\n const [slug, setSlug] = useState(organization.slug)\n const { busy, error, run } = useAction()\n const changed = name.trim() !== organization.name || slug !== organization.slug\n return (\n <AccountSection title={text('details')} description={editable ? text('detailsEditable') : text('detailsReadOnly')}>\n <SectionError message={error} />\n <form className=\"flex flex-col gap-2 sm:flex-row\" onSubmit={(event) => { event.preventDefault(); void run(async () => { await session.organizations.rename(organization.id, { name: name.trim(), slug }); onSaved() }) }}>\n <Input aria-label={text('name')} value={name} disabled={!editable} onChange={(event) => setName(event.target.value)} wrapperClassName=\"flex-1\" />\n <Input aria-label={text('slug')} value={slug} disabled={!editable} onChange={(event) => setSlug(event.target.value)} wrapperClassName=\"sm:w-48\" />\n {editable && <Button type=\"submit\" variant=\"primary\" loading={busy} disabled={!changed || !name.trim()}>{text('save')}</Button>}\n </form>\n </AccountSection>\n )\n}\n\nconst HandOver = ({ organization, memberId }: { organization: Organization; memberId: string }) => {\n const { session } = useAuth()\n const [members, setMembers] = useState<OrganizationMember[]>([])\n const [target, setTarget] = useState('')\n const { busy, error, run } = useAction()\n useEffect(() => {\n void session.organizations.members(organization.id).then((list) => setMembers(list.filter((member) => member.id !== memberId)), () => setMembers([]))\n }, [session, organization.id, memberId])\n return (\n <AccountSection title={text('handOver')} description={text('handOverDescription')}>\n <SectionError message={error} />\n <div className=\"flex flex-col gap-2 sm:flex-row\">\n <select aria-label={text('newOwner')} value={target} onChange={(event) => setTarget(event.target.value)} className=\"h-8 flex-1 rounded-md border border-border-strong bg-background px-2\">\n <option value=\"\">{text('chooseMember')}</option>\n {members.map((member) => <option key={member.id} value={member.id}>{member.name} ({member.email})</option>)}\n </select>\n <Button loading={busy} disabled={!target} onClick={() => void run(async () => { await session.organizations.transferOwnership(target); window.location.reload() })}>{text('handOver')}</Button>\n </div>\n </AccountSection>\n )\n}\n\nconst Delete = ({ organization, basePath }: { organization: Organization; basePath: string }) => {\n const { session } = useAuth()\n const [confirming, setConfirming] = useState(false)\n const [typed, setTyped] = useState('')\n const { busy, error, run } = useAction()\n const t = useOrganizationText()\n const remove = () => run(async () => { await session.organizations.remove(organization.id); reopenIn(basePath) })\n return (\n <AccountSection title={t('deleteOrganization')} description={t('deleteDescription')}>\n <SectionError message={confirming ? undefined : error} />\n <Button variant=\"danger\" onClick={() => setConfirming(true)}>{t('deleteOrganization')}</Button>\n {confirming && (\n <Dialog\n title={text('deleteTitle', { name: organization.name })}\n description={text('deleteConfirm')}\n onClose={() => setConfirming(false)}\n actions={\n <>\n <Button onClick={() => setConfirming(false)}>{text('cancel')}</Button>\n <Button variant=\"danger\" loading={busy} disabled={typed !== organization.name} onClick={() => void remove()}>{text('delete')}</Button>\n </>\n }\n >\n <SectionError message={error} />\n <Input aria-label={t('organizationName')} value={typed} onChange={(event) => setTyped(event.target.value)} />\n </Dialog>\n )}\n </AccountSection>\n )\n}\n\n// Whether the organization's calls take guests, which its owner and admins turn on and off; only in an app with calls.\nconst GuestLinks = ({ editable }: { editable: boolean }) => {\n const client = useClient()\n const [allowed, setAllowed] = useState<boolean>()\n const { busy, error, run } = useAction()\n useEffect(() => {\n void client.callGuests.allowed().then(setAllowed)\n }, [client])\n if (allowed === undefined) return null\n return (\n <AccountSection title={text('guestLinks')} description={text('guestLinksDescription')}>\n <SectionError message={error} />\n <label className=\"flex items-center gap-2 text-sm text-foreground\">\n <Switch\n checked={allowed}\n label={text('guestLinksAllowed')}\n {...(editable && !busy && { onChange: (next: boolean) => void run(async () => { await client.callGuests.setAllowed(next); setAllowed(next) }) })}\n />\n {text('guestLinksAllowed')}\n </label>\n </AccountSection>\n )\n}\n\nconst Leave = ({ organization, basePath, owner }: { organization: Organization; basePath: string; owner: boolean }) => {\n const { session } = useAuth()\n const { busy, error, run } = useAction()\n return (\n <AccountSection title={text('leave')} description={owner ? text('leaveOwner') : text('leaveMember')}>\n <SectionError message={error} />\n <Button loading={busy} onClick={() => void run(async () => { await session.organizations.leave(organization.id); reopenIn(basePath) })}>{text('leaveName', { name: organization.name })}</Button>\n </AccountSection>\n )\n}\n\n/**\n * The organization one works in: its details, whether its calls take guests, and handing it over, leaving and deleting\n * it, as one's role allows.\n */\nexport const OrganizationPage = ({ current, basePath, onChanged }: { current?: CurrentOrganization; basePath: string; onChanged: () => void }) => {\n const calls = useMeta().data?.calls === true\n const t = useOrganizationText()\n const organization = current?.organization\n if (!organization) {\n return (\n <div className=\"mx-auto w-full max-w-3xl px-4 py-6 md:px-6\">\n <PageHeader title={t('organization')} subtitle={t('noOrganization')} />\n </div>\n )\n }\n const owner = current.role === 'owner'\n return (\n <div className=\"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-6 md:px-6\">\n <PageHeader title={organization.name} subtitle={current.role ? text('youAre', { role: organizationRoleLabel(current.role).toLowerCase() }) : text('throughGlobalRoles')} />\n <Details key={`${organization.name}/${organization.slug}`} organization={organization} editable={managesOrganization(current)} onSaved={onChanged} />\n {calls && current.role && <GuestLinks editable={managesOrganization(current)} />}\n {owner && current.memberId && <HandOver organization={organization} memberId={current.memberId} />}\n {current.role && <Leave organization={organization} basePath={basePath} owner={owner} />}\n {owner && <Delete organization={organization} basePath={basePath} />}\n </div>\n )\n}\n"],"mappings":"uxBAmBM0B,GAAW,CAAE,eAAc,WAAU,aAAsF,CAC/H,GAAM,CAAE,WAAYf,EAAQ,EACtB,CAACgB,EAAMC,IAAA,EAAW5B,EAAAA,SAAAA,CAAS6B,EAAa,IAAI,EAC5C,CAACC,EAAMC,IAAA,EAAW/B,EAAAA,SAAAA,CAAS6B,EAAa,IAAI,EAC5C,CAAE,OAAM,QAAO,OAAQV,EAAU,EACjCa,EAAUL,EAAK,KAAK,IAAME,EAAa,MAAQC,IAASD,EAAa,KAC3E,OACE,EAAAJ,EAAA,KAAA,CAACR,EAAD,CAAgB,MAAOR,EAAK,SAAS,EAAG,YAAwBA,EAAXwB,EAAgB,kBAA0B,iBAAiB,EAAhH,SAAA,EACE,EAAAR,EAAA,IAAA,CAACJ,EAAD,CAAc,QAASa,CAAQ,CAAA,GAC/B,EAAAT,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,kCAAkC,SAAW,GAAU,CAAEU,EAAM,eAAe,EAAGC,EAAS,SAAY,CAAE,MAAMC,EAAQ,cAAc,OAAOR,EAAa,GAAI,CAAE,KAAMF,EAAK,KAAK,EAAG,MAAK,C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EAAAJ,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,6CACb,UAAA,EAAAA,EAAA,IAAA,CAACF,EAAD,CAAY,MAAOnB,EAAE,cAAc,EAAG,SAAUA,EAAE,gBAAgB,CAAI,CAAA,CACnE,CAAA,EAGT,IAAMyD,EAAQG,EAAQ,OAAS,QAC/B,OACE,EAAAvC,EAAA,KAAA,CAAC,MAAD,CAAK,UAAU,iEAAf,SAAA,EACE,EAAAA,EAAA,IAAA,CAACF,EAAD,CAAY,MAAOM,EAAa,KAAM,SAAUmC,EAAQ,KAAOvD,EAAK,SAAU,CAAE,KAAMS,EAAsB8C,EAAQ,IAAI,CAAC,CAAC,YAAY,CAAE,CAAC,EAAIvD,EAAK,oBAAoB,CAAI,CAAA,GAC1K,EAAAgB,EAAA,IAAA,CAACC,EAAD,CAAyE,eAAc,SAAUJ,EAAoB0C,CAAO,EAAG,QAASC,CAAY,EAAtI,GAAGpC,EAAa,KAAK,GAAGA,EAAa,MAAiG,EACnJkC,GAASC,EAAQ,OAAQ,EAAAvC,EAAA,IAAA,CAAC8B,EAAD,CAAY,SAAUjC,EAAoB0C,CAAO,CAAI,CAAA,EAC9EH,GAASG,EAAQ,WAAY,EAAAvC,EAAA,IAAA,CAACe,EAAD,CAAwB,eAAc,SAAUwB,EAAQ,QAAW,CAAA,EAChGA,EAAQ,OAAQ,EAAAvC,EAAA,IAAA,CAACmC,EAAD,CAAqB,eAAwB,WAAiB,OAAQ,CAAA,EACtFC,IAAS,EAAApC,EAAA,IAAA,CAACuB,EAAD,CAAsB,eAAwB,UAAW,CAAA,CAChE,GAET","debugId":"9d7daaaf-b218-4424-bdbb-2f942903b16c"}
1
+ {"version":3,"file":"organization-page-DnmV85sX.js","names":["useState","_Fragment","n","a","t","__toESM","require_react","require_jsx_runtime","useMeta","text","useOrganizationText","useAuth","useClient","Switch","Button","reopenIn","Input","AccountSection","organizationRoleLabel","useAction","Dialog","SectionError","managesOrganization","PageHeader","import_react","import_jsx_runtime","Details","name","setName","organization","slug","setSlug","changed","editable","error","event","run","session","onSaved","busy","HandOver","members","setMembers","target","setTarget","list","member","memberId","Delete","confirming","setConfirming","typed","setTyped","remove","basePath","GuestLinks","client","allowed","setAllowed","next","Leave","owner","OrganizationPage","calls","current","onChanged"],"sources":["../../../src/organizations/organization-page.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport type { CurrentOrganization, OrganizationMember } from '@protobase/client'\nimport { AccountSection, SectionError } from '../account/account-section'\nimport { PageHeader } from '../app-shell'\nimport { useAuth } from '../auth/auth-provider'\nimport { Button } from '../primitives/button'\nimport { Dialog } from '../primitives/dialog'\nimport { Input } from '../primitives/input'\nimport { Switch } from '../primitives/switch'\nimport { useClient } from '../data/api-provider'\nimport { useMeta } from '../data/use-meta'\nimport { managesOrganization, organizationRoleLabel } from './organization-paths'\nimport { useAction } from './use-action'\nimport { reopenIn } from './use-organizations'\nimport { text } from './messages'\nimport { useOrganizationText } from './organization-word'\n\ntype Organization = NonNullable<CurrentOrganization['organization']>\n\nconst Details = ({ organization, editable, onSaved }: { organization: Organization; editable: boolean; onSaved: () => void }) => {\n const { session } = useAuth()\n const [name, setName] = useState(organization.name)\n const [slug, setSlug] = useState(organization.slug)\n const { busy, error, run } = useAction()\n const changed = name.trim() !== organization.name || slug !== organization.slug\n return (\n <AccountSection title={text('details')} description={editable ? text('detailsEditable') : text('detailsReadOnly')}>\n <SectionError message={error} />\n <form className=\"flex flex-col gap-2 sm:flex-row\" onSubmit={(event) => { event.preventDefault(); void run(async () => { await session.organizations.rename(organization.id, { name: name.trim(), slug }); onSaved() }) }}>\n <Input aria-label={text('name')} value={name} disabled={!editable} onChange={(event) => setName(event.target.value)} wrapperClassName=\"flex-1\" />\n <Input aria-label={text('slug')} value={slug} disabled={!editable} onChange={(event) => setSlug(event.target.value)} wrapperClassName=\"sm:w-48\" />\n {editable && <Button type=\"submit\" variant=\"primary\" loading={busy} disabled={!changed || !name.trim()}>{text('save')}</Button>}\n </form>\n </AccountSection>\n )\n}\n\nconst HandOver = ({ organization, memberId }: { organization: Organization; memberId: string }) => {\n const { session } = useAuth()\n const [members, setMembers] = useState<OrganizationMember[]>([])\n const [target, setTarget] = useState('')\n const { busy, error, run } = useAction()\n useEffect(() => {\n void session.organizations.members(organization.id).then((list) => setMembers(list.filter((member) => member.id !== memberId)), () => setMembers([]))\n }, [session, organization.id, memberId])\n return (\n <AccountSection title={text('handOver')} description={text('handOverDescription')}>\n <SectionError message={error} />\n <div className=\"flex flex-col gap-2 sm:flex-row\">\n <select aria-label={text('newOwner')} value={target} onChange={(event) => setTarget(event.target.value)} className=\"h-8 flex-1 rounded-md border border-border-strong bg-background px-2\">\n <option value=\"\">{text('chooseMember')}</option>\n {members.map((member) => <option key={member.id} value={member.id}>{member.name} ({member.email})</option>)}\n </select>\n <Button loading={busy} disabled={!target} onClick={() => void run(async () => { await session.organizations.transferOwnership(target); window.location.reload() })}>{text('handOver')}</Button>\n </div>\n </AccountSection>\n )\n}\n\nconst Delete = ({ organization, basePath }: { organization: Organization; basePath: string }) => {\n const { session } = useAuth()\n const [confirming, setConfirming] = useState(false)\n const [typed, setTyped] = useState('')\n const { busy, error, run } = useAction()\n const t = useOrganizationText()\n const remove = () => run(async () => { await session.organizations.remove(organization.id); reopenIn(basePath) })\n return (\n <AccountSection title={t('deleteOrganization')} description={t('deleteDescription')}>\n <SectionError message={confirming ? undefined : error} />\n <Button variant=\"danger\" onClick={() => setConfirming(true)}>{t('deleteOrganization')}</Button>\n {confirming && (\n <Dialog\n title={text('deleteTitle', { name: organization.name })}\n description={text('deleteConfirm')}\n onClose={() => setConfirming(false)}\n actions={\n <>\n <Button onClick={() => setConfirming(false)}>{text('cancel')}</Button>\n <Button variant=\"danger\" loading={busy} disabled={typed !== organization.name} onClick={() => void remove()}>{text('delete')}</Button>\n </>\n }\n >\n <SectionError message={error} />\n <Input aria-label={t('organizationName')} value={typed} onChange={(event) => setTyped(event.target.value)} />\n </Dialog>\n )}\n </AccountSection>\n )\n}\n\n// Whether the organization's calls take guests, which its owner and admins turn on and off; only in an app with calls.\nconst GuestLinks = ({ editable }: { editable: boolean }) => {\n const client = useClient()\n const [allowed, setAllowed] = useState<boolean>()\n const { busy, error, run } = useAction()\n useEffect(() => {\n void client.callGuests.allowed().then(setAllowed)\n }, [client])\n if (allowed === undefined) return null\n return (\n <AccountSection title={text('guestLinks')} description={text('guestLinksDescription')}>\n <SectionError message={error} />\n <label className=\"flex items-center gap-2 text-sm text-foreground\">\n <Switch\n checked={allowed}\n label={text('guestLinksAllowed')}\n {...(editable && !busy && { onChange: (next: boolean) => void run(async () => { await client.callGuests.setAllowed(next); setAllowed(next) }) })}\n />\n {text('guestLinksAllowed')}\n </label>\n </AccountSection>\n )\n}\n\nconst Leave = ({ organization, basePath, owner }: { organization: Organization; basePath: string; owner: boolean }) => {\n const { session } = useAuth()\n const { busy, error, run } = useAction()\n return (\n <AccountSection title={text('leave')} description={owner ? text('leaveOwner') : text('leaveMember')}>\n <SectionError message={error} />\n <Button loading={busy} onClick={() => void run(async () => { await session.organizations.leave(organization.id); reopenIn(basePath) })}>{text('leaveName', { name: organization.name })}</Button>\n </AccountSection>\n )\n}\n\n/**\n * The organization one works in: its details, whether its calls take guests, and handing it over, leaving and deleting\n * it, as one's role allows.\n */\nexport const OrganizationPage = ({ current, basePath, onChanged }: { current?: CurrentOrganization; basePath: string; onChanged: () => void }) => {\n const calls = useMeta().data?.calls === true\n const t = useOrganizationText()\n const organization = current?.organization\n if (!organization) {\n return (\n <div className=\"mx-auto w-full max-w-3xl px-4 py-6 md:px-6\">\n <PageHeader title={t('organization')} subtitle={t('noOrganization')} />\n </div>\n )\n }\n const owner = current.role === 'owner'\n return (\n <div className=\"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-6 md:px-6\">\n <PageHeader title={organization.name} subtitle={current.role ? text('youAre', { role: organizationRoleLabel(current.role).toLowerCase() }) : text('throughGlobalRoles')} />\n <Details key={`${organization.name}/${organization.slug}`} organization={organization} editable={managesOrganization(current)} onSaved={onChanged} />\n {calls && current.role && <GuestLinks editable={managesOrganization(current)} />}\n {owner && current.memberId && <HandOver organization={organization} memberId={current.memberId} />}\n {current.role && <Leave organization={organization} basePath={basePath} owner={owner} />}\n {owner && <Delete organization={organization} basePath={basePath} />}\n </div>\n )\n}\n"],"mappings":"uxBAmBM0B,GAAW,CAAE,eAAc,WAAU,aAAsF,CAC/H,GAAM,CAAE,WAAYf,EAAQ,EACtB,CAACgB,EAAMC,IAAA,EAAW5B,EAAAA,SAAAA,CAAS6B,EAAa,IAAI,EAC5C,CAACC,EAAMC,IAAA,EAAW/B,EAAAA,SAAAA,CAAS6B,EAAa,IAAI,EAC5C,CAAE,OAAM,QAAO,OAAQV,EAAU,EACjCa,EAAUL,EAAK,KAAK,IAAME,EAAa,MAAQC,IAASD,EAAa,KAC3E,OACE,EAAAJ,EAAA,KAAA,CAACR,EAAD,CAAgB,MAAOR,EAAK,SAAS,EAAG,YAAwBA,EAAXwB,EAAgB,kBAA0B,iBAAiB,EAAhH,SAAA,EACE,EAAAR,EAAA,IAAA,CAACJ,EAAD,CAAc,QAASa,CAAQ,CAAA,GAC/B,EAAAT,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,kCAAkC,SAAW,GAAU,CAAEU,EAAM,eAAe,EAAGC,EAAS,SAAY,CAAE,MAAMC,EAAQ,cAAc,OAAOR,EAAa,GAAI,CAAE,KAAMF,EAAK,KAAK,EAAG,MAAK,CAAC,EAAGW,EAAQ,CAAE,CAAC,CAAE,EAAvN,SAAA,EACE,EAAAb,EAAA,IAAA,CAACT,EAAD,CAAO,aAAYP,EAAK,MAAM,EAAG,MAAOkB,EAAM,SAAU,CAACM,EAAU,SAAW,GAAUL,EAAQO,EAAM,OAAO,KAAK,EAAG,iBAAiB,QAAU,CAAA,GAChJ,EAAAV,EAAA,IAAA,CAACT,EAAD,CAAO,aAAYP,EAAK,MAAM,EAAG,MAAOqB,EAAM,SAAU,CAACG,EAAU,SAAW,GA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KAAM,SAAUmC,EAAQ,KAAOvD,EAAK,SAAU,CAAE,KAAMS,EAAsB8C,EAAQ,IAAI,CAAC,CAAC,YAAY,CAAE,CAAC,EAAIvD,EAAK,oBAAoB,CAAI,CAAA,GAC1K,EAAAgB,EAAA,IAAA,CAACC,EAAD,CAAyE,eAAc,SAAUJ,EAAoB0C,CAAO,EAAG,QAASC,CAAY,EAAtI,GAAGpC,EAAa,KAAK,GAAGA,EAAa,MAAiG,EACnJkC,GAASC,EAAQ,OAAQ,EAAAvC,EAAA,IAAA,CAAC8B,EAAD,CAAY,SAAUjC,EAAoB0C,CAAO,CAAI,CAAA,EAC9EH,GAASG,EAAQ,WAAY,EAAAvC,EAAA,IAAA,CAACe,EAAD,CAAwB,eAAc,SAAUwB,EAAQ,QAAW,CAAA,EAChGA,EAAQ,OAAQ,EAAAvC,EAAA,IAAA,CAACmC,EAAD,CAAqB,eAAwB,WAAiB,OAAQ,CAAA,EACtFC,IAAS,EAAApC,EAAA,IAAA,CAACuB,EAAD,CAAsB,eAAwB,UAAW,CAAA,CAChE,GAET","debugId":"e7995f39-b17e-431b-9432-9b6ab7e5a583"}
@@ -1 +1 @@
1
- {"version":3,"file":"organizations-page-C37kxzUq.js","names":["useState","useCallback","n","a","t","__toESM","require_react","require_jsx_runtime","text","useOrganizationText","useAuth","Button","reopenIn","AccountSection","Badge","isAdmin","useAction","SectionError","PageHeader","PagedSearchList","usePagedSearch","MyInvitationRow","useJoinInvitation","NewOrganizationForm","useMyInvitations","import_react","import_jsx_runtime","OrganizationRow","organization","current","busy","onOpen","AllOrganizations","query","setQuery","search","session","term","offset","page","list","currentId","run","basePath","YourInvitations","read","invitations","error","joining","invitation","join","OrganizationsPage","settings","auth","user","mayCreate","state"],"sources":["../../../src/organizations/organization-row.tsx","../../../src/organizations/all-organizations.tsx","../../../src/organizations/organizations-page.tsx"],"sourcesContent":["import type { Organization } from '@protobase/client'\nimport { Badge } from '../primitives/badge'\nimport { Button } from '../primitives/button'\nimport { text } from './messages'\n\n/** An organization with Open, or a Current badge when the person works in it. */\nexport const OrganizationRow = ({ organization, current, busy, onOpen }: { organization: Organization; current: boolean; busy: boolean; onOpen: () => void }) => (\n <li className=\"flex items-center gap-3 px-3 py-2.5\">\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">{organization.name}</span>\n <span className=\"block text-xs text-muted-foreground\">{organization.slug}</span>\n </span>\n {current ? <Badge tone=\"green\">{text('current')}</Badge> : <Button size=\"sm\" loading={busy} onClick={onOpen}>{text('open')}</Button>}\n </li>\n)\n","import { useCallback, useState } from 'react'\nimport { useAuth } from '../auth/auth-provider'\nimport { PagedSearchList } from '../lists/paged-search-list'\nimport { usePagedSearch } from '../lists/use-paged-search'\nimport { OrganizationRow } from './organization-row'\nimport { useAction } from './use-action'\nimport { reopenIn } from './use-organizations'\nimport { text } from './messages'\nimport { useOrganizationText } from './organization-word'\n\n/** Every organization in the app for people with a global role, who may work in any of them. */\nexport const AllOrganizations = ({ basePath, currentId }: { basePath: string; currentId?: string }) => {\n const { session } = useAuth()\n const t = useOrganizationText()\n const [query, setQuery] = useState('')\n const search = useCallback((term: string, offset: number) => session.organizations.search(term, offset).then((page) => ({ items: page.organizations, total: page.total })), [session])\n const list = usePagedSearch(search, query)\n const { busy, error, run } = useAction()\n return (\n <PagedSearchList\n title={t('allOrganizations')}\n description={t('allOrganizationsDescription')}\n searchLabel={t('findOrganization')}\n placeholder={text('nameOrSlug')}\n query={query}\n onQuery={setQuery}\n list={list}\n error={error}\n renderRow={(organization) => (\n <OrganizationRow key={organization.id} organization={organization} current={organization.id === currentId} busy={busy} onOpen={() => void run(async () => { await session.organizations.switchTo(organization.id); reopenIn(basePath) })} />\n )}\n />\n )\n}\n","import { AccountSection, SectionError } from '../account/account-section'\nimport { PageHeader } from '../app-shell'\nimport { useAuth } from '../auth/auth-provider'\nimport { isAdmin } from '../auth/user-to-shell'\nimport { AllOrganizations } from './all-organizations'\nimport { MyInvitationRow } from './my-invitation-row'\nimport { NewOrganizationForm } from './new-organization-form'\nimport { OrganizationRow } from './organization-row'\nimport { useOrganizationText } from './organization-word'\nimport { useAction } from './use-action'\nimport { useJoinInvitation } from './use-join-invitation'\nimport { useMyInvitations } from './use-my-invitations'\nimport { reopenIn, type OrganizationsState } from './use-organizations'\n\n/** The invitations for the person's own address, each to join, which opens the app in its organization. */\nconst YourInvitations = ({ basePath }: { basePath: string }) => {\n const t = useOrganizationText()\n const read = useMyInvitations()\n const invitations = read.state === 'ready' ? read.invitations : undefined\n const { busy, error, joining, join } = useJoinInvitation(() => reopenIn(basePath))\n if (!invitations || invitations.length === 0) return null\n return (\n <AccountSection title={t('invitationsForYou')} description={t('invitationsForYouDescription')}>\n <SectionError message={error} />\n <ul className=\"divide-y rounded-md border\">\n {invitations.map((invitation) => (\n <MyInvitationRow key={invitation.id} invitation={invitation} t={t} busy={busy} joining={joining === invitation.id} onJoin={() => join(invitation.id)} />\n ))}\n </ul>\n </AccountSection>\n )\n}\n\n/**\n * The person's organizations: switching between them, making a new one when the app allows it, and for people with a\n * global role every organization. Someone in none sees their invitations here.\n */\nexport const OrganizationsPage = ({ state, basePath }: { state: OrganizationsState; basePath: string }) => {\n const { session, organizations: settings, state: auth } = useAuth()\n const t = useOrganizationText()\n const { busy, error, run } = useAction()\n const user = auth.kind === 'signed-in' ? auth.user : undefined\n const mayCreate = settings?.create === 'everyone' || (user !== undefined && isAdmin(user))\n const currentId = state.current?.organization?.id\n return (\n <div className=\"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-6 md:px-6\">\n <PageHeader title={t('organizations')} subtitle={t('organizationsSubtitle')} />\n <AccountSection title={t('yourOrganizations')} description={state.organizations.length > 0 ? t('memberOf') : t('notMember')}>\n <SectionError message={error ?? state.error} />\n {state.organizations.length > 0 && (\n <ul className=\"divide-y rounded-md border\">\n {state.organizations.map((organization) => (\n <OrganizationRow key={organization.id} organization={organization} current={organization.id === currentId} busy={busy} onOpen={() => void run(async () => { await session.organizations.switchTo(organization.id); reopenIn(basePath) })} />\n ))}\n </ul>\n )}\n </AccountSection>\n <YourInvitations basePath={basePath} />\n {mayCreate && (\n <AccountSection title={t('newOrganization')} description={t('newOrganizationDescription')}>\n <NewOrganizationForm onCreated={() => reopenIn(basePath)} />\n </AccountSection>\n )}\n {(state.current?.globalRoles.length ?? 0) > 0 && <AllOrganizations basePath={basePath} currentId={currentId} />}\n </div>\n )\n}\n"],"mappings":"o3BAMa2B,GAAmB,CAAE,eAAc,UAAS,OAAM,aAC7D,EAAAD,EAAA,KAAA,CAAC,KAAD,CAAI,UAAU,sCAAd,SAAA,EACE,EAAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,iBAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,6BAA8B,SAAAE,EAAa,IAAW,CAAA,GACtE,EAAAF,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sCAAuC,SAAAE,EAAa,IAAW,CAAA,CAC3E,CACL,CAAA,EAAAC,GAAU,EAAAH,EAAA,IAAA,CAACZ,EAAD,CAAO,KAAK,QAAS,SAAAN,EAAK,SAAS,CAAS,CAAA,GAAI,EAAAkB,EAAA,IAAA,CAACf,EAAD,CAAQ,KAAK,KAAK,QAASmB,EAAM,QAASC,EAAS,SAAAvB,EAAK,MAAM,CAAU,CAAA,CACjI,ICFOwB,GAAoB,CAAE,WAAU,eAA0D,CACrG,GAAM,CAAE,WAAYtB,EAAQ,EACtBN,EAAIK,EAAoB,EACxB,CAACwB,EAAOC,IAAA,EAAYlC,EAAAA,SAAAA,CAAS,EAAE,EAC/BmC,GAAA,EAASlC,EAAAA,YAAAA,EAAa,EAAc,IAAmBmC,EAAQ,cAAc,OAAOC,EAAMC,CAAM,CAAC,CAAC,KAAM,IAAU,CAAE,MAAOC,EAAK,cAAe,MAAOA,EAAK,KAAM,EAAE,EAAG,CAACH,CAAO,CAAC,EAC/KI,EAAOpB,EAAee,EAAQF,CAAK,EACnC,CAAE,OA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QAAU,GAAK,IAAK,EAAA9B,EAAA,IAAA,CAACM,EAAD,CAA4B,WAAqB,WAAY,CAAA,CAC3G,GAET","debugId":"b7ee4c73-52a3-4c98-afc4-6707339de7cc"}
1
+ {"version":3,"file":"organizations-page-CKJB2qGB.js","names":["useState","useCallback","n","a","t","__toESM","require_react","require_jsx_runtime","text","useOrganizationText","useAuth","Button","reopenIn","AccountSection","Badge","isAdmin","useAction","SectionError","PageHeader","PagedSearchList","usePagedSearch","MyInvitationRow","useJoinInvitation","NewOrganizationForm","useMyInvitations","import_react","import_jsx_runtime","OrganizationRow","organization","current","busy","onOpen","AllOrganizations","query","setQuery","search","session","term","offset","page","list","currentId","run","basePath","YourInvitations","read","invitations","error","joining","invitation","join","OrganizationsPage","settings","auth","user","mayCreate","state"],"sources":["../../../src/organizations/organization-row.tsx","../../../src/organizations/all-organizations.tsx","../../../src/organizations/organizations-page.tsx"],"sourcesContent":["import type { Organization } from '@protobase/client'\nimport { Badge } from '../primitives/badge'\nimport { Button } from '../primitives/button'\nimport { text } from './messages'\n\n/** An organization with Open, or a Current badge when the person works in it. */\nexport const OrganizationRow = ({ organization, current, busy, onOpen }: { organization: Organization; current: boolean; busy: boolean; onOpen: () => void }) => (\n <li className=\"flex items-center gap-3 px-3 py-2.5\">\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">{organization.name}</span>\n <span className=\"block text-xs text-muted-foreground\">{organization.slug}</span>\n </span>\n {current ? <Badge tone=\"green\">{text('current')}</Badge> : <Button size=\"sm\" loading={busy} onClick={onOpen}>{text('open')}</Button>}\n </li>\n)\n","import { useCallback, useState } from 'react'\nimport { useAuth } from '../auth/auth-provider'\nimport { PagedSearchList } from '../lists/paged-search-list'\nimport { usePagedSearch } from '../lists/use-paged-search'\nimport { OrganizationRow } from './organization-row'\nimport { useAction } from './use-action'\nimport { reopenIn } from './use-organizations'\nimport { text } from './messages'\nimport { useOrganizationText } from './organization-word'\n\n/** Every organization in the app for people with a global role, who may work in any of them. */\nexport const AllOrganizations = ({ basePath, currentId }: { basePath: string; currentId?: string }) => {\n const { session } = useAuth()\n const t = useOrganizationText()\n const [query, setQuery] = useState('')\n const search = useCallback((term: string, offset: number) => session.organizations.search(term, offset).then((page) => ({ items: page.organizations, total: page.total })), [session])\n const list = usePagedSearch(search, query)\n const { busy, error, run } = useAction()\n return (\n <PagedSearchList\n title={t('allOrganizations')}\n description={t('allOrganizationsDescription')}\n searchLabel={t('findOrganization')}\n placeholder={text('nameOrSlug')}\n query={query}\n onQuery={setQuery}\n list={list}\n error={error}\n renderRow={(organization) => (\n <OrganizationRow key={organization.id} organization={organization} current={organization.id === currentId} busy={busy} onOpen={() => void run(async () => { await session.organizations.switchTo(organization.id); reopenIn(basePath) })} />\n )}\n />\n )\n}\n","import { AccountSection, SectionError } from '../account/account-section'\nimport { PageHeader } from '../app-shell'\nimport { useAuth } from '../auth/auth-provider'\nimport { isAdmin } from '../auth/user-to-shell'\nimport { AllOrganizations } from './all-organizations'\nimport { MyInvitationRow } from './my-invitation-row'\nimport { NewOrganizationForm } from './new-organization-form'\nimport { OrganizationRow } from './organization-row'\nimport { useOrganizationText } from './organization-word'\nimport { useAction } from './use-action'\nimport { useJoinInvitation } from './use-join-invitation'\nimport { useMyInvitations } from './use-my-invitations'\nimport { reopenIn, type OrganizationsState } from './use-organizations'\n\n/** The invitations for the person's own address, each to join, which opens the app in its organization. */\nconst YourInvitations = ({ basePath }: { basePath: string }) => {\n const t = useOrganizationText()\n const read = useMyInvitations()\n const invitations = read.state === 'ready' ? read.invitations : undefined\n const { busy, error, joining, join } = useJoinInvitation(() => reopenIn(basePath))\n if (!invitations || invitations.length === 0) return null\n return (\n <AccountSection title={t('invitationsForYou')} description={t('invitationsForYouDescription')}>\n <SectionError message={error} />\n <ul className=\"divide-y rounded-md border\">\n {invitations.map((invitation) => (\n <MyInvitationRow key={invitation.id} invitation={invitation} t={t} busy={busy} joining={joining === invitation.id} onJoin={() => join(invitation.id)} />\n ))}\n </ul>\n </AccountSection>\n )\n}\n\n/**\n * The person's organizations: switching between them, making a new one when the app allows it, and for people with a\n * global role every organization. Someone in none sees their invitations here.\n */\nexport const OrganizationsPage = ({ state, basePath }: { state: OrganizationsState; basePath: string }) => {\n const { session, organizations: settings, state: auth } = useAuth()\n const t = useOrganizationText()\n const { busy, error, run } = useAction()\n const user = auth.kind === 'signed-in' ? auth.user : undefined\n const mayCreate = settings?.create === 'everyone' || (user !== undefined && isAdmin(user))\n const currentId = state.current?.organization?.id\n return (\n <div className=\"mx-auto flex w-full max-w-3xl flex-col gap-4 px-4 py-6 md:px-6\">\n <PageHeader title={t('organizations')} subtitle={t('organizationsSubtitle')} />\n <AccountSection title={t('yourOrganizations')} description={state.organizations.length > 0 ? t('memberOf') : t('notMember')}>\n <SectionError message={error ?? state.error} />\n {state.organizations.length > 0 && (\n <ul className=\"divide-y rounded-md border\">\n {state.organizations.map((organization) => (\n <OrganizationRow key={organization.id} organization={organization} current={organization.id === currentId} busy={busy} onOpen={() => void run(async () => { await session.organizations.switchTo(organization.id); reopenIn(basePath) })} />\n ))}\n </ul>\n )}\n </AccountSection>\n <YourInvitations basePath={basePath} />\n {mayCreate && (\n <AccountSection title={t('newOrganization')} description={t('newOrganizationDescription')}>\n <NewOrganizationForm onCreated={() => reopenIn(basePath)} />\n </AccountSection>\n )}\n {(state.current?.globalRoles.length ?? 0) > 0 && <AllOrganizations basePath={basePath} currentId={currentId} />}\n </div>\n )\n}\n"],"mappings":"o3BAMa2B,GAAmB,CAAE,eAAc,UAAS,OAAM,aAC7D,EAAAD,EAAA,KAAA,CAAC,KAAD,CAAI,UAAU,sCAAd,SAAA,EACE,EAAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,iBAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,6BAA8B,SAAAE,EAAa,IAAW,CAAA,GACtE,EAAAF,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,sCAAuC,SAAAE,EA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AAA,EAC7CA,EAAM,cAAc,OAAS,IAC5B,EAAA9B,EAAA,IAAA,CAAC,KAAD,CAAI,UAAU,6BACX,SAAA8B,EAAM,cAAc,IAAK,IACxB,EAAA9B,EAAA,IAAA,CAACC,EAAD,CAAqD,eAAc,QAASC,EAAa,KAAOa,EAAiB,OAAM,WAAc,KAAKC,EAAI,SAAY,CAAE,MAAMN,EAAQ,cAAc,SAASR,EAAa,EAAE,EAAGhB,EAAS+B,CAAQ,CAAE,CAAC,CAAI,EAArNf,EAAa,EAAwM,CAC5O,CACC,CAAA,CAEQ,KAChB,EAAAF,EAAA,IAAA,CAACkB,EAAD,CAA2B,UAAW,CAAA,EACrCW,IACC,EAAA7B,EAAA,IAAA,CAACb,EAAD,CAAgB,MAAOT,EAAE,iBAAiB,EAAG,YAAaA,EAAE,4BAA4B,EACtF,UAAA,EAAAsB,EAAA,IAAA,CAACH,EAAD,CAAqB,cAAiBX,EAAS+B,CAAQ,CAAI,CAAA,CAC7C,CAAA,GAEhBa,EAAM,SAAS,YAAY,QAAU,GAAK,IAAK,EAAA9B,EAAA,IAAA,CAACM,EAAD,CAA4B,WAAqB,WAAY,CAAA,CAC3G,GAET","debugId":"8a241daa-1818-4d25-9277-b6fc022c20b3"}
@@ -1 +1 @@
1
- {"version":3,"file":"pending-invitation-row-Cyu7Ucej.js","names":["useState","useState","n","a","t","__toESM","require_react","require_jsx_runtime","formatTag","Button","Input","AccountSection","useAction","SectionError","messages","import_react","text","import_jsx_runtime","LinkNotice","link","InviteForm","email","setEmail","setLink","invite","run","onInvite","error","event","beside","busy","incomplete","children","PendingInvitationRow","expired","expiresAt","gives","onResend","onRevoke"],"sources":["../../../src/invitations/messages.ts","../../../src/invitations/link-notice.tsx","../../../src/invitations/invite-form.tsx","../../../src/invitations/pending-invitation-row.tsx"],"sourcesContent":["import { messages } from '../locale/messages'\n\nexport const text = messages('invitations')\n","import { text } from './messages'\n\n/** The invitation link to pass on, when the app cannot email it. */\nexport const LinkNotice = ({ link }: { link?: string }) =>\n link ? (\n <p className=\"mt-3 break-all rounded-md border bg-muted px-3 py-2 text-xs\">\n {text.rich('passLinkOn', { link: <span className=\"font-mono\">{link}</span> })}\n </p>\n ) : null\n","import { useState, type ReactNode } from 'react'\nimport { AccountSection, SectionError } from '../account/account-section'\nimport { useAction } from '../organizations/use-action'\nimport { Button } from '../primitives/button'\nimport { Input } from '../primitives/input'\nimport { LinkNotice } from './link-notice'\nimport { text } from './messages'\n\nexport type InviteFormProps = {\n title: string\n description: string\n /** Sends the invitation, with the roles the form's controls hold; answers its link when the app cannot email it. */\n onInvite: (email: string) => Promise<{ link?: string }>\n /** Controls on the line of the address, before Invite, such as a role to choose. */\n beside?: ReactNode\n /** The lines under it, such as the roles to give. */\n children?: ReactNode\n /** Keeps Invite off while the controls do not say enough yet, such as no role chosen. */\n incomplete?: boolean\n}\n\n/** Inviting an address: the address, the controls for what the invitation gives, Invite, and the link without mail. */\nexport const InviteForm = ({ title, description, onInvite, beside, children, incomplete = false }: InviteFormProps) => {\n const [email, setEmail] = useState('')\n const [link, setLink] = useState<string>()\n const { busy, error, run } = useAction()\n const invite = () =>\n run(async () => {\n setLink((await onInvite(email.trim())).link)\n setEmail('')\n })\n return (\n <AccountSection title={title} description={description}>\n <SectionError message={error} />\n <form className=\"flex flex-col gap-3\" onSubmit={(event) => { event.preventDefault(); void invite() }}>\n <div className=\"flex flex-col gap-2 sm:flex-row\">\n <Input aria-label={text('email')} type=\"email\" placeholder=\"name@example.com\" value={email} onChange={(event) => setEmail(event.target.value)} wrapperClassName=\"flex-1\" />\n {beside}\n <Button type=\"submit\" variant=\"primary\" loading={busy} disabled={!email.trim() || incomplete}>{text('invite')}</Button>\n </div>\n {children}\n </form>\n <LinkNotice link={link} />\n </AccountSection>\n )\n}\n","import { useState } from 'react'\nimport { SectionError } from '../account/account-section'\nimport { useAction } from '../organizations/use-action'\nimport { Button } from '../primitives/button'\nimport { LinkNotice } from './link-notice'\nimport { formatTag } from '../locale/active-locale'\nimport { text } from './messages'\n\nexport type PendingInvitationRowProps = {\n email: string\n /** What the invitation gives, in words: its roles. */\n gives: string\n expiresAt: string\n /** Sends it again with a new link, which replaces the earlier one; answers the link when the app cannot email it. */\n onResend: () => Promise<{ link?: string }>\n onRevoke: () => Promise<void>\n}\n\n/** An invitation not accepted yet: to whom, what it gives and until when, with Send again and Revoke. */\nexport const PendingInvitationRow = ({ email, gives, expiresAt, onResend, onRevoke }: PendingInvitationRowProps) => {\n const [link, setLink] = useState<string>()\n const { busy, error, run } = useAction()\n const expired = new Date(expiresAt).getTime() < Date.now()\n return (\n <li className=\"px-3 py-2.5\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">{email}</span>\n <span className=\"block text-xs text-muted-foreground\">\n {gives} · {expired ? text('expired') : text('until', { date: new Date(expiresAt).toLocaleDateString(formatTag()) })}\n </span>\n </span>\n <Button size=\"sm\" loading={busy} onClick={() => void run(async () => setLink((await onResend()).link))}>{text('sendAgain')}</Button>\n <Button size=\"sm\" variant=\"danger\" loading={busy} onClick={() => void run(onRevoke)}>{text('revoke')}</Button>\n </div>\n <SectionError message={error} />\n <LinkNotice link={link} />\n </li>\n )\n}\n"],"mappings":"+pBAEagB,EAAOF,EAAS,aAAa,aCC7BI,GAAc,CAAE,UAC3BC,GACE,EAAAF,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,8DACV,SAAAD,EAAK,KAAK,aAAc,CAAE,MAAM,EAAAC,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,YAAa,SAAAE,CAAW,CAAA,CAAE,CAAC,CAC3E,CAAA,EACD,KCcOC,GAAc,CAAE,QAAO,cAAa,WAAU,SAAQ,WAAU,aAAa,MAA6B,CACrH,GAAM,CAACC,EAAOC,IAAA,EAAYtB,EAAAA,SAAAA,CAAS,EAAE,EAC/B,CAACmB,EAAMI,IAAA,EAAWvB,EAAAA,SAAAA,CAAiB,EACnC,CAAE,OAAM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AAA,EACE,EAAAA,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,iBAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,6BAA8B,SAAAI,CAAY,CAAA,GAC1D,EAAAJ,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,sCAAhB,SAAA,CACGmB,EAAM,MAAIF,EAAUlB,EAAK,SAAS,EAAIA,EAAK,QAAS,CAAE,KAAM,IAAI,KAAKmB,CAAS,CAAC,CAAC,mBAAmB3B,EAAU,CAAC,CAAE,CAAC,CAC9G,CACF,CAAA,CAAA,KACN,EAAAS,EAAA,IAAA,CAACR,EAAD,CAAQ,KAAK,KAAK,QAASqB,EAAM,YAAe,KAAKL,EAAI,SAAYF,GAAS,MAAMc,EAAS,EAAA,CAAG,IAAI,CAAC,EAAI,SAAArB,EAAK,WAAW,CAAU,CAAA,GACnI,EAAAC,EAAA,IAAA,CAACR,EAAD,CAAQ,KAAK,KAAK,QAAQ,SAAS,QAASqB,EAAM,YAAe,KAAKL,EAAIa,CAAQ,EAAI,SAAAtB,EAAK,QAAQ,CAAU,CAAA,CAC1G,KACL,EAAAC,EAAA,IAAA,CAACJ,EAAD,CAAc,QAASc,CAAQ,CAAA,GAC/B,EAAAV,EAAA,IAAA,CAACC,EAAD,CAAkB,MAAO,CAAA,CACvB,GAER","debugId":"b2bbb51c-7a3f-46b0-8b15-286441ff3cb7"}
1
+ {"version":3,"file":"pending-invitation-row-DAXBo7SZ.js","names":["useState","useState","n","a","t","__toESM","require_react","require_jsx_runtime","formatTag","Button","Input","AccountSection","useAction","SectionError","messages","import_react","text","import_jsx_runtime","LinkNotice","link","InviteForm","email","setEmail","setLink","invite","run","onInvite","error","event","beside","busy","incomplete","children","PendingInvitationRow","expired","expiresAt","gives","onResend","onRevoke"],"sources":["../../../src/invitations/messages.ts","../../../src/invitations/link-notice.tsx","../../../src/invitations/invite-form.tsx","../../../src/invitations/pending-invitation-row.tsx"],"sourcesContent":["import { messages } from '../locale/messages'\n\nexport const text = messages('invitations')\n","import { text } from './messages'\n\n/** The invitation link to pass on, when the app cannot email it. */\nexport const LinkNotice = ({ link }: { link?: string }) =>\n link ? (\n <p className=\"mt-3 break-all rounded-md border bg-muted px-3 py-2 text-xs\">\n {text.rich('passLinkOn', { link: <span className=\"font-mono\">{link}</span> })}\n </p>\n ) : null\n","import { useState, type ReactNode } from 'react'\nimport { AccountSection, SectionError } from '../account/account-section'\nimport { useAction } from '../organizations/use-action'\nimport { Button } from '../primitives/button'\nimport { Input } from '../primitives/input'\nimport { LinkNotice } from './link-notice'\nimport { text } from './messages'\n\nexport type InviteFormProps = {\n title: string\n description: string\n /** Sends the invitation, with the roles the form's controls hold; answers its link when the app cannot email it. */\n onInvite: (email: string) => Promise<{ link?: string }>\n /** Controls on the line of the address, before Invite, such as a role to choose. */\n beside?: ReactNode\n /** The lines under it, such as the roles to give. */\n children?: ReactNode\n /** Keeps Invite off while the controls do not say enough yet, such as no role chosen. */\n incomplete?: boolean\n}\n\n/** Inviting an address: the address, the controls for what the invitation gives, Invite, and the link without mail. */\nexport const InviteForm = ({ title, description, onInvite, beside, children, incomplete = false }: InviteFormProps) => {\n const [email, setEmail] = useState('')\n const [link, setLink] = useState<string>()\n const { busy, error, run } = useAction()\n const invite = () =>\n run(async () => {\n setLink((await onInvite(email.trim())).link)\n setEmail('')\n })\n return (\n <AccountSection title={title} description={description}>\n <SectionError message={error} />\n <form className=\"flex flex-col gap-3\" onSubmit={(event) => { event.preventDefault(); void invite() }}>\n <div className=\"flex flex-col gap-2 sm:flex-row\">\n <Input aria-label={text('email')} type=\"email\" placeholder=\"name@example.com\" value={email} onChange={(event) => setEmail(event.target.value)} wrapperClassName=\"flex-1\" />\n {beside}\n <Button type=\"submit\" variant=\"primary\" loading={busy} disabled={!email.trim() || incomplete}>{text('invite')}</Button>\n </div>\n {children}\n </form>\n <LinkNotice link={link} />\n </AccountSection>\n )\n}\n","import { useState } from 'react'\nimport { SectionError } from '../account/account-section'\nimport { useAction } from '../organizations/use-action'\nimport { Button } from '../primitives/button'\nimport { LinkNotice } from './link-notice'\nimport { formatTag } from '../locale/active-locale'\nimport { text } from './messages'\n\nexport type PendingInvitationRowProps = {\n email: string\n /** What the invitation gives, in words: its roles. */\n gives: string\n expiresAt: string\n /** Sends it again with a new link, which replaces the earlier one; answers the link when the app cannot email it. */\n onResend: () => Promise<{ link?: string }>\n onRevoke: () => Promise<void>\n}\n\n/** An invitation not accepted yet: to whom, what it gives and until when, with Send again and Revoke. */\nexport const PendingInvitationRow = ({ email, gives, expiresAt, onResend, onRevoke }: PendingInvitationRowProps) => {\n const [link, setLink] = useState<string>()\n const { busy, error, run } = useAction()\n const expired = new Date(expiresAt).getTime() < Date.now()\n return (\n <li className=\"px-3 py-2.5\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate font-medium\">{email}</span>\n <span className=\"block text-xs text-muted-foreground\">\n {gives} · {expired ? text('expired') : text('until', { date: new Date(expiresAt).toLocaleDateString(formatTag()) })}\n </span>\n </span>\n <Button size=\"sm\" loading={busy} onClick={() => void run(async () => setLink((await onResend()).link))}>{text('sendAgain')}</Button>\n <Button size=\"sm\" variant=\"danger\" loading={busy} onClick={() => void run(onRevoke)}>{text('revoke')}</Button>\n </div>\n <SectionError message={error} />\n <LinkNotice link={link} />\n </li>\n )\n}\n"],"mappings":"+pBAEagB,EAAOF,EAAS,aAAa,aCC7BI,GAAc,CAAE,UAC3BC,GACE,EAAAF,EAAA,IAAA,CAAC,IAAD,CAAG,UAAU,8DACV,SAAAD,EAAK,KAAK,aAAc,CAAE,MAAM,EAAAC,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,YAAa,SAAAE,CAAW,CAAA,CAAE,CAAC,CAC3E,CAAA,EACD,KCcOC,GAAc,CAAE,QAAO,cAAa,WAAU,SAAQ,WAAU,aAAa,MAA6B,CACrH,GAAM,CAACC,EAAOC,IAAA,EAAYtB,EAAA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