@mesob/auth-react 0.4.0 → 0.4.1

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 (371) hide show
  1. package/dist/chunk-35TCGAW3.js +98 -0
  2. package/dist/chunk-35TCGAW3.js.map +1 -0
  3. package/dist/chunk-3BZC4VVD.js +36 -0
  4. package/dist/chunk-3BZC4VVD.js.map +1 -0
  5. package/dist/chunk-45UCLKH2.js +188 -0
  6. package/dist/chunk-45UCLKH2.js.map +1 -0
  7. package/dist/chunk-55BMNC4S.js +115 -0
  8. package/dist/chunk-55BMNC4S.js.map +1 -0
  9. package/dist/chunk-5F5FZMHE.js +94 -0
  10. package/dist/chunk-5F5FZMHE.js.map +1 -0
  11. package/dist/chunk-5M7I7WNH.js +31 -0
  12. package/dist/chunk-5M7I7WNH.js.map +1 -0
  13. package/dist/chunk-72YRO3A7.js +288 -0
  14. package/dist/chunk-72YRO3A7.js.map +1 -0
  15. package/dist/chunk-7KXTL6NT.js +48 -0
  16. package/dist/chunk-7KXTL6NT.js.map +1 -0
  17. package/dist/chunk-AIMD6R6U.js +466 -0
  18. package/dist/chunk-AIMD6R6U.js.map +1 -0
  19. package/dist/chunk-BGSHXIHI.js +953 -0
  20. package/dist/chunk-BGSHXIHI.js.map +1 -0
  21. package/dist/chunk-BZ42QPXE.js +271 -0
  22. package/dist/chunk-BZ42QPXE.js.map +1 -0
  23. package/dist/chunk-C26NPUPI.js +272 -0
  24. package/dist/chunk-C26NPUPI.js.map +1 -0
  25. package/dist/chunk-C2KFZ57H.js +194 -0
  26. package/dist/chunk-C2KFZ57H.js.map +1 -0
  27. package/dist/chunk-C5ZW7FD2.js +46 -0
  28. package/dist/chunk-C5ZW7FD2.js.map +1 -0
  29. package/dist/chunk-DPH2PHK3.js +32 -0
  30. package/dist/chunk-DPH2PHK3.js.map +1 -0
  31. package/dist/chunk-EQ4346FE.js +139 -0
  32. package/dist/chunk-EQ4346FE.js.map +1 -0
  33. package/dist/chunk-FAHN63DA.js +535 -0
  34. package/dist/chunk-FAHN63DA.js.map +1 -0
  35. package/dist/chunk-FBABIA5J.js +345 -0
  36. package/dist/chunk-FBABIA5J.js.map +1 -0
  37. package/dist/chunk-FFR5UHTS.js +99 -0
  38. package/dist/chunk-FFR5UHTS.js.map +1 -0
  39. package/dist/chunk-FHOLUOOZ.js +164 -0
  40. package/dist/chunk-FHOLUOOZ.js.map +1 -0
  41. package/dist/chunk-G2AW2H36.js +11 -0
  42. package/dist/chunk-G2AW2H36.js.map +1 -0
  43. package/dist/chunk-G7SCXCCM.js +89 -0
  44. package/dist/chunk-G7SCXCCM.js.map +1 -0
  45. package/dist/chunk-GP7GIUI3.js +64 -0
  46. package/dist/chunk-GP7GIUI3.js.map +1 -0
  47. package/dist/chunk-GRT6EBR6.js +93 -0
  48. package/dist/chunk-GRT6EBR6.js.map +1 -0
  49. package/dist/chunk-GXKBVCVS.js +102 -0
  50. package/dist/chunk-GXKBVCVS.js.map +1 -0
  51. package/dist/chunk-HOO2VLNM.js +305 -0
  52. package/dist/chunk-HOO2VLNM.js.map +1 -0
  53. package/dist/chunk-II5MLBSB.js +183 -0
  54. package/dist/chunk-II5MLBSB.js.map +1 -0
  55. package/dist/chunk-ISNNPMF7.js +95 -0
  56. package/dist/chunk-ISNNPMF7.js.map +1 -0
  57. package/dist/chunk-JB6XVST4.js +141 -0
  58. package/dist/chunk-JB6XVST4.js.map +1 -0
  59. package/dist/chunk-JUHBVG5Q.js +303 -0
  60. package/dist/chunk-JUHBVG5Q.js.map +1 -0
  61. package/dist/chunk-JZZJCBAE.js +118 -0
  62. package/dist/chunk-JZZJCBAE.js.map +1 -0
  63. package/dist/chunk-KWG4DSB5.js +55 -0
  64. package/dist/chunk-KWG4DSB5.js.map +1 -0
  65. package/dist/chunk-L4CGIO2I.js +265 -0
  66. package/dist/chunk-L4CGIO2I.js.map +1 -0
  67. package/dist/chunk-LNG736CV.js +19 -0
  68. package/dist/chunk-LNG736CV.js.map +1 -0
  69. package/dist/chunk-LSYKVFJA.js +98 -0
  70. package/dist/chunk-LSYKVFJA.js.map +1 -0
  71. package/dist/chunk-LZR4YUDV.js +107 -0
  72. package/dist/chunk-LZR4YUDV.js.map +1 -0
  73. package/dist/chunk-MELNS4QH.js +255 -0
  74. package/dist/chunk-MELNS4QH.js.map +1 -0
  75. package/dist/chunk-MS2JUZ3N.js +94 -0
  76. package/dist/chunk-MS2JUZ3N.js.map +1 -0
  77. package/dist/chunk-NEO72TMH.js +32 -0
  78. package/dist/chunk-NEO72TMH.js.map +1 -0
  79. package/dist/chunk-NJPNTAAT.js +68 -0
  80. package/dist/chunk-NJPNTAAT.js.map +1 -0
  81. package/dist/chunk-NPW7D2HZ.js +16 -0
  82. package/dist/chunk-NPW7D2HZ.js.map +1 -0
  83. package/dist/chunk-OAN4EXU4.js +310 -0
  84. package/dist/chunk-OAN4EXU4.js.map +1 -0
  85. package/dist/chunk-OFLSINVU.js +138 -0
  86. package/dist/chunk-OFLSINVU.js.map +1 -0
  87. package/dist/chunk-OHIIMUQC.js +286 -0
  88. package/dist/chunk-OHIIMUQC.js.map +1 -0
  89. package/dist/chunk-OQGJX37L.js +239 -0
  90. package/dist/chunk-OQGJX37L.js.map +1 -0
  91. package/dist/chunk-OYHH7HQG.js +65 -0
  92. package/dist/chunk-OYHH7HQG.js.map +1 -0
  93. package/dist/chunk-PSRIZMWJ.js +486 -0
  94. package/dist/chunk-PSRIZMWJ.js.map +1 -0
  95. package/dist/chunk-QNCE2B5O.js +23 -0
  96. package/dist/chunk-QNCE2B5O.js.map +1 -0
  97. package/dist/chunk-RLPZFLAS.js +23 -0
  98. package/dist/chunk-RLPZFLAS.js.map +1 -0
  99. package/dist/chunk-RT5C7IAE.js +38 -0
  100. package/dist/chunk-RT5C7IAE.js.map +1 -0
  101. package/dist/chunk-S3CXCCKL.js +272 -0
  102. package/dist/chunk-S3CXCCKL.js.map +1 -0
  103. package/dist/chunk-SOCZK4CV.js +69 -0
  104. package/dist/chunk-SOCZK4CV.js.map +1 -0
  105. package/dist/chunk-T6P7UHVP.js +34 -0
  106. package/dist/chunk-T6P7UHVP.js.map +1 -0
  107. package/dist/chunk-TFVBER3Y.js +52 -0
  108. package/dist/chunk-TFVBER3Y.js.map +1 -0
  109. package/dist/chunk-UXOZ2TME.js +104 -0
  110. package/dist/chunk-UXOZ2TME.js.map +1 -0
  111. package/dist/chunk-V2W3WPCZ.js +22 -0
  112. package/dist/chunk-V2W3WPCZ.js.map +1 -0
  113. package/dist/chunk-YZ264S2L.js +286 -0
  114. package/dist/chunk-YZ264S2L.js.map +1 -0
  115. package/dist/chunk-ZESFGO3K.js +28 -0
  116. package/dist/chunk-ZESFGO3K.js.map +1 -0
  117. package/dist/chunk-ZG6WFZHX.js +143 -0
  118. package/dist/chunk-ZG6WFZHX.js.map +1 -0
  119. package/dist/components/auth/auth-card.d.ts +3 -6
  120. package/dist/components/auth/auth-card.js +3 -7
  121. package/dist/components/auth/auth-card.js.map +1 -1
  122. package/dist/components/auth/auth-layout.d.ts +3 -6
  123. package/dist/components/auth/auth-layout.js +3 -28
  124. package/dist/components/auth/auth-layout.js.map +1 -1
  125. package/dist/components/auth/countdown.d.ts +2 -5
  126. package/dist/components/auth/countdown.js +5 -130
  127. package/dist/components/auth/countdown.js.map +1 -1
  128. package/dist/components/auth/forgot-password.d.ts +1 -5
  129. package/dist/components/auth/forgot-password.js +6 -365
  130. package/dist/components/auth/forgot-password.js.map +1 -1
  131. package/dist/components/auth/reset-password-form.d.ts +2 -5
  132. package/dist/components/auth/reset-password-form.js +6 -487
  133. package/dist/components/auth/reset-password-form.js.map +1 -1
  134. package/dist/components/auth/set-password.d.ts +2 -5
  135. package/dist/components/auth/set-password.js +7 -521
  136. package/dist/components/auth/set-password.js.map +1 -1
  137. package/dist/components/auth/sign-in.d.ts +2 -5
  138. package/dist/components/auth/sign-in.js +7 -561
  139. package/dist/components/auth/sign-in.js.map +1 -1
  140. package/dist/components/auth/sign-up.d.ts +2 -5
  141. package/dist/components/auth/sign-up.js +6 -511
  142. package/dist/components/auth/sign-up.js.map +1 -1
  143. package/dist/components/auth/verification-form.d.ts +13 -2
  144. package/dist/components/auth/verification-form.js +5 -217
  145. package/dist/components/auth/verification-form.js.map +1 -1
  146. package/dist/components/auth/verify-email.d.ts +2 -5
  147. package/dist/components/auth/verify-email.js +8 -527
  148. package/dist/components/auth/verify-email.js.map +1 -1
  149. package/dist/components/auth/verify-phone.d.ts +2 -5
  150. package/dist/components/auth/verify-phone.js +8 -532
  151. package/dist/components/auth/verify-phone.js.map +1 -1
  152. package/dist/components/authorization/deny.d.ts +3 -6
  153. package/dist/components/authorization/deny.js +4 -47
  154. package/dist/components/authorization/deny.js.map +1 -1
  155. package/dist/components/authorization/grant.d.ts +3 -6
  156. package/dist/components/authorization/grant.js +4 -52
  157. package/dist/components/authorization/grant.js.map +1 -1
  158. package/dist/components/error-boundary.d.ts +6 -10
  159. package/dist/components/error-boundary.js +4 -43
  160. package/dist/components/error-boundary.js.map +1 -1
  161. package/dist/components/iam/permission-selector.d.ts +3 -6
  162. package/dist/components/iam/permission-selector.js +3 -116
  163. package/dist/components/iam/permission-selector.js.map +1 -1
  164. package/dist/components/iam/permissions-page.d.ts +1 -0
  165. package/dist/components/iam/permissions-page.js +10 -0
  166. package/dist/components/iam/permissions-page.js.map +1 -0
  167. package/dist/components/iam/permissions.d.ts +1 -5
  168. package/dist/components/iam/permissions.js +5 -198
  169. package/dist/components/iam/permissions.js.map +1 -1
  170. package/dist/components/iam/role-detail-layout.d.ts +3 -6
  171. package/dist/components/iam/role-detail-layout.js +3 -131
  172. package/dist/components/iam/role-detail-layout.js.map +1 -1
  173. package/dist/components/iam/role-detail-page.d.ts +2 -5
  174. package/dist/components/iam/role-detail-page.js +3 -223
  175. package/dist/components/iam/role-detail-page.js.map +1 -1
  176. package/dist/components/iam/role-permissions-page.d.ts +2 -5
  177. package/dist/components/iam/role-permissions-page.js +4 -391
  178. package/dist/components/iam/role-permissions-page.js.map +1 -1
  179. package/dist/components/iam/roles-page.d.ts +1 -0
  180. package/dist/components/iam/roles-page.js +13 -0
  181. package/dist/components/iam/roles-page.js.map +1 -0
  182. package/dist/components/iam/roles.d.ts +1 -5
  183. package/dist/components/iam/roles.js +5 -218
  184. package/dist/components/iam/roles.js.map +1 -1
  185. package/dist/components/iam/sessions-page.d.ts +1 -0
  186. package/dist/components/iam/sessions-page.js +12 -0
  187. package/dist/components/iam/sessions-page.js.map +1 -0
  188. package/dist/components/iam/sessions.d.ts +1 -5
  189. package/dist/components/iam/sessions.js +5 -198
  190. package/dist/components/iam/sessions.js.map +1 -1
  191. package/dist/components/iam/tenants-page.d.ts +1 -0
  192. package/dist/components/iam/tenants-page.js +13 -0
  193. package/dist/components/iam/tenants-page.js.map +1 -0
  194. package/dist/components/iam/tenants.d.ts +1 -5
  195. package/dist/components/iam/tenants.js +5 -204
  196. package/dist/components/iam/tenants.js.map +1 -1
  197. package/dist/components/iam/users-page.d.ts +1 -0
  198. package/dist/components/iam/users-page.js +13 -0
  199. package/dist/components/iam/users-page.js.map +1 -0
  200. package/dist/components/iam/users.d.ts +1 -5
  201. package/dist/components/iam/users.js +5 -207
  202. package/dist/components/iam/users.js.map +1 -1
  203. package/dist/components/profile/account.d.ts +1 -5
  204. package/dist/components/profile/account.js +4 -151
  205. package/dist/components/profile/account.js.map +1 -1
  206. package/dist/components/profile/change-email-form.d.ts +1 -5
  207. package/dist/components/profile/change-email-form.js +9 -735
  208. package/dist/components/profile/change-email-form.js.map +1 -1
  209. package/dist/components/profile/change-password-form.d.ts +1 -5
  210. package/dist/components/profile/change-password-form.js +3 -262
  211. package/dist/components/profile/change-password-form.js.map +1 -1
  212. package/dist/components/profile/change-phone-form.d.ts +1 -5
  213. package/dist/components/profile/change-phone-form.js +10 -772
  214. package/dist/components/profile/change-phone-form.js.map +1 -1
  215. package/dist/components/profile/change-profile.d.ts +3 -7
  216. package/dist/components/profile/change-profile.js +2 -40
  217. package/dist/components/profile/change-profile.js.map +1 -1
  218. package/dist/components/profile/otp-verification-modal.d.ts +2 -5
  219. package/dist/components/profile/otp-verification-modal.js +6 -266
  220. package/dist/components/profile/otp-verification-modal.js.map +1 -1
  221. package/dist/components/profile/profile-layout.d.ts +4 -0
  222. package/dist/components/profile/profile-layout.js +10 -0
  223. package/dist/components/profile/profile-layout.js.map +1 -0
  224. package/dist/components/profile/request-change-email-form.d.ts +2 -5
  225. package/dist/components/profile/request-change-email-form.js +4 -285
  226. package/dist/components/profile/request-change-email-form.js.map +1 -1
  227. package/dist/components/profile/request-change-phone-form.d.ts +2 -5
  228. package/dist/components/profile/request-change-phone-form.js +5 -323
  229. package/dist/components/profile/request-change-phone-form.js.map +1 -1
  230. package/dist/components/profile/security.d.ts +1 -5
  231. package/dist/components/profile/security.js +15 -1508
  232. package/dist/components/profile/security.js.map +1 -1
  233. package/dist/components/profile/verify-change-email-form.d.ts +2 -5
  234. package/dist/components/profile/verify-change-email-form.js +7 -407
  235. package/dist/components/profile/verify-change-email-form.js.map +1 -1
  236. package/dist/components/profile/verify-change-phone-form.d.ts +2 -5
  237. package/dist/components/profile/verify-change-phone-form.js +7 -411
  238. package/dist/components/profile/verify-change-phone-form.js.map +1 -1
  239. package/dist/components/shared/data-table.d.ts +5 -8
  240. package/dist/components/shared/data-table.js +3 -79
  241. package/dist/components/shared/data-table.js.map +1 -1
  242. package/dist/components/skeletons/auth-form-skeleton.d.ts +1 -5
  243. package/dist/components/skeletons/auth-form-skeleton.js +3 -27
  244. package/dist/components/skeletons/auth-form-skeleton.js.map +1 -1
  245. package/dist/components/skeletons/profile-skeleton.d.ts +1 -5
  246. package/dist/components/skeletons/profile-skeleton.js +3 -28
  247. package/dist/components/skeletons/profile-skeleton.js.map +1 -1
  248. package/dist/components/skeletons/table-skeleton.d.ts +2 -5
  249. package/dist/components/skeletons/table-skeleton.js +3 -34
  250. package/dist/components/skeletons/table-skeleton.js.map +1 -1
  251. package/dist/constants/auth.error.codes.d.ts +5 -0
  252. package/dist/hooks/use-session-cookie-name.d.ts +1 -0
  253. package/dist/hooks/use-translator.d.ts +1 -0
  254. package/dist/index.d.ts +50 -92
  255. package/dist/index.js +147 -4936
  256. package/dist/index.js.map +1 -1
  257. package/dist/lib/query-options.d.ts +10 -0
  258. package/dist/lib/translations.d.ts +3 -0
  259. package/dist/pages/auth/forgot-password.d.ts +3 -7
  260. package/dist/pages/auth/forgot-password.js +8 -770
  261. package/dist/pages/auth/forgot-password.js.map +1 -1
  262. package/dist/pages/auth/layout.d.ts +3 -7
  263. package/dist/pages/auth/layout.js +13 -536
  264. package/dist/pages/auth/layout.js.map +1 -1
  265. package/dist/pages/auth/reset-password.d.ts +4 -7
  266. package/dist/pages/auth/reset-password.js +8 -888
  267. package/dist/pages/auth/reset-password.js.map +1 -1
  268. package/dist/pages/auth/set-password.d.ts +4 -7
  269. package/dist/pages/auth/set-password.js +9 -927
  270. package/dist/pages/auth/set-password.js.map +1 -1
  271. package/dist/pages/auth/sign-in.d.ts +4 -7
  272. package/dist/pages/auth/sign-in.js +9 -967
  273. package/dist/pages/auth/sign-in.js.map +1 -1
  274. package/dist/pages/auth/sign-up.d.ts +4 -7
  275. package/dist/pages/auth/sign-up.js +8 -915
  276. package/dist/pages/auth/sign-up.js.map +1 -1
  277. package/dist/pages/auth/verify-email.d.ts +4 -7
  278. package/dist/pages/auth/verify-email.js +10 -922
  279. package/dist/pages/auth/verify-email.js.map +1 -1
  280. package/dist/pages/auth/verify-phone.d.ts +4 -7
  281. package/dist/pages/auth/verify-phone.js +10 -927
  282. package/dist/pages/auth/verify-phone.js.map +1 -1
  283. package/dist/pages/iam/permissions/_components/permission-card.d.ts +6 -0
  284. package/dist/pages/iam/permissions/_components/permissions-data.d.ts +7 -0
  285. package/dist/pages/iam/permissions/_components/permissions-list.d.ts +14 -0
  286. package/dist/pages/iam/permissions.d.ts +1 -5
  287. package/dist/pages/iam/permissions.js +4 -302
  288. package/dist/pages/iam/permissions.js.map +1 -1
  289. package/dist/pages/iam/role-detail-layout.d.ts +3 -6
  290. package/dist/pages/iam/role-detail-layout.js +5 -132
  291. package/dist/pages/iam/role-detail-layout.js.map +1 -1
  292. package/dist/pages/iam/role-detail.d.ts +4 -7
  293. package/dist/pages/iam/role-detail.js +5 -224
  294. package/dist/pages/iam/role-detail.js.map +1 -1
  295. package/dist/pages/iam/role-permissions.d.ts +4 -7
  296. package/dist/pages/iam/role-permissions.js +6 -392
  297. package/dist/pages/iam/role-permissions.js.map +1 -1
  298. package/dist/pages/iam/role-users.d.ts +4 -7
  299. package/dist/pages/iam/role-users.js +9 -808
  300. package/dist/pages/iam/role-users.js.map +1 -1
  301. package/dist/pages/iam/roles/_components/role-card.d.ts +7 -0
  302. package/dist/pages/iam/roles/_components/role-form.d.ts +9 -0
  303. package/dist/pages/iam/roles/_components/role-selector.d.ts +11 -0
  304. package/dist/pages/iam/roles/_components/roles-data.d.ts +16 -0
  305. package/dist/pages/iam/roles/_components/roles-list.d.ts +15 -0
  306. package/dist/pages/iam/roles/users/_components/role-users-page.d.ts +5 -0
  307. package/dist/pages/iam/roles.d.ts +1 -5
  308. package/dist/pages/iam/roles.js +7 -678
  309. package/dist/pages/iam/roles.js.map +1 -1
  310. package/dist/pages/iam/sessions/_components/session-card.d.ts +6 -0
  311. package/dist/pages/iam/sessions/_components/sessions-data.d.ts +7 -0
  312. package/dist/pages/iam/sessions/_components/sessions-list.d.ts +14 -0
  313. package/dist/pages/iam/sessions.d.ts +1 -5
  314. package/dist/pages/iam/sessions.js +6 -309
  315. package/dist/pages/iam/sessions.js.map +1 -1
  316. package/dist/pages/iam/shared/navigation.d.ts +8 -0
  317. package/dist/pages/iam/shared/page-helpers.d.ts +12 -0
  318. package/dist/pages/iam/tenant-detail.d.ts +2 -5
  319. package/dist/pages/iam/tenant-detail.js +6 -174
  320. package/dist/pages/iam/tenant-detail.js.map +1 -1
  321. package/dist/pages/iam/tenants/_components/tenant-card.d.ts +6 -0
  322. package/dist/pages/iam/tenants/_components/tenant-form.d.ts +9 -0
  323. package/dist/pages/iam/tenants/_components/tenant-selector.d.ts +13 -0
  324. package/dist/pages/iam/tenants/_components/tenants-data.d.ts +12 -0
  325. package/dist/pages/iam/tenants/_components/tenants-list.d.ts +15 -0
  326. package/dist/pages/iam/tenants/tenant-detail-page-content.d.ts +5 -0
  327. package/dist/pages/iam/tenants.d.ts +1 -5
  328. package/dist/pages/iam/tenants.js +7 -604
  329. package/dist/pages/iam/tenants.js.map +1 -1
  330. package/dist/pages/iam/user-activity.d.ts +2 -5
  331. package/dist/pages/iam/user-activity.js +9 -838
  332. package/dist/pages/iam/user-activity.js.map +1 -1
  333. package/dist/pages/iam/user-detail-layout.d.ts +3 -6
  334. package/dist/pages/iam/user-detail-layout.js +5 -93
  335. package/dist/pages/iam/user-detail-layout.js.map +1 -1
  336. package/dist/pages/iam/user-detail.d.ts +2 -5
  337. package/dist/pages/iam/user-detail.js +5 -92
  338. package/dist/pages/iam/user-detail.js.map +1 -1
  339. package/dist/pages/iam/users/_components/bulk-invite-user-form.d.ts +6 -0
  340. package/dist/pages/iam/users/_components/invite-user-form.d.ts +6 -0
  341. package/dist/pages/iam/users/_components/invite-user-shared.d.ts +25 -0
  342. package/dist/pages/iam/users/_components/user-card.d.ts +6 -0
  343. package/dist/pages/iam/users/_components/user-detail-layout-content.d.ts +6 -0
  344. package/dist/pages/iam/users/_components/user-detail-page-content.d.ts +5 -0
  345. package/dist/pages/iam/users/_components/user-form.d.ts +9 -0
  346. package/dist/pages/iam/users/_components/user-selector.d.ts +12 -0
  347. package/dist/pages/iam/users/_components/users-data.d.ts +22 -0
  348. package/dist/pages/iam/users/_components/users-list.d.ts +15 -0
  349. package/dist/pages/iam/users/activity/_components/role-section.d.ts +3 -0
  350. package/dist/pages/iam/users/activity/user-activity-page-content.d.ts +5 -0
  351. package/dist/pages/iam/users.d.ts +1 -5
  352. package/dist/pages/iam/users.js +7 -1269
  353. package/dist/pages/iam/users.js.map +1 -1
  354. package/dist/pages/profile/_components/profile-sidebar.d.ts +1 -0
  355. package/dist/pages/profile/account.d.ts +1 -5
  356. package/dist/pages/profile/account.js +9 -158
  357. package/dist/pages/profile/account.js.map +1 -1
  358. package/dist/pages/profile/layout.d.ts +1 -8
  359. package/dist/pages/profile/layout.js +5 -128
  360. package/dist/pages/profile/layout.js.map +1 -1
  361. package/dist/pages/profile/security.d.ts +1 -5
  362. package/dist/pages/profile/security.js +20 -1515
  363. package/dist/pages/profile/security.js.map +1 -1
  364. package/dist/provider.d.ts +53 -0
  365. package/dist/{types-g9QcNRxT.d.ts → types.d.ts} +33 -12
  366. package/dist/utils/cookie.d.ts +2 -0
  367. package/dist/utils/custom-fetch.d.ts +2 -0
  368. package/dist/utils/handle-error.d.ts +7 -0
  369. package/dist/utils/normalize-phone.d.ts +1 -0
  370. package/package.json +4 -4
  371. package/dist/verification-form-ipSRTtQB.d.ts +0 -22
@@ -1,537 +1,13 @@
1
1
  "use client";
2
-
3
- // src/components/auth/verify-phone.tsx
4
- import { Alert, AlertDescription, AlertTitle } from "@mesob/ui/components";
5
- import { useMesob as useMesob2 } from "@mesob/ui/providers";
6
- import { IconAlertCircle } from "@tabler/icons-react";
7
- import { useEffect as useEffect2, useState as useState3 } from "react";
8
- import { toast } from "sonner";
9
-
10
- // src/hooks/use-translator.ts
11
- import { useMesob } from "@mesob/ui/providers";
12
-
13
- // src/lib/translations.ts
14
- function createTranslator(messages, namespace) {
15
- return (key, params) => {
16
- const fullKey = namespace ? `${namespace}.${key}` : key;
17
- const keys = fullKey.split(".");
18
- let value = messages;
19
- for (const k of keys) {
20
- if (value && typeof value === "object" && value !== null) {
21
- value = value[k];
22
- } else {
23
- return fullKey;
24
- }
25
- }
26
- if (typeof value !== "string") {
27
- return fullKey;
28
- }
29
- if (params) {
30
- return value.replace(
31
- /\{(\w+)\}/g,
32
- (_, param) => String(params[param] ?? `{${param}}`)
33
- );
34
- }
35
- return value;
36
- };
37
- }
38
-
39
- // src/provider.tsx
40
- import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
41
- import { deepmerge } from "deepmerge-ts";
42
- import createFetchClient from "openapi-fetch";
43
- import createClient from "openapi-react-query";
44
- import { createContext, useContext, useMemo, useState } from "react";
45
-
46
- // src/utils/cookie.ts
47
- var isProduction = typeof process !== "undefined" && process.env.NODE_ENV === "production";
48
-
49
- // src/provider.tsx
50
- import { jsx } from "react/jsx-runtime";
51
- var SessionContext = createContext(null);
52
- var ApiContext = createContext(null);
53
- var ConfigContext = createContext(null);
54
- var queryClient = new QueryClient({
55
- defaultOptions: {
56
- queries: {
57
- refetchOnWindowFocus: false
58
- }
59
- }
60
- });
61
- function useApi() {
62
- const context = useContext(ApiContext);
63
- if (!context) {
64
- throw new Error("useApi must be used within MesobAuthProvider");
65
- }
66
- return context;
67
- }
68
- function useConfig() {
69
- const context = useContext(ConfigContext);
70
- if (!context) {
71
- throw new Error("useConfig must be used within MesobAuthProvider");
72
- }
73
- return context;
74
- }
75
-
76
- // src/hooks/use-translator.ts
77
- function useTranslator(namespace) {
78
- const mesob = useMesob();
79
- const { config } = useConfig();
80
- if (mesob?.t) {
81
- return (key, params) => {
82
- const fullKey = namespace ? `${namespace}.${key}` : key;
83
- return mesob.t?.(fullKey, params) ?? fullKey;
84
- };
85
- }
86
- return createTranslator(config.messages || {}, namespace);
87
- }
88
-
89
- // src/constants/auth.error.codes.ts
90
- var AUTH_ERROR_MAPPING = {
91
- USER_NOT_FOUND: {
92
- title: "Account Not Found",
93
- description: "We could not find an account with that identifier. Please check your spelling or sign up."
94
- },
95
- INVALID_PASSWORD: {
96
- title: "Invalid Password",
97
- description: "The password you entered is incorrect. Please try again."
98
- },
99
- USER_EXISTS: {
100
- title: "Account Already Exists",
101
- description: "An account with this identifier already exists. Please sign in instead."
102
- },
103
- VERIFICATION_EXPIRED: {
104
- title: "Verification Expired",
105
- description: "The verification code or link has expired. Please request a new one."
106
- },
107
- VERIFICATION_MISMATCH: {
108
- title: "Invalid Code",
109
- description: "The verification code you entered is invalid. Please double-check and try again."
110
- },
111
- VERIFICATION_NOT_FOUND: {
112
- title: "Verification Not Found",
113
- description: "We could not find a pending verification request. Please restart the process."
114
- },
115
- TOO_MANY_ATTEMPTS: {
116
- title: "Too Many Attempts",
117
- description: "You have made too many requests recently. Please wait a moment before trying again."
118
- },
119
- REQUIRES_VERIFICATION: {
120
- title: "Verification Required",
121
- description: "You need to verify your account before you can continue. Please check your email or phone."
122
- },
123
- UNAUTHORIZED: {
124
- title: "Unauthorized",
125
- description: "You are not authorized to perform this action. Please sign in again."
126
- },
127
- ACCESS_DENIED: {
128
- title: "Access Denied",
129
- description: "You do not have permission to access this resource. Please contact support if you believe this is an error."
130
- },
131
- HAS_NO_PASSWORD: {
132
- title: "No Password Set",
133
- description: "Your account does not have a password yet. Continue to set a password before signing in."
134
- },
135
- PASSWORD_ALREADY_SET: {
136
- title: "Password Already Set",
137
- description: "This account already has a password. Use the normal sign-in form instead."
138
- }
139
- };
140
- var validCodes = Object.keys(AUTH_ERROR_MAPPING);
141
-
142
- // src/utils/handle-error.ts
143
- function isAuthError(err) {
144
- return typeof err === "object" && err !== null && "message" in err && typeof err.message === "string";
145
- }
146
- function extractErrorCode(err) {
147
- if (err.code && validCodes.includes(err.code)) {
148
- return err.code;
149
- }
150
- if (err.message) {
151
- const messageUpper = err.message.toUpperCase().trim();
152
- if (validCodes.includes(messageUpper)) {
153
- return messageUpper;
154
- }
155
- }
156
- return "";
157
- }
158
- function sanitizeErrorMessage(message) {
159
- const lowerMessage = message.toLowerCase();
160
- const isDatabaseError = lowerMessage.includes("failed query") || lowerMessage.includes("select") || lowerMessage.includes("insert") || lowerMessage.includes("update") || lowerMessage.includes("delete") || lowerMessage.includes("from") || lowerMessage.includes("where") || lowerMessage.includes("limit") || lowerMessage.includes("params:") || lowerMessage.includes("query") || message.includes('"iam".') || message.includes('"tenants"') || message.includes('"users"') || message.includes('"sessions"') || message.includes('"accounts"') || lowerMessage.includes("relation") || lowerMessage.includes("column") || lowerMessage.includes("syntax error") || lowerMessage.includes("database") || lowerMessage.includes("postgres") || lowerMessage.includes("sql");
161
- if (isDatabaseError) {
162
- return "An error occurred while processing your request";
163
- }
164
- return message;
165
- }
166
- function handleAuthError(err, setError, t) {
167
- const errorCode = extractErrorCode(err);
168
- if (errorCode && AUTH_ERROR_MAPPING[errorCode]) {
169
- const mapping = AUTH_ERROR_MAPPING[errorCode];
170
- setError({
171
- title: mapping.title,
172
- description: mapping.description
173
- });
174
- return;
175
- }
176
- const sanitizedMessage = sanitizeErrorMessage(
177
- err.message || t("errors.fallback")
178
- );
179
- setError({
180
- title: t("errors.fallback"),
181
- description: sanitizedMessage
182
- });
183
- }
184
- function handleGenericError(err, setError, t) {
185
- const rawMessage = err instanceof Error ? err.message : t("errors.fallback");
186
- const sanitizedMessage = sanitizeErrorMessage(rawMessage);
187
- setError({
188
- title: "Error",
189
- description: sanitizedMessage
190
- });
191
- }
192
- var handleError = (err, setError, t) => {
193
- if (isAuthError(err)) {
194
- handleAuthError(err, setError, t);
195
- } else {
196
- handleGenericError(err, setError, t);
197
- }
198
- };
199
-
200
- // src/components/auth/auth-layout.tsx
201
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
202
- var AuthLayout = ({
203
- title,
204
- description,
205
- children,
206
- footer,
207
- logoImage
208
- }) => {
209
- return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
210
- /* @__PURE__ */ jsx2("div", { className: "flex size-8 mb-6 w-full items-center justify-center rounded-md", children: /* @__PURE__ */ jsx2(
211
- "img",
212
- {
213
- src: logoImage || "",
214
- alt: title,
215
- width: 42,
216
- height: 42
217
- }
218
- ) }),
219
- /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
220
- /* @__PURE__ */ jsx2("h1", { className: "text-2xl font-bold tracking-tight", children: title }),
221
- description && /* @__PURE__ */ jsx2("p", { className: "mt-2 text-sm text-muted-foreground", children: description })
222
- ] }),
223
- children,
224
- footer && /* @__PURE__ */ jsx2("div", { className: "mt-2 w-full", children: /* @__PURE__ */ jsx2("div", { className: "w-full text-center text-sm text-muted-foreground", children: footer }) })
225
- ] });
226
- };
227
-
228
- // src/components/auth/verification-form.tsx
229
- import { zodResolver } from "@hookform/resolvers/zod";
230
2
  import {
231
- Button,
232
- Form,
233
- FormControl,
234
- FormField,
235
- FormItem,
236
- FormLabel,
237
- FormMessage,
238
- InputOTP,
239
- InputOTPGroup,
240
- InputOTPSlot
241
- } from "@mesob/ui/components";
242
- import { useForm } from "react-hook-form";
243
- import { z } from "zod";
244
-
245
- // src/components/auth/countdown.tsx
246
- import { Spinner } from "@mesob/ui/components";
247
- import { useEffect, useState as useState2 } from "react";
248
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
249
- var Countdown = ({
250
- initialSeconds = 60,
251
- onResend,
252
- resending = false
253
- }) => {
254
- const t = useTranslator("Common");
255
- const [seconds, setSeconds] = useState2(initialSeconds);
256
- const [isResending, setIsResending] = useState2(false);
257
- useEffect(() => {
258
- if (seconds <= 0) {
259
- return;
260
- }
261
- const timer = setInterval(() => {
262
- setSeconds((prev) => {
263
- if (prev <= 1) {
264
- clearInterval(timer);
265
- return 0;
266
- }
267
- return prev - 1;
268
- });
269
- }, 1e3);
270
- return () => clearInterval(timer);
271
- }, [seconds]);
272
- const handleResend = async () => {
273
- setIsResending(true);
274
- try {
275
- await onResend();
276
- setSeconds(initialSeconds);
277
- } catch (_error) {
278
- } finally {
279
- setIsResending(false);
280
- }
281
- };
282
- const busy = isResending || resending;
283
- if (seconds > 0) {
284
- return /* @__PURE__ */ jsx3("p", { className: "text-sm text-muted-foreground", children: t("resendIn", { seconds }) });
285
- }
286
- return /* @__PURE__ */ jsxs2(
287
- "button",
288
- {
289
- type: "button",
290
- onClick: handleResend,
291
- disabled: busy,
292
- className: "text-sm text-primary hover:underline disabled:opacity-50 flex items-center gap-1",
293
- children: [
294
- busy && /* @__PURE__ */ jsx3(Spinner, { className: "h-3 w-3" }),
295
- t("resend")
296
- ]
297
- }
298
- );
299
- };
300
-
301
- // src/components/auth/verification-form.tsx
302
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
303
- var verificationSchema = (t) => z.object({
304
- code: z.string().length(6, t("form.codeLength"))
305
- });
306
- var VerificationForm = ({
307
- onSubmit,
308
- onResend,
309
- isLoading = false
310
- }) => {
311
- const t = useTranslator("Auth.verification");
312
- const form = useForm({
313
- resolver: zodResolver(verificationSchema(t)),
314
- defaultValues: { code: "" }
315
- });
316
- const handleSubmit = form.handleSubmit(async (values) => {
317
- await onSubmit(values);
318
- });
319
- const codeLength = form.watch("code").length;
320
- return /* @__PURE__ */ jsx4(Form, { ...form, children: /* @__PURE__ */ jsxs3(
321
- "form",
322
- {
323
- id: "verification-form",
324
- onSubmit: handleSubmit,
325
- className: "space-y-4",
326
- children: [
327
- /* @__PURE__ */ jsx4(
328
- FormField,
329
- {
330
- control: form.control,
331
- name: "code",
332
- render: ({ field }) => /* @__PURE__ */ jsxs3(FormItem, { children: [
333
- /* @__PURE__ */ jsx4("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx4(FormLabel, { children: t("form.codeLabel") }) }),
334
- /* @__PURE__ */ jsx4(FormControl, { children: /* @__PURE__ */ jsx4(
335
- InputOTP,
336
- {
337
- maxLength: 6,
338
- required: true,
339
- value: field.value ?? "",
340
- onChange: field.onChange,
341
- onBlur: field.onBlur,
342
- containerClassName: "gap-4 justify-center mb-2 flex items-center",
343
- children: /* @__PURE__ */ jsxs3(InputOTPGroup, { className: "gap-3 *:data-[slot=input-otp-slot]:h-12 *:data-[slot=input-otp-slot]:w-12 *:data-[slot=input-otp-slot]:rounded-md *:data-[slot=input-otp-slot]:border *:data-[slot=input-otp-slot]:text-xl", children: [
344
- /* @__PURE__ */ jsx4(InputOTPSlot, { className: "h-12", index: 0 }),
345
- /* @__PURE__ */ jsx4(InputOTPSlot, { className: "h-12", index: 1 }),
346
- /* @__PURE__ */ jsx4(InputOTPSlot, { className: "h-12", index: 2 }),
347
- /* @__PURE__ */ jsx4(InputOTPSlot, { className: "h-12", index: 3 }),
348
- /* @__PURE__ */ jsx4(InputOTPSlot, { className: "h-12", index: 4 }),
349
- /* @__PURE__ */ jsx4(InputOTPSlot, { className: "h-12", index: 5 })
350
- ] })
351
- }
352
- ) }),
353
- /* @__PURE__ */ jsx4(FormMessage, {})
354
- ] })
355
- }
356
- ),
357
- /* @__PURE__ */ jsx4(
358
- Button,
359
- {
360
- type: "submit",
361
- form: "verification-form",
362
- className: "w-full",
363
- disabled: isLoading || codeLength !== 6,
364
- loading: isLoading,
365
- children: t("form.confirm")
366
- }
367
- ),
368
- /* @__PURE__ */ jsx4("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx4(Countdown, { onResend, resending: isLoading }) })
369
- ]
370
- }
371
- ) });
372
- };
373
-
374
- // src/components/auth/verify-phone.tsx
375
- import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
376
- var VerifyPhone = ({
377
- verificationId,
378
- context,
379
- phone = "",
380
- redirectUrl
381
- }) => {
382
- const { hooks, refresh, setAuth } = useApi();
383
- const { config } = useConfig();
384
- const mesob = useMesob2();
385
- const Link = mesob?.navigation?.Link;
386
- const t = useTranslator("Auth.verification");
387
- const common = useTranslator("Common");
388
- const footer = useTranslator("Auth.forgotPassword.footer");
389
- const [isLoading, setIsLoading] = useState3(false);
390
- const [error, setError] = useState3(null);
391
- const verifyPhoneMutation = hooks.useMutation(
392
- "post",
393
- "/phone/verification/confirm"
394
- );
395
- const requestPhoneMutation = hooks.useMutation(
396
- "post",
397
- "/phone/verification/request"
398
- );
399
- const signInLink = config.navigation?.links?.signIn || "/auth/sign-in";
400
- const onNavigate = config.navigation?.onNavigate || ((path) => {
401
- if (typeof window !== "undefined") {
402
- window.location.href = path;
403
- }
404
- });
405
- const logoImage = config.ui.logoImage;
406
- const defaultRedirect = redirectUrl || config.navigation?.defaultRedirectUrl || "/";
407
- useEffect2(() => {
408
- if (error) {
409
- toast.error(error.title || "Error", {
410
- description: error.description
411
- });
412
- }
413
- }, [error]);
414
- const handleSubmit = async (values) => {
415
- if (!verificationId) {
416
- setError({
417
- title: t("errors.fallback"),
418
- description: t("errors.fallback")
419
- });
420
- return;
421
- }
422
- setIsLoading(true);
423
- setError(null);
424
- try {
425
- const res = await verifyPhoneMutation.mutateAsync({
426
- body: {
427
- verificationId,
428
- code: values.code,
429
- context
430
- }
431
- });
432
- if (res && "user" in res && "session" in res && res.session) {
433
- setAuth(res);
434
- onNavigate(defaultRedirect);
435
- return;
436
- }
437
- await refresh();
438
- onNavigate(defaultRedirect);
439
- } catch (err) {
440
- handleError(err, setError, t);
441
- } finally {
442
- setIsLoading(false);
443
- }
444
- };
445
- const handleResend = async () => {
446
- setError(null);
447
- try {
448
- const targetPhone = context === "sign-up" ? phone : null;
449
- if (!targetPhone) {
450
- setError({
451
- title: t("errors.fallback"),
452
- description: t("phone.missingPhone")
453
- });
454
- return;
455
- }
456
- const res = await requestPhoneMutation.mutateAsync({
457
- body: {
458
- phone: targetPhone,
459
- context
460
- }
461
- });
462
- if (res && "verificationId" in res && res.verificationId) {
463
- onNavigate(
464
- `/auth/verify-phone?context=${context}&verificationId=${res.verificationId}&phone=${targetPhone}`
465
- );
466
- return;
467
- }
468
- setError({
469
- title: t("errors.fallback"),
470
- description: t("phone.resendFailed")
471
- });
472
- } catch (err) {
473
- handleError(err, setError, t);
474
- }
475
- };
476
- if (!verificationId) {
477
- return /* @__PURE__ */ jsx5(
478
- AuthLayout,
479
- {
480
- title: common("invalidLinkTitle"),
481
- description: common("invalidLinkDescription"),
482
- footer: /* @__PURE__ */ jsx5(Link, { href: signInLink, className: "text-primary hover:underline", children: footer("backToSignIn") }),
483
- children: /* @__PURE__ */ jsx5("div", {})
484
- }
485
- );
486
- }
487
- let errorContent = null;
488
- if (error) {
489
- if (typeof error === "string") {
490
- errorContent = { title: "Error", description: error };
491
- } else {
492
- errorContent = error;
493
- }
494
- }
495
- return /* @__PURE__ */ jsxs4(
496
- AuthLayout,
497
- {
498
- title: config.ui.name,
499
- description: t("phone.description", {
500
- target: phone || t("phone.missingPhone")
501
- }),
502
- logoImage,
503
- footer: Link ? /* @__PURE__ */ jsx5(Link, { href: signInLink, className: "text-primary hover:underline", children: footer("backToSignIn") }) : /* @__PURE__ */ jsx5(
504
- "a",
505
- {
506
- href: signInLink,
507
- onClick: (e) => {
508
- e.preventDefault();
509
- onNavigate(signInLink);
510
- },
511
- className: "text-primary hover:underline",
512
- children: footer("backToSignIn")
513
- }
514
- ),
515
- children: [
516
- /* @__PURE__ */ jsx5(
517
- VerificationForm,
518
- {
519
- verificationId,
520
- onSubmit: handleSubmit,
521
- onResend: handleResend,
522
- isLoading: isLoading || verifyPhoneMutation.isPending || requestPhoneMutation.isPending,
523
- error
524
- }
525
- ),
526
- errorContent && /* @__PURE__ */ jsxs4(Alert, { variant: "destructive", className: "mt-4", children: [
527
- /* @__PURE__ */ jsx5(IconAlertCircle, { className: "h-4 w-4" }),
528
- /* @__PURE__ */ jsx5(AlertTitle, { children: errorContent.title }),
529
- /* @__PURE__ */ jsx5(AlertDescription, { children: errorContent.description })
530
- ] })
531
- ]
532
- }
533
- );
534
- };
3
+ VerifyPhone
4
+ } from "../../chunk-45UCLKH2.js";
5
+ import "../../chunk-FFR5UHTS.js";
6
+ import "../../chunk-GP7GIUI3.js";
7
+ import "../../chunk-55BMNC4S.js";
8
+ import "../../chunk-DPH2PHK3.js";
9
+ import "../../chunk-QNCE2B5O.js";
10
+ import "../../chunk-72YRO3A7.js";
535
11
  export {
536
12
  VerifyPhone
537
13
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/auth/verify-phone.tsx","../../../src/hooks/use-translator.ts","../../../src/lib/translations.ts","../../../src/provider.tsx","../../../src/utils/cookie.ts","../../../src/constants/auth.error.codes.ts","../../../src/utils/handle-error.ts","../../../src/components/auth/auth-layout.tsx","../../../src/components/auth/verification-form.tsx","../../../src/components/auth/countdown.tsx"],"sourcesContent":["'use client';\n\nimport { Alert, AlertDescription, AlertTitle } from '@mesob/ui/components';\nimport { useMesob } from '@mesob/ui/providers';\nimport { IconAlertCircle } from '@tabler/icons-react';\nimport { useEffect, useState } from 'react';\nimport { toast } from 'sonner';\nimport { useTranslator } from '../../hooks/use-translator';\nimport { useApi, useConfig } from '../../provider';\nimport type { AuthResponse } from '../../types';\nimport type { AuthErrorContent } from '../../utils/handle-error';\nimport { handleError } from '../../utils/handle-error';\nimport { AuthLayout } from './auth-layout';\nimport { VerificationForm } from './verification-form';\n\ntype VerifyPhoneProps = {\n verificationId: string;\n context: 'sign-in' | 'sign-up';\n phone?: string;\n redirectUrl?: string;\n};\n\nexport const VerifyPhone = ({\n verificationId,\n context,\n phone = '',\n redirectUrl,\n}: VerifyPhoneProps) => {\n const { hooks, refresh, setAuth } = useApi();\n const { config } = useConfig();\n const mesob = useMesob();\n const Link = mesob?.navigation?.Link;\n const t = useTranslator('Auth.verification');\n const common = useTranslator('Common');\n const footer = useTranslator('Auth.forgotPassword.footer');\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<AuthErrorContent | null>(null);\n\n const verifyPhoneMutation = hooks.useMutation(\n 'post',\n '/phone/verification/confirm',\n );\n const requestPhoneMutation = hooks.useMutation(\n 'post',\n '/phone/verification/request',\n );\n\n const signInLink = config.navigation?.links?.signIn || '/auth/sign-in';\n const onNavigate =\n config.navigation?.onNavigate ||\n ((path: string) => {\n if (typeof window !== 'undefined') {\n window.location.href = path;\n }\n });\n const logoImage = config.ui.logoImage;\n const defaultRedirect =\n redirectUrl || config.navigation?.defaultRedirectUrl || '/';\n\n useEffect(() => {\n if (error) {\n toast.error(error.title || 'Error', {\n description: error.description,\n });\n }\n }, [error]);\n\n const handleSubmit = async (values: { code: string }) => {\n if (!verificationId) {\n setError({\n title: t('errors.fallback'),\n description: t('errors.fallback'),\n });\n return;\n }\n\n setIsLoading(true);\n setError(null);\n\n try {\n const res = await verifyPhoneMutation.mutateAsync({\n body: {\n verificationId,\n code: values.code,\n context,\n },\n });\n if (res && 'user' in res && 'session' in res && res.session) {\n setAuth(res as AuthResponse);\n onNavigate(defaultRedirect);\n return;\n }\n await refresh();\n onNavigate(defaultRedirect);\n } catch (err) {\n handleError(err, setError, t);\n } finally {\n setIsLoading(false);\n }\n };\n\n const handleResend = async () => {\n setError(null);\n try {\n const targetPhone = context === 'sign-up' ? phone : null;\n if (!targetPhone) {\n setError({\n title: t('errors.fallback'),\n description: t('phone.missingPhone'),\n });\n return;\n }\n const res = await requestPhoneMutation.mutateAsync({\n body: {\n phone: targetPhone,\n context,\n },\n });\n if (res && 'verificationId' in res && res.verificationId) {\n onNavigate(\n `/auth/verify-phone?context=${context}&verificationId=${res.verificationId}&phone=${targetPhone}`,\n );\n return;\n }\n setError({\n title: t('errors.fallback'),\n description: t('phone.resendFailed'),\n });\n } catch (err) {\n handleError(err, setError, t);\n }\n };\n\n if (!verificationId) {\n return (\n <AuthLayout\n title={common('invalidLinkTitle')}\n description={common('invalidLinkDescription')}\n footer={\n <Link href={signInLink} className=\"text-primary hover:underline\">\n {footer('backToSignIn')}\n </Link>\n }\n >\n <div />\n </AuthLayout>\n );\n }\n\n let errorContent: AuthErrorContent | null = null;\n if (error) {\n if (typeof error === 'string') {\n errorContent = { title: 'Error', description: error };\n } else {\n errorContent = error;\n }\n }\n\n return (\n <AuthLayout\n title={config.ui.name}\n description={t('phone.description', {\n target: phone || t('phone.missingPhone'),\n })}\n logoImage={logoImage}\n footer={\n Link ? (\n <Link href={signInLink} className=\"text-primary hover:underline\">\n {footer('backToSignIn')}\n </Link>\n ) : (\n <a\n href={signInLink}\n onClick={(e) => {\n e.preventDefault();\n onNavigate(signInLink);\n }}\n className=\"text-primary hover:underline\"\n >\n {footer('backToSignIn')}\n </a>\n )\n }\n >\n <VerificationForm\n verificationId={verificationId}\n onSubmit={handleSubmit}\n onResend={handleResend}\n isLoading={\n isLoading ||\n verifyPhoneMutation.isPending ||\n requestPhoneMutation.isPending\n }\n error={error}\n />\n {errorContent && (\n <Alert variant=\"destructive\" className=\"mt-4\">\n <IconAlertCircle className=\"h-4 w-4\" />\n <AlertTitle>{errorContent.title}</AlertTitle>\n <AlertDescription>{errorContent.description}</AlertDescription>\n </Alert>\n )}\n </AuthLayout>\n );\n};\n","import { useMesob } from '@mesob/ui/providers';\nimport { createTranslator } from '../lib/translations';\nimport { useConfig } from '../provider';\n\nexport function useTranslator(namespace?: string) {\n const mesob = useMesob();\n const { config } = useConfig();\n\n if (mesob?.t) {\n return (key: string, params?: Record<string, string | number>): string => {\n const fullKey = namespace ? `${namespace}.${key}` : key;\n return mesob.t?.(fullKey, params) ?? fullKey;\n };\n }\n\n return createTranslator(config.messages || {}, namespace);\n}\n","type Messages = Record<string, unknown>;\n\nexport function createTranslator(messages: Messages, namespace?: string) {\n return (key: string, params?: Record<string, string | number>): string => {\n const fullKey = namespace ? `${namespace}.${key}` : key;\n const keys = fullKey.split('.');\n\n let value: unknown = messages;\n for (const k of keys) {\n if (value && typeof value === 'object' && value !== null) {\n value = (value as Record<string, unknown>)[k];\n } else {\n return fullKey;\n }\n }\n\n if (typeof value !== 'string') {\n return fullKey;\n }\n\n // Simple parameter replacement\n if (params) {\n return value.replace(/\\{(\\w+)\\}/g, (_, param) =>\n String(params[param] ?? `{${param}}`),\n );\n }\n\n return value;\n };\n}\n","'use client';\n\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { deepmerge } from 'deepmerge-ts';\nimport createFetchClient from 'openapi-fetch';\nimport createClient from 'openapi-react-query';\nimport type { ReactNode } from 'react';\nimport { createContext, useContext, useMemo, useState } from 'react';\nimport type { paths } from './data/openapi';\nimport { createTranslator } from './lib/translations';\nimport {\n type AuthClientConfig,\n type AuthResponse,\n defaultAuthClientConfig,\n type Session,\n type User,\n} from './types';\nimport { getSessionCookieName } from './utils/cookie';\nimport { createCustomFetch } from './utils/custom-fetch';\n\n// biome-ignore lint/suspicious/noExplicitAny: OpenAPI hooks type\ntype OpenApiHooks = any;\n\n// --- Utility: Check if running on server ---\nfunction isServer(): boolean {\n return typeof document === 'undefined';\n}\n\n/**\n * @deprecated Cookie is httpOnly and cannot be read client-side.\n * Use `useSession().isAuthenticated` instead.\n * This function always returns false on client.\n */\nexport function hasAuthCookie(_cookieName: string): boolean {\n // Cookie is httpOnly, can't check client-side\n // Always return false - use useSession() for auth status\n return false;\n}\n\n// --- Types ---\nexport type AuthStatus = 'loading' | 'authenticated' | 'unauthenticated';\n\ntype AuthState = {\n user: User | null;\n session: Session | null;\n status: AuthStatus;\n error: Error | null;\n};\n\ntype SessionContextValue = AuthState & {\n isLoading: boolean;\n isAuthenticated: boolean;\n refresh: () => Promise<void>;\n signOut: () => Promise<void>;\n};\n\ntype ApiContextValue = {\n hooks: OpenApiHooks;\n setAuth: (auth: AuthResponse) => void;\n clearAuth: () => void;\n refresh: () => Promise<void>;\n};\n\ntype ConfigContextValue = {\n config: AuthClientConfig;\n cookieName: string;\n t: (key: string, params?: Record<string, string | number>) => string;\n};\n\nconst SessionContext = createContext<SessionContextValue | null>(null);\nconst ApiContext = createContext<ApiContextValue | null>(null);\nconst ConfigContext = createContext<ConfigContextValue | null>(null);\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n refetchOnWindowFocus: false,\n },\n },\n});\n\n// --- Hooks ---\n\n/**\n * Get session state including user, session, and auth status.\n * - `status`: 'loading' | 'authenticated' | 'unauthenticated'\n * - `isLoading`: true while fetching session\n * - `isAuthenticated`: true if user and session exist\n */\nexport function useSession(): SessionContextValue {\n const context = useContext(SessionContext);\n if (!context) {\n throw new Error('useSession must be used within MesobAuthProvider');\n }\n return context;\n}\n\nexport function useApi(): ApiContextValue {\n const context = useContext(ApiContext);\n if (!context) {\n throw new Error('useApi must be used within MesobAuthProvider');\n }\n return context;\n}\n\nexport function useConfig(): ConfigContextValue {\n const context = useContext(ConfigContext);\n if (!context) {\n throw new Error('useConfig must be used within MesobAuthProvider');\n }\n return context;\n}\n\n/**\n * @deprecated Cookie is httpOnly, can't be checked client-side.\n * Use `useSession().isAuthenticated` instead.\n */\nexport function useHasAuthCookie(): boolean {\n const { status } = useSession();\n return status === 'authenticated' || status === 'loading';\n}\n\n// --- Provider ---\n\ntype MesobAuthProviderProps = {\n config: AuthClientConfig;\n children: ReactNode;\n};\n\nexport function MesobAuthProvider({\n config,\n children,\n}: MesobAuthProviderProps) {\n const mergedConfig = useMemo(\n () =>\n deepmerge(\n { ...defaultAuthClientConfig } as Partial<AuthClientConfig>,\n config,\n ) as AuthClientConfig,\n [config],\n );\n\n const api = useMemo(\n () =>\n createFetchClient<paths>({\n baseUrl: mergedConfig.baseURL,\n fetch: createCustomFetch(mergedConfig),\n }),\n [mergedConfig],\n );\n\n const hooks = useMemo(() => createClient(api), [api]);\n const cookieName = useMemo(\n () => getSessionCookieName(mergedConfig),\n [mergedConfig],\n );\n\n return (\n <QueryClientProvider client={queryClient}>\n <AuthStateProvider\n config={mergedConfig}\n hooks={hooks}\n cookieName={cookieName}\n >\n {children}\n </AuthStateProvider>\n </QueryClientProvider>\n );\n}\n\ntype AuthStateProviderProps = {\n config: AuthClientConfig;\n hooks: OpenApiHooks;\n cookieName: string;\n children: ReactNode;\n};\n\nfunction AuthStateProvider({\n config,\n hooks,\n cookieName,\n children,\n}: AuthStateProviderProps) {\n // Manual override for sign-out / sign-in\n const [override, setOverride] = useState<AuthState | null>(null);\n\n // Always fetch session - cookie is httpOnly, can't check client-side\n // Server will read the cookie and return user/session if valid\n const {\n data: sessionData,\n isLoading,\n isFetched,\n error: sessionError,\n refetch,\n } = hooks.useQuery(\n 'get',\n '/session',\n {},\n {\n enabled: !(override || isServer()),\n refetchOnMount: false,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n retry: false,\n gcTime: 0,\n staleTime: 0,\n },\n );\n\n // Derive state directly - no useEffect\n const user = override?.user ?? sessionData?.user ?? null;\n const session = override?.session ?? sessionData?.session ?? null;\n const error = override?.error ?? (sessionError as Error | null);\n\n // Check error status code\n const errorStatus = (() => {\n if (!sessionError) {\n return null;\n }\n const err = sessionError as { status?: number };\n return err.status ?? null;\n })();\n\n // Check if error is a network/connection error\n const isNetworkError = (() => {\n if (!sessionError) {\n return false;\n }\n const error = sessionError as Error & { cause?: unknown; data?: unknown };\n const errorMessage =\n error.message || String(error) || JSON.stringify(error);\n // Network errors: TypeError, DOMException, or fetch failures\n if (\n error instanceof TypeError ||\n error instanceof DOMException ||\n error.name === 'TypeError' ||\n errorMessage.includes('Failed to fetch') ||\n errorMessage.includes('ERR_CONNECTION_REFUSED') ||\n errorMessage.includes('NetworkError') ||\n errorMessage.includes('Network request failed') ||\n errorMessage.includes('fetch failed')\n ) {\n return true;\n }\n // Check error cause\n if (error.cause) {\n const causeStr = String(error.cause);\n if (\n causeStr.includes('Failed to fetch') ||\n causeStr.includes('ERR_CONNECTION_REFUSED') ||\n causeStr.includes('NetworkError')\n ) {\n return true;\n }\n }\n return false;\n })();\n\n // Compute status\n // biome-ignore lint: Status determination requires multiple checks\n const status: AuthStatus = (() => {\n if (override) {\n return override.status;\n }\n if (isServer()) {\n return 'loading';\n }\n if (user && session) {\n return 'authenticated';\n }\n // Check for network errors or auth errors first - allow auth page to show\n if (isNetworkError || errorStatus === 401) {\n return 'unauthenticated';\n }\n // If we have an error but it's not a network error, still check loading state\n if (sessionError && !isNetworkError && errorStatus !== 401) {\n if (errorStatus && errorStatus >= 500) {\n return 'authenticated';\n }\n // Other errors mean unauthenticated\n if (isFetched) {\n return 'unauthenticated';\n }\n }\n if (isLoading || !isFetched) {\n return 'loading';\n }\n if (isFetched && !user && !session) {\n return 'unauthenticated';\n }\n return 'unauthenticated';\n })();\n\n const signOutMutation = hooks.useMutation('post', '/sign-out');\n const t = createTranslator(config.messages || {});\n\n const setAuth = (auth: AuthResponse) => {\n setOverride({\n user: auth.user,\n session: auth.session,\n status: 'authenticated',\n error: null,\n });\n };\n\n const clearAuth = () => {\n setOverride({\n user: null,\n session: null,\n status: 'unauthenticated',\n error: null,\n });\n };\n\n const refresh = async () => {\n setOverride(null);\n await refetch();\n };\n\n const signOut = async () => {\n try {\n await signOutMutation.mutateAsync({});\n } finally {\n clearAuth();\n }\n };\n\n return (\n <ConfigContext.Provider value={{ config, cookieName, t }}>\n <ApiContext.Provider value={{ hooks, setAuth, clearAuth, refresh }}>\n <SessionContext.Provider\n value={{\n user,\n session,\n status,\n error,\n isLoading: status === 'loading',\n isAuthenticated: status === 'authenticated',\n refresh,\n signOut,\n }}\n >\n {children}\n </SessionContext.Provider>\n </ApiContext.Provider>\n </ConfigContext.Provider>\n );\n}\n","import type { AuthClientConfig } from '../types';\n\nconst isProduction =\n typeof process !== 'undefined' && process.env.NODE_ENV === 'production';\n\nexport const getSessionCookieName = (config: AuthClientConfig): string => {\n const prefix = config.cookiePrefix || '';\n const baseName = 'session_token';\n if (prefix) {\n return `${prefix}_${baseName}`;\n }\n return isProduction ? '__Host-session_token' : baseName;\n};\n","export const AUTH_ERROR_MAPPING: Record<\n string,\n { title: string; description: string }\n> = {\n USER_NOT_FOUND: {\n title: 'Account Not Found',\n description:\n 'We could not find an account with that identifier. Please check your spelling or sign up.',\n },\n INVALID_PASSWORD: {\n title: 'Invalid Password',\n description: 'The password you entered is incorrect. Please try again.',\n },\n USER_EXISTS: {\n title: 'Account Already Exists',\n description:\n 'An account with this identifier already exists. Please sign in instead.',\n },\n VERIFICATION_EXPIRED: {\n title: 'Verification Expired',\n description:\n 'The verification code or link has expired. Please request a new one.',\n },\n VERIFICATION_MISMATCH: {\n title: 'Invalid Code',\n description:\n 'The verification code you entered is invalid. Please double-check and try again.',\n },\n VERIFICATION_NOT_FOUND: {\n title: 'Verification Not Found',\n description:\n 'We could not find a pending verification request. Please restart the process.',\n },\n TOO_MANY_ATTEMPTS: {\n title: 'Too Many Attempts',\n description:\n 'You have made too many requests recently. Please wait a moment before trying again.',\n },\n REQUIRES_VERIFICATION: {\n title: 'Verification Required',\n description:\n 'You need to verify your account before you can continue. Please check your email or phone.',\n },\n UNAUTHORIZED: {\n title: 'Unauthorized',\n description:\n 'You are not authorized to perform this action. Please sign in again.',\n },\n ACCESS_DENIED: {\n title: 'Access Denied',\n description:\n 'You do not have permission to access this resource. Please contact support if you believe this is an error.',\n },\n HAS_NO_PASSWORD: {\n title: 'No Password Set',\n description:\n 'Your account does not have a password yet. Continue to set a password before signing in.',\n },\n PASSWORD_ALREADY_SET: {\n title: 'Password Already Set',\n description:\n 'This account already has a password. Use the normal sign-in form instead.',\n },\n};\n\nexport const validCodes = Object.keys(AUTH_ERROR_MAPPING);\n","import { AUTH_ERROR_MAPPING, validCodes } from '../constants/auth.error.codes';\nimport type { AuthError } from '../types';\n\nexport type AuthErrorContent = {\n title: string;\n description: string;\n};\n\ntype TranslatorFunction = (\n key: string,\n params?: Record<string, string | number>,\n) => string;\n\n// Type guard to check if error is an AuthError\nfunction isAuthError(err: unknown): err is AuthError {\n return (\n typeof err === 'object' &&\n err !== null &&\n 'message' in err &&\n typeof (err as { message: unknown }).message === 'string'\n );\n}\n\nfunction extractErrorCode(err: AuthError): string {\n if (err.code && validCodes.includes(err.code)) {\n return err.code;\n }\n if (err.message) {\n const messageUpper = err.message.toUpperCase().trim();\n if (validCodes.includes(messageUpper)) {\n return messageUpper;\n }\n }\n return '';\n}\n\nfunction sanitizeErrorMessage(message: string): string {\n const lowerMessage = message.toLowerCase();\n const isDatabaseError =\n lowerMessage.includes('failed query') ||\n lowerMessage.includes('select') ||\n lowerMessage.includes('insert') ||\n lowerMessage.includes('update') ||\n lowerMessage.includes('delete') ||\n lowerMessage.includes('from') ||\n lowerMessage.includes('where') ||\n lowerMessage.includes('limit') ||\n lowerMessage.includes('params:') ||\n lowerMessage.includes('query') ||\n message.includes('\"iam\".') ||\n message.includes('\"tenants\"') ||\n message.includes('\"users\"') ||\n message.includes('\"sessions\"') ||\n message.includes('\"accounts\"') ||\n lowerMessage.includes('relation') ||\n lowerMessage.includes('column') ||\n lowerMessage.includes('syntax error') ||\n lowerMessage.includes('database') ||\n lowerMessage.includes('postgres') ||\n lowerMessage.includes('sql');\n\n if (isDatabaseError) {\n return 'An error occurred while processing your request';\n }\n\n return message;\n}\n\nfunction handleAuthError(\n err: AuthError,\n setError: (error: AuthErrorContent | null) => void,\n t: TranslatorFunction,\n) {\n const errorCode = extractErrorCode(err);\n\n if (errorCode && AUTH_ERROR_MAPPING[errorCode]) {\n const mapping = AUTH_ERROR_MAPPING[errorCode];\n setError({\n title: mapping.title,\n description: mapping.description,\n });\n return;\n }\n\n const sanitizedMessage = sanitizeErrorMessage(\n err.message || t('errors.fallback'),\n );\n setError({\n title: t('errors.fallback'),\n description: sanitizedMessage,\n });\n}\n\nfunction handleGenericError(\n err: unknown,\n setError: (error: AuthErrorContent | null) => void,\n t: TranslatorFunction,\n) {\n const rawMessage = err instanceof Error ? err.message : t('errors.fallback');\n const sanitizedMessage = sanitizeErrorMessage(rawMessage);\n setError({\n title: 'Error',\n description: sanitizedMessage,\n });\n}\n\nexport const handleError = (\n err: unknown,\n setError: (error: AuthErrorContent | null) => void,\n t: TranslatorFunction,\n) => {\n if (isAuthError(err)) {\n handleAuthError(err, setError, t);\n } else {\n handleGenericError(err, setError, t);\n }\n};\n","'use client';\n\nimport type { ReactNode } from 'react';\n\ntype AuthLayoutProps = {\n title: ReactNode;\n description?: string;\n children: ReactNode;\n footer?: ReactNode;\n logoImage?: string;\n};\n\nexport const AuthLayout = ({\n title,\n description,\n children,\n footer,\n logoImage,\n}: AuthLayoutProps) => {\n return (\n <div className=\"space-y-4\">\n <div className=\"flex size-8 mb-6 w-full items-center justify-center rounded-md\">\n {/** biome-ignore lint/performance/noImgElement: logo image */}\n <img\n src={logoImage || ''}\n alt={title as string}\n width={42}\n height={42}\n />\n </div>\n <div className=\"text-center\">\n <h1 className=\"text-2xl font-bold tracking-tight\">{title}</h1>\n {description && (\n <p className=\"mt-2 text-sm text-muted-foreground\">{description}</p>\n )}\n </div>\n\n {children}\n\n {footer && (\n <div className=\"mt-2 w-full\">\n <div className=\"w-full text-center text-sm text-muted-foreground\">\n {footer}\n </div>\n </div>\n )}\n </div>\n );\n};\n","'use client';\n\nimport { zodResolver } from '@hookform/resolvers/zod';\nimport {\n Button,\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n} from '@mesob/ui/components';\nimport { useForm } from 'react-hook-form';\nimport { z } from 'zod';\nimport { useTranslator } from '../../hooks/use-translator';\nimport type { AuthErrorContent } from '../../utils/handle-error';\nimport { Countdown } from './countdown';\n\ntype VerificationFormValues = {\n code: string;\n};\n\ntype VerificationFormProps = {\n verificationId: string;\n onSubmit: (values: VerificationFormValues) => Promise<void> | void;\n onResend: () => Promise<void> | void;\n isLoading?: boolean;\n error?: AuthErrorContent | string | null;\n};\n\nconst verificationSchema = (t: (key: string) => string) =>\n z.object({\n code: z.string().length(6, t('form.codeLength')),\n });\n\nexport const VerificationForm = ({\n onSubmit,\n onResend,\n isLoading = false,\n}: VerificationFormProps) => {\n const t = useTranslator('Auth.verification');\n const form = useForm<VerificationFormValues>({\n resolver: zodResolver(verificationSchema(t)),\n defaultValues: { code: '' },\n });\n\n const handleSubmit = form.handleSubmit(async (values) => {\n await onSubmit(values);\n });\n\n const codeLength = form.watch('code').length;\n\n return (\n <Form {...form}>\n <form\n id=\"verification-form\"\n onSubmit={handleSubmit}\n className=\"space-y-4\"\n >\n <FormField\n control={form.control}\n name=\"code\"\n render={({ field }) => (\n <FormItem>\n <div className=\"flex justify-center\">\n <FormLabel>{t('form.codeLabel')}</FormLabel>\n </div>\n <FormControl>\n <InputOTP\n maxLength={6}\n required\n value={field.value ?? ''}\n onChange={field.onChange}\n onBlur={field.onBlur}\n containerClassName=\"gap-4 justify-center mb-2 flex items-center\"\n >\n <InputOTPGroup className=\"gap-3 *:data-[slot=input-otp-slot]:h-12 *:data-[slot=input-otp-slot]:w-12 *:data-[slot=input-otp-slot]:rounded-md *:data-[slot=input-otp-slot]:border *:data-[slot=input-otp-slot]:text-xl\">\n <InputOTPSlot className=\"h-12\" index={0} />\n <InputOTPSlot className=\"h-12\" index={1} />\n <InputOTPSlot className=\"h-12\" index={2} />\n <InputOTPSlot className=\"h-12\" index={3} />\n <InputOTPSlot className=\"h-12\" index={4} />\n <InputOTPSlot className=\"h-12\" index={5} />\n </InputOTPGroup>\n </InputOTP>\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n <Button\n type=\"submit\"\n form=\"verification-form\"\n className=\"w-full\"\n disabled={isLoading || codeLength !== 6}\n loading={isLoading}\n >\n {t('form.confirm')}\n </Button>\n <div className=\"flex justify-center\">\n <Countdown onResend={onResend} resending={isLoading} />\n </div>\n </form>\n </Form>\n );\n};\n","'use client';\n\nimport { Spinner } from '@mesob/ui/components';\nimport { useEffect, useState } from 'react';\nimport { useTranslator } from '../../hooks/use-translator';\n\ntype CountdownProps = {\n initialSeconds?: number;\n onResend: () => Promise<void> | void;\n resending?: boolean;\n};\n\nexport const Countdown = ({\n initialSeconds = 60,\n onResend,\n resending = false,\n}: CountdownProps) => {\n const t = useTranslator('Common');\n const [seconds, setSeconds] = useState(initialSeconds);\n const [isResending, setIsResending] = useState(false);\n\n useEffect(() => {\n if (seconds <= 0) {\n return;\n }\n const timer = setInterval(() => {\n setSeconds((prev) => {\n if (prev <= 1) {\n clearInterval(timer);\n return 0;\n }\n return prev - 1;\n });\n }, 1000);\n return () => clearInterval(timer);\n }, [seconds]);\n\n const handleResend = async () => {\n setIsResending(true);\n try {\n await onResend();\n setSeconds(initialSeconds);\n } catch (_error) {\n // handled by parent\n } finally {\n setIsResending(false);\n }\n };\n\n const busy = isResending || resending;\n\n if (seconds > 0) {\n return (\n <p className=\"text-sm text-muted-foreground\">\n {t('resendIn', { seconds })}\n </p>\n );\n }\n\n return (\n <button\n type=\"button\"\n onClick={handleResend}\n disabled={busy}\n className=\"text-sm text-primary hover:underline disabled:opacity-50 flex items-center gap-1\"\n >\n {busy && <Spinner className=\"h-3 w-3\" />}\n {t('resend')}\n </button>\n );\n};\n"],"mappings":";;;AA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AAM,YAAY,WAAU,gCAC/B,iBAAO,cAAc,GACxB,IAEA,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,SAAS,CAAC,MAAM;AACd,cAAE,eAAe;AACjB,uBAAW,UAAU;AAAA,UACvB;AAAA,UACA,WAAU;AAAA,UAET,iBAAO,cAAc;AAAA;AAAA,MACxB;AAAA,MAIJ;AAAA,wBAAAA;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,UAAU;AAAA,YACV,UAAU;AAAA,YACV,WACE,aACA,oBAAoB,aACpB,qBAAqB;AAAA,YAEvB;AAAA;AAAA,QACF;AAAA,QACC,gBACC,gBAAAC,MAAC,SAAM,SAAQ,eAAc,WAAU,QACrC;AAAA,0BAAAD,KAAC,mBAAgB,WAAU,WAAU;AAAA,UACrC,gBAAAA,KAAC,cAAY,uBAAa,OAAM;AAAA,UAChC,gBAAAA,KAAC,oBAAkB,uBAAa,aAAY;AAAA,WAC9C;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":["useMesob","useEffect","useState","jsx","useState","jsx","jsxs","useState","jsx","jsxs","jsx","jsxs","useMesob","useState","useEffect"]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,11 +1,8 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode } from 'react';
3
-
1
+ import type { ReactNode } from 'react';
4
2
  type DenyProps = {
5
3
  permissions: readonly string[];
6
4
  userPermissions?: readonly string[] | null;
7
5
  children: ReactNode;
8
6
  };
9
- declare function Deny({ permissions, userPermissions, children }: DenyProps): react_jsx_runtime.JSX.Element | null;
10
-
11
- export { Deny };
7
+ export declare function Deny({ permissions, userPermissions, children }: DenyProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export {};