@protobase/ui 0.115.0 → 0.116.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/dist/account/messages.d.ts +2 -2
  2. package/dist/app/change-confirm/messages.d.ts +2 -2
  3. package/dist/app/charts/messages.d.ts +2 -2
  4. package/dist/app/comments/messages.d.ts +2 -2
  5. package/dist/app/confirm-sign-in-messages.d.ts +2 -2
  6. package/dist/app/conversation/messages.d.ts +2 -2
  7. package/dist/app/conversation/thread-state.d.ts +1 -1
  8. package/dist/app/create/messages.d.ts +2 -2
  9. package/dist/app/custom-section.d.ts +1 -1
  10. package/dist/app/delete/messages.d.ts +2 -2
  11. package/dist/app/displays/list-cards.d.ts +1 -1
  12. package/dist/app/displays/messages.d.ts +2 -2
  13. package/dist/app/embedded-list/messages.d.ts +2 -2
  14. package/dist/app/export/messages.d.ts +2 -2
  15. package/dist/app/field-messages.d.ts +2 -2
  16. package/dist/app/field-types/custom-step-container/messages.d.ts +2 -2
  17. package/dist/app/field-types/runner-install/messages.d.ts +2 -2
  18. package/dist/app/field-types/widget-part.d.ts +1 -1
  19. package/dist/app/field-types/workflow/definition.d.ts +1 -1
  20. package/dist/app/field-types/workflow/messages.d.ts +2 -2
  21. package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
  22. package/dist/app/field-types/workflow-run/messages.d.ts +2 -2
  23. package/dist/app/file-viewers/messages.d.ts +2 -2
  24. package/dist/app/focus/messages.d.ts +2 -2
  25. package/dist/app/gallery/gallery-layout.d.ts +2 -2
  26. package/dist/app/gallery/messages.d.ts +2 -2
  27. package/dist/app/hand-order/messages.d.ts +2 -2
  28. package/dist/app/history/messages.d.ts +2 -2
  29. package/dist/app/import/messages.d.ts +2 -2
  30. package/dist/app/list-messages.d.ts +2 -2
  31. package/dist/app/messages.d.ts +2 -2
  32. package/dist/app/meta-gate-messages.d.ts +2 -2
  33. package/dist/app/new-version/messages.d.ts +2 -2
  34. package/dist/app/pages/custom-boundary.d.ts +1 -1
  35. package/dist/app/pages/custom-chosen.d.ts +1 -1
  36. package/dist/app/pages/messages.d.ts +2 -2
  37. package/dist/app/record-chart/messages.d.ts +2 -2
  38. package/dist/app/record-messages.d.ts +2 -2
  39. package/dist/app/record-row/messages.d.ts +2 -2
  40. package/dist/app/related-cards/messages.d.ts +2 -2
  41. package/dist/app/runtime/messages.d.ts +2 -2
  42. package/dist/app/saved/messages.d.ts +2 -2
  43. package/dist/app/saved/saved-list.d.ts +1 -1
  44. package/dist/app/saved/use-favorite.d.ts +1 -1
  45. package/dist/app/search/messages.d.ts +2 -2
  46. package/dist/app/searches/messages.d.ts +2 -2
  47. package/dist/app/searches/use-save-search.d.ts +1 -1
  48. package/dist/app-shell/messages.d.ts +2 -2
  49. package/dist/assistant-dock/messages.d.ts +2 -2
  50. package/dist/auth/auth-provider.d.ts +3 -2
  51. package/dist/auth/auth-provider.js +8 -5
  52. package/dist/auth/messages.d.ts +2 -2
  53. package/dist/auth/native-sign-in.d.ts +11 -0
  54. package/dist/auth/native-sign-in.js +11 -0
  55. package/dist/calls/messages.d.ts +2 -2
  56. package/dist/chat/messages.d.ts +2 -2
  57. package/dist/compact-table/messages.d.ts +2 -2
  58. package/dist/data-grid/column-spec.d.ts +1 -1
  59. package/dist/data-grid/messages.d.ts +2 -2
  60. package/dist/filter-panel/messages.d.ts +2 -2
  61. package/dist/format/messages.d.ts +2 -2
  62. package/dist/forms/messages.d.ts +2 -2
  63. package/dist/inline-child-table/messages.d.ts +2 -2
  64. package/dist/invitations/messages.d.ts +2 -2
  65. package/dist/live/messages.d.ts +2 -2
  66. package/dist/mailbox/messages.d.ts +2 -2
  67. package/dist/mentions/messages.d.ts +2 -2
  68. package/dist/mocks/customers.d.ts +1 -1
  69. package/dist/mocks/invoices.d.ts +2 -2
  70. package/dist/mocks/orders.d.ts +2 -2
  71. package/dist/notifications/bell/messages.d.ts +2 -2
  72. package/dist/organizations/messages.d.ts +2 -2
  73. package/dist/package.js +1 -1
  74. package/dist/plugins/before-sign-in.d.ts +1 -1
  75. package/dist/plugins/messages.d.ts +2 -2
  76. package/dist/primitives/messages.d.ts +2 -2
  77. package/dist/record-view/messages.d.ts +2 -2
  78. package/dist/shell/assets/{account-page-XnRBgIm3.js → account-page-9Aq9kvrG.js} +2 -2
  79. package/dist/shell/assets/app-BnDutf0s.js +34 -0
  80. package/dist/shell/assets/{app-BdzxOK1l.css → app-DcrDZ6Fc.css} +1 -1
  81. package/dist/shell/assets/{assistant-shell-B0UOjO9j.js → assistant-shell-BGtjYwwY.js} +2 -2
  82. package/dist/shell/assets/{board-display-82tI8eop.js → board-display-Ck6nnv4b.js} +2 -2
  83. package/dist/shell/assets/{calendar-display-DdVa8wHA.js → calendar-display-DKXi1P_o.js} +2 -2
  84. package/dist/shell/assets/{call-rings-CtUeFpjU.js → call-rings-Bs9dtURX.js} +2 -2
  85. package/dist/shell/assets/{calls-Joul8uMN.js → calls-DR-Ci2ND.js} +2 -2
  86. package/dist/shell/assets/{circle-alert-CKfEY2eG.js → circle-alert-C0Jeesr7.js} +2 -2
  87. package/dist/shell/assets/{composed-page-BRTMBrpL.js → composed-page-Bdzzzuyj.js} +2 -2
  88. package/dist/shell/assets/{composer-section-DAIjBfXV.js → composer-section-rLoyhseD.js} +2 -2
  89. package/dist/shell/assets/{connect-route-DApl7e0e.js → connect-route-B9xNNieq.js} +2 -2
  90. package/dist/shell/assets/{copy-field-BHZX0DSt.js → copy-field-DkCyHPwg.js} +2 -2
  91. package/dist/shell/assets/{create-route-V5JNc_Kq.js → create-route-DBrv5Kqi.js} +2 -2
  92. package/dist/shell/assets/{custom-step-container-field-DC27oiuQ.js → custom-step-container-field-Do5pWJ_q.js} +2 -2
  93. package/dist/shell/assets/{embedded-list-DAjlopsR.js → embedded-list-CPgxhzPw.js} +3 -3
  94. package/dist/shell/assets/{export-dialog-Co7gghJ9.js → export-dialog-CovrAwYy.js} +2 -2
  95. package/dist/shell/assets/{graph-view-D7yvxu1M.js → graph-view-BfRhAOfb.js} +2 -2
  96. package/dist/shell/assets/{group-donut-BrffJgvP.js → group-donut-DC8GLnC8.js} +2 -2
  97. package/dist/shell/assets/{guest-call-page-B0thHXzD.js → guest-call-page-Dc8M5yz6.js} +3 -3
  98. package/dist/shell/assets/{html-viewer-BbtenCM5.js → html-viewer-DH_s-gLB.js} +2 -2
  99. package/dist/shell/assets/{import-dialog-Q-qqFWmI.js → import-dialog-Ge24RdwQ.js} +2 -2
  100. package/dist/shell/assets/{import-table-dialog-CEDYy6gW.js → import-table-dialog-D1aVXF3R.js} +2 -2
  101. package/dist/shell/assets/{index-ygoGHYZq.js → index-Bi_Jks-d.js} +1 -1
  102. package/dist/shell/assets/{invitations-page-DZ_oGyRY.js → invitations-page-CFwYUoqb.js} +2 -2
  103. package/dist/shell/assets/{layout-grid-DV6ebMSb.js → layout-grid-DCBxzjaE.js} +2 -2
  104. package/dist/shell/assets/{legend-item-ClY5HSFP.js → legend-item-BZXnHPzh.js} +2 -2
  105. package/dist/shell/assets/{list-page-CxylG_Bi.js → list-page-DwIEEzTz.js} +4 -4
  106. package/dist/shell/assets/{maplibre-BIJVsLGQ.js → maplibre-C7kZagL3.js} +2 -2
  107. package/dist/shell/assets/{markdown-content-B-r0DBG0.js → markdown-content-DMl-cVjQ.js} +2 -2
  108. package/dist/shell/assets/{members-page-UU96y7EQ.js → members-page-BfrzLCXo.js} +2 -2
  109. package/dist/shell/assets/{messages-03zmq2oA.js → messages-D5XhIbDz.js} +2 -2
  110. package/dist/shell/assets/{organization-page-Bj3c9EW9.js → organization-page-DxA2154P.js} +2 -2
  111. package/dist/shell/assets/{organizations-page-Cwn2LlFj.js → organizations-page-Bf4oXbvZ.js} +2 -2
  112. package/dist/shell/assets/{pending-invitation-row-JzQ9tOn_.js → pending-invitation-row-BIO4J3ts.js} +2 -2
  113. package/dist/shell/assets/{period-chart-CWBy03F7.js → period-chart-CoT2IDzy.js} +2 -2
  114. package/dist/shell/assets/{person-row-BJP4ag6H.js → person-row-DBeHOA2K.js} +2 -2
  115. package/dist/shell/assets/{public-form-page-Ct45rBwR.js → public-form-page-Dhinql3j.js} +2 -2
  116. package/dist/shell/assets/{record-lines-DCs-txvG.js → record-lines-Dmb8bl38.js} +2 -2
  117. package/dist/shell/assets/{record-map-BMZTdCJn.js → record-map-BR34Q9uI.js} +2 -2
  118. package/dist/shell/assets/{record-opens-DQrqEFru.js → record-opens-Dbjd4FLe.js} +2 -2
  119. package/dist/shell/assets/{record-page-C6tevfpa.js → record-page-Dnpo_8uE.js} +3 -3
  120. package/dist/shell/assets/{record-preview-Bqm2whUV.js → record-preview-CarOT-Gn.js} +2 -2
  121. package/dist/shell/assets/{records-map-Dq1fZ0Ll.js → records-map-CXanq-qN.js} +2 -2
  122. package/dist/shell/assets/{render-node-DQMrGelM.js → render-node-DGYXKoGV.js} +3 -3
  123. package/dist/shell/assets/{reorder-button-C8G3bjeB.js → reorder-button-9_dAk_3O.js} +2 -2
  124. package/dist/shell/assets/{run-trace-view-BoSTWwYy.js → run-trace-view-D1DZCrDs.js} +2 -2
  125. package/dist/shell/assets/{runner-install-field-BcduhfGA.js → runner-install-field-C2XhrG0M.js} +2 -2
  126. package/dist/shell/assets/{runtime-update-BRoaUFOx.js → runtime-update-C5TxLpYf.js} +2 -2
  127. package/dist/shell/assets/{shared-protobase-ui-Ck4mYbeU.js → shared-protobase-ui-HnfzBwws.js} +1 -1
  128. package/dist/shell/assets/{sheet-source-RncsoczT.js → sheet-source-DqFYbJpm.js} +2 -2
  129. package/dist/shell/assets/{sign-in-policy-page-azN2k0xv.js → sign-in-policy-page-vjGTg9Do.js} +2 -2
  130. package/dist/shell/assets/{start-block-queries-kp3ICAXt.js → start-block-queries-CmVDv8_F.js} +2 -2
  131. package/dist/shell/assets/{step-catalog-QFTLEUUW.js → step-catalog-PWiIgJSI.js} +2 -2
  132. package/dist/shell/assets/{step-panel-CcBoYcad.js → step-panel-TfW-31Gv.js} +2 -2
  133. package/dist/shell/assets/{timeline-display-Cr61_SZU.js → timeline-display-eBf3tuig.js} +2 -2
  134. package/dist/shell/assets/{trash-Bb3IsZeK.js → trash-BjnGkZfx.js} +2 -2
  135. package/dist/shell/assets/{update-set-D8rImCxw.js → update-set-BahNKmxv.js} +2 -2
  136. package/dist/shell/assets/{use-calendar-move-DP_MzXTz.js → use-calendar-move-Bfp2yC0P.js} +2 -2
  137. package/dist/shell/assets/{use-display-rows-3xQM1gvv.js → use-display-rows-DsBBYuKB.js} +2 -2
  138. package/dist/shell/assets/{use-paged-search-DcNUhIL9.js → use-paged-search-DaT4uUhX.js} +2 -2
  139. package/dist/shell/assets/{use-run-trace-B9v2XkVL.js → use-run-trace-DHk7l8MX.js} +2 -2
  140. package/dist/shell/assets/{use-workflow-page-DZZERjMt.js → use-workflow-page-DPIhXcnb.js} +2 -2
  141. package/dist/shell/assets/{use-workflow-types-BRe2O0QF.js → use-workflow-types-Bp8iqkBg.js} +2 -2
  142. package/dist/shell/assets/{workflow-canvas-Be_DnY83.js → workflow-canvas-CiGUTx4K.js} +2 -2
  143. package/dist/shell/assets/{workflow-field-D3BW-Lvk.js → workflow-field-lqBx3RDj.js} +3 -3
  144. package/dist/shell/assets/{workflow-graph-editor-J0pJUxAk.js → workflow-graph-editor-DgufTFii.js} +2 -2
  145. package/dist/shell/assets/{workflow-run-field-DCoSJYVl.js → workflow-run-field-C4BtvPnB.js} +3 -3
  146. package/dist/shell/assets/{workflow-status-field-btxWS0rc.js → workflow-status-field-CqDaP0V9.js} +2 -2
  147. package/dist/shell/assets/{workflow-workbench-lBJ6-WBD.js → workflow-workbench-CgL6wHPG.js} +2 -2
  148. package/dist/shell/index.html +4 -4
  149. package/dist/shell/protobase.shell.json +2 -2
  150. package/dist/shell/protobase.sw.js +2 -2
  151. package/dist/shell-source-maps/assets/{account-page-XnRBgIm3.js.map → account-page-9Aq9kvrG.js.map} +1 -1
  152. package/dist/shell-source-maps/assets/app-BnDutf0s.js.map +1 -0
  153. package/dist/shell-source-maps/assets/{assistant-shell-B0UOjO9j.js.map → assistant-shell-BGtjYwwY.js.map} +1 -1
  154. package/dist/shell-source-maps/assets/{board-display-82tI8eop.js.map → board-display-Ck6nnv4b.js.map} +1 -1
  155. package/dist/shell-source-maps/assets/{calendar-display-DdVa8wHA.js.map → calendar-display-DKXi1P_o.js.map} +1 -1
  156. package/dist/shell-source-maps/assets/{call-rings-CtUeFpjU.js.map → call-rings-Bs9dtURX.js.map} +1 -1
  157. package/dist/shell-source-maps/assets/{calls-Joul8uMN.js.map → calls-DR-Ci2ND.js.map} +1 -1
  158. package/dist/shell-source-maps/assets/{circle-alert-CKfEY2eG.js.map → circle-alert-C0Jeesr7.js.map} +1 -1
  159. package/dist/shell-source-maps/assets/{composed-page-BRTMBrpL.js.map → composed-page-Bdzzzuyj.js.map} +1 -1
  160. package/dist/shell-source-maps/assets/{composer-section-DAIjBfXV.js.map → composer-section-rLoyhseD.js.map} +1 -1
  161. package/dist/shell-source-maps/assets/{connect-route-DApl7e0e.js.map → connect-route-B9xNNieq.js.map} +1 -1
  162. package/dist/shell-source-maps/assets/{copy-field-BHZX0DSt.js.map → copy-field-DkCyHPwg.js.map} +1 -1
  163. package/dist/shell-source-maps/assets/{create-route-V5JNc_Kq.js.map → create-route-DBrv5Kqi.js.map} +1 -1
  164. package/dist/shell-source-maps/assets/{custom-step-container-field-DC27oiuQ.js.map → custom-step-container-field-Do5pWJ_q.js.map} +1 -1
  165. package/dist/shell-source-maps/assets/{embedded-list-DAjlopsR.js.map → embedded-list-CPgxhzPw.js.map} +1 -1
  166. package/dist/shell-source-maps/assets/{export-dialog-Co7gghJ9.js.map → export-dialog-CovrAwYy.js.map} +1 -1
  167. package/dist/shell-source-maps/assets/{graph-view-D7yvxu1M.js.map → graph-view-BfRhAOfb.js.map} +1 -1
  168. package/dist/shell-source-maps/assets/{group-donut-BrffJgvP.js.map → group-donut-DC8GLnC8.js.map} +1 -1
  169. package/dist/shell-source-maps/assets/{guest-call-page-B0thHXzD.js.map → guest-call-page-Dc8M5yz6.js.map} +1 -1
  170. package/dist/shell-source-maps/assets/{html-viewer-BbtenCM5.js.map → html-viewer-DH_s-gLB.js.map} +1 -1
  171. package/dist/shell-source-maps/assets/{import-dialog-Q-qqFWmI.js.map → import-dialog-Ge24RdwQ.js.map} +1 -1
  172. package/dist/shell-source-maps/assets/{import-table-dialog-CEDYy6gW.js.map → import-table-dialog-D1aVXF3R.js.map} +1 -1
  173. package/dist/shell-source-maps/assets/{invitations-page-DZ_oGyRY.js.map → invitations-page-CFwYUoqb.js.map} +1 -1
  174. package/dist/shell-source-maps/assets/{layout-grid-DV6ebMSb.js.map → layout-grid-DCBxzjaE.js.map} +1 -1
  175. package/dist/shell-source-maps/assets/{legend-item-ClY5HSFP.js.map → legend-item-BZXnHPzh.js.map} +1 -1
  176. package/dist/shell-source-maps/assets/{list-page-CxylG_Bi.js.map → list-page-DwIEEzTz.js.map} +1 -1
  177. package/dist/shell-source-maps/assets/{maplibre-BIJVsLGQ.js.map → maplibre-C7kZagL3.js.map} +1 -1
  178. package/dist/shell-source-maps/assets/{markdown-content-B-r0DBG0.js.map → markdown-content-DMl-cVjQ.js.map} +1 -1
  179. package/dist/shell-source-maps/assets/{members-page-UU96y7EQ.js.map → members-page-BfrzLCXo.js.map} +1 -1
  180. package/dist/shell-source-maps/assets/{messages-03zmq2oA.js.map → messages-D5XhIbDz.js.map} +1 -1
  181. package/dist/shell-source-maps/assets/{organization-page-Bj3c9EW9.js.map → organization-page-DxA2154P.js.map} +1 -1
  182. package/dist/shell-source-maps/assets/{organizations-page-Cwn2LlFj.js.map → organizations-page-Bf4oXbvZ.js.map} +1 -1
  183. package/dist/shell-source-maps/assets/{pending-invitation-row-JzQ9tOn_.js.map → pending-invitation-row-BIO4J3ts.js.map} +1 -1
  184. package/dist/shell-source-maps/assets/{period-chart-CWBy03F7.js.map → period-chart-CoT2IDzy.js.map} +1 -1
  185. package/dist/shell-source-maps/assets/{person-row-BJP4ag6H.js.map → person-row-DBeHOA2K.js.map} +1 -1
  186. package/dist/shell-source-maps/assets/{public-form-page-Ct45rBwR.js.map → public-form-page-Dhinql3j.js.map} +1 -1
  187. package/dist/shell-source-maps/assets/{record-lines-DCs-txvG.js.map → record-lines-Dmb8bl38.js.map} +1 -1
  188. package/dist/shell-source-maps/assets/{record-map-BMZTdCJn.js.map → record-map-BR34Q9uI.js.map} +1 -1
  189. package/dist/shell-source-maps/assets/{record-opens-DQrqEFru.js.map → record-opens-Dbjd4FLe.js.map} +1 -1
  190. package/dist/shell-source-maps/assets/{record-page-C6tevfpa.js.map → record-page-Dnpo_8uE.js.map} +1 -1
  191. package/dist/shell-source-maps/assets/{record-preview-Bqm2whUV.js.map → record-preview-CarOT-Gn.js.map} +1 -1
  192. package/dist/shell-source-maps/assets/{records-map-Dq1fZ0Ll.js.map → records-map-CXanq-qN.js.map} +1 -1
  193. package/dist/shell-source-maps/assets/{render-node-DQMrGelM.js.map → render-node-DGYXKoGV.js.map} +1 -1
  194. package/dist/shell-source-maps/assets/{reorder-button-C8G3bjeB.js.map → reorder-button-9_dAk_3O.js.map} +1 -1
  195. package/dist/shell-source-maps/assets/{run-trace-view-BoSTWwYy.js.map → run-trace-view-D1DZCrDs.js.map} +1 -1
  196. package/dist/shell-source-maps/assets/{runner-install-field-BcduhfGA.js.map → runner-install-field-C2XhrG0M.js.map} +1 -1
  197. package/dist/shell-source-maps/assets/{runtime-update-BRoaUFOx.js.map → runtime-update-C5TxLpYf.js.map} +1 -1
  198. package/dist/shell-source-maps/assets/{sheet-source-RncsoczT.js.map → sheet-source-DqFYbJpm.js.map} +1 -1
  199. package/dist/shell-source-maps/assets/{sign-in-policy-page-azN2k0xv.js.map → sign-in-policy-page-vjGTg9Do.js.map} +1 -1
  200. package/dist/shell-source-maps/assets/{start-block-queries-kp3ICAXt.js.map → start-block-queries-CmVDv8_F.js.map} +1 -1
  201. package/dist/shell-source-maps/assets/{step-catalog-QFTLEUUW.js.map → step-catalog-PWiIgJSI.js.map} +1 -1
  202. package/dist/shell-source-maps/assets/{step-panel-CcBoYcad.js.map → step-panel-TfW-31Gv.js.map} +1 -1
  203. package/dist/shell-source-maps/assets/{timeline-display-Cr61_SZU.js.map → timeline-display-eBf3tuig.js.map} +1 -1
  204. package/dist/shell-source-maps/assets/{trash-Bb3IsZeK.js.map → trash-BjnGkZfx.js.map} +1 -1
  205. package/dist/shell-source-maps/assets/{update-set-D8rImCxw.js.map → update-set-BahNKmxv.js.map} +1 -1
  206. package/dist/shell-source-maps/assets/{use-calendar-move-DP_MzXTz.js.map → use-calendar-move-Bfp2yC0P.js.map} +1 -1
  207. package/dist/shell-source-maps/assets/{use-display-rows-3xQM1gvv.js.map → use-display-rows-DsBBYuKB.js.map} +1 -1
  208. package/dist/shell-source-maps/assets/{use-paged-search-DcNUhIL9.js.map → use-paged-search-DaT4uUhX.js.map} +1 -1
  209. package/dist/shell-source-maps/assets/{use-run-trace-B9v2XkVL.js.map → use-run-trace-DHk7l8MX.js.map} +1 -1
  210. package/dist/shell-source-maps/assets/{use-workflow-page-DZZERjMt.js.map → use-workflow-page-DPIhXcnb.js.map} +1 -1
  211. package/dist/shell-source-maps/assets/{use-workflow-types-BRe2O0QF.js.map → use-workflow-types-Bp8iqkBg.js.map} +1 -1
  212. package/dist/shell-source-maps/assets/{workflow-canvas-Be_DnY83.js.map → workflow-canvas-CiGUTx4K.js.map} +1 -1
  213. package/dist/shell-source-maps/assets/{workflow-field-D3BW-Lvk.js.map → workflow-field-lqBx3RDj.js.map} +1 -1
  214. package/dist/shell-source-maps/assets/{workflow-graph-editor-J0pJUxAk.js.map → workflow-graph-editor-DgufTFii.js.map} +1 -1
  215. package/dist/shell-source-maps/assets/{workflow-run-field-DCoSJYVl.js.map → workflow-run-field-C4BtvPnB.js.map} +1 -1
  216. package/dist/shell-source-maps/assets/{workflow-status-field-btxWS0rc.js.map → workflow-status-field-CqDaP0V9.js.map} +1 -1
  217. package/dist/shell-source-maps/assets/{workflow-workbench-lBJ6-WBD.js.map → workflow-workbench-CgL6wHPG.js.map} +1 -1
  218. package/dist/status/messages.d.ts +2 -2
  219. package/dist/tokens.css +10 -10
  220. package/dist/users/messages.d.ts +2 -2
  221. package/package.json +5 -5
  222. package/dist/shell/assets/app-p7iRIIoG.js +0 -34
  223. package/dist/shell-source-maps/assets/app-p7iRIIoG.js.map +0 -1
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Wc as e}from"./app-p7iRIIoG.js";var t=class extends Error{reason;constructor(e){super(`The guest request was refused: ${e}`),this.reason=e,this.name=`GuestRefused`}},n=e=>{let n=[],r=t=>new Promise((r,i)=>{n.push({resolve:r,reject:i}),e(t)});return{guests:{link:({publish:e,expiresAt:t})=>r({type:`guest-link`,publish:e,...t&&{expires_at:t.toISOString()}}),revoke:e=>r({type:`guest-link-revoke`,link:e}),admit:e=>r({type:`guest-decide`,guest:e,admit:!0}),deny:e=>r({type:`guest-decide`,guest:e,admit:!1}),remove:e=>r({type:`guest-remove`,guest:e})},receive:e=>{if(e.type!==`guest-link`&&e.type!==`guest-done`&&e.type!==`guest-refused`)return!1;let r=n.shift();return e.type===`guest-refused`?r?.reject(new t(e.reason)):r?.resolve(e.type===`guest-link`?{link:e.link,token:e.token}:void 0),!0},lost:()=>{for(let e of n.splice(0))e.reject(Error(`The link to the call was lost before the server answered`))}}},r=class extends Error{constructor(e){super(e),this.name=`PublishRefused`}},i=e=>new RTCPeerConnection(e),a=e=>{let t=[...e],n=t.find(e=>e.type===`transport`&&typeof e.selectedCandidatePairId==`string`),r=t.find(e=>e.type===`candidate-pair`&&(e.id===n?.selectedCandidatePairId||!n&&e.selected===!0||!n&&e.nominated===!0&&e.state===`succeeded`)),i=0,a=0;for(let e of t)e.type===`inbound-rtp`&&(i+=Math.max(0,Number(e.packetsLost??0)),a+=Number(e.packetsReceived??0));let o=typeof r?.currentRoundTripTime==`number`?r.currentRoundTripTime*1e3:void 0;return{...o!==void 0&&{roundTripMs:o},...i+a>0&&{lostRatio:i/(i+a)}}},o=async(e,t)=>{let n=e.connectionState,r=n===`connected`?a((await e.getStats()).values()):{};return{...t!==void 0&&{member:t},state:n,...r}},s=e=>{let t=new Map;for(let n of e.split(/\r?\nm=/).slice(1)){let e=/^a=mid:(\S+)/m.exec(n)?.[1],r=/^a=msid:(\S+) \S+/m.exec(n)?.[1];e!==void 0&&r!==void 0&&r!==`-`&&t.set(r,e)}return t},c=e=>/^o=mozilla/m.test(e),l=typeof navigator<`u`&&/Firefox\//.test(navigator.userAgent),u=(e,t)=>l===c(t)?e.polite:l,d=(e,{iceServers:t,send:n,onTracks:a,createPeerConnection:c=i})=>{let l=new Map,d=new Map,f=[],p,m=Promise.resolve(),h=(e,{track:t,stream:n})=>e.addTransceiver(t,{direction:`sendonly`,streams:[n]}).sender,g=({member:e,sid:t})=>{let n=l.get(e)?.pc,r=n?.remoteDescription&&s(n.remoteDescription.sdp).get(t);return r===void 0?void 0:n.getTransceivers().find(e=>e.mid===r)?.receiver.track},_=()=>a(f.map(e=>({...e,...g(e)&&{track:g(e)}}))),v=(e,r)=>{let i=c({iceServers:t});r.pc=i,r.senders=new Map,i.onnegotiationneeded=async()=>{let t=i.setLocalDescription();r.makingOffer=t;try{await t,r.pc===i&&n({type:`signal`,to:e,description:i.localDescription.toJSON()})}finally{r.makingOffer===t&&(r.makingOffer=void 0)}},i.onicecandidate=t=>{t.candidate&&r.pc===i&&n({type:`signal`,to:e,candidate:t.candidate.toJSON()})},i.oniceconnectionstatechange=()=>{i.iceConnectionState===`failed`&&i.restartIce()},i.ontrack=()=>_();for(let[e,t]of d)r.senders.set(e,h(i,t))},y=t=>{let n={polite:e<t,ignoreOffer:!1};return l.set(t,n),v(t,n),n},b=async(e,t)=>{await t.makingOffer,t.pc.close(),v(e,t)},x=e=>{l.get(e)?.pc.close(),l.delete(e)},S=async(e,t,r)=>{let i=l.get(e)??y(e);if(t){let n=t.type===`offer`&&(i.makingOffer!==void 0||i.pc.signalingState!==`stable`);if(i.ignoreOffer=!u(i,t.sdp)&&n,i.ignoreOffer)return;n&&!i.pc.currentRemoteDescription&&await b(e,i)}let{pc:a}=i;t&&(await a.setRemoteDescription(t),t.type===`offer`&&(await a.setLocalDescription(),n({type:`signal`,to:e,description:a.localDescription.toJSON()})),_()),r&&await a.addIceCandidate(r).catch(e=>{if(!i.ignoreOffer)throw e})},C=async e=>{switch(e.type){case`peers`:{let t=new Set(e.members);for(let e of l.keys())t.has(e)||x(e);for(let e of t)l.has(e)||y(e);return}case`signal`:return S(e.from,e.description,e.candidate);case`tracks`:f=e.tracks,_();return;case`published`:p?.resolve();return;case`publish-refused`:p?.reject(new r(e.reason));return}},w=async e=>{let t=Object.entries(e);for(let[e]of t)if(d.has(e))throw Error(`The call already sends a ${e} track: unpublish it first`);if(t.length===0)return;let r=t.map(([e,t])=>{let n=new MediaStream([t]);return[e,{track:t,sid:n.id,stream:n}]}),i=new Promise((e,t)=>p={resolve:e,reject:t});n({type:`publish`,tracks:r.map(([e,{track:t,sid:n}])=>({cid:n,kind:t.kind,source:e}))});try{await i}finally{p=void 0}for(let[e,t]of r){d.set(e,t);for(let n of l.values())n.senders.set(e,h(n.pc,t))}};return{receive:C,publish:e=>{let t=m.then(()=>w(e));return m=t.catch(()=>{}),t},unpublish:async e=>{let t=d.get(e);if(t){d.delete(e);for(let t of l.values()){let n=t.senders.get(e);n&&t.pc.signalingState!==`closed`&&t.pc.removeTrack(n),t.senders.delete(e)}n({type:`unpublish`,sid:t.sid})}},mute:(e,t)=>{let r=d.get(e);r&&(r.track.enabled=!t,n({type:`mute`,sid:r.sid,muted:t}))},restartIce:async()=>{for(let e of l.values())e.pc.restartIce()},resumeState:async e=>({participant:e,tracks:[...d].map(([e,{track:t,sid:n}])=>({cid:n,sid:n,kind:t.kind,source:e}))}),resumed:async()=>{},sending:()=>new Map([...d].map(([e,{track:t}])=>[e,{track:t,simulcast:!1}])),connections:()=>Promise.all([...l].map(([e,t])=>o(t.pc,e))),close:()=>{p?.reject(Error(`The call ended`));for(let e of[...l.keys()])x(e)}}},f=e=>{let t=!1,n=!1,r=[],i=async()=>{t=!0,n=!1,await e()},a=()=>{for(let e of r.splice(0))e()};return{request:async()=>{if(t){n=!0;return}await i()},answered:async()=>{if(t=!1,n)return i();a()},abandon:()=>{t&&(n=!0),t=!1},get pending(){return n},settled:()=>t||n?new Promise(e=>r.push(e)):Promise.resolve(),reset:()=>{t=!1,n=!1,a()}}},p=[{rid:`q`,quality:`low`,scale:4,maxBitrate:15e4},{rid:`h`,quality:`medium`,scale:2,maxBitrate:5e5},{rid:`f`,quality:`high`,scale:1,maxBitrate:12e5}],m=12e5,h=(e,t,n)=>{if(t.kind===`audio`)return{cid:t.id,kind:`audio`,source:e};let{width:r=0,height:i=0}=t.getSettings(),a=n?p.map(e=>({quality:e.quality,width:Math.round(r/e.scale),height:Math.round(i/e.scale),bitrate:e.maxBitrate})):[];return{cid:t.id,kind:`video`,source:e,width:r,height:i,...n&&{layers:a}}},g=(e,t)=>{if(e.kind!==`audio`)return t?p.map(e=>({rid:e.rid,scaleResolutionDownBy:e.scale,maxBitrate:e.maxBitrate})):[{maxBitrate:m}]},_=({iceServers:e,send:t,onTracks:n,onUnpublished:a,createPeerConnection:s=i})=>{let c=s({iceServers:e,bundlePolicy:`max-bundle`}),l=new Map,u=[],d={},p=[],m=0,_,v=Promise.resolve(),y=f(async()=>{let e=await c.createOffer();await c.setLocalDescription(e),t({type:`offer`,sdp:e.sdp,id:++m})}),b=async()=>{c.getTransceivers().length>0&&await y.request()},x=async()=>{await b(),await y.settled()},S=e=>{let t=Object.keys(d).find(t=>d[t]===e);return t===void 0?void 0:c.getTransceivers().find(e=>e.mid===t)?.receiver.track},C=()=>n(p.map(e=>({...e,...S(e.sid)&&{track:S(e.sid)}})));c.onicecandidate=e=>{e.candidate&&t({type:`candidate`,candidate:e.candidate.toJSON()})},c.oniceconnectionstatechange=()=>{c.iceConnectionState===`failed`&&w()},c.ontrack=()=>C();let w=async()=>{c.restartIce(),await x()},T=e=>{let t=l.get(e);return t?(l.delete(e),c.signalingState!==`closed`&&c.removeTrack(t.transceiver.sender),!0):!1},E=async e=>{switch(e.type){case`answer`:if(e.id!==m)return;d={...d,...e.mids},await c.setRemoteDescription({type:`answer`,sdp:e.sdp});for(let e of u.splice(0))await c.addIceCandidate(e);C(),await y.answered();return;case`candidate`:c.remoteDescription?await c.addIceCandidate(e.candidate):u.push(e.candidate);return;case`sections`:for(let t=0;t<e.audio;t++)c.addTransceiver(`audio`,{direction:`recvonly`});for(let t=0;t<e.video;t++)c.addTransceiver(`video`,{direction:`recvonly`});await b();return;case`tracks`:p=e.tracks,C();return;case`unpublished`:{let t=[...l.values()].find(t=>t.sid===e.sid);if(!t)return;T(t.source),await b(),a(t.source);return}case`published`:_?.resolve(e.tracks);return;case`publish-refused`:_?.reject(new r(e.reason));return}},D=async(e,n)=>{let r=Object.entries(e).map(([e,t])=>{if(l.has(e))throw Error(`The call already sends a ${e} track: unpublish it first`);let r=t.kind===`video`&&!!n.simulcast,i=g(t,r);return{source:e,track:t,transceiver:c.addTransceiver(t,{direction:`sendonly`,...i&&{sendEncodings:i}}),simulcast:r}});if(r.length===0)return;let i=new Promise((e,t)=>_={resolve:e,reject:t});t({type:`publish`,tracks:r.map(e=>h(e.source,e.track,e.simulcast))});try{let e=await i;for(let t of r)l.set(t.source,{...t,sid:e.find(e=>e.cid===t.track.id).sid})}catch(e){for(let e of r)e.transceiver.stop();throw e}finally{_=void 0}await x()};return{receive:E,publish:(e,t={})=>{let n=v.then(()=>D(e,t));return v=n.catch(()=>{}),n},unpublish:async e=>{T(e)&&await x()},mute:(e,n)=>{let r=l.get(e);r?.sid&&(r.track.enabled=!n,t({type:`mute`,sid:r.sid,muted:n}))},restartIce:w,resumeState:async e=>{if(c.signalingState===`have-local-offer`&&(await c.setLocalDescription({type:`rollback`}),y.abandon()),!c.localDescription||!c.remoteDescription)return;let t=[...l.values()].flatMap(e=>e.sid?[{cid:e.track.id,sid:e.sid,kind:e.track.kind,source:e.source}]:[]);return{participant:e,offer:c.localDescription.sdp,answer:c.remoteDescription.sdp,tracks:t}},resumed:async()=>{y.pending&&await b()},sending:()=>new Map([...l.values()].map(e=>[e.source,{track:e.track,simulcast:e.simulcast}])),connections:async()=>[await o(c)],close:()=>{_?.reject(Error(`The call ended`)),y.reset(),c.close()}}},v=e=>Math.min(1e4,500*2**e),y=e=>{let t=new URL(e,globalThis.location?.href);return t.protocol=t.protocol.replace(/^http/,`ws`),t.href},b={1e3:`ended`,1008:`removed`},x=new Set([1011,1013]),S=e=>{let t=e.WebSocket??WebSocket,r=e.retryDelayMs??v,i=e.maxRetries??8,a=y(e.url),o,s,c=``,l=``,u=[],f=[],p=!1,m=!1,h=!1,g=!1,S=0,C=Promise.resolve(),w,T=new Promise((e,t)=>w={resolve:e,reject:t}),E=e=>{o.readyState===t.OPEN&&o.send(JSON.stringify(e))},D=n(E),O=e.guest===void 0?{}:{guest:e.guest},k=t=>e.onState?.(t),A=(e,n)=>{p||(p=!0,s?.close(),s=void 0,(o.readyState===t.OPEN||o.readyState===t.CONNECTING)&&o.close(1e3),w.reject(n??Error(`The call was left: ${e}`)),k({state:`left`,reason:e,...n!==void 0&&{error:n}}))},j=t=>{let n={iceServers:t.iceServers,send:E,onTracks:t=>{f=t,e.onTracks?.(t)},onUnpublished:t=>e.onUnpublished?.(t),...e.createPeerConnection&&{createPeerConnection:e.createPeerConnection}};return t.mode===`peer`?d(t.participant,n):_(n)},M=async t=>{switch(t.type){case`joined`:{let e=s?.sending();s?.close(),c=t.participant,l=t.call,s=j(t),S=0,k({state:`joined`}),w.resolve(F);for(let[t,{track:n,simulcast:r}]of e??[])F.publish({[t]:n},{simulcast:r}).catch(e=>A(`ended`,e));return}case`resumed`:g=!0,S=0,k({state:`joined`}),await s?.resumed();return;case`speakers`:e.onSpeakers?.(t.speakers);return;case`members`:u=t.members,e.onMembers?.(u);return;case`left`:t.reason===`rejoin`?m=!0:A(t.reason);return;case`lobby`:e.onLobby?.({guests:t.guests,links:t.links});return;default:if(D.receive(t))return;await s?.receive(t)}},N=e=>{h=!1,g=!1,o=new t(a),o.onopen=()=>{h=!0,C=C.then(async()=>{let t=e===`resume`&&s?await s.resumeState(c):void 0;E(t?{type:`resume`,call:l,...t,...O}:{type:`join`,...O})})},o.onmessage=e=>{let t=JSON.parse(String(e.data));C=C.then(()=>M(t)).catch(e=>A(`ended`,e))},o.onclose=t=>{D.lost(),C=C.then(()=>P(e,t.code))}},P=(e,t)=>{if(p)return;if(m)return m=!1,N(`join`);let n=b[t];if(n)return A(n);if(!c&&!x.has(t))return A(`refused`);if(S++,S>i)return A(c?`ended`:`unavailable`);k(c?{state:`resuming`}:{state:`connecting`});let a=e===`resume`&&h&&!g?`join`:`resume`;setTimeout(()=>{p||N(a)},r(S-1))},F={get id(){return l},get participant(){return c},members:()=>u,publish:async(e,t)=>{if(!s)throw Error(`The call was left`);await s.publish(e,t)},unpublish:async e=>{await s?.unpublish(e)},mute:(e,t)=>s?.mute(e,t),view:(e,t)=>E(t===`hidden`?{type:`view`,sids:e,width:0,height:0,hidden:!0}:{type:`view`,sids:e,...t}),restartIce:async()=>{await s?.restartIce()},leave:()=>{p||(E({type:`leave`}),A(`ended`))},tracks:()=>f,connections:async()=>s?s.connections():[],guests:D.guests};return k({state:`connecting`}),N(`join`),T},C=class extends Error{status;constructor(e,t){super(t),this.status=e,this.name=`LobbyRefused`}},w=({systemPath:t=`/api`,fetch:n=globalThis.fetch}={})=>{let r=e(t,`lobby`),i=async e=>{let t=await n(r,{...e,credentials:`omit`,cache:`no-store`});if(!t.ok)throw new C(t.status,(await t.json().catch(()=>void 0))?.detail??t.statusText);return t},a=e=>({authorization:`Bearer ${e}`});return{socketUrl:e(t,`socket`),enter:async(e,t)=>await(await i({method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({link:e,name:t})})).json(),wait:async e=>await(await i({method:`GET`,headers:a(e)})).json(),leave:async e=>{await i({method:`DELETE`,headers:a(e)})}}};export{t as GuestRefused,C as LobbyRefused,r as PublishRefused,w as guestLobby,S as joinCall};
2
- //# debugId=09a2e97c-b8c3-4efb-91dd-57f2e70c7100
1
+ (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Wc as e}from"./app-BnDutf0s.js";var t=class extends Error{reason;constructor(e){super(`The guest request was refused: ${e}`),this.reason=e,this.name=`GuestRefused`}},n=e=>{let n=[],r=t=>new Promise((r,i)=>{n.push({resolve:r,reject:i}),e(t)});return{guests:{link:({publish:e,expiresAt:t})=>r({type:`guest-link`,publish:e,...t&&{expires_at:t.toISOString()}}),revoke:e=>r({type:`guest-link-revoke`,link:e}),admit:e=>r({type:`guest-decide`,guest:e,admit:!0}),deny:e=>r({type:`guest-decide`,guest:e,admit:!1}),remove:e=>r({type:`guest-remove`,guest:e})},receive:e=>{if(e.type!==`guest-link`&&e.type!==`guest-done`&&e.type!==`guest-refused`)return!1;let r=n.shift();return e.type===`guest-refused`?r?.reject(new t(e.reason)):r?.resolve(e.type===`guest-link`?{link:e.link,token:e.token}:void 0),!0},lost:()=>{for(let e of n.splice(0))e.reject(Error(`The link to the call was lost before the server answered`))}}},r=class extends Error{constructor(e){super(e),this.name=`PublishRefused`}},i=e=>new RTCPeerConnection(e),a=e=>{let t=[...e],n=t.find(e=>e.type===`transport`&&typeof e.selectedCandidatePairId==`string`),r=t.find(e=>e.type===`candidate-pair`&&(e.id===n?.selectedCandidatePairId||!n&&e.selected===!0||!n&&e.nominated===!0&&e.state===`succeeded`)),i=0,a=0;for(let e of t)e.type===`inbound-rtp`&&(i+=Math.max(0,Number(e.packetsLost??0)),a+=Number(e.packetsReceived??0));let o=typeof r?.currentRoundTripTime==`number`?r.currentRoundTripTime*1e3:void 0;return{...o!==void 0&&{roundTripMs:o},...i+a>0&&{lostRatio:i/(i+a)}}},o=async(e,t)=>{let n=e.connectionState,r=n===`connected`?a((await e.getStats()).values()):{};return{...t!==void 0&&{member:t},state:n,...r}},s=e=>{let t=new Map;for(let n of e.split(/\r?\nm=/).slice(1)){let e=/^a=mid:(\S+)/m.exec(n)?.[1],r=/^a=msid:(\S+) \S+/m.exec(n)?.[1];e!==void 0&&r!==void 0&&r!==`-`&&t.set(r,e)}return t},c=e=>/^o=mozilla/m.test(e),l=typeof navigator<`u`&&/Firefox\//.test(navigator.userAgent),u=(e,t)=>l===c(t)?e.polite:l,d=(e,{iceServers:t,send:n,onTracks:a,createPeerConnection:c=i})=>{let l=new Map,d=new Map,f=[],p,m=Promise.resolve(),h=(e,{track:t,stream:n})=>e.addTransceiver(t,{direction:`sendonly`,streams:[n]}).sender,g=({member:e,sid:t})=>{let n=l.get(e)?.pc,r=n?.remoteDescription&&s(n.remoteDescription.sdp).get(t);return r===void 0?void 0:n.getTransceivers().find(e=>e.mid===r)?.receiver.track},_=()=>a(f.map(e=>({...e,...g(e)&&{track:g(e)}}))),v=(e,r)=>{let i=c({iceServers:t});r.pc=i,r.senders=new Map,i.onnegotiationneeded=async()=>{let t=i.setLocalDescription();r.makingOffer=t;try{await t,r.pc===i&&n({type:`signal`,to:e,description:i.localDescription.toJSON()})}finally{r.makingOffer===t&&(r.makingOffer=void 0)}},i.onicecandidate=t=>{t.candidate&&r.pc===i&&n({type:`signal`,to:e,candidate:t.candidate.toJSON()})},i.oniceconnectionstatechange=()=>{i.iceConnectionState===`failed`&&i.restartIce()},i.ontrack=()=>_();for(let[e,t]of d)r.senders.set(e,h(i,t))},y=t=>{let n={polite:e<t,ignoreOffer:!1};return l.set(t,n),v(t,n),n},b=async(e,t)=>{await t.makingOffer,t.pc.close(),v(e,t)},x=e=>{l.get(e)?.pc.close(),l.delete(e)},S=async(e,t,r)=>{let i=l.get(e)??y(e);if(t){let n=t.type===`offer`&&(i.makingOffer!==void 0||i.pc.signalingState!==`stable`);if(i.ignoreOffer=!u(i,t.sdp)&&n,i.ignoreOffer)return;n&&!i.pc.currentRemoteDescription&&await b(e,i)}let{pc:a}=i;t&&(await a.setRemoteDescription(t),t.type===`offer`&&(await a.setLocalDescription(),n({type:`signal`,to:e,description:a.localDescription.toJSON()})),_()),r&&await a.addIceCandidate(r).catch(e=>{if(!i.ignoreOffer)throw e})},C=async e=>{switch(e.type){case`peers`:{let t=new Set(e.members);for(let e of l.keys())t.has(e)||x(e);for(let e of t)l.has(e)||y(e);return}case`signal`:return S(e.from,e.description,e.candidate);case`tracks`:f=e.tracks,_();return;case`published`:p?.resolve();return;case`publish-refused`:p?.reject(new r(e.reason));return}},w=async e=>{let t=Object.entries(e);for(let[e]of t)if(d.has(e))throw Error(`The call already sends a ${e} track: unpublish it first`);if(t.length===0)return;let r=t.map(([e,t])=>{let n=new MediaStream([t]);return[e,{track:t,sid:n.id,stream:n}]}),i=new Promise((e,t)=>p={resolve:e,reject:t});n({type:`publish`,tracks:r.map(([e,{track:t,sid:n}])=>({cid:n,kind:t.kind,source:e}))});try{await i}finally{p=void 0}for(let[e,t]of r){d.set(e,t);for(let n of l.values())n.senders.set(e,h(n.pc,t))}};return{receive:C,publish:e=>{let t=m.then(()=>w(e));return m=t.catch(()=>{}),t},unpublish:async e=>{let t=d.get(e);if(t){d.delete(e);for(let t of l.values()){let n=t.senders.get(e);n&&t.pc.signalingState!==`closed`&&t.pc.removeTrack(n),t.senders.delete(e)}n({type:`unpublish`,sid:t.sid})}},mute:(e,t)=>{let r=d.get(e);r&&(r.track.enabled=!t,n({type:`mute`,sid:r.sid,muted:t}))},restartIce:async()=>{for(let e of l.values())e.pc.restartIce()},resumeState:async e=>({participant:e,tracks:[...d].map(([e,{track:t,sid:n}])=>({cid:n,sid:n,kind:t.kind,source:e}))}),resumed:async()=>{},sending:()=>new Map([...d].map(([e,{track:t}])=>[e,{track:t,simulcast:!1}])),connections:()=>Promise.all([...l].map(([e,t])=>o(t.pc,e))),close:()=>{p?.reject(Error(`The call ended`));for(let e of[...l.keys()])x(e)}}},f=e=>{let t=!1,n=!1,r=[],i=async()=>{t=!0,n=!1,await e()},a=()=>{for(let e of r.splice(0))e()};return{request:async()=>{if(t){n=!0;return}await i()},answered:async()=>{if(t=!1,n)return i();a()},abandon:()=>{t&&(n=!0),t=!1},get pending(){return n},settled:()=>t||n?new Promise(e=>r.push(e)):Promise.resolve(),reset:()=>{t=!1,n=!1,a()}}},p=[{rid:`q`,quality:`low`,scale:4,maxBitrate:15e4},{rid:`h`,quality:`medium`,scale:2,maxBitrate:5e5},{rid:`f`,quality:`high`,scale:1,maxBitrate:12e5}],m=12e5,h=(e,t,n)=>{if(t.kind===`audio`)return{cid:t.id,kind:`audio`,source:e};let{width:r=0,height:i=0}=t.getSettings(),a=n?p.map(e=>({quality:e.quality,width:Math.round(r/e.scale),height:Math.round(i/e.scale),bitrate:e.maxBitrate})):[];return{cid:t.id,kind:`video`,source:e,width:r,height:i,...n&&{layers:a}}},g=(e,t)=>{if(e.kind!==`audio`)return t?p.map(e=>({rid:e.rid,scaleResolutionDownBy:e.scale,maxBitrate:e.maxBitrate})):[{maxBitrate:m}]},_=({iceServers:e,send:t,onTracks:n,onUnpublished:a,createPeerConnection:s=i})=>{let c=s({iceServers:e,bundlePolicy:`max-bundle`}),l=new Map,u=[],d={},p=[],m=0,_,v=Promise.resolve(),y=f(async()=>{let e=await c.createOffer();await c.setLocalDescription(e),t({type:`offer`,sdp:e.sdp,id:++m})}),b=async()=>{c.getTransceivers().length>0&&await y.request()},x=async()=>{await b(),await y.settled()},S=e=>{let t=Object.keys(d).find(t=>d[t]===e);return t===void 0?void 0:c.getTransceivers().find(e=>e.mid===t)?.receiver.track},C=()=>n(p.map(e=>({...e,...S(e.sid)&&{track:S(e.sid)}})));c.onicecandidate=e=>{e.candidate&&t({type:`candidate`,candidate:e.candidate.toJSON()})},c.oniceconnectionstatechange=()=>{c.iceConnectionState===`failed`&&w()},c.ontrack=()=>C();let w=async()=>{c.restartIce(),await x()},T=e=>{let t=l.get(e);return t?(l.delete(e),c.signalingState!==`closed`&&c.removeTrack(t.transceiver.sender),!0):!1},E=async e=>{switch(e.type){case`answer`:if(e.id!==m)return;d={...d,...e.mids},await c.setRemoteDescription({type:`answer`,sdp:e.sdp});for(let e of u.splice(0))await c.addIceCandidate(e);C(),await y.answered();return;case`candidate`:c.remoteDescription?await c.addIceCandidate(e.candidate):u.push(e.candidate);return;case`sections`:for(let t=0;t<e.audio;t++)c.addTransceiver(`audio`,{direction:`recvonly`});for(let t=0;t<e.video;t++)c.addTransceiver(`video`,{direction:`recvonly`});await b();return;case`tracks`:p=e.tracks,C();return;case`unpublished`:{let t=[...l.values()].find(t=>t.sid===e.sid);if(!t)return;T(t.source),await b(),a(t.source);return}case`published`:_?.resolve(e.tracks);return;case`publish-refused`:_?.reject(new r(e.reason));return}},D=async(e,n)=>{let r=Object.entries(e).map(([e,t])=>{if(l.has(e))throw Error(`The call already sends a ${e} track: unpublish it first`);let r=t.kind===`video`&&!!n.simulcast,i=g(t,r);return{source:e,track:t,transceiver:c.addTransceiver(t,{direction:`sendonly`,...i&&{sendEncodings:i}}),simulcast:r}});if(r.length===0)return;let i=new Promise((e,t)=>_={resolve:e,reject:t});t({type:`publish`,tracks:r.map(e=>h(e.source,e.track,e.simulcast))});try{let e=await i;for(let t of r)l.set(t.source,{...t,sid:e.find(e=>e.cid===t.track.id).sid})}catch(e){for(let e of r)e.transceiver.stop();throw e}finally{_=void 0}await x()};return{receive:E,publish:(e,t={})=>{let n=v.then(()=>D(e,t));return v=n.catch(()=>{}),n},unpublish:async e=>{T(e)&&await x()},mute:(e,n)=>{let r=l.get(e);r?.sid&&(r.track.enabled=!n,t({type:`mute`,sid:r.sid,muted:n}))},restartIce:w,resumeState:async e=>{if(c.signalingState===`have-local-offer`&&(await c.setLocalDescription({type:`rollback`}),y.abandon()),!c.localDescription||!c.remoteDescription)return;let t=[...l.values()].flatMap(e=>e.sid?[{cid:e.track.id,sid:e.sid,kind:e.track.kind,source:e.source}]:[]);return{participant:e,offer:c.localDescription.sdp,answer:c.remoteDescription.sdp,tracks:t}},resumed:async()=>{y.pending&&await b()},sending:()=>new Map([...l.values()].map(e=>[e.source,{track:e.track,simulcast:e.simulcast}])),connections:async()=>[await o(c)],close:()=>{_?.reject(Error(`The call ended`)),y.reset(),c.close()}}},v=e=>Math.min(1e4,500*2**e),y=e=>{let t=new URL(e,globalThis.location?.href);return t.protocol=t.protocol.replace(/^http/,`ws`),t.href},b={1e3:`ended`,1008:`removed`},x=new Set([1011,1013]),S=e=>{let t=e.WebSocket??WebSocket,r=e.retryDelayMs??v,i=e.maxRetries??8,a=y(e.url),o,s,c=``,l=``,u=[],f=[],p=!1,m=!1,h=!1,g=!1,S=0,C=Promise.resolve(),w,T=new Promise((e,t)=>w={resolve:e,reject:t}),E=e=>{o.readyState===t.OPEN&&o.send(JSON.stringify(e))},D=n(E),O=e.guest===void 0?{}:{guest:e.guest},k=t=>e.onState?.(t),A=(e,n)=>{p||(p=!0,s?.close(),s=void 0,(o.readyState===t.OPEN||o.readyState===t.CONNECTING)&&o.close(1e3),w.reject(n??Error(`The call was left: ${e}`)),k({state:`left`,reason:e,...n!==void 0&&{error:n}}))},j=t=>{let n={iceServers:t.iceServers,send:E,onTracks:t=>{f=t,e.onTracks?.(t)},onUnpublished:t=>e.onUnpublished?.(t),...e.createPeerConnection&&{createPeerConnection:e.createPeerConnection}};return t.mode===`peer`?d(t.participant,n):_(n)},M=async t=>{switch(t.type){case`joined`:{let e=s?.sending();s?.close(),c=t.participant,l=t.call,s=j(t),S=0,k({state:`joined`}),w.resolve(F);for(let[t,{track:n,simulcast:r}]of e??[])F.publish({[t]:n},{simulcast:r}).catch(e=>A(`ended`,e));return}case`resumed`:g=!0,S=0,k({state:`joined`}),await s?.resumed();return;case`speakers`:e.onSpeakers?.(t.speakers);return;case`members`:u=t.members,e.onMembers?.(u);return;case`left`:t.reason===`rejoin`?m=!0:A(t.reason);return;case`lobby`:e.onLobby?.({guests:t.guests,links:t.links});return;default:if(D.receive(t))return;await s?.receive(t)}},N=e=>{h=!1,g=!1,o=new t(a),o.onopen=()=>{h=!0,C=C.then(async()=>{let t=e===`resume`&&s?await s.resumeState(c):void 0;E(t?{type:`resume`,call:l,...t,...O}:{type:`join`,...O})})},o.onmessage=e=>{let t=JSON.parse(String(e.data));C=C.then(()=>M(t)).catch(e=>A(`ended`,e))},o.onclose=t=>{D.lost(),C=C.then(()=>P(e,t.code))}},P=(e,t)=>{if(p)return;if(m)return m=!1,N(`join`);let n=b[t];if(n)return A(n);if(!c&&!x.has(t))return A(`refused`);if(S++,S>i)return A(c?`ended`:`unavailable`);k(c?{state:`resuming`}:{state:`connecting`});let a=e===`resume`&&h&&!g?`join`:`resume`;setTimeout(()=>{p||N(a)},r(S-1))},F={get id(){return l},get participant(){return c},members:()=>u,publish:async(e,t)=>{if(!s)throw Error(`The call was left`);await s.publish(e,t)},unpublish:async e=>{await s?.unpublish(e)},mute:(e,t)=>s?.mute(e,t),view:(e,t)=>E(t===`hidden`?{type:`view`,sids:e,width:0,height:0,hidden:!0}:{type:`view`,sids:e,...t}),restartIce:async()=>{await s?.restartIce()},leave:()=>{p||(E({type:`leave`}),A(`ended`))},tracks:()=>f,connections:async()=>s?s.connections():[],guests:D.guests};return k({state:`connecting`}),N(`join`),T},C=class extends Error{status;constructor(e,t){super(t),this.status=e,this.name=`LobbyRefused`}},w=({systemPath:t=`/api`,fetch:n=globalThis.fetch}={})=>{let r=e(t,`lobby`),i=async e=>{let t=await n(r,{...e,credentials:`omit`,cache:`no-store`});if(!t.ok)throw new C(t.status,(await t.json().catch(()=>void 0))?.detail??t.statusText);return t},a=e=>({authorization:`Bearer ${e}`});return{socketUrl:e(t,`socket`),enter:async(e,t)=>await(await i({method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({link:e,name:t})})).json(),wait:async e=>await(await i({method:`GET`,headers:a(e)})).json(),leave:async e=>{await i({method:`DELETE`,headers:a(e)})}}};export{t as GuestRefused,C as LobbyRefused,r as PublishRefused,w as guestLobby,S as joinCall};
2
+ //# debugId=d1f828b6-343a-4cb3-91d2-3fea02f9d356
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Ac as e}from"./app-p7iRIIoG.js";var t={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};t.node;var n=e(t);export{n as t};
2
- //# debugId=8a7c4636-786c-4575-9c9e-869c1519d596
1
+ (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{Ac as e}from"./app-BnDutf0s.js";var t={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};t.node;var n=e(t);export{n as t};
2
+ //# debugId=b425e7ac-afb3-44bc-a68c-81a45c43b3c7
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{t}from"./react-CuiNlnus.js";import{$n as n,Ha as r,Jo as i,Li as a,Qn as o,Rs as s,_a as c,nn as l,qo as u}from"./app-p7iRIIoG.js";import{t as d}from"./render-node-DQMrGelM.js";import{t as f}from"./start-block-queries-kp3ICAXt.js";var p=e(t(),1),m=({name:e,tab:t,params:m})=>{let h=i().pages[e];if(!h)return(0,p.jsx)(u,{title:r(`notFound`),children:r.rich(`noPage`,{page:e})});let g=t=>s(n({page:e,...t&&{tab:t},given:m??{}}));return(0,p.jsx)(c,{route:{...t&&{tab:t},pathOf:g},children:(0,p.jsx)(o,{page:e,...t&&{tab:t},tree:h.tree,...m&&{given:m},children:(0,p.jsxs)(l,{tree:h.tree,plan:h.reads,children:[(0,p.jsx)(f,{tree:h.tree,plan:h.reads}),(0,p.jsx)(a,{children:(0,p.jsx)(d,{node:h.tree,at:``})})]})})})};export{m as ComposedPage};
2
- //# debugId=514cc06b-a4b2-42cc-9785-6d20e36ba307
1
+ (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{t}from"./react-CuiNlnus.js";import{$n as n,Ha as r,Jo as i,Li as a,Qn as o,Rs as s,_a as c,nn as l,qo as u}from"./app-BnDutf0s.js";import{t as d}from"./render-node-DGYXKoGV.js";import{t as f}from"./start-block-queries-CmVDv8_F.js";var p=e(t(),1),m=({name:e,tab:t,params:m})=>{let h=i().pages[e];if(!h)return(0,p.jsx)(u,{title:r(`notFound`),children:r.rich(`noPage`,{page:e})});let g=t=>s(n({page:e,...t&&{tab:t},given:m??{}}));return(0,p.jsx)(c,{route:{...t&&{tab:t},pathOf:g},children:(0,p.jsx)(o,{page:e,...t&&{tab:t},tree:h.tree,...m&&{given:m},children:(0,p.jsxs)(l,{tree:h.tree,plan:h.reads,children:[(0,p.jsx)(f,{tree:h.tree,plan:h.reads}),(0,p.jsx)(a,{children:(0,p.jsx)(d,{node:h.tree,at:``})})]})})})};export{m as ComposedPage};
2
+ //# debugId=5dcf3cee-ca3d-43c1-9d7f-38e4dc7b429a
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{t}from"./react-CuiNlnus.js";import{l as n}from"./app-p7iRIIoG.js";import{u as r}from"./render-node-DQMrGelM.js";var i=e(t(),1),a=({item:e,owner:t,recordKey:a})=>(0,i.jsx)(`div`,{className:`pb-8`,children:(0,i.jsx)(r,{resource:e.resource,field:e.text,values:{[e.field]:n(t,a)},placeholder:e.placeholder})});export{a as ComposerSection};
2
- //# debugId=c022305f-5d55-477a-9a9a-5c2c02e366ef
1
+ (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{t}from"./react-CuiNlnus.js";import{l as n}from"./app-BnDutf0s.js";import{u as r}from"./render-node-DGYXKoGV.js";var i=e(t(),1),a=({item:e,owner:t,recordKey:a})=>(0,i.jsx)(`div`,{className:`pb-8`,children:(0,i.jsx)(r,{resource:e.resource,field:e.text,values:{[e.field]:n(t,a)},placeholder:e.placeholder})});export{a as ComposerSection};
2
+ //# debugId=2b2e8ca1-b1e0-4952-99c7-3f11a4c79d14
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{G as r,Go as i,Hs as a,It as o,Jo as s,Ls as c,Qs as l,U as u,W as d,Xs as f,ao as p,cs as m,ds as h,io as g,ro as _}from"./app-p7iRIIoG.js";import{n as v,t as y}from"./client-publisher-D39SlIhp.js";var b=e(t(),1),x=[`localhost`,`127.0.0.1`,`[::1]`],S=[`javascript:`,`data:`,`vbscript:`,`file:`,`blob:`,`about:`],C=e=>{if(!URL.canParse(e))return;let t=new URL(e);if(t.protocol===`https:`)return{kind:`site`,host:t.host};if(t.protocol===`http:`)return x.includes(t.hostname)?{kind:`this-computer`,port:t.port||`80`}:void 0;if(!S.includes(t.protocol))return{kind:`device-app`,uri:e.split(`?`)[0].split(`#`)[0]}},w=e=>!URL.canParse(e,`http://local`)||!S.includes(new URL(e,`http://local`).protocol),T=(e,t)=>{let n=new URL(e,t.origin);if(n.origin===t.origin&&n.pathname===t.pathname)return c(n.search).oauthQuery},E=()=>{let{params:e}=a();return(0,b.useMemo)(()=>c(e.toString()),[e])},D=e(n(),1),O={invalid_signature:`This request has expired: connect again from your app.`,STAFF_CANNOT_CONNECT:`Staff signed in as someone cannot allow apps to act for them.`,SIGN_IN_SETUP_REQUIRED:`Set up what this app requires for signing in first, then connect again from your app.`,ADDRESS_NOT_VERIFIED:`Confirm your address first: sign out, then sign in with a code emailed to you, and connect again from your app.`},k=e=>{if(!(e instanceof h))throw e;return(e.code&&O[e.code])??i(e)},A=e=>t=>{if(!w(t))throw new h(`The app asked to be sent somewhere this page will not go.`,400);e(t)},j=({target:e})=>e.kind===`site`?(0,D.jsxs)(D.Fragment,{children:[`the website `,(0,D.jsx)(`strong`,{className:`font-medium text-foreground`,children:e.host})]}):e.kind===`this-computer`?(0,D.jsxs)(D.Fragment,{children:[`an app on this computer (port `,e.port,`)`]}):(0,D.jsxs)(D.Fragment,{children:[`an app on this device that opens `,(0,D.jsx)(`code`,{className:`break-all text-foreground`,children:e.uri})]}),M=({title:e,icon:t,children:n})=>(0,D.jsx)(_,{title:e,icon:t,children:(0,D.jsx)(`p`,{className:`text-muted-foreground`,children:n})}),N=({asking:e,appName:t,appIcon:n,email:i,onAnswer:a,onSignOut:o})=>{let[s,c]=(0,b.useState)(!1),l=d(500),u=e=>{c(!0),a(e).finally(()=>c(!1))},p=r(l&&!s,()=>u(!0)),m=v(e.client.client_name),h=y(e.client.client_id),{target:g}=e;return(0,D.jsx)(_,{title:`Allow an app to act as you in ${t}?`,icon:n,size:`md`,children:(0,D.jsxs)(`section`,{"aria-label":`Allow an app`,children:[(0,D.jsxs)(`p`,{children:[`An app that calls itself`,` `,(0,D.jsxs)(`bdi`,{className:`inline-block max-w-full truncate align-bottom font-medium`,title:m,children:[`“`,m??`no name`,`”`]}),` `,`asks to act as you here.`]}),h&&(0,D.jsxs)(`p`,{className:`mt-1 text-muted-foreground`,children:[`Published by `,h,`.`]}),g?(0,D.jsxs)(`p`,{className:`mt-3 text-muted-foreground`,children:[`Allowing sends you on to `,(0,D.jsx)(j,{target:g}),`.`]}):(0,D.jsx)(`p`,{role:`alert`,className:`mt-3 text-danger-text`,children:`This app asked to be sent somewhere this page will not go, so it cannot be allowed.`}),(0,D.jsx)(`p`,{className:`mt-3 text-muted-foreground`,children:`It can then read and change what you can, with your current role and organization, until you disconnect it from your account page.`}),(0,D.jsxs)(`div`,{className:`mt-5 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,children:[(0,D.jsx)(f,{disabled:s,onClick:()=>u(!1),children:`Deny`}),g&&(0,D.jsx)(f,{variant:`primary`,loading:s,disabled:!l||s,...p,children:`Allow`})]}),(0,D.jsxs)(`p`,{className:`mt-4 border-t pt-3 text-xs text-muted-foreground`,children:[`Signed in as `,i,`.`,` `,(0,D.jsx)(`button`,{type:`button`,className:`underline underline-offset-2 hover:text-foreground`,onClick:o,children:`Not you? Sign out`})]})]})})},P=({oauthQuery:e,appName:t,appIcon:n,email:r,assign:i})=>{let{session:o,signOut:s}=m(),{path:c,basePath:u}=a(),d=A(i),f=e=>T(e,{origin:window.location.origin,pathname:`${u}${c}`}),[p,h]=(0,b.useState)({kind:`loading`}),g=e=>h({kind:`failed`,message:k(e)});(0,b.useEffect)(()=>{let t=!0;return(async()=>{let{url:n}=await o.connect.resume(e),r=f(n);if(r===void 0)return d(n);let i=new URLSearchParams(r),a=await o.connect.client(i.get(`client_id`)??``);t&&h({kind:`asking`,asking:{oauthQuery:r,client:a,target:C(i.get(`redirect_uri`)??``)}})})().catch(e=>t&&g(e)),()=>{t=!1}},[o,e]);let _=async(e,t)=>{try{let{url:n}=await o.connect.answer(e,t.oauthQuery);f(n)!==void 0&&await s(),d(n)}catch(e){g(e)}};return p.kind===`failed`?(0,D.jsx)(M,{title:`This app cannot be connected`,icon:n,children:p.message}):p.kind===`loading`?(0,D.jsxs)(`div`,{className:`flex min-h-full w-full items-center justify-center gap-2 bg-surface text-muted-foreground`,children:[(0,D.jsx)(l,{}),` Loading`]}):(0,D.jsx)(N,{asking:p.asking,appName:t,appIcon:n,email:r,onAnswer:e=>_(e,p.asking),onSignOut:()=>void s()})},F=({email:e,appName:t,appIcon:n,isFramed:r=u,assign:i=e=>window.location.assign(e)})=>{let[a]=(0,b.useState)(r),{oauthQuery:o}=E();return a?(0,D.jsxs)(M,{title:`This page cannot be used inside another site`,icon:n,children:[(0,D.jsx)(`a`,{href:window.location.href,target:`_blank`,rel:`noopener`,className:`underline underline-offset-2`,children:`Open it on its own`}),` `,`to go on.`]}):o?(0,D.jsx)(P,{oauthQuery:o,appName:t,appIcon:n,email:e,assign:i},o):(0,D.jsx)(M,{title:`Nothing to connect`,icon:n,children:`Connect again from your app.`})},I={title:`Sign in to connect an app`,description:`An app asks to act as you here. Sign in, then choose whether to allow it.`},L=()=>{let e=s(),{state:t}=m();return p(g([`Connect an app`],e.appName)),t.kind===`signed-in`?(0,D.jsx)(F,{email:t.user.email,appName:e.appName??`this app`,appIcon:e.appIcon}):(0,D.jsx)(_,{title:I.title,description:I.description,icon:e.appIcon,children:(0,D.jsx)(`div`,{className:`flex flex-col gap-2 [&>*]:min-h-10 [&>*]:w-full`,children:(0,D.jsx)(o,{prompt:I})})})};export{L as ConnectRoute};
2
- //# debugId=c0a65ede-d1eb-4d36-be34-92007b287046
1
+ (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{G as r,Go as i,Hs as a,It as o,Jo as s,Ls as c,Qs as l,U as u,W as d,Xs as f,ao as p,cs as m,ds as h,io as g,ro as _}from"./app-BnDutf0s.js";import{n as v,t as y}from"./client-publisher-D39SlIhp.js";var b=e(t(),1),x=[`localhost`,`127.0.0.1`,`[::1]`],S=[`javascript:`,`data:`,`vbscript:`,`file:`,`blob:`,`about:`],C=e=>{if(!URL.canParse(e))return;let t=new URL(e);if(t.protocol===`https:`)return{kind:`site`,host:t.host};if(t.protocol===`http:`)return x.includes(t.hostname)?{kind:`this-computer`,port:t.port||`80`}:void 0;if(!S.includes(t.protocol))return{kind:`device-app`,uri:e.split(`?`)[0].split(`#`)[0]}},w=e=>!URL.canParse(e,`http://local`)||!S.includes(new URL(e,`http://local`).protocol),T=(e,t)=>{let n=new URL(e,t.origin);if(n.origin===t.origin&&n.pathname===t.pathname)return c(n.search).oauthQuery},E=()=>{let{params:e}=a();return(0,b.useMemo)(()=>c(e.toString()),[e])},D=e(n(),1),O={invalid_signature:`This request has expired: connect again from your app.`,STAFF_CANNOT_CONNECT:`Staff signed in as someone cannot allow apps to act for them.`,SIGN_IN_SETUP_REQUIRED:`Set up what this app requires for signing in first, then connect again from your app.`,ADDRESS_NOT_VERIFIED:`Confirm your address first: sign out, then sign in with a code emailed to you, and connect again from your app.`},k=e=>{if(!(e instanceof h))throw e;return(e.code&&O[e.code])??i(e)},A=e=>t=>{if(!w(t))throw new h(`The app asked to be sent somewhere this page will not go.`,400);e(t)},j=({target:e})=>e.kind===`site`?(0,D.jsxs)(D.Fragment,{children:[`the website `,(0,D.jsx)(`strong`,{className:`font-medium text-foreground`,children:e.host})]}):e.kind===`this-computer`?(0,D.jsxs)(D.Fragment,{children:[`an app on this computer (port `,e.port,`)`]}):(0,D.jsxs)(D.Fragment,{children:[`an app on this device that opens `,(0,D.jsx)(`code`,{className:`break-all text-foreground`,children:e.uri})]}),M=({title:e,icon:t,children:n})=>(0,D.jsx)(_,{title:e,icon:t,children:(0,D.jsx)(`p`,{className:`text-muted-foreground`,children:n})}),N=({asking:e,appName:t,appIcon:n,email:i,onAnswer:a,onSignOut:o})=>{let[s,c]=(0,b.useState)(!1),l=d(500),u=e=>{c(!0),a(e).finally(()=>c(!1))},p=r(l&&!s,()=>u(!0)),m=v(e.client.client_name),h=y(e.client.client_id),{target:g}=e;return(0,D.jsx)(_,{title:`Allow an app to act as you in ${t}?`,icon:n,size:`md`,children:(0,D.jsxs)(`section`,{"aria-label":`Allow an app`,children:[(0,D.jsxs)(`p`,{children:[`An app that calls itself`,` `,(0,D.jsxs)(`bdi`,{className:`inline-block max-w-full truncate align-bottom font-medium`,title:m,children:[`“`,m??`no name`,`”`]}),` `,`asks to act as you here.`]}),h&&(0,D.jsxs)(`p`,{className:`mt-1 text-muted-foreground`,children:[`Published by `,h,`.`]}),g?(0,D.jsxs)(`p`,{className:`mt-3 text-muted-foreground`,children:[`Allowing sends you on to `,(0,D.jsx)(j,{target:g}),`.`]}):(0,D.jsx)(`p`,{role:`alert`,className:`mt-3 text-danger-text`,children:`This app asked to be sent somewhere this page will not go, so it cannot be allowed.`}),(0,D.jsx)(`p`,{className:`mt-3 text-muted-foreground`,children:`It can then read and change what you can, with your current role and organization, until you disconnect it from your account page.`}),(0,D.jsxs)(`div`,{className:`mt-5 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,children:[(0,D.jsx)(f,{disabled:s,onClick:()=>u(!1),children:`Deny`}),g&&(0,D.jsx)(f,{variant:`primary`,loading:s,disabled:!l||s,...p,children:`Allow`})]}),(0,D.jsxs)(`p`,{className:`mt-4 border-t pt-3 text-xs text-muted-foreground`,children:[`Signed in as `,i,`.`,` `,(0,D.jsx)(`button`,{type:`button`,className:`underline underline-offset-2 hover:text-foreground`,onClick:o,children:`Not you? Sign out`})]})]})})},P=({oauthQuery:e,appName:t,appIcon:n,email:r,assign:i})=>{let{session:o,signOut:s}=m(),{path:c,basePath:u}=a(),d=A(i),f=e=>T(e,{origin:window.location.origin,pathname:`${u}${c}`}),[p,h]=(0,b.useState)({kind:`loading`}),g=e=>h({kind:`failed`,message:k(e)});(0,b.useEffect)(()=>{let t=!0;return(async()=>{let{url:n}=await o.connect.resume(e),r=f(n);if(r===void 0)return d(n);let i=new URLSearchParams(r),a=await o.connect.client(i.get(`client_id`)??``);t&&h({kind:`asking`,asking:{oauthQuery:r,client:a,target:C(i.get(`redirect_uri`)??``)}})})().catch(e=>t&&g(e)),()=>{t=!1}},[o,e]);let _=async(e,t)=>{try{let{url:n}=await o.connect.answer(e,t.oauthQuery);f(n)!==void 0&&await s(),d(n)}catch(e){g(e)}};return p.kind===`failed`?(0,D.jsx)(M,{title:`This app cannot be connected`,icon:n,children:p.message}):p.kind===`loading`?(0,D.jsxs)(`div`,{className:`flex min-h-full w-full items-center justify-center gap-2 bg-surface text-muted-foreground`,children:[(0,D.jsx)(l,{}),` Loading`]}):(0,D.jsx)(N,{asking:p.asking,appName:t,appIcon:n,email:r,onAnswer:e=>_(e,p.asking),onSignOut:()=>void s()})},F=({email:e,appName:t,appIcon:n,isFramed:r=u,assign:i=e=>window.location.assign(e)})=>{let[a]=(0,b.useState)(r),{oauthQuery:o}=E();return a?(0,D.jsxs)(M,{title:`This page cannot be used inside another site`,icon:n,children:[(0,D.jsx)(`a`,{href:window.location.href,target:`_blank`,rel:`noopener`,className:`underline underline-offset-2`,children:`Open it on its own`}),` `,`to go on.`]}):o?(0,D.jsx)(P,{oauthQuery:o,appName:t,appIcon:n,email:e,assign:i},o):(0,D.jsx)(M,{title:`Nothing to connect`,icon:n,children:`Connect again from your app.`})},I={title:`Sign in to connect an app`,description:`An app asks to act as you here. Sign in, then choose whether to allow it.`},L=()=>{let e=s(),{state:t}=m();return p(g([`Connect an app`],e.appName)),t.kind===`signed-in`?(0,D.jsx)(F,{email:t.user.email,appName:e.appName??`this app`,appIcon:e.appIcon}):(0,D.jsx)(_,{title:I.title,description:I.description,icon:e.appIcon,children:(0,D.jsx)(`div`,{className:`flex flex-col gap-2 [&>*]:min-h-10 [&>*]:w-full`,children:(0,D.jsx)(o,{prompt:I})})})};export{L as ConnectRoute};
2
+ //# debugId=7dc4d362-7aad-4e90-b556-78619a32369b
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Tc as r,ss as i,vc as a}from"./app-p7iRIIoG.js";var o=e(t(),1),s=e(n(),1),c=({value:e,copyLabel:t})=>{let[n,c]=(0,o.useState)();return(0,o.useEffect)(()=>{if(n!==`yes`)return;let e=setTimeout(()=>c(void 0),2e3);return()=>clearTimeout(e)},[n]),(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border bg-surface py-1.5 pl-3 pr-1.5`,children:[(0,s.jsx)(`code`,{className:`min-w-0 flex-1 break-all font-mono text-xs`,children:e}),(0,s.jsx)(`button`,{type:`button`,"aria-label":n===`yes`?i(`copied`):t,onClick:()=>{if(!navigator.clipboard)return c(`refused`);navigator.clipboard.writeText(e).then(()=>c(`yes`),e=>{if(!(e instanceof DOMException))throw e;c(`refused`)})},className:`inline-flex size-8 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted pointer-coarse:size-11`,children:n===`yes`?(0,s.jsx)(r,{className:`size-4 text-success`}):(0,s.jsx)(a,{className:`size-4`})})]}),n===`refused`&&(0,s.jsx)(`p`,{role:`alert`,className:`mt-1.5 text-xs font-medium text-danger-text`,children:i(`copyRefused`)})]})};export{c as t};
2
- //# debugId=47657d03-4ad4-4160-87ca-474426cd9629
1
+ (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Tc as r,ss as i,vc as a}from"./app-BnDutf0s.js";var o=e(t(),1),s=e(n(),1),c=({value:e,copyLabel:t})=>{let[n,c]=(0,o.useState)();return(0,o.useEffect)(()=>{if(n!==`yes`)return;let e=setTimeout(()=>c(void 0),2e3);return()=>clearTimeout(e)},[n]),(0,s.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border bg-surface py-1.5 pl-3 pr-1.5`,children:[(0,s.jsx)(`code`,{className:`min-w-0 flex-1 break-all font-mono text-xs`,children:e}),(0,s.jsx)(`button`,{type:`button`,"aria-label":n===`yes`?i(`copied`):t,onClick:()=>{if(!navigator.clipboard)return c(`refused`);navigator.clipboard.writeText(e).then(()=>c(`yes`),e=>{if(!(e instanceof DOMException))throw e;c(`refused`)})},className:`inline-flex size-8 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted pointer-coarse:size-11`,children:n===`yes`?(0,s.jsx)(r,{className:`size-4 text-success`}):(0,s.jsx)(a,{className:`size-4`})})]}),n===`refused`&&(0,s.jsx)(`p`,{role:`alert`,className:`mt-1.5 text-xs font-medium text-danger-text`,children:i(`copyRefused`)})]})};export{c as t};
2
+ //# debugId=e40b21cf-c209-45c3-9b29-c58f8b200724
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Ca as r,Jo as i,N as a,P as o,R as s,Vs as c,Ws as l,Yo as u,Zc as d,bl as f,oo as p,qo as m,r as h,vl as g,zr as _}from"./app-p7iRIIoG.js";import{ComposedPage as v}from"./composed-page-BRTMBrpL.js";import{t as y}from"./record-opens-DQrqEFru.js";var b=e(t(),1),x=e(n(),1),S=({noun:e,collection:t,sections:n,width:r,saving:i,message:c,onSubmit:l,onCancel:u,ref:d})=>(0,x.jsx)(a,{ref:d,title:p(`title`,{noun:e}),eyebrow:t,width:r,submit:p(`submit`,{noun:e}),saving:i,error:c?Error(c):void 0,errorTitle:p(`notCreated`),onSubmit:l,onCancel:u,children:n.map(e=>(0,x.jsx)(o,{title:e.title,help:e.help,children:(0,x.jsx)(`div`,{className:`grid grid-cols-1 gap-x-6 gap-y-5 sm:grid-cols-2`,children:e.fields.map(e=>(0,x.jsx)(s,{name:e.name,label:e.label,required:e.required,help:e.help,error:e.error,wide:e.wide,children:e.editor},e.name))})},e.title))}),C=({resource:e,values:t})=>{let n=i(),a=n.resources[e],o=u(e);return a?r(o,`create`)?(0,x.jsx)(w,{resource:e,values:t}):(0,x.jsx)(m,{title:p(`notAllowed`),children:p(`cannotCreate`,{plural:n.views[e]?.names?.plural.toLowerCase()??e})}):(0,x.jsx)(m,{title:l(`notFound`),children:l(`noResource`,{name:e})})},w=({resource:e,values:t})=>{let n=i().views[e],{go:r}=_(),[a,o]=(0,b.useState)(),s=h({resource:e,values:t,onCreated:(e,t)=>o(t)});c(!a&&(s.touched||s.saving),`input-lost`),(0,b.useEffect)(()=>{a&&r(a,{replace:!0})},[a,r]);let l=n?.names?.singular??d(e);return(0,x.jsx)(S,{ref:s.ref,noun:l,collection:n?.names?.plural??d(e),sections:s.sections,width:n?.recordWidth,saving:s.saving,message:s.message,onSubmit:()=>void s.submit(),onCancel:()=>r({kind:`list`,resource:e})})},T=({resource:e,values:t})=>{let n=i(),r=n.views[e];return r?.createOpens&&g(r.createOpens).every(e=>t?.[e])?(0,x.jsx)(y,{to:f(r.createOpens,t)}):r?.create?n.pages[r.create.page]?(0,x.jsx)(v,{name:r.create.page}):(0,x.jsx)(m,{title:p(`notAllowed`),children:p(`cannotCreate`,{plural:r.names?.plural.toLowerCase()??d(e)})}):(0,x.jsx)(C,{resource:e,values:t},new URLSearchParams(t).toString())};export{T as CreateRoute};
2
- //# debugId=15e4935c-fcaa-4a0a-8568-441066b4783e
1
+ (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Ca as r,Jo as i,N as a,P as o,R as s,Vs as c,Ws as l,Yo as u,Zc as d,bl as f,oo as p,qo as m,r as h,vl as g,zr as _}from"./app-BnDutf0s.js";import{ComposedPage as v}from"./composed-page-Bdzzzuyj.js";import{t as y}from"./record-opens-Dbjd4FLe.js";var b=e(t(),1),x=e(n(),1),S=({noun:e,collection:t,sections:n,width:r,saving:i,message:c,onSubmit:l,onCancel:u,ref:d})=>(0,x.jsx)(a,{ref:d,title:p(`title`,{noun:e}),eyebrow:t,width:r,submit:p(`submit`,{noun:e}),saving:i,error:c?Error(c):void 0,errorTitle:p(`notCreated`),onSubmit:l,onCancel:u,children:n.map(e=>(0,x.jsx)(o,{title:e.title,help:e.help,children:(0,x.jsx)(`div`,{className:`grid grid-cols-1 gap-x-6 gap-y-5 sm:grid-cols-2`,children:e.fields.map(e=>(0,x.jsx)(s,{name:e.name,label:e.label,required:e.required,help:e.help,error:e.error,wide:e.wide,children:e.editor},e.name))})},e.title))}),C=({resource:e,values:t})=>{let n=i(),a=n.resources[e],o=u(e);return a?r(o,`create`)?(0,x.jsx)(w,{resource:e,values:t}):(0,x.jsx)(m,{title:p(`notAllowed`),children:p(`cannotCreate`,{plural:n.views[e]?.names?.plural.toLowerCase()??e})}):(0,x.jsx)(m,{title:l(`notFound`),children:l(`noResource`,{name:e})})},w=({resource:e,values:t})=>{let n=i().views[e],{go:r}=_(),[a,o]=(0,b.useState)(),s=h({resource:e,values:t,onCreated:(e,t)=>o(t)});c(!a&&(s.touched||s.saving),`input-lost`),(0,b.useEffect)(()=>{a&&r(a,{replace:!0})},[a,r]);let l=n?.names?.singular??d(e);return(0,x.jsx)(S,{ref:s.ref,noun:l,collection:n?.names?.plural??d(e),sections:s.sections,width:n?.recordWidth,saving:s.saving,message:s.message,onSubmit:()=>void s.submit(),onCancel:()=>r({kind:`list`,resource:e})})},T=({resource:e,values:t})=>{let n=i(),r=n.views[e];return r?.createOpens&&g(r.createOpens).every(e=>t?.[e])?(0,x.jsx)(y,{to:f(r.createOpens,t)}):r?.create?n.pages[r.create.page]?(0,x.jsx)(v,{name:r.create.page}):(0,x.jsx)(m,{title:p(`notAllowed`),children:p(`cannotCreate`,{plural:r.names?.plural.toLowerCase()??d(e)})}):(0,x.jsx)(C,{resource:e,values:t},new URLSearchParams(t).toString())};export{T as CreateRoute};
2
+ //# debugId=c1aefe4a-aa21-4e33-8761-cd3fe85ca8cd
@@ -1,6 +1,6 @@
1
- (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Bn as r,Gc as i,Un as a,Xs as o,cc as s,ec as c,mo as l,po as u,zc as d,zn as f}from"./app-p7iRIIoG.js";var p=e(t(),1),m=e=>typeof e==`object`&&!!e&&!Array.isArray(e),h=e=>{let t=m(e)?e:{};return{dockerfile:typeof t.dockerfile==`string`?t.dockerfile:``,files:m(t.files)?Object.entries(t.files).map(([e,t])=>[e,typeof t==`string`?t:JSON.stringify(t)]):[],command:Array.isArray(t.command)?t.command.map(String):[]}},g=e=>{if(e.trimStart().startsWith(`[`))try{let t=JSON.parse(e);return Array.isArray(t)&&t.every(e=>typeof e==`string`)?t:void 0}catch{return}},_=e=>g(e)??e.split(`
1
+ (function(){try{var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:protobase-app":!0})}catch{}})();import{o as e}from"./rolldown-runtime-DFwUHQ4A.js";import{i as t,t as n}from"./react-CuiNlnus.js";import{Bn as r,Gc as i,Un as a,Xs as o,cc as s,ec as c,mo as l,po as u,zc as d,zn as f}from"./app-BnDutf0s.js";var p=e(t(),1),m=e=>typeof e==`object`&&!!e&&!Array.isArray(e),h=e=>{let t=m(e)?e:{};return{dockerfile:typeof t.dockerfile==`string`?t.dockerfile:``,files:m(t.files)?Object.entries(t.files).map(([e,t])=>[e,typeof t==`string`?t:JSON.stringify(t)]):[],command:Array.isArray(t.command)?t.command.map(String):[]}},g=e=>{if(e.trimStart().startsWith(`[`))try{let t=JSON.parse(e);return Array.isArray(t)&&t.every(e=>typeof e==`string`)?t:void 0}catch{return}},_=e=>g(e)??e.split(`
2
2
  `).filter(e=>e!==``),v=e=>e.some(e=>e.includes(`
3
3
  `))?JSON.stringify(e):e.join(`
4
4
  `),y=({dockerfile:e,files:t,command:n})=>({dockerfile:e,files:Object.fromEntries(t),...n.length>0&&{command:n}}),b=d(`app/field-types/custom-step-container`),x=e(n(),1),S=({title:e,children:t})=>(0,x.jsxs)(`div`,{className:`grid gap-1`,children:[(0,x.jsx)(`h5`,{className:`text-xs font-medium text-muted-foreground`,children:e}),t]}),C=({value:e})=>{if(e===null)return(0,x.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let t=h(e);return(0,x.jsxs)(`div`,{className:`grid gap-3`,children:[(0,x.jsx)(S,{title:b(`dockerfile`),children:(0,x.jsx)(f,{children:t.dockerfile})}),t.files.map(([e,t])=>(0,x.jsx)(S,{title:(0,x.jsx)(`span`,{className:`font-mono`,children:e}),children:(0,x.jsx)(f,{children:t})},e)),(0,x.jsx)(S,{title:b(`command`),children:t.command.length>0?(0,x.jsx)(f,{children:JSON.stringify(t.command)}):(0,x.jsx)(`p`,{className:`text-body text-muted-foreground`,children:b(`ownCommand`)})})]})},w=({value:e})=>{if(e===null)return null;let t=h(e);return(0,x.jsx)(a,{text:b(`summary`,{files:t.files.length,line:t.dockerfile.split(`
5
5
  `)[0]??``})})},T=({value:e,onChange:t,invalid:n})=>{let i=h(e),a=JSON.stringify(e??null),[d,f]=(0,p.useState)(()=>({seen:a,files:i.files,command:v(i.command)}));d.seen!==a&&f({seen:a,files:i.files,command:v(i.command)});let{files:m,command:g}=d,S=(0,p.useId)(),C=e=>{let n={files:e.files??m,command:e.command??g},r=y({dockerfile:e.dockerfile??i.dockerfile,files:n.files,command:e.command===void 0?i.command:_(e.command)});f({seen:JSON.stringify(r),...n}),t(r)},w=e=>C({files:e}),T=(e,t)=>e||b(`fileNumber`,{number:t+1});return(0,x.jsxs)(`div`,{className:`grid gap-3`,children:[(0,x.jsx)(r,{value:i.dockerfile,rows:6,invalid:n,className:`font-mono text-xs`,spellCheck:!1,onChange:e=>C({dockerfile:e.target.value})}),(0,x.jsxs)(l.Provider,{value:void 0,children:[m.map(([e,t],n)=>(0,x.jsxs)(`div`,{className:`grid gap-1.5 rounded-md border p-2`,role:`group`,"aria-label":T(e,n),children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(u,{value:e,"aria-label":b(`path`),placeholder:b(`pathExample`),className:`font-mono`,spellCheck:!1,wrapperClassName:`flex-1`,onChange:e=>w(m.map((r,i)=>i===n?[e.target.value,t]:r))}),(0,x.jsx)(o,{type:`button`,size:`icon`,variant:`ghost`,"aria-label":b(`removeFile`,{path:T(e,n)}),onClick:()=>w(m.filter((e,t)=>t!==n)),children:(0,x.jsx)(c,{className:`size-4`})})]}),(0,x.jsx)(r,{value:t,rows:4,"aria-label":b(`fileText`,{path:T(e,n)}),className:`font-mono text-xs`,spellCheck:!1,onChange:t=>w(m.map((r,i)=>i===n?[e,t.target.value]:r))})]},n)),(0,x.jsxs)(o,{type:`button`,size:`sm`,className:`justify-self-start`,onClick:()=>w([...m,[``,``]]),children:[(0,x.jsx)(s,{className:`size-4`}),b(`addFile`)]}),(0,x.jsxs)(`div`,{className:`grid gap-1`,children:[(0,x.jsx)(`label`,{htmlFor:`${S}-command`,className:`text-xs font-medium text-muted-foreground`,children:b(`commandLines`)}),(0,x.jsx)(r,{id:`${S}-command`,value:g,rows:2,className:`font-mono text-xs`,spellCheck:!1,onChange:e=>C({command:e.target.value})})]})]})]})},E={of:[...i.custom_step_container],display:C,editor:T,cell:w,wide:!0};export{E as customStepContainerField};
6
- //# debugId=c2dbba22-b90e-432c-9baa-3496cb7b2c61
6
+ //# debugId=e8e69589-feaf-4dd8-ad7c-c781b45448a0