@arbidocs/blocks 0.4.146 → 0.4.150

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/dist/ConnectedNativeDocxComparison-3XQSINPQ.cjs +44 -0
  2. package/dist/ConnectedNativeDocxComparison-3XQSINPQ.cjs.map +1 -0
  3. package/dist/ConnectedNativeDocxComparison-XQSXVGHR.js +35 -0
  4. package/dist/ConnectedNativeDocxComparison-XQSXVGHR.js.map +1 -0
  5. package/dist/ConnectedNativeDocxEditor-IPEZDERL.js +33 -0
  6. package/dist/ConnectedNativeDocxEditor-IPEZDERL.js.map +1 -0
  7. package/dist/ConnectedNativeDocxEditor-OUWFMIPH.cjs +46 -0
  8. package/dist/ConnectedNativeDocxEditor-OUWFMIPH.cjs.map +1 -0
  9. package/dist/ConnectedStreamedWordArtifact-D5LSMDO4.cjs +44 -0
  10. package/dist/ConnectedStreamedWordArtifact-D5LSMDO4.cjs.map +1 -0
  11. package/dist/ConnectedStreamedWordArtifact-UZVNBKQB.js +35 -0
  12. package/dist/ConnectedStreamedWordArtifact-UZVNBKQB.js.map +1 -0
  13. package/dist/FactTextEditor-YESAU2IJ.js +25 -0
  14. package/dist/FactTextEditor-YESAU2IJ.js.map +1 -0
  15. package/dist/FactTextEditor-YUPBCTXK.cjs +27 -0
  16. package/dist/FactTextEditor-YUPBCTXK.cjs.map +1 -0
  17. package/dist/{NativeDocxEditor-BE2OEOTJ.cjs → NativeDocxEditor-5VBNM5I7.cjs} +8 -8
  18. package/dist/{NativeDocxEditor-BE2OEOTJ.cjs.map → NativeDocxEditor-5VBNM5I7.cjs.map} +1 -1
  19. package/dist/{NativeDocxEditor-KOPFMRYW.js → NativeDocxEditor-XT5ZLFGU.js} +4 -4
  20. package/dist/{NativeDocxEditor-KOPFMRYW.js.map → NativeDocxEditor-XT5ZLFGU.js.map} +1 -1
  21. package/dist/agents/index.cjs +265 -266
  22. package/dist/agents/index.js +8 -9
  23. package/dist/calendar/index.cjs +117 -125
  24. package/dist/calendar/index.d.ts +0 -1
  25. package/dist/calendar/index.js +1 -1
  26. package/dist/calls/index.cjs +3 -3
  27. package/dist/calls/index.js +2 -2
  28. package/dist/chat/index.cjs +78 -78
  29. package/dist/chat/index.js +3 -3
  30. package/dist/{chunk-2FL7QJKJ.js → chunk-265GOG4W.js} +3 -3
  31. package/dist/{chunk-2FL7QJKJ.js.map → chunk-265GOG4W.js.map} +1 -1
  32. package/dist/{chunk-IJST4EBM.js → chunk-3E2F4AHD.js} +8 -8
  33. package/dist/{chunk-IJST4EBM.js.map → chunk-3E2F4AHD.js.map} +1 -1
  34. package/dist/chunk-3FSXWVHW.cjs +5184 -0
  35. package/dist/chunk-3FSXWVHW.cjs.map +1 -0
  36. package/dist/{chunk-LPYEUD2D.cjs → chunk-4JNKXOFZ.cjs} +3 -3
  37. package/dist/{chunk-LPYEUD2D.cjs.map → chunk-4JNKXOFZ.cjs.map} +1 -1
  38. package/dist/{chunk-ODRHHWHY.cjs → chunk-4KMLM3GY.cjs} +4 -4
  39. package/dist/chunk-4KMLM3GY.cjs.map +1 -0
  40. package/dist/{chunk-MHFF5N65.cjs → chunk-757OYF6G.cjs} +4 -38
  41. package/dist/chunk-757OYF6G.cjs.map +1 -0
  42. package/dist/chunk-AXTDDWMR.js +16 -0
  43. package/dist/chunk-AXTDDWMR.js.map +1 -0
  44. package/dist/{chunk-B3AHCIV5.js → chunk-BJ24VPOA.js} +4 -55
  45. package/dist/chunk-BJ24VPOA.js.map +1 -0
  46. package/dist/chunk-C7PTF6BQ.cjs +172 -0
  47. package/dist/chunk-C7PTF6BQ.cjs.map +1 -0
  48. package/dist/{chunk-T5B7FM7S.js → chunk-COA3S3CZ.js} +3 -3
  49. package/dist/{chunk-T5B7FM7S.js.map → chunk-COA3S3CZ.js.map} +1 -1
  50. package/dist/{chunk-C44TDH54.js → chunk-CQPFW64W.js} +5 -5
  51. package/dist/{chunk-C44TDH54.js.map → chunk-CQPFW64W.js.map} +1 -1
  52. package/dist/chunk-D3WFIFRY.cjs +659 -0
  53. package/dist/chunk-D3WFIFRY.cjs.map +1 -0
  54. package/dist/{chunk-QXMR5YHC.js → chunk-DIB4JYUY.js} +19 -3
  55. package/dist/chunk-DIB4JYUY.js.map +1 -0
  56. package/dist/chunk-DVB5ZKOF.js +22 -0
  57. package/dist/chunk-DVB5ZKOF.js.map +1 -0
  58. package/dist/{chunk-VHJHY7TT.js → chunk-ECERC6TI.js} +3 -3
  59. package/dist/{chunk-VHJHY7TT.js.map → chunk-ECERC6TI.js.map} +1 -1
  60. package/dist/chunk-EDV7CYG6.cjs +18 -0
  61. package/dist/chunk-EDV7CYG6.cjs.map +1 -0
  62. package/dist/chunk-FAXXN7KI.cjs +213 -0
  63. package/dist/chunk-FAXXN7KI.cjs.map +1 -0
  64. package/dist/{chunk-2MJWWPHY.js → chunk-G4IYES7G.js} +140 -15
  65. package/dist/chunk-G4IYES7G.js.map +1 -0
  66. package/dist/{chunk-MFMASSEO.cjs → chunk-GGTUMLCT.cjs} +93 -91
  67. package/dist/chunk-GGTUMLCT.cjs.map +1 -0
  68. package/dist/{chunk-QI6AIHWP.cjs → chunk-GOWXP5KT.cjs} +145 -14
  69. package/dist/chunk-GOWXP5KT.cjs.map +1 -0
  70. package/dist/{chunk-O6IEZDRC.cjs → chunk-GRGS5M6O.cjs} +181 -3
  71. package/dist/chunk-GRGS5M6O.cjs.map +1 -0
  72. package/dist/{chunk-A6IU4GIW.js → chunk-HGLC566X.js} +598 -13
  73. package/dist/chunk-HGLC566X.js.map +1 -0
  74. package/dist/{chunk-O2GW5IY6.cjs → chunk-ILM42LE6.cjs} +33 -33
  75. package/dist/{chunk-O2GW5IY6.cjs.map → chunk-ILM42LE6.cjs.map} +1 -1
  76. package/dist/{chunk-C3CGJK7A.cjs → chunk-IPQ5MJ4Z.cjs} +636 -31
  77. package/dist/chunk-IPQ5MJ4Z.cjs.map +1 -0
  78. package/dist/{chunk-NRFAWUVD.js → chunk-JAANWQGB.js} +157 -157
  79. package/dist/chunk-JAANWQGB.js.map +1 -0
  80. package/dist/{chunk-7RJTEWYM.js → chunk-JGOST4IL.js} +350 -64
  81. package/dist/chunk-JGOST4IL.js.map +1 -0
  82. package/dist/chunk-KHXEIEXN.js +41 -0
  83. package/dist/chunk-KHXEIEXN.js.map +1 -0
  84. package/dist/chunk-KLPRAQCE.cjs +22 -0
  85. package/dist/chunk-KLPRAQCE.cjs.map +1 -0
  86. package/dist/chunk-KQYPP72K.js +644 -0
  87. package/dist/chunk-KQYPP72K.js.map +1 -0
  88. package/dist/chunk-KUT2Y7JF.cjs +43 -0
  89. package/dist/chunk-KUT2Y7JF.cjs.map +1 -0
  90. package/dist/{chunk-6YTHQ73P.cjs → chunk-LLYZGH3L.cjs} +3 -56
  91. package/dist/chunk-LLYZGH3L.cjs.map +1 -0
  92. package/dist/{chunk-YSHIC4NJ.cjs → chunk-LXTOOUEN.cjs} +159 -154
  93. package/dist/chunk-LXTOOUEN.cjs.map +1 -0
  94. package/dist/{chunk-EVUEIBNU.js → chunk-M4S75AEJ.js} +44 -5
  95. package/dist/chunk-M4S75AEJ.js.map +1 -0
  96. package/dist/{chunk-V5OAXIBN.cjs → chunk-NPR5BGFF.cjs} +11 -11
  97. package/dist/{chunk-V5OAXIBN.cjs.map → chunk-NPR5BGFF.cjs.map} +1 -1
  98. package/dist/{chunk-PLJ7PHWU.cjs → chunk-NS7NVX4E.cjs} +3 -3
  99. package/dist/{chunk-PLJ7PHWU.cjs.map → chunk-NS7NVX4E.cjs.map} +1 -1
  100. package/dist/{chunk-RB7GX2VT.cjs → chunk-NWNAYXC7.cjs} +9 -9
  101. package/dist/{chunk-RB7GX2VT.cjs.map → chunk-NWNAYXC7.cjs.map} +1 -1
  102. package/dist/chunk-Q6N6MZKO.js +5004 -0
  103. package/dist/chunk-Q6N6MZKO.js.map +1 -0
  104. package/dist/{chunk-I2QSDQQV.cjs → chunk-QT3A4PFC.cjs} +21 -2
  105. package/dist/chunk-QT3A4PFC.cjs.map +1 -0
  106. package/dist/{chunk-6HCJ3ZEU.js → chunk-R6VCPDPF.js} +178 -6
  107. package/dist/chunk-R6VCPDPF.js.map +1 -0
  108. package/dist/{chunk-ZM26YEOT.js → chunk-RY2SODRN.js} +3 -3
  109. package/dist/{chunk-ZM26YEOT.js.map → chunk-RY2SODRN.js.map} +1 -1
  110. package/dist/chunk-SDOEHEJP.js +208 -0
  111. package/dist/chunk-SDOEHEJP.js.map +1 -0
  112. package/dist/{chunk-DETZZBG2.cjs → chunk-SIB6C7P7.cjs} +43 -2
  113. package/dist/chunk-SIB6C7P7.cjs.map +1 -0
  114. package/dist/{chunk-OPTBQSCV.cjs → chunk-SMN32BQ3.cjs} +4 -183
  115. package/dist/chunk-SMN32BQ3.cjs.map +1 -0
  116. package/dist/chunk-TAWPVD6C.cjs +1956 -0
  117. package/dist/chunk-TAWPVD6C.cjs.map +1 -0
  118. package/dist/chunk-TC25LGIM.js +6584 -0
  119. package/dist/chunk-TC25LGIM.js.map +1 -0
  120. package/dist/{chunk-OBWYM25Y.js → chunk-TL45OJQE.js} +85 -83
  121. package/dist/chunk-TL45OJQE.js.map +1 -0
  122. package/dist/{chunk-AOSUHWIL.js → chunk-TZOQKV64.js} +4 -37
  123. package/dist/chunk-TZOQKV64.js.map +1 -0
  124. package/dist/chunk-UTVY63DG.js +16 -0
  125. package/dist/chunk-UTVY63DG.js.map +1 -0
  126. package/dist/chunk-V4YZXGXR.cjs +6751 -0
  127. package/dist/chunk-V4YZXGXR.cjs.map +1 -0
  128. package/dist/chunk-XRWHFMHK.js +19 -0
  129. package/dist/chunk-XRWHFMHK.js.map +1 -0
  130. package/dist/{chunk-O4YPVYPO.cjs → chunk-YAEXSCUW.cjs} +364 -60
  131. package/dist/chunk-YAEXSCUW.cjs.map +1 -0
  132. package/dist/chunk-YIFCLNII.cjs +18 -0
  133. package/dist/chunk-YIFCLNII.cjs.map +1 -0
  134. package/dist/chunk-Z27QMJ6S.cjs +25 -0
  135. package/dist/chunk-Z27QMJ6S.cjs.map +1 -0
  136. package/dist/{chunk-CSI2B2H5.js → chunk-Z4NQ3TED.js} +4 -4
  137. package/dist/chunk-Z4NQ3TED.js.map +1 -0
  138. package/dist/{chunk-DWZXSPMB.cjs → chunk-ZAVEMQ37.cjs} +3 -3
  139. package/dist/{chunk-DWZXSPMB.cjs.map → chunk-ZAVEMQ37.cjs.map} +1 -1
  140. package/dist/{chunk-FUTMU4FR.js → chunk-ZLEYLCE4.js} +8 -181
  141. package/dist/chunk-ZLEYLCE4.js.map +1 -0
  142. package/dist/chunk-ZNLTEZEF.js +170 -0
  143. package/dist/chunk-ZNLTEZEF.js.map +1 -0
  144. package/dist/chunk-ZO7PJMCO.js +1907 -0
  145. package/dist/chunk-ZO7PJMCO.js.map +1 -0
  146. package/dist/citations/index.cjs +14 -14
  147. package/dist/citations/index.js +2 -2
  148. package/dist/collaboration/index.cjs +74 -74
  149. package/dist/collaboration/index.js +3 -3
  150. package/dist/connect/docx.cjs +23 -28
  151. package/dist/connect/docx.cjs.map +1 -1
  152. package/dist/connect/docx.js +12 -28
  153. package/dist/connect/docx.js.map +1 -1
  154. package/dist/connect/index.cjs +8799 -2057
  155. package/dist/connect/index.cjs.map +1 -1
  156. package/dist/connect/index.d.ts +11 -2
  157. package/dist/connect/index.js +8578 -1884
  158. package/dist/connect/index.js.map +1 -1
  159. package/dist/connect/viewer.cjs +1229 -0
  160. package/dist/connect/viewer.cjs.map +1 -0
  161. package/dist/connect/viewer.d.ts +8 -0
  162. package/dist/connect/viewer.js +1226 -0
  163. package/dist/connect/viewer.js.map +1 -0
  164. package/dist/connection/ConnectedWorkflowsTable.d.ts +2 -12
  165. package/dist/connection/ai.d.ts +2 -9
  166. package/dist/connection/billing/AddAddonDialog.d.ts +24 -0
  167. package/dist/connection/billing/BillingCard.d.ts +18 -0
  168. package/dist/connection/billing/BillingProjectEntity.d.ts +9 -0
  169. package/dist/connection/billing/ChangePlanDialog.d.ts +20 -0
  170. package/dist/connection/billing/ChangeProPlan.d.ts +20 -0
  171. package/dist/connection/billing/CheckoutTotal.d.ts +12 -0
  172. package/dist/connection/billing/DailyCapEditor.d.ts +4 -0
  173. package/dist/connection/billing/InvoicesModal.d.ts +6 -0
  174. package/dist/connection/billing/NewProjectFlow.d.ts +14 -0
  175. package/dist/connection/billing/PlanChangeLines.d.ts +13 -0
  176. package/dist/connection/billing/PlanSelector.d.ts +50 -0
  177. package/dist/connection/billing/ProjectBilling.d.ts +24 -0
  178. package/dist/connection/billing/ProjectDetail.d.ts +16 -0
  179. package/dist/connection/billing/ProjectUsageCard.d.ts +21 -0
  180. package/dist/connection/billing/ProjectUsageContent.d.ts +18 -0
  181. package/dist/connection/billing/ProjectsTable.d.ts +13 -0
  182. package/dist/connection/billing/ReduceAddonDialog.d.ts +18 -0
  183. package/dist/connection/billing/ReferralReward.d.ts +32 -0
  184. package/dist/connection/billing/SharedProjects.d.ts +13 -0
  185. package/dist/connection/billing/StripeCheckoutModal.d.ts +32 -0
  186. package/dist/connection/billing/SubscriptionPlans.d.ts +15 -0
  187. package/dist/connection/billing/SubscriptionStatus.d.ts +10 -0
  188. package/dist/connection/billing/addon-pricing.d.ts +97 -0
  189. package/dist/connection/billing/api-error.d.ts +6 -0
  190. package/dist/connection/billing/billing-country.d.ts +14 -0
  191. package/dist/connection/billing/billing-focus.d.ts +11 -0
  192. package/dist/connection/billing/index.d.ts +22 -0
  193. package/dist/connection/billing/plan-badge.d.ts +15 -0
  194. package/dist/connection/billing/plan-change-outcome.d.ts +15 -0
  195. package/dist/connection/billing/plan-constants.d.ts +29 -0
  196. package/dist/connection/billing/plan-pricing.d.ts +67 -0
  197. package/dist/connection/billing/quota-items.d.ts +33 -0
  198. package/dist/connection/billing/referral-reward.d.ts +28 -0
  199. package/dist/connection/billing/refusal-copy.d.ts +5 -0
  200. package/dist/connection/billing/reward-balance.d.ts +19 -0
  201. package/dist/connection/billing/support.d.ts +35 -0
  202. package/dist/connection/billing/tax-quote.d.ts +36 -0
  203. package/dist/connection/billing/useAddonPurchase.d.ts +32 -0
  204. package/dist/connection/billing/useAutoRefreshPendingProjects.d.ts +11 -0
  205. package/dist/connection/billing/useCheckoutQuote.d.ts +30 -0
  206. package/dist/connection/billing/useOpenBillingPortal.d.ts +12 -0
  207. package/dist/connection/calendar/CalendarSettingsDialog.d.ts +1 -1
  208. package/dist/connection/connectors/ConnectedAppsSettings.d.ts +24 -0
  209. package/dist/connection/connectors/ConnectedDriveSyncDialog.d.ts +12 -0
  210. package/dist/connection/connectors/ConnectedMailboxSyncDialog.d.ts +12 -0
  211. package/dist/connection/connectors/index.d.ts +4 -0
  212. package/dist/connection/connectors/sync-labels.d.ts +21 -0
  213. package/dist/connection/facts/ConnectedFactsPage.d.ts +50 -0
  214. package/dist/connection/facts/FactMarkdownEditor.d.ts +57 -0
  215. package/dist/connection/facts/FactSourcesPopover.d.ts +38 -0
  216. package/dist/connection/facts/FactTextEditor.d.ts +2 -0
  217. package/dist/connection/facts/factNouns.d.ts +4 -0
  218. package/dist/connection/facts/factPageColumns.d.ts +37 -0
  219. package/dist/connection/facts/types.d.ts +127 -0
  220. package/dist/connection/facts/useFactActions.d.ts +10 -0
  221. package/dist/connection/facts/useFactComposer.d.ts +54 -0
  222. package/dist/connection/facts/useFactFilters.d.ts +101 -0
  223. package/dist/connection/facts/useFactSelection.d.ts +82 -0
  224. package/dist/connection/facts/useFactsGrid.d.ts +87 -0
  225. package/dist/connection/facts/useFactsPageView.d.ts +4 -0
  226. package/dist/connection/mail/ConnectedMailComposer.d.ts +3 -1
  227. package/dist/connection/mail/ConnectedMailbox.d.ts +4 -2
  228. package/dist/connection/mail/MailComposerForm.d.ts +4 -2
  229. package/dist/connection/mail/MailRecipientInput.d.ts +14 -0
  230. package/dist/connection/mail/index.d.ts +1 -1
  231. package/dist/connection/mail/types.d.ts +10 -0
  232. package/dist/connection/search/ConnectedSearchPage.d.ts +64 -0
  233. package/dist/connection/search/SearchResultRows.d.ts +38 -0
  234. package/dist/connection/search/index.d.ts +2 -0
  235. package/dist/connection/settings-page/ConnectedSettingsPage.d.ts +4 -0
  236. package/dist/connection/settings-page/index.d.ts +1 -1
  237. package/dist/connection/tags/ConnectedTagTable.d.ts +108 -0
  238. package/dist/connection/tags/ConnectedTagsPage.d.ts +55 -0
  239. package/dist/connection/tags/DocTagPassages.d.ts +25 -0
  240. package/dist/connection/tags/GlossaryExport.d.ts +7 -0
  241. package/dist/connection/tags/TagCombineFilter.d.ts +14 -0
  242. package/dist/connection/tags/TagPlacement.d.ts +16 -0
  243. package/dist/connection/tags/TagsPageSections.d.ts +36 -0
  244. package/dist/connection/tags/tagCombine.d.ts +55 -0
  245. package/dist/connection/useConnectedWorkNotifications.d.ts +7 -24
  246. package/dist/connection/viewer/ConnectedDocumentToolsProvider.d.ts +11 -0
  247. package/dist/connection/viewer/ConnectedDocumentViewer.d.ts +21 -0
  248. package/dist/connection/viewer/FinaliseTranslationButton.d.ts +15 -0
  249. package/dist/connection/viewer/ViewerPdfPane.d.ts +46 -0
  250. package/dist/connection/viewer/support.d.ts +79 -0
  251. package/dist/connection/viewer/useImageCrop.d.ts +13 -0
  252. package/dist/connection/viewer/useViewedDocument.d.ts +70 -0
  253. package/dist/connection/viewer/useViewerBlobs.d.ts +15 -0
  254. package/dist/connection/viewer/useViewerTabs.d.ts +18 -0
  255. package/dist/connection/viewer/useViewerVersions.d.ts +11 -0
  256. package/dist/connection/workspace-settings/useConnectedWorkspaceSettings.d.ts +6 -0
  257. package/dist/document-tools/index.cjs +59 -652
  258. package/dist/document-tools/index.cjs.map +1 -1
  259. package/dist/document-tools/index.js +2 -641
  260. package/dist/document-tools/index.js.map +1 -1
  261. package/dist/docx/index.cjs +48 -47
  262. package/dist/docx/index.js +4 -3
  263. package/dist/facts/FactsBulkBar.d.ts +6 -3
  264. package/dist/facts/cited-version-ref.d.ts +1 -0
  265. package/dist/facts/index.cjs +206 -1942
  266. package/dist/facts/index.cjs.map +1 -1
  267. package/dist/facts/index.d.ts +1 -0
  268. package/dist/facts/index.js +15 -1897
  269. package/dist/facts/index.js.map +1 -1
  270. package/dist/files/ViewerChrome.d.ts +5 -4
  271. package/dist/files/ViewerControlBar.d.ts +12 -0
  272. package/dist/files/doc-labels.d.ts +35 -0
  273. package/dist/files/grid/FilterButton.d.ts +12 -0
  274. package/dist/files/grid/RowDensityControl.d.ts +18 -0
  275. package/dist/files/grid/row-density.d.ts +27 -0
  276. package/dist/files/index.cjs +779 -7100
  277. package/dist/files/index.cjs.map +1 -1
  278. package/dist/files/index.d.ts +5 -0
  279. package/dist/files/index.js +14 -6919
  280. package/dist/files/index.js.map +1 -1
  281. package/dist/home/index.cjs +2 -2
  282. package/dist/home/index.js +2 -2
  283. package/dist/index.cjs +1043 -1259
  284. package/dist/index.cjs.map +1 -1
  285. package/dist/index.js +27 -360
  286. package/dist/index.js.map +1 -1
  287. package/dist/retrieval/SearchSnippet.d.ts +6 -0
  288. package/dist/retrieval/index.cjs +75 -42
  289. package/dist/retrieval/index.d.ts +2 -0
  290. package/dist/retrieval/index.js +3 -2
  291. package/dist/retrieval/search-results.d.ts +46 -0
  292. package/dist/settings/Billing.d.ts +0 -66
  293. package/dist/settings/PlanBadge.d.ts +1 -1
  294. package/dist/settings/SubscriptionParts.d.ts +1 -50
  295. package/dist/settings/index.cjs +501 -3714
  296. package/dist/settings/index.cjs.map +1 -1
  297. package/dist/settings/index.d.ts +3 -2
  298. package/dist/settings/index.js +10 -3527
  299. package/dist/settings/index.js.map +1 -1
  300. package/dist/settings/inverted-index-filter.d.ts +26 -0
  301. package/dist/shell/index.cjs +2 -2
  302. package/dist/shell/index.js +2 -2
  303. package/dist/site/index.cjs +5 -5
  304. package/dist/site/index.js +1 -1
  305. package/dist/studio/index.cjs +6 -6
  306. package/dist/studio/index.js +5 -5
  307. package/dist/tags/definitions.d.ts +10 -0
  308. package/dist/tags/index.d.ts +4 -1
  309. package/dist/tags/page/ExtractEntitiesDialog.d.ts +24 -0
  310. package/dist/tags/page/TagPicker.d.ts +16 -0
  311. package/dist/tags/page/tagsPageLabels.d.ts +36 -0
  312. package/dist/workflow-canvas/index.cjs +21 -22
  313. package/dist/workflow-canvas/index.cjs.map +1 -1
  314. package/dist/workflow-canvas/index.js +8 -9
  315. package/dist/workflow-canvas/index.js.map +1 -1
  316. package/node_modules/@arbidocs/coedit/package.json +1 -1
  317. package/package.json +13 -4
  318. package/dist/calendar/access-setup.d.ts +0 -8
  319. package/dist/chunk-2MJWWPHY.js.map +0 -1
  320. package/dist/chunk-3AFWGEDJ.cjs +0 -53
  321. package/dist/chunk-3AFWGEDJ.cjs.map +0 -1
  322. package/dist/chunk-5YHEHEJT.js +0 -1667
  323. package/dist/chunk-5YHEHEJT.js.map +0 -1
  324. package/dist/chunk-6HCJ3ZEU.js.map +0 -1
  325. package/dist/chunk-6YTHQ73P.cjs.map +0 -1
  326. package/dist/chunk-7RJTEWYM.js.map +0 -1
  327. package/dist/chunk-A6IU4GIW.js.map +0 -1
  328. package/dist/chunk-AOSUHWIL.js.map +0 -1
  329. package/dist/chunk-B3AHCIV5.js.map +0 -1
  330. package/dist/chunk-C3CGJK7A.cjs.map +0 -1
  331. package/dist/chunk-CSI2B2H5.js.map +0 -1
  332. package/dist/chunk-DETZZBG2.cjs.map +0 -1
  333. package/dist/chunk-EVUEIBNU.js.map +0 -1
  334. package/dist/chunk-FUTMU4FR.js.map +0 -1
  335. package/dist/chunk-I2QSDQQV.cjs.map +0 -1
  336. package/dist/chunk-J5CWKFSC.js +0 -170
  337. package/dist/chunk-J5CWKFSC.js.map +0 -1
  338. package/dist/chunk-MFMASSEO.cjs.map +0 -1
  339. package/dist/chunk-MHFF5N65.cjs.map +0 -1
  340. package/dist/chunk-NRFAWUVD.js.map +0 -1
  341. package/dist/chunk-O4YPVYPO.cjs.map +0 -1
  342. package/dist/chunk-O6IEZDRC.cjs.map +0 -1
  343. package/dist/chunk-OBWYM25Y.js.map +0 -1
  344. package/dist/chunk-ODRHHWHY.cjs.map +0 -1
  345. package/dist/chunk-OPTBQSCV.cjs.map +0 -1
  346. package/dist/chunk-QI6AIHWP.cjs.map +0 -1
  347. package/dist/chunk-QXMR5YHC.js.map +0 -1
  348. package/dist/chunk-RFXJYIDV.js +0 -50
  349. package/dist/chunk-RFXJYIDV.js.map +0 -1
  350. package/dist/chunk-U73KPFYH.cjs +0 -1717
  351. package/dist/chunk-U73KPFYH.cjs.map +0 -1
  352. package/dist/chunk-XVUOMWMD.cjs +0 -177
  353. package/dist/chunk-XVUOMWMD.cjs.map +0 -1
  354. package/dist/chunk-YSHIC4NJ.cjs.map +0 -1
  355. package/dist/connection/ConnectedTagTable.d.ts +0 -32
  356. package/dist/connection/calendar/CopyField.d.ts +0 -9
  357. package/dist/connection/calendar/OpenAccessPanel.d.ts +0 -7
@@ -1,1717 +0,0 @@
1
- "use client";
2
- 'use strict';
3
-
4
- var chunkADOKTJHV_cjs = require('./chunk-ADOKTJHV.cjs');
5
- var chunk7RGLTF76_cjs = require('./chunk-7RGLTF76.cjs');
6
- var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
7
- var chunkULWRNGGE_cjs = require('./chunk-ULWRNGGE.cjs');
8
- var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
9
- var jsxRuntime = require('react/jsx-runtime');
10
- var react = require('react');
11
- var lucideReact = require('lucide-react');
12
- var ui = require('@arbidocs/react/ui');
13
-
14
- var INTERACTIVE_SELECTOR = 'button, input, select, a, [role="tab"], [role="radio"]';
15
- function DraggableHeader({ onDragStart, children }) {
16
- return /* @__PURE__ */ jsxRuntime.jsx(
17
- "div",
18
- {
19
- className: "flex-shrink-0",
20
- onMouseDown: onDragStart ? (e) => {
21
- const target = e.target;
22
- if (target.closest(INTERACTIVE_SELECTOR)) return;
23
- onDragStart(e);
24
- } : void 0,
25
- style: onDragStart ? { cursor: "move" } : void 0,
26
- children
27
- }
28
- );
29
- }
30
- var DEFAULT_AVATAR_PICKER_LABELS = {
31
- uploadingPicture: "Uploading picture",
32
- changeProfilePicture: "Change profile picture",
33
- change: "Change"
34
- };
35
- function AvatarPicker({
36
- pictureUrl,
37
- initials,
38
- fallbackClassName,
39
- isUploading,
40
- disabled,
41
- onFileChosen,
42
- testId = "avatar-uploader-input",
43
- labels
44
- }) {
45
- const l = react.useMemo(() => ({ ...DEFAULT_AVATAR_PICKER_LABELS, ...labels }), [labels]);
46
- const fileInputRef = react.useRef(null);
47
- const handleChange = (e) => {
48
- const file = e.target.files?.[0];
49
- e.target.value = "";
50
- if (file) onFileChosen(file);
51
- };
52
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "avatar-picker", className: "group/avatar relative shrink-0", children: [
53
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Avatar, { className: "h-20 w-20 ring-1 ring-border", children: [
54
- pictureUrl && /* @__PURE__ */ jsxRuntime.jsx(ui.AvatarImage, { src: pictureUrl, alt: initials }),
55
- /* @__PURE__ */ jsxRuntime.jsx(
56
- ui.AvatarFallback,
57
- {
58
- className: ui.cn("text-2xl font-semibold leading-none text-white", fallbackClassName),
59
- children: initials
60
- }
61
- )
62
- ] }),
63
- /* @__PURE__ */ jsxRuntime.jsx(
64
- "button",
65
- {
66
- type: "button",
67
- onClick: () => fileInputRef.current?.click(),
68
- disabled: disabled || isUploading,
69
- className: ui.cn(
70
- "absolute inset-0 flex items-center justify-center rounded-full",
71
- "bg-foreground/70 text-background",
72
- "opacity-0 focus-visible:opacity-100 group-hover/avatar:opacity-100",
73
- // Touch has no hover: keep the change affordance visible (lighter scrim over the photo).
74
- "pointer-coarse:opacity-100",
75
- "transition-opacity duration-200",
76
- "disabled:cursor-not-allowed disabled:opacity-100"
77
- ),
78
- "aria-label": isUploading ? l.uploadingPicture : l.changeProfilePicture,
79
- children: isUploading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-6 w-6 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-0.5", children: [
80
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Camera, { className: "h-5 w-5" }),
81
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium", children: l.change })
82
- ] })
83
- }
84
- ),
85
- /* @__PURE__ */ jsxRuntime.jsx(
86
- "span",
87
- {
88
- "aria-hidden": "true",
89
- className: "pointer-events-none absolute -bottom-1 -right-1 flex h-7 w-7 items-center justify-center rounded-full bg-background text-muted-foreground ring-1 ring-border",
90
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Camera, { className: "h-3.5 w-3.5" })
91
- }
92
- ),
93
- /* @__PURE__ */ jsxRuntime.jsx(
94
- "input",
95
- {
96
- ref: fileInputRef,
97
- type: "file",
98
- accept: "image/png,image/jpeg,image/webp,image/gif",
99
- onChange: handleChange,
100
- hidden: true,
101
- className: "hidden",
102
- "data-testid": testId
103
- }
104
- )
105
- ] });
106
- }
107
- var DEFAULT_SETTINGS_DANGER_ZONE_LABELS = {
108
- dangerZone: "Danger Zone"
109
- };
110
- function SettingsPanel({ className, testId, ...props }) {
111
- return /* @__PURE__ */ jsxRuntime.jsx(
112
- "div",
113
- {
114
- "data-slot": "settings-panel",
115
- "data-testid": testId,
116
- className: ui.cn("mx-auto w-full max-w-xl space-y-6", className),
117
- ...props
118
- }
119
- );
120
- }
121
- function SettingsSection({
122
- icon,
123
- title,
124
- description,
125
- action,
126
- testId,
127
- className,
128
- children,
129
- ...props
130
- }) {
131
- return /* @__PURE__ */ jsxRuntime.jsxs(
132
- "section",
133
- {
134
- "data-slot": "settings-section",
135
- "data-testid": testId,
136
- className: ui.cn("space-y-3", className),
137
- ...props,
138
- children: [
139
- (title || action) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
140
- title && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
141
- icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground [&_svg]:h-4 [&_svg]:w-4", children: icon }),
142
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-base font-semibold text-foreground", children: title })
143
- ] }),
144
- action
145
- ] }),
146
- description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: description }),
147
- children
148
- ]
149
- }
150
- );
151
- }
152
- function SettingsRow({
153
- label,
154
- labelFor,
155
- description,
156
- children,
157
- testId,
158
- className,
159
- ...props
160
- }) {
161
- return /* @__PURE__ */ jsxRuntime.jsxs(
162
- "div",
163
- {
164
- "data-slot": "settings-row",
165
- "data-testid": testId,
166
- className: ui.cn(
167
- "flex flex-col gap-2 py-2 @xl:flex-row @xl:items-center @xl:justify-between @xl:gap-6",
168
- className
169
- ),
170
- ...props,
171
- children: [
172
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
173
- labelFor ? /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: labelFor, className: "text-sm font-medium text-foreground", children: label }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium text-foreground", children: label }),
174
- description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground", children: description })
175
- ] }),
176
- children && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children })
177
- ]
178
- }
179
- );
180
- }
181
- function SettingsCard({ padding = "md", className, ...props }) {
182
- return /* @__PURE__ */ jsxRuntime.jsx(
183
- "div",
184
- {
185
- "data-slot": "settings-card",
186
- className: ui.cn(
187
- "rounded-lg border border-border bg-card shadow-xs",
188
- padding === "md" ? "space-y-5 p-5" : "divide-y divide-border p-2",
189
- className
190
- ),
191
- ...props
192
- }
193
- );
194
- }
195
- function SettingsActionRow({ title, description, onClick, testId }) {
196
- return /* @__PURE__ */ jsxRuntime.jsxs(
197
- "button",
198
- {
199
- type: "button",
200
- onClick,
201
- "data-slot": "settings-action-row",
202
- "data-testid": testId,
203
- className: "flex w-full items-center gap-3 rounded-md px-3 py-3 text-left transition-colors hover:bg-background/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11",
204
- children: [
205
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
206
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-semibold text-foreground", children: title }),
207
- description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 text-xs leading-relaxed text-muted-foreground", children: description })
208
- ] }),
209
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4 shrink-0 text-muted-foreground" })
210
- ]
211
- }
212
- );
213
- }
214
- function SettingsDangerZone({
215
- isOpen,
216
- onToggle,
217
- label,
218
- title,
219
- description,
220
- action,
221
- labels
222
- }) {
223
- const l = react.useMemo(() => ({ ...DEFAULT_SETTINGS_DANGER_ZONE_LABELS, ...labels }), [labels]);
224
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "settings-danger-zone", className: "mt-8 pt-2", children: [
225
- /* @__PURE__ */ jsxRuntime.jsxs(
226
- "button",
227
- {
228
- type: "button",
229
- onClick: onToggle,
230
- "aria-expanded": isOpen,
231
- className: "flex w-full items-center gap-1.5 text-left pointer-coarse:min-h-11",
232
- children: [
233
- isOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-3.5 w-3.5 text-muted-foreground" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-3.5 w-3.5 text-muted-foreground" }),
234
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: label ?? l.dangerZone })
235
- ]
236
- }
237
- ),
238
- isOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex items-center justify-between gap-4 rounded-lg bg-destructive/5 p-4", children: [
239
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
240
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium", children: title }),
241
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: description })
242
- ] }),
243
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0", children: action })
244
- ] })
245
- ] });
246
- }
247
- var DEFAULT_PROFILE_CARD_LABELS = {
248
- firstName: "First name",
249
- lastName: "Last name",
250
- save: "Save",
251
- cancel: "Cancel",
252
- sso: "SSO",
253
- ssoTooltip: "Your email is managed by your sign-in provider. Change it there and it will sync here automatically on your next sign-in.",
254
- change: "Change",
255
- newEmailAddress: "New email address",
256
- emailPlaceholder: "you@example.com",
257
- codeWillBeSent: "We\u2019ll send a 3-word verification code to this address.",
258
- sendCode: "Send code",
259
- verify: (email) => `Verify ${email}`,
260
- codePlaceholder: "WORD-WORD-WORD",
261
- enterCodeHint: "Enter the 3-word code from the email we just sent.",
262
- confirm: "Confirm",
263
- resendIn: (seconds) => `Resend in ${seconds}s`,
264
- resendCode: "Resend code",
265
- verifiedNameLocked: "Verified name. Remove your identity verification to change it."
266
- };
267
- function ProfileCard({
268
- avatar,
269
- name,
270
- email,
271
- isSso,
272
- isVerified = false,
273
- onStartEmailChange,
274
- emailChange,
275
- ssoTooltip,
276
- labels
277
- }) {
278
- const l = react.useMemo(() => ({ ...DEFAULT_PROFILE_CARD_LABELS, ...labels }), [labels]);
279
- return /* @__PURE__ */ jsxRuntime.jsxs(SettingsCard, { children: [
280
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-5", children: [
281
- avatar,
282
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 space-y-3", children: [
283
- name.isEditing ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
284
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 @xl:flex-row", children: [
285
- /* @__PURE__ */ jsxRuntime.jsx(
286
- ui.Input,
287
- {
288
- value: name.givenName,
289
- onChange: (e) => name.onGivenNameChange(e.target.value),
290
- placeholder: l.firstName,
291
- className: "flex-1",
292
- autoFocus: true
293
- }
294
- ),
295
- /* @__PURE__ */ jsxRuntime.jsx(
296
- ui.Input,
297
- {
298
- value: name.familyName,
299
- onChange: (e) => name.onFamilyNameChange(e.target.value),
300
- placeholder: l.lastName,
301
- className: "flex-1"
302
- }
303
- )
304
- ] }),
305
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
306
- /* @__PURE__ */ jsxRuntime.jsxs(
307
- ui.Button,
308
- {
309
- onClick: name.onSave,
310
- size: "sm",
311
- disabled: !name.givenName.trim() || name.isSaving,
312
- children: [
313
- name.isSaving ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-1 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "mr-1 h-4 w-4" }),
314
- l.save
315
- ]
316
- }
317
- ),
318
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: name.onCancel, size: "sm", variant: "ghost", disabled: name.isSaving, children: l.cancel })
319
- ] })
320
- ] }) : isVerified ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "-mx-2 w-full px-2 py-1", "data-testid": "verified-name", children: [
321
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
322
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate font-heading text-xl font-semibold text-foreground", children: name.display }),
323
- /* @__PURE__ */ jsxRuntime.jsx(ui.VerifiedBadge, { className: "h-4 w-4" })
324
- ] }),
325
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: l.verifiedNameLocked })
326
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(
327
- "button",
328
- {
329
- type: "button",
330
- onClick: name.onStartEdit,
331
- className: "-mx-2 w-full rounded-md px-2 py-1 text-left transition-colors hover:bg-background/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11",
332
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
333
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate font-heading text-xl font-semibold text-foreground", children: name.display }),
334
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
335
- ] })
336
- }
337
- ),
338
- !emailChange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "-mx-2 flex min-w-0 items-center gap-2 px-2 py-1", children: [
339
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
340
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate text-sm text-muted-foreground", children: email }),
341
- isSso ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
342
- /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
343
- "span",
344
- {
345
- className: "ml-1 shrink-0 cursor-help rounded bg-background px-1.5 py-0.5 text-xs font-medium text-muted-foreground",
346
- tabIndex: 0,
347
- children: l.sso
348
- }
349
- ) }),
350
- /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { className: "max-w-xs", children: ssoTooltip ?? l.ssoTooltip })
351
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(
352
- "button",
353
- {
354
- type: "button",
355
- onClick: onStartEmailChange,
356
- className: "ml-auto shrink-0 text-xs font-medium text-primary hover:underline pointer-coarse:min-h-11",
357
- children: l.change
358
- }
359
- )
360
- ] })
361
- ] })
362
- ] }),
363
- emailChange && !isSso && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-accordion-down overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3 rounded-lg bg-background p-4", children: emailChange.step === "enter" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
364
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-xs font-medium text-muted-foreground", children: [
365
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "h-3.5 w-3.5" }),
366
- l.newEmailAddress
367
- ] }),
368
- /* @__PURE__ */ jsxRuntime.jsx(
369
- ui.Input,
370
- {
371
- type: "email",
372
- value: emailChange.newEmail,
373
- onChange: (e) => emailChange.onNewEmailChange(e.target.value),
374
- placeholder: l.emailPlaceholder,
375
- autoFocus: true
376
- }
377
- ),
378
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: l.codeWillBeSent }),
379
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 pt-1", children: [
380
- /* @__PURE__ */ jsxRuntime.jsxs(
381
- ui.Button,
382
- {
383
- onClick: emailChange.onSendCode,
384
- size: "sm",
385
- disabled: !emailChange.newEmail.trim() || emailChange.isSending,
386
- children: [
387
- emailChange.isSending ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-1 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "mr-1 h-4 w-4" }),
388
- l.sendCode
389
- ]
390
- }
391
- ),
392
- /* @__PURE__ */ jsxRuntime.jsx(
393
- ui.Button,
394
- {
395
- onClick: emailChange.onCancel,
396
- size: "sm",
397
- variant: "ghost",
398
- disabled: emailChange.isSending,
399
- children: l.cancel
400
- }
401
- )
402
- ] })
403
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
404
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-xs font-medium text-muted-foreground", children: [
405
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: "h-3.5 w-3.5" }),
406
- l.verify(emailChange.newEmail)
407
- ] }),
408
- /* @__PURE__ */ jsxRuntime.jsx(
409
- ui.Input,
410
- {
411
- value: emailChange.code,
412
- onChange: (e) => emailChange.onCodeChange(e.target.value.toUpperCase().replace(/\s+/g, "-")),
413
- className: ui.cn("text-center font-mono tracking-wider"),
414
- placeholder: l.codePlaceholder,
415
- autoFocus: true
416
- }
417
- ),
418
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: l.enterCodeHint }),
419
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2 pt-1", children: [
420
- /* @__PURE__ */ jsxRuntime.jsxs(
421
- ui.Button,
422
- {
423
- onClick: emailChange.onConfirm,
424
- size: "sm",
425
- disabled: !emailChange.code.trim() || emailChange.isConfirming,
426
- children: [
427
- emailChange.isConfirming ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-1 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "mr-1 h-4 w-4" }),
428
- l.confirm
429
- ]
430
- }
431
- ),
432
- /* @__PURE__ */ jsxRuntime.jsx(
433
- ui.Button,
434
- {
435
- onClick: () => {
436
- if (emailChange.cooldownSeconds > 0) return;
437
- emailChange.onSendCode();
438
- },
439
- size: "sm",
440
- variant: "ghost",
441
- disabled: emailChange.cooldownSeconds > 0 || emailChange.isSending,
442
- children: emailChange.cooldownSeconds > 0 ? l.resendIn(emailChange.cooldownSeconds) : l.resendCode
443
- }
444
- ),
445
- /* @__PURE__ */ jsxRuntime.jsx(
446
- ui.Button,
447
- {
448
- onClick: emailChange.onCancel,
449
- size: "sm",
450
- variant: "ghost",
451
- disabled: emailChange.isConfirming,
452
- children: l.cancel
453
- }
454
- )
455
- ] })
456
- ] }) }) })
457
- ] });
458
- }
459
- var DEFAULT_IDENTITY_VERIFICATION_LABELS = {
460
- title: "Identity verification",
461
- intro: "Check your ID once to get a verified tick next to your name.",
462
- priceLine: (price, attempts) => `${price} \xB7 ${attempts} attempts`,
463
- proOnly: "Available on Pro plans.",
464
- seePlans: "See plans",
465
- manageBilling: "Manage billing",
466
- verify: "Verify identity",
467
- continue: "Continue",
468
- attemptsLeft: (n) => `${n} attempt${n === 1 ? "" : "s"} left`,
469
- verified: "Verified",
470
- verifiedDetail: (country) => `ID issued in ${country}`,
471
- inReview: "Your check is being reviewed. We\u2019ll update this when it\u2019s done.",
472
- finishName: "Your ID was verified. Confirm your name to get the tick.",
473
- finish: "Finish",
474
- remove: "Remove",
475
- payTitle: "Verify your identity",
476
- payBody: (price, attempts) => `A one-time fee of ${price} is charged to the card on your Pro plan. It covers up to ${attempts} attempts. Your ID is checked by our provider, Didit; ARBI does not keep your document.`,
477
- pay: "Pay and continue",
478
- confirmPayment: "Confirm payment with your bank",
479
- paymentConfirmed: "I\u2019ve confirmed it",
480
- verifyTitle: "Scan your ID",
481
- embedFailed: "Your camera isn\u2019t available here. Continue in a new tab, then come back.",
482
- openInNewTab: "Open in a new tab",
483
- checkResult: "I\u2019ve finished",
484
- resultVerified: "You\u2019re verified. The tick now shows next to your name.",
485
- resultDeclined: (n) => n > 0 ? `We couldn\u2019t verify your ID. You have ${n} attempt${n === 1 ? "" : "s"} left.` : "We couldn\u2019t verify your ID and no attempts are left.",
486
- tryAgain: "Try again",
487
- resultInReview: "Your check needs a manual review. We\u2019ll show the result here when it\u2019s done.",
488
- nameMismatchTitle: "Your ID was verified",
489
- nameMismatchBody: "The name on your ID differs from your account name. The tick shows only with the name on your ID.",
490
- documentName: "Name on your ID",
491
- accountName: "Account name",
492
- useDocumentName: (name) => `Change my name to ${name}`,
493
- keepName: "Keep my name",
494
- close: "Close",
495
- requiredTitle: "Identity verification required",
496
- requiredBody: "This workspace requires a verified identity before you continue.",
497
- requiredProOnly: "Identity verification is available on Pro plans. Ask your administrator."
498
- };
499
- function useLabels(labels) {
500
- return react.useMemo(() => ({ ...DEFAULT_IDENTITY_VERIFICATION_LABELS, ...labels }), [labels]);
501
- }
502
- var BILLING_CODES = [
503
- "PRO_REQUIRED",
504
- "PAYMENT_METHOD_REQUIRED",
505
- "BILLING_ADDRESS_REQUIRED",
506
- "PAYMENT_DECLINED"
507
- ];
508
- function Problem({
509
- flow,
510
- onManageBilling,
511
- label
512
- }) {
513
- if (!flow.problem) return null;
514
- const billing = onManageBilling && BILLING_CODES.includes(flow.problem.code ?? "");
515
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", "data-testid": "identity-problem", children: [
516
- /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-sm text-destructive", children: flow.problem.message }),
517
- billing && /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "sm", variant: "outline", onClick: onManageBilling, children: label })
518
- ] });
519
- }
520
- function IdentityVerificationCard({
521
- flow,
522
- onManageBilling,
523
- labels
524
- }) {
525
- const l = useLabels(labels);
526
- const { status } = flow;
527
- if (!status?.enabled) return null;
528
- const busy = flow.busy !== null;
529
- let description;
530
- let action = null;
531
- if (status.verified) {
532
- description = /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
533
- /* @__PURE__ */ jsxRuntime.jsx(ui.VerifiedBadge, {}),
534
- l.verified,
535
- status.document_country && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground", children: [
536
- " \xB7 ",
537
- l.verifiedDetail(status.document_country)
538
- ] })
539
- ] });
540
- action = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "sm", variant: "ghost", onClick: flow.remove, disabled: busy, children: l.remove });
541
- } else if (!status.eligible) {
542
- description = `${l.intro} ${l.proOnly}`;
543
- action = onManageBilling ? /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "sm", variant: "outline", onClick: onManageBilling, children: l.seePlans }) : null;
544
- } else if (status.state === "in_review") {
545
- description = l.inReview;
546
- } else if (status.state === "name_mismatch") {
547
- description = l.finishName;
548
- action = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { size: "sm", onClick: flow.open, children: l.finish });
549
- } else {
550
- const resuming = status.attempts_left > 0 || status.state === "in_progress";
551
- description = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
552
- l.intro,
553
- " ",
554
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: resuming ? l.attemptsLeft(status.attempts_left) : l.priceLine(flow.price ?? "", status.attempts_per_fee) })
555
- ] });
556
- action = /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { size: "sm", onClick: flow.open, disabled: busy, children: [
557
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldCheck, { className: "mr-1 h-4 w-4" }),
558
- resuming ? l.continue : l.verify
559
- ] });
560
- }
561
- return /* @__PURE__ */ jsxRuntime.jsxs(SettingsCard, { padding: "sm", "data-testid": "identity-verification-card", children: [
562
- /* @__PURE__ */ jsxRuntime.jsx(SettingsRow, { label: l.title, description, children: action }),
563
- !flow.isOpen && /* @__PURE__ */ jsxRuntime.jsx(Problem, { flow, onManageBilling, label: l.manageBilling })
564
- ] });
565
- }
566
- function IdentityVerificationDialog({
567
- flow,
568
- accountName,
569
- dismissible = true,
570
- onManageBilling,
571
- labels
572
- }) {
573
- const l = useLabels(labels);
574
- const { status } = flow;
575
- const attempts = status?.attempts_per_fee ?? 0;
576
- const docName = [status?.document_given_name, status?.document_family_name].filter(Boolean).join(" ");
577
- const spinner = /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-1 h-4 w-4 animate-spin" });
578
- let body;
579
- let footer = null;
580
- if (flow.step === "pay") {
581
- body = flow.paymentUrl ? /* @__PURE__ */ jsxRuntime.jsxs(
582
- "a",
583
- {
584
- href: flow.paymentUrl,
585
- target: "_blank",
586
- rel: "noopener noreferrer",
587
- className: "inline-flex items-center gap-1 text-sm font-medium text-primary hover:underline",
588
- children: [
589
- l.confirmPayment,
590
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "h-3.5 w-3.5" })
591
- ]
592
- }
593
- ) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.payBody(flow.price ?? "", attempts) });
594
- footer = flow.paymentUrl ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: flow.recheckPayment, disabled: flow.busy !== null, children: [
595
- flow.busy === "start" && spinner,
596
- l.paymentConfirmed
597
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: flow.pay, disabled: flow.busy !== null, "data-testid": "identity-pay", children: [
598
- flow.busy === "pay" && spinner,
599
- l.pay
600
- ] });
601
- } else if (flow.step === "verify") {
602
- body = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: flow.embedFailed ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.embedFailed }) : /* @__PURE__ */ jsxRuntime.jsx(
603
- "div",
604
- {
605
- id: flow.verifyContainerId,
606
- ref: flow.verifyContainerRef,
607
- className: "h-[560px] w-full overflow-hidden rounded-md bg-muted",
608
- "data-testid": "identity-didit-frame",
609
- children: flow.busy === "start" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-6 w-6 animate-spin text-muted-foreground" }) })
610
- }
611
- ) });
612
- footer = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
613
- flow.embedFailed && /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "outline", onClick: flow.openInNewTab, children: [
614
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "mr-1 h-4 w-4" }),
615
- l.openInNewTab
616
- ] }),
617
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { variant: "ghost", onClick: flow.checkResult, disabled: flow.busy !== null, children: [
618
- flow.busy === "refresh" && spinner,
619
- l.checkResult
620
- ] })
621
- ] });
622
- } else if (status?.state === "name_mismatch") {
623
- body = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", "data-testid": "identity-name-mismatch", children: [
624
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.nameMismatchBody }),
625
- /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm", children: [
626
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: l.documentName }),
627
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "font-medium", children: docName }),
628
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: l.accountName }),
629
- /* @__PURE__ */ jsxRuntime.jsx("dd", { children: accountName })
630
- ] })
631
- ] });
632
- footer = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
633
- /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { variant: "ghost", onClick: flow.keepName, disabled: flow.busy !== null, children: l.keepName }),
634
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Button, { onClick: flow.acceptName, disabled: flow.busy !== null || !docName, children: [
635
- flow.busy === "accept" && spinner,
636
- l.useDocumentName(docName)
637
- ] })
638
- ] });
639
- } else if (status?.verified) {
640
- body = /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "flex items-center gap-2 text-sm", children: [
641
- /* @__PURE__ */ jsxRuntime.jsx(ui.VerifiedBadge, { className: "h-4 w-4" }),
642
- l.resultVerified
643
- ] });
644
- footer = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: flow.close, children: l.close });
645
- } else if (status?.state === "in_review") {
646
- body = /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.resultInReview });
647
- footer = /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: flow.close, children: l.close });
648
- } else {
649
- const left = status?.attempts_left ?? 0;
650
- body = /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.resultDeclined(left) });
651
- footer = left > 0 ? /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: flow.retry, disabled: flow.busy !== null, children: l.tryAgain }) : /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: flow.close, children: l.close });
652
- }
653
- const title = status?.state === "name_mismatch" && flow.step === "result" ? l.nameMismatchTitle : flow.step === "verify" ? l.verifyTitle : l.payTitle;
654
- return /* @__PURE__ */ jsxRuntime.jsxs(
655
- chunkULWRNGGE_cjs.ModalScaffold,
656
- {
657
- open: flow.isOpen,
658
- onOpenChange: (open) => open ? flow.open() : flow.close(),
659
- title,
660
- icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldCheck, { className: "h-5 w-5" }),
661
- size: flow.step === "verify" ? "lg" : "md",
662
- dismissible,
663
- testId: "identity-verification-dialog",
664
- children: [
665
- /* @__PURE__ */ jsxRuntime.jsxs(chunkULWRNGGE_cjs.ModalScaffold.Body, { children: [
666
- body,
667
- /* @__PURE__ */ jsxRuntime.jsx(Problem, { flow, onManageBilling, label: l.manageBilling })
668
- ] }),
669
- /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Footer, { children: footer })
670
- ]
671
- }
672
- );
673
- }
674
- function RequireVerified({
675
- flow,
676
- accountName,
677
- onManageBilling,
678
- children,
679
- labels
680
- }) {
681
- const l = useLabels(labels);
682
- const { status } = flow;
683
- const blocked = Boolean(status?.enabled && status.required && !status.verified);
684
- if (!blocked || !status) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
685
- if (flow.isOpen) {
686
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
687
- children,
688
- /* @__PURE__ */ jsxRuntime.jsx(
689
- IdentityVerificationDialog,
690
- {
691
- flow,
692
- accountName,
693
- dismissible: false,
694
- onManageBilling,
695
- labels
696
- }
697
- )
698
- ] });
699
- }
700
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
701
- children,
702
- /* @__PURE__ */ jsxRuntime.jsxs(
703
- chunkULWRNGGE_cjs.ModalScaffold,
704
- {
705
- open: true,
706
- onOpenChange: () => {
707
- },
708
- title: l.requiredTitle,
709
- icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ShieldCheck, { className: "h-5 w-5" }),
710
- dismissible: false,
711
- testId: "identity-required-gate",
712
- children: [
713
- /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: status.eligible ? l.requiredBody : l.requiredProOnly }) }),
714
- status.eligible && /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(ui.Button, { onClick: flow.open, children: l.verify }) })
715
- ]
716
- }
717
- )
718
- ] });
719
- }
720
- var DEFAULT_PASSWORD_CHANGE_DIALOG_LABELS = {
721
- setNewPasswordTitle: "Set New Password",
722
- changeMasterPasswordTitle: "Change Master Password",
723
- recoveryDescription: "Set a new password for your recovered account",
724
- changeDescription: "Change your master password dialog",
725
- passwordChanged: "Password changed",
726
- recoveryKeyUnchanged: "Your recovery key is unchanged: the one you saved still recovers this account.",
727
- done: "Done",
728
- recoverySuccessful: "Recovery successful. Set a new master password to continue.",
729
- currentPassword: "Current Password",
730
- currentPasswordPlaceholder: "Enter current password",
731
- masterPassword: "Master Password",
732
- newPassword: "New Password",
733
- confirmPassword: "Confirm Password",
734
- confirmNewPassword: "Confirm New Password",
735
- cancel: "Cancel",
736
- settingPassword: "Setting Password...",
737
- changingPassword: "Changing Password...",
738
- continue: "Continue",
739
- changePassword: "Change Password"
740
- };
741
- function PasswordChangeDialog({
742
- open,
743
- onClose,
744
- recoveryMode,
745
- currentPassword,
746
- onCurrentPasswordChange,
747
- newPassword,
748
- onNewPasswordChange,
749
- confirmPassword,
750
- onConfirmPasswordChange,
751
- getUnmetRequirement,
752
- error,
753
- isProcessing,
754
- isSubmitDisabled,
755
- onSubmit,
756
- isChanged,
757
- success,
758
- onDone,
759
- labels,
760
- passwordInputLabels,
761
- testId,
762
- testIds,
763
- passwordInputTestIds
764
- }) {
765
- const currentPasswordId = react.useId();
766
- const l = react.useMemo(() => ({ ...DEFAULT_PASSWORD_CHANGE_DIALOG_LABELS, ...labels }), [labels]);
767
- const handleSubmit = (e) => {
768
- e.preventDefault();
769
- onSubmit();
770
- };
771
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open, onOpenChange: (next) => !next && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(
772
- ui.DialogContent,
773
- {
774
- presentation: "sheet",
775
- className: "sm:max-w-md",
776
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "change-password-dialog" }),
777
- children: [
778
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
779
- /* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: recoveryMode ? l.setNewPasswordTitle : l.changeMasterPasswordTitle }),
780
- /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { className: "sr-only", children: recoveryMode ? l.recoveryDescription : l.changeDescription })
781
- ] }),
782
- isChanged ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
783
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-green-text", children: [
784
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle2, { className: "h-5 w-5" }),
785
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: l.passwordChanged })
786
- ] }),
787
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.recoveryKeyUnchanged }),
788
- success,
789
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
790
- ui.Button,
791
- {
792
- onClick: onDone,
793
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.done, { testId: "change-password-done-button" }),
794
- children: l.done
795
- }
796
- ) })
797
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleSubmit, className: "space-y-3", children: [
798
- recoveryMode && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-green-text", children: l.recoverySuccessful }),
799
- !recoveryMode && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
800
- /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: currentPasswordId, className: "text-sm font-medium text-foreground", children: [
801
- l.currentPassword,
802
- " ",
803
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-text", children: "*" })
804
- ] }),
805
- /* @__PURE__ */ jsxRuntime.jsx(
806
- ui.Input,
807
- {
808
- id: currentPasswordId,
809
- type: "password",
810
- value: currentPassword,
811
- onChange: (e) => onCurrentPasswordChange(e.target.value),
812
- disabled: isProcessing,
813
- placeholder: l.currentPasswordPlaceholder,
814
- autoComplete: "current-password",
815
- className: "placeholder:text-muted-foreground",
816
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.currentInput, {
817
- testId: "change-password-current-input"
818
- })
819
- }
820
- )
821
- ] }),
822
- /* @__PURE__ */ jsxRuntime.jsx(
823
- chunkADOKTJHV_cjs.PasswordStrengthInput,
824
- {
825
- password: newPassword,
826
- confirmPassword,
827
- onPasswordChange: onNewPasswordChange,
828
- onConfirmPasswordChange,
829
- showConfirmation: true,
830
- disabled: isProcessing,
831
- passwordLabel: recoveryMode ? l.masterPassword : l.newPassword,
832
- confirmLabel: recoveryMode ? l.confirmPassword : l.confirmNewPassword,
833
- labels: passwordInputLabels,
834
- testIds: passwordInputTestIds,
835
- layout: recoveryMode ? "side-by-side" : "stacked",
836
- showStrengthIndicator: true,
837
- getUnmetRequirement
838
- }
839
- ),
840
- error && /* @__PURE__ */ jsxRuntime.jsx(
841
- "div",
842
- {
843
- className: "rounded-md bg-red-bg p-3",
844
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.error, { testId: "change-password-error" }),
845
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
846
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { className: "h-5 w-5 flex-shrink-0 text-red-text" }),
847
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-text", children: error })
848
- ] })
849
- }
850
- ),
851
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col-reverse sm:flex-row sm:justify-end gap-3 pt-4", children: [
852
- !recoveryMode && /* @__PURE__ */ jsxRuntime.jsx(
853
- ui.Button,
854
- {
855
- type: "button",
856
- variant: "outline",
857
- onClick: onClose,
858
- disabled: isProcessing,
859
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.cancel, {
860
- testId: "change-password-cancel-button"
861
- }),
862
- children: l.cancel
863
- }
864
- ),
865
- /* @__PURE__ */ jsxRuntime.jsx(
866
- ui.Button,
867
- {
868
- type: "submit",
869
- disabled: isSubmitDisabled,
870
- className: recoveryMode ? "w-full" : "",
871
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.submit, { testId: "change-password-submit-button" }),
872
- children: isProcessing ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
873
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
874
- recoveryMode ? l.settingPassword : l.changingPassword
875
- ] }) : recoveryMode ? l.continue : l.changePassword
876
- }
877
- )
878
- ] })
879
- ] })
880
- ]
881
- }
882
- ) });
883
- }
884
- var DEFAULT_ACTIVE_SESSIONS_DIALOG_LABELS = {
885
- title: "Active sessions",
886
- description: "Devices and agents currently signed in to your account. Ending a session signs it out immediately.",
887
- noSessions: "No active sessions.",
888
- thisDevice: "This device",
889
- agent: "Agent",
890
- endSession: "End this session"
891
- };
892
- var DEFAULT_DELETE_ACCOUNT_DIALOG_LABELS = {
893
- warningTitle: "Delete your account?",
894
- warningBefore: "Once deleted, your account will be ",
895
- warningEmphasis: "immediately closed and you will be logged out",
896
- warningAfter: ". This action cannot be undone.",
897
- blockersHeading: "You must resolve these first:",
898
- cancel: "Cancel",
899
- continue: "Continue",
900
- confirmTitle: "Confirm account deletion",
901
- confirmDescription: "Type your email address to confirm. Your account will be closed immediately and you will be logged out.",
902
- yourEmail: "Your email",
903
- back: "Back",
904
- deleting: "Deleting...",
905
- deleteAccount: "Delete Account"
906
- };
907
- function SessionListRow({
908
- session,
909
- onTerminate,
910
- labels,
911
- testIds
912
- }) {
913
- return /* @__PURE__ */ jsxRuntime.jsxs(
914
- "div",
915
- {
916
- className: "flex w-full items-center gap-3 border-b border-border/60 px-4 py-3 last:border-b-0",
917
- "data-testid": chunkMHVNT4J3_cjs.prefixedTestId(testIds?.sessionItem, session.id, {
918
- testId: `session-item-${session.id}`
919
- }),
920
- children: [
921
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-9 shrink-0 items-center justify-center rounded-full bg-muted", children: session.icon }),
922
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
923
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
924
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: session.name }),
925
- session.isCurrent && /* @__PURE__ */ jsxRuntime.jsx(ui.Badge, { className: "border-transparent bg-accent px-1.5 py-0 text-xs text-accent-foreground shadow-none hover:bg-accent", children: labels.thisDevice }),
926
- session.isAgent && /* @__PURE__ */ jsxRuntime.jsx(ui.Badge, { variant: "default", className: "px-1 py-0 text-xs", children: labels.agent })
927
- ] }),
928
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: session.detail })
929
- ] }),
930
- !session.isCurrent && /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
931
- /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
932
- ui.Button,
933
- {
934
- type: "button",
935
- variant: "ghost",
936
- size: "icon",
937
- className: "h-8 w-8 shrink-0 text-muted-foreground hover:text-destructive",
938
- "aria-label": labels.endSession,
939
- onClick: () => onTerminate(session.id),
940
- disabled: session.isTerminating,
941
- "data-testid": chunkMHVNT4J3_cjs.prefixedTestId(
942
- testIds?.terminateSession,
943
- session.id,
944
- { testId: `terminate-session-${session.id}-button` },
945
- "-button"
946
- ),
947
- children: session.isTerminating ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { className: "h-4 w-4" })
948
- }
949
- ) }),
950
- /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: labels.endSession })
951
- ] })
952
- ]
953
- }
954
- );
955
- }
956
- function ActiveSessionsDialog({
957
- open,
958
- onOpenChange,
959
- isLoading,
960
- sessions,
961
- onTerminate,
962
- labels,
963
- testId,
964
- testIds
965
- }) {
966
- const l = react.useMemo(() => ({ ...DEFAULT_ACTIVE_SESSIONS_DIALOG_LABELS, ...labels }), [labels]);
967
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(
968
- ui.DialogContent,
969
- {
970
- presentation: "sheet",
971
- className: "sm:max-w-lg",
972
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "active-sessions-dialog" }),
973
- children: [
974
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
975
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
976
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Radio, { className: "h-6 w-6" }),
977
- /* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: l.title })
978
- ] }),
979
- /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: l.description })
980
- ] }),
981
- isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-5 w-5 animate-spin text-muted-foreground" }) }) : sessions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "py-4 text-center text-sm text-muted-foreground", children: l.noSessions }) : /* @__PURE__ */ jsxRuntime.jsx(
982
- "div",
983
- {
984
- className: "-mx-2 max-h-96 overflow-auto rounded-lg bg-muted",
985
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.list, { testId: "session-list" }),
986
- children: sessions.map((session) => /* @__PURE__ */ jsxRuntime.jsx(
987
- SessionListRow,
988
- {
989
- session,
990
- onTerminate,
991
- labels: l,
992
- testIds
993
- },
994
- session.id
995
- ))
996
- }
997
- )
998
- ]
999
- }
1000
- ) });
1001
- }
1002
- function DeleteAccountDialog({
1003
- open,
1004
- onClose,
1005
- step,
1006
- blockers,
1007
- onContinue,
1008
- onBack,
1009
- userEmail,
1010
- confirmEmail,
1011
- onConfirmEmailChange,
1012
- isDeleting,
1013
- onSubmit,
1014
- labels,
1015
- testId,
1016
- testIds
1017
- }) {
1018
- const confirmEmailId = react.useId();
1019
- const l = react.useMemo(() => ({ ...DEFAULT_DELETE_ACCOUNT_DIALOG_LABELS, ...labels }), [labels]);
1020
- const emailMatches = confirmEmail.toLowerCase() === userEmail.toLowerCase();
1021
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open, onOpenChange: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(
1022
- ui.DialogContent,
1023
- {
1024
- presentation: "sheet",
1025
- className: "sm:max-w-md",
1026
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "delete-account-dialog" }),
1027
- children: step === "warning" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1028
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
1029
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogTitle, { className: "flex items-center gap-2", children: [
1030
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "h-5 w-5 text-destructive" }),
1031
- l.warningTitle
1032
- ] }),
1033
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogDescription, { children: [
1034
- l.warningBefore,
1035
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: l.warningEmphasis }),
1036
- l.warningAfter
1037
- ] })
1038
- ] }),
1039
- blockers.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-md bg-yellow-bg p-3 text-sm text-yellow-text", children: [
1040
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-1 font-semibold", children: l.blockersHeading }),
1041
- /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "list-inside list-disc space-y-1", children: blockers.map((blocker) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: blocker.content }, blocker.key)) })
1042
- ] }),
1043
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col-reverse sm:flex-row sm:justify-end gap-2 pt-2", children: [
1044
- /* @__PURE__ */ jsxRuntime.jsx(
1045
- ui.Button,
1046
- {
1047
- variant: "outline",
1048
- onClick: onClose,
1049
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.cancel, { testId: "delete-account-cancel-button" }),
1050
- children: l.cancel
1051
- }
1052
- ),
1053
- /* @__PURE__ */ jsxRuntime.jsx(
1054
- ui.Button,
1055
- {
1056
- variant: "destructive",
1057
- disabled: blockers.length > 0,
1058
- onClick: onContinue,
1059
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.continue, {
1060
- testId: "delete-account-continue-button"
1061
- }),
1062
- children: l.continue
1063
- }
1064
- )
1065
- ] })
1066
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1067
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
1068
- /* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: l.confirmTitle }),
1069
- /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: l.confirmDescription })
1070
- ] }),
1071
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1072
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: confirmEmailId, className: "mb-1 block text-sm font-medium", children: l.yourEmail }),
1073
- /* @__PURE__ */ jsxRuntime.jsx(
1074
- ui.Input,
1075
- {
1076
- id: confirmEmailId,
1077
- type: "email",
1078
- placeholder: userEmail,
1079
- value: confirmEmail,
1080
- onChange: (e) => onConfirmEmailChange(e.target.value),
1081
- autoFocus: true,
1082
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.emailInput, {
1083
- testId: "delete-account-email-input"
1084
- })
1085
- }
1086
- )
1087
- ] }),
1088
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col-reverse sm:flex-row sm:justify-end gap-2 pt-2", children: [
1089
- /* @__PURE__ */ jsxRuntime.jsx(
1090
- ui.Button,
1091
- {
1092
- variant: "outline",
1093
- onClick: onBack,
1094
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.back, { testId: "delete-account-back-button" }),
1095
- children: l.back
1096
- }
1097
- ),
1098
- /* @__PURE__ */ jsxRuntime.jsx(
1099
- ui.Button,
1100
- {
1101
- variant: "destructive",
1102
- disabled: !emailMatches || isDeleting,
1103
- onClick: onSubmit,
1104
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.submit, { testId: "delete-account-submit-button" }),
1105
- children: isDeleting ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1106
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }),
1107
- l.deleting
1108
- ] }) : l.deleteAccount
1109
- }
1110
- )
1111
- ] })
1112
- ] })
1113
- }
1114
- ) });
1115
- }
1116
- var DEFAULT_LOGOUT_DIALOG_LABELS = {
1117
- title: "Logout",
1118
- descriptionAll: "End this session or all active sessions?",
1119
- descriptionThis: "End this session and return to the login page.",
1120
- cancel: "Cancel",
1121
- allSessions: "All sessions",
1122
- offlineTooltip: "Ending all sessions needs a connection \u2014 you can still log out of this device.",
1123
- thisSession: "This session",
1124
- offlineNote: "You\u2019re offline \u2014 ending all sessions needs a connection. You can still log out of this device.",
1125
- activeSessions: (count) => chunkKDG6FER6_cjs.formatCount(count, { one: "active session", other: "active sessions" }),
1126
- workspaces: (count) => chunkKDG6FER6_cjs.formatCount(count, { one: "workspace", other: "workspaces" }),
1127
- ttl: (ttlLabel) => `TTL ${ttlLabel}`
1128
- };
1129
- function SessionRow({
1130
- session,
1131
- icon,
1132
- labels
1133
- }) {
1134
- const { status } = session;
1135
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 rounded-md bg-muted/50 px-3 py-2", children: [
1136
- icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0", children: icon }),
1137
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
1138
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1139
- /* @__PURE__ */ jsxRuntime.jsx("code", { className: "truncate font-mono text-sm", children: session.id.slice(0, 12) }),
1140
- /* @__PURE__ */ jsxRuntime.jsx(
1141
- ui.Badge,
1142
- {
1143
- variant: status === "agent" ? "default" : "secondary",
1144
- className: "px-1 py-0 text-sm",
1145
- children: status
1146
- }
1147
- )
1148
- ] }),
1149
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
1150
- session.ipAddress && /* @__PURE__ */ jsxRuntime.jsx("span", { children: session.ipAddress }),
1151
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.ttl(session.ttlLabel) }),
1152
- session.workspaceCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.workspaces(session.workspaceCount) })
1153
- ] })
1154
- ] })
1155
- ] });
1156
- }
1157
- function LogoutDialog({
1158
- open,
1159
- onClose,
1160
- onLogoutThis,
1161
- onLogoutAll,
1162
- canLogoutAll,
1163
- isOnline,
1164
- sessions,
1165
- renderSessionIcon,
1166
- labels,
1167
- testId,
1168
- testIds
1169
- }) {
1170
- const l = react.useMemo(() => ({ ...DEFAULT_LOGOUT_DIALOG_LABELS, ...labels }), [labels]);
1171
- const [sessionsOpen, setSessionsOpen] = react.useState(false);
1172
- const restoreFocus = chunkULWRNGGE_cjs.useRestoreFocus();
1173
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { open, onOpenChange: (next) => !next && onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(
1174
- ui.DialogContent,
1175
- {
1176
- ...restoreFocus,
1177
- className: "sm:max-w-md",
1178
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "logout-modal" }),
1179
- children: [
1180
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogHeader, { children: [
1181
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
1182
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { className: "h-6 w-6" }),
1183
- /* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: l.title })
1184
- ] }),
1185
- /* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { className: "text-base", children: canLogoutAll ? l.descriptionAll : l.descriptionThis })
1186
- ] }),
1187
- /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogFooter, { className: "gap-2", children: [
1188
- /* @__PURE__ */ jsxRuntime.jsx(
1189
- ui.Button,
1190
- {
1191
- variant: "outline",
1192
- onClick: onClose,
1193
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.cancel, { testId: "logout-modal-cancel-button" }),
1194
- children: l.cancel
1195
- }
1196
- ),
1197
- canLogoutAll && /* @__PURE__ */ jsxRuntime.jsx(
1198
- ui.Button,
1199
- {
1200
- variant: "secondary",
1201
- onClick: onLogoutAll,
1202
- disabled: !isOnline,
1203
- title: isOnline ? void 0 : l.offlineTooltip,
1204
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.all, { testId: "logout-modal-all-button" }),
1205
- children: l.allSessions
1206
- }
1207
- ),
1208
- /* @__PURE__ */ jsxRuntime.jsx(
1209
- ui.Button,
1210
- {
1211
- variant: "default",
1212
- onClick: onLogoutThis,
1213
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.this, { testId: "logout-modal-this-button" }),
1214
- children: l.thisSession
1215
- }
1216
- )
1217
- ] }),
1218
- canLogoutAll && !isOnline && /* @__PURE__ */ jsxRuntime.jsx(
1219
- "p",
1220
- {
1221
- className: "text-sm text-muted-foreground",
1222
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.offlineNote, { testId: "logout-offline-note" }),
1223
- children: l.offlineNote
1224
- }
1225
- ),
1226
- sessions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(ui.Collapsible, { open: sessionsOpen, onOpenChange: setSessionsOpen, children: [
1227
- /* @__PURE__ */ jsxRuntime.jsxs(ui.CollapsibleTrigger, { className: "flex w-full items-center gap-2 py-1 text-left transition-opacity hover:opacity-80 pointer-coarse:py-3", children: [
1228
- sessionsOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 flex-shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4 flex-shrink-0" }),
1229
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 text-sm font-medium text-muted-foreground", children: [
1230
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Radio, { className: "h-3 w-3" }),
1231
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: l.activeSessions(sessions.length) })
1232
- ] })
1233
- ] }),
1234
- /* @__PURE__ */ jsxRuntime.jsx(ui.CollapsibleContent, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-48 space-y-1.5 overflow-auto pt-2", children: sessions.map((session) => /* @__PURE__ */ jsxRuntime.jsx(
1235
- SessionRow,
1236
- {
1237
- session,
1238
- icon: renderSessionIcon?.(session.status),
1239
- labels: l
1240
- },
1241
- session.id
1242
- )) }) })
1243
- ] })
1244
- ]
1245
- }
1246
- ) });
1247
- }
1248
- function SettingsSwitchRow({
1249
- id,
1250
- title,
1251
- icon,
1252
- description,
1253
- checked,
1254
- onCheckedChange,
1255
- testId,
1256
- disabled,
1257
- className
1258
- }) {
1259
- return /* @__PURE__ */ jsxRuntime.jsxs(
1260
- "div",
1261
- {
1262
- "data-slot": "settings-switch-row",
1263
- className: ui.cn("flex items-center justify-between gap-4", className),
1264
- children: [
1265
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
1266
- /* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: id, className: "flex items-center gap-2 text-sm font-medium text-foreground", children: [
1267
- icon,
1268
- title
1269
- ] }),
1270
- description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
1271
- ] }),
1272
- /* @__PURE__ */ jsxRuntime.jsx(
1273
- ui.Switch,
1274
- {
1275
- id,
1276
- checked,
1277
- onCheckedChange,
1278
- disabled,
1279
- "data-testid": testId
1280
- }
1281
- )
1282
- ]
1283
- }
1284
- );
1285
- }
1286
- function SettingsSwitchGroup({
1287
- className,
1288
- children
1289
- }) {
1290
- return /* @__PURE__ */ jsxRuntime.jsx(
1291
- "div",
1292
- {
1293
- "data-slot": "settings-switch-group",
1294
- className: ui.cn("ml-6 space-y-4 border-l border-border pl-4", className),
1295
- children
1296
- }
1297
- );
1298
- }
1299
- function NotificationCategoryList({
1300
- masterId,
1301
- masterTitle,
1302
- masterDescription,
1303
- masterChecked,
1304
- onMasterChange,
1305
- masterTestId,
1306
- categories,
1307
- onCategoryChange,
1308
- idPrefix = masterId,
1309
- testIdPrefix
1310
- }) {
1311
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "notification-category-list", children: [
1312
- /* @__PURE__ */ jsxRuntime.jsx(
1313
- SettingsSwitchRow,
1314
- {
1315
- id: masterId,
1316
- title: masterTitle,
1317
- description: masterDescription,
1318
- checked: masterChecked,
1319
- onCheckedChange: onMasterChange,
1320
- testId: chunkMHVNT4J3_cjs.testIdOr(masterTestId, { testId: "toggle-email-notifications" })
1321
- }
1322
- ),
1323
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-1 mt-3 space-y-3 border-l border-border pl-4 pointer-coarse:mt-5 pointer-coarse:space-y-5", children: categories.map((c) => /* @__PURE__ */ jsxRuntime.jsxs(
1324
- "label",
1325
- {
1326
- htmlFor: `${idPrefix}-${c.key}`,
1327
- className: ui.cn(
1328
- "flex items-start gap-3 pointer-coarse:min-h-11",
1329
- masterChecked ? "cursor-pointer" : "cursor-not-allowed opacity-50"
1330
- ),
1331
- children: [
1332
- /* @__PURE__ */ jsxRuntime.jsx(
1333
- ui.Checkbox,
1334
- {
1335
- id: `${idPrefix}-${c.key}`,
1336
- checked: c.checked,
1337
- disabled: !masterChecked,
1338
- onCheckedChange: (value) => onCategoryChange(c.key, value === true),
1339
- "data-testid": chunkMHVNT4J3_cjs.prefixedTestId(testIdPrefix, c.key, { testId: `toggle-email-${c.key}` }),
1340
- className: "mt-0.5 size-5 shrink-0"
1341
- }
1342
- ),
1343
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
1344
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm", children: c.label }),
1345
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 text-xs text-muted-foreground", children: c.description })
1346
- ] })
1347
- ]
1348
- },
1349
- c.key
1350
- )) })
1351
- ] });
1352
- }
1353
-
1354
- // src/settings/account-views.ts
1355
- function formatSessionTtl(totalSeconds) {
1356
- if (totalSeconds <= 0) return "expired";
1357
- const days = Math.floor(totalSeconds / 86400);
1358
- const hours = Math.floor(totalSeconds % 86400 / 3600);
1359
- const minutes = Math.floor(totalSeconds % 3600 / 60);
1360
- const parts = [];
1361
- if (days > 0) parts.push(`${days}d`);
1362
- if (hours > 0) parts.push(`${hours}h`);
1363
- if (minutes > 0) parts.push(`${minutes}m`);
1364
- return parts.length > 0 ? parts.join(" ") : "<1m";
1365
- }
1366
- function toActiveSessionViews(sessions, {
1367
- currentSessionId,
1368
- terminatingId,
1369
- renderIcon,
1370
- formatTtl = formatSessionTtl
1371
- }) {
1372
- return sessions.map((session) => {
1373
- const status = session.status || "user";
1374
- const count = session.workspaces.length;
1375
- return {
1376
- id: session.session_id,
1377
- name: session.name || (status === "agent" ? "Agent session" : "Browser session"),
1378
- isCurrent: session.session_id === currentSessionId,
1379
- isAgent: status === "agent",
1380
- detail: `${session.ip_address ?? "Unknown IP"} \xB7 expires in ${formatTtl(session.ttl)}${count > 0 ? ` \xB7 ${count} workspace${count > 1 ? "s" : ""}` : ""}`,
1381
- isTerminating: terminatingId === session.session_id,
1382
- icon: renderIcon?.(status)
1383
- };
1384
- }).sort((a, b) => Number(b.isCurrent) - Number(a.isCurrent));
1385
- }
1386
- function toLogoutSessionViews(sessions, formatTtl = formatSessionTtl) {
1387
- return sessions.map((session) => ({
1388
- id: session.session_id,
1389
- status: session.status || "user",
1390
- ipAddress: session.ip_address,
1391
- ttlLabel: formatTtl(session.ttl),
1392
- workspaceCount: session.workspaces.length
1393
- }));
1394
- }
1395
- function toDeleteBlockerViews(blockers, renderSubscriptionLink) {
1396
- return blockers.flatMap(
1397
- (blocker) => blocker.type === "active_subscription" ? [
1398
- {
1399
- key: "active_subscription",
1400
- content: renderSubscriptionLink ? renderSubscriptionLink() : "Active subscription: cancel it in your subscription settings first"
1401
- }
1402
- ] : blocker.workspaces.map((ws) => ({
1403
- key: `workspace-${ws}`,
1404
- content: `You are the sole admin of workspace "${ws}" \u2014 transfer admin rights or remove all other members first`
1405
- }))
1406
- );
1407
- }
1408
- var EMAIL_NOTIFICATION_CATEGORIES = [
1409
- { key: "messages", label: "New messages", description: "A direct message while you\u2019re offline" },
1410
- { key: "workspace_added", label: "Workspace access", description: "You\u2019re added to a workspace" },
1411
- {
1412
- key: "contact_accepted",
1413
- label: "Invitation accepted",
1414
- description: "Someone accepts your invitation"
1415
- },
1416
- { key: "referral_reward", label: "Rewards", description: "You earn a reward" },
1417
- {
1418
- key: "product_updates",
1419
- label: "ARBI update",
1420
- description: "Weekly digest of new features and highlights"
1421
- }
1422
- ];
1423
- var EMAIL_NOTIFICATION_KEYS = EMAIL_NOTIFICATION_CATEGORIES.map(
1424
- (c) => c.key
1425
- );
1426
- function toNotificationCategories(checked, defs = EMAIL_NOTIFICATION_CATEGORIES) {
1427
- return defs.map((def) => ({ ...def, checked: checked[def.key] ?? true }));
1428
- }
1429
- function PanelFrame({ testId, className, children }) {
1430
- return /* @__PURE__ */ jsxRuntime.jsx(
1431
- "div",
1432
- {
1433
- "data-slot": "panel-frame",
1434
- "data-testid": testId,
1435
- className: ui.cn("flex h-full min-h-0 flex-col bg-background", className),
1436
- children
1437
- }
1438
- );
1439
- }
1440
- function PanelFrameBody({ className, children }) {
1441
- return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "panel-frame-body", className: ui.cn("min-h-0 flex-1 overflow-hidden", className), children });
1442
- }
1443
- function PanelScroll({ variant = "flush", className, children }) {
1444
- return /* @__PURE__ */ jsxRuntime.jsx(
1445
- "div",
1446
- {
1447
- "data-slot": "panel-scroll",
1448
- className: ui.cn("h-full overflow-auto", variant === "padded" && "space-y-4 p-3", className),
1449
- children
1450
- }
1451
- );
1452
- }
1453
- function PanelActionsRow({
1454
- className,
1455
- children
1456
- }) {
1457
- return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "panel-actions-row", className: ui.cn("flex justify-end", className), children });
1458
- }
1459
- function PanelAddButton({
1460
- label,
1461
- onClick,
1462
- isCompact,
1463
- icon,
1464
- testId,
1465
- disabledReason
1466
- }) {
1467
- return /* @__PURE__ */ jsxRuntime.jsxs(
1468
- "button",
1469
- {
1470
- type: "button",
1471
- onClick,
1472
- disabled: !!disabledReason,
1473
- title: disabledReason ?? label,
1474
- "data-slot": "panel-add-button",
1475
- "data-testid": testId,
1476
- className: "flex h-8 items-center gap-1.5 rounded-md px-2 text-sm font-medium text-primary transition-colors hover:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent pointer-coarse:h-11 pointer-coarse:min-w-11",
1477
- children: [
1478
- icon,
1479
- isCompact ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: label }) : /* @__PURE__ */ jsxRuntime.jsx("span", { children: "New" })
1480
- ]
1481
- }
1482
- );
1483
- }
1484
- function PanelTitleBar({
1485
- icon,
1486
- title,
1487
- end
1488
- }) {
1489
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "panel-title-bar", className: "flex w-full items-center justify-between px-4 py-2", children: [
1490
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1491
- icon,
1492
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: title })
1493
- ] }),
1494
- end
1495
- ] });
1496
- }
1497
- function PanelNote({ children }) {
1498
- return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "panel-note", className: "py-8 text-center text-muted-foreground", children });
1499
- }
1500
- function resolveSettingsSection(sections, id) {
1501
- return sections.find((section) => section.id === id) ?? sections[0];
1502
- }
1503
- function SettingsPage({
1504
- sections,
1505
- activeSectionId,
1506
- onSectionChange,
1507
- title = "Settings",
1508
- headerActions,
1509
- children,
1510
- testId = "settings-page"
1511
- }) {
1512
- const active = resolveSettingsSection(sections, activeSectionId);
1513
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1514
- /* @__PURE__ */ jsxRuntime.jsxs(PanelFrame, { testId, children: [
1515
- /* @__PURE__ */ jsxRuntime.jsx(DraggableHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(
1516
- chunk7RGLTF76_cjs.TabHeader,
1517
- {
1518
- tabs: sections.map(({ id, label, icon }) => ({ id, label, icon })),
1519
- activeTabId: active?.id ?? "",
1520
- onTabChange: onSectionChange,
1521
- variant: "underline",
1522
- compactBreakpoint: 0,
1523
- rightContent: () => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1524
- active?.actions,
1525
- headerActions
1526
- ] })
1527
- }
1528
- ) }),
1529
- /* @__PURE__ */ jsxRuntime.jsxs(PanelFrameBody, { className: "overflow-auto px-6 pb-6 pt-4", children: [
1530
- /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "mx-auto mb-4 w-full max-w-2xl text-xl font-semibold text-foreground", children: title }),
1531
- active?.render()
1532
- ] })
1533
- ] }),
1534
- children
1535
- ] });
1536
- }
1537
- var DOT = {
1538
- connected: "bg-green-solid",
1539
- connecting: "bg-yellow-solid",
1540
- disconnected: "bg-red-solid",
1541
- offline: "bg-yellow-solid"
1542
- };
1543
- function ServerConnectionButton({
1544
- state,
1545
- label,
1546
- isRefreshing,
1547
- onRefresh,
1548
- testId = "refresh-session-button"
1549
- }) {
1550
- return /* @__PURE__ */ jsxRuntime.jsxs(
1551
- ui.Button,
1552
- {
1553
- type: "button",
1554
- variant: "outline",
1555
- size: "sm",
1556
- onClick: onRefresh,
1557
- disabled: isRefreshing,
1558
- className: "flex items-center gap-2",
1559
- "data-testid": testId,
1560
- "data-state": state,
1561
- children: [
1562
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: ui.cn("size-4", isRefreshing && "animate-spin") }),
1563
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: ui.cn("size-2 rounded-full", DOT[state]), "aria-hidden": true }),
1564
- label
1565
- ]
1566
- }
1567
- );
1568
- }
1569
- var DEFAULT_WORK_OFFLINE_LABELS = {
1570
- goOnline: "Go online",
1571
- workOffline: "Work offline",
1572
- goOnlineHint: "Reconnect and use ARBI online again",
1573
- workOfflineHint: "Work offline \u2014 read cached docs and queue edits, even though the server is reachable"
1574
- };
1575
- function WorkOfflineToggle({
1576
- isOffline,
1577
- onToggle,
1578
- labels,
1579
- testId = "work-offline-toggle"
1580
- }) {
1581
- const l = { ...DEFAULT_WORK_OFFLINE_LABELS, ...labels };
1582
- return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
1583
- /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1584
- ui.Button,
1585
- {
1586
- variant: isOffline ? "secondary" : "outline",
1587
- size: "icon",
1588
- onClick: () => onToggle(!isOffline),
1589
- "aria-label": isOffline ? l.goOnline : l.workOffline,
1590
- "aria-pressed": isOffline,
1591
- "data-testid": testId,
1592
- children: isOffline ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Wifi, { className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.WifiOff, { className: "size-4" })
1593
- }
1594
- ) }),
1595
- /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: isOffline ? l.goOnlineHint : l.workOfflineHint }) })
1596
- ] });
1597
- }
1598
- function serverConnectionView({ status, forcedOffline = false, deviceOffline = false }, domain) {
1599
- const state = forcedOffline || deviceOffline ? "offline" : status === "error" ? "disconnected" : status;
1600
- const label = forcedOffline ? "Working offline" : deviceOffline ? "Offline" : status === "connected" ? "Connected" : status === "connecting" ? "Connecting" : "Disconnected";
1601
- const description = deviceOffline && !forcedOffline ? "You're offline. ARBI reconnects by itself when your connection returns." : `${status === "connected" ? `Connected to ${domain}.` : status === "connecting" ? `Connecting to ${domain}...` : `Disconnected from ${domain}.`} Click to refresh your session.`;
1602
- return { state, label, description };
1603
- }
1604
- var GRID_ACCENT_CLASSES = [
1605
- "[&_.ag-checkbox-input-wrapper.ag-checked]:!bg-primary",
1606
- "[&_.ag-checkbox-input-wrapper.ag-checked]:!border-primary",
1607
- "[&_.ag-checkbox-input-wrapper.ag-checked]:!text-primary-foreground"
1608
- ];
1609
- var GRID_ACCENT_VARS = {
1610
- "--ag-checkbox-checked-color": "hsl(var(--primary))",
1611
- "--ag-selected-row-background-color": "hsl(var(--accent))"
1612
- };
1613
- function PremiumModelsFrame({
1614
- enabled,
1615
- onEnabledChange,
1616
- title = "Enable Premium Models",
1617
- description = "Third party AI models are priced on a pass-through basis.",
1618
- children,
1619
- toggleTestId
1620
- }) {
1621
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "premium-models-frame", children: [
1622
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-center gap-3", children: [
1623
- /* @__PURE__ */ jsxRuntime.jsx(
1624
- ui.Switch,
1625
- {
1626
- id: "premiumModelToggle",
1627
- checked: enabled,
1628
- onCheckedChange: onEnabledChange,
1629
- "data-testid": chunkMHVNT4J3_cjs.testIdOr(toggleTestId, { testId: "toggle-premium-model" })
1630
- }
1631
- ),
1632
- /* @__PURE__ */ jsxRuntime.jsxs(
1633
- "label",
1634
- {
1635
- className: "flex cursor-pointer items-center gap-2 text-sm font-medium",
1636
- htmlFor: "premiumModelToggle",
1637
- children: [
1638
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Crown, { className: "size-4 text-muted-foreground" }),
1639
- title
1640
- ]
1641
- }
1642
- )
1643
- ] }),
1644
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-sm text-muted-foreground", children: description }),
1645
- /* @__PURE__ */ jsxRuntime.jsx(
1646
- "div",
1647
- {
1648
- className: ui.cn(
1649
- "transition-opacity",
1650
- !enabled && "pointer-events-none opacity-50",
1651
- GRID_ACCENT_CLASSES
1652
- ),
1653
- style: GRID_ACCENT_VARS,
1654
- "aria-disabled": !enabled,
1655
- children
1656
- }
1657
- )
1658
- ] });
1659
- }
1660
- function ModelProviderLabel({ logo, children }) {
1661
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-slot": "model-provider", className: "flex items-center gap-1.5", children: [
1662
- logo,
1663
- children
1664
- ] });
1665
- }
1666
-
1667
- exports.ActiveSessionsDialog = ActiveSessionsDialog;
1668
- exports.AvatarPicker = AvatarPicker;
1669
- exports.DEFAULT_ACTIVE_SESSIONS_DIALOG_LABELS = DEFAULT_ACTIVE_SESSIONS_DIALOG_LABELS;
1670
- exports.DEFAULT_AVATAR_PICKER_LABELS = DEFAULT_AVATAR_PICKER_LABELS;
1671
- exports.DEFAULT_DELETE_ACCOUNT_DIALOG_LABELS = DEFAULT_DELETE_ACCOUNT_DIALOG_LABELS;
1672
- exports.DEFAULT_IDENTITY_VERIFICATION_LABELS = DEFAULT_IDENTITY_VERIFICATION_LABELS;
1673
- exports.DEFAULT_LOGOUT_DIALOG_LABELS = DEFAULT_LOGOUT_DIALOG_LABELS;
1674
- exports.DEFAULT_PASSWORD_CHANGE_DIALOG_LABELS = DEFAULT_PASSWORD_CHANGE_DIALOG_LABELS;
1675
- exports.DEFAULT_PROFILE_CARD_LABELS = DEFAULT_PROFILE_CARD_LABELS;
1676
- exports.DEFAULT_SETTINGS_DANGER_ZONE_LABELS = DEFAULT_SETTINGS_DANGER_ZONE_LABELS;
1677
- exports.DEFAULT_WORK_OFFLINE_LABELS = DEFAULT_WORK_OFFLINE_LABELS;
1678
- exports.DeleteAccountDialog = DeleteAccountDialog;
1679
- exports.DraggableHeader = DraggableHeader;
1680
- exports.EMAIL_NOTIFICATION_CATEGORIES = EMAIL_NOTIFICATION_CATEGORIES;
1681
- exports.EMAIL_NOTIFICATION_KEYS = EMAIL_NOTIFICATION_KEYS;
1682
- exports.IdentityVerificationCard = IdentityVerificationCard;
1683
- exports.IdentityVerificationDialog = IdentityVerificationDialog;
1684
- exports.LogoutDialog = LogoutDialog;
1685
- exports.ModelProviderLabel = ModelProviderLabel;
1686
- exports.NotificationCategoryList = NotificationCategoryList;
1687
- exports.PanelActionsRow = PanelActionsRow;
1688
- exports.PanelAddButton = PanelAddButton;
1689
- exports.PanelFrame = PanelFrame;
1690
- exports.PanelFrameBody = PanelFrameBody;
1691
- exports.PanelNote = PanelNote;
1692
- exports.PanelScroll = PanelScroll;
1693
- exports.PanelTitleBar = PanelTitleBar;
1694
- exports.PasswordChangeDialog = PasswordChangeDialog;
1695
- exports.PremiumModelsFrame = PremiumModelsFrame;
1696
- exports.ProfileCard = ProfileCard;
1697
- exports.RequireVerified = RequireVerified;
1698
- exports.ServerConnectionButton = ServerConnectionButton;
1699
- exports.SettingsActionRow = SettingsActionRow;
1700
- exports.SettingsCard = SettingsCard;
1701
- exports.SettingsDangerZone = SettingsDangerZone;
1702
- exports.SettingsPage = SettingsPage;
1703
- exports.SettingsPanel = SettingsPanel;
1704
- exports.SettingsRow = SettingsRow;
1705
- exports.SettingsSection = SettingsSection;
1706
- exports.SettingsSwitchGroup = SettingsSwitchGroup;
1707
- exports.SettingsSwitchRow = SettingsSwitchRow;
1708
- exports.WorkOfflineToggle = WorkOfflineToggle;
1709
- exports.formatSessionTtl = formatSessionTtl;
1710
- exports.resolveSettingsSection = resolveSettingsSection;
1711
- exports.serverConnectionView = serverConnectionView;
1712
- exports.toActiveSessionViews = toActiveSessionViews;
1713
- exports.toDeleteBlockerViews = toDeleteBlockerViews;
1714
- exports.toLogoutSessionViews = toLogoutSessionViews;
1715
- exports.toNotificationCategories = toNotificationCategories;
1716
- //# sourceMappingURL=chunk-U73KPFYH.cjs.map
1717
- //# sourceMappingURL=chunk-U73KPFYH.cjs.map