@mesob/auth-react 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/components/auth/auth-layout.d.ts +1 -1
  2. package/dist/components/auth/auth-layout.js +10 -2
  3. package/dist/components/auth/auth-layout.js.map +1 -1
  4. package/dist/components/auth/countdown.js +8 -6
  5. package/dist/components/auth/countdown.js.map +1 -1
  6. package/dist/components/auth/forgot-password.js +21 -19
  7. package/dist/components/auth/forgot-password.js.map +1 -1
  8. package/dist/components/auth/reset-password-form.js +22 -21
  9. package/dist/components/auth/reset-password-form.js.map +1 -1
  10. package/dist/components/auth/set-password.d.ts +9 -0
  11. package/dist/components/auth/set-password.js +527 -0
  12. package/dist/components/auth/set-password.js.map +1 -0
  13. package/dist/components/auth/sign-in.js +45 -26
  14. package/dist/components/auth/sign-in.js.map +1 -1
  15. package/dist/components/auth/sign-up.js +25 -29
  16. package/dist/components/auth/sign-up.js.map +1 -1
  17. package/dist/components/auth/verification-form.js +24 -27
  18. package/dist/components/auth/verification-form.js.map +1 -1
  19. package/dist/components/auth/verify-email.js +40 -31
  20. package/dist/components/auth/verify-email.js.map +1 -1
  21. package/dist/components/auth/verify-phone.js +40 -31
  22. package/dist/components/auth/verify-phone.js.map +1 -1
  23. package/dist/components/authorization/deny.d.ts +11 -0
  24. package/dist/components/authorization/deny.js +52 -0
  25. package/dist/components/authorization/deny.js.map +1 -0
  26. package/dist/components/authorization/grant.d.ts +12 -0
  27. package/dist/components/authorization/grant.js +57 -0
  28. package/dist/components/authorization/grant.js.map +1 -0
  29. package/dist/components/iam/permission-selector.d.ts +19 -0
  30. package/dist/components/iam/permission-selector.js +122 -0
  31. package/dist/components/iam/permission-selector.js.map +1 -0
  32. package/dist/components/iam/permissions.js +21 -33
  33. package/dist/components/iam/permissions.js.map +1 -1
  34. package/dist/components/iam/role-detail-layout.d.ts +11 -0
  35. package/dist/components/iam/role-detail-layout.js +137 -0
  36. package/dist/components/iam/role-detail-layout.js.map +1 -0
  37. package/dist/components/iam/role-detail-page.d.ts +9 -0
  38. package/dist/components/iam/role-detail-page.js +229 -0
  39. package/dist/components/iam/role-detail-page.js.map +1 -0
  40. package/dist/components/iam/role-permissions-page.d.ts +8 -0
  41. package/dist/components/iam/role-permissions-page.js +397 -0
  42. package/dist/components/iam/role-permissions-page.js.map +1 -0
  43. package/dist/components/iam/roles.js +20 -10
  44. package/dist/components/iam/roles.js.map +1 -1
  45. package/dist/components/iam/tenants.js +9 -2
  46. package/dist/components/iam/tenants.js.map +1 -1
  47. package/dist/components/iam/users.js +10 -9
  48. package/dist/components/iam/users.js.map +1 -1
  49. package/dist/components/profile/account.js +110 -19
  50. package/dist/components/profile/account.js.map +1 -1
  51. package/dist/components/profile/change-email-form.js +26 -29
  52. package/dist/components/profile/change-email-form.js.map +1 -1
  53. package/dist/components/profile/change-phone-form.js +26 -29
  54. package/dist/components/profile/change-phone-form.js.map +1 -1
  55. package/dist/components/profile/change-profile.d.ts +2 -1
  56. package/dist/components/profile/change-profile.js +16 -8
  57. package/dist/components/profile/change-profile.js.map +1 -1
  58. package/dist/components/profile/otp-verification-modal.js +24 -27
  59. package/dist/components/profile/otp-verification-modal.js.map +1 -1
  60. package/dist/components/profile/security.js +88 -57
  61. package/dist/components/profile/security.js.map +1 -1
  62. package/dist/components/profile/verify-change-email-form.js +24 -27
  63. package/dist/components/profile/verify-change-email-form.js.map +1 -1
  64. package/dist/components/profile/verify-change-phone-form.js +24 -27
  65. package/dist/components/profile/verify-change-phone-form.js.map +1 -1
  66. package/dist/index.d.ts +9 -1
  67. package/dist/index.js +1897 -821
  68. package/dist/index.js.map +1 -1
  69. package/dist/pages/auth/forgot-password.d.ts +7 -0
  70. package/dist/pages/auth/forgot-password.js +784 -0
  71. package/dist/pages/auth/forgot-password.js.map +1 -0
  72. package/dist/pages/auth/layout.d.ts +8 -0
  73. package/dist/pages/auth/layout.js +562 -0
  74. package/dist/pages/auth/layout.js.map +1 -0
  75. package/dist/pages/auth/reset-password.d.ts +10 -0
  76. package/dist/pages/auth/reset-password.js +913 -0
  77. package/dist/pages/auth/reset-password.js.map +1 -0
  78. package/dist/pages/auth/set-password.d.ts +10 -0
  79. package/dist/pages/auth/set-password.js +946 -0
  80. package/dist/pages/auth/set-password.js.map +1 -0
  81. package/dist/pages/auth/sign-in.d.ts +10 -0
  82. package/dist/pages/auth/sign-in.js +984 -0
  83. package/dist/pages/auth/sign-in.js.map +1 -0
  84. package/dist/pages/auth/sign-up.d.ts +10 -0
  85. package/dist/pages/auth/sign-up.js +940 -0
  86. package/dist/pages/auth/sign-up.js.map +1 -0
  87. package/dist/pages/auth/verify-email.d.ts +10 -0
  88. package/dist/pages/auth/verify-email.js +950 -0
  89. package/dist/pages/auth/verify-email.js.map +1 -0
  90. package/dist/pages/auth/verify-phone.d.ts +10 -0
  91. package/dist/pages/auth/verify-phone.js +964 -0
  92. package/dist/pages/auth/verify-phone.js.map +1 -0
  93. package/dist/pages/iam/permissions.d.ts +5 -0
  94. package/dist/pages/iam/permissions.js +308 -0
  95. package/dist/pages/iam/permissions.js.map +1 -0
  96. package/dist/pages/iam/role-detail-layout.d.ts +12 -0
  97. package/dist/pages/iam/role-detail-layout.js +145 -0
  98. package/dist/pages/iam/role-detail-layout.js.map +1 -0
  99. package/dist/pages/iam/role-detail.d.ts +12 -0
  100. package/dist/pages/iam/role-detail.js +241 -0
  101. package/dist/pages/iam/role-detail.js.map +1 -0
  102. package/dist/pages/iam/role-permissions.d.ts +12 -0
  103. package/dist/pages/iam/role-permissions.js +409 -0
  104. package/dist/pages/iam/role-permissions.js.map +1 -0
  105. package/dist/pages/iam/role-users.d.ts +12 -0
  106. package/dist/pages/iam/role-users.js +825 -0
  107. package/dist/pages/iam/role-users.js.map +1 -0
  108. package/dist/pages/iam/roles.d.ts +5 -0
  109. package/dist/pages/iam/roles.js +684 -0
  110. package/dist/pages/iam/roles.js.map +1 -0
  111. package/dist/pages/iam/sessions.d.ts +5 -0
  112. package/dist/pages/iam/sessions.js +315 -0
  113. package/dist/pages/iam/sessions.js.map +1 -0
  114. package/dist/pages/iam/tenant-detail.d.ts +10 -0
  115. package/dist/pages/iam/tenant-detail.js +186 -0
  116. package/dist/pages/iam/tenant-detail.js.map +1 -0
  117. package/dist/pages/iam/tenants.d.ts +5 -0
  118. package/dist/pages/iam/tenants.js +610 -0
  119. package/dist/pages/iam/tenants.js.map +1 -0
  120. package/dist/pages/iam/user-activity.d.ts +10 -0
  121. package/dist/pages/iam/user-activity.js +850 -0
  122. package/dist/pages/iam/user-activity.js.map +1 -0
  123. package/dist/pages/iam/user-detail-layout.d.ts +12 -0
  124. package/dist/pages/iam/user-detail-layout.js +106 -0
  125. package/dist/pages/iam/user-detail-layout.js.map +1 -0
  126. package/dist/pages/iam/user-detail.d.ts +10 -0
  127. package/dist/pages/iam/user-detail.js +102 -0
  128. package/dist/pages/iam/user-detail.js.map +1 -0
  129. package/dist/pages/iam/users.d.ts +5 -0
  130. package/dist/pages/iam/users.js +1275 -0
  131. package/dist/pages/iam/users.js.map +1 -0
  132. package/dist/pages/profile/account.d.ts +5 -0
  133. package/dist/pages/profile/account.js +182 -0
  134. package/dist/pages/profile/account.js.map +1 -0
  135. package/dist/pages/profile/layout.d.ts +8 -0
  136. package/dist/pages/profile/layout.js +133 -0
  137. package/dist/pages/profile/layout.js.map +1 -0
  138. package/dist/pages/profile/security.d.ts +5 -0
  139. package/dist/pages/profile/security.js +1539 -0
  140. package/dist/pages/profile/security.js.map +1 -0
  141. package/dist/{types-vcfvnAzQ.d.ts → types-g9QcNRxT.d.ts} +13 -7
  142. package/package.json +102 -3
@@ -0,0 +1,950 @@
1
+ // src/components/auth/auth-card.tsx
2
+ import { Card } from "@mesob/ui/components";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ // src/components/auth/forgot-password.tsx
6
+ import { zodResolver } from "@hookform/resolvers/zod";
7
+ import {
8
+ Alert,
9
+ AlertDescription,
10
+ AlertTitle,
11
+ Button,
12
+ Form,
13
+ FormControl,
14
+ FormField,
15
+ FormItem,
16
+ FormLabel,
17
+ FormMessage,
18
+ Input
19
+ } from "@mesob/ui/components";
20
+ import { useMesob as useMesob2 } from "@mesob/ui/providers";
21
+ import { IconAlertCircle } from "@tabler/icons-react";
22
+ import { useEffect, useState as useState2 } from "react";
23
+ import { useForm } from "react-hook-form";
24
+ import { toast } from "sonner";
25
+ import { z } from "zod";
26
+
27
+ // src/hooks/use-translator.ts
28
+ import { useMesob } from "@mesob/ui/providers";
29
+
30
+ // src/lib/translations.ts
31
+ function createTranslator(messages, namespace) {
32
+ return (key, params) => {
33
+ const fullKey = namespace ? `${namespace}.${key}` : key;
34
+ const keys = fullKey.split(".");
35
+ let value = messages;
36
+ for (const k of keys) {
37
+ if (value && typeof value === "object" && value !== null) {
38
+ value = value[k];
39
+ } else {
40
+ return fullKey;
41
+ }
42
+ }
43
+ if (typeof value !== "string") {
44
+ return fullKey;
45
+ }
46
+ if (params) {
47
+ return value.replace(
48
+ /\{(\w+)\}/g,
49
+ (_, param) => String(params[param] ?? `{${param}}`)
50
+ );
51
+ }
52
+ return value;
53
+ };
54
+ }
55
+
56
+ // src/provider.tsx
57
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
58
+ import { deepmerge } from "deepmerge-ts";
59
+ import createFetchClient from "openapi-fetch";
60
+ import createClient from "openapi-react-query";
61
+ import { createContext, useContext, useMemo, useState } from "react";
62
+
63
+ // src/utils/cookie.ts
64
+ var isProduction = typeof process !== "undefined" && process.env.NODE_ENV === "production";
65
+
66
+ // src/provider.tsx
67
+ import { jsx as jsx2 } from "react/jsx-runtime";
68
+ var SessionContext = createContext(null);
69
+ var ApiContext = createContext(null);
70
+ var ConfigContext = createContext(null);
71
+ var queryClient = new QueryClient({
72
+ defaultOptions: {
73
+ queries: {
74
+ refetchOnWindowFocus: false
75
+ }
76
+ }
77
+ });
78
+ function useApi() {
79
+ const context = useContext(ApiContext);
80
+ if (!context) {
81
+ throw new Error("useApi must be used within MesobAuthProvider");
82
+ }
83
+ return context;
84
+ }
85
+ function useConfig() {
86
+ const context = useContext(ConfigContext);
87
+ if (!context) {
88
+ throw new Error("useConfig must be used within MesobAuthProvider");
89
+ }
90
+ return context;
91
+ }
92
+
93
+ // src/hooks/use-translator.ts
94
+ function useTranslator(namespace) {
95
+ const mesob = useMesob();
96
+ const { config } = useConfig();
97
+ if (mesob?.t) {
98
+ return (key, params) => {
99
+ const fullKey = namespace ? `${namespace}.${key}` : key;
100
+ return mesob.t?.(fullKey, params) ?? fullKey;
101
+ };
102
+ }
103
+ return createTranslator(config.messages || {}, namespace);
104
+ }
105
+
106
+ // src/constants/auth.error.codes.ts
107
+ var AUTH_ERROR_MAPPING = {
108
+ USER_NOT_FOUND: {
109
+ title: "Account Not Found",
110
+ description: "We could not find an account with that identifier. Please check your spelling or sign up."
111
+ },
112
+ INVALID_PASSWORD: {
113
+ title: "Invalid Password",
114
+ description: "The password you entered is incorrect. Please try again."
115
+ },
116
+ USER_EXISTS: {
117
+ title: "Account Already Exists",
118
+ description: "An account with this identifier already exists. Please sign in instead."
119
+ },
120
+ VERIFICATION_EXPIRED: {
121
+ title: "Verification Expired",
122
+ description: "The verification code or link has expired. Please request a new one."
123
+ },
124
+ VERIFICATION_MISMATCH: {
125
+ title: "Invalid Code",
126
+ description: "The verification code you entered is invalid. Please double-check and try again."
127
+ },
128
+ VERIFICATION_NOT_FOUND: {
129
+ title: "Verification Not Found",
130
+ description: "We could not find a pending verification request. Please restart the process."
131
+ },
132
+ TOO_MANY_ATTEMPTS: {
133
+ title: "Too Many Attempts",
134
+ description: "You have made too many requests recently. Please wait a moment before trying again."
135
+ },
136
+ REQUIRES_VERIFICATION: {
137
+ title: "Verification Required",
138
+ description: "You need to verify your account before you can continue. Please check your email or phone."
139
+ },
140
+ UNAUTHORIZED: {
141
+ title: "Unauthorized",
142
+ description: "You are not authorized to perform this action. Please sign in again."
143
+ },
144
+ ACCESS_DENIED: {
145
+ title: "Access Denied",
146
+ description: "You do not have permission to access this resource. Please contact support if you believe this is an error."
147
+ },
148
+ HAS_NO_PASSWORD: {
149
+ title: "No Password Set",
150
+ description: "Your account does not have a password yet. Continue to set a password before signing in."
151
+ },
152
+ PASSWORD_ALREADY_SET: {
153
+ title: "Password Already Set",
154
+ description: "This account already has a password. Use the normal sign-in form instead."
155
+ }
156
+ };
157
+ var validCodes = Object.keys(AUTH_ERROR_MAPPING);
158
+
159
+ // src/utils/handle-error.ts
160
+ function isAuthError(err) {
161
+ return typeof err === "object" && err !== null && "message" in err && typeof err.message === "string";
162
+ }
163
+ function extractErrorCode(err) {
164
+ if (err.code && validCodes.includes(err.code)) {
165
+ return err.code;
166
+ }
167
+ if (err.message) {
168
+ const messageUpper = err.message.toUpperCase().trim();
169
+ if (validCodes.includes(messageUpper)) {
170
+ return messageUpper;
171
+ }
172
+ }
173
+ return "";
174
+ }
175
+ function sanitizeErrorMessage(message) {
176
+ const lowerMessage = message.toLowerCase();
177
+ 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");
178
+ if (isDatabaseError) {
179
+ return "An error occurred while processing your request";
180
+ }
181
+ return message;
182
+ }
183
+ function handleAuthError(err, setError, t) {
184
+ const errorCode = extractErrorCode(err);
185
+ if (errorCode && AUTH_ERROR_MAPPING[errorCode]) {
186
+ const mapping = AUTH_ERROR_MAPPING[errorCode];
187
+ setError({
188
+ title: mapping.title,
189
+ description: mapping.description
190
+ });
191
+ return;
192
+ }
193
+ const sanitizedMessage = sanitizeErrorMessage(
194
+ err.message || t("errors.fallback")
195
+ );
196
+ setError({
197
+ title: t("errors.fallback"),
198
+ description: sanitizedMessage
199
+ });
200
+ }
201
+ function handleGenericError(err, setError, t) {
202
+ const rawMessage = err instanceof Error ? err.message : t("errors.fallback");
203
+ const sanitizedMessage = sanitizeErrorMessage(rawMessage);
204
+ setError({
205
+ title: "Error",
206
+ description: sanitizedMessage
207
+ });
208
+ }
209
+ var handleError = (err, setError, t) => {
210
+ if (isAuthError(err)) {
211
+ handleAuthError(err, setError, t);
212
+ } else {
213
+ handleGenericError(err, setError, t);
214
+ }
215
+ };
216
+
217
+ // src/components/auth/auth-layout.tsx
218
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
219
+ var AuthLayout = ({
220
+ title,
221
+ description,
222
+ children,
223
+ footer,
224
+ logoImage
225
+ }) => {
226
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
227
+ /* @__PURE__ */ jsx3("div", { className: "flex size-8 mb-6 w-full items-center justify-center rounded-md", children: /* @__PURE__ */ jsx3(
228
+ "img",
229
+ {
230
+ src: logoImage || "",
231
+ alt: title,
232
+ width: 42,
233
+ height: 42
234
+ }
235
+ ) }),
236
+ /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
237
+ /* @__PURE__ */ jsx3("h1", { className: "text-2xl font-bold tracking-tight", children: title }),
238
+ description && /* @__PURE__ */ jsx3("p", { className: "mt-2 text-sm text-muted-foreground", children: description })
239
+ ] }),
240
+ children,
241
+ footer && /* @__PURE__ */ jsx3("div", { className: "mt-2 w-full", children: /* @__PURE__ */ jsx3("div", { className: "w-full text-center text-sm text-muted-foreground", children: footer }) })
242
+ ] });
243
+ };
244
+
245
+ // src/components/auth/forgot-password.tsx
246
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
247
+
248
+ // src/components/auth/reset-password-form.tsx
249
+ import { zodResolver as zodResolver2 } from "@hookform/resolvers/zod";
250
+ import {
251
+ Alert as Alert2,
252
+ AlertDescription as AlertDescription2,
253
+ AlertTitle as AlertTitle2,
254
+ Button as Button2,
255
+ Form as Form2,
256
+ FormControl as FormControl2,
257
+ FormField as FormField2,
258
+ FormItem as FormItem2,
259
+ FormLabel as FormLabel2,
260
+ FormMessage as FormMessage2,
261
+ Input as Input2,
262
+ InputOTP,
263
+ InputOTPGroup,
264
+ InputOTPSlot,
265
+ useFormField
266
+ } from "@mesob/ui/components";
267
+ import { useMesob as useMesob3 } from "@mesob/ui/providers";
268
+ import { IconAlertCircle as IconAlertCircle2, IconEye, IconEyeOff } from "@tabler/icons-react";
269
+ import { useEffect as useEffect2, useState as useState3 } from "react";
270
+ import { useForm as useForm2 } from "react-hook-form";
271
+ import { toast as toast2 } from "sonner";
272
+ import { z as z2 } from "zod";
273
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
274
+
275
+ // src/components/auth/set-password.tsx
276
+ import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
277
+ import {
278
+ Alert as Alert3,
279
+ AlertDescription as AlertDescription3,
280
+ AlertTitle as AlertTitle3,
281
+ Button as Button3,
282
+ Form as Form3,
283
+ FormControl as FormControl3,
284
+ FormField as FormField3,
285
+ FormItem as FormItem3,
286
+ FormLabel as FormLabel3,
287
+ FormMessage as FormMessage3,
288
+ Input as Input3,
289
+ useFormField as useFormField2
290
+ } from "@mesob/ui/components";
291
+ import { useMesob as useMesob4 } from "@mesob/ui/providers";
292
+ import { IconAlertCircle as IconAlertCircle3, IconEye as IconEye2, IconEyeOff as IconEyeOff2 } from "@tabler/icons-react";
293
+ import { useEffect as useEffect3, useEffectEvent, useState as useState4 } from "react";
294
+ import { useForm as useForm3 } from "react-hook-form";
295
+ import { toast as toast3 } from "sonner";
296
+ import { z as z3 } from "zod";
297
+ import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
298
+
299
+ // src/components/auth/sign-in.tsx
300
+ import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
301
+ import {
302
+ Alert as Alert4,
303
+ AlertDescription as AlertDescription4,
304
+ AlertTitle as AlertTitle4,
305
+ Button as Button4,
306
+ Form as Form4,
307
+ FormControl as FormControl4,
308
+ FormField as FormField4,
309
+ FormItem as FormItem4,
310
+ FormLabel as FormLabel4,
311
+ FormMessage as FormMessage4,
312
+ Input as Input4,
313
+ useFormField as useFormField3
314
+ } from "@mesob/ui/components";
315
+ import { useMesob as useMesob5 } from "@mesob/ui/providers";
316
+ import { IconAlertCircle as IconAlertCircle4, IconEye as IconEye3, IconEyeOff as IconEyeOff3 } from "@tabler/icons-react";
317
+ import { useEffect as useEffect4, useState as useState5 } from "react";
318
+ import { useForm as useForm4 } from "react-hook-form";
319
+ import { toast as toast4 } from "sonner";
320
+ import { z as z4 } from "zod";
321
+ import { Fragment, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
322
+
323
+ // src/components/auth/sign-up.tsx
324
+ import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
325
+ import {
326
+ Alert as Alert5,
327
+ AlertDescription as AlertDescription5,
328
+ AlertTitle as AlertTitle5,
329
+ Button as Button5,
330
+ Form as Form5,
331
+ FormControl as FormControl5,
332
+ FormField as FormField5,
333
+ FormItem as FormItem5,
334
+ FormLabel as FormLabel5,
335
+ FormMessage as FormMessage5,
336
+ Input as Input5,
337
+ useFormField as useFormField4
338
+ } from "@mesob/ui/components";
339
+ import { useMesob as useMesob6 } from "@mesob/ui/providers";
340
+ import { IconAlertCircle as IconAlertCircle5, IconEye as IconEye4, IconEyeOff as IconEyeOff4 } from "@tabler/icons-react";
341
+ import { useEffect as useEffect5, useState as useState6 } from "react";
342
+ import { useForm as useForm5 } from "react-hook-form";
343
+ import { toast as toast5 } from "sonner";
344
+ import { z as z5 } from "zod";
345
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
346
+
347
+ // src/components/auth/verification-form.tsx
348
+ import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
349
+ import {
350
+ Button as Button6,
351
+ Form as Form6,
352
+ FormControl as FormControl6,
353
+ FormField as FormField6,
354
+ FormItem as FormItem6,
355
+ FormLabel as FormLabel6,
356
+ FormMessage as FormMessage6,
357
+ InputOTP as InputOTP2,
358
+ InputOTPGroup as InputOTPGroup2,
359
+ InputOTPSlot as InputOTPSlot2
360
+ } from "@mesob/ui/components";
361
+ import { useForm as useForm6 } from "react-hook-form";
362
+ import { z as z6 } from "zod";
363
+
364
+ // src/components/auth/countdown.tsx
365
+ import { Spinner } from "@mesob/ui/components";
366
+ import { useEffect as useEffect6, useState as useState7 } from "react";
367
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
368
+ var Countdown = ({
369
+ initialSeconds = 60,
370
+ onResend,
371
+ resending = false
372
+ }) => {
373
+ const t = useTranslator("Common");
374
+ const [seconds, setSeconds] = useState7(initialSeconds);
375
+ const [isResending, setIsResending] = useState7(false);
376
+ useEffect6(() => {
377
+ if (seconds <= 0) {
378
+ return;
379
+ }
380
+ const timer = setInterval(() => {
381
+ setSeconds((prev) => {
382
+ if (prev <= 1) {
383
+ clearInterval(timer);
384
+ return 0;
385
+ }
386
+ return prev - 1;
387
+ });
388
+ }, 1e3);
389
+ return () => clearInterval(timer);
390
+ }, [seconds]);
391
+ const handleResend = async () => {
392
+ setIsResending(true);
393
+ try {
394
+ await onResend();
395
+ setSeconds(initialSeconds);
396
+ } catch (_error) {
397
+ } finally {
398
+ setIsResending(false);
399
+ }
400
+ };
401
+ const busy = isResending || resending;
402
+ if (seconds > 0) {
403
+ return /* @__PURE__ */ jsx9("p", { className: "text-sm text-muted-foreground", children: t("resendIn", { seconds }) });
404
+ }
405
+ return /* @__PURE__ */ jsxs7(
406
+ "button",
407
+ {
408
+ type: "button",
409
+ onClick: handleResend,
410
+ disabled: busy,
411
+ className: "text-sm text-primary hover:underline disabled:opacity-50 flex items-center gap-1",
412
+ children: [
413
+ busy && /* @__PURE__ */ jsx9(Spinner, { className: "h-3 w-3" }),
414
+ t("resend")
415
+ ]
416
+ }
417
+ );
418
+ };
419
+
420
+ // src/components/auth/verification-form.tsx
421
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
422
+ var verificationSchema = (t) => z6.object({
423
+ code: z6.string().length(6, t("form.codeLength"))
424
+ });
425
+ var VerificationForm = ({
426
+ onSubmit,
427
+ onResend,
428
+ isLoading = false
429
+ }) => {
430
+ const t = useTranslator("Auth.verification");
431
+ const form = useForm6({
432
+ resolver: zodResolver6(verificationSchema(t)),
433
+ defaultValues: { code: "" }
434
+ });
435
+ const handleSubmit = form.handleSubmit(async (values) => {
436
+ await onSubmit(values);
437
+ });
438
+ const codeLength = form.watch("code").length;
439
+ return /* @__PURE__ */ jsx10(Form6, { ...form, children: /* @__PURE__ */ jsxs8(
440
+ "form",
441
+ {
442
+ id: "verification-form",
443
+ onSubmit: handleSubmit,
444
+ className: "space-y-4",
445
+ children: [
446
+ /* @__PURE__ */ jsx10(
447
+ FormField6,
448
+ {
449
+ control: form.control,
450
+ name: "code",
451
+ render: ({ field }) => /* @__PURE__ */ jsxs8(FormItem6, { children: [
452
+ /* @__PURE__ */ jsx10("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx10(FormLabel6, { children: t("form.codeLabel") }) }),
453
+ /* @__PURE__ */ jsx10(FormControl6, { children: /* @__PURE__ */ jsx10(
454
+ InputOTP2,
455
+ {
456
+ maxLength: 6,
457
+ required: true,
458
+ value: field.value ?? "",
459
+ onChange: field.onChange,
460
+ onBlur: field.onBlur,
461
+ containerClassName: "gap-4 justify-center mb-2 flex items-center",
462
+ children: /* @__PURE__ */ jsxs8(InputOTPGroup2, { 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: [
463
+ /* @__PURE__ */ jsx10(InputOTPSlot2, { className: "h-12", index: 0 }),
464
+ /* @__PURE__ */ jsx10(InputOTPSlot2, { className: "h-12", index: 1 }),
465
+ /* @__PURE__ */ jsx10(InputOTPSlot2, { className: "h-12", index: 2 }),
466
+ /* @__PURE__ */ jsx10(InputOTPSlot2, { className: "h-12", index: 3 }),
467
+ /* @__PURE__ */ jsx10(InputOTPSlot2, { className: "h-12", index: 4 }),
468
+ /* @__PURE__ */ jsx10(InputOTPSlot2, { className: "h-12", index: 5 })
469
+ ] })
470
+ }
471
+ ) }),
472
+ /* @__PURE__ */ jsx10(FormMessage6, {})
473
+ ] })
474
+ }
475
+ ),
476
+ /* @__PURE__ */ jsx10(
477
+ Button6,
478
+ {
479
+ type: "submit",
480
+ form: "verification-form",
481
+ className: "w-full",
482
+ disabled: isLoading || codeLength !== 6,
483
+ loading: isLoading,
484
+ children: t("form.confirm")
485
+ }
486
+ ),
487
+ /* @__PURE__ */ jsx10("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx10(Countdown, { onResend, resending: isLoading }) })
488
+ ]
489
+ }
490
+ ) });
491
+ };
492
+
493
+ // src/components/auth/verify-email.tsx
494
+ import { Alert as Alert6, AlertDescription as AlertDescription6, AlertTitle as AlertTitle6 } from "@mesob/ui/components";
495
+ import { useMesob as useMesob7 } from "@mesob/ui/providers";
496
+ import { IconAlertCircle as IconAlertCircle6 } from "@tabler/icons-react";
497
+ import { useEffect as useEffect7, useState as useState8 } from "react";
498
+ import { toast as toast6 } from "sonner";
499
+ import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
500
+ var VerifyEmail = ({
501
+ verificationId,
502
+ email,
503
+ redirectUrl
504
+ }) => {
505
+ const { hooks, setAuth } = useApi();
506
+ const { config } = useConfig();
507
+ const mesob = useMesob7();
508
+ const t = useTranslator("Auth.verification");
509
+ const common = useTranslator("Common");
510
+ const footer = useTranslator("Auth.forgotPassword.footer");
511
+ const Link = mesob?.navigation?.Link;
512
+ const [isLoading, setIsLoading] = useState8(false);
513
+ const [error, setError] = useState8(null);
514
+ const verifyEmailMutation = hooks.useMutation(
515
+ "post",
516
+ "/email/verification/confirm"
517
+ );
518
+ const requestEmailMutation = hooks.useMutation(
519
+ "post",
520
+ "/email/verification/request"
521
+ );
522
+ const signInLink = config.navigation?.links?.signIn || "/auth/sign-in";
523
+ const onNavigate = config.navigation?.onNavigate || ((path) => {
524
+ if (typeof window !== "undefined") {
525
+ window.location.href = path;
526
+ }
527
+ });
528
+ const logoImage = config.ui.logoImage;
529
+ const defaultRedirect = redirectUrl || config.navigation?.defaultRedirectUrl || "/";
530
+ useEffect7(() => {
531
+ if (error) {
532
+ toast6.error(error.title || "Error", {
533
+ description: error.description
534
+ });
535
+ }
536
+ }, [error]);
537
+ const handleSubmit = async (values) => {
538
+ if (!verificationId) {
539
+ setError({
540
+ title: t("errors.fallback"),
541
+ description: t("errors.missingVerificationId")
542
+ });
543
+ return;
544
+ }
545
+ setIsLoading(true);
546
+ setError(null);
547
+ try {
548
+ const res = await verifyEmailMutation.mutateAsync({
549
+ body: {
550
+ verificationId,
551
+ code: values.code
552
+ }
553
+ });
554
+ if ("user" in res && "session" in res) {
555
+ setAuth(res);
556
+ }
557
+ onNavigate(defaultRedirect);
558
+ } catch (err) {
559
+ handleError(err, setError, t);
560
+ } finally {
561
+ setIsLoading(false);
562
+ }
563
+ };
564
+ const handleResend = async () => {
565
+ setError(null);
566
+ try {
567
+ const res = await requestEmailMutation.mutateAsync({
568
+ body: {
569
+ email
570
+ }
571
+ });
572
+ if (res.verificationId) {
573
+ onNavigate(
574
+ `/auth/verify-email?verificationId=${res.verificationId}&email=${encodeURIComponent(email)}`
575
+ );
576
+ } else {
577
+ setError({
578
+ title: t("errors.fallback"),
579
+ description: t("errors.resendFailed")
580
+ });
581
+ }
582
+ } catch (err) {
583
+ handleError(err, setError, t);
584
+ }
585
+ };
586
+ if (!verificationId) {
587
+ return /* @__PURE__ */ jsx11(
588
+ AuthLayout,
589
+ {
590
+ title: common("invalidLinkTitle"),
591
+ description: common("invalidLinkDescription"),
592
+ footer: Link ? /* @__PURE__ */ jsx11(Link, { href: signInLink, className: "text-primary hover:underline", children: footer("backToSignIn") }) : /* @__PURE__ */ jsx11(
593
+ "a",
594
+ {
595
+ href: signInLink,
596
+ onClick: (e) => {
597
+ e.preventDefault();
598
+ onNavigate(signInLink);
599
+ },
600
+ className: "text-primary hover:underline",
601
+ children: footer("backToSignIn")
602
+ }
603
+ ),
604
+ children: /* @__PURE__ */ jsx11("div", {})
605
+ }
606
+ );
607
+ }
608
+ let errorContent = null;
609
+ if (error) {
610
+ if (typeof error === "string") {
611
+ errorContent = { title: "Error", description: error };
612
+ } else {
613
+ errorContent = error;
614
+ }
615
+ }
616
+ return /* @__PURE__ */ jsxs9(
617
+ AuthLayout,
618
+ {
619
+ title: config.ui.name,
620
+ description: t("email.description"),
621
+ logoImage,
622
+ footer: Link ? /* @__PURE__ */ jsx11(Link, { href: signInLink, className: "text-primary hover:underline", children: footer("backToSignIn") }) : /* @__PURE__ */ jsx11(
623
+ "a",
624
+ {
625
+ href: signInLink,
626
+ onClick: (e) => {
627
+ e.preventDefault();
628
+ onNavigate(signInLink);
629
+ },
630
+ className: "text-primary hover:underline",
631
+ children: footer("backToSignIn")
632
+ }
633
+ ),
634
+ children: [
635
+ /* @__PURE__ */ jsx11(
636
+ VerificationForm,
637
+ {
638
+ verificationId,
639
+ onSubmit: handleSubmit,
640
+ onResend: handleResend,
641
+ isLoading: isLoading || verifyEmailMutation.isPending || requestEmailMutation.isPending,
642
+ error
643
+ }
644
+ ),
645
+ errorContent && /* @__PURE__ */ jsxs9(Alert6, { variant: "destructive", className: "mt-4", children: [
646
+ /* @__PURE__ */ jsx11(IconAlertCircle6, { className: "h-4 w-4" }),
647
+ /* @__PURE__ */ jsx11(AlertTitle6, { children: errorContent.title }),
648
+ /* @__PURE__ */ jsx11(AlertDescription6, { children: errorContent.description })
649
+ ] })
650
+ ]
651
+ }
652
+ );
653
+ };
654
+
655
+ // src/components/auth/verify-phone.tsx
656
+ import { Alert as Alert7, AlertDescription as AlertDescription7, AlertTitle as AlertTitle7 } from "@mesob/ui/components";
657
+ import { useMesob as useMesob8 } from "@mesob/ui/providers";
658
+ import { IconAlertCircle as IconAlertCircle7 } from "@tabler/icons-react";
659
+ import { useEffect as useEffect8, useState as useState9 } from "react";
660
+ import { toast as toast7 } from "sonner";
661
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
662
+
663
+ // src/components/authorization/deny.tsx
664
+ import { deny as canDeny } from "@mesob/common";
665
+ import { Fragment as Fragment2, jsx as jsx13 } from "react/jsx-runtime";
666
+
667
+ // src/components/authorization/grant.tsx
668
+ import { grant as canGrant } from "@mesob/common";
669
+ import { Fragment as Fragment3, jsx as jsx14 } from "react/jsx-runtime";
670
+
671
+ // src/components/error-boundary.tsx
672
+ import { Button as Button7 } from "@mesob/ui/components";
673
+ import { Component } from "react";
674
+ import { jsx as jsx15, jsxs as jsxs11 } from "react/jsx-runtime";
675
+
676
+ // src/components/iam/permission-selector.tsx
677
+ import {
678
+ Badge,
679
+ EntitySelector,
680
+ useEntitySectionState
681
+ } from "@mesob/ui/components";
682
+ import { IconKey } from "@tabler/icons-react";
683
+ import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
684
+
685
+ // src/components/iam/permissions.tsx
686
+ import { Badge as Badge2, Button as Button8 } from "@mesob/ui/components";
687
+ import { useState as useState10 } from "react";
688
+
689
+ // src/components/shared/data-table.tsx
690
+ import {
691
+ Table,
692
+ TableBody,
693
+ TableCell,
694
+ TableHead,
695
+ TableHeader,
696
+ TableRow
697
+ } from "@mesob/ui/components";
698
+
699
+ // src/components/skeletons/table-skeleton.tsx
700
+ import { Skeleton } from "@mesob/ui/components";
701
+ import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
702
+
703
+ // src/components/shared/data-table.tsx
704
+ import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
705
+
706
+ // src/components/iam/permissions.tsx
707
+ import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
708
+
709
+ // src/components/iam/role-detail-layout.tsx
710
+ import {
711
+ EntityDetailHeader,
712
+ EntityEmptyState,
713
+ PageContainer,
714
+ useBreadcrumbs
715
+ } from "@mesob/ui/components";
716
+ import { IconShield } from "@tabler/icons-react";
717
+ import { useMemo as useMemo2 } from "react";
718
+ import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
719
+
720
+ // src/components/iam/role-detail-page.tsx
721
+ import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
722
+ import {
723
+ EntityFormActions,
724
+ Form as Form7,
725
+ FormControl as FormControl7,
726
+ FormField as FormField7,
727
+ FormItem as FormItem7,
728
+ FormLabel as FormLabel7,
729
+ FormMessage as FormMessage7,
730
+ Input as Input6,
731
+ LocaleInputText,
732
+ LocaleInputTextarea,
733
+ Section,
734
+ Skeleton as Skeleton2
735
+ } from "@mesob/ui/components";
736
+ import { useLocaleSchemas } from "@mesob/ui/providers";
737
+ import { useQueryClient } from "@tanstack/react-query";
738
+ import { useEffect as useEffect9, useMemo as useMemo3 } from "react";
739
+ import { useForm as useForm7 } from "react-hook-form";
740
+ import { toast as toast8 } from "sonner";
741
+ import { z as z7 } from "zod";
742
+ import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
743
+
744
+ // src/components/iam/role-permissions-page.tsx
745
+ import {
746
+ Badge as Badge3,
747
+ Button as Button9,
748
+ DataTablePagination,
749
+ DeleteConfirmButton,
750
+ DisplayTable,
751
+ EntityEmptyState as EntityEmptyState2,
752
+ EntityFilter,
753
+ EntityHeader,
754
+ EntityLoadingState,
755
+ EntitySearch,
756
+ EntitySort,
757
+ EntityViewToggle,
758
+ PageBody,
759
+ Tbody,
760
+ Td,
761
+ Th,
762
+ Thead,
763
+ Tr,
764
+ useEntityPagination,
765
+ useEntityParams
766
+ } from "@mesob/ui/components";
767
+ import { IconKey as IconKey2, IconPlus, IconTrash } from "@tabler/icons-react";
768
+ import { useQueryClient as useQueryClient2 } from "@tanstack/react-query";
769
+ import { useMemo as useMemo4 } from "react";
770
+ import { toast as toast9 } from "sonner";
771
+ import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
772
+
773
+ // src/components/iam/roles.tsx
774
+ import { Badge as Badge4, Button as Button10 } from "@mesob/ui/components";
775
+ import { useLocale } from "next-intl";
776
+ import { useState as useState11 } from "react";
777
+ import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
778
+
779
+ // src/components/iam/sessions.tsx
780
+ import { Button as Button11 } from "@mesob/ui/components";
781
+ import { useState as useState12 } from "react";
782
+ import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
783
+
784
+ // src/components/iam/tenants.tsx
785
+ import { Badge as Badge5, Button as Button12 } from "@mesob/ui/components";
786
+ import { useState as useState13 } from "react";
787
+ import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
788
+
789
+ // src/components/iam/users.tsx
790
+ import { Badge as Badge6, Button as Button13 } from "@mesob/ui/components";
791
+ import { useState as useState14 } from "react";
792
+ import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
793
+
794
+ // src/components/profile/account.tsx
795
+ import { Badge as Badge8, Card as Card2, CardContent, Separator } from "@mesob/ui/components";
796
+
797
+ // src/components/profile/change-profile.tsx
798
+ import {
799
+ Avatar,
800
+ AvatarFallback,
801
+ AvatarImage,
802
+ Badge as Badge7,
803
+ Button as Button14
804
+ } from "@mesob/ui/components";
805
+ import { useState as useState15 } from "react";
806
+ import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
807
+
808
+ // src/components/profile/account.tsx
809
+ import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
810
+
811
+ // src/components/profile/security.tsx
812
+ import { Badge as Badge9, Card as Card3, CardContent as CardContent2, Separator as Separator2 } from "@mesob/ui/components";
813
+
814
+ // src/components/profile/change-email-form.tsx
815
+ import {
816
+ Button as Button16,
817
+ Collapsible,
818
+ CollapsibleContent,
819
+ CollapsibleTrigger
820
+ } from "@mesob/ui/components";
821
+ import { IconChevronDown } from "@tabler/icons-react";
822
+ import { useState as useState18 } from "react";
823
+
824
+ // src/components/profile/request-change-email-form.tsx
825
+ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
826
+ import { Button as Button15, Input as Input7, Label, Spinner as Spinner2 } from "@mesob/ui/components";
827
+ import { IconEye as IconEye5, IconEyeOff as IconEyeOff5 } from "@tabler/icons-react";
828
+ import { useEffect as useEffect10, useState as useState16 } from "react";
829
+ import { useForm as useForm8 } from "react-hook-form";
830
+ import { toast as toast10 } from "sonner";
831
+ import { z as z8 } from "zod";
832
+ import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
833
+ var emailPasswordSchema = z8.object({
834
+ email: z8.string().email("Invalid email address"),
835
+ password: z8.string().min(8, "Password must be at least 8 characters").max(128, "Password too long")
836
+ });
837
+
838
+ // src/components/profile/verify-change-email-form.tsx
839
+ import { useState as useState17 } from "react";
840
+ import { toast as toast11 } from "sonner";
841
+
842
+ // src/components/profile/otp-verification-modal.tsx
843
+ import {
844
+ Dialog,
845
+ DialogContent,
846
+ DialogDescription,
847
+ DialogHeader,
848
+ DialogTitle
849
+ } from "@mesob/ui/components";
850
+ import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
851
+
852
+ // src/components/profile/verify-change-email-form.tsx
853
+ import { jsx as jsx31 } from "react/jsx-runtime";
854
+
855
+ // src/components/profile/change-email-form.tsx
856
+ import { jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
857
+
858
+ // src/components/profile/change-password-form.tsx
859
+ import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
860
+ import {
861
+ Button as Button17,
862
+ Collapsible as Collapsible2,
863
+ CollapsibleContent as CollapsibleContent2,
864
+ CollapsibleTrigger as CollapsibleTrigger2,
865
+ Input as Input8,
866
+ Label as Label2,
867
+ Spinner as Spinner3
868
+ } from "@mesob/ui/components";
869
+ import { IconChevronDown as IconChevronDown2, IconEye as IconEye6, IconEyeOff as IconEyeOff6 } from "@tabler/icons-react";
870
+ import { useState as useState19 } from "react";
871
+ import { useForm as useForm9 } from "react-hook-form";
872
+ import { toast as toast12 } from "sonner";
873
+ import { z as z9 } from "zod";
874
+ import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
875
+ var changePasswordSchema = z9.object({
876
+ currentPassword: z9.string().min(8, "Password must be at least 8 characters"),
877
+ newPassword: z9.string().min(8, "Password must be at least 8 characters"),
878
+ confirmPassword: z9.string().min(8, "Password must be at least 8 characters")
879
+ }).refine((data) => data.newPassword === data.confirmPassword, {
880
+ message: "Passwords don't match",
881
+ path: ["confirmPassword"]
882
+ });
883
+
884
+ // src/components/profile/change-phone-form.tsx
885
+ import {
886
+ Button as Button19,
887
+ Collapsible as Collapsible3,
888
+ CollapsibleContent as CollapsibleContent3,
889
+ CollapsibleTrigger as CollapsibleTrigger3
890
+ } from "@mesob/ui/components";
891
+ import { IconChevronDown as IconChevronDown3 } from "@tabler/icons-react";
892
+ import { useState as useState22 } from "react";
893
+
894
+ // src/components/profile/request-change-phone-form.tsx
895
+ import { zodResolver as zodResolver10 } from "@hookform/resolvers/zod";
896
+ import { Button as Button18, Input as Input9, Label as Label3, Spinner as Spinner4 } from "@mesob/ui/components";
897
+ import { IconEye as IconEye7, IconEyeOff as IconEyeOff7 } from "@tabler/icons-react";
898
+ import { useEffect as useEffect11, useState as useState20 } from "react";
899
+ import { useForm as useForm10 } from "react-hook-form";
900
+ import { toast as toast13 } from "sonner";
901
+ import { z as z10 } from "zod";
902
+ import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
903
+
904
+ // src/components/profile/verify-change-phone-form.tsx
905
+ import { useState as useState21 } from "react";
906
+ import { toast as toast14 } from "sonner";
907
+ import { jsx as jsx35 } from "react/jsx-runtime";
908
+
909
+ // src/components/profile/change-phone-form.tsx
910
+ import { jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
911
+
912
+ // src/components/profile/security.tsx
913
+ import { jsx as jsx37, jsxs as jsxs31 } from "react/jsx-runtime";
914
+
915
+ // src/components/skeletons/auth-form-skeleton.tsx
916
+ import { Skeleton as Skeleton3 } from "@mesob/ui/components";
917
+ import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
918
+
919
+ // src/components/skeletons/profile-skeleton.tsx
920
+ import { Skeleton as Skeleton4 } from "@mesob/ui/components";
921
+ import { jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
922
+
923
+ // src/pages/auth/verify-email.tsx
924
+ import { jsx as jsx40 } from "react/jsx-runtime";
925
+ var metadata = {
926
+ title: "Verify email",
927
+ description: "Verify your email address."
928
+ };
929
+ async function VerifyEmailPage({ searchParams }) {
930
+ const params = searchParams ? await searchParams : {};
931
+ const verificationIdParam = params.verificationId;
932
+ const emailParam = params.email;
933
+ const redirectParam = params.redirect;
934
+ const verificationId = typeof verificationIdParam === "string" ? verificationIdParam : "";
935
+ const email = typeof emailParam === "string" ? emailParam : "";
936
+ const redirectUrl = typeof redirectParam === "string" ? redirectParam : void 0;
937
+ return /* @__PURE__ */ jsx40(
938
+ VerifyEmail,
939
+ {
940
+ verificationId,
941
+ email,
942
+ redirectUrl
943
+ }
944
+ );
945
+ }
946
+ export {
947
+ VerifyEmailPage as default,
948
+ metadata
949
+ };
950
+ //# sourceMappingURL=verify-email.js.map