@plumile/backoffice-react 0.1.104 → 0.1.105

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 (228) hide show
  1. package/lib/esm/{AcceptInvitationScreen-B1IPafwD.js → AcceptInvitationScreen-VaWXQPHp.js} +4 -4
  2. package/lib/esm/AcceptInvitationScreen-VaWXQPHp.js.map +1 -0
  3. package/lib/esm/{BackofficeAcceptInvitationPage-BfRsORii.js → BackofficeAcceptInvitationPage-tpfBfhT9.js} +4 -4
  4. package/lib/esm/{BackofficeAcceptInvitationPage-BfRsORii.js.map → BackofficeAcceptInvitationPage-tpfBfhT9.js.map} +1 -1
  5. package/lib/esm/BackofficeDashboardPage-D5W36DY-.js +329 -0
  6. package/lib/esm/BackofficeDashboardPage-D5W36DY-.js.map +1 -0
  7. package/lib/esm/BackofficeDetailPayload-CZcsDv2w.js +98 -0
  8. package/lib/esm/BackofficeDetailPayload-CZcsDv2w.js.map +1 -0
  9. package/lib/esm/BackofficeEntityActionFormDialog-DrZxuytz.js +589 -0
  10. package/lib/esm/BackofficeEntityActionFormDialog-DrZxuytz.js.map +1 -0
  11. package/lib/esm/{BackofficeEntityDetailLayoutContext-DeuH5PCW.js → BackofficeEntityDetailLayoutContext-C5G-PH28.js} +1 -1
  12. package/lib/esm/{BackofficeEntityDetailLayoutContext-DeuH5PCW.js.map → BackofficeEntityDetailLayoutContext-C5G-PH28.js.map} +1 -1
  13. package/lib/esm/{BackofficeEntityDetailLayoutPage-Duc_DcIV.js → BackofficeEntityDetailLayoutPage-BSgGBzSL.js} +2 -2
  14. package/lib/esm/{BackofficeEntityDetailLayoutPage-Duc_DcIV.js.map → BackofficeEntityDetailLayoutPage-BSgGBzSL.js.map} +1 -1
  15. package/lib/esm/{BackofficeEntityDetailPage-ChxBrqz8.js → BackofficeEntityDetailPage-LB1uEJVM.js} +366 -358
  16. package/lib/esm/BackofficeEntityDetailPage-LB1uEJVM.js.map +1 -0
  17. package/lib/esm/{BackofficeEntityDetailUnknownPageRedirect-xupMeril.js → BackofficeEntityDetailUnknownPageRedirect-Iu4R3WvX.js} +3 -3
  18. package/lib/esm/{BackofficeEntityDetailUnknownPageRedirect-xupMeril.js.map → BackofficeEntityDetailUnknownPageRedirect-Iu4R3WvX.js.map} +1 -1
  19. package/lib/esm/BackofficeEntityListPage-D_zL-qRb.js +432 -0
  20. package/lib/esm/BackofficeEntityListPage-D_zL-qRb.js.map +1 -0
  21. package/lib/esm/BackofficeHubPage-DOePQ8Fc.js +121 -0
  22. package/lib/esm/BackofficeHubPage-DOePQ8Fc.js.map +1 -0
  23. package/lib/esm/BackofficeHubTemplate-C6K55egX.js +82 -0
  24. package/lib/esm/BackofficeHubTemplate-C6K55egX.js.map +1 -0
  25. package/lib/esm/{BackofficeLayoutPage-r6dXo9SI.js → BackofficeLayoutPage-Bq2bKkYF.js} +301 -217
  26. package/lib/esm/BackofficeLayoutPage-Bq2bKkYF.js.map +1 -0
  27. package/lib/esm/BackofficeListToolbar-loFfIPtP.js +109 -0
  28. package/lib/esm/BackofficeListToolbar-loFfIPtP.js.map +1 -0
  29. package/lib/esm/{BackofficeLoginPage-BMPhO1cr.js → BackofficeLoginPage-DIlcOueK.js} +5 -5
  30. package/lib/esm/{BackofficeLoginPage-BMPhO1cr.js.map → BackofficeLoginPage-DIlcOueK.js.map} +1 -1
  31. package/lib/esm/{BackofficePasswordResetCompletePage-OApMUiOi.js → BackofficePasswordResetCompletePage-Cit5sdDm.js} +6 -7
  32. package/lib/esm/{BackofficePasswordResetCompletePage-OApMUiOi.js.map → BackofficePasswordResetCompletePage-Cit5sdDm.js.map} +1 -1
  33. package/lib/esm/{BackofficePasswordResetRequestPage-DPDImb37.js → BackofficePasswordResetRequestPage-B_TurHev.js} +5 -6
  34. package/lib/esm/{BackofficePasswordResetRequestPage-DPDImb37.js.map → BackofficePasswordResetRequestPage-B_TurHev.js.map} +1 -1
  35. package/lib/esm/{BackofficePermissionsContext-CmWwudBU.js → BackofficePermissionsContext-C2bdxy2z.js} +1 -1
  36. package/lib/esm/{BackofficePermissionsContext-CmWwudBU.js.map → BackofficePermissionsContext-C2bdxy2z.js.map} +1 -1
  37. package/lib/esm/BackofficeRightPageLayout-CfNkrMvH.js +83 -0
  38. package/lib/esm/BackofficeRightPageLayout-CfNkrMvH.js.map +1 -0
  39. package/lib/esm/{BackofficeTopbarPortalContext-CphoSrZD.js → BackofficeTopbarPortalContext-Da5XFatM.js} +1 -1
  40. package/lib/esm/BackofficeTopbarPortalContext-Da5XFatM.js.map +1 -0
  41. package/lib/esm/{BackofficeVerifyEmailPage-DHuSOxDf.js → BackofficeVerifyEmailPage-DQbFIob1.js} +6 -7
  42. package/lib/esm/{BackofficeVerifyEmailPage-DHuSOxDf.js.map → BackofficeVerifyEmailPage-DQbFIob1.js.map} +1 -1
  43. package/lib/esm/EntityIdPickerDialog-BSn0v3bv.js +340 -0
  44. package/lib/esm/EntityIdPickerDialog-BSn0v3bv.js.map +1 -0
  45. package/lib/esm/LazyBackofficeEntityActionFormDialog-oRd_WHAK.js +670 -0
  46. package/lib/esm/LazyBackofficeEntityActionFormDialog-oRd_WHAK.js.map +1 -0
  47. package/lib/esm/backoffice-react.js +553 -315
  48. package/lib/esm/backoffice-react.js.map +1 -1
  49. package/lib/esm/{backofficeAuthPaths-2KMmkBLv.js → backofficeAuthPaths-2hHNn8D3.js} +1 -1
  50. package/lib/esm/{backofficeAuthPaths-2KMmkBLv.js.map → backofficeAuthPaths-2hHNn8D3.js.map} +1 -1
  51. package/lib/esm/backofficeEntityActionFormDialog.css-DJgEKwaA.js +6 -0
  52. package/lib/esm/backofficeEntityActionFormDialog.css-DJgEKwaA.js.map +1 -0
  53. package/lib/esm/{buildBreadcrumbs-C9cyiXb7.js → buildBreadcrumbs-C5St167Y.js} +1 -1
  54. package/lib/esm/buildBreadcrumbs-C5St167Y.js.map +1 -0
  55. package/lib/esm/{buildDataTableColumns-DGPjPK4N.js → buildDataTableColumns-DdmF-EYq.js} +1 -1
  56. package/lib/esm/{buildDataTableColumns-DGPjPK4N.js.map → buildDataTableColumns-DdmF-EYq.js.map} +1 -1
  57. package/lib/esm/{mutationResult-CcQMY13J.js → mutationResult-C2Vb_vPt.js} +1 -1
  58. package/lib/esm/{mutationResult-CcQMY13J.js.map → mutationResult-C2Vb_vPt.js.map} +1 -1
  59. package/lib/esm/{pageResolution-hAQA5C6S.js → pageResolution-CUaTq4Ql.js} +1 -1
  60. package/lib/esm/{pageResolution-hAQA5C6S.js.map → pageResolution-CUaTq4Ql.js.map} +1 -1
  61. package/lib/esm/{sidebarUtils-BZETlHea.js → sidebarUtils-BgCBLJLv.js} +20 -6
  62. package/lib/esm/sidebarUtils-BgCBLJLv.js.map +1 -0
  63. package/lib/esm/style.css +1 -1
  64. package/lib/esm/{synchronizeAuthStatusQuery-BoPKMrP1.js → synchronizeAuthStatusQuery-DNJR5MfH.js} +8 -9
  65. package/lib/esm/synchronizeAuthStatusQuery-DNJR5MfH.js.map +1 -0
  66. package/lib/esm/{toastViewAction-DJkv_4p9.js → toastViewAction-DQYlcGOL.js} +1 -1
  67. package/lib/esm/{toastViewAction-DJkv_4p9.js.map → toastViewAction-DQYlcGOL.js.map} +1 -1
  68. package/lib/esm/{useAuth-CheTnq60.js → useAuth-CWf8ZspF.js} +70 -66
  69. package/lib/esm/useAuth-CWf8ZspF.js.map +1 -0
  70. package/lib/esm/{useBackofficeAuth-DVAXNAjP.js → useBackofficeAuth-Da7FPNys.js} +2 -2
  71. package/lib/esm/{useBackofficeAuth-DVAXNAjP.js.map → useBackofficeAuth-Da7FPNys.js.map} +1 -1
  72. package/lib/esm/{useBackofficeLazyValue-CoIAK-5N.js → useBackofficeLazyValue-CW9xfRzQ.js} +1 -1
  73. package/lib/esm/{useBackofficeLazyValue-CoIAK-5N.js.map → useBackofficeLazyValue-CW9xfRzQ.js.map} +1 -1
  74. package/lib/esm/{useBackofficeListUrlState-D4fx5O7u.js → useBackofficeListUrlState-Ca6d7uIN.js} +1 -1
  75. package/lib/esm/useBackofficeListUrlState-Ca6d7uIN.js.map +1 -0
  76. package/lib/types/auth/login/LoginFlow.d.ts.map +1 -1
  77. package/lib/types/auth/login/MfaChallengeForm.d.ts.map +1 -1
  78. package/lib/types/auth/login/PasskeyLoginForm.d.ts.map +1 -1
  79. package/lib/types/auth/pages/AcceptInvitationScreen.d.ts.map +1 -1
  80. package/lib/types/components/backoffice/actions/BackofficeEntityActionFormDialog.d.ts.map +1 -1
  81. package/lib/types/components/backoffice/actions/LazyBackofficeEntityActionFormDialog.d.ts.map +1 -1
  82. package/lib/types/components/backoffice/actions/backofficeEntityActionFormDialog.css.d.ts +4 -0
  83. package/lib/types/components/backoffice/actions/backofficeEntityActionFormDialog.css.d.ts.map +1 -1
  84. package/lib/types/components/backoffice/detail/BackofficeDetailRelationLink.d.ts +3 -5
  85. package/lib/types/components/backoffice/detail/BackofficeDetailRelationLink.d.ts.map +1 -1
  86. package/lib/types/components/backoffice/detail/BackofficeDetailRelationListBlock.d.ts +3 -4
  87. package/lib/types/components/backoffice/detail/BackofficeDetailRelationListBlock.d.ts.map +1 -1
  88. package/lib/types/components/backoffice/detail/BackofficeDetailSection.d.ts.map +1 -1
  89. package/lib/types/components/backoffice/detail/backofficeDetailField.css.d.ts +1 -0
  90. package/lib/types/components/backoffice/detail/backofficeDetailField.css.d.ts.map +1 -1
  91. package/lib/types/components/backoffice/detail/backofficeDetailLayout.css.d.ts.map +1 -1
  92. package/lib/types/components/backoffice/detail/backofficeDetailRelationLink.css.d.ts +2 -0
  93. package/lib/types/components/backoffice/detail/backofficeDetailRelationLink.css.d.ts.map +1 -1
  94. package/lib/types/components/backoffice/filters/BackofficeFilterAction.d.ts +4 -4
  95. package/lib/types/components/backoffice/filters/BackofficeFilterAction.d.ts.map +1 -1
  96. package/lib/types/components/backoffice/filters/DeferredFilterSearchInput.d.ts +13 -0
  97. package/lib/types/components/backoffice/filters/DeferredFilterSearchInput.d.ts.map +1 -0
  98. package/lib/types/components/backoffice/filters/EntityIdFilterField.d.ts +4 -0
  99. package/lib/types/components/backoffice/filters/EntityIdFilterField.d.ts.map +1 -1
  100. package/lib/types/components/backoffice/filters/deferredFilterSearchInput.css.d.ts +3 -0
  101. package/lib/types/components/backoffice/filters/deferredFilterSearchInput.css.d.ts.map +1 -0
  102. package/lib/types/components/backoffice/filters/entityIdFilterField.css.d.ts +3 -0
  103. package/lib/types/components/backoffice/filters/entityIdFilterField.css.d.ts.map +1 -1
  104. package/lib/types/components/backoffice/hub/BackofficeHubTemplate.d.ts +36 -0
  105. package/lib/types/components/backoffice/hub/BackofficeHubTemplate.d.ts.map +1 -0
  106. package/lib/types/{pages/backofficeHubPage.css.d.ts → components/backoffice/hub/backofficeHubTemplate.css.d.ts} +5 -3
  107. package/lib/types/components/backoffice/hub/backofficeHubTemplate.css.d.ts.map +1 -0
  108. package/lib/types/components/backoffice/layout/breadcrumb/BackofficeTopbarBreadcrumb.d.ts.map +1 -1
  109. package/lib/types/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.d.ts +2 -0
  110. package/lib/types/components/backoffice/layout/breadcrumb/BackofficeTopbarPortalContext.d.ts.map +1 -1
  111. package/lib/types/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.d.ts +3 -0
  112. package/lib/types/components/backoffice/layout/breadcrumb/backofficeTopbarBreadcrumb.css.d.ts.map +1 -1
  113. package/lib/types/components/backoffice/layout/breadcrumb/buildBreadcrumbs.d.ts +2 -2
  114. package/lib/types/components/backoffice/layout/breadcrumb/buildBreadcrumbs.d.ts.map +1 -1
  115. package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts +1 -0
  116. package/lib/types/components/backoffice/layout/buildSidebarSections.d.ts.map +1 -1
  117. package/lib/types/components/backoffice/layout/sidebarUtils.d.ts +2 -1
  118. package/lib/types/components/backoffice/layout/sidebarUtils.d.ts.map +1 -1
  119. package/lib/types/components/backoffice/lists/BackofficeListToolbar.d.ts +16 -0
  120. package/lib/types/components/backoffice/lists/BackofficeListToolbar.d.ts.map +1 -0
  121. package/lib/types/components/backoffice/lists/backofficeListToolbar.css.d.ts +16 -0
  122. package/lib/types/components/backoffice/lists/backofficeListToolbar.css.d.ts.map +1 -0
  123. package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts +1 -1
  124. package/lib/types/components/backoffice/pickers/EntityIdPickerDialog.d.ts.map +1 -1
  125. package/lib/types/components/backoffice/pickers/entityIdPickerDialog.css.d.ts +2 -0
  126. package/lib/types/components/backoffice/pickers/entityIdPickerDialog.css.d.ts.map +1 -1
  127. package/lib/types/components/backoffice/pickers/shared/EntityPickerList.d.ts.map +1 -1
  128. package/lib/types/components/backoffice/pickers/shared/EntityPickerShell.d.ts.map +1 -1
  129. package/lib/types/components/backoffice/pickers/types.d.ts +1 -1
  130. package/lib/types/components/backoffice/pickers/types.d.ts.map +1 -1
  131. package/lib/types/components/backoffice/refs/BackofficeEntityIdRef.d.ts +4 -4
  132. package/lib/types/components/backoffice/refs/BackofficeEntityIdRef.d.ts.map +1 -1
  133. package/lib/types/components/backoffice/refs/BackofficeRelatedCountLink.d.ts.map +1 -1
  134. package/lib/types/components/backoffice/refs/backofficeRelatedCountLink.css.d.ts +2 -0
  135. package/lib/types/components/backoffice/refs/backofficeRelatedCountLink.css.d.ts.map +1 -1
  136. package/lib/types/components/backoffice/routing/BackofficeContentError.d.ts +1 -1
  137. package/lib/types/components/backoffice/routing/BackofficeContentError.d.ts.map +1 -1
  138. package/lib/types/components/backoffice/routing/BackofficeRouteFallback.d.ts +4 -0
  139. package/lib/types/components/backoffice/routing/BackofficeRouteFallback.d.ts.map +1 -1
  140. package/lib/types/components/backoffice/scaffolds/BackofficeEntityDetailScaffold.d.ts.map +1 -1
  141. package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts +10 -6
  142. package/lib/types/components/backoffice/scaffolds/BackofficeEntityListScaffold.d.ts.map +1 -1
  143. package/lib/types/components/backoffice/scaffolds/BackofficeListFilterContext.d.ts +3 -3
  144. package/lib/types/components/backoffice/scaffolds/BackofficeListFilterContext.d.ts.map +1 -1
  145. package/lib/types/components/backoffice/scaffolds/backofficeEntityListScaffold.css.d.ts.map +1 -1
  146. package/lib/types/components/backoffice/shared/BackofficeFilterableCell.d.ts +13 -0
  147. package/lib/types/components/backoffice/shared/BackofficeFilterableCell.d.ts.map +1 -0
  148. package/lib/types/components/backoffice/shared/backofficeFilterableCell.css.d.ts +12 -0
  149. package/lib/types/components/backoffice/shared/backofficeFilterableCell.css.d.ts.map +1 -0
  150. package/lib/types/components/backoffice/shared/backofficeInlineFilterRow.css.d.ts.map +1 -1
  151. package/lib/types/filters/filterHelpers.d.ts +3 -3
  152. package/lib/types/filters/filterHelpers.d.ts.map +1 -1
  153. package/lib/types/hooks/useAuth.d.ts.map +1 -1
  154. package/lib/types/hooks/useBackofficeInfiniteScrollSentinel.d.ts.map +1 -1
  155. package/lib/types/hooks/useBackofficeListRefetch.d.ts +7 -3
  156. package/lib/types/hooks/useBackofficeListRefetch.d.ts.map +1 -1
  157. package/lib/types/hooks/useBackofficeListUrlState.d.ts +2 -2
  158. package/lib/types/hooks/useBackofficeListUrlState.d.ts.map +1 -1
  159. package/lib/types/i18n/resources.d.ts +84 -7
  160. package/lib/types/i18n/resources.d.ts.map +1 -1
  161. package/lib/types/index.d.ts +3 -0
  162. package/lib/types/index.d.ts.map +1 -1
  163. package/lib/types/pages/BackofficeDashboardPage.d.ts.map +1 -1
  164. package/lib/types/pages/BackofficeEntityDetailPage.d.ts.map +1 -1
  165. package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts +3 -8
  166. package/lib/types/pages/BackofficeEntityDetailPage.view-helpers.d.ts.map +1 -1
  167. package/lib/types/pages/BackofficeEntityListPage.d.ts +2 -2
  168. package/lib/types/pages/BackofficeEntityListPage.d.ts.map +1 -1
  169. package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts +8 -4
  170. package/lib/types/pages/BackofficeEntityListPage.helpers.d.ts.map +1 -1
  171. package/lib/types/pages/BackofficeHubPage.d.ts.map +1 -1
  172. package/lib/types/pages/BackofficeLayoutPage.d.ts.map +1 -1
  173. package/lib/types/pages/BackofficePasswordResetCompletePage.d.ts.map +1 -1
  174. package/lib/types/pages/BackofficePasswordResetRequestPage.d.ts.map +1 -1
  175. package/lib/types/pages/BackofficeVerifyEmailPage.d.ts.map +1 -1
  176. package/lib/types/pages/backofficeDashboardPage.css.d.ts +1 -14
  177. package/lib/types/pages/backofficeDashboardPage.css.d.ts.map +1 -1
  178. package/lib/types/pages/backofficeEntityDetailPage.css.d.ts +2 -0
  179. package/lib/types/pages/backofficeEntityDetailPage.css.d.ts.map +1 -1
  180. package/lib/types/pages/dashboard/DashboardMetricGroup.d.ts +14 -0
  181. package/lib/types/pages/dashboard/DashboardMetricGroup.d.ts.map +1 -0
  182. package/lib/types/pages/dashboard/DashboardPanel.d.ts +9 -0
  183. package/lib/types/pages/dashboard/DashboardPanel.d.ts.map +1 -0
  184. package/lib/types/pages/dashboard/DashboardQuickActions.d.ts +13 -0
  185. package/lib/types/pages/dashboard/DashboardQuickActions.d.ts.map +1 -0
  186. package/lib/types/pages/dashboard/DashboardStatusList.d.ts +13 -0
  187. package/lib/types/pages/dashboard/DashboardStatusList.d.ts.map +1 -0
  188. package/lib/types/pages/dashboard/dashboardMetricGroup.css.d.ts +4 -0
  189. package/lib/types/pages/dashboard/dashboardMetricGroup.css.d.ts.map +1 -0
  190. package/lib/types/pages/dashboard/dashboardPanel.css.d.ts +2 -0
  191. package/lib/types/pages/dashboard/dashboardPanel.css.d.ts.map +1 -0
  192. package/lib/types/pages/dashboard/dashboardQuickActions.css.d.ts +5 -0
  193. package/lib/types/pages/dashboard/dashboardQuickActions.css.d.ts.map +1 -0
  194. package/lib/types/pages/dashboard/dashboardStatusList.css.d.ts +6 -0
  195. package/lib/types/pages/dashboard/dashboardStatusList.css.d.ts.map +1 -0
  196. package/lib/types/provider/BackofficeProvider.d.ts.map +1 -1
  197. package/lib/types/provider/types.d.ts +5 -1
  198. package/lib/types/provider/types.d.ts.map +1 -1
  199. package/lib/types/router/createBackofficeRoutes.d.ts.map +1 -1
  200. package/package.json +5 -5
  201. package/lib/esm/AcceptInvitationScreen-B1IPafwD.js.map +0 -1
  202. package/lib/esm/BackofficeDashboardPage-CZAcZwRc.js +0 -344
  203. package/lib/esm/BackofficeDashboardPage-CZAcZwRc.js.map +0 -1
  204. package/lib/esm/BackofficeDetailPayload-P61MDRLE.js +0 -94
  205. package/lib/esm/BackofficeDetailPayload-P61MDRLE.js.map +0 -1
  206. package/lib/esm/BackofficeEntityActionFormDialog-BgMuhyU8.js +0 -512
  207. package/lib/esm/BackofficeEntityActionFormDialog-BgMuhyU8.js.map +0 -1
  208. package/lib/esm/BackofficeEntityDetailPage-ChxBrqz8.js.map +0 -1
  209. package/lib/esm/BackofficeEntityListPage-BACvfX6c.js +0 -404
  210. package/lib/esm/BackofficeEntityListPage-BACvfX6c.js.map +0 -1
  211. package/lib/esm/BackofficeHubPage-BsUXulN0.js +0 -136
  212. package/lib/esm/BackofficeHubPage-BsUXulN0.js.map +0 -1
  213. package/lib/esm/BackofficeLayoutPage-r6dXo9SI.js.map +0 -1
  214. package/lib/esm/BackofficeRightPageLayout-BZb7LhT-.js +0 -53
  215. package/lib/esm/BackofficeRightPageLayout-BZb7LhT-.js.map +0 -1
  216. package/lib/esm/BackofficeTopbarPortalContext-CphoSrZD.js.map +0 -1
  217. package/lib/esm/EntityFilterValue-BWUdPBwp.js +0 -78
  218. package/lib/esm/EntityFilterValue-BWUdPBwp.js.map +0 -1
  219. package/lib/esm/EntityIdPickerDialog-Yhmr-WsV.js +0 -308
  220. package/lib/esm/EntityIdPickerDialog-Yhmr-WsV.js.map +0 -1
  221. package/lib/esm/LazyBackofficeEntityActionFormDialog-uyYFFJGM.js +0 -522
  222. package/lib/esm/LazyBackofficeEntityActionFormDialog-uyYFFJGM.js.map +0 -1
  223. package/lib/esm/buildBreadcrumbs-C9cyiXb7.js.map +0 -1
  224. package/lib/esm/sidebarUtils-BZETlHea.js.map +0 -1
  225. package/lib/esm/synchronizeAuthStatusQuery-BoPKMrP1.js.map +0 -1
  226. package/lib/esm/useAuth-CheTnq60.js.map +0 -1
  227. package/lib/esm/useBackofficeListUrlState-D4fx5O7u.js.map +0 -1
  228. package/lib/types/pages/backofficeHubPage.css.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { o as e } from "./environment-DQfVyWHJ.js";
2
2
  import { t } from "./useBackofficeReactTranslation-Btt58EIo.js";
3
3
  import { a as n, c as r, d as i, s as a, t as o } from "./loginPage.css-B7Io_DuU.js";
4
- import { i as s, t as c } from "./mutationResult-CcQMY13J.js";
4
+ import { i as s, t as c } from "./mutationResult-C2Vb_vPt.js";
5
5
  import { useCallback as l, useEffect as u, useState as d } from "react";
6
6
  import { Button as f, FormError as p, FormField as m } from "@plumile/ui";
7
7
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
@@ -22,15 +22,14 @@ var _ = ({ auth: e, onSuccess: s, onBack: c }) => {
22
22
  let t = { code: n };
23
23
  await e.completeMfa(t), s();
24
24
  } catch {
25
- let t = e.error?.message;
26
- x(t ?? _("auth.mfa.errors.verificationFailed"));
25
+ x(_("auth.mfa.errors.verificationFailed"));
27
26
  }
28
27
  }, [
29
28
  e,
30
29
  v,
31
30
  s,
32
31
  _
33
- ]), C = e.emailHint == null ? _("auth.mfa.helper.default") : _("auth.mfa.helper.withEmail", { email: e.emailHint }), w = b ?? e.error?.message ?? null;
32
+ ]), C = e.emailHint == null ? _("auth.mfa.helper.default") : _("auth.mfa.helper.withEmail", { email: e.emailHint }), w = b;
34
33
  return /* @__PURE__ */ g("form", {
35
34
  className: n,
36
35
  onSubmit: S,
@@ -116,11 +115,11 @@ var S = {
116
115
  mfaLevel: null,
117
116
  nextStep: null
118
117
  }, C = (n) => () => {
119
- let { t: r } = t(), [i, a] = d(!1), [o, u] = d(null), [f, p] = d(null), [m, h] = d(null), [g, _] = d([]), [b, C] = d(S), w = n.login.commit, T = n.logout.commit, E = n.completeMfa.commit, D = n.beginPasskeyLogin.commit, O = n.finishPasskeyLogin.commit, k = n.acceptInvitation?.commit, A = n.beginAuthentication.commit, j = r("auth.loginFlow.errors.tryAgain"), M = r("auth.loginFlow.errors.tryAgain"), N = r("auth.passkey.errors.failed"), P = r("auth.mfa.errors.verificationFailed"), F = r("auth.acceptInvitation.errors.default"), I = r("auth.mfa.errors.invalidChallenge"), L = r("auth.passkey.errors.notAvailable"), R = "Logout failed.", z = l(() => {
118
+ let { t: r } = t(), [i, a] = d(!1), [o, u] = d(null), [f, p] = d(null), [m, h] = d(null), [g, _] = d([]), [b, C] = d(S), w = n.login.commit, T = n.logout.commit, E = n.completeMfa.commit, D = n.beginPasskeyLogin.commit, O = n.finishPasskeyLogin.commit, k = n.acceptInvitation?.commit, A = n.beginAuthentication.commit, j = r("auth.loginFlow.errors.tryAgain"), M = r("auth.loginFlow.errors.tryAgain"), N = r("auth.passkey.errors.failed"), P = r("auth.mfa.errors.verificationFailed"), F = r("auth.acceptInvitation.errors.default"), I = r("auth.mfa.errors.invalidChallenge"), L = r("auth.passkey.errors.notAvailable"), R = r("auth.logout.errors.default"), z = r("auth.passkey.errors.cancelled"), B = r("auth.passkey.errors.noCredential"), V = r("auth.acceptInvitation.errors.unavailable"), H = l(() => {
120
119
  u(null), p(null), h(null), _([]), C(S);
121
- }, []), B = l(() => {
120
+ }, []), U = l(() => {
122
121
  u(null);
123
- }, []), V = l((e) => {
122
+ }, []), W = l((e) => {
124
123
  let t = e.authMethod ?? null, n = e.challengeToken ?? null, r = e.mfaLevel ?? null, i = e.nextStep ?? null;
125
124
  return C((e) => ({
126
125
  ...e,
@@ -129,7 +128,7 @@ var S = {
129
128
  mfaLevel: r,
130
129
  nextStep: i
131
130
  })), e.loggedInUser != null && i == null ? (p({ id: e.loggedInUser.id }), "success") : i === "TOTP" && n != null ? "mfa-required" : "error";
132
- }, []), H = l((e) => typeof e == "object" && !!e && ("status" in e || "result" in e), []), U = l((e) => {
131
+ }, []), G = l((e) => typeof e == "object" && !!e && ("status" in e || "result" in e), []), K = l((e) => {
133
132
  switch (e) {
134
133
  case "INVALID_CREDENTIALS": return r("auth.loginFlow.errors.invalidCredentials");
135
134
  case "ACCOUNT_LOCKED": return r("auth.loginFlow.errors.accountLocked");
@@ -137,13 +136,13 @@ var S = {
137
136
  case "INTERNAL_ERROR": return r("auth.loginFlow.errors.tryAgain");
138
137
  default: return null;
139
138
  }
140
- }, [r]), W = l((e) => {
139
+ }, [r]), q = l((e) => {
141
140
  switch (e) {
142
141
  case "INVALID_EMAIL": return r("auth.loginFlow.errors.invalidEmail");
143
142
  case "INTERNAL_ERROR": return r("auth.loginFlow.errors.tryAgain");
144
143
  default: return null;
145
144
  }
146
- }, [r]), G = l((e) => {
145
+ }, [r]), J = l((e) => {
147
146
  switch (e) {
148
147
  case "INVALID_EMAIL": return r("auth.passkey.errors.invalidEmail");
149
148
  case "PASSKEY_NOT_FOUND": return r("auth.passkey.errors.notFound");
@@ -151,7 +150,7 @@ var S = {
151
150
  case "INTERNAL_ERROR": return r("auth.passkey.errors.failed");
152
151
  default: return null;
153
152
  }
154
- }, [r]), K = l((e) => {
153
+ }, [r]), Y = l((e) => {
155
154
  switch (e) {
156
155
  case "INVALID_CHALLENGE_TOKEN": return r("auth.passkey.errors.invalidChallenge");
157
156
  case "CHALLENGE_EXPIRED": return r("auth.passkey.errors.challengeExpired");
@@ -159,7 +158,7 @@ var S = {
159
158
  case "INTERNAL_ERROR": return r("auth.passkey.errors.failed");
160
159
  default: return null;
161
160
  }
162
- }, [r]), q = l((e) => {
161
+ }, [r]), X = l((e) => {
163
162
  switch (e) {
164
163
  case "INVALID_CHALLENGE_TOKEN": return r("auth.mfa.errors.invalidChallenge");
165
164
  case "CHALLENGE_EXPIRED": return r("auth.mfa.errors.expired");
@@ -168,7 +167,7 @@ var S = {
168
167
  case "INTERNAL_ERROR": return r("auth.mfa.errors.verificationFailed");
169
168
  default: return null;
170
169
  }
171
- }, [r]), J = l((e) => {
170
+ }, [r]), Z = l((e) => {
172
171
  switch (e) {
173
172
  case "INVALID_TOKEN": return r("auth.acceptInvitation.errors.invalidToken");
174
173
  case "TOKEN_EXPIRED": return r("auth.acceptInvitation.errors.expired");
@@ -180,15 +179,15 @@ var S = {
180
179
  case "INTERNAL_ERROR": return r("auth.acceptInvitation.errors.default");
181
180
  default: return null;
182
181
  }
183
- }, [r]), Y = l(async (e) => new Promise((t, n) => {
182
+ }, [r]), Q = l(async (e) => new Promise((t, n) => {
184
183
  A({
185
184
  variables: { email: e },
186
185
  onCompleted: (e) => {
187
186
  let r = e.beginAuthentication, i = r;
188
- if (H(r)) {
187
+ if (G(r)) {
189
188
  let e = s(r, {
190
189
  defaultErrorMessage: M,
191
- mapReason: W
190
+ mapReason: q
192
191
  });
193
192
  if (!e.ok) {
194
193
  let t = { message: e.message };
@@ -211,9 +210,9 @@ var S = {
211
210
  }), [
212
211
  A,
213
212
  M,
214
- H,
215
- W
216
- ]), X = l(async (e) => (a(!0), u(null), C((t) => ({
213
+ G,
214
+ q
215
+ ]), $ = l(async (e) => (a(!0), u(null), C((t) => ({
217
216
  ...t,
218
217
  emailHint: e.email
219
218
  })), new Promise((t, n) => {
@@ -222,10 +221,10 @@ var S = {
222
221
  onCompleted: (e) => {
223
222
  a(!1);
224
223
  let r = e.login, i = null;
225
- if (H(r)) {
224
+ if (G(r)) {
226
225
  let e = s(r, {
227
226
  defaultErrorMessage: j,
228
- mapReason: U
227
+ mapReason: K
229
228
  });
230
229
  if (!e.ok) {
231
230
  let t = { message: e.message };
@@ -239,7 +238,7 @@ var S = {
239
238
  u(e), n(e);
240
239
  return;
241
240
  }
242
- let o = V(i);
241
+ let o = W(i);
243
242
  if (o === "success" || o === "mfa-required") {
244
243
  t(o);
245
244
  return;
@@ -256,10 +255,10 @@ var S = {
256
255
  })), [
257
256
  w,
258
257
  j,
259
- H,
260
- U,
261
- V
262
- ]), Z = l(async (e) => {
258
+ G,
259
+ K,
260
+ W
261
+ ]), ee = l(async (e) => {
263
262
  let { challengeToken: t } = b;
264
263
  if (t == null) {
265
264
  let e = { message: I };
@@ -274,10 +273,10 @@ var S = {
274
273
  onCompleted: (e) => {
275
274
  a(!1);
276
275
  let t = e.completeMfa, i = null;
277
- if (H(t)) {
276
+ if (G(t)) {
278
277
  let e = s(t, {
279
278
  defaultErrorMessage: P,
280
- mapReason: q
279
+ mapReason: X
281
280
  });
282
281
  if (!e.ok) {
283
282
  let t = { message: e.message };
@@ -291,7 +290,7 @@ var S = {
291
290
  u(e), r(e);
292
291
  return;
293
292
  }
294
- if (V(i) === "success") {
293
+ if (W(i) === "success") {
295
294
  n();
296
295
  return;
297
296
  }
@@ -309,11 +308,11 @@ var S = {
309
308
  b,
310
309
  E,
311
310
  P,
312
- H,
313
- q,
311
+ G,
312
+ X,
314
313
  I,
315
- V
316
- ]), Q = l(async ({ email: e }) => {
314
+ W
315
+ ]), te = l(async ({ email: e }) => {
317
316
  if (typeof window > "u") {
318
317
  let e = { message: L };
319
318
  return u(e), Promise.reject(e);
@@ -326,10 +325,10 @@ var S = {
326
325
  variables: { email: e },
327
326
  onCompleted: (e) => {
328
327
  let r = e.beginPasskeyLogin, i = r;
329
- if (H(r)) {
328
+ if (G(r)) {
330
329
  let e = s(r, {
331
330
  defaultErrorMessage: N,
332
- mapReason: G
331
+ mapReason: J
333
332
  });
334
333
  if (!e.ok) {
335
334
  a(!1);
@@ -350,7 +349,7 @@ var S = {
350
349
  rpId: i.rpId,
351
350
  userVerification: "preferred"
352
351
  } });
353
- if (e == null) throw Error("No credential returned by the authenticator.");
352
+ if (e == null) throw Error("PASSKEY_NO_CREDENTIAL");
354
353
  let r = e.response, o = x(r.authenticatorData);
355
354
  O({
356
355
  variables: { input: {
@@ -363,10 +362,10 @@ var S = {
363
362
  onCompleted: (e) => {
364
363
  a(!1);
365
364
  let r = e.finishPasskeyLogin, i = null;
366
- if (H(r)) {
365
+ if (G(r)) {
367
366
  let e = s(r, {
368
367
  defaultErrorMessage: N,
369
- mapReason: K
368
+ mapReason: Y
370
369
  });
371
370
  if (!e.ok) {
372
371
  let t = { message: e.message };
@@ -380,7 +379,7 @@ var S = {
380
379
  u(e), n(e);
381
380
  return;
382
381
  }
383
- let o = V(i);
382
+ let o = W(i);
384
383
  if (o === "success") {
385
384
  t(o);
386
385
  return;
@@ -396,8 +395,10 @@ var S = {
396
395
  });
397
396
  } catch (e) {
398
397
  a(!1);
399
- let t = { message: e instanceof Error ? e.message : "Passkey login was cancelled." };
400
- u(t), n(t);
398
+ let t = N;
399
+ e instanceof Error && e.message === "PASSKEY_NO_CREDENTIAL" ? t = B : typeof DOMException < "u" && e instanceof DOMException && (e.name === "AbortError" || e.name === "NotAllowedError" ? t = z : (e.name === "InvalidStateError" || e.name === "NotSupportedError" || e.name === "SecurityError") && (t = L));
400
+ let r = { message: t };
401
+ u(r), n(r);
401
402
  }
402
403
  })().catch(() => {});
403
404
  },
@@ -412,14 +413,16 @@ var S = {
412
413
  D,
413
414
  O,
414
415
  N,
415
- H,
416
416
  G,
417
- K,
417
+ J,
418
+ Y,
419
+ z,
420
+ B,
418
421
  L,
419
- V
420
- ]), $ = l(async (e) => {
422
+ W
423
+ ]), ne = l(async (e) => {
421
424
  if (k == null) {
422
- let e = { message: "Invitation acceptance is not available." };
425
+ let e = { message: V };
423
426
  return u(e), Promise.reject(e);
424
427
  }
425
428
  return a(!0), u(null), new Promise((t, n) => {
@@ -432,10 +435,10 @@ var S = {
432
435
  onCompleted: (e) => {
433
436
  a(!1);
434
437
  let r = e.acceptInvitation, i = null;
435
- if (H(r)) {
438
+ if (G(r)) {
436
439
  let e = s(r, {
437
440
  defaultErrorMessage: F,
438
- mapReason: J
441
+ mapReason: Z
439
442
  });
440
443
  if (!e.ok) {
441
444
  let t = { message: e.message };
@@ -449,7 +452,7 @@ var S = {
449
452
  u(e), n(e);
450
453
  return;
451
454
  }
452
- let o = V(i);
455
+ let o = W(i);
453
456
  if (o === "success" || o === "mfa-required") {
454
457
  t(o);
455
458
  return;
@@ -467,16 +470,17 @@ var S = {
467
470
  }, [
468
471
  k,
469
472
  F,
470
- H,
471
- J,
472
- V
473
- ]), ee = l(async () => (a(!0), new Promise((t, n) => {
473
+ V,
474
+ G,
475
+ Z,
476
+ W
477
+ ]), re = l(async () => (a(!0), new Promise((t, n) => {
474
478
  T({
475
479
  variables: {},
476
480
  onCompleted: (r) => {
477
481
  a(!1);
478
482
  let i = r.logout, o = null;
479
- if (H(i)) {
483
+ if (G(i)) {
480
484
  let e = s(i, { defaultErrorMessage: R });
481
485
  if (!e.ok) {
482
486
  let t = { message: e.message };
@@ -515,23 +519,23 @@ var S = {
515
519
  })), [
516
520
  T,
517
521
  R,
518
- H
519
- ]), te = i || n.login.isInFlight || n.logout.isInFlight || n.completeMfa.isInFlight || n.beginPasskeyLogin.isInFlight || n.finishPasskeyLogin.isInFlight || (n.acceptInvitation?.isInFlight ?? !1) || n.beginAuthentication.isInFlight;
522
+ G
523
+ ]), ie = i || n.login.isInFlight || n.logout.isInFlight || n.completeMfa.isInFlight || n.beginPasskeyLogin.isInFlight || n.finishPasskeyLogin.isInFlight || (n.acceptInvitation?.isInFlight ?? !1) || n.beginAuthentication.isInFlight;
520
524
  return {
521
525
  authMethod: b.authMethod,
522
526
  challengeToken: b.challengeToken,
523
527
  nextStep: b.nextStep,
524
528
  mfaLevel: b.mfaLevel,
525
529
  emailHint: b.emailHint,
526
- login: X,
527
- loginWithPasskey: Q,
528
- completeMfa: Z,
529
- acceptInvitation: $,
530
- beginAuthentication: Y,
531
- logout: ee,
532
- reset: z,
533
- clearError: B,
534
- isLoading: te,
530
+ login: $,
531
+ loginWithPasskey: te,
532
+ completeMfa: ee,
533
+ acceptInvitation: ne,
534
+ beginAuthentication: Q,
535
+ logout: re,
536
+ reset: H,
537
+ clearError: U,
538
+ isLoading: ie,
535
539
  error: o,
536
540
  user: f,
537
541
  lockedUntil: m,
@@ -541,4 +545,4 @@ var S = {
541
545
  //#endregion
542
546
  export { x as a, b as i, y as n, _ as o, v as r, C as t };
543
547
 
544
- //# sourceMappingURL=useAuth-CheTnq60.js.map
548
+ //# sourceMappingURL=useAuth-CWf8ZspF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAuth-CWf8ZspF.js","names":[],"sources":["../../src/auth/login/MfaChallengeForm.tsx","../../src/modules/webauthn.ts","../../src/hooks/useAuth.ts"],"sourcesContent":["/* eslint-disable no-ternary */\nimport {\n useCallback,\n useEffect,\n useState,\n type FormEvent,\n type JSX,\n} from 'react';\nimport { useBackofficeReactTranslation } from '../../i18n/useBackofficeReactTranslation.js';\n\nimport { Button, FormError, FormField } from '@plumile/ui';\n\nimport type { TotpCredentials, UseAuthReturn } from '../../hooks/useAuth.js';\n\nimport * as styles from './loginPage.css.js';\n\ntype Props = {\n auth: Pick<\n UseAuthReturn,\n 'completeMfa' | 'isLoading' | 'error' | 'emailHint' | 'reset' | 'clearError'\n >;\n onSuccess: () => void;\n onBack: () => void;\n};\n\nexport const MfaChallengeForm = ({\n auth,\n onSuccess,\n onBack,\n}: Props): JSX.Element => {\n const { t } = useBackofficeReactTranslation();\n const [code, setCode] = useState('');\n const [localError, setLocalError] = useState<string | null>(null);\n\n // Clear any stale errors when the MFA form is shown\n useEffect(() => {\n auth.clearError();\n setLocalError(null);\n }, [auth]);\n\n const handleSubmit = useCallback(\n async (event: FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n setLocalError(null);\n\n const trimmed = code.trim();\n if (trimmed.length < 4) {\n setLocalError(t('auth.mfa.errors.shortCode'));\n return;\n }\n\n try {\n const credentials: TotpCredentials = {\n code: trimmed,\n };\n await auth.completeMfa(credentials);\n onSuccess();\n } catch {\n setLocalError(t('auth.mfa.errors.verificationFailed'));\n }\n },\n [auth, code, onSuccess, t],\n );\n\n const helper =\n auth.emailHint != null\n ? t('auth.mfa.helper.withEmail', { email: auth.emailHint })\n : t('auth.mfa.helper.default');\n\n const formError = localError;\n\n return (\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n <form className={styles.formSurface} onSubmit={handleSubmit} noValidate>\n <div className={styles.stack}>\n <p className={styles.helper}>{helper}</p>\n {formError != null ? <FormError>{formError}</FormError> : null}\n <FormField\n label={t('auth.mfa.form.label')}\n name=\"code\"\n type=\"text\"\n value={code}\n onChange={(event) => {\n setCode(event.target.value);\n setLocalError(null);\n }}\n placeholder={t('auth.mfa.form.placeholder')}\n autoComplete=\"one-time-code\"\n autoFocus\n required\n />\n </div>\n <div className={styles.actionsRow}>\n <Button\n type=\"button\"\n variant=\"text\"\n size=\"small\"\n className={styles.inlineLink}\n onClick={() => {\n auth.reset();\n onBack();\n }}\n >\n {t('auth.mfa.actions.back')}\n </Button>\n <Button type=\"submit\" size=\"large\" isLoading={auth.isLoading}>\n {t('auth.mfa.actions.submit')}\n </Button>\n </div>\n </form>\n );\n};\n","/**\n * Buffer to base64 url\n */\nexport function bufferToBase64Url(input: ArrayBuffer): string {\n const byteArray = new Uint8Array(input);\n let binary = '';\n for (const byte of byteArray) {\n binary += String.fromCharCode(byte);\n }\n return btoa(binary)\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=+$/, '');\n}\n\n/**\n * Base64 url to buffer\n */\nexport function base64UrlToBuffer(input: string): ArrayBuffer {\n const normalized = input.replace(/-/g, '+').replace(/_/g, '/');\n const remainder = normalized.length % 4;\n let padding = '';\n if (remainder === 2) {\n padding = '==';\n } else if (remainder === 3) {\n padding = '=';\n } else if (remainder === 1) {\n throw new Error('Invalid base64url input length.');\n }\n const padded = `${normalized}${padding}`;\n const binary = atob(padded);\n const output = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i += 1) {\n output[i] = binary.charCodeAt(i);\n }\n return output.buffer;\n}\n\nexport type WebAuthnRegistrationErrorKind =\n | 'cancelled'\n | 'credentialInUse'\n | 'notSupported'\n | 'failed';\n\n/**\n * Maps a browser WebAuthn registration error to a stable UI category.\n */\nexport function mapWebAuthnRegistrationError(\n error: unknown,\n): WebAuthnRegistrationErrorKind {\n if (!(error instanceof DOMException)) {\n return 'failed';\n }\n\n switch (error.name) {\n case 'NotAllowedError':\n case 'AbortError':\n return 'cancelled';\n case 'InvalidStateError':\n return 'credentialInUse';\n case 'SecurityError':\n case 'NotSupportedError':\n return 'notSupported';\n default:\n return 'failed';\n }\n}\n\n/**\n * Parse sign count\n */\nexport function parseSignCount(authenticatorData: ArrayBuffer): number {\n if (authenticatorData.byteLength < 37) {\n return 0;\n }\n const view = new DataView(authenticatorData);\n return view.getUint32(33, false);\n}\n","/* eslint-disable no-ternary */\nimport { useCallback, useState } from 'react';\n\nimport {\n type MutationPayloadBase,\n requireField,\n resolveMutationOutcome,\n} from '../relay/mutationResult.js';\nimport { useBackofficeReactTranslation } from '../i18n/useBackofficeReactTranslation.js';\n\nimport { resetRelayStore } from '../relay/environment.js';\nimport type { PayloadError } from 'relay-runtime';\n\nimport type {\n AuthMethod,\n LoginNextStep,\n MfaLevel,\n} from '../modules/sharedSchemaTypes.js';\nimport {\n base64UrlToBuffer,\n bufferToBase64Url,\n parseSignCount,\n} from '../modules/webauthn.js';\n\nexport type AuthPayload = {\n authMethod: AuthMethod | null | undefined;\n challengeToken: string | null | undefined;\n loggedInUser: { id: string } | null | undefined;\n mfaLevel: MfaLevel | null | undefined;\n nextStep: LoginNextStep | null | undefined;\n};\n\ntype LoginErrorReason =\n | 'INVALID_CREDENTIALS'\n | 'ACCOUNT_LOCKED'\n | 'RATE_LIMITED'\n | 'INTERNAL_ERROR';\n\ntype LogoutErrorReason =\n | 'UNAUTHENTICATED'\n | 'SESSION_NOT_FOUND'\n | 'INTERNAL_ERROR';\n\ntype BeginAuthenticationErrorReason = 'INVALID_EMAIL' | 'INTERNAL_ERROR';\n\ntype BeginPasskeyLoginErrorReason =\n | 'INVALID_EMAIL'\n | 'PASSKEY_NOT_FOUND'\n | 'PASSKEY_NOT_SUPPORTED'\n | 'INTERNAL_ERROR';\n\ntype FinishPasskeyLoginErrorReason =\n | 'INVALID_CHALLENGE_TOKEN'\n | 'CHALLENGE_EXPIRED'\n | 'INVALID_ASSERTION'\n | 'INTERNAL_ERROR';\n\ntype CompleteMfaErrorReason =\n | 'INVALID_CHALLENGE_TOKEN'\n | 'CHALLENGE_EXPIRED'\n | 'INVALID_CODE'\n | 'TOO_MANY_ATTEMPTS'\n | 'INTERNAL_ERROR';\n\ntype AcceptInvitationErrorReason =\n | 'INVALID_TOKEN'\n | 'TOKEN_EXPIRED'\n | 'ALREADY_ACCEPTED'\n | 'PASSWORD_MISMATCH'\n | 'PASSWORD_POLICY_VIOLATION'\n | 'RATE_LIMITED'\n | 'EMAIL_MISMATCH'\n | 'INTERNAL_ERROR';\n\nexport type BeginAuthenticationPayload =\n MutationPayloadBase<BeginAuthenticationErrorReason> & {\n lockedUntil: string | null | undefined;\n methods: readonly {\n method: AuthMethod;\n mfaEnforced?: boolean | null | undefined;\n }[];\n };\n\nexport type BeginPasskeyLoginPayload =\n MutationPayloadBase<BeginPasskeyLoginErrorReason> & {\n allowCredentials: readonly string[];\n challenge: string;\n challengeToken: string;\n rpId: string;\n };\n\ntype LoginMutationPayload = MutationPayloadBase<LoginErrorReason> & {\n payload?: AuthPayload | null | undefined;\n};\n\ntype LogoutPayload = {\n loggedOut?: boolean | null | undefined;\n};\n\ntype LogoutMutationPayload = MutationPayloadBase<LogoutErrorReason> & {\n payload?: LogoutPayload | null | undefined;\n};\n\ntype CompleteMfaMutationPayload =\n MutationPayloadBase<CompleteMfaErrorReason> & {\n payload?: AuthPayload | null | undefined;\n };\n\ntype FinishPasskeyLoginMutationPayload =\n MutationPayloadBase<FinishPasskeyLoginErrorReason> & {\n payload?: AuthPayload | null | undefined;\n };\n\ntype AcceptInvitationMutationPayload =\n MutationPayloadBase<AcceptInvitationErrorReason> & {\n payload?: AuthPayload | null | undefined;\n };\n\nexport type LoginResponse = { login: AuthPayload | LoginMutationPayload };\nexport type LogoutResponse = { logout: LogoutPayload | LogoutMutationPayload };\nexport type CompleteMfaResponse = {\n completeMfa: AuthPayload | CompleteMfaMutationPayload;\n};\nexport type FinishPasskeyLoginResponse = {\n finishPasskeyLogin: AuthPayload | FinishPasskeyLoginMutationPayload;\n};\nexport type AcceptInvitationResponse = {\n acceptInvitation: AuthPayload | AcceptInvitationMutationPayload;\n};\nexport type BeginAuthenticationResponse = {\n beginAuthentication: BeginAuthenticationPayload;\n};\nexport type BeginPasskeyLoginResponse = {\n beginPasskeyLogin: BeginPasskeyLoginPayload;\n};\n\nexport type LoginVariables = {\n input: LoginCredentials;\n};\n\nexport type LogoutVariables = Record<PropertyKey, never>;\n\nexport type CompleteMfaVariables = {\n input: {\n challengeToken: string;\n code: string;\n };\n};\n\nexport type BeginPasskeyLoginVariables = {\n email: string;\n};\n\nexport type FinishPasskeyLoginVariables = {\n input: {\n challenge: string;\n challengeToken: string;\n credentialId: string;\n signCount: number;\n userHandle?: string | null;\n };\n};\n\nexport type AcceptInvitationVariables = {\n input: {\n token: string;\n password: string;\n passwordConfirmation: string;\n };\n};\n\nexport type BeginAuthenticationVariables = {\n email: string;\n};\n\ntype MutationCommitConfig<TVariables, TResponse> = {\n variables: TVariables;\n onCompleted?: (\n response: TResponse,\n errors: readonly PayloadError[] | null,\n ) => void;\n onError?: (error: Error) => void;\n};\n\ntype MutationCommit<TVariables, TResponse> = (\n config: MutationCommitConfig<TVariables, TResponse>,\n) => void;\n\ntype MutationEntry<TVariables, TResponse> = {\n commit: MutationCommit<TVariables, TResponse>;\n isInFlight: boolean;\n};\n\nexport type AuthMutationHooks = {\n login: MutationEntry<LoginVariables, LoginResponse>;\n logout: MutationEntry<LogoutVariables, LogoutResponse>;\n completeMfa: MutationEntry<CompleteMfaVariables, CompleteMfaResponse>;\n beginPasskeyLogin: MutationEntry<\n BeginPasskeyLoginVariables,\n BeginPasskeyLoginResponse\n >;\n finishPasskeyLogin: MutationEntry<\n FinishPasskeyLoginVariables,\n FinishPasskeyLoginResponse\n >;\n acceptInvitation?: MutationEntry<\n AcceptInvitationVariables,\n AcceptInvitationResponse\n >;\n beginAuthentication: MutationEntry<\n BeginAuthenticationVariables,\n BeginAuthenticationResponse\n >;\n};\n\ninterface User {\n id: string;\n}\n\nexport type LoginStatus = 'success' | 'mfa-required' | 'error';\n\nexport interface LoginCredentials {\n email: string;\n password: string;\n}\n\nexport interface TotpCredentials {\n code: string;\n}\n\nexport interface AcceptInvitationCredentials {\n token: string;\n password: string;\n passwordConfirmation: string;\n}\n\nexport interface AuthError {\n message: string;\n code?: string;\n}\n\nexport interface UseAuthReturn {\n authMethod: AuthMethod | null;\n challengeToken: string | null;\n nextStep: LoginNextStep | null;\n mfaLevel: MfaLevel | null;\n emailHint: string | null;\n lockedUntil: string | null;\n availableMethods: AuthMethod[];\n login: (credentials: LoginCredentials) => Promise<LoginStatus>;\n loginWithPasskey: (params: { email: string }) => Promise<LoginStatus>;\n completeMfa: (credentials: TotpCredentials) => Promise<void>;\n acceptInvitation: (\n credentials: AcceptInvitationCredentials,\n ) => Promise<LoginStatus>;\n beginAuthentication: (\n email: string,\n ) => Promise<{ methods: AuthMethod[]; lockedUntil: string | null }>;\n logout: () => Promise<void>;\n reset: () => void;\n clearError: () => void;\n isLoading: boolean;\n error: AuthError | null;\n user: User | null;\n}\n\nconst initialState = {\n authMethod: null as AuthMethod | null,\n challengeToken: null as string | null,\n emailHint: null as string | null,\n mfaLevel: null as MfaLevel | null,\n nextStep: null as LoginNextStep | null,\n};\n\nexport const createUseAuth = (mutations: AuthMutationHooks) => {\n return (): UseAuthReturn => {\n const { t } = useBackofficeReactTranslation();\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<AuthError | null>(null);\n const [user, setUser] = useState<User | null>(null);\n const [lockedUntil, setLockedUntil] = useState<string | null>(null);\n const [availableMethods, setAvailableMethods] = useState<AuthMethod[]>([]);\n const [authState, setAuthState] = useState(initialState);\n\n const commitLoginMutation = mutations.login.commit;\n const commitLogoutMutation = mutations.logout.commit;\n const commitCompleteMfaMutation = mutations.completeMfa.commit;\n const commitBeginPasskeyLoginMutation = mutations.beginPasskeyLogin.commit;\n const commitFinishPasskeyLoginMutation =\n mutations.finishPasskeyLogin.commit;\n const commitAcceptInvitationMutation = mutations.acceptInvitation?.commit;\n const commitBeginAuthenticationMutation =\n mutations.beginAuthentication.commit;\n\n const defaultLoginErrorMessage = t('auth.loginFlow.errors.tryAgain');\n const defaultBeginAuthenticationErrorMessage = t(\n 'auth.loginFlow.errors.tryAgain',\n );\n const defaultPasskeyErrorMessage = t('auth.passkey.errors.failed');\n const defaultMfaErrorMessage = t('auth.mfa.errors.verificationFailed');\n const defaultInvitationErrorMessage = t(\n 'auth.acceptInvitation.errors.default',\n );\n const mfaInvalidChallengeMessage = t('auth.mfa.errors.invalidChallenge');\n const passkeyNotAvailableMessage = t('auth.passkey.errors.notAvailable');\n const defaultLogoutErrorMessage = t('auth.logout.errors.default');\n const passkeyCancelledMessage = t('auth.passkey.errors.cancelled');\n const passkeyNoCredentialMessage = t('auth.passkey.errors.noCredential');\n const invitationUnavailableMessage = t(\n 'auth.acceptInvitation.errors.unavailable',\n );\n\n const reset = useCallback(() => {\n setError(null);\n setUser(null);\n setLockedUntil(null);\n setAvailableMethods([]);\n setAuthState(initialState);\n }, []);\n\n const clearError = useCallback(() => {\n setError(null);\n }, []);\n\n const updateAuthStateFromPayload = useCallback(\n (payload: AuthPayload): LoginStatus => {\n const authMethod = payload.authMethod ?? null;\n const challengeToken = payload.challengeToken ?? null;\n const mfaLevel = payload.mfaLevel ?? null;\n const nextStep = payload.nextStep ?? null;\n\n setAuthState((prev) => {\n return {\n ...prev,\n authMethod,\n challengeToken,\n mfaLevel,\n nextStep,\n };\n });\n\n if (payload.loggedInUser != null && nextStep == null) {\n setUser({\n id: payload.loggedInUser.id,\n });\n return 'success';\n }\n\n if (nextStep === 'TOTP' && challengeToken != null) {\n return 'mfa-required';\n }\n\n return 'error';\n },\n [],\n );\n\n const isMutationPayload = useCallback(\n (value: unknown): value is MutationPayloadBase => {\n return (\n value != null &&\n typeof value === 'object' &&\n ('status' in value || 'result' in value)\n );\n },\n [],\n );\n\n const mapLoginReason = useCallback(\n (reason: LoginErrorReason): string | null => {\n switch (reason) {\n case 'INVALID_CREDENTIALS':\n return t('auth.loginFlow.errors.invalidCredentials');\n case 'ACCOUNT_LOCKED':\n return t('auth.loginFlow.errors.accountLocked');\n case 'RATE_LIMITED':\n return t('auth.loginFlow.errors.rateLimited');\n case 'INTERNAL_ERROR':\n return t('auth.loginFlow.errors.tryAgain');\n default:\n return null;\n }\n },\n [t],\n );\n\n const mapBeginAuthenticationReason = useCallback(\n (reason: BeginAuthenticationErrorReason): string | null => {\n switch (reason) {\n case 'INVALID_EMAIL':\n return t('auth.loginFlow.errors.invalidEmail');\n case 'INTERNAL_ERROR':\n return t('auth.loginFlow.errors.tryAgain');\n default:\n return null;\n }\n },\n [t],\n );\n\n const mapBeginPasskeyLoginReason = useCallback(\n (reason: BeginPasskeyLoginErrorReason): string | null => {\n switch (reason) {\n case 'INVALID_EMAIL':\n return t('auth.passkey.errors.invalidEmail');\n case 'PASSKEY_NOT_FOUND':\n return t('auth.passkey.errors.notFound');\n case 'PASSKEY_NOT_SUPPORTED':\n return t('auth.passkey.errors.notAvailable');\n case 'INTERNAL_ERROR':\n return t('auth.passkey.errors.failed');\n default:\n return null;\n }\n },\n [t],\n );\n\n const mapFinishPasskeyLoginReason = useCallback(\n (reason: FinishPasskeyLoginErrorReason): string | null => {\n switch (reason) {\n case 'INVALID_CHALLENGE_TOKEN':\n return t('auth.passkey.errors.invalidChallenge');\n case 'CHALLENGE_EXPIRED':\n return t('auth.passkey.errors.challengeExpired');\n case 'INVALID_ASSERTION':\n return t('auth.passkey.errors.invalidAssertion');\n case 'INTERNAL_ERROR':\n return t('auth.passkey.errors.failed');\n default:\n return null;\n }\n },\n [t],\n );\n\n const mapCompleteMfaReason = useCallback(\n (reason: CompleteMfaErrorReason): string | null => {\n switch (reason) {\n case 'INVALID_CHALLENGE_TOKEN':\n return t('auth.mfa.errors.invalidChallenge');\n case 'CHALLENGE_EXPIRED':\n return t('auth.mfa.errors.expired');\n case 'INVALID_CODE':\n return t('auth.mfa.errors.invalidCode');\n case 'TOO_MANY_ATTEMPTS':\n return t('auth.mfa.errors.tooManyAttempts');\n case 'INTERNAL_ERROR':\n return t('auth.mfa.errors.verificationFailed');\n default:\n return null;\n }\n },\n [t],\n );\n\n const mapAcceptInvitationReason = useCallback(\n (reason: AcceptInvitationErrorReason): string | null => {\n switch (reason) {\n case 'INVALID_TOKEN':\n return t('auth.acceptInvitation.errors.invalidToken');\n case 'TOKEN_EXPIRED':\n return t('auth.acceptInvitation.errors.expired');\n case 'ALREADY_ACCEPTED':\n return t('auth.acceptInvitation.errors.alreadyAccepted');\n case 'PASSWORD_MISMATCH':\n return t('auth.acceptInvitation.errors.passwordMismatch');\n case 'PASSWORD_POLICY_VIOLATION':\n return t('auth.acceptInvitation.errors.passwordPolicyViolation');\n case 'RATE_LIMITED':\n return t('auth.acceptInvitation.errors.rateLimited');\n case 'EMAIL_MISMATCH':\n return t('auth.acceptInvitation.errors.emailMismatch');\n case 'INTERNAL_ERROR':\n return t('auth.acceptInvitation.errors.default');\n default:\n return null;\n }\n },\n [t],\n );\n\n const beginAuthentication = useCallback(\n async (\n email: string,\n ): Promise<{ methods: AuthMethod[]; lockedUntil: string | null }> => {\n return new Promise((resolve, reject) => {\n commitBeginAuthenticationMutation({\n variables: { email },\n onCompleted: (response) => {\n const rawPayload = response.beginAuthentication;\n let payload = rawPayload;\n\n if (isMutationPayload(rawPayload)) {\n const outcome = resolveMutationOutcome(rawPayload, {\n defaultErrorMessage: defaultBeginAuthenticationErrorMessage,\n mapReason: mapBeginAuthenticationReason,\n });\n if (!outcome.ok) {\n const authError: AuthError = {\n message: outcome.message,\n };\n setError(authError);\n reject(authError);\n return;\n }\n payload = outcome.payload;\n }\n\n const methods = payload.methods.map((item) => {\n return item.method;\n });\n const locked = payload.lockedUntil ?? null;\n setAvailableMethods(methods);\n setLockedUntil(locked);\n resolve({ methods, lockedUntil: locked });\n },\n onError: () => {\n const authError: AuthError = {\n message: defaultBeginAuthenticationErrorMessage,\n };\n setError(authError);\n reject(authError);\n },\n });\n });\n },\n [\n commitBeginAuthenticationMutation,\n defaultBeginAuthenticationErrorMessage,\n isMutationPayload,\n mapBeginAuthenticationReason,\n ],\n );\n\n const login = useCallback(\n async (credentials: LoginCredentials): Promise<LoginStatus> => {\n setIsLoading(true);\n setError(null);\n setAuthState((prev) => {\n return {\n ...prev,\n emailHint: credentials.email,\n };\n });\n\n return new Promise((resolve, reject) => {\n commitLoginMutation({\n variables: {\n input: credentials,\n },\n onCompleted: (response) => {\n setIsLoading(false);\n const rawPayload = response.login;\n let authPayload: AuthPayload | null = null;\n\n if (isMutationPayload(rawPayload)) {\n const outcome = resolveMutationOutcome(rawPayload, {\n defaultErrorMessage: defaultLoginErrorMessage,\n mapReason: mapLoginReason,\n });\n if (!outcome.ok) {\n const authError: AuthError = {\n message: outcome.message,\n };\n setError(authError);\n reject(authError);\n return;\n }\n authPayload = rawPayload.payload ?? null;\n } else {\n authPayload = rawPayload;\n }\n\n if (authPayload == null) {\n const authError: AuthError = {\n message: defaultLoginErrorMessage,\n };\n setError(authError);\n reject(authError);\n return;\n }\n\n const status = updateAuthStateFromPayload(authPayload);\n if (status === 'success' || status === 'mfa-required') {\n resolve(status);\n return;\n }\n\n const authError: AuthError = {\n message: defaultLoginErrorMessage,\n };\n setError(authError);\n reject(authError);\n },\n onError: () => {\n setIsLoading(false);\n const authError: AuthError = {\n message: defaultLoginErrorMessage,\n };\n setError(authError);\n reject(authError);\n },\n });\n });\n },\n [\n commitLoginMutation,\n defaultLoginErrorMessage,\n isMutationPayload,\n mapLoginReason,\n updateAuthStateFromPayload,\n ],\n );\n\n const completeMfa = useCallback(\n async (credentials: TotpCredentials): Promise<void> => {\n const { challengeToken } = authState;\n if (challengeToken == null) {\n const authError: AuthError = {\n message: mfaInvalidChallengeMessage,\n };\n setError(authError);\n return Promise.reject(authError);\n }\n\n setIsLoading(true);\n setError(null);\n\n return new Promise((resolve, reject) => {\n commitCompleteMfaMutation({\n variables: {\n input: {\n challengeToken,\n code: credentials.code,\n },\n },\n onCompleted: (response) => {\n setIsLoading(false);\n const rawPayload = response.completeMfa;\n let authPayload: AuthPayload | null = null;\n\n if (isMutationPayload(rawPayload)) {\n const outcome = resolveMutationOutcome(rawPayload, {\n defaultErrorMessage: defaultMfaErrorMessage,\n mapReason: mapCompleteMfaReason,\n });\n if (!outcome.ok) {\n const authError: AuthError = {\n message: outcome.message,\n };\n setError(authError);\n reject(authError);\n return;\n }\n authPayload = rawPayload.payload ?? null;\n } else {\n authPayload = rawPayload;\n }\n\n if (authPayload == null) {\n const authError: AuthError = {\n message: defaultMfaErrorMessage,\n };\n setError(authError);\n reject(authError);\n return;\n }\n\n const status = updateAuthStateFromPayload(authPayload);\n if (status === 'success') {\n resolve();\n return;\n }\n\n const authError: AuthError = {\n message: defaultMfaErrorMessage,\n };\n setError(authError);\n reject(authError);\n },\n onError: () => {\n setIsLoading(false);\n const authError: AuthError = {\n message: defaultMfaErrorMessage,\n };\n setError(authError);\n reject(authError);\n },\n });\n });\n },\n [\n authState,\n commitCompleteMfaMutation,\n defaultMfaErrorMessage,\n isMutationPayload,\n mapCompleteMfaReason,\n mfaInvalidChallengeMessage,\n updateAuthStateFromPayload,\n ],\n );\n\n const loginWithPasskey = useCallback(\n async ({ email }: { email: string }): Promise<LoginStatus> => {\n if (typeof window === 'undefined') {\n const authError: AuthError = {\n message: passkeyNotAvailableMessage,\n };\n setError(authError);\n return Promise.reject(authError);\n }\n\n setIsLoading(true);\n setError(null);\n setAuthState((prev) => {\n return {\n ...prev,\n emailHint: email,\n };\n });\n\n return new Promise((resolve, reject) => {\n commitBeginPasskeyLoginMutation({\n variables: {\n email,\n },\n onCompleted: (response) => {\n const rawOptions = response.beginPasskeyLogin;\n let options = rawOptions;\n\n if (isMutationPayload(rawOptions)) {\n const outcome = resolveMutationOutcome(rawOptions, {\n defaultErrorMessage: defaultPasskeyErrorMessage,\n mapReason: mapBeginPasskeyLoginReason,\n });\n if (!outcome.ok) {\n setIsLoading(false);\n const authError: AuthError = {\n message: outcome.message,\n };\n setError(authError);\n reject(authError);\n return;\n }\n options = outcome.payload;\n }\n\n const continuePasskeyLogin = async (): Promise<void> => {\n try {\n const assertion = (await navigator.credentials.get({\n publicKey: {\n allowCredentials: options.allowCredentials.map(\n (credentialId) => {\n return {\n id: base64UrlToBuffer(credentialId),\n type: 'public-key' as const,\n };\n },\n ),\n challenge: base64UrlToBuffer(options.challenge),\n rpId: options.rpId,\n userVerification: 'preferred',\n },\n })) as PublicKeyCredential | null;\n\n if (assertion == null) {\n throw new Error('PASSKEY_NO_CREDENTIAL');\n }\n\n const assertionResponse =\n assertion.response as AuthenticatorAssertionResponse;\n const signCount = parseSignCount(\n assertionResponse.authenticatorData,\n );\n\n commitFinishPasskeyLoginMutation({\n variables: {\n input: {\n challenge: options.challenge,\n challengeToken: options.challengeToken,\n credentialId: assertion.id,\n signCount,\n userHandle:\n assertionResponse.userHandle != null\n ? bufferToBase64Url(assertionResponse.userHandle)\n : null,\n },\n },\n onCompleted: (finishResponse) => {\n setIsLoading(false);\n const rawPayload = finishResponse.finishPasskeyLogin;\n let authPayload: AuthPayload | null = null;\n\n if (isMutationPayload(rawPayload)) {\n const outcome = resolveMutationOutcome(rawPayload, {\n defaultErrorMessage: defaultPasskeyErrorMessage,\n mapReason: mapFinishPasskeyLoginReason,\n });\n if (!outcome.ok) {\n const authError: AuthError = {\n message: outcome.message,\n };\n setError(authError);\n reject(authError);\n return;\n }\n authPayload = rawPayload.payload ?? null;\n } else {\n authPayload = rawPayload;\n }\n\n if (authPayload == null) {\n const authError: AuthError = {\n message: defaultPasskeyErrorMessage,\n };\n setError(authError);\n reject(authError);\n return;\n }\n\n const status = updateAuthStateFromPayload(authPayload);\n if (status === 'success') {\n resolve(status);\n return;\n }\n const authError: AuthError = {\n message: defaultPasskeyErrorMessage,\n };\n setError(authError);\n reject(authError);\n },\n onError: () => {\n setIsLoading(false);\n const authError: AuthError = {\n message: defaultPasskeyErrorMessage,\n };\n setError(authError);\n reject(authError);\n },\n });\n } catch (credentialError) {\n setIsLoading(false);\n let message = defaultPasskeyErrorMessage;\n if (\n credentialError instanceof Error &&\n credentialError.message === 'PASSKEY_NO_CREDENTIAL'\n ) {\n message = passkeyNoCredentialMessage;\n } else if (\n typeof DOMException !== 'undefined' &&\n credentialError instanceof DOMException\n ) {\n if (\n credentialError.name === 'AbortError' ||\n credentialError.name === 'NotAllowedError'\n ) {\n message = passkeyCancelledMessage;\n } else if (\n credentialError.name === 'InvalidStateError' ||\n credentialError.name === 'NotSupportedError' ||\n credentialError.name === 'SecurityError'\n ) {\n message = passkeyNotAvailableMessage;\n }\n }\n const authError: AuthError = {\n message,\n };\n setError(authError);\n reject(authError);\n }\n };\n\n continuePasskeyLogin().catch(() => {\n return undefined;\n });\n },\n onError: () => {\n setIsLoading(false);\n const authError: AuthError = {\n message: defaultPasskeyErrorMessage,\n };\n setError(authError);\n reject(authError);\n },\n });\n });\n },\n [\n commitBeginPasskeyLoginMutation,\n commitFinishPasskeyLoginMutation,\n defaultPasskeyErrorMessage,\n isMutationPayload,\n mapBeginPasskeyLoginReason,\n mapFinishPasskeyLoginReason,\n passkeyCancelledMessage,\n passkeyNoCredentialMessage,\n passkeyNotAvailableMessage,\n updateAuthStateFromPayload,\n ],\n );\n\n const acceptInvitation = useCallback(\n async (\n credentials: AcceptInvitationCredentials,\n ): Promise<LoginStatus> => {\n if (commitAcceptInvitationMutation == null) {\n const authError: AuthError = {\n message: invitationUnavailableMessage,\n };\n setError(authError);\n return Promise.reject(authError);\n }\n\n setIsLoading(true);\n setError(null);\n\n return new Promise((resolve, reject) => {\n commitAcceptInvitationMutation({\n variables: {\n input: {\n token: credentials.token,\n password: credentials.password,\n passwordConfirmation: credentials.passwordConfirmation,\n },\n },\n onCompleted: (response) => {\n setIsLoading(false);\n const rawPayload = response.acceptInvitation;\n let authPayload: AuthPayload | null = null;\n\n if (isMutationPayload(rawPayload)) {\n const outcome = resolveMutationOutcome(rawPayload, {\n defaultErrorMessage: defaultInvitationErrorMessage,\n mapReason: mapAcceptInvitationReason,\n });\n if (!outcome.ok) {\n const authError: AuthError = {\n message: outcome.message,\n };\n setError(authError);\n reject(authError);\n return;\n }\n authPayload = rawPayload.payload ?? null;\n } else {\n authPayload = rawPayload;\n }\n\n if (authPayload == null) {\n const authError: AuthError = {\n message: defaultInvitationErrorMessage,\n };\n setError(authError);\n reject(authError);\n return;\n }\n\n const status = updateAuthStateFromPayload(authPayload);\n if (status === 'success' || status === 'mfa-required') {\n resolve(status);\n return;\n }\n const authError: AuthError = {\n message: defaultInvitationErrorMessage,\n };\n setError(authError);\n reject(authError);\n },\n onError: () => {\n setIsLoading(false);\n const authError: AuthError = {\n message: defaultInvitationErrorMessage,\n };\n setError(authError);\n reject(authError);\n },\n });\n });\n },\n [\n commitAcceptInvitationMutation,\n defaultInvitationErrorMessage,\n invitationUnavailableMessage,\n isMutationPayload,\n mapAcceptInvitationReason,\n updateAuthStateFromPayload,\n ],\n );\n\n const logout = useCallback(async (): Promise<void> => {\n setIsLoading(true);\n\n return new Promise((resolve, reject) => {\n commitLogoutMutation({\n variables: {},\n onCompleted: (response) => {\n setIsLoading(false);\n const rawPayload = response.logout;\n let loggedOutValue: boolean | null = null;\n\n if (isMutationPayload(rawPayload)) {\n const outcome = resolveMutationOutcome(rawPayload, {\n defaultErrorMessage: defaultLogoutErrorMessage,\n });\n if (!outcome.ok) {\n const authError: AuthError = { message: outcome.message };\n setError(authError);\n reject(authError);\n return;\n }\n\n const loggedOutResult = requireField(\n rawPayload.payload?.loggedOut ?? null,\n defaultLogoutErrorMessage,\n );\n if (!loggedOutResult.ok) {\n const authError: AuthError = {\n message: loggedOutResult.message,\n };\n setError(authError);\n reject(authError);\n return;\n }\n loggedOutValue = loggedOutResult.value;\n } else {\n const loggedOutResult = requireField(\n rawPayload.loggedOut ?? null,\n defaultLogoutErrorMessage,\n );\n if (!loggedOutResult.ok) {\n const authError: AuthError = {\n message: loggedOutResult.message,\n };\n setError(authError);\n reject(authError);\n return;\n }\n loggedOutValue = loggedOutResult.value;\n }\n\n if (!loggedOutValue) {\n const authError: AuthError = {\n message: defaultLogoutErrorMessage,\n };\n setError(authError);\n reject(authError);\n return;\n }\n\n localStorage.removeItem('auth_token');\n localStorage.removeItem('remember_me');\n setUser(null);\n setAuthState(initialState);\n resetRelayStore();\n\n resolve();\n },\n onError: () => {\n setIsLoading(false);\n const authError: AuthError = {\n message: defaultLogoutErrorMessage,\n };\n setError(authError);\n resetRelayStore();\n\n reject(authError);\n },\n });\n });\n }, [commitLogoutMutation, defaultLogoutErrorMessage, isMutationPayload]);\n\n const combinedIsLoading =\n isLoading ||\n mutations.login.isInFlight ||\n mutations.logout.isInFlight ||\n mutations.completeMfa.isInFlight ||\n mutations.beginPasskeyLogin.isInFlight ||\n mutations.finishPasskeyLogin.isInFlight ||\n (mutations.acceptInvitation?.isInFlight ?? false) ||\n mutations.beginAuthentication.isInFlight;\n\n return {\n authMethod: authState.authMethod,\n challengeToken: authState.challengeToken,\n nextStep: authState.nextStep,\n mfaLevel: authState.mfaLevel,\n emailHint: authState.emailHint,\n login,\n loginWithPasskey,\n completeMfa,\n acceptInvitation,\n beginAuthentication,\n logout,\n reset,\n clearError,\n isLoading: combinedIsLoading,\n error,\n user,\n lockedUntil,\n availableMethods,\n };\n };\n};\n"],"mappings":";;;;;;;;AAyBA,IAAa,KAAoB,EAC/B,SACA,cACA,gBACwB;CACxB,IAAM,EAAE,SAAM,GAA+B,EACvC,CAAC,GAAM,KAAW,EAAS,GAAG,EAC9B,CAAC,GAAY,KAAiB,EAAwB,KAAK;CAGjE,QAAgB;EAEd,AADA,EAAK,YAAY,EACjB,EAAc,KAAK;IAClB,CAAC,EAAK,CAAC;CAEV,IAAM,IAAe,EACnB,OAAO,MAAsC;EAE3C,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B,EAC3B,SAAS,GACV;KAED,AADA,EAAS,EAAU,EACnB,EAAO,EAAU;KACjB;;IASF,AANA,aAAa,WAAW,aAAa,EACrC,aAAa,WAAW,cAAc,EACtC,EAAQ,KAAK,EACb,EAAa,EAAa,EAC1B,GAAiB,EAEjB,GAAS;;GAEX,eAAe;IACb,EAAa,GAAM;IACnB,IAAM,IAAuB,EAC3B,SAAS,GACV;IAID,AAHA,EAAS,EAAU,EACnB,GAAiB,EAEjB,EAAO,EAAU;;GAEpB,CAAC;GACF,GACD;EAAC;EAAsB;EAA2B;EAAkB,CAAC,EAElE,KACJ,KACA,EAAU,MAAM,cAChB,EAAU,OAAO,cACjB,EAAU,YAAY,cACtB,EAAU,kBAAkB,cAC5B,EAAU,mBAAmB,eAC5B,EAAU,kBAAkB,cAAc,OAC3C,EAAU,oBAAoB;CAEhC,OAAO;EACL,YAAY,EAAU;EACtB,gBAAgB,EAAU;EAC1B,UAAU,EAAU;EACpB,UAAU,EAAU;EACpB,WAAW,EAAU;EACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA;EACA;EACA;EACD"}
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./useRelayEnvironment-vQ86aW-n.js";
2
2
  import { r as t } from "./useBackofficeReactTranslation-Btt58EIo.js";
3
- import { t as n } from "./useAuth-CheTnq60.js";
3
+ import { t as n } from "./useAuth-CWf8ZspF.js";
4
4
  import { useCallback as r, useMemo as i, useState as a } from "react";
5
5
  import * as o from "react-relay";
6
6
  //#region src/hooks/useBackofficeAuth.ts
@@ -86,4 +86,4 @@ function d() {
86
86
  //#endregion
87
87
  export { d as t };
88
88
 
89
- //# sourceMappingURL=useBackofficeAuth-DVAXNAjP.js.map
89
+ //# sourceMappingURL=useBackofficeAuth-Da7FPNys.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBackofficeAuth-DVAXNAjP.js","names":[],"sources":["../../src/hooks/useBackofficeAuth.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react';\nimport * as ReactRelay from 'react-relay';\nimport type { GraphQLTaggedNode, PayloadError } from 'relay-runtime';\n\nimport {\n createUseAuth,\n type UseAuthReturn,\n type AcceptInvitationResponse,\n type AcceptInvitationVariables,\n type BeginAuthenticationResponse,\n type BeginAuthenticationVariables,\n type BeginPasskeyLoginResponse,\n type BeginPasskeyLoginVariables,\n type CompleteMfaResponse,\n type CompleteMfaVariables,\n type FinishPasskeyLoginResponse,\n type FinishPasskeyLoginVariables,\n type LoginResponse,\n type LoginVariables,\n type LogoutResponse,\n type LogoutVariables,\n} from './useAuth.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport type { BackofficeLazyValue } from '../provider/lazyValue.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\n\nconst { commitMutation } = ReactRelay;\n\ntype MutationCommitConfig<TVariables, TResponse> = {\n variables: TVariables;\n onCompleted?: (\n response: TResponse,\n errors: readonly PayloadError[] | null,\n ) => void;\n onError?: (error: Error) => void;\n};\n\nconst toMutationLoadError = (error: unknown): Error => {\n if (error instanceof Error) {\n return error;\n }\n return new Error('Unable to load auth mutation.');\n};\n\nconst useDeferredMutation = <TVariables extends object, TResponse>(\n loadMutation: () => Promise<GraphQLTaggedNode | null>,\n) => {\n const relayEnvironment = useRelayEnvironment();\n const [inFlightCount, setInFlightCount] = useState(0);\n\n const commit = useCallback(\n (config: MutationCommitConfig<TVariables, TResponse>) => {\n setInFlightCount((count) => {\n return count + 1;\n });\n\n const finish = () => {\n setInFlightCount((count) => {\n return Math.max(0, count - 1);\n });\n };\n\n loadMutation()\n .then((mutation) => {\n if (mutation == null) {\n throw new Error('Missing auth mutation config.');\n }\n\n commitMutation(relayEnvironment, {\n mutation,\n variables: config.variables,\n onCompleted: (response, errors) => {\n finish();\n config.onCompleted?.(response as TResponse, errors ?? null);\n },\n onError: (error) => {\n finish();\n config.onError?.(error);\n },\n });\n })\n .catch((error: unknown) => {\n finish();\n config.onError?.(toMutationLoadError(error));\n });\n },\n [loadMutation, relayEnvironment],\n );\n\n return {\n commit,\n isInFlight: inFlightCount > 0,\n };\n};\n\nconst loadOptionalMutation = async <TConfig>(\n eagerMutation: GraphQLTaggedNode | null | undefined,\n lazyConfig: BackofficeLazyValue<TConfig> | null | undefined,\n selectMutation: (config: TConfig) => GraphQLTaggedNode,\n): Promise<GraphQLTaggedNode | null> => {\n if (eagerMutation != null) {\n return eagerMutation;\n }\n if (lazyConfig == null) {\n return null;\n }\n const loadedConfig = await lazyConfig.load();\n return selectMutation(loadedConfig);\n};\n\n/**\n * Provides auth actions/state backed by Relay mutations from BackofficeProvider.\n */\nexport function useBackofficeAuth(): UseAuthReturn {\n const { auth: authConfig } = useBackofficeConfig();\n const { commit: commitLogin, isInFlight: isLoginInFlight } =\n useDeferredMutation<LoginVariables, LoginResponse>(\n useCallback(async () => {\n const loginConfig = authConfig.login.get();\n return loadOptionalMutation(\n loginConfig?.loginMutation,\n authConfig.login,\n (config) => {\n return config.loginMutation;\n },\n );\n }, [authConfig.login]),\n );\n const { commit: commitLogout, isInFlight: isLogoutInFlight } =\n useDeferredMutation<LogoutVariables, LogoutResponse>(\n useCallback(async () => {\n const logoutConfig = await authConfig.logout.load();\n return logoutConfig.logoutMutation;\n }, [authConfig.logout]),\n );\n const { commit: commitCompleteMfa, isInFlight: isCompleteMfaInFlight } =\n useDeferredMutation<CompleteMfaVariables, CompleteMfaResponse>(\n useCallback(async () => {\n return loadOptionalMutation(\n authConfig.login.get()?.completeMfaMutation,\n authConfig.completeMfa,\n (config) => {\n return config.completeMfaMutation;\n },\n );\n }, [authConfig.completeMfa, authConfig.login]),\n );\n const {\n commit: commitBeginPasskeyLogin,\n isInFlight: isBeginPasskeyLoginInFlight,\n } = useDeferredMutation<\n BeginPasskeyLoginVariables,\n BeginPasskeyLoginResponse\n >(\n useCallback(async () => {\n return loadOptionalMutation(\n authConfig.login.get()?.beginPasskeyLoginMutation,\n authConfig.passkeyLogin,\n (config) => {\n return config.beginPasskeyLoginMutation;\n },\n );\n }, [authConfig.login, authConfig.passkeyLogin]),\n );\n const {\n commit: commitFinishPasskeyLogin,\n isInFlight: isFinishPasskeyLoginInFlight,\n } = useDeferredMutation<\n FinishPasskeyLoginVariables,\n FinishPasskeyLoginResponse\n >(\n useCallback(async () => {\n return loadOptionalMutation(\n authConfig.login.get()?.finishPasskeyLoginMutation,\n authConfig.passkeyLogin,\n (config) => {\n return config.finishPasskeyLoginMutation;\n },\n );\n }, [authConfig.login, authConfig.passkeyLogin]),\n );\n const {\n commit: commitBeginAuthentication,\n isInFlight: isBeginAuthenticationInFlight,\n } = useDeferredMutation<\n BeginAuthenticationVariables,\n BeginAuthenticationResponse\n >(\n useCallback(async () => {\n return loadOptionalMutation(\n authConfig.login.get()?.beginAuthenticationMutation,\n authConfig.authentication,\n (config) => {\n return config.beginAuthenticationMutation;\n },\n );\n }, [authConfig.authentication, authConfig.login]),\n );\n const {\n commit: commitAcceptInvitation,\n isInFlight: isAcceptInvitationInFlight,\n } = useDeferredMutation<AcceptInvitationVariables, AcceptInvitationResponse>(\n useCallback(async () => {\n return loadOptionalMutation(\n authConfig.login.get()?.acceptInvitationMutation,\n authConfig.acceptInvitation,\n (config) => {\n return config.acceptInvitationMutation;\n },\n );\n }, [authConfig.acceptInvitation, authConfig.login]),\n );\n const hasAcceptInvitationMutation =\n authConfig.login.get()?.acceptInvitationMutation != null ||\n authConfig.acceptInvitation != null;\n\n const useAuthWithMutations = useMemo(() => {\n let acceptInvitation:\n | {\n commit: typeof commitAcceptInvitation;\n isInFlight: boolean;\n }\n | undefined;\n if (hasAcceptInvitationMutation) {\n acceptInvitation = {\n commit: commitAcceptInvitation,\n isInFlight: isAcceptInvitationInFlight,\n };\n }\n return createUseAuth({\n login: { commit: commitLogin, isInFlight: isLoginInFlight },\n logout: { commit: commitLogout, isInFlight: isLogoutInFlight },\n completeMfa: {\n commit: commitCompleteMfa,\n isInFlight: isCompleteMfaInFlight,\n },\n beginPasskeyLogin: {\n commit: commitBeginPasskeyLogin,\n isInFlight: isBeginPasskeyLoginInFlight,\n },\n finishPasskeyLogin: {\n commit: commitFinishPasskeyLogin,\n isInFlight: isFinishPasskeyLoginInFlight,\n },\n beginAuthentication: {\n commit: commitBeginAuthentication,\n isInFlight: isBeginAuthenticationInFlight,\n },\n acceptInvitation,\n });\n }, [\n commitAcceptInvitation,\n commitBeginAuthentication,\n commitBeginPasskeyLogin,\n commitCompleteMfa,\n commitFinishPasskeyLogin,\n commitLogin,\n commitLogout,\n hasAcceptInvitationMutation,\n isAcceptInvitationInFlight,\n isBeginAuthenticationInFlight,\n isBeginPasskeyLoginInFlight,\n isCompleteMfaInFlight,\n isFinishPasskeyLoginInFlight,\n isLoginInFlight,\n isLogoutInFlight,\n ]);\n\n return useAuthWithMutations();\n}\n"],"mappings":";;;;;;AA0BA,IAAM,EAAE,gBAAA,MAAmB,GAWrB,KAAuB,MACvB,aAAiB,QACZ,IAEF,gBAAI,MAAM,gCAAgC,EAG7C,KACJ,MACG;CACH,IAAM,IAAmB,GAAqB,EACxC,CAAC,GAAe,KAAoB,EAAS,EAAE;CAyCrD,OAAO;EACL,QAxCa,GACZ,MAAwD;GACvD,GAAkB,MACT,IAAQ,EACf;GAEF,IAAM,UAAe;IACnB,GAAkB,MACT,KAAK,IAAI,GAAG,IAAQ,EAAE,CAC7B;;GAGJ,GAAc,CACX,MAAM,MAAa;IAClB,IAAI,KAAY,MACd,MAAU,MAAM,gCAAgC;IAGlD,EAAe,GAAkB;KAC/B;KACA,WAAW,EAAO;KAClB,cAAc,GAAU,MAAW;MAEjC,AADA,GAAQ,EACR,EAAO,cAAc,GAAuB,KAAU,KAAK;;KAE7D,UAAU,MAAU;MAElB,AADA,GAAQ,EACR,EAAO,UAAU,EAAM;;KAE1B,CAAC;KACF,CACD,OAAO,MAAmB;IAEzB,AADA,GAAQ,EACR,EAAO,UAAU,EAAoB,EAAM,CAAC;KAC5C;KAEN,CAAC,GAAc,EAAiB,CAIhC;E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EACA,CAAC,EAAW,kBAAkB,EAAW,MAAM,CAAC,CACpD,EACK,IACJ,EAAW,MAAM,KAAK,EAAE,4BAA4B,QACpD,EAAW,oBAAoB;CAsDjC,OApD6B,QAAc;EACzC,IAAI;EAYJ,OANI,MACF,IAAmB;GACjB,QAAQ;GACR,YAAY;GACb,GAEI,EAAc;GACnB,OAAO;IAAE,QAAQ;IAAa,YAAY;IAAiB;GAC3D,QAAQ;IAAE,QAAQ;IAAc,YAAY;IAAkB;GAC9D,aAAa;IACX,QAAQ;IACR,YAAY;IACb;GACD,mBAAmB;IACjB,QAAQ;IACR,YAAY;IACb;GACD,oBAAoB;IAClB,QAAQ;IACR,YAAY;IACb;GACD,qBAAqB;IACnB,QAAQ;IACR,YAAY;IACb;GACD;GACD,CAAC;IACD;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CAEM,EAAsB"}
1
+ {"version":3,"file":"useBackofficeAuth-Da7FPNys.js","names":[],"sources":["../../src/hooks/useBackofficeAuth.ts"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react';\nimport * as ReactRelay from 'react-relay';\nimport type { GraphQLTaggedNode, PayloadError } from 'relay-runtime';\n\nimport {\n createUseAuth,\n type UseAuthReturn,\n type AcceptInvitationResponse,\n type AcceptInvitationVariables,\n type BeginAuthenticationResponse,\n type BeginAuthenticationVariables,\n type BeginPasskeyLoginResponse,\n type BeginPasskeyLoginVariables,\n type CompleteMfaResponse,\n type CompleteMfaVariables,\n type FinishPasskeyLoginResponse,\n type FinishPasskeyLoginVariables,\n type LoginResponse,\n type LoginVariables,\n type LogoutResponse,\n type LogoutVariables,\n} from './useAuth.js';\nimport { useBackofficeConfig } from '../provider/BackofficeConfigContext.js';\nimport type { BackofficeLazyValue } from '../provider/lazyValue.js';\nimport { useRelayEnvironment } from '../relay/useRelayEnvironment.js';\n\nconst { commitMutation } = ReactRelay;\n\ntype MutationCommitConfig<TVariables, TResponse> = {\n variables: TVariables;\n onCompleted?: (\n response: TResponse,\n errors: readonly PayloadError[] | null,\n ) => void;\n onError?: (error: Error) => void;\n};\n\nconst toMutationLoadError = (error: unknown): Error => {\n if (error instanceof Error) {\n return error;\n }\n return new Error('Unable to load auth mutation.');\n};\n\nconst useDeferredMutation = <TVariables extends object, TResponse>(\n loadMutation: () => Promise<GraphQLTaggedNode | null>,\n) => {\n const relayEnvironment = useRelayEnvironment();\n const [inFlightCount, setInFlightCount] = useState(0);\n\n const commit = useCallback(\n (config: MutationCommitConfig<TVariables, TResponse>) => {\n setInFlightCount((count) => {\n return count + 1;\n });\n\n const finish = () => {\n setInFlightCount((count) => {\n return Math.max(0, count - 1);\n });\n };\n\n loadMutation()\n .then((mutation) => {\n if (mutation == null) {\n throw new Error('Missing auth mutation config.');\n }\n\n commitMutation(relayEnvironment, {\n mutation,\n variables: config.variables,\n onCompleted: (response, errors) => {\n finish();\n config.onCompleted?.(response as TResponse, errors ?? null);\n },\n onError: (error) => {\n finish();\n config.onError?.(error);\n },\n });\n })\n .catch((error: unknown) => {\n finish();\n config.onError?.(toMutationLoadError(error));\n });\n },\n [loadMutation, relayEnvironment],\n );\n\n return {\n commit,\n isInFlight: inFlightCount > 0,\n };\n};\n\nconst loadOptionalMutation = async <TConfig>(\n eagerMutation: GraphQLTaggedNode | null | undefined,\n lazyConfig: BackofficeLazyValue<TConfig> | null | undefined,\n selectMutation: (config: TConfig) => GraphQLTaggedNode,\n): Promise<GraphQLTaggedNode | null> => {\n if (eagerMutation != null) {\n return eagerMutation;\n }\n if (lazyConfig == null) {\n return null;\n }\n const loadedConfig = await lazyConfig.load();\n return selectMutation(loadedConfig);\n};\n\n/**\n * Provides auth actions/state backed by Relay mutations from BackofficeProvider.\n */\nexport function useBackofficeAuth(): UseAuthReturn {\n const { auth: authConfig } = useBackofficeConfig();\n const { commit: commitLogin, isInFlight: isLoginInFlight } =\n useDeferredMutation<LoginVariables, LoginResponse>(\n useCallback(async () => {\n const loginConfig = authConfig.login.get();\n return loadOptionalMutation(\n loginConfig?.loginMutation,\n authConfig.login,\n (config) => {\n return config.loginMutation;\n },\n );\n }, [authConfig.login]),\n );\n const { commit: commitLogout, isInFlight: isLogoutInFlight } =\n useDeferredMutation<LogoutVariables, LogoutResponse>(\n useCallback(async () => {\n const logoutConfig = await authConfig.logout.load();\n return logoutConfig.logoutMutation;\n }, [authConfig.logout]),\n );\n const { commit: commitCompleteMfa, isInFlight: isCompleteMfaInFlight } =\n useDeferredMutation<CompleteMfaVariables, CompleteMfaResponse>(\n useCallback(async () => {\n return loadOptionalMutation(\n authConfig.login.get()?.completeMfaMutation,\n authConfig.completeMfa,\n (config) => {\n return config.completeMfaMutation;\n },\n );\n }, [authConfig.completeMfa, authConfig.login]),\n );\n const {\n commit: commitBeginPasskeyLogin,\n isInFlight: isBeginPasskeyLoginInFlight,\n } = useDeferredMutation<\n BeginPasskeyLoginVariables,\n BeginPasskeyLoginResponse\n >(\n useCallback(async () => {\n return loadOptionalMutation(\n authConfig.login.get()?.beginPasskeyLoginMutation,\n authConfig.passkeyLogin,\n (config) => {\n return config.beginPasskeyLoginMutation;\n },\n );\n }, [authConfig.login, authConfig.passkeyLogin]),\n );\n const {\n commit: commitFinishPasskeyLogin,\n isInFlight: isFinishPasskeyLoginInFlight,\n } = useDeferredMutation<\n FinishPasskeyLoginVariables,\n FinishPasskeyLoginResponse\n >(\n useCallback(async () => {\n return loadOptionalMutation(\n authConfig.login.get()?.finishPasskeyLoginMutation,\n authConfig.passkeyLogin,\n (config) => {\n return config.finishPasskeyLoginMutation;\n },\n );\n }, [authConfig.login, authConfig.passkeyLogin]),\n );\n const {\n commit: commitBeginAuthentication,\n isInFlight: isBeginAuthenticationInFlight,\n } = useDeferredMutation<\n BeginAuthenticationVariables,\n BeginAuthenticationResponse\n >(\n useCallback(async () => {\n return loadOptionalMutation(\n authConfig.login.get()?.beginAuthenticationMutation,\n authConfig.authentication,\n (config) => {\n return config.beginAuthenticationMutation;\n },\n );\n }, [authConfig.authentication, authConfig.login]),\n );\n const {\n commit: commitAcceptInvitation,\n isInFlight: isAcceptInvitationInFlight,\n } = useDeferredMutation<AcceptInvitationVariables, AcceptInvitationResponse>(\n useCallback(async () => {\n return loadOptionalMutation(\n authConfig.login.get()?.acceptInvitationMutation,\n authConfig.acceptInvitation,\n (config) => {\n return config.acceptInvitationMutation;\n },\n );\n }, [authConfig.acceptInvitation, authConfig.login]),\n );\n const hasAcceptInvitationMutation =\n authConfig.login.get()?.acceptInvitationMutation != null ||\n authConfig.acceptInvitation != null;\n\n const useAuthWithMutations = useMemo(() => {\n let acceptInvitation:\n | {\n commit: typeof commitAcceptInvitation;\n isInFlight: boolean;\n }\n | undefined;\n if (hasAcceptInvitationMutation) {\n acceptInvitation = {\n commit: commitAcceptInvitation,\n isInFlight: isAcceptInvitationInFlight,\n };\n }\n return createUseAuth({\n login: { commit: commitLogin, isInFlight: isLoginInFlight },\n logout: { commit: commitLogout, isInFlight: isLogoutInFlight },\n completeMfa: {\n commit: commitCompleteMfa,\n isInFlight: isCompleteMfaInFlight,\n },\n beginPasskeyLogin: {\n commit: commitBeginPasskeyLogin,\n isInFlight: isBeginPasskeyLoginInFlight,\n },\n finishPasskeyLogin: {\n commit: commitFinishPasskeyLogin,\n isInFlight: isFinishPasskeyLoginInFlight,\n },\n beginAuthentication: {\n commit: commitBeginAuthentication,\n isInFlight: isBeginAuthenticationInFlight,\n },\n acceptInvitation,\n });\n }, [\n commitAcceptInvitation,\n commitBeginAuthentication,\n commitBeginPasskeyLogin,\n commitCompleteMfa,\n commitFinishPasskeyLogin,\n commitLogin,\n commitLogout,\n hasAcceptInvitationMutation,\n isAcceptInvitationInFlight,\n isBeginAuthenticationInFlight,\n isBeginPasskeyLoginInFlight,\n isCompleteMfaInFlight,\n isFinishPasskeyLoginInFlight,\n isLoginInFlight,\n isLogoutInFlight,\n ]);\n\n return useAuthWithMutations();\n}\n"],"mappings":";;;;;;AA0BA,IAAM,EAAE,gBAAA,MAAm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ACA;EACA;EACA;EACD,CAEM,EAAsB"}
@@ -28,4 +28,4 @@ var t = (e) => {
28
28
  //#endregion
29
29
  export { o as a, a as i, i as n, r, n as t };
30
30
 
31
- //# sourceMappingURL=useBackofficeLazyValue-CoIAK-5N.js.map
31
+ //# sourceMappingURL=useBackofficeLazyValue-CW9xfRzQ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBackofficeLazyValue-CoIAK-5N.js","names":[],"sources":["../../src/provider/useBackofficeLazyValue.ts"],"sourcesContent":["import type { BackofficeDashboardConfig } from '@plumile/backoffice-core/types.js';\n\nimport { useBackofficeConfig } from './BackofficeConfigContext.js';\nimport type {\n BackofficeResolvedAuthLoginConfig,\n BackofficeResolvedAuthLogoutConfig,\n BackofficeResolvedAuthPasswordResetCompleteConfig,\n BackofficeResolvedAuthPasswordResetRequestConfig,\n BackofficeResolvedAuthSessionConfig,\n BackofficeResolvedAuthVerifyEmailConfig,\n} from './types.js';\nimport type { BackofficeLazyValue } from './lazyValue.js';\n\nconst useResolvedLazyValue = <TValue>(\n resource: BackofficeLazyValue<TValue> | null | undefined,\n): TValue | null => {\n if (resource == null) {\n return null;\n }\n const loadedValue = resource.get();\n if (loadedValue != null) {\n return loadedValue;\n }\n // React Suspense expects a pending promise to be thrown while the lazy value loads.\n // eslint-disable-next-line @typescript-eslint/only-throw-error\n throw resource.load();\n};\n\nexport const useBackofficeAuthSessionConfig =\n (): BackofficeResolvedAuthSessionConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.session);\n if (resolved == null) {\n throw new Error('Missing backoffice auth session config.');\n }\n return resolved;\n };\n\nexport const useBackofficeAuthLoginConfig =\n (): BackofficeResolvedAuthLoginConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.login);\n if (resolved == null) {\n throw new Error('Missing backoffice auth login config.');\n }\n return resolved;\n };\n\nexport const useBackofficeAuthLogoutConfig =\n (): BackofficeResolvedAuthLogoutConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.logout);\n if (resolved == null) {\n throw new Error('Missing backoffice logout auth config.');\n }\n return resolved;\n };\n\nexport const useBackofficeAuthPasswordResetRequestConfig =\n (): BackofficeResolvedAuthPasswordResetRequestConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.passwordResetRequest);\n if (resolved == null) {\n throw new Error('Missing backoffice password reset request auth config.');\n }\n return resolved;\n };\n\nexport const useBackofficeAuthPasswordResetCompleteConfig =\n (): BackofficeResolvedAuthPasswordResetCompleteConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.passwordResetComplete);\n if (resolved == null) {\n throw new Error(\n 'Missing backoffice password reset completion auth config.',\n );\n }\n return resolved;\n };\n\nexport const useBackofficeAuthVerifyEmailConfig =\n (): BackofficeResolvedAuthVerifyEmailConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.verifyEmail);\n if (resolved == null) {\n throw new Error('Missing backoffice verify email auth config.');\n }\n return resolved;\n };\n\nexport const useBackofficeDashboardConfig =\n (): BackofficeDashboardConfig | null => {\n const { dashboard } = useBackofficeConfig();\n return useResolvedLazyValue(dashboard);\n };\n\nexport default useResolvedLazyValue;\n"],"mappings":";;AAaA,IAAM,KACJ,MACkB;CAClB,IAAI,KAAY,MACd,OAAO;CAET,IAAM,IAAc,EAAS,KAAK;CAClC,IAAI,KAAe,MACjB,OAAO;CAIT,MAAM,EAAS,MAAM;GAaV,UAC8B;CACvC,IAAM,EAAE,YAAS,GAAqB,EAChC,IAAW,EAAqB,EAAK,MAAM;CACjD,IAAI,KAAY,MACd,MAAU,MAAM,wCAAwC;CAE1D,OAAO;GAaE,UAC6C;CACtD,IAAM,EAAE,YAAS,GAAqB,EAChC,IAAW,EAAqB,EAAK,qBAAqB;CAChE,IAAI,KAAY,MACd,MAAU,MAAM,yDAAyD;CAE3E,OAAO;GAGE,UAC8C;CACvD,IAAM,EAAE,YAAS,GAAqB,EAChC,IAAW,EAAqB,EAAK,sBAAsB;CACjE,IAAI,KAAY,MACd,MAAU,MACR,4DACD;CAEH,OAAO;GAGE,UACoC;CAC7C,IAAM,EAAE,YAAS,GAAqB,EAChC,IAAW,EAAqB,EAAK,YAAY;CACvD,IAAI,KAAY,MACd,MAAU,MAAM,+CAA+C;CAEjE,OAAO;GAGE,UAC6B;CACtC,IAAM,EAAE,iBAAc,GAAqB;CAC3C,OAAO,EAAqB,EAAU"}
1
+ {"version":3,"file":"useBackofficeLazyValue-CW9xfRzQ.js","names":[],"sources":["../../src/provider/useBackofficeLazyValue.ts"],"sourcesContent":["import type { BackofficeDashboardConfig } from '@plumile/backoffice-core/types.js';\n\nimport { useBackofficeConfig } from './BackofficeConfigContext.js';\nimport type {\n BackofficeResolvedAuthLoginConfig,\n BackofficeResolvedAuthLogoutConfig,\n BackofficeResolvedAuthPasswordResetCompleteConfig,\n BackofficeResolvedAuthPasswordResetRequestConfig,\n BackofficeResolvedAuthSessionConfig,\n BackofficeResolvedAuthVerifyEmailConfig,\n} from './types.js';\nimport type { BackofficeLazyValue } from './lazyValue.js';\n\nconst useResolvedLazyValue = <TValue>(\n resource: BackofficeLazyValue<TValue> | null | undefined,\n): TValue | null => {\n if (resource == null) {\n return null;\n }\n const loadedValue = resource.get();\n if (loadedValue != null) {\n return loadedValue;\n }\n // React Suspense expects a pending promise to be thrown while the lazy value loads.\n // eslint-disable-next-line @typescript-eslint/only-throw-error\n throw resource.load();\n};\n\nexport const useBackofficeAuthSessionConfig =\n (): BackofficeResolvedAuthSessionConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.session);\n if (resolved == null) {\n throw new Error('Missing backoffice auth session config.');\n }\n return resolved;\n };\n\nexport const useBackofficeAuthLoginConfig =\n (): BackofficeResolvedAuthLoginConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.login);\n if (resolved == null) {\n throw new Error('Missing backoffice auth login config.');\n }\n return resolved;\n };\n\nexport const useBackofficeAuthLogoutConfig =\n (): BackofficeResolvedAuthLogoutConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.logout);\n if (resolved == null) {\n throw new Error('Missing backoffice logout auth config.');\n }\n return resolved;\n };\n\nexport const useBackofficeAuthPasswordResetRequestConfig =\n (): BackofficeResolvedAuthPasswordResetRequestConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.passwordResetRequest);\n if (resolved == null) {\n throw new Error('Missing backoffice password reset request auth config.');\n }\n return resolved;\n };\n\nexport const useBackofficeAuthPasswordResetCompleteConfig =\n (): BackofficeResolvedAuthPasswordResetCompleteConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.passwordResetComplete);\n if (resolved == null) {\n throw new Error(\n 'Missing backoffice password reset completion auth config.',\n );\n }\n return resolved;\n };\n\nexport const useBackofficeAuthVerifyEmailConfig =\n (): BackofficeResolvedAuthVerifyEmailConfig => {\n const { auth } = useBackofficeConfig();\n const resolved = useResolvedLazyValue(auth.verifyEmail);\n if (resolved == null) {\n throw new Error('Missing backoffice verify email auth config.');\n }\n return resolved;\n };\n\nexport const useBackofficeDashboardConfig =\n (): BackofficeDashboardConfig | null => {\n const { dashboard } = useBackofficeConfig();\n return useResolvedLazyValue(dashboard);\n };\n\nexport default useResolvedLazyValue;\n"],"mappings":";;AAaA,IAAM,KACJ,MACkB;CAClB,IAAI,KAAY,MACd,OAAO;CAET,IAAM,IAAc,EAAS,KAAK;CAClC,IAAI,KAAe,MACjB,OAAO;CAIT,MAAM,EAAS,MAAM;GAaV,UAC8B;CACvC,IAAM,EAAE,YAAS,GAAqB,EAChC,IAAW,EAAqB,EAAK,MAAM;CACjD,IAAI,KAAY,MACd,MAAU,MAAM,wCAAwC;CAE1D,OAAO;GAaE,UAC6C;CACtD,IAAM,EAAE,YAAS,GAAqB,EAChC,IAAW,EAAqB,EAAK,qBAAqB;CAChE,IAAI,KAAY,MACd,MAAU,MAAM,yDAAyD;CAE3E,OAAO;GAGE,UAC8C;CACvD,IAAM,EAAE,YAAS,GAAqB,EAChC,IAAW,EAAqB,EAAK,sBAAsB;CACjE,IAAI,KAAY,MACd,MAAU,MACR,4DACD;CAEH,OAAO;GAGE,UACoC;CAC7C,IAAM,EAAE,YAAS,GAAqB,EAChC,IAAW,EAAqB,EAAK,YAAY;CACvD,IAAI,KAAY,MACd,MAAU,MAAM,+CAA+C;CAEjE,OAAO;GAGE,UAC6B;CACtC,IAAM,EAAE,iBAAc,GAAqB;CAC3C,OAAO,EAAqB,EAAU"}
@@ -34,4 +34,4 @@ function o(o) {
34
34
  //#endregion
35
35
  export { o as t };
36
36
 
37
- //# sourceMappingURL=useBackofficeListUrlState-D4fx5O7u.js.map
37
+ //# sourceMappingURL=useBackofficeListUrlState-Ca6d7uIN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBackofficeListUrlState-Ca6d7uIN.js","names":[],"sources":["../../src/hooks/useBackofficeListUrlState.ts"],"sourcesContent":["import { useCallback, useContext, useMemo } from 'react';\nimport { RoutingContext, useLocation } from '@plumile/router';\n\nimport type {\n BackofficeListState,\n BackofficeRuntimeResolvedListFacetConfig,\n} from '@plumile/backoffice-core/types.js';\n\n/** Normalizes a router `location.search` string into URLSearchParams. */\nfunction normalizeSearch(value: string): URLSearchParams {\n if (value.trim() === '') {\n return new URLSearchParams();\n }\n return new URLSearchParams(value);\n}\n\ntype ReturnValue<Where extends Record<string, unknown>, Sort extends string> = {\n state: BackofficeListState<Where, Sort>;\n pushState: (next: BackofficeListState<Where, Sort>) => void;\n};\n\n/** Keeps list state in sync with the URL search params for backoffice pages. */\nexport function useBackofficeListUrlState<\n Where extends Record<string, unknown>,\n Sort extends string,\n>(config: BackofficeRuntimeResolvedListFacetConfig): ReturnValue<Where, Sort> {\n const routing = useContext(RoutingContext);\n const { hash, pathname, search } = useLocation();\n const fallbackState = useMemo(() => {\n return {\n where: null,\n sort: null,\n };\n }, []);\n\n const state = useMemo(() => {\n if (config.listUrlCodec == null) {\n return fallbackState;\n }\n return config.listUrlCodec.parse(\n normalizeSearch(search),\n ) as BackofficeListState<Where, Sort>;\n }, [config.listUrlCodec, fallbackState, search]);\n\n const pushState = useCallback(\n (next: BackofficeListState<Where, Sort>) => {\n if (routing == null) {\n return;\n }\n if (config.listUrlCodec == null) {\n return;\n }\n\n const params = config.listUrlCodec.serialize(next as never);\n const qs = params.toString();\n\n let nextSearch = '';\n if (qs !== '') {\n nextSearch = `?${qs}`;\n }\n\n routing.history.push({\n pathname,\n search: nextSearch,\n hash,\n });\n },\n [config.listUrlCodec, hash, pathname, routing],\n );\n\n return { state, pushState };\n}\n"],"mappings":";;;AASA,SAAS,EAAgB,GAAgC;CAIvD,OAHI,EAAM,MAAM,KAAK,KACZ,IAAI,iBAAiB,GAEvB,IAAI,gBAAgB,EAAM;;AASnC,SAAgB,EAGd,GAA4E;CAC5E,IAAM,IAAU,EAAW,EAAe,EACpC,EAAE,SAAM,aAAU,cAAW,GAAa,EAC1C,IAAgB,SACb;EACL,OAAO;EACP,MAAM;EACP,GACA,EAAE,CAAC;CAqCN,OAAO;EAAE,OAnCK,QACR,EAAO,gBAAgB,OAClB,IAEF,EAAO,aAAa,MACzB,EAAgB,EAAO,CACxB,EACA;GAAC,EAAO;GAAc;GAAe;GAAO,CA4BtC;EAAO,WA1BE,GACf,MAA2C;GAI1C,IAHI,KAAW,QAGX,EAAO,gBAAgB,MACzB;GAIF,IAAM,IADS,EAAO,aAAa,UAAU,EAClC,CAAO,UAAU,EAExB,IAAa;GAKjB,AAJI,MAAO,OACT,IAAa,IAAI,MAGnB,EAAQ,QAAQ,KAAK;IACnB;IACA,QAAQ;IACR;IACD,CAAC;KAEJ;GAAC,EAAO;GAAc;GAAM;GAAU;GAAQ,CAGhC;EAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"LoginFlow.d.ts","sourceRoot":"","sources":["../../../../src/auth/login/LoginFlow.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,GAAG,EAMT,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAS5D,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC3C,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAIF,eAAO,MAAM,SAAS,GAAI,4DAKvB,cAAc,KAAG,GAAG,CAAC,OA8NvB,CAAC"}
1
+ {"version":3,"file":"LoginFlow.d.ts","sourceRoot":"","sources":["../../../../src/auth/login/LoginFlow.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,GAAG,EAMT,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAS5D,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC3C,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAIF,eAAO,MAAM,SAAS,GAAI,4DAKvB,cAAc,KAAG,GAAG,CAAC,OAsNvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MfaChallengeForm.d.ts","sourceRoot":"","sources":["../../../../src/auth/login/MfaChallengeForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI7E,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,CACR,aAAa,EACb,aAAa,GAAG,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,GAAG,YAAY,CAC7E,CAAC;IACF,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,8BAI9B,KAAK,KAAG,GAAG,CAAC,OAmFd,CAAC"}
1
+ {"version":3,"file":"MfaChallengeForm.d.ts","sourceRoot":"","sources":["../../../../src/auth/login/MfaChallengeForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI7E,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,CACR,aAAa,EACb,aAAa,GAAG,WAAW,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,GAAG,YAAY,CAC7E,CAAC;IACF,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,8BAI9B,KAAK,KAAG,GAAG,CAAC,OAkFd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PasskeyLoginForm.d.ts","sourceRoot":"","sources":["../../../../src/auth/login/PasskeyLoginForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,CACR,aAAa,EACX,kBAAkB,GAClB,WAAW,GACX,OAAO,GACP,WAAW,GACX,UAAU,GACV,qBAAqB,GACrB,aAAa,GACb,kBAAkB,CACrB,CAAC;IACF,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,wEAM9B,KAAK,KAAG,GAAG,CAAC,OA+Fd,CAAC"}
1
+ {"version":3,"file":"PasskeyLoginForm.d.ts","sourceRoot":"","sources":["../../../../src/auth/login/PasskeyLoginForm.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,CACR,aAAa,EACX,kBAAkB,GAClB,WAAW,GACX,OAAO,GACP,WAAW,GACX,UAAU,GACV,qBAAqB,GACrB,aAAa,GACb,kBAAkB,CACrB,CAAC;IACF,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,wEAM9B,KAAK,KAAG,GAAG,CAAC,OA8Fd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AcceptInvitationScreen.d.ts","sourceRoot":"","sources":["../../../../src/auth/pages/AcceptInvitationScreen.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAO5D,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,aAAa,CAAC;IACpB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,oDAKpC,KAAK,KAAG,GAAG,CAAC,OAwKd,CAAC"}
1
+ {"version":3,"file":"AcceptInvitationScreen.d.ts","sourceRoot":"","sources":["../../../../src/auth/pages/AcceptInvitationScreen.tsx"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAO5D,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,aAAa,CAAC;IACpB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,oDAKpC,KAAK,KAAG,GAAG,CAAC,OAkKd,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BackofficeEntityActionFormDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/actions/BackofficeEntityActionFormDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,GAAG,EAMT,MAAM,OAAO,CAAC;AAuBf,OAAO,KAAK,EAEV,sCAAsC,EAEvC,MAAM,mCAAmC,CAAC;AAgB3C,MAAM,MAAM,qCAAqC,CAAC,IAAI,IAAI;IACxD,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,sCAAsC,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAiGF,eAAO,MAAM,gCAAgC,GAAI,IAAI,EAAG,+CAMrD,qCAAqC,CAAC,IAAI,CAAC,KAAG,GAAG,CAAC,OAAO,GAAG,IA4wB9D,CAAC;AAEF,eAAe,gCAAgC,CAAC"}
1
+ {"version":3,"file":"BackofficeEntityActionFormDialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/backoffice/actions/BackofficeEntityActionFormDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,GAAG,EAOT,MAAM,OAAO,CAAC;AAuBf,OAAO,KAAK,EAEV,sCAAsC,EAEvC,MAAM,mCAAmC,CAAC;AAgB3C,MAAM,MAAM,qCAAqC,CAAC,IAAI,IAAI;IACxD,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,sCAAsC,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAiGF,eAAO,MAAM,gCAAgC,GAAI,IAAI,EAAG,+CAMrD,qCAAqC,CAAC,IAAI,CAAC,KAAG,GAAG,CAAC,OAAO,GAAG,IA62B9D,CAAC;AAEF,eAAe,gCAAgC,CAAC"}