@m5kdev/web-ui 0.8.5 → 0.8.7

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 (98) hide show
  1. package/dist/packages/backend/dist/src/modules/auth/auth.dto.d.mts +2 -2
  2. package/dist/src/components/AvatarUpload.mjs +2 -2
  3. package/dist/src/components/CardsSelect.mjs +1 -1
  4. package/dist/src/components/CollapsibleSidebarMenuItem.mjs +1 -1
  5. package/dist/src/components/ColorPicker.d.mts +1 -1
  6. package/dist/src/components/ColorPicker.mjs +2 -2
  7. package/dist/src/components/CopyButton.d.mts +1 -1
  8. package/dist/src/components/CopyButton.mjs +3 -3
  9. package/dist/src/components/CropDialog.mjs +2 -2
  10. package/dist/src/components/DialogProvider.d.mts +1 -1
  11. package/dist/src/components/DialogProvider.mjs +1 -1
  12. package/dist/src/components/FileDropzone.mjs +1 -1
  13. package/dist/src/components/MultiSelectDropdown.mjs +1 -1
  14. package/dist/src/components/PageAlert.mjs +2 -2
  15. package/dist/src/components/SelectChips.d.mts +1 -1
  16. package/dist/src/components/SelectChips.mjs +1 -1
  17. package/dist/src/components/Steps.mjs +1 -1
  18. package/dist/src/components/TablerIconPicker.d.mts +1 -1
  19. package/dist/src/components/TablerIconPicker.mjs +1 -1
  20. package/dist/src/components/mode-toggle.mjs +1 -1
  21. package/dist/src/components/nav-main.d.mts +1 -1
  22. package/dist/src/components/nav-main.mjs +1 -1
  23. package/dist/src/components/pricing-cards.mjs +1 -1
  24. package/dist/src/components/shared/ButtonCopy.mjs +2 -2
  25. package/dist/src/components/team-switcher.mjs +1 -1
  26. package/dist/src/components/ui/alert.d.mts +1 -1
  27. package/dist/src/components/ui/alert.mjs +1 -1
  28. package/dist/src/components/ui/badge.d.mts +2 -2
  29. package/dist/src/components/ui/badge.mjs +1 -1
  30. package/dist/src/components/ui/breadcrumb.mjs +2 -2
  31. package/dist/src/components/ui/button.d.mts +1 -1
  32. package/dist/src/components/ui/button.mjs +1 -1
  33. package/dist/src/components/ui/checkbox.mjs +1 -1
  34. package/dist/src/components/ui/dialog.mjs +1 -1
  35. package/dist/src/components/ui/dropdown-menu.mjs +1 -1
  36. package/dist/src/components/ui/form.d.mts +1 -1
  37. package/dist/src/components/ui/form.mjs +1 -1
  38. package/dist/src/components/ui/label.mjs +1 -1
  39. package/dist/src/components/ui/pagination.mjs +1 -1
  40. package/dist/src/components/ui/resizable-navbar.mjs +1 -1
  41. package/dist/src/components/ui/select.mjs +1 -1
  42. package/dist/src/components/ui/sheet.d.mts +1 -1
  43. package/dist/src/components/ui/sheet.mjs +2 -2
  44. package/dist/src/components/ui/sidebar.mjs +3 -3
  45. package/dist/src/components/ui/spinner.d.mts +1 -1
  46. package/dist/src/components/ui/spinner.mjs +1 -1
  47. package/dist/src/components/ui/toast.mjs +2 -2
  48. package/dist/src/modules/app/components/AppLoader.d.mts +1 -1
  49. package/dist/src/modules/app/components/AppLoader.mjs +1 -1
  50. package/dist/src/modules/app/components/AppSidebarHeader.mjs +4 -4
  51. package/dist/src/modules/app/components/AppSidebarHeader.mjs.map +1 -1
  52. package/dist/src/modules/app/components/AppSidebarInvites.mjs +4 -4
  53. package/dist/src/modules/app/components/AppSidebarInvites.mjs.map +1 -1
  54. package/dist/src/modules/app/components/AppSidebarUser.mjs +1 -1
  55. package/dist/src/modules/auth/components/AdminUserManagement.mjs +2 -2
  56. package/dist/src/modules/auth/components/AdminWaitlist.mjs +2 -2
  57. package/dist/src/modules/auth/components/AuthProviders.mjs +2 -2
  58. package/dist/src/modules/auth/components/ClaimAccountRoute.mjs +1 -1
  59. package/dist/src/modules/auth/components/ErrorAuthRoute.mjs +5 -5
  60. package/dist/src/modules/auth/components/ErrorAuthRoute.mjs.map +1 -1
  61. package/dist/src/modules/auth/components/ForgotPasswordForm.mjs +2 -2
  62. package/dist/src/modules/auth/components/ForgotPasswordRoute.mjs +4 -4
  63. package/dist/src/modules/auth/components/ForgotPasswordRoute.mjs.map +1 -1
  64. package/dist/src/modules/auth/components/InviteFriends.mjs +2 -2
  65. package/dist/src/modules/auth/components/LastUsedBadge.d.mts +1 -1
  66. package/dist/src/modules/auth/components/LastUsedBadge.mjs +2 -2
  67. package/dist/src/modules/auth/components/LoginForm.mjs +5 -5
  68. package/dist/src/modules/auth/components/LoginForm.mjs.map +1 -1
  69. package/dist/src/modules/auth/components/LoginRoute.mjs +5 -5
  70. package/dist/src/modules/auth/components/LoginRoute.mjs.map +1 -1
  71. package/dist/src/modules/auth/components/LogoutRoute.mjs +1 -1
  72. package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.mjs +2 -2
  73. package/dist/src/modules/auth/components/OrganizationMembersRoute.mjs +3 -3
  74. package/dist/src/modules/auth/components/OrganizationPreferences.mjs +2 -2
  75. package/dist/src/modules/auth/components/OrganizationSettingsRoute.mjs +2 -2
  76. package/dist/src/modules/auth/components/OrganizationSwitcher.mjs +5 -5
  77. package/dist/src/modules/auth/components/OrganizationSwitcher.mjs.map +1 -1
  78. package/dist/src/modules/auth/components/PreferencesEditor.mjs +1 -1
  79. package/dist/src/modules/auth/components/ProfileRoute.mjs +2 -2
  80. package/dist/src/modules/auth/components/RangeNuqsDatePicker.mjs +2 -2
  81. package/dist/src/modules/auth/components/ResetPasswordForm.mjs +4 -4
  82. package/dist/src/modules/auth/components/ResetPasswordForm.mjs.map +1 -1
  83. package/dist/src/modules/auth/components/ResetPasswordRoute.mjs +4 -4
  84. package/dist/src/modules/auth/components/ResetPasswordRoute.mjs.map +1 -1
  85. package/dist/src/modules/auth/components/SignupFormRoute.mjs +2 -2
  86. package/dist/src/modules/auth/components/SignupRoute.mjs +4 -4
  87. package/dist/src/modules/auth/components/SignupRoute.mjs.map +1 -1
  88. package/dist/src/modules/auth/components/UserPreferences.mjs +1 -1
  89. package/dist/src/modules/auth/components/WaitlistCard.mjs +2 -2
  90. package/dist/src/modules/auth/components/WaitlistCodeValidation.mjs +2 -2
  91. package/dist/src/modules/billing/components/BillingBetaPage.mjs +1 -1
  92. package/dist/src/modules/billing/components/BillingInvoicePage.mjs +2 -2
  93. package/dist/src/modules/billing/components/BillingSinglePlanSelect.mjs +5 -5
  94. package/dist/src/modules/billing/components/BillingSinglePlanSelect.mjs.map +1 -1
  95. package/dist/src/modules/table/components/ColumnOrderAndVisibility.mjs +1 -1
  96. package/dist/src/modules/table/components/NuqsTable.mjs +2 -2
  97. package/dist/src/modules/table/components/TableFiltering.mjs +2 -2
  98. package/package.json +5 -5
@@ -1,9 +1,9 @@
1
1
  import { Avatar, AvatarFallback, AvatarImage } from "../../../components/ui/avatar.mjs";
2
2
  import { SidebarMenu, SidebarMenuButton, SidebarMenuItem, useSidebar } from "../../../components/ui/sidebar.mjs";
3
3
  import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "../../../components/ui/dropdown-menu.mjs";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { Building2, ChevronsUpDown, CreditCard, LogOut, Settings, Sparkles, User } from "lucide-react";
6
5
  import { useTranslation } from "react-i18next";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { Link } from "react-router";
8
8
  //#region src/modules/app/components/AppSidebarUser.tsx
9
9
  function AppSidebarUser({ user, onSignOut, organizationSettingsPath }) {
@@ -1,8 +1,8 @@
1
+ import { BarChart3, CalendarClock, ChevronDown, ChevronUp, Copy, Filter, Info, Link2, List, MoreHorizontal, Search, UserPlus, X } from "lucide-react";
1
2
  import { useCallback, useEffect, useId, useState } from "react";
2
- import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, Input, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, Select, SelectItem, Spinner, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, Tooltip } from "@heroui/react";
3
3
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
4
- import { BarChart3, CalendarClock, ChevronDown, ChevronUp, Copy, Filter, Info, Link2, List, MoreHorizontal, Search, UserPlus, X } from "lucide-react";
5
4
  import { useNavigate } from "react-router";
5
+ import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, Input, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, Select, SelectItem, Spinner, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, Tooltip } from "@heroui/react";
6
6
  import { toast } from "sonner";
7
7
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
8
8
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
@@ -1,7 +1,7 @@
1
+ import { Mail, MoreHorizontal, Search, Trash2, UserPlus, X } from "lucide-react";
1
2
  import { useEffect, useId, useState } from "react";
2
- import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, Input, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, Spinner, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow } from "@heroui/react";
3
3
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
4
- import { Mail, MoreHorizontal, Search, Trash2, UserPlus, X } from "lucide-react";
4
+ import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, Input, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, Spinner, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow } from "@heroui/react";
5
5
  import { toast } from "sonner";
6
6
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
7
7
  //#region src/modules/auth/components/AdminWaitlist.tsx
@@ -2,9 +2,9 @@ import { GoogleIcon } from "../../../icons/GoogleIcon.mjs";
2
2
  import { LinkedInIcon } from "../../../icons/LinkedInIcon.mjs";
3
3
  import { MicrosoftIcon } from "../../../icons/MicrosoftIcon.mjs";
4
4
  import { LastUsedBadge } from "./LastUsedBadge.mjs";
5
- import { Button } from "@heroui/react";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
5
  import { useTranslation } from "react-i18next";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { Button } from "@heroui/react";
8
8
  import { toast } from "sonner";
9
9
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
10
10
  //#region src/modules/auth/components/AuthProviders.tsx
@@ -2,9 +2,9 @@ import { GoogleIcon } from "../../../icons/GoogleIcon.mjs";
2
2
  import { LinkedInIcon } from "../../../icons/LinkedInIcon.mjs";
3
3
  import { MicrosoftIcon } from "../../../icons/MicrosoftIcon.mjs";
4
4
  import { useEffect, useMemo, useState } from "react";
5
- import { Alert, Button, Card, CardBody, CardHeader, Input } from "@heroui/react";
6
5
  import { jsx, jsxs } from "react/jsx-runtime";
7
6
  import { useLocation, useNavigate } from "react-router";
7
+ import { Alert, Button, Card, CardBody, CardHeader, Input } from "@heroui/react";
8
8
  import { toast } from "sonner";
9
9
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
10
10
  import { useSession } from "@m5kdev/frontend/modules/auth/hooks/useSession";
@@ -1,8 +1,8 @@
1
- import { Button, Card, CardBody, CardHeader } from "@heroui/react";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
1
  import { AlertCircle } from "lucide-react";
4
2
  import { useTranslation } from "react-i18next";
5
- import { Link as Link$1 } from "react-router";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Link } from "react-router";
5
+ import { Button, Card, CardBody, CardHeader } from "@heroui/react";
6
6
  import { useQueryState } from "nuqs";
7
7
  //#region src/modules/auth/components/ErrorAuthRoute.tsx
8
8
  function ErrorAuthRoute() {
@@ -109,12 +109,12 @@ function ErrorAuthRoute() {
109
109
  children: /* @__PURE__ */ jsxs("div", {
110
110
  className: "flex flex-col gap-2",
111
111
  children: [buttons.includes("login") && /* @__PURE__ */ jsx(Button, {
112
- as: Link$1,
112
+ as: Link,
113
113
  to: "/login",
114
114
  variant: "bordered",
115
115
  children: t("web-ui:auth.error.backToLogin")
116
116
  }), buttons.includes("signup") && /* @__PURE__ */ jsx(Button, {
117
- as: Link$1,
117
+ as: Link,
118
118
  to: "/signup",
119
119
  variant: "bordered",
120
120
  children: signupLabel || t("web-ui:auth.error.backToSignup")
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorAuthRoute.mjs","names":["Link"],"sources":["../../../../../src/modules/auth/components/ErrorAuthRoute.tsx"],"sourcesContent":["import { Button, Card, CardBody, CardHeader } from \"@heroui/react\";\r\nimport { AlertCircle } from \"lucide-react\";\r\nimport { useQueryState } from \"nuqs\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\n\r\nexport function ErrorAuthRoute() {\r\n const { t } = useTranslation();\r\n const [error] = useQueryState(\"error\");\r\n\r\n const ErrorEnum = {\r\n invalid_callback_request: {\r\n title: \"Invalid callback request\",\r\n description: \"The callback request is invalid. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n state_not_found: {\r\n title: \"State not found\",\r\n description: \"The state was not found. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n account_already_linked_to_different_user: {\r\n title: \"Account already linked to different user\",\r\n description: \"The account is already linked to a different user. Please try again.\",\r\n buttons: [\"signup\"],\r\n signupLabel: null,\r\n },\r\n \"email_doesn't_match\": {\r\n title: \"Email doesn't match\",\r\n description: \"The email doesn't match. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n email_not_found: {\r\n title: \"Email not found\",\r\n description: \"The email was not found. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n no_callback_url: {\r\n title: \"No callback URL\",\r\n description: \"The callback URL is not set. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n no_code: {\r\n title: \"No code\",\r\n description: \"The code is not set. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n oauth_provider_not_found: {\r\n title: \"OAuth provider not found\",\r\n description: \"The OAuth provider was not found. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n unable_to_link_account: {\r\n title: \"Unable to link account\",\r\n description: \"The account could not be linked. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n unable_to_get_user_info: {\r\n title: \"Unable to get user info\",\r\n description: \"The user info could not be retrieved. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n state_mismatch: {\r\n title: \"State mismatch\",\r\n description: \"The state mismatch. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n signup_disabled: {\r\n title: \"Signup disabled\",\r\n description:\r\n \"The signup is disabled while we are in beta. Please join the waitlist to be notified when we launch.\",\r\n buttons: [\"signup\"],\r\n signupLabel: \"Join the waitlist\",\r\n },\r\n default: {\r\n title: \"Authentication Failed\",\r\n description: \"We encountered an issue with your authentication request\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n };\r\n\r\n const errorData = ErrorEnum[error as keyof typeof ErrorEnum] || ErrorEnum.default;\r\n const { title, description, buttons, signupLabel } = errorData;\r\n\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-2 items-center\">\r\n <AlertCircle className=\"w-10 h-10 text-red-500\" />\r\n <p className=\"text-xl font-semibold\">{title}</p>\r\n <p className=\"text-sm text-default-600\">{description}</p>\r\n </CardHeader>\r\n <CardBody className=\"flex flex-col gap-4\">\r\n <div className=\"flex flex-col gap-2\">\r\n {buttons.includes(\"login\") && (\r\n <Button as={Link} to=\"/login\" variant=\"bordered\">\r\n {t(\"web-ui:auth.error.backToLogin\")}\r\n </Button>\r\n )}\r\n {buttons.includes(\"signup\") && (\r\n <Button as={Link} to=\"/signup\" variant=\"bordered\">\r\n {signupLabel || t(\"web-ui:auth.error.backToSignup\")}\r\n </Button>\r\n )}\r\n </div>\r\n </CardBody>\r\n </Card>\r\n </div>\r\n );\r\n}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B,UAAU,UAAoC,UAAU;AAG1E,QACE,oBAAC,OAAD;EAAK,WAAU;YACb,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB;IACE,oBAAC,aAAD,EAAa,WAAU,0BAA2B,CAAA;IAClD,oBAAC,KAAD;KAAG,WAAU;eAAyB;KAAU,CAAA;IAChD,oBAAC,KAAD;KAAG,WAAU;eAA4B;KAAgB,CAAA;IAC9C;MACb,oBAAC,UAAD;GAAU,WAAU;aAClB,qBAAC,OAAD;IAAK,WAAU;cAAf,CACG,QAAQ,SAAS,QAAQ,IACxB,oBAAC,QAAD;KAAQ,IAAIA;KAAM,IAAG;KAAS,SAAQ;eACnC,EAAE,gCAAgC;KAC5B,CAAA,EAEV,QAAQ,SAAS,SAAS,IACzB,oBAAC,QAAD;KAAQ,IAAIA;KAAM,IAAG;KAAU,SAAQ;eACpC,eAAe,EAAE,iCAAiC;KAC5C,CAAA,CAEP;;GACG,CAAA,CACN,EAAA,CAAA;EACH,CAAA"}
1
+ {"version":3,"file":"ErrorAuthRoute.mjs","names":[],"sources":["../../../../../src/modules/auth/components/ErrorAuthRoute.tsx"],"sourcesContent":["import { Button, Card, CardBody, CardHeader } from \"@heroui/react\";\r\nimport { AlertCircle } from \"lucide-react\";\r\nimport { useQueryState } from \"nuqs\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\n\r\nexport function ErrorAuthRoute() {\r\n const { t } = useTranslation();\r\n const [error] = useQueryState(\"error\");\r\n\r\n const ErrorEnum = {\r\n invalid_callback_request: {\r\n title: \"Invalid callback request\",\r\n description: \"The callback request is invalid. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n state_not_found: {\r\n title: \"State not found\",\r\n description: \"The state was not found. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n account_already_linked_to_different_user: {\r\n title: \"Account already linked to different user\",\r\n description: \"The account is already linked to a different user. Please try again.\",\r\n buttons: [\"signup\"],\r\n signupLabel: null,\r\n },\r\n \"email_doesn't_match\": {\r\n title: \"Email doesn't match\",\r\n description: \"The email doesn't match. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n email_not_found: {\r\n title: \"Email not found\",\r\n description: \"The email was not found. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n no_callback_url: {\r\n title: \"No callback URL\",\r\n description: \"The callback URL is not set. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n no_code: {\r\n title: \"No code\",\r\n description: \"The code is not set. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n oauth_provider_not_found: {\r\n title: \"OAuth provider not found\",\r\n description: \"The OAuth provider was not found. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n unable_to_link_account: {\r\n title: \"Unable to link account\",\r\n description: \"The account could not be linked. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n unable_to_get_user_info: {\r\n title: \"Unable to get user info\",\r\n description: \"The user info could not be retrieved. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n state_mismatch: {\r\n title: \"State mismatch\",\r\n description: \"The state mismatch. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n signup_disabled: {\r\n title: \"Signup disabled\",\r\n description:\r\n \"The signup is disabled while we are in beta. Please join the waitlist to be notified when we launch.\",\r\n buttons: [\"signup\"],\r\n signupLabel: \"Join the waitlist\",\r\n },\r\n default: {\r\n title: \"Authentication Failed\",\r\n description: \"We encountered an issue with your authentication request\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n };\r\n\r\n const errorData = ErrorEnum[error as keyof typeof ErrorEnum] || ErrorEnum.default;\r\n const { title, description, buttons, signupLabel } = errorData;\r\n\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-2 items-center\">\r\n <AlertCircle className=\"w-10 h-10 text-red-500\" />\r\n <p className=\"text-xl font-semibold\">{title}</p>\r\n <p className=\"text-sm text-default-600\">{description}</p>\r\n </CardHeader>\r\n <CardBody className=\"flex flex-col gap-4\">\r\n <div className=\"flex flex-col gap-2\">\r\n {buttons.includes(\"login\") && (\r\n <Button as={Link} to=\"/login\" variant=\"bordered\">\r\n {t(\"web-ui:auth.error.backToLogin\")}\r\n </Button>\r\n )}\r\n {buttons.includes(\"signup\") && (\r\n <Button as={Link} to=\"/signup\" variant=\"bordered\">\r\n {signupLabel || t(\"web-ui:auth.error.backToSignup\")}\r\n </Button>\r\n )}\r\n </div>\r\n </CardBody>\r\n </Card>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;;AAMA,SAAgB,iBAAiB;CAC/B,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,CAAC,SAAS,cAAc,QAAQ;CAEtC,MAAM,YAAY;EAChB,0BAA0B;GACxB,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,iBAAiB;GACf,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,0CAA0C;GACxC,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS;GACnB,aAAa;GACd;EACD,uBAAuB;GACrB,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,iBAAiB;GACf,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,iBAAiB;GACf,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,SAAS;GACP,OAAO;GACP,aAAa;GACb,SAAS,C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"react";
2
- import { Button, Input } from "@heroui/react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
2
  import { useTranslation } from "react-i18next";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Button, Input } from "@heroui/react";
5
5
  import { toast } from "sonner";
6
6
  import { useForm } from "react-hook-form";
7
7
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
@@ -1,8 +1,8 @@
1
1
  import { ForgotPasswordForm } from "./ForgotPasswordForm.mjs";
2
- import { Card, CardBody, CardHeader } from "@heroui/react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
2
  import { useTranslation } from "react-i18next";
5
- import { Link as Link$1 } from "react-router";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Link } from "react-router";
5
+ import { Card, CardBody, CardHeader } from "@heroui/react";
6
6
  //#region src/modules/auth/components/ForgotPasswordRoute.tsx
7
7
  function ForgotPasswordRoute() {
8
8
  const { t } = useTranslation();
@@ -22,7 +22,7 @@ function ForgotPasswordRoute() {
22
22
  children: [
23
23
  t("web-ui:auth.forgotPassword.rememberPassword"),
24
24
  " ",
25
- /* @__PURE__ */ jsx(Link$1, {
25
+ /* @__PURE__ */ jsx(Link, {
26
26
  to: "/login",
27
27
  className: "underline underline-offset-4 hover:text-primary",
28
28
  children: t("web-ui:auth.login.button")
@@ -1 +1 @@
1
- {"version":3,"file":"ForgotPasswordRoute.mjs","names":["Link"],"sources":["../../../../../src/modules/auth/components/ForgotPasswordRoute.tsx"],"sourcesContent":["import { Card, CardBody, CardHeader } from \"@heroui/react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\nimport { ForgotPasswordForm } from \"./ForgotPasswordForm\";\r\n\r\nexport function ForgotPasswordRoute() {\r\n const { t } = useTranslation();\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-1\">\r\n <p className=\"text-xl font-semibold\">{t(\"web-ui:auth.forgotPassword.title\")}</p>\r\n <p className=\"text-sm text-default-600\">{t(\"web-ui:auth.forgotPassword.description\")}</p>\r\n </CardHeader>\r\n <CardBody>\r\n <ForgotPasswordForm />\r\n </CardBody>\r\n </Card>\r\n <div className=\"text-center text-xs text-muted-foreground\">\r\n {t(\"web-ui:auth.forgotPassword.rememberPassword\")}{\" \"}\r\n <Link to=\"/login\" className=\"underline underline-offset-4 hover:text-primary\">\r\n {t(\"web-ui:auth.login.button\")}\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;AAKA,SAAgB,sBAAsB;CACpC,MAAM,EAAE,MAAM,gBAAgB;AAC9B,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB,CACE,oBAAC,KAAD;IAAG,WAAU;cAAyB,EAAE,mCAAmC;IAAK,CAAA,EAChF,oBAAC,KAAD;IAAG,WAAU;cAA4B,EAAE,yCAAyC;IAAK,CAAA,CAC9E;MACb,oBAAC,UAAD,EAAA,UACE,oBAAC,oBAAD,EAAsB,CAAA,EACb,CAAA,CACN,EAAA,CAAA,EACP,qBAAC,OAAD;GAAK,WAAU;aAAf;IACG,EAAE,8CAA8C;IAAE;IACnD,oBAACA,QAAD;KAAM,IAAG;KAAS,WAAU;eACzB,EAAE,2BAA2B;KACzB,CAAA;IACH;KACF"}
1
+ {"version":3,"file":"ForgotPasswordRoute.mjs","names":[],"sources":["../../../../../src/modules/auth/components/ForgotPasswordRoute.tsx"],"sourcesContent":["import { Card, CardBody, CardHeader } from \"@heroui/react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\nimport { ForgotPasswordForm } from \"./ForgotPasswordForm\";\r\n\r\nexport function ForgotPasswordRoute() {\r\n const { t } = useTranslation();\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-1\">\r\n <p className=\"text-xl font-semibold\">{t(\"web-ui:auth.forgotPassword.title\")}</p>\r\n <p className=\"text-sm text-default-600\">{t(\"web-ui:auth.forgotPassword.description\")}</p>\r\n </CardHeader>\r\n <CardBody>\r\n <ForgotPasswordForm />\r\n </CardBody>\r\n </Card>\r\n <div className=\"text-center text-xs text-muted-foreground\">\r\n {t(\"web-ui:auth.forgotPassword.rememberPassword\")}{\" \"}\r\n <Link to=\"/login\" className=\"underline underline-offset-4 hover:text-primary\">\r\n {t(\"web-ui:auth.login.button\")}\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;AAKA,SAAgB,sBAAsB;CACpC,MAAM,EAAE,MAAM,gBAAgB;AAC9B,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB,CACE,oBAAC,KAAD;IAAG,WAAU;cAAyB,EAAE,mCAAmC;IAAK,CAAA,EAChF,oBAAC,KAAD;IAAG,WAAU;cAA4B,EAAE,yCAAyC;IAAK,CAAA,CAC9E;MACb,oBAAC,UAAD,EAAA,UACE,oBAAC,oBAAD,EAAsB,CAAA,EACb,CAAA,CACN,EAAA,CAAA,EACP,qBAAC,OAAD;GAAK,WAAU;aAAf;IACG,EAAE,8CAA8C;IAAE;IACnD,oBAAC,MAAD;KAAM,IAAG;KAAS,WAAU;eACzB,EAAE,2BAA2B;KACzB,CAAA;IACH;KACF"}
@@ -1,8 +1,8 @@
1
1
  import { CopyButton } from "../../../components/CopyButton.mjs";
2
+ import { CheckCircle2, Link2Icon, Mail, Send, Ticket, Users, Zap } from "lucide-react";
2
3
  import { useMemo, useState } from "react";
3
- import { Button, Card, CardBody, CardHeader, Chip, Input } from "@heroui/react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
- import { CheckCircle2, Link2Icon, Mail, Send, Ticket, Users, Zap } from "lucide-react";
5
+ import { Button, Card, CardBody, CardHeader, Chip, Input } from "@heroui/react";
6
6
  import { toast } from "sonner";
7
7
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
8
8
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
1
  import * as _$react from "react";
2
- import { BadgeProps } from "@heroui/react";
3
2
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+ import { BadgeProps } from "@heroui/react";
4
4
 
5
5
  //#region src/modules/auth/components/LastUsedBadge.d.ts
6
6
  declare function LastUsedBadge({
@@ -1,6 +1,6 @@
1
- import { Badge } from "@heroui/react";
2
- import { jsx } from "react/jsx-runtime";
3
1
  import { useTranslation } from "react-i18next";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Badge } from "@heroui/react";
4
4
  //#region src/modules/auth/components/LastUsedBadge.tsx
5
5
  function LastUsedBadge({ lastMethod, method, children, ...props }) {
6
6
  const { t } = useTranslation();
@@ -1,9 +1,9 @@
1
1
  import { LastUsedBadge } from "./LastUsedBadge.mjs";
2
2
  import { AuthProviders } from "./AuthProviders.mjs";
3
- import { Button, Input } from "@heroui/react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
3
  import { useTranslation } from "react-i18next";
6
- import { Link as Link$1, useNavigate } from "react-router";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Link, useNavigate } from "react-router";
6
+ import { Button, Input } from "@heroui/react";
7
7
  import { toast } from "sonner";
8
8
  import { useForm } from "react-hook-form";
9
9
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
@@ -68,7 +68,7 @@ function LoginForm({ providers }) {
68
68
  htmlFor: "password",
69
69
  className: "text-sm font-medium",
70
70
  children: t("web-ui:auth.login.password")
71
- }), /* @__PURE__ */ jsx(Link$1, {
71
+ }), /* @__PURE__ */ jsx(Link, {
72
72
  to: "/forgot-password",
73
73
  className: "ml-auto text-sm underline-offset-4 hover:underline",
74
74
  children: t("web-ui:auth.login.forgotPassword")
@@ -94,7 +94,7 @@ function LoginForm({ providers }) {
94
94
  children: [
95
95
  t("web-ui:auth.login.noAccount"),
96
96
  " ",
97
- /* @__PURE__ */ jsx(Link$1, {
97
+ /* @__PURE__ */ jsx(Link, {
98
98
  to: "/signup",
99
99
  className: "underline underline-offset-4",
100
100
  children: t("web-ui:auth.login.signUp")
@@ -1 +1 @@
1
- {"version":3,"file":"LoginForm.mjs","names":["Link"],"sources":["../../../../../src/modules/auth/components/LoginForm.tsx"],"sourcesContent":["import { Button, Input } from \"@heroui/react\";\r\nimport { authClient } from \"@m5kdev/frontend/modules/auth/auth.lib\";\r\nimport { useSession } from \"@m5kdev/frontend/modules/auth/hooks/useSession\";\r\nimport { type SubmitHandler, useForm } from \"react-hook-form\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link, useNavigate } from \"react-router\";\r\nimport { toast } from \"sonner\";\r\nimport { AuthProviders } from \"./AuthProviders\";\r\nimport { LastUsedBadge } from \"./LastUsedBadge\";\r\n\r\ntype Inputs = {\r\n email: string;\r\n password: string;\r\n};\r\n\r\nexport function LoginForm({ providers }: { providers?: string[] }) {\r\n const lastMethod = authClient.getLastUsedLoginMethod();\r\n const { register, handleSubmit } = useForm<Inputs>();\r\n const { registerSession } = useSession();\r\n const navigate = useNavigate();\r\n const { t } = useTranslation();\r\n\r\n const onSubmit: SubmitHandler<Inputs> = (data) => {\r\n console.log(data);\r\n authClient.signIn\r\n .email({\r\n email: data.email,\r\n password: data.password,\r\n })\r\n .then((res) => {\r\n console.log(res);\r\n if (res.data?.user) {\r\n registerSession(() => {\r\n navigate(\"/\");\r\n });\r\n } else if (res.error) {\r\n toast.error(t(\"web-ui:auth.errors.authentication\"), {\r\n description: res.error.message,\r\n });\r\n }\r\n })\r\n .catch((error) => {\r\n toast.error(t(\"web-ui:auth.errors.server\"), {\r\n description: error.message,\r\n });\r\n });\r\n };\r\n\r\n return (\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n <div className=\"grid gap-6\">\r\n <AuthProviders providers={providers} lastMethod={lastMethod} />\r\n\r\n <div className=\"grid gap-6\">\r\n <div className=\"grid gap-2\">\r\n <LastUsedBadge lastMethod={lastMethod} method=\"email\">\r\n <label htmlFor=\"email\" className=\"text-sm font-medium\">\r\n {t(\"web-ui:auth.login.email\")}\r\n </label>\r\n </LastUsedBadge>\r\n <Input\r\n type=\"email\"\r\n placeholder={t(\"web-ui:auth.login.placeholder.email\")}\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"email\", { required: true })}\r\n />\r\n </div>\r\n\r\n <div className=\"grid gap-2\">\r\n <div className=\"flex items-center\">\r\n <label htmlFor=\"password\" className=\"text-sm font-medium\">\r\n {t(\"web-ui:auth.login.password\")}\r\n </label>\r\n <Link\r\n to=\"/forgot-password\"\r\n className=\"ml-auto text-sm underline-offset-4 hover:underline\"\r\n >\r\n {t(\"web-ui:auth.login.forgotPassword\")}\r\n </Link>\r\n </div>\r\n <Input\r\n placeholder={t(\"web-ui:auth.login.password\")}\r\n type=\"password\"\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"password\", { required: true })}\r\n />\r\n </div>\r\n <Button type=\"submit\" className=\"w-full\" color=\"primary\">\r\n {t(\"web-ui:auth.login.button\")}\r\n </Button>\r\n </div>\r\n\r\n <div className=\"text-center text-sm\">\r\n {t(\"web-ui:auth.login.noAccount\")}{\" \"}\r\n <Link to=\"/signup\" className=\"underline underline-offset-4\">\r\n {t(\"web-ui:auth.login.signUp\")}\r\n </Link>\r\n </div>\r\n </div>\r\n </form>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,UAAU,EAAE,aAAuC;CACjE,MAAM,aAAa,WAAW,wBAAwB;CACtD,MAAM,EAAE,UAAU,iBAAiB,SAAiB;CACpD,MAAM,EAAE,oBAAoB,YAAY;CACxC,MAAM,WAAW,aAAa;CAC9B,MAAM,EAAE,MAAM,gBAAgB;CAE9B,MAAM,YAAmC,SAAS;AAChD,UAAQ,IAAI,KAAK;AACjB,aAAW,OACR,MAAM;GACL,OAAO,KAAK;GAC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C5C,EAAE,2BAA2B;OACvB,CAAA;MACL;;IAEN,qBAAC,OAAD;KAAK,WAAU;eAAf;MACG,EAAE,8BAA8B;MAAE;MACnC,oBAACA,QAAD;OAAM,IAAG;OAAU,WAAU;iBAC1B,EAAE,2BAA2B;OACzB,CAAA;MACH;;IACF;;EACD,CAAA"}
1
+ {"version":3,"file":"LoginForm.mjs","names":[],"sources":["../../../../../src/modules/auth/components/LoginForm.tsx"],"sourcesContent":["import { Button, Input } from \"@heroui/react\";\r\nimport { authClient } from \"@m5kdev/frontend/modules/auth/auth.lib\";\r\nimport { useSession } from \"@m5kdev/frontend/modules/auth/hooks/useSession\";\r\nimport { type SubmitHandler, useForm } from \"react-hook-form\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link, useNavigate } from \"react-router\";\r\nimport { toast } from \"sonner\";\r\nimport { AuthProviders } from \"./AuthProviders\";\r\nimport { LastUsedBadge } from \"./LastUsedBadge\";\r\n\r\ntype Inputs = {\r\n email: string;\r\n password: string;\r\n};\r\n\r\nexport function LoginForm({ providers }: { providers?: string[] }) {\r\n const lastMethod = authClient.getLastUsedLoginMethod();\r\n const { register, handleSubmit } = useForm<Inputs>();\r\n const { registerSession } = useSession();\r\n const navigate = useNavigate();\r\n const { t } = useTranslation();\r\n\r\n const onSubmit: SubmitHandler<Inputs> = (data) => {\r\n console.log(data);\r\n authClient.signIn\r\n .email({\r\n email: data.email,\r\n password: data.password,\r\n })\r\n .then((res) => {\r\n console.log(res);\r\n if (res.data?.user) {\r\n registerSession(() => {\r\n navigate(\"/\");\r\n });\r\n } else if (res.error) {\r\n toast.error(t(\"web-ui:auth.errors.authentication\"), {\r\n description: res.error.message,\r\n });\r\n }\r\n })\r\n .catch((error) => {\r\n toast.error(t(\"web-ui:auth.errors.server\"), {\r\n description: error.message,\r\n });\r\n });\r\n };\r\n\r\n return (\r\n <form onSubmit={handleSubmit(onSubmit)}>\r\n <div className=\"grid gap-6\">\r\n <AuthProviders providers={providers} lastMethod={lastMethod} />\r\n\r\n <div className=\"grid gap-6\">\r\n <div className=\"grid gap-2\">\r\n <LastUsedBadge lastMethod={lastMethod} method=\"email\">\r\n <label htmlFor=\"email\" className=\"text-sm font-medium\">\r\n {t(\"web-ui:auth.login.email\")}\r\n </label>\r\n </LastUsedBadge>\r\n <Input\r\n type=\"email\"\r\n placeholder={t(\"web-ui:auth.login.placeholder.email\")}\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"email\", { required: true })}\r\n />\r\n </div>\r\n\r\n <div className=\"grid gap-2\">\r\n <div className=\"flex items-center\">\r\n <label htmlFor=\"password\" className=\"text-sm font-medium\">\r\n {t(\"web-ui:auth.login.password\")}\r\n </label>\r\n <Link\r\n to=\"/forgot-password\"\r\n className=\"ml-auto text-sm underline-offset-4 hover:underline\"\r\n >\r\n {t(\"web-ui:auth.login.forgotPassword\")}\r\n </Link>\r\n </div>\r\n <Input\r\n placeholder={t(\"web-ui:auth.login.password\")}\r\n type=\"password\"\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"password\", { required: true })}\r\n />\r\n </div>\r\n <Button type=\"submit\" className=\"w-full\" color=\"primary\">\r\n {t(\"web-ui:auth.login.button\")}\r\n </Button>\r\n </div>\r\n\r\n <div className=\"text-center text-sm\">\r\n {t(\"web-ui:auth.login.noAccount\")}{\" \"}\r\n <Link to=\"/signup\" className=\"underline underline-offset-4\">\r\n {t(\"web-ui:auth.login.signUp\")}\r\n </Link>\r\n </div>\r\n </div>\r\n </form>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,UAAU,EAAE,aAAuC;CACjE,MAAM,aAAa,WAAW,wBAAwB;CACtD,MAAM,EAAE,UAAU,iBAAiB,SAAiB;CACpD,MAAM,EAAE,oBAAoB,YAAY;CACxC,MAAM,WAAW,aAAa;CAC9B,MAAM,EAAE,MAAM,gBAAgB;CAE9B,MAAM,YAAmC,SAAS;AAChD,UAAQ,IAAI,KAAK;AACjB,aAAW,OACR,MAAM;G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U;OAAS,OAAM;iBAC5C,EAAE,2BAA2B;OACvB,CAAA;MACL;;IAEN,qBAAC,OAAD;KAAK,WAAU;eAAf;MACG,EAAE,8BAA8B;MAAE;MACnC,oBAAC,MAAD;OAAM,IAAG;OAAU,WAAU;iBAC1B,EAAE,2BAA2B;OACzB,CAAA;MACH;;IACF;;EACD,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import { LoginForm } from "./LoginForm.mjs";
2
- import { Card, CardBody, CardHeader } from "@heroui/react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
2
  import { useTranslation } from "react-i18next";
5
- import { Link as Link$1 } from "react-router";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Link } from "react-router";
5
+ import { Card, CardBody, CardHeader } from "@heroui/react";
6
6
  //#region src/modules/auth/components/LoginRoute.tsx
7
7
  function LoginRoute({ providers }) {
8
8
  const { t } = useTranslation();
@@ -22,14 +22,14 @@ function LoginRoute({ providers }) {
22
22
  children: [
23
23
  t("web-ui:common.byClickingContinue"),
24
24
  " ",
25
- /* @__PURE__ */ jsx(Link$1, {
25
+ /* @__PURE__ */ jsx(Link, {
26
26
  to: "/terms-of-service",
27
27
  children: t("web-ui:common.termsOfService")
28
28
  }),
29
29
  " ",
30
30
  t("web-ui:common.and"),
31
31
  " ",
32
- /* @__PURE__ */ jsx(Link$1, {
32
+ /* @__PURE__ */ jsx(Link, {
33
33
  to: "/privacy-policy",
34
34
  children: t("web-ui:common.privacyPolicy")
35
35
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"LoginRoute.mjs","names":["Link"],"sources":["../../../../../src/modules/auth/components/LoginRoute.tsx"],"sourcesContent":["import { Card, CardBody, CardHeader } from \"@heroui/react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\nimport { LoginForm } from \"./LoginForm\";\r\n\r\nexport function LoginRoute({ providers }: { providers?: string[] }) {\r\n const { t } = useTranslation();\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-1\">\r\n <p className=\"text-xl font-semibold\">{t(\"web-ui:auth.login.welcome\")}</p>\r\n <p className=\"text-sm text-default-600\">\r\n {providers\r\n ? t(\"web-ui:auth.login.descriptionWithProviders\")\r\n : t(\"web-ui:auth.login.description\")}\r\n </p>\r\n </CardHeader>\r\n <CardBody>\r\n <LoginForm providers={providers} />\r\n </CardBody>\r\n </Card>\r\n <div className=\"text-balance text-center text-xs text-muted-foreground [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-primary \">\r\n {t(\"web-ui:common.byClickingContinue\")}{\" \"}\r\n <Link to=\"/terms-of-service\">{t(\"web-ui:common.termsOfService\")}</Link>{\" \"}\r\n {t(\"web-ui:common.and\")}{\" \"}\r\n <Link to=\"/privacy-policy\">{t(\"web-ui:common.privacyPolicy\")}</Link>.\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;AAKA,SAAgB,WAAW,EAAE,aAAuC;CAClE,MAAM,EAAE,MAAM,gBAAgB;AAC9B,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB,CACE,oBAAC,KAAD;IAAG,WAAU;cAAyB,EAAE,4BAA4B;IAAK,CAAA,EACzE,oBAAC,KAAD;IAAG,WAAU;cACV,YACG,EAAE,6CAA6C,GAC/C,EAAE,gCAAgC;IACpC,CAAA,CACO;MACb,oBAAC,UAAD,EAAA,UACE,oBAAC,WAAD,EAAsB,WAAa,CAAA,EAC1B,CAAA,CACN,EAAA,CAAA,EACP,qBAAC,OAAD;GAAK,WAAU;aAAf;IACG,EAAE,mCAAmC;IAAE;IACxC,oBAACA,QAAD;KAAM,IAAG;eAAqB,EAAE,+BAA+B;KAAQ,CAAA;IAAC;IACvE,EAAE,oBAAoB;IAAE;IACzB,oBAACA,QAAD;KAAM,IAAG;eAAmB,EAAE,8BAA8B;KAAQ,CAAA;;IAChE;KACF"}
1
+ {"version":3,"file":"LoginRoute.mjs","names":[],"sources":["../../../../../src/modules/auth/components/LoginRoute.tsx"],"sourcesContent":["import { Card, CardBody, CardHeader } from \"@heroui/react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\nimport { LoginForm } from \"./LoginForm\";\r\n\r\nexport function LoginRoute({ providers }: { providers?: string[] }) {\r\n const { t } = useTranslation();\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-1\">\r\n <p className=\"text-xl font-semibold\">{t(\"web-ui:auth.login.welcome\")}</p>\r\n <p className=\"text-sm text-default-600\">\r\n {providers\r\n ? t(\"web-ui:auth.login.descriptionWithProviders\")\r\n : t(\"web-ui:auth.login.description\")}\r\n </p>\r\n </CardHeader>\r\n <CardBody>\r\n <LoginForm providers={providers} />\r\n </CardBody>\r\n </Card>\r\n <div className=\"text-balance text-center text-xs text-muted-foreground [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-primary \">\r\n {t(\"web-ui:common.byClickingContinue\")}{\" \"}\r\n <Link to=\"/terms-of-service\">{t(\"web-ui:common.termsOfService\")}</Link>{\" \"}\r\n {t(\"web-ui:common.and\")}{\" \"}\r\n <Link to=\"/privacy-policy\">{t(\"web-ui:common.privacyPolicy\")}</Link>.\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;AAKA,SAAgB,WAAW,EAAE,aAAuC;CAClE,MAAM,EAAE,MAAM,gBAAgB;AAC9B,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB,CACE,oBAAC,KAAD;IAAG,WAAU;cAAyB,EAAE,4BAA4B;IAAK,CAAA,EACzE,oBAAC,KAAD;IAAG,WAAU;cACV,YACG,EAAE,6CAA6C,GAC/C,EAAE,gCAAgC;IACpC,CAAA,CACO;MACb,oBAAC,UAAD,EAAA,UACE,oBAAC,WAAD,EAAsB,WAAa,CAAA,EAC1B,CAAA,CACN,EAAA,CAAA,EACP,qBAAC,OAAD;GAAK,WAAU;aAAf;IACG,EAAE,mCAAmC;IAAE;IACxC,oBAAC,MAAD;KAAM,IAAG;eAAqB,EAAE,+BAA+B;KAAQ,CAAA;IAAC;IACvE,EAAE,oBAAoB;IAAE;IACzB,oBAAC,MAAD;KAAM,IAAG;eAAmB,EAAE,8BAA8B;KAAQ,CAAA;;IAChE;KACF"}
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from "react";
2
- import { Spinner } from "@heroui/react";
3
2
  import { jsx } from "react/jsx-runtime";
4
3
  import { useNavigate } from "react-router";
4
+ import { Spinner } from "@heroui/react";
5
5
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
6
6
  //#region src/modules/auth/components/LogoutRoute.tsx
7
7
  function Logout() {
@@ -1,8 +1,8 @@
1
1
  import { useEffect, useMemo, useState } from "react";
2
- import { Card, CardBody, CardHeader, Spinner } from "@heroui/react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
2
  import { useTranslation } from "react-i18next";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { useLocation, useNavigate, useSearchParams } from "react-router";
5
+ import { Card, CardBody, CardHeader, Spinner } from "@heroui/react";
6
6
  import { toast } from "sonner";
7
7
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
8
8
  import { useSession } from "@m5kdev/frontend/modules/auth/hooks/useSession";
@@ -1,8 +1,8 @@
1
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
- import { Button, Card, CardBody, CardHeader, Chip, Input, Select, SelectItem, Spinner, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow } from "@heroui/react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
1
  import { Copy, Trash2, UserPlus, Users } from "lucide-react";
2
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
3
  import { useTranslation } from "react-i18next";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Button, Card, CardBody, CardHeader, Chip, Input, Select, SelectItem, Spinner, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow } from "@heroui/react";
6
6
  import { toast } from "sonner";
7
7
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
8
8
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
@@ -1,8 +1,8 @@
1
1
  import { PreferencesEditor } from "./PreferencesEditor.mjs";
2
2
  import { useCallback, useMemo } from "react";
3
- import { Card, CardBody, CardHeader } from "@heroui/react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
3
  import { useTranslation } from "react-i18next";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Card, CardBody, CardHeader } from "@heroui/react";
6
6
  import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
7
7
  import { useSession } from "@m5kdev/frontend/modules/auth/hooks/useSession";
8
8
  //#region src/modules/auth/components/OrganizationPreferences.tsx
@@ -1,7 +1,7 @@
1
1
  import { useCallback, useEffect, useMemo, useState } from "react";
2
- import { Button, Card, CardBody, CardHeader, Chip, Input, Spinner, Textarea } from "@heroui/react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
2
  import { useTranslation } from "react-i18next";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Button, Card, CardBody, CardHeader, Chip, Input, Spinner, Textarea } from "@heroui/react";
5
5
  import { toast } from "sonner";
6
6
  import { useQuery, useQueryClient } from "@tanstack/react-query";
7
7
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
@@ -1,11 +1,11 @@
1
1
  import { cn } from "../../../lib/utils.mjs";
2
2
  import { useSidebar } from "../../../components/ui/sidebar.mjs";
3
- import { useCallback, useMemo, useState } from "react";
4
- import { Button, Select, SelectItem } from "@heroui/react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
3
  import { Building2 } from "lucide-react";
4
+ import { useCallback, useMemo, useState } from "react";
7
5
  import { useTranslation } from "react-i18next";
8
- import { Link as Link$1 } from "react-router";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Link } from "react-router";
8
+ import { Button, Select, SelectItem } from "@heroui/react";
9
9
  import { toast } from "sonner";
10
10
  import { useQuery } from "@tanstack/react-query";
11
11
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
@@ -50,7 +50,7 @@ function OrganizationSwitcher({ onInvalidateScopedQueries, managerRoles = ["admi
50
50
  t
51
51
  ]);
52
52
  if (!open) return /* @__PURE__ */ jsx(Button, {
53
- as: Link$1,
53
+ as: Link,
54
54
  to: canManageOrganization ? managerPath : fallbackPath,
55
55
  variant: "light",
56
56
  size: "sm",
@@ -1 +1 @@
1
- {"version":3,"file":"OrganizationSwitcher.mjs","names":["Link"],"sources":["../../../../../src/modules/auth/components/OrganizationSwitcher.tsx"],"sourcesContent":["import { Button, Select, SelectItem } from \"@heroui/react\";\r\nimport { authClient } from \"@m5kdev/frontend/modules/auth/auth.lib\";\r\nimport { useSession } from \"@m5kdev/frontend/modules/auth/hooks/useSession\";\r\nimport { useQuery } from \"@tanstack/react-query\";\r\nimport { Building2 } from \"lucide-react\";\r\nimport { useCallback, useMemo, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\nimport { toast } from \"sonner\";\r\nimport { useSidebar } from \"../../../components/ui/sidebar\";\r\nimport { cn } from \"../../../lib/utils\";\r\n\r\ntype OrganizationOption = {\r\n id: string;\r\n name: string;\r\n slug: string;\r\n};\r\n\r\nexport type OrganizationSwitcherProps = {\r\n onInvalidateScopedQueries?: () => void | Promise<void>;\r\n managerRoles?: string[];\r\n managerPath?: string;\r\n fallbackPath?: string;\r\n};\r\n\r\nexport function OrganizationSwitcher({\r\n onInvalidateScopedQueries,\r\n managerRoles = [\"admin\", \"owner\"],\r\n managerPath = \"/organization/members\",\r\n fallbackPath = \"/\",\r\n}: OrganizationSwitcherProps) {\r\n const { t } = useTranslation();\r\n const { data: session, registerSession } = useSession();\r\n const { open } = useSidebar();\r\n const [isSwitching, setIsSwitching] = useState(false);\r\n const activeOrganizationId = session?.session.activeOrganizationId ?? null;\r\n const activeOrganizationRole =\r\n (session?.session as { activeOrganizationRole?: string } | undefined)?.activeOrganizationRole ??\r\n \"\";\r\n const managerRoleSet = useMemo(() => new Set(managerRoles), [managerRoles]);\r\n const canManageOrganization = managerRoleSet.has(activeOrganizationRole);\r\n\r\n const {\r\n data: organizations = [],\r\n isError,\r\n error,\r\n refetch,\r\n } = useQuery({\r\n queryKey: [\"auth-organization-list\"],\r\n queryFn: async () => {\r\n const { data, error } = await authClient.organization.list();\r\n if (error) {\r\n throw new Error(\r\n error.message ?? t(\"web-ui:organization.switcher.failedToLoadOrganizations\")\r\n );\r\n }\r\n return (data ?? []) as OrganizationOption[];\r\n },\r\n });\r\n\r\n const handleSwitchOrganization = useCallback(\r\n async (organizationId: string) => {\r\n if (!organizationId || organizationId === activeOrganizationId || isSwitching) {\r\n return;\r\n }\r\n\r\n try {\r\n setIsSwitching(true);\r\n const { error } = await authClient.organization.setActive({ organizationId });\r\n if (error) {\r\n throw new Error(\r\n error.message ?? t(\"web-ui:organization.switcher.failedToSwitchOrganization\")\r\n );\r\n }\r\n\r\n registerSession(() => {\r\n void onInvalidateScopedQueries?.();\r\n });\r\n toast.success(t(\"web-ui:organization.switcher.organizationSwitched\"));\r\n } catch (error) {\r\n toast.error(\r\n error instanceof Error\r\n ? error.message\r\n : t(\"web-ui:organization.switcher.failedToSwitchOrganization\")\r\n );\r\n } finally {\r\n setIsSwitching(false);\r\n }\r\n },\r\n [activeOrganizationId, isSwitching, onInvalidateScopedQueries, registerSession, t]\r\n );\r\n\r\n if (!open) {\r\n return (\r\n <Button\r\n as={Link}\r\n to={canManageOrganization ? managerPath : fallbackPath}\r\n variant=\"light\"\r\n size=\"sm\"\r\n isIconOnly\r\n aria-label={t(\"web-ui:organization.switcher.label\")}\r\n >\r\n <Building2 className=\"h-4 w-4\" />\r\n </Button>\r\n );\r\n }\r\n\r\n if (isError) {\r\n return (\r\n <div className=\"mb-4 flex flex-col gap-2\">\r\n <p className=\"text-sm text-destructive\">\r\n {error instanceof Error\r\n ? error.message\r\n : t(\"web-ui:organization.switcher.failedToLoadOrganizations\")}\r\n </p>\r\n <Button size=\"sm\" variant=\"flat\" onPress={() => void refetch()}>\r\n {t(\"web-ui:organization.switcher.retry\")}\r\n </Button>\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <div className=\"mb-4\">\r\n <Select\r\n size=\"sm\"\r\n label={t(\"web-ui:organization.switcher.label\")}\r\n selectedKeys={activeOrganizationId ? [activeOrganizationId] : []}\r\n disallowEmptySelection\r\n isDisabled={isSwitching || organizations.length === 0}\r\n onSelectionChange={(keys) => {\r\n const selectedOrganizationId = Array.from(keys as Set<string>)[0];\r\n if (selectedOrganizationId) {\r\n void handleSwitchOrganization(selectedOrganizationId);\r\n }\r\n }}\r\n classNames={{\r\n trigger: cn(\"min-h-10\"),\r\n value: cn(\"text-sm\"),\r\n }}\r\n >\r\n {organizations.map((organization) => (\r\n <SelectItem key={organization.id}>{organization.name}</SelectItem>\r\n ))}\r\n </Select>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAyBA,SAAgB,qBAAqB,EACnC,2BACA,eAAe,CAAC,SAAS,QAAQ,EACjC,cAAc,yBACd,eAAe,OACa;CAC5B,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,EAAE,MAAM,SAAS,oBAAoB,YAAY;CACvD,MAAM,EAAE,SAAS,YAAY;CAC7B,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;CACrD,MAAM,uBAAuB,SAAS,QAAQ,wBAAwB;CACtE,MAAM,0BACH,SAAS,UAA6D,0BACvE;CAEF,MAAM,wBADiB,cAAc,IAAI,IAAI,aAAa,EAAE,CAAC,aAAa,CAAC,CAC9B,IAAI,uBAAuB;CAExE,MAAM,EACJ,MAAM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ACE,MAAK;GACL,OAAO,EAAE,qCAAqC;GAC9C,cAAc,uBAAuB,CAAC,qBAAqB,GAAG,EAAE;GAChE,wBAAA;GACA,YAAY,eAAe,cAAc,WAAW;GACpD,oBAAoB,SAAS;IAC3B,MAAM,yBAAyB,MAAM,KAAK,KAAoB,CAAC;AAC/D,QAAI,uBACG,0BAAyB,uBAAuB;;GAGzD,YAAY;IACV,SAAS,GAAG,WAAW;IACvB,OAAO,GAAG,UAAU;IACrB;aAEA,cAAc,KAAK,iBAClB,oBAAC,YAAD,EAAA,UAAmC,aAAa,MAAkB,EAAjD,aAAa,GAAoC,CAClE;GACK,CAAA;EACL,CAAA"}
1
+ {"version":3,"file":"OrganizationSwitcher.mjs","names":[],"sources":["../../../../../src/modules/auth/components/OrganizationSwitcher.tsx"],"sourcesContent":["import { Button, Select, SelectItem } from \"@heroui/react\";\r\nimport { authClient } from \"@m5kdev/frontend/modules/auth/auth.lib\";\r\nimport { useSession } from \"@m5kdev/frontend/modules/auth/hooks/useSession\";\r\nimport { useQuery } from \"@tanstack/react-query\";\r\nimport { Building2 } from \"lucide-react\";\r\nimport { useCallback, useMemo, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\nimport { toast } from \"sonner\";\r\nimport { useSidebar } from \"../../../components/ui/sidebar\";\r\nimport { cn } from \"../../../lib/utils\";\r\n\r\ntype OrganizationOption = {\r\n id: string;\r\n name: string;\r\n slug: string;\r\n};\r\n\r\nexport type OrganizationSwitcherProps = {\r\n onInvalidateScopedQueries?: () => void | Promise<void>;\r\n managerRoles?: string[];\r\n managerPath?: string;\r\n fallbackPath?: string;\r\n};\r\n\r\nexport function OrganizationSwitcher({\r\n onInvalidateScopedQueries,\r\n managerRoles = [\"admin\", \"owner\"],\r\n managerPath = \"/organization/members\",\r\n fallbackPath = \"/\",\r\n}: OrganizationSwitcherProps) {\r\n const { t } = useTranslation();\r\n const { data: session, registerSession } = useSession();\r\n const { open } = useSidebar();\r\n const [isSwitching, setIsSwitching] = useState(false);\r\n const activeOrganizationId = session?.session.activeOrganizationId ?? null;\r\n const activeOrganizationRole =\r\n (session?.session as { activeOrganizationRole?: string } | undefined)?.activeOrganizationRole ??\r\n \"\";\r\n const managerRoleSet = useMemo(() => new Set(managerRoles), [managerRoles]);\r\n const canManageOrganization = managerRoleSet.has(activeOrganizationRole);\r\n\r\n const {\r\n data: organizations = [],\r\n isError,\r\n error,\r\n refetch,\r\n } = useQuery({\r\n queryKey: [\"auth-organization-list\"],\r\n queryFn: async () => {\r\n const { data, error } = await authClient.organization.list();\r\n if (error) {\r\n throw new Error(\r\n error.message ?? t(\"web-ui:organization.switcher.failedToLoadOrganizations\")\r\n );\r\n }\r\n return (data ?? []) as OrganizationOption[];\r\n },\r\n });\r\n\r\n const handleSwitchOrganization = useCallback(\r\n async (organizationId: string) => {\r\n if (!organizationId || organizationId === activeOrganizationId || isSwitching) {\r\n return;\r\n }\r\n\r\n try {\r\n setIsSwitching(true);\r\n const { error } = await authClient.organization.setActive({ organizationId });\r\n if (error) {\r\n throw new Error(\r\n error.message ?? t(\"web-ui:organization.switcher.failedToSwitchOrganization\")\r\n );\r\n }\r\n\r\n registerSession(() => {\r\n void onInvalidateScopedQueries?.();\r\n });\r\n toast.success(t(\"web-ui:organization.switcher.organizationSwitched\"));\r\n } catch (error) {\r\n toast.error(\r\n error instanceof Error\r\n ? error.message\r\n : t(\"web-ui:organization.switcher.failedToSwitchOrganization\")\r\n );\r\n } finally {\r\n setIsSwitching(false);\r\n }\r\n },\r\n [activeOrganizationId, isSwitching, onInvalidateScopedQueries, registerSession, t]\r\n );\r\n\r\n if (!open) {\r\n return (\r\n <Button\r\n as={Link}\r\n to={canManageOrganization ? managerPath : fallbackPath}\r\n variant=\"light\"\r\n size=\"sm\"\r\n isIconOnly\r\n aria-label={t(\"web-ui:organization.switcher.label\")}\r\n >\r\n <Building2 className=\"h-4 w-4\" />\r\n </Button>\r\n );\r\n }\r\n\r\n if (isError) {\r\n return (\r\n <div className=\"mb-4 flex flex-col gap-2\">\r\n <p className=\"text-sm text-destructive\">\r\n {error instanceof Error\r\n ? error.message\r\n : t(\"web-ui:organization.switcher.failedToLoadOrganizations\")}\r\n </p>\r\n <Button size=\"sm\" variant=\"flat\" onPress={() => void refetch()}>\r\n {t(\"web-ui:organization.switcher.retry\")}\r\n </Button>\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <div className=\"mb-4\">\r\n <Select\r\n size=\"sm\"\r\n label={t(\"web-ui:organization.switcher.label\")}\r\n selectedKeys={activeOrganizationId ? [activeOrganizationId] : []}\r\n disallowEmptySelection\r\n isDisabled={isSwitching || organizations.length === 0}\r\n onSelectionChange={(keys) => {\r\n const selectedOrganizationId = Array.from(keys as Set<string>)[0];\r\n if (selectedOrganizationId) {\r\n void handleSwitchOrganization(selectedOrganizationId);\r\n }\r\n }}\r\n classNames={{\r\n trigger: cn(\"min-h-10\"),\r\n value: cn(\"text-sm\"),\r\n }}\r\n >\r\n {organizations.map((organization) => (\r\n <SelectItem key={organization.id}>{organization.name}</SelectItem>\r\n ))}\r\n </Select>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAyBA,SAAgB,qBAAqB,EACnC,2BACA,eAAe,CAAC,SAAS,QAAQ,EACjC,cAAc,yBACd,eAAe,OACa;CAC5B,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,EAAE,MAAM,SAAS,oBAAoB,YAAY;CACvD,MAAM,EAAE,SAAS,YAAY;CAC7B,MAAM,CAAC,aAAa,kBAAkB,SAAS,MAAM;CACrD,MAAM,uBAAuB,SAAS,QAAQ,wBAAwB;CACtE,MAAM,0BACH,SAAS,UAA6D,0BACvE;CAEF,MAAM,wBADiB,cAAc,IAAI,IAAI,aAAa,EAAE,CAAC,aAAa,CAAC,CAC9B,IAAI,uBAAuB;CAExE,MAAM,EACJ,MAAM,gBAAgB,EAAE,EACxB,SACA,OACA,YACE,SAAS;EACX,UAAU,CA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CAAC,qBAAqB,GAAG,EAAE;GAChE,wBAAA;GACA,YAAY,eAAe,cAAc,WAAW;GACpD,oBAAoB,SAAS;IAC3B,MAAM,yBAAyB,MAAM,KAAK,KAAoB,CAAC;AAC/D,QAAI,uBACG,0BAAyB,uBAAuB;;GAGzD,YAAY;IACV,SAAS,GAAG,WAAW;IACvB,OAAO,GAAG,UAAU;IACrB;aAEA,cAAc,KAAK,iBAClB,oBAAC,YAAD,EAAA,UAAmC,aAAa,MAAkB,EAAjD,aAAa,GAAoC,CAClE;GACK,CAAA;EACL,CAAA"}
@@ -1,5 +1,5 @@
1
- import { Button, Form, Input, Select, SelectItem, Switch } from "@heroui/react";
2
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Button, Form, Input, Select, SelectItem, Switch } from "@heroui/react";
3
3
  import { toast } from "sonner";
4
4
  //#region src/modules/auth/components/PreferencesEditor.tsx
5
5
  function PreferencesEditor({ schema, controls, values, isLoading, isPending, labels, updateValues }) {
@@ -1,8 +1,8 @@
1
1
  import { AvatarUpload } from "../../../components/AvatarUpload.mjs";
2
2
  import { Form as Form$1, FormControl, FormField, FormItem, FormLabel, FormMessage } from "../../../components/ui/form.mjs";
3
- import { Button, Card, CardBody, CardHeader, Input } from "@heroui/react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
3
  import { useTranslation } from "react-i18next";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Button, Card, CardBody, CardHeader, Input } from "@heroui/react";
6
6
  import { toast } from "sonner";
7
7
  import { useForm } from "react-hook-form";
8
8
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
@@ -1,7 +1,7 @@
1
1
  import { startTransition, useEffect, useMemo, useState } from "react";
2
- import { DateRangePicker, Select, SelectItem } from "@heroui/react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
2
  import { useTranslation } from "react-i18next";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { DateRangePicker, Select, SelectItem } from "@heroui/react";
5
5
  import { CalendarDate, getLocalTimeZone, today } from "@internationalized/date";
6
6
  import { DateTime } from "luxon";
7
7
  import { useNuqsQueryParams } from "@m5kdev/frontend/modules/table/hooks/useNuqsQueryParams";
@@ -1,7 +1,7 @@
1
- import { Button, Card, CardBody, CardHeader, Input } from "@heroui/react";
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
1
  import { useTranslation } from "react-i18next";
4
- import { Link as Link$1, useSearchParams } from "react-router";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Link, useSearchParams } from "react-router";
4
+ import { Button, Card, CardBody, CardHeader, Input } from "@heroui/react";
5
5
  import { toast } from "sonner";
6
6
  import { useForm } from "react-hook-form";
7
7
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
@@ -86,7 +86,7 @@ function ResetPasswordForm() {
86
86
  children: [
87
87
  t("web-ui:auth.forgotPassword.rememberPassword"),
88
88
  " ",
89
- /* @__PURE__ */ jsx(Link$1, {
89
+ /* @__PURE__ */ jsx(Link, {
90
90
  to: "/login",
91
91
  className: "underline underline-offset-4 hover:text-primary",
92
92
  children: t("web-ui:auth.login.button")
@@ -1 +1 @@
1
- {"version":3,"file":"ResetPasswordForm.mjs","names":["Link"],"sources":["../../../../../src/modules/auth/components/ResetPasswordForm.tsx"],"sourcesContent":["import { Button, Card, CardBody, CardHeader, Input } from \"@heroui/react\";\r\nimport { authClient } from \"@m5kdev/frontend/modules/auth/auth.lib\";\r\nimport { type SubmitHandler, useForm } from \"react-hook-form\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link, useSearchParams } from \"react-router\";\r\nimport { toast } from \"sonner\";\r\n\r\ntype Inputs = {\r\n password: string;\r\n confirmPassword: string;\r\n};\r\n\r\nexport function ResetPasswordForm() {\r\n const { t } = useTranslation();\r\n const {\r\n register,\r\n handleSubmit,\r\n setError,\r\n formState: { errors },\r\n } = useForm<Inputs>();\r\n const [searchParams] = useSearchParams();\r\n const token = searchParams.get(\"token\");\r\n\r\n const onSubmit: SubmitHandler<Inputs> = (data) => {\r\n if (data.password !== data.confirmPassword) {\r\n setError(\"confirmPassword\", { message: t(\"web-ui:auth.resetPassword.passwordMismatch\") });\r\n return;\r\n }\r\n\r\n if (!token) {\r\n throw new Error(t(\"web-ui:auth.resetPassword.tokenRequired\"));\r\n }\r\n\r\n authClient\r\n .resetPassword({\r\n newPassword: data.password,\r\n token,\r\n })\r\n .then(() => {\r\n toast.success(t(\"web-ui:auth.resetPassword.success\"));\r\n // Optionally, redirect\r\n })\r\n .catch(() => {\r\n toast.error(t(\"web-ui:auth.resetPassword.error\"));\r\n });\r\n };\r\n\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-1\">\r\n <h2 className=\"text-xl font-semibold\">{t(\"web-ui:auth.resetPassword.title\")}</h2>\r\n <p className=\"text-sm text-default-600\">{t(\"web-ui:auth.resetPassword.description\")}</p>\r\n </CardHeader>\r\n <CardBody className=\"gap-6\">\r\n <form onSubmit={handleSubmit(onSubmit)} className=\"grid gap-6\">\r\n <div className=\"grid gap-2\">\r\n <Input\r\n labelPlacement=\"outside\"\r\n label={t(\"web-ui:auth.resetPassword.newPassword\")}\r\n placeholder={t(\"web-ui:auth.resetPassword.newPassword\")}\r\n type=\"password\"\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"password\", {\r\n required: t(\"web-ui:auth.resetPassword.passwordRequired\"),\r\n })}\r\n />\r\n {errors.password && (\r\n <span className=\"text-red-500 text-xs\">{errors.password.message}</span>\r\n )}\r\n </div>\r\n <div className=\"grid gap-2\">\r\n <Input\r\n labelPlacement=\"outside\"\r\n label={t(\"web-ui:auth.resetPassword.confirmPassword\")}\r\n placeholder={t(\"web-ui:auth.resetPassword.confirmPassword\")}\r\n type=\"password\"\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"confirmPassword\", {\r\n required: t(\"web-ui:auth.resetPassword.confirmPasswordRequired\"),\r\n })}\r\n />\r\n {errors.confirmPassword && (\r\n <span className=\"text-red-500 text-xs\">{errors.confirmPassword.message}</span>\r\n )}\r\n </div>\r\n <Button type=\"submit\" className=\"w-full\" color=\"primary\">\r\n {t(\"web-ui:auth.resetPassword.button\")}\r\n </Button>\r\n </form>\r\n </CardBody>\r\n </Card>\r\n <div className=\"text-center text-xs text-muted-foreground\">\r\n {t(\"web-ui:auth.forgotPassword.rememberPassword\")}{\" \"}\r\n <Link to=\"/login\" className=\"underline underline-offset-4 hover:text-primary\">\r\n {t(\"web-ui:auth.login.button\")}\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;AAYA,SAAgB,oBAAoB;CAClC,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,EACJ,UACA,cACA,UACA,WAAW,EAAE,aACX,SAAiB;CACrB,MAAM,CAAC,gBAAgB,iBAAiB;CACxC,MAAM,QAAQ,aAAa,IAAI,QAAQ;CAEvC,MAAM,YAAmC,SAAS;AAChD,MAAI,KAAK,aAAa,KAAK,iBAAiB;AAC1C,YAAS,mBAAmB,EAAE,SAAS,EAAE,6CAA6C,EAAE,CAAC;AACzF;;AAGF,MAAI,CAAC,MACH,OAAM,IAAI,MAAM,EAAE,0CAA0C,CAAC;AAG/D,aACG,cAAc;GACb,aAAa,KAAK;GAClB;GACD,CAAC,CACD,WAAW;AACV,SAAM,QAAQ,EAAE,oCAAoC,CAAC;IAErD,CACD,YAAY;AACX,SAAM,MAAM,EAAE,kCAAkC,CAAC;IACjD;;AAGN,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB,CACE,oBAAC,MAAD;IAAI,WAAU;cAAyB,EAAE,kCAAkC;IAAM,CAAA,EACjF,oBAAC,KAAD;IAAG,WAAU;cAA4B,EAAE,wCAAwC;IAAK,CAAA,CAC7E;MACb,oBAAC,UAAD;GAAU,WAAU;aAClB,qBAAC,QAAD;IAAM,UAAU,aAAa,SAAS;IAAE,WAAU;cAAlD;KACE,qBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,oBAAC,OAAD;OACE,gBAAe;OACf,OAAO,EAAE,wCAAwC;OACjD,aAAa,EAAE,wCAAwC;OACvD,MAAK;OACL,SAAQ;OACR,YAAA;OACA,GAAI,SAAS,YAAY,EACvB,UAAU,EAAE,6CAA6C,EAC1D,CAAC;OACF,CAAA,EACD,OAAO,YACN,oBAAC,QAAD;OAAM,WAAU;iBAAwB,OAAO,SAAS;OAAe,CAAA,CAErE;;KACN,qBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,oBAAC,OAAD;OACE,gBAAe;OACf,OAAO,EAAE,4CAA4C;OACrD,aAAa,EAAE,4CAA4C;OAC3D,MAAK;OACL,SAAQ;OACR,YAAA;OACA,GAAI,SAAS,mBAAmB,EAC9B,UAAU,EAAE,oDAAoD,EACjE,CAAC;OACF,CAAA,EACD,OAAO,mBACN,oBAAC,QAAD;OAAM,WAAU;iBAAwB,OAAO,gBAAgB;OAAe,CAAA,CAE5E;;KACN,oBAAC,QAAD;MAAQ,MAAK;MAAS,WAAU;MAAS,OAAM;gBAC5C,EAAE,mCAAmC;MAC/B,CAAA;KACJ;;GACE,CAAA,CACN,EAAA,CAAA,EACP,qBAAC,OAAD;GAAK,WAAU;aAAf;IACG,EAAE,8CAA8C;IAAE;IACnD,oBAACA,QAAD;KAAM,IAAG;KAAS,WAAU;eACzB,EAAE,2BAA2B;KACzB,CAAA;IACH;KACF"}
1
+ {"version":3,"file":"ResetPasswordForm.mjs","names":[],"sources":["../../../../../src/modules/auth/components/ResetPasswordForm.tsx"],"sourcesContent":["import { Button, Card, CardBody, CardHeader, Input } from \"@heroui/react\";\r\nimport { authClient } from \"@m5kdev/frontend/modules/auth/auth.lib\";\r\nimport { type SubmitHandler, useForm } from \"react-hook-form\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link, useSearchParams } from \"react-router\";\r\nimport { toast } from \"sonner\";\r\n\r\ntype Inputs = {\r\n password: string;\r\n confirmPassword: string;\r\n};\r\n\r\nexport function ResetPasswordForm() {\r\n const { t } = useTranslation();\r\n const {\r\n register,\r\n handleSubmit,\r\n setError,\r\n formState: { errors },\r\n } = useForm<Inputs>();\r\n const [searchParams] = useSearchParams();\r\n const token = searchParams.get(\"token\");\r\n\r\n const onSubmit: SubmitHandler<Inputs> = (data) => {\r\n if (data.password !== data.confirmPassword) {\r\n setError(\"confirmPassword\", { message: t(\"web-ui:auth.resetPassword.passwordMismatch\") });\r\n return;\r\n }\r\n\r\n if (!token) {\r\n throw new Error(t(\"web-ui:auth.resetPassword.tokenRequired\"));\r\n }\r\n\r\n authClient\r\n .resetPassword({\r\n newPassword: data.password,\r\n token,\r\n })\r\n .then(() => {\r\n toast.success(t(\"web-ui:auth.resetPassword.success\"));\r\n // Optionally, redirect\r\n })\r\n .catch(() => {\r\n toast.error(t(\"web-ui:auth.resetPassword.error\"));\r\n });\r\n };\r\n\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-1\">\r\n <h2 className=\"text-xl font-semibold\">{t(\"web-ui:auth.resetPassword.title\")}</h2>\r\n <p className=\"text-sm text-default-600\">{t(\"web-ui:auth.resetPassword.description\")}</p>\r\n </CardHeader>\r\n <CardBody className=\"gap-6\">\r\n <form onSubmit={handleSubmit(onSubmit)} className=\"grid gap-6\">\r\n <div className=\"grid gap-2\">\r\n <Input\r\n labelPlacement=\"outside\"\r\n label={t(\"web-ui:auth.resetPassword.newPassword\")}\r\n placeholder={t(\"web-ui:auth.resetPassword.newPassword\")}\r\n type=\"password\"\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"password\", {\r\n required: t(\"web-ui:auth.resetPassword.passwordRequired\"),\r\n })}\r\n />\r\n {errors.password && (\r\n <span className=\"text-red-500 text-xs\">{errors.password.message}</span>\r\n )}\r\n </div>\r\n <div className=\"grid gap-2\">\r\n <Input\r\n labelPlacement=\"outside\"\r\n label={t(\"web-ui:auth.resetPassword.confirmPassword\")}\r\n placeholder={t(\"web-ui:auth.resetPassword.confirmPassword\")}\r\n type=\"password\"\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"confirmPassword\", {\r\n required: t(\"web-ui:auth.resetPassword.confirmPasswordRequired\"),\r\n })}\r\n />\r\n {errors.confirmPassword && (\r\n <span className=\"text-red-500 text-xs\">{errors.confirmPassword.message}</span>\r\n )}\r\n </div>\r\n <Button type=\"submit\" className=\"w-full\" color=\"primary\">\r\n {t(\"web-ui:auth.resetPassword.button\")}\r\n </Button>\r\n </form>\r\n </CardBody>\r\n </Card>\r\n <div className=\"text-center text-xs text-muted-foreground\">\r\n {t(\"web-ui:auth.forgotPassword.rememberPassword\")}{\" \"}\r\n <Link to=\"/login\" className=\"underline underline-offset-4 hover:text-primary\">\r\n {t(\"web-ui:auth.login.button\")}\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;AAYA,SAAgB,oBAAoB;CAClC,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,EACJ,UACA,cACA,UACA,WAAW,EAAE,aACX,SAAiB;CACrB,MAAM,CAAC,gBAAgB,iBAAiB;CACxC,MAAM,QAAQ,aAAa,IAAI,QAAQ;CAEvC,MAAM,YAAmC,SAAS;AAChD,MAAI,KAAK,aAAa,KAAK,iBAAiB;AAC1C,YAAS,mBAAmB,EAAE,SAAS,EAAE,6CAA6C,EAAE,CAAC;AACzF;;AAGF,MAAI,CAAC,MACH,OAAM,IAAI,MAAM,EAAE,0CAA0C,CAAC;AAG/D,aACG,cAAc;GACb,aAAa,KAAK;GAClB;GACD,CAAC,CACD,WAAW;AACV,SAAM,QAAQ,EAAE,oCAAoC,CAAC;IAErD,CACD,YAAY;AACX,SAAM,MAAM,EAAE,kCAAkC,CAAC;IACjD;;AAGN,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,MAAD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m.mjs";
2
- import { Card, CardBody, CardHeader } from "@heroui/react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
2
  import { useTranslation } from "react-i18next";
5
- import { Link as Link$1 } from "react-router";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { Link } from "react-router";
5
+ import { Card, CardBody, CardHeader } from "@heroui/react";
6
6
  //#region src/modules/auth/components/ResetPasswordRoute.tsx
7
7
  function ResetPasswordRoute() {
8
8
  const { t } = useTranslation();
@@ -22,7 +22,7 @@ function ResetPasswordRoute() {
22
22
  children: [
23
23
  t("web-ui:auth.forgotPassword.rememberPassword"),
24
24
  " ",
25
- /* @__PURE__ */ jsx(Link$1, {
25
+ /* @__PURE__ */ jsx(Link, {
26
26
  to: "/login",
27
27
  className: "underline underline-offset-4 hover:text-primary",
28
28
  children: t("web-ui:auth.login.button")
@@ -1 +1 @@
1
- {"version":3,"file":"ResetPasswordRoute.mjs","names":["Link"],"sources":["../../../../../src/modules/auth/components/ResetPasswordRoute.tsx"],"sourcesContent":["import { Card, CardBody, CardHeader } from \"@heroui/react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\nimport { ResetPasswordForm } from \"./ResetPasswordForm\";\r\n\r\nexport function ResetPasswordRoute() {\r\n const { t } = useTranslation();\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-1\">\r\n <h2 className=\"text-xl font-semibold\">{t(\"web-ui:auth.resetPassword.title\")}</h2>\r\n <p className=\"text-sm text-default-600\">{t(\"web-ui:auth.resetPassword.description\")}</p>\r\n </CardHeader>\r\n <CardBody>\r\n <ResetPasswordForm />\r\n </CardBody>\r\n </Card>\r\n <div className=\"text-center text-xs text-muted-foreground\">\r\n {t(\"web-ui:auth.forgotPassword.rememberPassword\")}{\" \"}\r\n <Link to=\"/login\" className=\"underline underline-offset-4 hover:text-primary\">\r\n {t(\"web-ui:auth.login.button\")}\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;AAKA,SAAgB,qBAAqB;CACnC,MAAM,EAAE,MAAM,gBAAgB;AAC9B,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB,CACE,oBAAC,MAAD;IAAI,WAAU;cAAyB,EAAE,kCAAkC;IAAM,CAAA,EACjF,oBAAC,KAAD;IAAG,WAAU;cAA4B,EAAE,wCAAwC;IAAK,CAAA,CAC7E;MACb,oBAAC,UAAD,EAAA,UACE,oBAAC,mBAAD,EAAqB,CAAA,EACZ,CAAA,CACN,EAAA,CAAA,EACP,qBAAC,OAAD;GAAK,WAAU;aAAf;IACG,EAAE,8CAA8C;IAAE;IACnD,oBAACA,QAAD;KAAM,IAAG;KAAS,WAAU;eACzB,EAAE,2BAA2B;KACzB,CAAA;IACH;KACF"}
1
+ {"version":3,"file":"ResetPasswordRoute.mjs","names":[],"sources":["../../../../../src/modules/auth/components/ResetPasswordRoute.tsx"],"sourcesContent":["import { Card, CardBody, CardHeader } from \"@heroui/react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\nimport { ResetPasswordForm } from \"./ResetPasswordForm\";\r\n\r\nexport function ResetPasswordRoute() {\r\n const { t } = useTranslation();\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-1\">\r\n <h2 className=\"text-xl font-semibold\">{t(\"web-ui:auth.resetPassword.title\")}</h2>\r\n <p className=\"text-sm text-default-600\">{t(\"web-ui:auth.resetPassword.description\")}</p>\r\n </CardHeader>\r\n <CardBody>\r\n <ResetPasswordForm />\r\n </CardBody>\r\n </Card>\r\n <div className=\"text-center text-xs text-muted-foreground\">\r\n {t(\"web-ui:auth.forgotPassword.rememberPassword\")}{\" \"}\r\n <Link to=\"/login\" className=\"underline underline-offset-4 hover:text-primary\">\r\n {t(\"web-ui:auth.login.button\")}\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;AAKA,SAAgB,qBAAqB;CACnC,MAAM,EAAE,MAAM,gBAAgB;AAC9B,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB,CACE,oBAAC,MAAD;IAAI,WAAU;cAAyB,EAAE,kCAAkC;IAAM,CAAA,EACjF,oBAAC,KAAD;IAAG,WAAU;cAA4B,EAAE,wCAAwC;IAAK,CAAA,CAC7E;MACb,oBAAC,UAAD,EAAA,UACE,oBAAC,mBAAD,EAAqB,CAAA,EACZ,CAAA,CACN,EAAA,CAAA,EACP,qBAAC,OAAD;GAAK,WAAU;aAAf;IACG,EAAE,8CAA8C;IAAE;IACnD,oBAAC,MAAD;KAAM,IAAG;KAAS,WAAU;eACzB,EAAE,2BAA2B;KACzB,CAAA;IACH;KACF"}
@@ -1,8 +1,8 @@
1
1
  import { useState } from "react";
2
- import { Alert, Button, Input } from "@heroui/react";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
2
  import { useTranslation } from "react-i18next";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { useNavigate } from "react-router";
5
+ import { Alert, Button, Input } from "@heroui/react";
6
6
  import { toast } from "sonner";
7
7
  import { useForm } from "react-hook-form";
8
8
  import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
@@ -2,10 +2,10 @@ import { AuthProviders } from "./AuthProviders.mjs";
2
2
  import { SignupForm } from "./SignupFormRoute.mjs";
3
3
  import { WaitlistCard } from "./WaitlistCard.mjs";
4
4
  import { WaitlistCodeValidation } from "./WaitlistCodeValidation.mjs";
5
- import { Card, CardBody, CardHeader } from "@heroui/react";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
5
  import { useTranslation } from "react-i18next";
8
- import { Link as Link$1 } from "react-router";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Link } from "react-router";
8
+ import { Card, CardBody, CardHeader } from "@heroui/react";
9
9
  import { useQueryState } from "nuqs";
10
10
  //#region src/modules/auth/components/SignupRoute.tsx
11
11
  function SignupRoute({ providers, useTRPC }) {
@@ -47,7 +47,7 @@ function SignupRoute({ providers, useTRPC }) {
47
47
  children: [
48
48
  t("web-ui:auth.signup.alreadyHaveAccount"),
49
49
  " ",
50
- /* @__PURE__ */ jsx(Link$1, {
50
+ /* @__PURE__ */ jsx(Link, {
51
51
  to: "/login",
52
52
  className: "underline underline-offset-4 hover:text-primary",
53
53
  children: t("web-ui:auth.login.button")