@sikka/hawa 0.23.9-next → 0.23.10-next

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 (38) hide show
  1. package/dist/DropdownMenu-jh4puuXw.d.ts +95 -0
  2. package/dist/DropdownMenu-vm2kRAhL.d.mts +95 -0
  3. package/dist/Radio-2ZwcMDWt.d.ts +74 -0
  4. package/dist/Radio-5ZANA8Vh.d.mts +74 -0
  5. package/dist/SimpleTable-EE4ejgUR.d.mts +97 -0
  6. package/dist/SimpleTable-vY1ziD-2.d.ts +97 -0
  7. package/dist/Toast-jAb16JQg.d.mts +23 -0
  8. package/dist/Toast-xcELwcIX.d.ts +23 -0
  9. package/dist/blocks/index.d.mts +480 -0
  10. package/dist/blocks/index.d.ts +480 -0
  11. package/dist/blocks/index.js +8119 -0
  12. package/dist/blocks/index.mjs +2535 -0
  13. package/dist/chunk-2R2QPJT7.mjs +7519 -0
  14. package/dist/chunk-343SRWR4.mjs +146 -0
  15. package/dist/chunk-FNVYY7ND.mjs +22 -0
  16. package/dist/commonTypes-CKtkuNFH.d.mts +11 -0
  17. package/dist/commonTypes-CKtkuNFH.d.ts +11 -0
  18. package/dist/elements/index.d.mts +715 -0
  19. package/dist/elements/index.d.ts +715 -0
  20. package/dist/elements/index.js +7719 -0
  21. package/dist/elements/index.mjs +285 -0
  22. package/dist/hooks/index.d.mts +107 -0
  23. package/dist/hooks/index.d.ts +107 -0
  24. package/dist/hooks/index.js +451 -0
  25. package/dist/hooks/index.mjs +254 -0
  26. package/dist/index.d.mts +1905 -0
  27. package/dist/index.d.ts +1905 -0
  28. package/dist/index.js +11987 -0
  29. package/dist/index.mjs +11760 -0
  30. package/dist/layout/index.d.mts +249 -0
  31. package/dist/layout/index.d.ts +249 -0
  32. package/dist/layout/index.js +4373 -0
  33. package/dist/layout/index.mjs +1381 -0
  34. package/dist/types/index.d.mts +115 -0
  35. package/dist/types/index.d.ts +115 -0
  36. package/dist/types/index.js +18 -0
  37. package/dist/types/index.mjs +0 -0
  38. package/package.json +1 -1
@@ -0,0 +1,2535 @@
1
+ import {
2
+ Alert,
3
+ BadEmoji,
4
+ Button,
5
+ Card,
6
+ CardContent,
7
+ CardDescription,
8
+ CardFooter,
9
+ CardHeader,
10
+ CardTitle,
11
+ CheckMark,
12
+ Checkbox,
13
+ Chip,
14
+ DropdownMenu,
15
+ EyeIcon,
16
+ GoodEmoji,
17
+ HiddenEyeIcon,
18
+ Input,
19
+ Label,
20
+ Loading,
21
+ Logos,
22
+ PhoneInput,
23
+ PinInput,
24
+ Popover,
25
+ Progress,
26
+ Radio,
27
+ ScrollArea,
28
+ Select,
29
+ Separator,
30
+ Skeleton,
31
+ StopPropagationWrapper,
32
+ Tabs,
33
+ TabsContent,
34
+ TabsList,
35
+ TabsTrigger,
36
+ Textarea,
37
+ Tooltip,
38
+ UncheckMark,
39
+ VeryBadEmoji,
40
+ VeryGoodEmoji,
41
+ cn
42
+ } from "../chunk-2R2QPJT7.mjs";
43
+ import "../chunk-343SRWR4.mjs";
44
+
45
+ // components/blocks/auth/LoginForm.tsx
46
+ import React2, { useState } from "react";
47
+ import { Controller, useForm } from "react-hook-form";
48
+ import { zodResolver } from "@hookform/resolvers/zod";
49
+ import { parsePhoneNumber } from "libphonenumber-js";
50
+ import * as z from "zod";
51
+
52
+ // components/blocks/auth/AuthButtons.tsx
53
+ import React from "react";
54
+ var AuthButtons = (props) => {
55
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
56
+ return /* @__PURE__ */ React.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, props.viaGoogle && /* @__PURE__ */ React.createElement(
57
+ Button,
58
+ {
59
+ disabled: props.isGoogleLoading,
60
+ className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
61
+ variant: "outline",
62
+ onClick: props.handleGoogle
63
+ },
64
+ props.isGoogleLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.google, { className: "hawa-icon" }),
65
+ (_b = (_a = props.texts) == null ? void 0 : _a.continueWithGoogle) != null ? _b : "Continue With Google"
66
+ ), props.viaGithub && /* @__PURE__ */ React.createElement(
67
+ Button,
68
+ {
69
+ disabled: props.isGithubLoading,
70
+ className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
71
+ variant: "outline",
72
+ onClick: props.handleGithub
73
+ },
74
+ props.isGithubLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.github, { className: "hawa-icon" }),
75
+ (_d = (_c = props.texts) == null ? void 0 : _c.continueWithGithub) != null ? _d : "Continue With Github"
76
+ ), props.viaTwitter && /* @__PURE__ */ React.createElement(
77
+ Button,
78
+ {
79
+ disabled: props.isTwitterLoading,
80
+ className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
81
+ variant: "outline",
82
+ onClick: props.handleTwitter
83
+ },
84
+ props.isTwitterLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.twitter, { className: "hawa-icon" }),
85
+ (_f = (_e = props.texts) == null ? void 0 : _e.continueWithTwitter) != null ? _f : "Continue With Twitter"
86
+ ), props.viaApple && /* @__PURE__ */ React.createElement(
87
+ Button,
88
+ {
89
+ disabled: props.isAppleLoading,
90
+ className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
91
+ variant: "outline",
92
+ onClick: props.handleApple
93
+ },
94
+ props.isAppleLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.apple, { className: "hawa-icon" }),
95
+ (_h = (_g = props.texts) == null ? void 0 : _g.continueWithApple) != null ? _h : "Continue With Apple"
96
+ ), props.viaMicrosoft && /* @__PURE__ */ React.createElement(
97
+ Button,
98
+ {
99
+ disabled: props.isMicrosoftLoading,
100
+ className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
101
+ variant: "outline",
102
+ onClick: props.handleMicrosoft
103
+ },
104
+ props.isMicrosoftLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.microsoft, { className: "hawa-icon" }),
105
+ (_j = (_i = props.texts) == null ? void 0 : _i.continueWithMicrosoft) != null ? _j : "Continue With Microsoft"
106
+ ), props.viaEmail && /* @__PURE__ */ React.createElement(
107
+ Button,
108
+ {
109
+ disabled: props.isEmailLoading,
110
+ className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
111
+ variant: "outline",
112
+ onClick: props.handleEmail
113
+ },
114
+ props.isEmailLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.mail, { className: "hawa-icon" }),
115
+ (_l = (_k = props.texts) == null ? void 0 : _k.continueWithEmail) != null ? _l : "Continue With Email"
116
+ ), props.viaPhone && /* @__PURE__ */ React.createElement(
117
+ Button,
118
+ {
119
+ disabled: props.isPhoneLoading,
120
+ className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2",
121
+ variant: "outline",
122
+ onClick: props.handlePhone
123
+ },
124
+ props.isPhoneLoading ? /* @__PURE__ */ React.createElement(Loading, { size: "button" }) : /* @__PURE__ */ React.createElement(Logos.phone, { className: "hawa-icon" }),
125
+ (_n = (_m = props.texts) == null ? void 0 : _m.continueWithPhone) != null ? _n : "Continue With Phone"
126
+ ));
127
+ };
128
+
129
+ // components/blocks/auth/LoginForm.tsx
130
+ var LoginForm = ({
131
+ loginType,
132
+ texts,
133
+ passwordLength = 8,
134
+ ...props
135
+ }) => {
136
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
137
+ const [passwordVisible, setPasswordVisible] = useState(false);
138
+ const thirdPartyAuthTexts = {
139
+ continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
140
+ continueWithTwitter: texts == null ? void 0 : texts.continueWithTwitter,
141
+ continueWithApple: texts == null ? void 0 : texts.continueWithApple,
142
+ continueWithMicrosoft: texts == null ? void 0 : texts.continueWithMicrosoft,
143
+ continueWithGithub: texts == null ? void 0 : texts.continueWithGithub,
144
+ continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
145
+ continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
146
+ };
147
+ let formSchema;
148
+ if (loginType === "email") {
149
+ formSchema = z.object({
150
+ email: z.string({ required_error: (_a = texts == null ? void 0 : texts.email) == null ? void 0 : _a.required }).min(1, { message: (_b = texts == null ? void 0 : texts.email) == null ? void 0 : _b.required }).email({ message: (_c = texts == null ? void 0 : texts.email) == null ? void 0 : _c.invalid }),
151
+ password: z.string({ required_error: (_d = texts == null ? void 0 : texts.password) == null ? void 0 : _d.required }).min(1, { message: (_e = texts == null ? void 0 : texts.password) == null ? void 0 : _e.required }).min(passwordLength, { message: (_f = texts == null ? void 0 : texts.password) == null ? void 0 : _f.tooShort })
152
+ });
153
+ } else if (loginType === "username") {
154
+ formSchema = z.object({
155
+ username: z.string({ required_error: (_g = texts == null ? void 0 : texts.username) == null ? void 0 : _g.required }).min(2, { message: (_h = texts == null ? void 0 : texts.username) == null ? void 0 : _h.tooShort }).refine(
156
+ (value) => {
157
+ const isValid = /^[a-zA-Z][a-zA-Z0-9_-]{2,14}$/.test(value);
158
+ return isValid;
159
+ },
160
+ { message: (_i = texts == null ? void 0 : texts.username) == null ? void 0 : _i.invalid }
161
+ ),
162
+ password: z.string({ required_error: (_j = texts == null ? void 0 : texts.password) == null ? void 0 : _j.required }).min(1, { message: (_k = texts == null ? void 0 : texts.password) == null ? void 0 : _k.required }).min(passwordLength, { message: (_l = texts == null ? void 0 : texts.password) == null ? void 0 : _l.tooShort })
163
+ });
164
+ } else if (loginType === "phone") {
165
+ formSchema = z.object({
166
+ phone: z.string({ required_error: (_m = texts == null ? void 0 : texts.phone) == null ? void 0 : _m.required }).refine(
167
+ (value) => {
168
+ let phoneNumber = parsePhoneNumber(value);
169
+ return phoneNumber.isValid();
170
+ },
171
+ { message: (_n = texts == null ? void 0 : texts.phone) == null ? void 0 : _n.invalid }
172
+ )
173
+ });
174
+ } else if (loginType === "link") {
175
+ formSchema = z.object({
176
+ email: z.string({ required_error: (_o = texts == null ? void 0 : texts.email) == null ? void 0 : _o.required }).min(1, { message: (_p = texts == null ? void 0 : texts.email) == null ? void 0 : _p.required }).email({ message: (_q = texts == null ? void 0 : texts.email) == null ? void 0 : _q.invalid })
177
+ });
178
+ } else {
179
+ formSchema = z.object({});
180
+ }
181
+ const { handleSubmit, control, formState } = useForm({
182
+ resolver: zodResolver(formSchema)
183
+ });
184
+ const renderFields = () => {
185
+ switch (loginType) {
186
+ case "email":
187
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
188
+ Controller,
189
+ {
190
+ control,
191
+ name: "email",
192
+ render: ({ field }) => {
193
+ var _a2, _b2, _c2;
194
+ return /* @__PURE__ */ React2.createElement(
195
+ Input,
196
+ {
197
+ inputProps: {
198
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
199
+ },
200
+ dir: "ltr",
201
+ width: "full",
202
+ autoComplete: "email",
203
+ label: (_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label,
204
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
205
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "contact@sikka.io",
206
+ ...field
207
+ }
208
+ );
209
+ }
210
+ }
211
+ ), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(
212
+ Controller,
213
+ {
214
+ control,
215
+ name: "password",
216
+ render: ({ field }) => {
217
+ var _a2, _b2, _c2;
218
+ return /* @__PURE__ */ React2.createElement(
219
+ Input,
220
+ {
221
+ width: "full",
222
+ autoComplete: "current-password",
223
+ type: passwordVisible ? "text" : "password",
224
+ label: ((_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label) || "Password",
225
+ endIcon: /* @__PURE__ */ React2.createElement(
226
+ "div",
227
+ {
228
+ className: "hawa-cursor-pointer",
229
+ onClick: () => setPasswordVisible(!passwordVisible)
230
+ },
231
+ passwordVisible ? /* @__PURE__ */ React2.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React2.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" })
232
+ ),
233
+ placeholder: ((_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder) || "Enter your password",
234
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
235
+ ...field
236
+ }
237
+ );
238
+ }
239
+ }
240
+ ), !props.withoutResetPassword && /* @__PURE__ */ React2.createElement(
241
+ "div",
242
+ {
243
+ onClick: props.onForgotPassword,
244
+ className: "hawa-mb-3 hawa-mt-2 hawa-w-fit hawa-cursor-pointer hawa-select-none hawa-text-xs dark:hawa-text-gray-300"
245
+ },
246
+ (texts == null ? void 0 : texts.forgotPassword) || "Forgot Password?"
247
+ )));
248
+ case "username":
249
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
250
+ Controller,
251
+ {
252
+ control,
253
+ name: "username",
254
+ render: ({ field }) => {
255
+ var _a2, _b2, _c2;
256
+ return /* @__PURE__ */ React2.createElement(
257
+ Input,
258
+ {
259
+ width: "full",
260
+ autoComplete: "username",
261
+ label: ((_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label) || "Username",
262
+ helperText: (_b2 = formState.errors.username) == null ? void 0 : _b2.message,
263
+ placeholder: ((_c2 = texts == null ? void 0 : texts.username) == null ? void 0 : _c2.placeholder) || "sikka_sa",
264
+ ...field
265
+ }
266
+ );
267
+ }
268
+ }
269
+ ), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(
270
+ Controller,
271
+ {
272
+ control,
273
+ name: "password",
274
+ render: ({ field }) => {
275
+ var _a2, _b2, _c2;
276
+ return /* @__PURE__ */ React2.createElement(
277
+ Input,
278
+ {
279
+ width: "full",
280
+ autoComplete: "current-password",
281
+ type: passwordVisible ? "text" : "password",
282
+ label: (_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label,
283
+ endIcon: /* @__PURE__ */ React2.createElement(
284
+ "div",
285
+ {
286
+ className: "hawa-cursor-pointer",
287
+ onClick: () => setPasswordVisible(!passwordVisible)
288
+ },
289
+ passwordVisible ? /* @__PURE__ */ React2.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React2.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" })
290
+ ),
291
+ placeholder: ((_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder) || "Enter your password",
292
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
293
+ ...field
294
+ }
295
+ );
296
+ }
297
+ }
298
+ ), !props.withoutResetPassword && /* @__PURE__ */ React2.createElement(
299
+ "div",
300
+ {
301
+ onClick: props.onForgotPassword,
302
+ className: "hawa-mb-3 hawa-mt-2 hawa-w-fit hawa-cursor-pointer hawa-select-none hawa-text-xs dark:hawa-text-gray-300"
303
+ },
304
+ (texts == null ? void 0 : texts.forgotPassword) || "Forgot Password?"
305
+ )));
306
+ case "phone":
307
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
308
+ Controller,
309
+ {
310
+ control,
311
+ name: "phone",
312
+ render: ({ field }) => {
313
+ var _a2, _b2;
314
+ return /* @__PURE__ */ React2.createElement(
315
+ PhoneInput,
316
+ {
317
+ label: (_a2 = texts == null ? void 0 : texts.phone) == null ? void 0 : _a2.label,
318
+ helperText: (_b2 = formState.errors.phone) == null ? void 0 : _b2.message,
319
+ preferredCountry: { label: "+966" },
320
+ handleChange: (e) => field.onChange(parsePhoneNumber(e).number)
321
+ }
322
+ );
323
+ }
324
+ }
325
+ ));
326
+ case "link":
327
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
328
+ Controller,
329
+ {
330
+ control,
331
+ name: "email",
332
+ render: ({ field }) => {
333
+ var _a2, _b2, _c2;
334
+ return /* @__PURE__ */ React2.createElement(
335
+ Input,
336
+ {
337
+ width: "full",
338
+ autoComplete: "email",
339
+ label: ((_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label) || "Email",
340
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
341
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "contact@sikka.io",
342
+ ...field
343
+ }
344
+ );
345
+ }
346
+ }
347
+ ));
348
+ default:
349
+ break;
350
+ }
351
+ };
352
+ return /* @__PURE__ */ React2.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React2.createElement(Card, { dir: props.direction }, /* @__PURE__ */ React2.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React2.createElement(
353
+ Alert,
354
+ {
355
+ direction: props.direction,
356
+ title: props.errorTitle,
357
+ text: props.errorText,
358
+ severity: "error"
359
+ }
360
+ ), /* @__PURE__ */ React2.createElement(
361
+ "form",
362
+ {
363
+ noValidate: true,
364
+ className: "hawa-flex hawa-flex-col hawa-gap-4",
365
+ onSubmit: handleSubmit((e) => {
366
+ if (props.onLogin) {
367
+ return props.onLogin(e);
368
+ } else {
369
+ console.log("Form is submitted but onLogin prop is missing");
370
+ }
371
+ })
372
+ },
373
+ renderFields(),
374
+ /* @__PURE__ */ React2.createElement(
375
+ Button,
376
+ {
377
+ className: "hawa-mt-0 hawa-w-full",
378
+ type: "submit",
379
+ isLoading: props.isLoading,
380
+ disabled: props.isLoading
381
+ },
382
+ (texts == null ? void 0 : texts.loginText) || "Login"
383
+ ),
384
+ props.additionalButtons,
385
+ props.allowRegister && /* @__PURE__ */ React2.createElement("div", { className: "hawa-select-none hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, (texts == null ? void 0 : texts.newUserText) || "New user?", " ", /* @__PURE__ */ React2.createElement(
386
+ "span",
387
+ {
388
+ onClick: props.onRouteToRegister,
389
+ className: "clickable-link"
390
+ },
391
+ (texts == null ? void 0 : texts.createAccount) || "Create Account"
392
+ ))
393
+ )), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React2.createElement(
394
+ CardFooter,
395
+ {
396
+ className: cn(
397
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
398
+ )
399
+ },
400
+ /* @__PURE__ */ React2.createElement(
401
+ AuthButtons,
402
+ {
403
+ texts: thirdPartyAuthTexts,
404
+ viaGoogle: props.viaGoogle,
405
+ viaGithub: props.viaGithub,
406
+ viaTwitter: props.viaTwitter,
407
+ isGoogleLoading: props.isGoogleLoading,
408
+ isGithubLoading: props.isGithubLoading,
409
+ isTwitterLoading: props.isTwitterLoading,
410
+ handleGoogle: props.onGoogleLogin,
411
+ handleGithub: props.onGithubLogin,
412
+ handleTwitter: props.onTwitterLogin
413
+ }
414
+ )
415
+ ) : null));
416
+ };
417
+
418
+ // components/blocks/auth/RegisterForm.tsx
419
+ import React3, { useState as useState2 } from "react";
420
+ import { Controller as Controller2, FormProvider, useForm as useForm2 } from "react-hook-form";
421
+ import { zodResolver as zodResolver2 } from "@hookform/resolvers/zod";
422
+ import * as z2 from "zod";
423
+ var RegisterForm = ({
424
+ texts,
425
+ registerFields = ["email"],
426
+ ...props
427
+ }) => {
428
+ var _a, _b, _c, _d, _e, _f;
429
+ const [passwordVisible, setPasswordVisible] = useState2(false);
430
+ const thirdPartyAuthTexts = {
431
+ continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
432
+ continueWithTwitter: texts == null ? void 0 : texts.continueWithTwitter,
433
+ continueWithApple: texts == null ? void 0 : texts.continueWithApple,
434
+ continueWithMicrosoft: texts == null ? void 0 : texts.continueWithMicrosoft,
435
+ continueWithGithub: texts == null ? void 0 : texts.continueWithGithub,
436
+ continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
437
+ continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
438
+ };
439
+ const methods = useForm2();
440
+ let fieldSchemas = {};
441
+ registerFields.forEach((field) => {
442
+ var _a2, _b2, _c2, _d2, _e2, _f2;
443
+ switch (field) {
444
+ case "fullname":
445
+ fieldSchemas["fullName"] = z2.string().optional();
446
+ break;
447
+ case "email":
448
+ fieldSchemas["email"] = z2.string({ required_error: (_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.required }).email({ message: (_b2 = texts == null ? void 0 : texts.email) == null ? void 0 : _b2.invalid }).min(1, { message: (_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.required });
449
+ break;
450
+ case "username":
451
+ fieldSchemas["username"] = z2.string({ required_error: (_d2 = texts == null ? void 0 : texts.username) == null ? void 0 : _d2.required }).min(1, { message: (_e2 = texts == null ? void 0 : texts.username) == null ? void 0 : _e2.required }).refine(
452
+ (value) => {
453
+ const isValid = /^[a-zA-Z][a-zA-Z0-9_-]{2,14}$/.test(value);
454
+ return isValid;
455
+ },
456
+ { message: (_f2 = texts == null ? void 0 : texts.username) == null ? void 0 : _f2.invalid }
457
+ );
458
+ break;
459
+ }
460
+ });
461
+ const formSchema = z2.object({
462
+ ...fieldSchemas,
463
+ password: z2.string({ required_error: (_a = texts == null ? void 0 : texts.password) == null ? void 0 : _a.required }).min(5, { message: (_b = texts == null ? void 0 : texts.password) == null ? void 0 : _b.tooShort }).refine((value) => value !== "", {
464
+ message: (_c = texts == null ? void 0 : texts.password) == null ? void 0 : _c.required
465
+ }),
466
+ confirm_password: z2.string({ required_error: (_d = texts == null ? void 0 : texts.confirm) == null ? void 0 : _d.required }).refine((value) => value !== "", {
467
+ message: (_e = texts == null ? void 0 : texts.password) == null ? void 0 : _e.required
468
+ }),
469
+ refCode: z2.string().optional(),
470
+ reference: z2.string().optional(),
471
+ terms_accepted: z2.boolean({ required_error: texts == null ? void 0 : texts.termsRequired }).refine((value) => value, { message: texts == null ? void 0 : texts.termsRequired }),
472
+ newsletter_accepted: z2.boolean().optional()
473
+ }).refine((data) => data.password === data.confirm_password, {
474
+ message: (_f = texts == null ? void 0 : texts.confirm) == null ? void 0 : _f.dontMatch,
475
+ path: ["confirm_password"]
476
+ });
477
+ const { handleSubmit, control, formState } = useForm2({
478
+ resolver: zodResolver2(formSchema)
479
+ });
480
+ return /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React3.createElement(Card, { dir: props.direction }, /* @__PURE__ */ React3.createElement(CardContent, { headless: true }, /* @__PURE__ */ React3.createElement("div", null, props.showError && /* @__PURE__ */ React3.createElement(
481
+ Alert,
482
+ {
483
+ title: props.errorTitle,
484
+ text: props.errorText,
485
+ severity: "error"
486
+ }
487
+ ), /* @__PURE__ */ React3.createElement(FormProvider, { ...methods }, /* @__PURE__ */ React3.createElement(
488
+ "form",
489
+ {
490
+ noValidate: true,
491
+ onSubmit: handleSubmit((e) => {
492
+ if (props.onRegister) {
493
+ return props.onRegister(e);
494
+ } else {
495
+ console.log(
496
+ "Form is submitted but onRegister prop is missing"
497
+ );
498
+ }
499
+ }),
500
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
501
+ },
502
+ /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
503
+ if (fld === "fullname") {
504
+ return /* @__PURE__ */ React3.createElement(
505
+ Controller2,
506
+ {
507
+ key: i,
508
+ control,
509
+ name: "fullName",
510
+ render: ({ field }) => {
511
+ var _a2, _b2, _c2;
512
+ return /* @__PURE__ */ React3.createElement(
513
+ Input,
514
+ {
515
+ width: "full",
516
+ label: (_a2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _a2.label,
517
+ placeholder: (_b2 = texts == null ? void 0 : texts.fullName) == null ? void 0 : _b2.placeholder,
518
+ helperText: (_c2 = formState.errors.fullName) == null ? void 0 : _c2.message,
519
+ ...field
520
+ }
521
+ );
522
+ }
523
+ }
524
+ );
525
+ }
526
+ if (fld === "email") {
527
+ return /* @__PURE__ */ React3.createElement(
528
+ Controller2,
529
+ {
530
+ key: i,
531
+ control,
532
+ name: "email",
533
+ render: ({ field }) => {
534
+ var _a2, _b2, _c2;
535
+ return /* @__PURE__ */ React3.createElement(
536
+ Input,
537
+ {
538
+ dir: "ltr",
539
+ inputProps: {
540
+ className: props.direction === "rtl" ? "hawa-text-right" : "hawa-text-left"
541
+ },
542
+ width: "full",
543
+ autoComplete: "email",
544
+ label: (_a2 = texts == null ? void 0 : texts.email) == null ? void 0 : _a2.label,
545
+ helperText: (_b2 = formState.errors.email) == null ? void 0 : _b2.message,
546
+ placeholder: ((_c2 = texts == null ? void 0 : texts.email) == null ? void 0 : _c2.placeholder) || "Enter your email",
547
+ ...field
548
+ }
549
+ );
550
+ }
551
+ }
552
+ );
553
+ }
554
+ if (fld === "username") {
555
+ return /* @__PURE__ */ React3.createElement(
556
+ Controller2,
557
+ {
558
+ key: i,
559
+ control,
560
+ name: "username",
561
+ render: ({ field }) => {
562
+ var _a2, _b2, _c2;
563
+ return /* @__PURE__ */ React3.createElement(
564
+ Input,
565
+ {
566
+ width: "full",
567
+ autoComplete: "username",
568
+ label: (_a2 = texts == null ? void 0 : texts.username) == null ? void 0 : _a2.label,
569
+ helperText: (_b2 = formState.errors.username) == null ? void 0 : _b2.message,
570
+ placeholder: (_c2 = texts == null ? void 0 : texts.username) == null ? void 0 : _c2.placeholder,
571
+ ...field
572
+ }
573
+ );
574
+ }
575
+ }
576
+ );
577
+ }
578
+ })),
579
+ /* @__PURE__ */ React3.createElement(
580
+ Controller2,
581
+ {
582
+ control,
583
+ name: "password",
584
+ render: ({ field }) => {
585
+ var _a2, _b2, _c2;
586
+ return /* @__PURE__ */ React3.createElement(
587
+ Input,
588
+ {
589
+ width: "full",
590
+ type: passwordVisible ? "text" : "password",
591
+ endIcon: /* @__PURE__ */ React3.createElement(
592
+ "div",
593
+ {
594
+ className: "hawa-cursor-pointer",
595
+ onClick: () => setPasswordVisible(!passwordVisible)
596
+ },
597
+ passwordVisible ? /* @__PURE__ */ React3.createElement(EyeIcon, { className: "hawa-text-gray-500" }) : /* @__PURE__ */ React3.createElement(HiddenEyeIcon, { className: "hawa-text-gray-500" }),
598
+ " "
599
+ ),
600
+ autoComplete: "new-password",
601
+ label: (_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label,
602
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
603
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
604
+ ...field
605
+ }
606
+ );
607
+ }
608
+ }
609
+ ),
610
+ /* @__PURE__ */ React3.createElement(
611
+ Controller2,
612
+ {
613
+ control,
614
+ name: "confirm_password",
615
+ render: ({ field }) => {
616
+ var _a2, _b2, _c2;
617
+ return /* @__PURE__ */ React3.createElement(
618
+ Input,
619
+ {
620
+ width: "full",
621
+ type: "password",
622
+ autoComplete: "new-password",
623
+ label: (_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label,
624
+ placeholder: (_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder,
625
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
626
+ ...field
627
+ }
628
+ );
629
+ }
630
+ }
631
+ ),
632
+ props.additionalInputs,
633
+ props.showRefCode && /* @__PURE__ */ React3.createElement(
634
+ Controller2,
635
+ {
636
+ control,
637
+ name: "refCode",
638
+ render: ({ field }) => {
639
+ var _a2;
640
+ return /* @__PURE__ */ React3.createElement(
641
+ Input,
642
+ {
643
+ width: "full",
644
+ label: texts == null ? void 0 : texts.refCode,
645
+ placeholder: (texts == null ? void 0 : texts.refCodePlaceholder) || "Enter the referral code",
646
+ helperText: (_a2 = formState.errors.refCode) == null ? void 0 : _a2.message,
647
+ ...field
648
+ }
649
+ );
650
+ }
651
+ }
652
+ ),
653
+ props.showUserSource && /* @__PURE__ */ React3.createElement(
654
+ Controller2,
655
+ {
656
+ control,
657
+ name: "reference",
658
+ render: ({ field }) => {
659
+ var _a2, _b2;
660
+ return /* @__PURE__ */ React3.createElement(
661
+ Select,
662
+ {
663
+ label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
664
+ placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
665
+ isCreatable: false,
666
+ isMulti: false,
667
+ isSearchable: false,
668
+ isClearable: false,
669
+ options: props.userReferenceOptions,
670
+ onChange: (e) => {
671
+ field.onChange(e.value);
672
+ }
673
+ }
674
+ );
675
+ }
676
+ }
677
+ ),
678
+ /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3" }, props.showTermsOption && /* @__PURE__ */ React3.createElement(
679
+ Controller2,
680
+ {
681
+ control,
682
+ name: "terms_accepted",
683
+ render: ({ field }) => {
684
+ var _a2, _b2;
685
+ return /* @__PURE__ */ React3.createElement(
686
+ Checkbox,
687
+ {
688
+ id: "terms_accepted",
689
+ helperText: (_b2 = (_a2 = formState.errors.terms_accepted) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
690
+ onCheckedChange: (e) => field.onChange(e),
691
+ label: /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-0.5" }, /* @__PURE__ */ React3.createElement("span", null, texts == null ? void 0 : texts.iAcceptText), " ", /* @__PURE__ */ React3.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React3.createElement(
692
+ "a",
693
+ {
694
+ onClick: props.onRouteToTOS,
695
+ className: "clickable-link"
696
+ },
697
+ texts == null ? void 0 : texts.termsText
698
+ )))
699
+ }
700
+ );
701
+ }
702
+ }
703
+ ), props.showNewsletterOption && /* @__PURE__ */ React3.createElement(
704
+ Controller2,
705
+ {
706
+ control,
707
+ name: "newsletter_accepted",
708
+ render: ({ field }) => /* @__PURE__ */ React3.createElement(
709
+ Checkbox,
710
+ {
711
+ id: "newsletter_accepted",
712
+ label: texts == null ? void 0 : texts.subscribeToNewsletter,
713
+ onCheckedChange: field.onChange
714
+ }
715
+ )
716
+ }
717
+ )),
718
+ /* @__PURE__ */ React3.createElement(
719
+ Button,
720
+ {
721
+ isLoading: props.isLoading,
722
+ className: "hawa-mt-4 hawa-w-full"
723
+ },
724
+ texts == null ? void 0 : texts.registerText
725
+ ),
726
+ props.additionalButtons
727
+ )), /* @__PURE__ */ React3.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-1 hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-white" }, /* @__PURE__ */ React3.createElement("span", null, texts == null ? void 0 : texts.existingUserText), /* @__PURE__ */ React3.createElement("span", { onClick: props.onRouteToLogin, className: "clickable-link" }, (texts == null ? void 0 : texts.loginText) || "Login")))), props.viaGithub || props.viaGoogle || props.viaTwitter ? /* @__PURE__ */ React3.createElement(
728
+ CardFooter,
729
+ {
730
+ className: cn(
731
+ props.logosOnly ? "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-2" : "hawa-grid hawa-grid-cols-1 hawa-gap-2"
732
+ )
733
+ },
734
+ /* @__PURE__ */ React3.createElement(
735
+ AuthButtons,
736
+ {
737
+ texts: thirdPartyAuthTexts,
738
+ viaGoogle: props.viaGoogle,
739
+ viaGithub: props.viaGithub,
740
+ viaTwitter: props.viaTwitter,
741
+ isGoogleLoading: props.isGoogleLoading,
742
+ isGithubLoading: props.isGithubLoading,
743
+ isTwitterLoading: props.isTwitterLoading,
744
+ handleGoogle: props.onGoogleRegister,
745
+ handleGithub: props.onGithubRegister,
746
+ handleTwitter: props.onTwitterRegister
747
+ }
748
+ )
749
+ ) : null));
750
+ };
751
+
752
+ // components/blocks/auth/AppLanding.tsx
753
+ import React4 from "react";
754
+ var AppLanding = ({ texts, ...props }) => {
755
+ const thirdPartyAuthTexts = {
756
+ continueWithGoogle: texts == null ? void 0 : texts.continueWithGoogle,
757
+ continueWithTwitter: texts == null ? void 0 : texts.continueWithTwitter,
758
+ continueWithApple: texts == null ? void 0 : texts.continueWithApple,
759
+ continueWithMicrosoft: texts == null ? void 0 : texts.continueWithMicrosoft,
760
+ continueWithGithub: texts == null ? void 0 : texts.continueWithGithub,
761
+ continueWithEmail: texts == null ? void 0 : texts.continueWithEmail,
762
+ continueWithPhone: texts == null ? void 0 : texts.continueWithPhone
763
+ };
764
+ return /* @__PURE__ */ React4.createElement("div", { dir: props.direction }, /* @__PURE__ */ React4.createElement(Card, null, /* @__PURE__ */ React4.createElement(CardContent, { headless: true, className: "hawa-flex hawa-flex-col hawa-gap-6" }, /* @__PURE__ */ React4.createElement(
765
+ AuthButtons,
766
+ {
767
+ texts: thirdPartyAuthTexts,
768
+ viaApple: props.viaApple,
769
+ viaGoogle: props.viaGoogle,
770
+ viaEmail: props.viaEmail,
771
+ viaGithub: props.viaGithub,
772
+ viaMicrosoft: props.viaMicrosoft,
773
+ viaPhone: props.viaPhone,
774
+ viaTwitter: props.viaTwitter,
775
+ handleApple: props.handleApple,
776
+ handleGoogle: props.handleGoogle,
777
+ handleTwitter: props.handleTwitter,
778
+ handleMicrosoft: props.handleMicrosoft,
779
+ handleGithub: props.handleGithub,
780
+ handleEmail: props.handleEmail,
781
+ handlePhone: props.handlePhone
782
+ }
783
+ ), props.allowRegister && /* @__PURE__ */ React4.createElement("div", { className: "hawa-p-3 hawa-text-center hawa-text-sm hawa-font-normal dark:hawa-text-gray-300" }, texts == null ? void 0 : texts.newUserText, " ", /* @__PURE__ */ React4.createElement(
784
+ "span",
785
+ {
786
+ onClick: props.handleRouteToRegister,
787
+ className: "clickable-link"
788
+ },
789
+ texts == null ? void 0 : texts.createAccount
790
+ )))));
791
+ };
792
+
793
+ // components/blocks/auth/CheckEmail.tsx
794
+ import React5 from "react";
795
+ var CheckEmail = ({ texts, handleResend }) => {
796
+ return /* @__PURE__ */ React5.createElement(Card, null, /* @__PURE__ */ React5.createElement(CardContent, { headless: true }, /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center" }, /* @__PURE__ */ React5.createElement("div", { className: "hawa-flex hawa-h-16 hawa-w-16 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold hawa-text-primary-foreground" }, /* @__PURE__ */ React5.createElement(
797
+ "svg",
798
+ {
799
+ stroke: "currentColor",
800
+ fill: "none",
801
+ strokeWidth: "2",
802
+ viewBox: "0 0 24 24",
803
+ strokeLinecap: "round",
804
+ strokeLinejoin: "round",
805
+ height: "0.5em",
806
+ width: "0.5em",
807
+ xmlns: "http://www.w3.org/2000/svg"
808
+ },
809
+ /* @__PURE__ */ React5.createElement("path", { d: "M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z" }),
810
+ /* @__PURE__ */ React5.createElement("polyline", { points: "22,6 12,13 2,6" })
811
+ )), /* @__PURE__ */ React5.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.checkEmail) || "Check your Email"), /* @__PURE__ */ React5.createElement("div", { className: "hawa-text-sm" }, (texts == null ? void 0 : texts.pleaseVerify) || "Thank you for signing up! To complete your registration, we've sent a verification email to the address you provided. Please check your inbox and follow the instructions in the email to activate your account."))), /* @__PURE__ */ React5.createElement(CardFooter, { className: "hawa-flex hawa-flex-col hawa-justify-center " }, /* @__PURE__ */ React5.createElement("span", { className: "clickable-link hawa-text-sm", onClick: handleResend }, (texts == null ? void 0 : texts.resendEmail) || "Resend Email")));
812
+ };
813
+
814
+ // components/blocks/auth/NewPassword.tsx
815
+ import React6, { useState as useState3 } from "react";
816
+ import { Controller as Controller3, useForm as useForm3 } from "react-hook-form";
817
+ import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
818
+ import * as z3 from "zod";
819
+ var NewPasswordForm = ({ texts, ...props }) => {
820
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
821
+ const formSchema = z3.object({
822
+ password: z3.string({ required_error: (_a = texts == null ? void 0 : texts.password) == null ? void 0 : _a.required }).min(1, { message: (_b = texts == null ? void 0 : texts.password) == null ? void 0 : _b.required }).min(8, { message: (_c = texts == null ? void 0 : texts.password) == null ? void 0 : _c.tooShort }),
823
+ confirm_password: z3.string({ required_error: (_d = texts == null ? void 0 : texts.confirm) == null ? void 0 : _d.required }).refine((value) => value !== "", {
824
+ message: (_e = texts == null ? void 0 : texts.password) == null ? void 0 : _e.required
825
+ })
826
+ }).refine((data) => data.password === data.confirm_password, {
827
+ message: (_f = texts == null ? void 0 : texts.confirm) == null ? void 0 : _f.dontMatch,
828
+ path: ["confirm_password"]
829
+ });
830
+ const { handleSubmit, control, formState } = useForm3({
831
+ resolver: zodResolver3(formSchema)
832
+ });
833
+ const [matchError, setMatchError] = useState3(false);
834
+ return /* @__PURE__ */ React6.createElement(Card, { dir: props.direction }, matchError && /* @__PURE__ */ React6.createElement(Alert, { text: (_g = texts == null ? void 0 : texts.confirm) == null ? void 0 : _g.dontMatch, severity: "error" }), props.passwordChanged ? /* @__PURE__ */ React6.createElement(CardContent, { headless: true }, /* @__PURE__ */ React6.createElement("div", { className: "hawa-text-center" }, texts == null ? void 0 : texts.passwordChanged)) : /* @__PURE__ */ React6.createElement(
835
+ "form",
836
+ {
837
+ noValidate: true,
838
+ onSubmit: handleSubmit((e) => {
839
+ if (props.handleNewPassword) {
840
+ return props.handleNewPassword(e);
841
+ } else {
842
+ console.log(
843
+ "Form is submitted but handleSubmission prop is missing"
844
+ );
845
+ }
846
+ })
847
+ },
848
+ !props.headless && /* @__PURE__ */ React6.createElement(CardHeader, null, /* @__PURE__ */ React6.createElement(CardTitle, null, "Create Password"), /* @__PURE__ */ React6.createElement(CardDescription, null, "Set a new password for your account")),
849
+ /* @__PURE__ */ React6.createElement(
850
+ CardContent,
851
+ {
852
+ headless: props.headless,
853
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
854
+ },
855
+ /* @__PURE__ */ React6.createElement(
856
+ Controller3,
857
+ {
858
+ control,
859
+ name: "password",
860
+ render: ({ field }) => {
861
+ var _a2, _b2, _c2;
862
+ return /* @__PURE__ */ React6.createElement(
863
+ Input,
864
+ {
865
+ width: "full",
866
+ type: "password",
867
+ autoComplete: "new-password",
868
+ label: (_a2 = texts == null ? void 0 : texts.password) == null ? void 0 : _a2.label,
869
+ placeholder: (_b2 = texts == null ? void 0 : texts.password) == null ? void 0 : _b2.placeholder,
870
+ helperText: (_c2 = formState.errors.password) == null ? void 0 : _c2.message,
871
+ ...field
872
+ }
873
+ );
874
+ }
875
+ }
876
+ ),
877
+ /* @__PURE__ */ React6.createElement(
878
+ Controller3,
879
+ {
880
+ control,
881
+ name: "confirm_password",
882
+ render: ({ field }) => {
883
+ var _a2, _b2, _c2;
884
+ return /* @__PURE__ */ React6.createElement(
885
+ Input,
886
+ {
887
+ width: "full",
888
+ type: "password",
889
+ autoComplete: "new-password",
890
+ label: (_a2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _a2.label,
891
+ placeholder: (_b2 = texts == null ? void 0 : texts.confirm) == null ? void 0 : _b2.placeholder,
892
+ helperText: (_c2 = formState.errors.confirm_password) == null ? void 0 : _c2.message,
893
+ ...field
894
+ }
895
+ );
896
+ }
897
+ }
898
+ )
899
+ ),
900
+ /* @__PURE__ */ React6.createElement(CardFooter, { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ React6.createElement(Button, { className: "hawa-w-full", type: "submit" }, texts == null ? void 0 : texts.updatePassword), props.allowRegister && /* @__PURE__ */ React6.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, (_h = texts == null ? void 0 : texts.dontHaveAccount) != null ? _h : "Don't have an account? ", /* @__PURE__ */ React6.createElement(
901
+ "span",
902
+ {
903
+ className: "clickable-link",
904
+ onClick: props.handleRouteToRegister
905
+ },
906
+ (_i = texts == null ? void 0 : texts.registerText) != null ? _i : "Register"
907
+ )))
908
+ ));
909
+ };
910
+
911
+ // components/blocks/auth/ResetPassword.tsx
912
+ import React7 from "react";
913
+ import { Controller as Controller4, useForm as useForm4 } from "react-hook-form";
914
+ import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
915
+ import * as z4 from "zod";
916
+ var ResetPasswordForm = (props) => {
917
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
918
+ const formSchema = z4.object({
919
+ email: z4.string({ required_error: (_b = (_a = props.texts) == null ? void 0 : _a.email) == null ? void 0 : _b.required }).email({ message: (_d = (_c = props.texts) == null ? void 0 : _c.email) == null ? void 0 : _d.invalid }).min(1, { message: (_f = (_e = props.texts) == null ? void 0 : _e.email) == null ? void 0 : _f.required })
920
+ });
921
+ const { handleSubmit, control, formState } = useForm4({
922
+ resolver: zodResolver4(formSchema)
923
+ });
924
+ return /* @__PURE__ */ React7.createElement(Card, { dir: props.direction }, !props.sent ? /* @__PURE__ */ React7.createElement(React7.Fragment, null, !props.headless && /* @__PURE__ */ React7.createElement(CardHeader, null, /* @__PURE__ */ React7.createElement(CardTitle, null, " ", ((_g = props.texts) == null ? void 0 : _g.headTitle) || "Reset Password"), /* @__PURE__ */ React7.createElement(CardDescription, null, ((_h = props.texts) == null ? void 0 : _h.headDescription) || "Enter your email to reset your account password")), /* @__PURE__ */ React7.createElement(
925
+ "form",
926
+ {
927
+ noValidate: true,
928
+ onSubmit: handleSubmit((e) => {
929
+ if (props.handleResetPassword) {
930
+ return props.handleResetPassword(e);
931
+ } else {
932
+ console.log("handleResetPassword prop is missing");
933
+ }
934
+ })
935
+ },
936
+ /* @__PURE__ */ React7.createElement(CardContent, { headless: props.headless }, /* @__PURE__ */ React7.createElement(
937
+ Controller4,
938
+ {
939
+ control,
940
+ name: "email",
941
+ render: ({ field }) => {
942
+ var _a2, _b2, _c2, _d2, _e2;
943
+ return /* @__PURE__ */ React7.createElement(
944
+ Input,
945
+ {
946
+ width: "full",
947
+ label: (_b2 = (_a2 = props.texts) == null ? void 0 : _a2.email) == null ? void 0 : _b2.label,
948
+ helperText: (_c2 = formState.errors.email) == null ? void 0 : _c2.message,
949
+ placeholder: (_e2 = (_d2 = props.texts) == null ? void 0 : _d2.email) == null ? void 0 : _e2.placeholder,
950
+ ...field
951
+ }
952
+ );
953
+ }
954
+ }
955
+ )),
956
+ /* @__PURE__ */ React7.createElement(CardFooter, { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ React7.createElement(Button, { type: "submit", className: "hawa-w-full" }, (_i = props.texts) == null ? void 0 : _i.resetPassword), props.allowRegister && /* @__PURE__ */ React7.createElement("div", { className: "hawa-mt-4 hawa-pb-0 hawa-text-center hawa-text-sm dark:hawa-text-gray-300" }, (_k = (_j = props.texts) == null ? void 0 : _j.dontHaveAccount) != null ? _k : "Don't have an account? ", /* @__PURE__ */ React7.createElement(
957
+ "span",
958
+ {
959
+ className: "clickable-link",
960
+ onClick: props.handleRouteToRegister
961
+ },
962
+ (_m = (_l = props.texts) == null ? void 0 : _l.registerText) != null ? _m : "Register"
963
+ )))
964
+ )) : /* @__PURE__ */ React7.createElement(CardContent, { headless: true }, /* @__PURE__ */ React7.createElement("div", { className: "hawa-text-center" }, (_n = props.texts) == null ? void 0 : _n.emailSentText)));
965
+ };
966
+
967
+ // components/blocks/auth/CodeConfirmation.tsx
968
+ import React8, { useEffect, useState as useState4 } from "react";
969
+ import { Controller as Controller5, useForm as useForm5 } from "react-hook-form";
970
+ import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
971
+ import * as z5 from "zod";
972
+ var CodeConfirmation = (props) => {
973
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
974
+ const formSchema = z5.object({
975
+ otp_code: z5.string({ required_error: (_a = props.texts) == null ? void 0 : _a.codeRequiredText }).min(6, { message: (_b = props.texts) == null ? void 0 : _b.codeTooShort })
976
+ });
977
+ const { handleSubmit, control, formState, setValue } = useForm5({
978
+ resolver: zodResolver5(formSchema)
979
+ });
980
+ const [resendTimer, setResendTimer] = useState4(null);
981
+ const [remainingTime, setRemainingTime] = useState4(0);
982
+ const [showResendTimer, setShowResendTimer] = useState4(false);
983
+ const startResendTimer = () => {
984
+ if (resendTimer !== null) {
985
+ clearInterval(resendTimer);
986
+ setResendTimer(null);
987
+ }
988
+ const timerDuration = 60;
989
+ setRemainingTime(timerDuration);
990
+ setShowResendTimer(true);
991
+ const newTimer = window.setInterval(() => {
992
+ setRemainingTime((prevTime) => {
993
+ if (prevTime > 0) {
994
+ return prevTime - 1;
995
+ } else {
996
+ clearInterval(newTimer);
997
+ setShowResendTimer(false);
998
+ return 0;
999
+ }
1000
+ });
1001
+ }, 1e3);
1002
+ setResendTimer(newTimer);
1003
+ };
1004
+ useEffect(() => {
1005
+ return () => {
1006
+ if (resendTimer !== null) {
1007
+ clearInterval(resendTimer);
1008
+ }
1009
+ };
1010
+ }, []);
1011
+ return /* @__PURE__ */ React8.createElement(Card, null, /* @__PURE__ */ React8.createElement(CardContent, { headless: true }, props.showError && /* @__PURE__ */ React8.createElement(
1012
+ Alert,
1013
+ {
1014
+ title: props.errorTitle,
1015
+ text: props.errorText,
1016
+ severity: "error"
1017
+ }
1018
+ ), /* @__PURE__ */ React8.createElement("div", { className: "hawa-mb-4 dark:hawa-text-white" }, /* @__PURE__ */ React8.createElement("div", { className: "hawa-text-lg hawa-font-bold" }, ((_c = props.texts) == null ? void 0 : _c.checkYourPhone) || "Please check your phone"), /* @__PURE__ */ React8.createElement("div", { className: "hawa-text-muted-foreground" }, /* @__PURE__ */ React8.createElement("span", null, ((_d = props.texts) == null ? void 0 : _d.weSentCode) || "We've sent a code to "), /* @__PURE__ */ React8.createElement("span", null, props.phoneNumber))), /* @__PURE__ */ React8.createElement(
1019
+ "form",
1020
+ {
1021
+ noValidate: true,
1022
+ onSubmit: handleSubmit((e) => {
1023
+ if (props.handleConfirm) {
1024
+ return props.handleConfirm(e);
1025
+ } else {
1026
+ console.log(
1027
+ "Form is submitted but handleConfirm prop is missing"
1028
+ );
1029
+ }
1030
+ })
1031
+ },
1032
+ /* @__PURE__ */ React8.createElement(
1033
+ Controller5,
1034
+ {
1035
+ control,
1036
+ name: "otp_code",
1037
+ render: ({ field }) => {
1038
+ var _a2;
1039
+ return /* @__PURE__ */ React8.createElement(
1040
+ PinInput,
1041
+ {
1042
+ width: "full",
1043
+ digits: 6,
1044
+ getPins: (e) => setValue("otp_code", e.join("")),
1045
+ helperText: (_a2 = formState.errors.otp_code) == null ? void 0 : _a2.message
1046
+ }
1047
+ );
1048
+ }
1049
+ }
1050
+ ),
1051
+ showResendTimer ? /* @__PURE__ */ React8.createElement("div", { className: " hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, (_e = props.texts) == null ? void 0 : _e.resendCodeTimer, " ", /* @__PURE__ */ React8.createElement("strong", null, remainingTime), " ", (_f = props.texts) == null ? void 0 : _f.seconds) : /* @__PURE__ */ React8.createElement("div", { className: " hawa-py-2 hawa-text-center hawa-text-xs hawa-text-muted-foreground" }, /* @__PURE__ */ React8.createElement("span", null, (_h = (_g = props.texts) == null ? void 0 : _g.didntGetCode) != null ? _h : "Didn't get the code?"), " ", /* @__PURE__ */ React8.createElement(
1052
+ "span",
1053
+ {
1054
+ className: "clickable-link",
1055
+ onClick: () => {
1056
+ startResendTimer();
1057
+ props.handleResend();
1058
+ }
1059
+ },
1060
+ ((_i = props.texts) == null ? void 0 : _i.resendCode) || "Click to resend"
1061
+ )),
1062
+ /* @__PURE__ */ React8.createElement("div", { className: "hawa-mt-4 hawa-grid hawa-grid-cols-2 hawa-gap-2" }, /* @__PURE__ */ React8.createElement(Button, { variant: "secondary" }, ((_j = props.texts) == null ? void 0 : _j.cancel) || "Cancel"), /* @__PURE__ */ React8.createElement(Button, { isLoading: props.confirmLoading }, ((_k = props.texts) == null ? void 0 : _k.confirm) || "Confirm"))
1063
+ )));
1064
+ };
1065
+
1066
+ // components/blocks/feedback/UserReferralSource.tsx
1067
+ import React9, { useRef, useState as useState5 } from "react";
1068
+ import { Controller as Controller6, useForm as useForm6 } from "react-hook-form";
1069
+ import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
1070
+ import * as z6 from "zod";
1071
+ var UserReferralSource = ({
1072
+ position = "bottom-right",
1073
+ options = [],
1074
+ ...props
1075
+ }) => {
1076
+ var _a, _b;
1077
+ const [closed, setClosed] = useState5(false);
1078
+ const popUpRef = useRef(null);
1079
+ const formSchema = z6.object({
1080
+ source: z6.string({ required_error: (_a = props.texts) == null ? void 0 : _a.pleaseSelectOption }),
1081
+ feedback: z6.string().optional()
1082
+ });
1083
+ const { handleSubmit, control, formState, watch } = useForm6({
1084
+ resolver: zodResolver6(formSchema)
1085
+ });
1086
+ const selectedSource = watch("source");
1087
+ const boxPosition = {
1088
+ "bottom-right": "hawa-right-4",
1089
+ "bottom-left": "hawa-left-4"
1090
+ };
1091
+ const optionsWithOther = [
1092
+ ...options,
1093
+ {
1094
+ value: "other",
1095
+ label: "Other"
1096
+ }
1097
+ ];
1098
+ return /* @__PURE__ */ React9.createElement(
1099
+ "div",
1100
+ {
1101
+ className: cn(
1102
+ "hawa-transition-all",
1103
+ closed ? "hawa-opacity-0" : "hawa-opacity-100"
1104
+ ),
1105
+ ref: popUpRef
1106
+ },
1107
+ /* @__PURE__ */ React9.createElement(
1108
+ Card,
1109
+ {
1110
+ className: cn(
1111
+ "hawa-fixed hawa-bottom-4 hawa-p-0 ",
1112
+ boxPosition[position]
1113
+ ),
1114
+ dir: props.direction
1115
+ },
1116
+ /* @__PURE__ */ React9.createElement(
1117
+ "button",
1118
+ {
1119
+ type: "button",
1120
+ className: cn(
1121
+ props.direction === "rtl" ? "hawa-left-2" : "hawa-right-2",
1122
+ "hawa-absolute hawa-top-2 hawa-inline-flex hawa-h-8 hawa-w-8 hawa-rounded hawa-p-1.5 hawa-text-gray-400 hawa-transition-all hover:hawa-bg-gray-100 hover:hawa-text-gray-900 focus:hawa-ring-2 focus:hawa-ring-gray-300 dark:hawa-bg-gray-800 dark:hawa-text-gray-500 dark:hover:hawa-bg-gray-700 dark:hover:hawa-text-white"
1123
+ ),
1124
+ "data-dismiss-target": "#toast-default",
1125
+ "aria-label": "Close",
1126
+ onClick: () => {
1127
+ setClosed(true);
1128
+ setTimeout(() => {
1129
+ if (popUpRef == null ? void 0 : popUpRef.current) {
1130
+ popUpRef == null ? void 0 : popUpRef.current.removeChild(popUpRef == null ? void 0 : popUpRef.current.children[0]);
1131
+ }
1132
+ }, 200);
1133
+ }
1134
+ },
1135
+ /* @__PURE__ */ React9.createElement(
1136
+ "svg",
1137
+ {
1138
+ "aria-hidden": "true",
1139
+ className: "hawa-h-5 hawa-w-5",
1140
+ fill: "currentColor",
1141
+ viewBox: "0 0 20 20"
1142
+ },
1143
+ /* @__PURE__ */ React9.createElement(
1144
+ "path",
1145
+ {
1146
+ fillRule: "evenodd",
1147
+ d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
1148
+ clipRule: "evenodd"
1149
+ }
1150
+ )
1151
+ )
1152
+ ),
1153
+ /* @__PURE__ */ React9.createElement(CardContent, { headless: true }, /* @__PURE__ */ React9.createElement(
1154
+ "form",
1155
+ {
1156
+ noValidate: true,
1157
+ onSubmit: handleSubmit((e) => {
1158
+ if (props.onSubmitForm) {
1159
+ props.onSubmitForm(e);
1160
+ } else {
1161
+ console.log("onSubmitForm was not provided");
1162
+ }
1163
+ })
1164
+ },
1165
+ /* @__PURE__ */ React9.createElement(
1166
+ "div",
1167
+ {
1168
+ className: cn(
1169
+ "hawa-flex hawa-flex-col hawa-gap-4 hawa-transition-all",
1170
+ closed ? "hawa-opacity-0" : "hawa-opacity-100"
1171
+ )
1172
+ },
1173
+ /* @__PURE__ */ React9.createElement("div", { className: "hawa-mt-4 hawa-font-bold" }, props.question),
1174
+ /* @__PURE__ */ React9.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-row hawa-gap-1 hawa-rounded " }, /* @__PURE__ */ React9.createElement(
1175
+ Controller6,
1176
+ {
1177
+ control,
1178
+ name: "source",
1179
+ render: ({ field }) => {
1180
+ var _a2, _b2;
1181
+ return /* @__PURE__ */ React9.createElement(
1182
+ Radio,
1183
+ {
1184
+ direction: props.direction,
1185
+ orientation: "vertical",
1186
+ options: optionsWithOther,
1187
+ defaultValue: field.value,
1188
+ onChangeTab: (e) => field.onChange(e.value),
1189
+ helperText: (_b2 = (_a2 = formState.errors.source) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
1190
+ }
1191
+ );
1192
+ }
1193
+ }
1194
+ )),
1195
+ /* @__PURE__ */ React9.createElement("div", null, /* @__PURE__ */ React9.createElement(
1196
+ Controller6,
1197
+ {
1198
+ control,
1199
+ name: "feedback",
1200
+ render: ({ field }) => {
1201
+ var _a2, _b2;
1202
+ return /* @__PURE__ */ React9.createElement(
1203
+ Textarea,
1204
+ {
1205
+ ...field,
1206
+ textareaProps: {
1207
+ onChange: (e) => field.onChange(e.target.value),
1208
+ disabled: selectedSource !== "other"
1209
+ },
1210
+ helperText: (_b2 = (_a2 = formState.errors.feedback) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()
1211
+ }
1212
+ );
1213
+ }
1214
+ }
1215
+ ))
1216
+ ),
1217
+ /* @__PURE__ */ React9.createElement(Button, { type: "submit", className: "hawa-mt-4 hawa-w-full" }, ((_b = props.texts) == null ? void 0 : _b.submit) || "Submit")
1218
+ ))
1219
+ )
1220
+ );
1221
+ };
1222
+
1223
+ // components/blocks/feedback/FeedbackRating.tsx
1224
+ import React10, { useEffect as useEffect2, useRef as useRef2, useState as useState6 } from "react";
1225
+ var FeedbackRating = ({
1226
+ position = "bottom-right",
1227
+ ...props
1228
+ }) => {
1229
+ const [closed, setClosed] = useState6(false);
1230
+ const [answered, setAnswered] = useState6(false);
1231
+ const [clickedOption, setClickedOption] = useState6(null);
1232
+ const [closingTimer, setClosingTimer] = useState6(5);
1233
+ const popUpRef = useRef2(null);
1234
+ const boxPosition = {
1235
+ "bottom-right": "hawa-right-4",
1236
+ "bottom-left": "hawa-left-4"
1237
+ };
1238
+ useEffect2(() => {
1239
+ const timeoutHide = setTimeout(() => {
1240
+ if (closingTimer >= 0) {
1241
+ setClosingTimer(closingTimer - 1);
1242
+ }
1243
+ }, 1e3);
1244
+ return () => {
1245
+ clearTimeout(timeoutHide);
1246
+ };
1247
+ }, [closingTimer]);
1248
+ const slowClose = () => {
1249
+ setClosed(true);
1250
+ setTimeout(() => {
1251
+ if (popUpRef.current) {
1252
+ popUpRef.current.removeChild(popUpRef.current.children[0]);
1253
+ }
1254
+ }, 200);
1255
+ };
1256
+ return /* @__PURE__ */ React10.createElement(
1257
+ "div",
1258
+ {
1259
+ ref: popUpRef,
1260
+ className: cn(
1261
+ props.banner ? "hawa-fixed hawa-bottom-0 hawa-left-0 hawa-w-full hawa-px-0 md:hawa-px-4" : "hawa-fixed hawa-bottom-4 ",
1262
+ boxPosition[position]
1263
+ )
1264
+ },
1265
+ /* @__PURE__ */ React10.createElement(
1266
+ "div",
1267
+ {
1268
+ className: cn(
1269
+ "hawa-relative hawa-flex hawa-w-full hawa-flex-col hawa-gap-2 hawa-rounded hawa-border hawa-bg-background hawa-p-4 hawa-shadow-md hawa-transition-all",
1270
+ closed ? "hawa-opacity-0" : "hawa-opacity-100",
1271
+ props.banner && "hawa-rounded-none hawa-px-4 md:hawa-rounded-t md:hawa-px-64"
1272
+ )
1273
+ },
1274
+ /* @__PURE__ */ React10.createElement("div", { className: "hawa-absolute hawa-left-2 hawa-top-2 hawa-p-1.5 hawa-text-sm" }, props.title),
1275
+ /* @__PURE__ */ React10.createElement(
1276
+ "button",
1277
+ {
1278
+ type: "button",
1279
+ className: "hawa-absolute hawa-right-2 hawa-top-2 hawa-inline-flex hawa-h-8 hawa-w-8 hawa-rounded hawa-p-1.5 hawa-text-gray-400 hover:hawa-bg-gray-100 hover:hawa-text-gray-900 focus:hawa-ring-2 focus:hawa-ring-gray-300 dark:hawa-bg-gray-800 dark:hawa-text-gray-500 dark:hover:hawa-bg-gray-700 dark:hover:hawa-text-white",
1280
+ "data-dismiss-target": "#toast-default",
1281
+ "aria-label": "Close",
1282
+ onClick: () => slowClose()
1283
+ },
1284
+ /* @__PURE__ */ React10.createElement(
1285
+ "svg",
1286
+ {
1287
+ "aria-hidden": "true",
1288
+ className: "hawa-h-5 hawa-w-5",
1289
+ fill: "currentColor",
1290
+ viewBox: "0 0 20 20"
1291
+ },
1292
+ /* @__PURE__ */ React10.createElement(
1293
+ "path",
1294
+ {
1295
+ fillRule: "evenodd",
1296
+ d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
1297
+ clipRule: "evenodd"
1298
+ }
1299
+ )
1300
+ )
1301
+ ),
1302
+ /* @__PURE__ */ React10.createElement("div", { className: "hawa-mt-8" }, props.question),
1303
+ /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-row hawa-gap-1 hawa-rounded" }, props.options && props.options.map((op, i) => /* @__PURE__ */ React10.createElement(
1304
+ "span",
1305
+ {
1306
+ key: i,
1307
+ onClick: () => {
1308
+ if (props.onOptionClicked) {
1309
+ props.onOptionClicked(op);
1310
+ }
1311
+ setClickedOption(op);
1312
+ setAnswered(true);
1313
+ const timeoutDestroy = setTimeout(() => {
1314
+ setClosed(true);
1315
+ }, 4800);
1316
+ setTimeout(() => {
1317
+ var _a, _b;
1318
+ (_b = popUpRef.current) == null ? void 0 : _b.removeChild(
1319
+ (_a = popUpRef.current) == null ? void 0 : _a.children[0]
1320
+ );
1321
+ clearTimeout(timeoutDestroy);
1322
+ }, 5300);
1323
+ },
1324
+ className: cn(
1325
+ "hawa-w-full hawa-cursor-pointer hawa-rounded hawa-border hawa-p-4 hawa-text-center hawa-transition-all ",
1326
+ clickedOption === op ? "hawa-bg-gray-500 hawa-text-white" : "hawa-border hawa-bg-background hover:hawa-bg-gray-300 dark:hover:hawa-bg-gray-700"
1327
+ )
1328
+ },
1329
+ op
1330
+ ))),
1331
+ props.texts && /* @__PURE__ */ React10.createElement("div", { className: " hawa-flex hawa-flex-row hawa-justify-between hawa-text-xs" }, /* @__PURE__ */ React10.createElement("span", null, props.texts.least), /* @__PURE__ */ React10.createElement("span", null, props.texts.most)),
1332
+ answered && /* @__PURE__ */ React10.createElement("div", { className: "hawa-absolute hawa-left-0 hawa-top-0 hawa-flex hawa-h-full hawa-w-full hawa-flex-col hawa-items-center hawa-justify-center hawa-gap-2 hawa-rounded hawa-bg-black hawa-bg-opacity-80 hawa-p-4 hawa-text-center hawa-transition-all" }, /* @__PURE__ */ React10.createElement("span", { className: "hawa-font-bold hawa-text-white" }, "Thank you for your answer. This box will disappear in", " " + closingTimer, " seconds"), /* @__PURE__ */ React10.createElement("div", { className: "hawa-flex hawa-flex-row hawa-gap-2" }, /* @__PURE__ */ React10.createElement(Button, { variant: "secondary", onClick: () => slowClose() }, "Close")))
1333
+ )
1334
+ );
1335
+ };
1336
+
1337
+ // components/blocks/feedback/FeedbackEmoji.tsx
1338
+ import React11, { useState as useState7 } from "react";
1339
+ var FeedbackEmoji = (props) => {
1340
+ const [selectedEmoji, setSelectedEmoji] = useState7(null);
1341
+ const [loadingSubmit, setLoadingSubmit] = useState7(false);
1342
+ const [feedbackText, setFeedbackText] = useState7("");
1343
+ const [helperText, setHelperText] = useState7(false);
1344
+ let emojis = [
1345
+ { icon: /* @__PURE__ */ React11.createElement(VeryGoodEmoji, null), value: "very-good" },
1346
+ { icon: /* @__PURE__ */ React11.createElement(GoodEmoji, null), value: "good" },
1347
+ { icon: /* @__PURE__ */ React11.createElement(BadEmoji, null), value: "bad" },
1348
+ { icon: /* @__PURE__ */ React11.createElement(VeryBadEmoji, null), value: "very-bad" }
1349
+ ];
1350
+ const onFeedbackSubmit = async () => {
1351
+ if (feedbackText) {
1352
+ setLoadingSubmit(true);
1353
+ try {
1354
+ await props.handleSubmit({
1355
+ choice: selectedEmoji,
1356
+ feedback: feedbackText
1357
+ });
1358
+ } catch (error) {
1359
+ console.error("Error during submission:", error);
1360
+ setLoadingSubmit(false);
1361
+ }
1362
+ await setLoadingSubmit(false);
1363
+ } else {
1364
+ setLoadingSubmit(false);
1365
+ setHelperText(true);
1366
+ }
1367
+ };
1368
+ return /* @__PURE__ */ React11.createElement(
1369
+ "div",
1370
+ {
1371
+ className: cn(
1372
+ "hawa-flex hawa-flex-col hawa-rounded hawa-border hawa-p-2 hawa-transition-all",
1373
+ selectedEmoji ? "hawa-h-[189px] hawa-min-w-fit" : "hawa-h-[44px] "
1374
+ )
1375
+ },
1376
+ /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-center hawa-gap-2 " }, /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-center hawa-gap-0.5 " }, emojis.map((emoji, i) => /* @__PURE__ */ React11.createElement(
1377
+ Button,
1378
+ {
1379
+ key: i,
1380
+ onClick: () => {
1381
+ if (selectedEmoji === emoji.value) {
1382
+ setSelectedEmoji("");
1383
+ } else {
1384
+ setSelectedEmoji(emoji.value);
1385
+ }
1386
+ },
1387
+ variant: "ghost",
1388
+ size: "smallIcon",
1389
+ className: cn(
1390
+ selectedEmoji === emoji.value ? "hawa-bg-primary/10 hover:hawa-bg-primary/10 " : "hawa-text-[#666666]"
1391
+ )
1392
+ },
1393
+ emoji.icon
1394
+ )))),
1395
+ /* @__PURE__ */ React11.createElement(
1396
+ "div",
1397
+ {
1398
+ className: cn(
1399
+ "hawa-flex hawa-flex-col hawa-overflow-clip hawa-transition-all hawa-duration-500 hawa-ease-in-out ",
1400
+ selectedEmoji ? "hawa-visible hawa-opacity-100" : "hawa-invisible hawa-opacity-0 "
1401
+ )
1402
+ },
1403
+ props.showSuccess ? /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-h-full hawa-flex-col hawa-items-center hawa-justify-center hawa-gap-2 hawa-pt-4" }, /* @__PURE__ */ React11.createElement("div", { className: "hawa-rounded hawa-bg-primary hawa-p-2 hawa-text-primary-foreground" }, /* @__PURE__ */ React11.createElement(
1404
+ "svg",
1405
+ {
1406
+ stroke: "currentColor",
1407
+ fill: "currentColor",
1408
+ strokeWidth: "0",
1409
+ viewBox: "0 0 512 512",
1410
+ height: "0.5em",
1411
+ width: "0.5em"
1412
+ },
1413
+ /* @__PURE__ */ React11.createElement("path", { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })
1414
+ )), /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-col hawa-text-center hawa-text-sm" }, /* @__PURE__ */ React11.createElement("span", null, "Your feedback has been received!"), /* @__PURE__ */ React11.createElement("span", null, "Thank you for your help"))) : /* @__PURE__ */ React11.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-1 hawa-p-1" }, /* @__PURE__ */ React11.createElement(
1415
+ Popover,
1416
+ {
1417
+ className: "hawa-select-none hawa-p-1 hawa-text-xs ",
1418
+ open: helperText,
1419
+ trigger: /* @__PURE__ */ React11.createElement(
1420
+ Textarea,
1421
+ {
1422
+ className: cn("hawa-mt-2 hawa-h-full hawa-resize-none"),
1423
+ placeholder: "Your feedback",
1424
+ onChange: (e) => {
1425
+ if (e.target.value) {
1426
+ setHelperText(false);
1427
+ }
1428
+ setFeedbackText(e.target.value);
1429
+ }
1430
+ }
1431
+ )
1432
+ },
1433
+ /* @__PURE__ */ React11.createElement("span", { className: "hawa-m-0" }, "Please enter your feedback")
1434
+ ), /* @__PURE__ */ React11.createElement(
1435
+ Button,
1436
+ {
1437
+ isLoading: loadingSubmit,
1438
+ onClick: onFeedbackSubmit,
1439
+ className: "hawa-w-full",
1440
+ size: "sm"
1441
+ },
1442
+ "Submit"
1443
+ ))
1444
+ )
1445
+ );
1446
+ };
1447
+
1448
+ // components/blocks/feedback/FeedbackForm.tsx
1449
+ import React12 from "react";
1450
+ import { useForm as useForm7, Controller as Controller7 } from "react-hook-form";
1451
+ import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
1452
+ import * as z7 from "zod";
1453
+ var FeedbackForm = (props) => {
1454
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
1455
+ const formSchema = z7.object({
1456
+ requestType: z7.string({ required_error: (_b = (_a = props.texts) == null ? void 0 : _a.requestType) == null ? void 0 : _b.required }).min(1, { message: (_d = (_c = props.texts) == null ? void 0 : _c.requestType) == null ? void 0 : _d.required }),
1457
+ description: z7.string({ required_error: (_f = (_e = props.texts) == null ? void 0 : _e.description) == null ? void 0 : _f.required }).min(10, { message: (_h = (_g = props.texts) == null ? void 0 : _g.description) == null ? void 0 : _h.tooShort })
1458
+ });
1459
+ const { handleSubmit, control, formState } = useForm7({
1460
+ resolver: zodResolver7(formSchema)
1461
+ });
1462
+ return /* @__PURE__ */ React12.createElement(
1463
+ Card,
1464
+ {
1465
+ className: cn(
1466
+ props.cardless ? "hawa-border-none hawa-bg-transparent hawa-shadow-none" : ""
1467
+ ),
1468
+ style: props.cardless ? { boxShadow: "none" } : void 0
1469
+ },
1470
+ /* @__PURE__ */ React12.createElement(CardContent, { headless: true }, /* @__PURE__ */ React12.createElement(
1471
+ "form",
1472
+ {
1473
+ noValidate: true,
1474
+ onSubmit: handleSubmit((e) => {
1475
+ if (props.onSubmit) {
1476
+ return props.onSubmit(e);
1477
+ } else {
1478
+ console.log("Form is submitted but onSubmit prop is missing");
1479
+ }
1480
+ }),
1481
+ className: "hawa-flex hawa-flex-col hawa-gap-4"
1482
+ },
1483
+ /* @__PURE__ */ React12.createElement(Label, null, (_j = (_i = props.texts) == null ? void 0 : _i.requestType) == null ? void 0 : _j.label),
1484
+ /* @__PURE__ */ React12.createElement(
1485
+ Controller7,
1486
+ {
1487
+ name: "requestType",
1488
+ control,
1489
+ render: ({ field }) => {
1490
+ var _a2, _b2, _c2, _d2, _e2, _f2;
1491
+ return /* @__PURE__ */ React12.createElement(
1492
+ Select,
1493
+ {
1494
+ ...field,
1495
+ ...props.selectProps,
1496
+ onChange: (option) => field.onChange(option.value),
1497
+ options: props.requestTypes,
1498
+ helperText: (_b2 = (_a2 = formState.errors.requestType) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString(),
1499
+ placeholder: (_d2 = (_c2 = props.texts) == null ? void 0 : _c2.requestType) == null ? void 0 : _d2.placeholder,
1500
+ texts: {
1501
+ noOptions: (_f2 = (_e2 = props.texts) == null ? void 0 : _e2.requestType) == null ? void 0 : _f2.noOptions
1502
+ }
1503
+ }
1504
+ );
1505
+ }
1506
+ }
1507
+ ),
1508
+ /* @__PURE__ */ React12.createElement(Label, null, (_l = (_k = props.texts) == null ? void 0 : _k.description) == null ? void 0 : _l.label),
1509
+ /* @__PURE__ */ React12.createElement(
1510
+ Controller7,
1511
+ {
1512
+ name: "description",
1513
+ control,
1514
+ render: ({ field }) => {
1515
+ var _a2, _b2, _c2, _d2;
1516
+ return /* @__PURE__ */ React12.createElement(
1517
+ Textarea,
1518
+ {
1519
+ ...field,
1520
+ helperText: formState.errors.description && ((_b2 = (_a2 = formState.errors.description) == null ? void 0 : _a2.message) == null ? void 0 : _b2.toString()),
1521
+ placeholder: (_d2 = (_c2 = props.texts) == null ? void 0 : _c2.description) == null ? void 0 : _d2.placeholder
1522
+ }
1523
+ );
1524
+ }
1525
+ }
1526
+ ),
1527
+ /* @__PURE__ */ React12.createElement(Button, { type: "submit" }, (_m = props.texts) == null ? void 0 : _m.submit)
1528
+ ))
1529
+ );
1530
+ };
1531
+
1532
+ // components/blocks/misc/LegalTexts.tsx
1533
+ import React13 from "react";
1534
+ var LegalTexts = ({ tabs, ...props }) => {
1535
+ return /* @__PURE__ */ React13.createElement(
1536
+ Tabs,
1537
+ {
1538
+ value: props.activeTab,
1539
+ onValueChange: props.handleTabChange,
1540
+ defaultValue: props.defaultTab || tabs[0].value,
1541
+ dir: props.direction
1542
+ },
1543
+ /* @__PURE__ */ React13.createElement(TabsList, { className: "hawa-w-full" }, tabs.map((tab, index) => /* @__PURE__ */ React13.createElement(TabsTrigger, { key: index, value: tab.value }, tab.title))),
1544
+ tabs.map((tab, index) => /* @__PURE__ */ React13.createElement(TabsContent, { key: index, value: tab.value }, /* @__PURE__ */ React13.createElement(
1545
+ ScrollArea,
1546
+ {
1547
+ className: cn(
1548
+ "hawa-rounded hawa-border hawa-bg-muted hawa-p-4",
1549
+ props.scrollAreaClassName
1550
+ )
1551
+ },
1552
+ tab.content
1553
+ )))
1554
+ );
1555
+ };
1556
+
1557
+ // components/blocks/misc/EmptyState.tsx
1558
+ import React14 from "react";
1559
+ var EmptyState = ({ texts, onActionClick }) => {
1560
+ return /* @__PURE__ */ React14.createElement(Card, null, /* @__PURE__ */ React14.createElement(CardContent, { headless: true }, /* @__PURE__ */ React14.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center " }, /* @__PURE__ */ React14.createElement("div", { className: "hawa-flex hawa-h-10 hawa-w-10 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold hawa-text-primary-foreground" }, /* @__PURE__ */ React14.createElement(
1561
+ "svg",
1562
+ {
1563
+ stroke: "currentColor",
1564
+ fill: "currentColor",
1565
+ strokeWidth: "0",
1566
+ viewBox: "0 0 512 512",
1567
+ height: "0.35em",
1568
+ width: "0.35em"
1569
+ },
1570
+ /* @__PURE__ */ React14.createElement("path", { d: "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" })
1571
+ )), /* @__PURE__ */ React14.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.youreCaughtUp) || "You're all caught up"))), /* @__PURE__ */ React14.createElement(CardFooter, null, /* @__PURE__ */ React14.createElement(Button, { className: "hawa-w-full", onClick: () => onActionClick() }, (texts == null ? void 0 : texts.actionText) || "Go Home")));
1572
+ };
1573
+
1574
+ // components/blocks/misc/Testimonial.tsx
1575
+ import React15 from "react";
1576
+ var Testimonial = () => {
1577
+ return /* @__PURE__ */ React15.createElement(Card, null, /* @__PURE__ */ React15.createElement(CardContent, { headless: true }, /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement("p", { className: "mb-4 max-w-sm" }, "The team at Sikka Software is simply amazing. The tech is easy to follow, easy to work with, and infinitely flexible. The solution opportunities created by Tines are endless.")), /* @__PURE__ */ React15.createElement("div", { className: "flex flex-row gap-4" }, /* @__PURE__ */ React15.createElement("svg", { width: "48", height: "48", viewBox: "0 0 48 48", fill: "none" }, /* @__PURE__ */ React15.createElement("rect", { width: "48", height: "48", rx: "24", fill: "#45BE8B" }), /* @__PURE__ */ React15.createElement(
1578
+ "path",
1579
+ {
1580
+ d: "M14.1412 22.4427L17.5803 16.5199C17.7671 16.1981 18.1112 16 18.4834 16H20.8581C21.653 16 22.1565 16.8528 21.7725 17.5488L19.3042 22.0225C19.2202 22.1747 19.1762 22.3458 19.1762 22.5196C19.1762 23.0879 19.6369 23.5486 20.2052 23.5486H21.5827C22.1594 23.5486 22.627 24.0162 22.627 24.5929V31.347C22.627 31.9237 22.1594 32.3913 21.5827 32.3913H15.0443C14.4676 32.3913 14 31.9237 14 31.347V22.9671C14 22.7829 14.0487 22.602 14.1412 22.4427Z",
1581
+ fill: "#FFFFFF"
1582
+ }
1583
+ ), /* @__PURE__ */ React15.createElement(
1584
+ "path",
1585
+ {
1586
+ d: "M25.356 22.4427L28.7951 16.5199C28.982 16.1981 29.326 16 29.6982 16H32.0729C32.8679 16 33.3713 16.8528 32.9873 17.5488L30.5191 22.0225C30.4351 22.1747 30.391 22.3458 30.391 22.5196C30.391 23.0879 30.8518 23.5486 31.4201 23.5486H32.7975C33.3743 23.5486 33.8418 24.0162 33.8418 24.5929V31.347C33.8418 31.9237 33.3743 32.3913 32.7975 32.3913H26.2592C25.6824 32.3913 25.2148 31.9237 25.2148 31.347V22.9671C25.2148 22.7829 25.2636 22.602 25.356 22.4427Z",
1587
+ fill: "#FFFFFF"
1588
+ }
1589
+ )), /* @__PURE__ */ React15.createElement("span", { className: "border border-l " }), " ", /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement("strong", null, "Brent Lassi"), /* @__PURE__ */ React15.createElement("div", null, " Chief Information Security Officer")))));
1590
+ };
1591
+
1592
+ // components/blocks/misc/LeadGenerator.tsx
1593
+ import React16 from "react";
1594
+ import { useForm as useForm8, Controller as Controller8 } from "react-hook-form";
1595
+ var LeadGenerator = ({ texts, submitHandler }) => {
1596
+ var _a;
1597
+ const { handleSubmit, control, formState } = useForm8();
1598
+ const onSubmit = (data) => {
1599
+ if (submitHandler) {
1600
+ submitHandler(data.email);
1601
+ } else {
1602
+ console.log("handleNewsletterSub props was not provided");
1603
+ }
1604
+ };
1605
+ return /* @__PURE__ */ React16.createElement(Card, null, /* @__PURE__ */ React16.createElement(CardHeader, null, /* @__PURE__ */ React16.createElement(CardTitle, null, texts == null ? void 0 : texts.title), /* @__PURE__ */ React16.createElement(CardDescription, null, texts == null ? void 0 : texts.subtitle)), /* @__PURE__ */ React16.createElement(CardContent, null, /* @__PURE__ */ React16.createElement(
1606
+ "form",
1607
+ {
1608
+ noValidate: true,
1609
+ className: "hawa-flex hawa-flex-row hawa-gap-2",
1610
+ onSubmit: handleSubmit(onSubmit)
1611
+ },
1612
+ /* @__PURE__ */ React16.createElement(
1613
+ Controller8,
1614
+ {
1615
+ name: "email",
1616
+ control,
1617
+ rules: {
1618
+ required: true,
1619
+ pattern: {
1620
+ value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,
1621
+ message: (texts == null ? void 0 : texts.invalidEmail) || "Invalid email address"
1622
+ }
1623
+ },
1624
+ defaultValue: "",
1625
+ render: ({ field }) => /* @__PURE__ */ React16.createElement(Input, { ...field, type: "email", placeholder: "example@sikka.io" })
1626
+ }
1627
+ ),
1628
+ /* @__PURE__ */ React16.createElement(Button, { type: "submit", disabled: !formState.isValid }, (_a = texts == null ? void 0 : texts.submit) != null ? _a : "Submit")
1629
+ )));
1630
+ };
1631
+
1632
+ // components/blocks/misc/Announcement.tsx
1633
+ import React17 from "react";
1634
+ var Announcement = ({
1635
+ onActionClick,
1636
+ ...props
1637
+ }) => {
1638
+ return /* @__PURE__ */ React17.createElement(Card, null, /* @__PURE__ */ React17.createElement(
1639
+ CardContent,
1640
+ {
1641
+ headless: true,
1642
+ className: "hawa-flex hawa-flex-row hawa-items-center hawa-justify-between"
1643
+ },
1644
+ /* @__PURE__ */ React17.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-start hawa-justify-center " }, /* @__PURE__ */ React17.createElement("span", { className: "hawa-text-lg hawa-font-bold" }, props.title), /* @__PURE__ */ React17.createElement("span", { className: "hawa-text-sm" }, props.subtitle)),
1645
+ /* @__PURE__ */ React17.createElement(
1646
+ Button,
1647
+ {
1648
+ onClick: () => onActionClick(),
1649
+ className: "hawa-whitespace-nowrap"
1650
+ },
1651
+ props.actionText
1652
+ )
1653
+ ));
1654
+ };
1655
+
1656
+ // components/blocks/misc/NotFound.tsx
1657
+ import React18 from "react";
1658
+ var NotFound = ({ texts }) => {
1659
+ return /* @__PURE__ */ React18.createElement(Card, null, /* @__PURE__ */ React18.createElement(CardContent, { headless: true }, /* @__PURE__ */ React18.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center dark:hawa-text-white" }, /* @__PURE__ */ React18.createElement("div", { className: "hawa-text-center hawa-text-6xl hawa-font-bold " }, "404"), /* @__PURE__ */ React18.createElement("div", { className: "hawa-m-2 hawa-text-center hawa-text-xl hawa-font-bold " }, (texts == null ? void 0 : texts.pageNotFound) || "Page Not Found"), /* @__PURE__ */ React18.createElement("div", { className: "hawa-mb-4 hawa-text-center" }, (texts == null ? void 0 : texts.ifLost) || /* @__PURE__ */ React18.createElement(React18.Fragment, null, "If you're lost please contact us ", /* @__PURE__ */ React18.createElement("span", { className: "clickable-link" }, "help@sikka.io"))), /* @__PURE__ */ React18.createElement(Button, { className: "hawa-w-full" }, (texts == null ? void 0 : texts.home) || "Home"))));
1660
+ };
1661
+
1662
+ // components/blocks/misc/NoPermission.tsx
1663
+ import React19 from "react";
1664
+ var NoPermission = ({ texts }) => {
1665
+ return /* @__PURE__ */ React19.createElement(Card, null, /* @__PURE__ */ React19.createElement(CardContent, { headless: true }, /* @__PURE__ */ React19.createElement("div", { className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-text-center" }, /* @__PURE__ */ React19.createElement("div", { className: "hawa-flex hawa-h-10 hawa-w-10 hawa-flex-col hawa-items-center hawa-justify-center hawa-rounded-3xl hawa-bg-primary hawa-text-6xl hawa-font-bold hawa-text-primary-foreground" }, /* @__PURE__ */ React19.createElement(
1666
+ "svg",
1667
+ {
1668
+ stroke: "currentColor",
1669
+ fill: "currentColor",
1670
+ strokeWidth: "0",
1671
+ viewBox: "0 0 448 512",
1672
+ height: "0.35em",
1673
+ width: "0.35em"
1674
+ },
1675
+ /* @__PURE__ */ React19.createElement("path", { d: "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" })
1676
+ )), /* @__PURE__ */ React19.createElement("div", { className: "hawa-m-2 hawa-text-xl hawa-font-bold" }, (texts == null ? void 0 : texts.title) || "You don't have permission"), /* @__PURE__ */ React19.createElement("div", null, (texts == null ? void 0 : texts.subtitle) || "If you think this is a problem please contact your administrator or our customer support"))));
1677
+ };
1678
+
1679
+ // components/blocks/misc/ContactForm.tsx
1680
+ import React20 from "react";
1681
+ import { useForm as useForm9, Controller as Controller9 } from "react-hook-form";
1682
+ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
1683
+ import * as z8 from "zod";
1684
+ var ContactForm = ({
1685
+ cardless,
1686
+ size = "default",
1687
+ texts,
1688
+ formId,
1689
+ formAutoComplete,
1690
+ onSubmit
1691
+ }) => {
1692
+ var _a, _b, _c;
1693
+ const contactFormSchema = z8.object({
1694
+ name: z8.string({ required_error: texts == null ? void 0 : texts.name.required }).min(1, texts == null ? void 0 : texts.name.required).default(""),
1695
+ email: z8.string({ required_error: (_a = texts == null ? void 0 : texts.email) == null ? void 0 : _a.required }).min(1, { message: (_b = texts == null ? void 0 : texts.email) == null ? void 0 : _b.required }).email({ message: (_c = texts == null ? void 0 : texts.email) == null ? void 0 : _c.invalid }).default(""),
1696
+ message: z8.string({ required_error: texts == null ? void 0 : texts.message.required }).min(10, texts == null ? void 0 : texts.message.invalid).default("")
1697
+ });
1698
+ const {
1699
+ control,
1700
+ handleSubmit,
1701
+ formState: { errors },
1702
+ reset
1703
+ } = useForm9({
1704
+ resolver: zodResolver8(contactFormSchema),
1705
+ defaultValues: {
1706
+ name: "",
1707
+ email: "",
1708
+ message: ""
1709
+ }
1710
+ });
1711
+ const handleFormSubmit = (data) => {
1712
+ if (onSubmit) {
1713
+ onSubmit(data);
1714
+ reset();
1715
+ } else {
1716
+ console.log("Form is submitted but onSubmit prop is missing");
1717
+ }
1718
+ };
1719
+ let sizeStyle = {
1720
+ sm: "hawa-max-w-sm",
1721
+ default: "hawa-w-full"
1722
+ };
1723
+ return /* @__PURE__ */ React20.createElement(
1724
+ Card,
1725
+ {
1726
+ className: cn(
1727
+ // sizeStyle[size],
1728
+ "hawa-w-full",
1729
+ cardless && "hawa-border-none hawa-bg-transparent hawa-shadow-none hawa-drop-shadow-none"
1730
+ ),
1731
+ style: cardless ? { boxShadow: "none" } : void 0
1732
+ },
1733
+ /* @__PURE__ */ React20.createElement(CardContent, { headless: true }, /* @__PURE__ */ React20.createElement(
1734
+ "form",
1735
+ {
1736
+ noValidate: true,
1737
+ onSubmit: handleSubmit(handleFormSubmit),
1738
+ className: "hawa-space-y-2",
1739
+ id: formId,
1740
+ autoComplete: formAutoComplete
1741
+ },
1742
+ /* @__PURE__ */ React20.createElement(
1743
+ "div",
1744
+ {
1745
+ className: cn(
1746
+ "hawa-flex hawa-items-start hawa-justify-start hawa-gap-2",
1747
+ {
1748
+ "hawa-flex-row": size === "default",
1749
+ "hawa-flex-col": size === "sm"
1750
+ }
1751
+ )
1752
+ },
1753
+ /* @__PURE__ */ React20.createElement(
1754
+ Controller9,
1755
+ {
1756
+ control,
1757
+ name: "name",
1758
+ render: ({ field }) => {
1759
+ var _a2;
1760
+ return /* @__PURE__ */ React20.createElement(
1761
+ Input,
1762
+ {
1763
+ label: texts == null ? void 0 : texts.name.label,
1764
+ id: texts == null ? void 0 : texts.name.label,
1765
+ ...field,
1766
+ placeholder: texts == null ? void 0 : texts.name.placeholder,
1767
+ helperText: (_a2 = errors.name) == null ? void 0 : _a2.message
1768
+ }
1769
+ );
1770
+ }
1771
+ }
1772
+ ),
1773
+ /* @__PURE__ */ React20.createElement(
1774
+ Controller9,
1775
+ {
1776
+ control,
1777
+ name: "email",
1778
+ render: ({ field }) => {
1779
+ var _a2;
1780
+ return /* @__PURE__ */ React20.createElement(
1781
+ Input,
1782
+ {
1783
+ label: texts == null ? void 0 : texts.email.label,
1784
+ id: texts == null ? void 0 : texts.email.label,
1785
+ ...field,
1786
+ placeholder: texts == null ? void 0 : texts.email.placeholder,
1787
+ helperText: (_a2 = errors.email) == null ? void 0 : _a2.message
1788
+ }
1789
+ );
1790
+ }
1791
+ }
1792
+ )
1793
+ ),
1794
+ /* @__PURE__ */ React20.createElement(
1795
+ Controller9,
1796
+ {
1797
+ control,
1798
+ name: "message",
1799
+ render: ({ field }) => {
1800
+ var _a2;
1801
+ return /* @__PURE__ */ React20.createElement(
1802
+ Textarea,
1803
+ {
1804
+ label: texts == null ? void 0 : texts.message.label,
1805
+ id: texts == null ? void 0 : texts.message.label,
1806
+ textareaProps: {
1807
+ placeholder: texts == null ? void 0 : texts.message.placeholder,
1808
+ ...field
1809
+ },
1810
+ helperText: (_a2 = errors.message) == null ? void 0 : _a2.message
1811
+ }
1812
+ );
1813
+ }
1814
+ }
1815
+ ),
1816
+ /* @__PURE__ */ React20.createElement(Button, { type: "submit", className: "hawa-w-full" }, (texts == null ? void 0 : texts.submit) || "Submit")
1817
+ ))
1818
+ );
1819
+ };
1820
+
1821
+ // components/blocks/pricing/PricingPlans.tsx
1822
+ import React26 from "react";
1823
+
1824
+ // components/blocks/cards/ActionCard.tsx
1825
+ import React21, { useState as useState8 } from "react";
1826
+ var ActionCard = (props) => {
1827
+ const [hovered, setHovered] = useState8(false);
1828
+ return /* @__PURE__ */ React21.createElement("div", { className: "hawa-flex hawa-h-full hawa-w-full hawa-flex-col hawa-gap-1" }, /* @__PURE__ */ React21.createElement(
1829
+ "div",
1830
+ {
1831
+ className: "hawa-group hawa-relative hawa-h-full hawa-w-full hawa-rounded hawa-border hawa-bg-background hawa-bg-cover hawa-bg-center hawa-transition-all hawa-duration-500 hover:hawa-drop-shadow-2xl",
1832
+ style: {
1833
+ backgroundImage: `url(${props.blank ? "" : props.cardImage})`
1834
+ },
1835
+ onMouseEnter: () => setHovered(true),
1836
+ onMouseLeave: () => setHovered(false)
1837
+ },
1838
+ props.blank ? /* @__PURE__ */ React21.createElement("div", { className: "hawa-flex hawa-h-full hawa-flex-col hawa-items-center hawa-justify-center " }, /* @__PURE__ */ React21.createElement(
1839
+ "svg",
1840
+ {
1841
+ className: "hawa-h-10 hawa-w-10 hawa-text-foreground",
1842
+ stroke: "currentColor",
1843
+ fill: "currentColor",
1844
+ strokeWidth: "0",
1845
+ viewBox: "0 0 24 24",
1846
+ height: "1em",
1847
+ width: "1em",
1848
+ xmlns: "http://www.w3.org/2000/svg"
1849
+ },
1850
+ /* @__PURE__ */ React21.createElement("path", { d: "M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z" })
1851
+ )) : /* @__PURE__ */ React21.createElement("div", { className: "hawa-absolute hawa-inset-0 hawa-rounded hawa-bg-black hawa-opacity-50" }),
1852
+ /* @__PURE__ */ React21.createElement("div", { className: "hawa-absolute hawa-bottom-2 hawa-right-2 hawa-z-10 hawa-opacity-0 hawa-transition-all hawa-duration-200 group-hover:hawa-opacity-100" }, props.inCardActions),
1853
+ !props.blank && /* @__PURE__ */ React21.createElement("div", { className: "hawa-relative hawa-p-4" }, /* @__PURE__ */ React21.createElement("h1", { className: "hawa-text-white" }, props.title), /* @__PURE__ */ React21.createElement("p", { className: "hawa-text-white" }, props.subtitle))
1854
+ ), /* @__PURE__ */ React21.createElement(
1855
+ "div",
1856
+ {
1857
+ className: `hawa-flex hawa-flex-row hawa-justify-between hawa-text-sm hawa-transition-all hawa-duration-200 ${hovered ? "hawa-opacity-100" : "hawa-opacity-0"}`
1858
+ },
1859
+ props.bottomElement
1860
+ ));
1861
+ };
1862
+
1863
+ // components/blocks/cards/AdCard.tsx
1864
+ import React22, { useState as useState9, useEffect as useEffect3, useRef as useRef3 } from "react";
1865
+ var AdCard = ({
1866
+ orientation = "vertical",
1867
+ ...props
1868
+ }) => {
1869
+ const adRef = useRef3(null);
1870
+ const [closed, setClosed] = useState9(false);
1871
+ let duration = 0;
1872
+ useEffect3(() => {
1873
+ if (duration) {
1874
+ const timeoutHide = setTimeout(() => {
1875
+ setClosed(true);
1876
+ }, duration);
1877
+ const timeoutDestroy = setTimeout(() => {
1878
+ setClosed(true);
1879
+ if (adRef.current) {
1880
+ adRef.current.removeChild(adRef.current.children[0]);
1881
+ }
1882
+ }, duration + 1e3);
1883
+ return () => {
1884
+ clearTimeout(timeoutHide);
1885
+ clearTimeout(timeoutDestroy);
1886
+ };
1887
+ }
1888
+ }, [duration]);
1889
+ let cardStyles = {
1890
+ horizontal: "hawa-flex hawa-flex-row hawa-max-w-xl hawa-rounded hawa-border hawa-bg-card hawa-p-2 hawa-gap-2 hawa-items-center hawa-relative ",
1891
+ vertical: "hawa-flex hawa-flex-col hawa-max-w-[200px] hawa-justify-start hawa-rounded hawa-border hawa-bg-card hawa-gap-2 hawa-p-2 hawa-relative"
1892
+ };
1893
+ let imageStyles = {
1894
+ horizontal: "hawa-w-auto hawa-h-full hawa-bg-blue-500 hawa-rounded-inner",
1895
+ vertical: "hawa-bg-blue-500 hawa-rounded-inner hawa-w-auto "
1896
+ };
1897
+ return /* @__PURE__ */ React22.createElement("div", { ref: adRef }, /* @__PURE__ */ React22.createElement(
1898
+ "div",
1899
+ {
1900
+ className: cn(cardStyles[orientation], props.className),
1901
+ onClick: props.handleClick
1902
+ },
1903
+ /* @__PURE__ */ React22.createElement("div", { className: "hawa-flex hawa-aspect-square hawa-w-full hawa-max-w-fit hawa-items-start " }, /* @__PURE__ */ React22.createElement(
1904
+ "img",
1905
+ {
1906
+ src: props.imageURL ? props.imageURL : "https://via.placeholder.com/50",
1907
+ className: imageStyles[orientation]
1908
+ }
1909
+ )),
1910
+ /* @__PURE__ */ React22.createElement("div", { className: "hawa-w-full hawa-text-xs" }, /* @__PURE__ */ React22.createElement("div", { className: "hawa-font-bold" }, props.title), /* @__PURE__ */ React22.createElement("div", { className: "hawa-text-[12px]" }, props.description)),
1911
+ props.canHide && /* @__PURE__ */ React22.createElement(
1912
+ "span",
1913
+ {
1914
+ onClick: (e) => {
1915
+ e.stopPropagation();
1916
+ if (props.canHide) {
1917
+ setClosed(true);
1918
+ setTimeout(() => {
1919
+ if (adRef.current) {
1920
+ adRef.current.removeChild(adRef.current.children[0]);
1921
+ }
1922
+ }, 200);
1923
+ } else {
1924
+ if (props.handleCantHide) {
1925
+ props.handleCantHide();
1926
+ }
1927
+ }
1928
+ },
1929
+ className: "hawa-absolute hawa-right-0 hawa-top-0 hawa-h-fit hawa-cursor-pointer hawa-select-none hawa-rounded-bl-lg hawa-rounded-tr-lg hawa-bg-primary/50 hawa-px-2.5 hawa-py-0.5 hawa-text-[10px] hawa-font-semibold hawa-text-primary-foreground"
1930
+ },
1931
+ "Hide"
1932
+ )
1933
+ ));
1934
+ };
1935
+
1936
+ // components/blocks/cards/PricingCard.tsx
1937
+ import React23 from "react";
1938
+ var PricingCard = ({
1939
+ size = "medium",
1940
+ direction = "ltr",
1941
+ endButton = true,
1942
+ recommended,
1943
+ currentPlan = false,
1944
+ ...props
1945
+ }) => {
1946
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
1947
+ let cardSizes = {
1948
+ small: "hawa-w-full hawa-max-w-sm hawa-rounded hawa-border dark:hawa-border-gray-700 hawa-bg-background ",
1949
+ medium: "hawa-w-full hawa-rounded hawa-min-w-fit hawa-border dark:hawa-border-gray-700 hawa-bg-background ",
1950
+ large: "hawa-w-full hawa-max-w-lg hawa-rounded hawa-border dark:hawa-border-gray-700 hawa-bg-background "
1951
+ };
1952
+ return /* @__PURE__ */ React23.createElement(
1953
+ Card,
1954
+ {
1955
+ dir: direction,
1956
+ className: cn(
1957
+ currentPlan ? "hawa-border-2 hawa-border-primary dark:hawa-border-primary/70 " : "hawa-border",
1958
+ cardSizes[size],
1959
+ "hawa-relative hawa-flex hawa-flex-col hawa-justify-between hawa-gap-4 hawa-p-4",
1960
+ recommended ? "hawa-rounded hawa-rounded-t-none" : "hawa-rounded"
1961
+ )
1962
+ },
1963
+ recommended && /* @__PURE__ */ React23.createElement(
1964
+ "div",
1965
+ {
1966
+ className: "hawa-absolute -hawa-left-[1px] hawa-top-0 -hawa-translate-y-full hawa-rounded-t hawa-border hawa-bg-primary hawa-p-2 hawa-text-center hawa-text-primary-foreground",
1967
+ style: { width: "calc(100% + 2px)" }
1968
+ },
1969
+ ((_a = props.texts) == null ? void 0 : _a.recommended) || "RECOMMENDED"
1970
+ ),
1971
+ /* @__PURE__ */ React23.createElement("div", { className: "hawa-flex hawa-h-full hawa-flex-col hawa-gap-4" }, /* @__PURE__ */ React23.createElement("div", { className: "hawa-text-md hawa-relative hawa-flex hawa-flex-col hawa-justify-between hawa-font-bold hawa-text-primary/70" }, /* @__PURE__ */ React23.createElement("span", null, (_b = props.texts) == null ? void 0 : _b.title), /* @__PURE__ */ React23.createElement("h5", { className: "hawa-text-sm hawa-font-normal hawa-text-primary/70" }, (_c = props.texts) == null ? void 0 : _c.subtitle), props.discount && /* @__PURE__ */ React23.createElement("span", { className: "hawa-absolute hawa-end-0" }, /* @__PURE__ */ React23.createElement(Chip, { label: props.discount, size: "large", color: "hyper" }))), /* @__PURE__ */ React23.createElement("div", { className: " hawa-flex hawa-items-baseline hawa-text-primary" }, props.isLoading ? /* @__PURE__ */ React23.createElement(Skeleton, { className: "hawa-h-[48px] hawa-w-full hawa-max-w-[200px] hawa-p-0 " }) : /* @__PURE__ */ React23.createElement(React23.Fragment, null, props.noPrice ? /* @__PURE__ */ React23.createElement("div", { className: "hawa-text-5xl hawa-font-extrabold hawa-tracking-tight" }, ((_d = props.texts) == null ? void 0 : _d.priceless) || "Contact Us") : /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-end hawa-gap-2" }, props.oldPrice && props.oldPrice > 0 && /* @__PURE__ */ React23.createElement("span", { className: "hawa-line-through hawa-opacity-70" }, props.oldPrice + " " + ((_e = props.texts) == null ? void 0 : _e.currencyText)), /* @__PURE__ */ React23.createElement("span", { className: "hawa-text-5xl hawa-font-extrabold hawa-tracking-tight" }, props.price)), /* @__PURE__ */ React23.createElement("span", { className: "hawa-mx-1 hawa-text-sm hawa-font-semibold" }, (_f = props.texts) == null ? void 0 : _f.currencyText)), /* @__PURE__ */ React23.createElement("span", { className: "hawa-ml-1 hawa-whitespace-nowrap hawa-text-xl hawa-font-normal hawa-text-primary/70" }, "/ ", (_g = props.texts) == null ? void 0 : _g.cycleText)))), endButton && /* @__PURE__ */ React23.createElement(Separator, null), /* @__PURE__ */ React23.createElement(
1972
+ "div",
1973
+ {
1974
+ className: cn(
1975
+ "hawa-flex hawa-h-full hawa-justify-between hawa-gap-4",
1976
+ endButton ? "hawa-flex-col" : "hawa-flex-col-reverse"
1977
+ )
1978
+ },
1979
+ props.features && /* @__PURE__ */ React23.createElement("ul", { role: "list", className: "hawa-space-y-0 hawa-overflow-x-auto" }, (_h = props.features) == null ? void 0 : _h.map((feature, o) => {
1980
+ return /* @__PURE__ */ React23.createElement(
1981
+ "li",
1982
+ {
1983
+ key: o,
1984
+ className: cn(
1985
+ "hawa-flex hawa-flex-row hawa-justify-between hawa-gap-2",
1986
+ !feature.included && "hawa-line-through"
1987
+ )
1988
+ },
1989
+ /* @__PURE__ */ React23.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center" }, feature.included ? /* @__PURE__ */ React23.createElement(
1990
+ "svg",
1991
+ {
1992
+ "aria-label": "Check Icon",
1993
+ "aria-hidden": "true",
1994
+ className: "hawa-m-2 hawa-h-5 hawa-w-5 hawa-flex-shrink-0 hawa-text-primary",
1995
+ fill: "currentColor",
1996
+ viewBox: "0 0 20 20"
1997
+ },
1998
+ /* @__PURE__ */ React23.createElement(
1999
+ "path",
2000
+ {
2001
+ fillRule: "evenodd",
2002
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
2003
+ clipRule: "evenodd"
2004
+ }
2005
+ )
2006
+ ) : /* @__PURE__ */ React23.createElement("div", { className: "hawa-m-2 hawa-mx-2.5 hawa-h-4 hawa-w-4 hawa-rounded-full hawa-bg-primary/10" }), /* @__PURE__ */ React23.createElement("span", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 hawa-whitespace-nowrap hawa-text-start hawa-font-normal hawa-leading-tight hawa-text-primary/70 " }, feature.text, " ", feature.soon && feature.included && /* @__PURE__ */ React23.createElement(Chip, { label: "soon", color: "oceanic", size: "small" }))),
2007
+ feature.hint && /* @__PURE__ */ React23.createElement(Tooltip, { content: feature.hint, side: feature.hintSide }, /* @__PURE__ */ React23.createElement(
2008
+ "svg",
2009
+ {
2010
+ xmlns: "http://www.w3.org/2000/svg",
2011
+ className: "hawa-h-[14px] hawa-w-[14px] hawa-cursor-help",
2012
+ viewBox: "0 0 24 24",
2013
+ fill: "none",
2014
+ stroke: "currentColor",
2015
+ strokeWidth: "2",
2016
+ strokeLinecap: "round",
2017
+ strokeLinejoin: "round"
2018
+ },
2019
+ /* @__PURE__ */ React23.createElement("circle", { cx: "12", cy: "12", r: "10" }),
2020
+ /* @__PURE__ */ React23.createElement("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
2021
+ /* @__PURE__ */ React23.createElement("path", { d: "M12 17h.01" })
2022
+ ))
2023
+ );
2024
+ })),
2025
+ /* @__PURE__ */ React23.createElement(
2026
+ Button,
2027
+ {
2028
+ onClick: props.onPlanClicked,
2029
+ disabled: currentPlan,
2030
+ className: "hawa-w-full"
2031
+ },
2032
+ (_i = props.texts) == null ? void 0 : _i.buttonText
2033
+ )
2034
+ ))
2035
+ );
2036
+ };
2037
+
2038
+ // components/blocks/cards/ItemCard.tsx
2039
+ import React24, { useEffect as useEffect4, useState as useState10 } from "react";
2040
+ var ItemCard = ({
2041
+ actions,
2042
+ counts,
2043
+ content,
2044
+ headerActions,
2045
+ clickableImage,
2046
+ onImageClick,
2047
+ clickableImageActionText,
2048
+ clickableImageActionIcon,
2049
+ header,
2050
+ cardImage,
2051
+ orientation = "vertical",
2052
+ ...props
2053
+ }) => {
2054
+ let defaultStyle = "hawa-block hawa-rounded hawa-border hawa-bg-card hawa-text-card-foreground hawa-shadow-sm hawa-transition-all";
2055
+ let orientationStyles = {
2056
+ vertical: "hawa-max-w-sm",
2057
+ horizontal: "hawa-flex hawa-flex-row hawa-w-full"
2058
+ };
2059
+ let imageStyles = {
2060
+ vertical: "hawa-h-auto hawa-max-h-56 hawa-w-full hawa-rounded-t-lg hawa-object-cover",
2061
+ horizontal: (
2062
+ // "h-auto w-full rounded-l-lg object-cover md:h-auto md:w-48 md:rounded-none md:rounded-l-lg",
2063
+ // "h-full w-full rounded-l-lg object-cover md:w-48 md:rounded-none md:rounded-l-lg",
2064
+ "hawa-h-full hawa-w-48 hawa-rounded-l hawa-object-cover"
2065
+ )
2066
+ };
2067
+ let headerActionsButtonStyle = "hawa-inline-block hawa-rounded hawa-p-1 hawa-text-sm hawa-text-gray-500 hover:hawa-bg-gray-100 focus:hawa-outline-none focus:hawa-ring-4 focus:hawa-ring-gray-200 dark:hawa-text-gray-400 dark:hover:hawa-bg-gray-700 dark:focus:hawa-ring-gray-700";
2068
+ const [openActionHeader, setOpenActionHeader] = useState10(false);
2069
+ function handleOpenActionHeader(e) {
2070
+ e.stopPropagation();
2071
+ setOpenActionHeader(!openActionHeader);
2072
+ }
2073
+ useEffect4(() => {
2074
+ window.onclick = () => {
2075
+ if (openActionHeader) {
2076
+ setOpenActionHeader(false);
2077
+ }
2078
+ };
2079
+ return () => window.onclick = null;
2080
+ }, [openActionHeader]);
2081
+ return /* @__PURE__ */ React24.createElement(
2082
+ "div",
2083
+ {
2084
+ className: cn(
2085
+ defaultStyle,
2086
+ props.onCardClick && " hawa-cursor-pointer hover:hawa-shadow-lg",
2087
+ orientationStyles[orientation],
2088
+ props.className
2089
+ ),
2090
+ onClick: (e) => {
2091
+ e.stopPropagation();
2092
+ if (props.onCardClick) {
2093
+ props.onCardClick(e);
2094
+ }
2095
+ }
2096
+ },
2097
+ cardImage && /* @__PURE__ */ React24.createElement("div", { className: "hawa-group hawa-relative hawa-overflow-clip" }, /* @__PURE__ */ React24.createElement(
2098
+ "img",
2099
+ {
2100
+ src: cardImage,
2101
+ className: cn(
2102
+ imageStyles[orientation],
2103
+ clickableImage ? "hawa-overflow-clip hawa-transition-all group-hover:hawa-blur-lg" : ""
2104
+ )
2105
+ }
2106
+ ), clickableImage && /* @__PURE__ */ React24.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React24.createElement("div", { className: "hawa-absolute hawa-left-0 hawa-top-0 hawa-flex hawa-h-full hawa-w-full hawa-items-center hawa-justify-center hawa-opacity-0 hawa-transition-all group-hover:hawa-opacity-100 " }, /* @__PURE__ */ React24.createElement(
2107
+ Button,
2108
+ {
2109
+ variant: "secondary",
2110
+ onClick: onImageClick,
2111
+ className: "hawa-flex hawa-flex-row hawa-gap-2"
2112
+ },
2113
+ clickableImageActionIcon,
2114
+ clickableImageActionText || "Click"
2115
+ )))),
2116
+ /* @__PURE__ */ React24.createElement("div", { className: "hawa-relative hawa-w-full hawa-p-4 xs:hawa-p-6 xs:hawa-px-2 xs:hawa-pb-2" }, headerActions && /* @__PURE__ */ React24.createElement("div", { className: "hawa-absolute hawa-right-0 hawa-top-0 hawa-flex hawa-justify-end hawa-pr-3 hawa-pt-3" }, /* @__PURE__ */ React24.createElement(StopPropagationWrapper, null, /* @__PURE__ */ React24.createElement(
2117
+ DropdownMenu,
2118
+ {
2119
+ items: headerActions,
2120
+ trigger: /* @__PURE__ */ React24.createElement(
2121
+ Button,
2122
+ {
2123
+ variant: "ghost",
2124
+ size: "smallIcon",
2125
+ onClick: handleOpenActionHeader
2126
+ },
2127
+ /* @__PURE__ */ React24.createElement("span", { className: "hawa-sr-only" }, "Open dropdown"),
2128
+ /* @__PURE__ */ React24.createElement(
2129
+ "svg",
2130
+ {
2131
+ className: "hawa-h-5 hawa-w-5",
2132
+ "aria-hidden": "true",
2133
+ fill: "currentColor",
2134
+ viewBox: "0 0 20 20"
2135
+ },
2136
+ /* @__PURE__ */ React24.createElement("path", { d: "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" })
2137
+ )
2138
+ )
2139
+ }
2140
+ ))), /* @__PURE__ */ React24.createElement("div", { className: " hawa-mx-2" }, header && /* @__PURE__ */ React24.createElement("h5", { className: "hawa-mb-2 hawa-text-2xl hawa-font-bold hawa-tracking-tight " }, header), content && /* @__PURE__ */ React24.createElement("span", { className: "hawa-w-full hawa-font-normal " }, content)), actions || counts ? /* @__PURE__ */ React24.createElement(
2141
+ "div",
2142
+ {
2143
+ className: cn(
2144
+ "hawa-mt-3 hawa-flex hawa-flex-col hawa-items-center hawa-rounded-b-lg dark:hawa-text-white xs:hawa-flex-row ",
2145
+ actions && counts ? "hawa-justify-between" : "hawa-justify-end"
2146
+ )
2147
+ },
2148
+ counts,
2149
+ /* @__PURE__ */ React24.createElement(StopPropagationWrapper, null, actions)
2150
+ ) : null)
2151
+ );
2152
+ };
2153
+
2154
+ // components/blocks/cards/LandingCard.tsx
2155
+ import React25 from "react";
2156
+ var LandingCard = (props) => {
2157
+ return /* @__PURE__ */ React25.createElement(Card, { className: props.className }, /* @__PURE__ */ React25.createElement(CardHeader, null, props.icon, /* @__PURE__ */ React25.createElement(CardTitle, null, props.title), /* @__PURE__ */ React25.createElement(CardDescription, null, props.subtitle)));
2158
+ };
2159
+
2160
+ // components/blocks/pricing/PricingPlans.tsx
2161
+ var PricingPlans = ({
2162
+ mainContainerProps,
2163
+ cardsContainerProps,
2164
+ ...props
2165
+ }) => {
2166
+ return /* @__PURE__ */ React26.createElement("div", { ...mainContainerProps }, /* @__PURE__ */ React26.createElement("div", { className: "hawa-mb-2 hawa-flex hawa-w-full hawa-justify-between" }, /* @__PURE__ */ React26.createElement(
2167
+ Radio,
2168
+ {
2169
+ design: "tabs",
2170
+ defaultValue: props.currentCycle.value,
2171
+ options: props.billingCycles,
2172
+ onChangeTab: (e) => {
2173
+ if (props.onCycleChange) {
2174
+ props.onCycleChange(e);
2175
+ }
2176
+ }
2177
+ }
2178
+ ), /* @__PURE__ */ React26.createElement(
2179
+ Radio,
2180
+ {
2181
+ design: "tabs",
2182
+ defaultValue: props.currentCurrency.value,
2183
+ options: props.currencies,
2184
+ onChangeTab: (e) => {
2185
+ if (props.onCurrencyChange) {
2186
+ props.onCurrencyChange(e);
2187
+ }
2188
+ }
2189
+ }
2190
+ )), /* @__PURE__ */ React26.createElement(
2191
+ "div",
2192
+ {
2193
+ className: "hawa-inline-grid hawa-w-full hawa-grid-cols-[repeat(auto-fit,_minmax(300px,_1fr))] hawa-gap-4",
2194
+ ...cardsContainerProps
2195
+ },
2196
+ props.plans.map((plan, index) => {
2197
+ var _a, _b;
2198
+ return /* @__PURE__ */ React26.createElement(
2199
+ PricingCard,
2200
+ {
2201
+ key: index,
2202
+ onPlanClicked: () => {
2203
+ var _a2, _b2;
2204
+ if (props.onPlanClicked) {
2205
+ let clickedData = {
2206
+ // plan: plan.id,
2207
+ currency: (_a2 = props.currentCurrency) == null ? void 0 : _a2.value,
2208
+ cycle: (_b2 = props.currentCycle) == null ? void 0 : _b2.value,
2209
+ ...plan
2210
+ };
2211
+ props.onPlanClicked(clickedData);
2212
+ }
2213
+ },
2214
+ ...plan,
2215
+ price: plan.price,
2216
+ texts: {
2217
+ ...plan.texts,
2218
+ currencyText: (_a = props.currentCurrency) == null ? void 0 : _a.label,
2219
+ cycleText: (_b = props.currentCycle) == null ? void 0 : _b.label
2220
+ }
2221
+ }
2222
+ );
2223
+ })
2224
+ ));
2225
+ };
2226
+
2227
+ // components/blocks/pricing/ComparingPlans.tsx
2228
+ import React27 from "react";
2229
+ var ComparingPlans = (props) => {
2230
+ const uniqueFeatures = Array.from(
2231
+ new Set(
2232
+ props.plans.flatMap(
2233
+ (plan) => plan.features.map((feature) => feature.text)
2234
+ )
2235
+ )
2236
+ );
2237
+ return /* @__PURE__ */ React27.createElement("div", { id: "detailed-pricing", className: "hawa-w-full" }, /* @__PURE__ */ React27.createElement("div", { className: "hawa-mb-2 hawa-flex hawa-w-full hawa-flex-col hawa-justify-between hawa-gap-2 sm:hawa-flex-row" }, /* @__PURE__ */ React27.createElement(
2238
+ Radio,
2239
+ {
2240
+ tabsContainerClassName: "hawa-w-full sm:hawa-max-w-fit",
2241
+ width: "none",
2242
+ design: "tabs",
2243
+ defaultValue: props.currentCycle.value,
2244
+ options: props.billingCycles,
2245
+ onChangeTab: (e) => {
2246
+ if (props.onCycleChange) {
2247
+ props.onCycleChange(e);
2248
+ }
2249
+ }
2250
+ }
2251
+ ), /* @__PURE__ */ React27.createElement(
2252
+ Radio,
2253
+ {
2254
+ tabsContainerClassName: "hawa-w-full sm:hawa-max-w-fit",
2255
+ width: "none",
2256
+ design: "tabs",
2257
+ defaultValue: props.currentCurrency.value,
2258
+ options: props.currencies,
2259
+ onChangeTab: (e) => {
2260
+ if (props.onCurrencyChange) {
2261
+ props.onCurrencyChange(e);
2262
+ }
2263
+ }
2264
+ }
2265
+ )), /* @__PURE__ */ React27.createElement(
2266
+ "div",
2267
+ {
2268
+ className: cn(
2269
+ "hawa-sticky hawa-z-10 hawa-grid hawa-grid-cols-4 hawa-gap-x-2 hawa-rounded-t hawa-border hawa-p-4 hawa-text-sm hawa-font-medium",
2270
+ "hawa-bg-primary-foreground"
2271
+ ),
2272
+ style: {
2273
+ top: props.topPosition || 0
2274
+ }
2275
+ },
2276
+ /* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-items-center" }),
2277
+ props.plans.map((plan, i) => /* @__PURE__ */ React27.createElement(
2278
+ "div",
2279
+ {
2280
+ key: i,
2281
+ className: "hawa-flex hawa-flex-col hawa-items-center hawa-justify-center hawa-gap-2"
2282
+ },
2283
+ /* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-2" }, /* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-flex-col" }, /* @__PURE__ */ React27.createElement("span", { className: "hawa-text-md hawa-font-bold " }, plan.texts.title), /* @__PURE__ */ React27.createElement("span", { className: "hawa-text-md hawa-font-normal hawa-text-muted-foreground " }, plan.texts.subtitle)), /* @__PURE__ */ React27.createElement("div", { className: " hawa-flex hawa-items-baseline " }, /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement("span", { className: "hawa-text-5xl hawa-font-extrabold hawa-tracking-tight" }, plan.price), /* @__PURE__ */ React27.createElement("span", { className: "hawa-mx-1 hawa-text-sm hawa-font-semibold" }, plan.texts.currencyText)), /* @__PURE__ */ React27.createElement("span", { className: "hawa-ml-1 hawa-text-xl hawa-font-normal " }, "/ ", plan.texts.cycleText)))
2284
+ ))
2285
+ ), /* @__PURE__ */ React27.createElement(
2286
+ ScrollArea,
2287
+ {
2288
+ className: "hawa-h-fit hawa-rounded hawa-rounded-t-none hawa-border hawa-border-t-0 hawa-bg-background",
2289
+ dir: props.direction
2290
+ },
2291
+ uniqueFeatures.map((featureText, featureIndex) => {
2292
+ var _a, _b, _c, _d;
2293
+ return /* @__PURE__ */ React27.createElement(
2294
+ "div",
2295
+ {
2296
+ key: featureIndex,
2297
+ className: cn(
2298
+ "hawa-border-foreground-muted dark:text-white hawa-grid hawa-grid-cols-[1fr_repeat(3,_minmax(0,_1fr))] hawa-gap-x-16 hawa-px-4 hawa-py-5 hawa-text-sm hawa-text-gray-700",
2299
+ featureIndex === 0 ? "" : "hawa-border-t"
2300
+ )
2301
+ },
2302
+ /* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2 hawa-text-foreground" }, featureText, props.plans.some(
2303
+ (plan) => plan.features.some(
2304
+ (feature) => feature.text === featureText && feature.hint
2305
+ )
2306
+ ) && /* @__PURE__ */ React27.createElement(
2307
+ Tooltip,
2308
+ {
2309
+ side: "right",
2310
+ content: (_b = (_a = props.plans.find(
2311
+ (plan) => {
2312
+ var _a2;
2313
+ return (_a2 = plan.features.find(
2314
+ (feature) => feature.text === featureText
2315
+ )) == null ? void 0 : _a2.hint;
2316
+ }
2317
+ )) == null ? void 0 : _a.features.find(
2318
+ (feature) => feature.text === featureText
2319
+ )) == null ? void 0 : _b.hint
2320
+ },
2321
+ /* @__PURE__ */ React27.createElement(
2322
+ "svg",
2323
+ {
2324
+ stroke: "currentColor",
2325
+ fill: "currentColor",
2326
+ strokeWidth: "0",
2327
+ viewBox: "0 0 16 16",
2328
+ height: "1em",
2329
+ width: "1em"
2330
+ },
2331
+ /* @__PURE__ */ React27.createElement("path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z" })
2332
+ )
2333
+ ), props.plans.some(
2334
+ (plan) => plan.features.some(
2335
+ (feature) => feature.text === featureText && feature.soon
2336
+ )
2337
+ ) && /* @__PURE__ */ React27.createElement(
2338
+ Chip,
2339
+ {
2340
+ label: ((_d = (_c = props.plans.find(
2341
+ (plan) => plan.features.some(
2342
+ (feature) => feature.text === featureText && feature.soon
2343
+ )
2344
+ )) == null ? void 0 : _c.texts) == null ? void 0 : _d.soon) || "Soon"
2345
+ }
2346
+ )),
2347
+ props.plans.map((plan, planIndex) => {
2348
+ const feature = plan.features.find(
2349
+ (f) => f.text === featureText
2350
+ );
2351
+ return /* @__PURE__ */ React27.createElement(
2352
+ "div",
2353
+ {
2354
+ key: planIndex,
2355
+ className: "hawa-flex hawa-flex-col hawa-items-center hawa-text-center"
2356
+ },
2357
+ (feature == null ? void 0 : feature.included) ? /* @__PURE__ */ React27.createElement(CheckMark, { className: "hawa-text-foreground" }) : /* @__PURE__ */ React27.createElement(UncheckMark, { className: "hawa-text-foreground" })
2358
+ );
2359
+ })
2360
+ );
2361
+ })
2362
+ ), props.showButtons && /* @__PURE__ */ React27.createElement("div", { className: "hawa-grid hawa-grid-cols-[1fr_repeat(3,_minmax(0,_1fr))] hawa-gap-x-16 hawa-px-4 hawa-py-5" }, /* @__PURE__ */ React27.createElement("div", { className: "hawa-flex hawa-items-center" }), props.plans.map((plan, i) => {
2363
+ var _a;
2364
+ return /* @__PURE__ */ React27.createElement(
2365
+ "div",
2366
+ {
2367
+ key: i,
2368
+ className: "hawa-flex hawa-items-center hawa-justify-center"
2369
+ },
2370
+ /* @__PURE__ */ React27.createElement(
2371
+ Button,
2372
+ {
2373
+ className: "hawa-w-full hawa-max-w-xs",
2374
+ onClick: () => {
2375
+ var _a2, _b;
2376
+ if (props.onPlanClicked) {
2377
+ let clickedData = {
2378
+ // plan: plan.id,
2379
+ currency: (_a2 = props.currentCurrency) == null ? void 0 : _a2.value,
2380
+ cycle: (_b = props.currentCycle) == null ? void 0 : _b.value,
2381
+ ...plan
2382
+ };
2383
+ props.onPlanClicked(clickedData);
2384
+ }
2385
+ }
2386
+ },
2387
+ ((_a = plan.texts) == null ? void 0 : _a.buttonText) || "Get Started"
2388
+ )
2389
+ );
2390
+ })));
2391
+ };
2392
+
2393
+ // components/blocks/pricing/HorizontalPricing.tsx
2394
+ import React28, { useState as useState11 } from "react";
2395
+ var HorizontalPricing = (props) => {
2396
+ const [selectedCard, setSelectedCard] = useState11("");
2397
+ let data = [
2398
+ { title: "basic", price: "$49", cycle: "/mo" },
2399
+ { title: "business", price: "$99", cycle: "/mo" },
2400
+ { title: "enterprise", price: "$149", cycle: "/mo" }
2401
+ ];
2402
+ return /* @__PURE__ */ React28.createElement("div", { className: "hawa-z-10 hawa-w-full hawa-max-w-screen-sm" }, /* @__PURE__ */ React28.createElement("div", { className: "hawa-max-w-2xl " }, /* @__PURE__ */ React28.createElement("div", { className: "hawa-flex hawa-flex-row hawa-justify-between" }, /* @__PURE__ */ React28.createElement(
2403
+ Radio,
2404
+ {
2405
+ design: "tabs",
2406
+ options: props.currencies,
2407
+ defaultValue: props.currentCurrency
2408
+ }
2409
+ ), /* @__PURE__ */ React28.createElement(
2410
+ Radio,
2411
+ {
2412
+ design: "tabs",
2413
+ options: props.billingCycles,
2414
+ defaultValue: props.currentCycle
2415
+ }
2416
+ )), data.map((d, i) => /* @__PURE__ */ React28.createElement(
2417
+ "label",
2418
+ {
2419
+ key: i,
2420
+ htmlFor: d.title,
2421
+ className: "",
2422
+ onClick: () => setSelectedCard(d.title)
2423
+ },
2424
+ /* @__PURE__ */ React28.createElement(
2425
+ "input",
2426
+ {
2427
+ type: "radio",
2428
+ name: "radio",
2429
+ id: d.title,
2430
+ className: "hawa-peer hawa-appearance-none"
2431
+ }
2432
+ ),
2433
+ /* @__PURE__ */ React28.createElement(
2434
+ "div",
2435
+ {
2436
+ className: cn(
2437
+ selectedCard === d.title ? "peer-checked:hawa-border-primary peer-checked:hawa-ring-4 peer-checked:hawa-ring-primary/20 " : "",
2438
+ "hawa-peer hawa-flex hawa-cursor-pointer hawa-items-center hawa-justify-between hawa-rounded-xl hawa-border hawa-bg-background hawa-px-5 hawa-py-4 hawa-shadow dark:hawa-text-white peer-checked:[&_.active]:hawa-block peer-checked:[&_.default]:hawa-hidden"
2439
+ )
2440
+ },
2441
+ /* @__PURE__ */ React28.createElement("div", { className: "hawa-peer hawa-flex hawa-items-center hawa-gap-4" }, /* @__PURE__ */ React28.createElement(CheckIcons, null), /* @__PURE__ */ React28.createElement(
2442
+ CardText,
2443
+ {
2444
+ title: "Enterprise",
2445
+ subtitle: "For startups and new businesses"
2446
+ }
2447
+ )),
2448
+ /* @__PURE__ */ React28.createElement(CardPrice, { amount: d.price, cycle: d.cycle })
2449
+ )
2450
+ ))));
2451
+ };
2452
+ var CheckIcons = () => /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(
2453
+ "svg",
2454
+ {
2455
+ fill: "none",
2456
+ viewBox: "0 0 24 24",
2457
+ strokeWidth: "1.5",
2458
+ stroke: "currentColor",
2459
+ className: "hawa-default hawa-h-8 hawa-w-8 hawa-text-neutral-500"
2460
+ },
2461
+ /* @__PURE__ */ React28.createElement(
2462
+ "path",
2463
+ {
2464
+ strokeLinecap: "round",
2465
+ strokeLinejoin: "round",
2466
+ d: "M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
2467
+ }
2468
+ )
2469
+ ), /* @__PURE__ */ React28.createElement(
2470
+ "svg",
2471
+ {
2472
+ viewBox: "0 0 24 24",
2473
+ fill: "currentColor",
2474
+ className: "hawa-active hawa-hidden hawa-h-8 hawa-w-8 hawa-text-blue-500"
2475
+ },
2476
+ /* @__PURE__ */ React28.createElement(
2477
+ "path",
2478
+ {
2479
+ fillRule: "evenodd",
2480
+ clipRule: "evenodd",
2481
+ d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z"
2482
+ }
2483
+ )
2484
+ ));
2485
+ var CardText = (props) => /* @__PURE__ */ React28.createElement("div", { className: "hawa-peer hawa-flex hawa-flex-col hawa-items-start " }, /* @__PURE__ */ React28.createElement("h2", { className: "hawa-font-medium hawa-text-primary/90 sm:hawa-text-xl" }, props.title), /* @__PURE__ */ React28.createElement("p", { className: "hawa-text-sm hawa-text-primary/60" }, props.subtitle, " "));
2486
+ var CardPrice = (props) => /* @__PURE__ */ React28.createElement("h2", { className: "hawa-peer hawa-text-xl hawa-font-semibold hawa-text-primary sm:hawa-text-2xl" }, props.amount, /* @__PURE__ */ React28.createElement("span", { className: "hawa-text-base hawa-font-medium hawa-text-neutral-400" }, props.cycle));
2487
+
2488
+ // components/blocks/Usage.tsx
2489
+ import React29 from "react";
2490
+ var Usage = (props) => {
2491
+ var _a;
2492
+ return /* @__PURE__ */ React29.createElement("div", { className: "hawa-flex hawa-w-full hawa-flex-col hawa-gap-1 hawa-rounded hawa-border hawa-bg-card hawa-p-4" }, /* @__PURE__ */ React29.createElement("div", { className: "hawa-flex hawa-flex-row hawa-items-center hawa-gap-2" }, /* @__PURE__ */ React29.createElement("span", { className: "hawa-bg-white-200" }, props.title), props.tooltip && /* @__PURE__ */ React29.createElement(Tooltip, { content: props.tooltip }, /* @__PURE__ */ React29.createElement(
2493
+ "svg",
2494
+ {
2495
+ stroke: "currentColor",
2496
+ "aria-label": "Exclamation Circle",
2497
+ fill: "currentColor",
2498
+ strokeWidth: "0",
2499
+ viewBox: "0 0 16 16",
2500
+ height: "1em",
2501
+ width: "1em"
2502
+ },
2503
+ /* @__PURE__ */ React29.createElement("path", { d: "M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8 4a.905.905 0 0 0-.9.995l.35 3.507a.552.552 0 0 0 1.1 0l.35-3.507A.905.905 0 0 0 8 4zm.002 6a1 1 0 1 0 0 2 1 1 0 0 0 0-2z" })
2504
+ ))), /* @__PURE__ */ React29.createElement("div", { className: "hawa-bg-white-100 hawa-flex hawa-flex-row" }, /* @__PURE__ */ React29.createElement("div", null, props.currentUsage), /* @__PURE__ */ React29.createElement("div", null, " (", props.percent, "%)")), /* @__PURE__ */ React29.createElement(Progress, { value: (_a = props.percent) != null ? _a : 0 }));
2505
+ };
2506
+ export {
2507
+ ActionCard,
2508
+ AdCard,
2509
+ Announcement,
2510
+ AppLanding,
2511
+ CheckEmail,
2512
+ CodeConfirmation,
2513
+ ComparingPlans,
2514
+ ContactForm,
2515
+ EmptyState,
2516
+ FeedbackEmoji,
2517
+ FeedbackForm,
2518
+ FeedbackRating,
2519
+ HorizontalPricing,
2520
+ ItemCard,
2521
+ LandingCard,
2522
+ LeadGenerator,
2523
+ LegalTexts,
2524
+ LoginForm,
2525
+ NewPasswordForm,
2526
+ NoPermission,
2527
+ NotFound,
2528
+ PricingCard,
2529
+ PricingPlans,
2530
+ RegisterForm,
2531
+ ResetPasswordForm,
2532
+ Testimonial,
2533
+ Usage,
2534
+ UserReferralSource
2535
+ };