@greatapps/common 1.1.133 → 1.1.135
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.
- package/dist/MMQ4R4NB-B36VHW65.mjs +61 -0
- package/dist/MMQ4R4NB-B36VHW65.mjs.map +1 -0
- package/dist/V4HPSUGU-6BOE4IPH.mjs +51 -0
- package/dist/V4HPSUGU-6BOE4IPH.mjs.map +1 -0
- package/dist/account-management.action-7QQCACDJ.mjs +40 -0
- package/dist/account.service-XTZDEIPS.mjs +9 -0
- package/dist/{modules/auth/services/auth.service.mjs → chunk-7MBVHKTC.mjs} +46 -13
- package/dist/chunk-7MBVHKTC.mjs.map +1 -0
- package/dist/{modules/users/services/user.service.mjs → chunk-B2W2HK7C.mjs} +13 -8
- package/dist/chunk-B2W2HK7C.mjs.map +1 -0
- package/dist/{modules/auth/actions/validate-session.action.mjs → chunk-EC3T7NF6.mjs} +8 -4
- package/dist/chunk-EC3T7NF6.mjs.map +1 -0
- package/dist/chunk-EKZZ2RWJ.mjs +12701 -0
- package/dist/chunk-EKZZ2RWJ.mjs.map +1 -0
- package/dist/chunk-ICUZDG2N.mjs +283 -0
- package/dist/chunk-ICUZDG2N.mjs.map +1 -0
- package/dist/{utils/safeServerAction.mjs → chunk-JW4XRHLX.mjs} +7 -2
- package/dist/chunk-JW4XRHLX.mjs.map +1 -0
- package/dist/chunk-QEFMNBSY.mjs +165 -0
- package/dist/chunk-QEFMNBSY.mjs.map +1 -0
- package/dist/{infra/api/client.mjs → chunk-RV7ECGIH.mjs} +12 -7
- package/dist/chunk-RV7ECGIH.mjs.map +1 -0
- package/dist/chunk-S53NE5H4.mjs +2928 -0
- package/dist/chunk-S53NE5H4.mjs.map +1 -0
- package/dist/{modules/whitelabel/services/whitelabel.service.mjs → chunk-UEWT6VFS.mjs} +57 -9
- package/dist/chunk-UEWT6VFS.mjs.map +1 -0
- package/dist/chunk-XY4LNPBR.mjs +16 -0
- package/dist/chunk-XY4LNPBR.mjs.map +1 -0
- package/dist/{modules/accounts/services/account.service.mjs → chunk-Z3Q2LLBS.mjs} +64 -9
- package/dist/chunk-Z3Q2LLBS.mjs.map +1 -0
- package/dist/find-user-by-id.action-BUFTU3ZY.mjs +11 -0
- package/dist/index.mjs +9584 -258
- package/dist/index.mjs.map +1 -1
- package/dist/modern-4YXF5ES3.mjs +426 -0
- package/dist/modern-4YXF5ES3.mjs.map +1 -0
- package/dist/server.mjs +140 -36
- package/dist/server.mjs.map +1 -1
- package/dist/user.service-VDR4JKHO.mjs +8 -0
- package/dist/validate-session.action-K7RWN2GE.mjs +11 -0
- package/dist/{modules/auth/actions/verify-two-factor.action.mjs → verify-two-factor.action-V6JQATK2.mjs} +12 -4
- package/dist/verify-two-factor.action-V6JQATK2.mjs.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +0 -1
- package/dist/components/account/AccountModals.mjs +0 -18
- package/dist/components/account/AccountModals.mjs.map +0 -1
- package/dist/components/account/ConfigurationsMyAccountModal.mjs +0 -132
- package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +0 -1
- package/dist/components/account/ConfirmDeleteAccountModal.mjs +0 -45
- package/dist/components/account/ConfirmDeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs +0 -45
- package/dist/components/account/ConfirmGlobalPreferencesModal.mjs.map +0 -1
- package/dist/components/account/DeleteAccountModal.mjs +0 -123
- package/dist/components/account/DeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/DisableTwoFactorAuthModal.mjs +0 -67
- package/dist/components/account/DisableTwoFactorAuthModal.mjs.map +0 -1
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +0 -42
- package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +0 -1
- package/dist/components/account/TwoFactorAuthModal.mjs +0 -190
- package/dist/components/account/TwoFactorAuthModal.mjs.map +0 -1
- package/dist/components/account/constants.mjs +0 -29
- package/dist/components/account/constants.mjs.map +0 -1
- package/dist/components/account/hooks/useChangeEmailForm.mjs +0 -53
- package/dist/components/account/hooks/useChangeEmailForm.mjs.map +0 -1
- package/dist/components/account/hooks/useChangePasswordForm.mjs +0 -47
- package/dist/components/account/hooks/useChangePasswordForm.mjs.map +0 -1
- package/dist/components/account/hooks/useChangePhoneForm.mjs +0 -64
- package/dist/components/account/hooks/useChangePhoneForm.mjs.map +0 -1
- package/dist/components/account/hooks/useConfigurationsModal.mjs +0 -33
- package/dist/components/account/hooks/useConfigurationsModal.mjs.map +0 -1
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs +0 -54
- package/dist/components/account/hooks/useDisableTwoFactorAuthForm.mjs.map +0 -1
- package/dist/components/account/hooks/useOtpVerification.mjs +0 -94
- package/dist/components/account/hooks/useOtpVerification.mjs.map +0 -1
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs +0 -80
- package/dist/components/account/hooks/useTwoFactorAuthForm.mjs.map +0 -1
- package/dist/components/account/sections/ChangeEmailModal.mjs +0 -180
- package/dist/components/account/sections/ChangeEmailModal.mjs.map +0 -1
- package/dist/components/account/sections/ChangePasswordSection.mjs +0 -64
- package/dist/components/account/sections/ChangePasswordSection.mjs.map +0 -1
- package/dist/components/account/sections/ChangePhoneModal.mjs +0 -182
- package/dist/components/account/sections/ChangePhoneModal.mjs.map +0 -1
- package/dist/components/account/sections/MyProfileSection.mjs +0 -303
- package/dist/components/account/sections/MyProfileSection.mjs.map +0 -1
- package/dist/components/account/sections/PreferencesSection.mjs +0 -250
- package/dist/components/account/sections/PreferencesSection.mjs.map +0 -1
- package/dist/components/account/sections/SecuritySection.mjs +0 -147
- package/dist/components/account/sections/SecuritySection.mjs.map +0 -1
- package/dist/components/handlers/SearchParamsHandler.mjs +0 -24
- package/dist/components/handlers/SearchParamsHandler.mjs.map +0 -1
- package/dist/components/layouts/AppMobileNavBar.mjs +0 -115
- package/dist/components/layouts/AppMobileNavBar.mjs.map +0 -1
- package/dist/components/layouts/AppNavBar.mjs +0 -49
- package/dist/components/layouts/AppNavBar.mjs.map +0 -1
- package/dist/components/layouts/MainLayout.mjs +0 -60
- package/dist/components/layouts/MainLayout.mjs.map +0 -1
- package/dist/components/layouts/MdSideBarNavigation.mjs +0 -54
- package/dist/components/layouts/MdSideBarNavigation.mjs.map +0 -1
- package/dist/components/layouts/NavBar.mjs +0 -132
- package/dist/components/layouts/NavBar.mjs.map +0 -1
- package/dist/components/layouts/NavBarItem.mjs +0 -23
- package/dist/components/layouts/NavBarItem.mjs.map +0 -1
- package/dist/components/layouts/NotificationsPopover.mjs +0 -97
- package/dist/components/layouts/NotificationsPopover.mjs.map +0 -1
- package/dist/components/layouts/ProfilePopover.mjs +0 -150
- package/dist/components/layouts/ProfilePopover.mjs.map +0 -1
- package/dist/components/layouts/SideBarNavigation.mjs +0 -22
- package/dist/components/layouts/SideBarNavigation.mjs.map +0 -1
- package/dist/components/layouts/UsersSelectorPopover.mjs +0 -236
- package/dist/components/layouts/UsersSelectorPopover.mjs.map +0 -1
- package/dist/components/modals/ModalManager.mjs +0 -19
- package/dist/components/modals/ModalManager.mjs.map +0 -1
- package/dist/components/modals/Modals.mjs +0 -20
- package/dist/components/modals/Modals.mjs.map +0 -1
- package/dist/components/navigation/AppNavigation.mjs +0 -30
- package/dist/components/navigation/AppNavigation.mjs.map +0 -1
- package/dist/components/navigation/AppNavigationContext.mjs +0 -13
- package/dist/components/navigation/AppNavigationContext.mjs.map +0 -1
- package/dist/components/navigation/NavItem.mjs +0 -35
- package/dist/components/navigation/NavItem.mjs.map +0 -1
- package/dist/components/navigation/NavItemsContext.mjs +0 -16
- package/dist/components/navigation/NavItemsContext.mjs.map +0 -1
- package/dist/components/navigation/ProjectSelectorPopover.mjs +0 -128
- package/dist/components/navigation/ProjectSelectorPopover.mjs.map +0 -1
- package/dist/components/navigation/shells/DesktopShell.mjs +0 -11
- package/dist/components/navigation/shells/DesktopShell.mjs.map +0 -1
- package/dist/components/navigation/shells/MdShell.mjs +0 -11
- package/dist/components/navigation/shells/MdShell.mjs.map +0 -1
- package/dist/components/navigation/shells/MobileShell.mjs +0 -27
- package/dist/components/navigation/shells/MobileShell.mjs.map +0 -1
- package/dist/components/navigation/shells/TabsMobileShell.mjs +0 -59
- package/dist/components/navigation/shells/TabsMobileShell.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/CreditsCard.mjs +0 -30
- package/dist/components/navigation/subcomponents/CreditsCard.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/NavItems.mjs +0 -25
- package/dist/components/navigation/subcomponents/NavItems.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/PlanCard.mjs +0 -25
- package/dist/components/navigation/subcomponents/PlanCard.mjs.map +0 -1
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs +0 -130
- package/dist/components/navigation/subcomponents/ProjectSelector.mjs.map +0 -1
- package/dist/components/navigation/types.mjs +0 -1
- package/dist/components/pages/notifications/Notifications.mjs +0 -156
- package/dist/components/pages/notifications/Notifications.mjs.map +0 -1
- package/dist/components/ui/buttons/Button.mjs +0 -52
- package/dist/components/ui/buttons/Button.mjs.map +0 -1
- package/dist/components/ui/buttons/CancelButton.mjs +0 -17
- package/dist/components/ui/buttons/CancelButton.mjs.map +0 -1
- package/dist/components/ui/buttons/CopyButton.mjs +0 -42
- package/dist/components/ui/buttons/CopyButton.mjs.map +0 -1
- package/dist/components/ui/data-display/Accordion.mjs +0 -76
- package/dist/components/ui/data-display/Accordion.mjs.map +0 -1
- package/dist/components/ui/data-display/Badge.mjs +0 -42
- package/dist/components/ui/data-display/Badge.mjs.map +0 -1
- package/dist/components/ui/data-display/Card.mjs +0 -92
- package/dist/components/ui/data-display/Card.mjs.map +0 -1
- package/dist/components/ui/data-display/Pagination.mjs +0 -118
- package/dist/components/ui/data-display/Pagination.mjs.map +0 -1
- package/dist/components/ui/data-display/ScrollArea.mjs +0 -62
- package/dist/components/ui/data-display/ScrollArea.mjs.map +0 -1
- package/dist/components/ui/data-display/Separator.mjs +0 -28
- package/dist/components/ui/data-display/Separator.mjs.map +0 -1
- package/dist/components/ui/data-display/Table.mjs +0 -116
- package/dist/components/ui/data-display/Table.mjs.map +0 -1
- package/dist/components/ui/data-display/Tabs.mjs +0 -69
- package/dist/components/ui/data-display/Tabs.mjs.map +0 -1
- package/dist/components/ui/data-display/UserAvatar.mjs +0 -49
- package/dist/components/ui/data-display/UserAvatar.mjs.map +0 -1
- package/dist/components/ui/feedback/CircularProgress.mjs +0 -71
- package/dist/components/ui/feedback/CircularProgress.mjs.map +0 -1
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs +0 -50
- package/dist/components/ui/feedback/DefaultCircularProgress.mjs.map +0 -1
- package/dist/components/ui/feedback/LoadingOverlay.mjs +0 -19
- package/dist/components/ui/feedback/LoadingOverlay.mjs.map +0 -1
- package/dist/components/ui/feedback/Progress.mjs +0 -37
- package/dist/components/ui/feedback/Progress.mjs.map +0 -1
- package/dist/components/ui/feedback/Toast.mjs +0 -77
- package/dist/components/ui/feedback/Toast.mjs.map +0 -1
- package/dist/components/ui/form/Calendar.mjs +0 -204
- package/dist/components/ui/form/Calendar.mjs.map +0 -1
- package/dist/components/ui/form/Checkbox.mjs +0 -33
- package/dist/components/ui/form/Checkbox.mjs.map +0 -1
- package/dist/components/ui/form/ComboboxField.mjs +0 -130
- package/dist/components/ui/form/ComboboxField.mjs.map +0 -1
- package/dist/components/ui/form/DatePicker.mjs +0 -82
- package/dist/components/ui/form/DatePicker.mjs.map +0 -1
- package/dist/components/ui/form/DateRangePicker.mjs +0 -92
- package/dist/components/ui/form/DateRangePicker.mjs.map +0 -1
- package/dist/components/ui/form/FormField.mjs +0 -103
- package/dist/components/ui/form/FormField.mjs.map +0 -1
- package/dist/components/ui/form/Input.mjs +0 -21
- package/dist/components/ui/form/Input.mjs.map +0 -1
- package/dist/components/ui/form/InputOtp.mjs +0 -70
- package/dist/components/ui/form/InputOtp.mjs.map +0 -1
- package/dist/components/ui/form/PhoneInput.mjs +0 -78
- package/dist/components/ui/form/PhoneInput.mjs.map +0 -1
- package/dist/components/ui/form/RadioGroup.mjs +0 -37
- package/dist/components/ui/form/RadioGroup.mjs.map +0 -1
- package/dist/components/ui/form/Select.mjs +0 -179
- package/dist/components/ui/form/Select.mjs.map +0 -1
- package/dist/components/ui/form/SelectField.mjs +0 -80
- package/dist/components/ui/form/SelectField.mjs.map +0 -1
- package/dist/components/ui/form/Switch.mjs +0 -33
- package/dist/components/ui/form/Switch.mjs.map +0 -1
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs +0 -40
- package/dist/components/ui/form/SwitchOptionFieldWithIcon.mjs.map +0 -1
- package/dist/components/ui/form/TextAreaField.mjs +0 -56
- package/dist/components/ui/form/TextAreaField.mjs.map +0 -1
- package/dist/components/ui/form/Textarea.mjs +0 -20
- package/dist/components/ui/form/Textarea.mjs.map +0 -1
- package/dist/components/ui/overlay/Command.mjs +0 -178
- package/dist/components/ui/overlay/Command.mjs.map +0 -1
- package/dist/components/ui/overlay/Dialog.mjs +0 -142
- package/dist/components/ui/overlay/Dialog.mjs.map +0 -1
- package/dist/components/ui/overlay/Popover.mjs +0 -46
- package/dist/components/ui/overlay/Popover.mjs.map +0 -1
- package/dist/components/ui/overlay/Sheet.mjs +0 -142
- package/dist/components/ui/overlay/Sheet.mjs.map +0 -1
- package/dist/components/ui/overlay/Tooltip.mjs +0 -57
- package/dist/components/ui/overlay/Tooltip.mjs.map +0 -1
- package/dist/components/widgets/notifications/NotificationCard.mjs +0 -54
- package/dist/components/widgets/notifications/NotificationCard.mjs.map +0 -1
- package/dist/enums/AccountSectionType.mjs +0 -11
- package/dist/enums/AccountSectionType.mjs.map +0 -1
- package/dist/hooks/copy-to-clipboard.hook.mjs +0 -52
- package/dist/hooks/copy-to-clipboard.hook.mjs.map +0 -1
- package/dist/hooks/useCountdownTimer.mjs +0 -29
- package/dist/hooks/useCountdownTimer.mjs.map +0 -1
- package/dist/hooks/useDebounce.mjs +0 -19
- package/dist/hooks/useDebounce.mjs.map +0 -1
- package/dist/hooks/useDebounceState.mjs +0 -12
- package/dist/hooks/useDebounceState.mjs.map +0 -1
- package/dist/hooks/useDebouncedEffect.mjs +0 -44
- package/dist/hooks/useDebouncedEffect.mjs.map +0 -1
- package/dist/hooks/useIsMobile.mjs +0 -18
- package/dist/hooks/useIsMobile.mjs.map +0 -1
- package/dist/hooks/usePasswordVisibility.mjs +0 -13
- package/dist/hooks/usePasswordVisibility.mjs.map +0 -1
- package/dist/infra/api/client.mjs.map +0 -1
- package/dist/infra/api/types.mjs +0 -31
- package/dist/infra/api/types.mjs.map +0 -1
- package/dist/infra/utils/client-info.mjs +0 -27
- package/dist/infra/utils/client-info.mjs.map +0 -1
- package/dist/infra/utils/clsx.mjs +0 -9
- package/dist/infra/utils/clsx.mjs.map +0 -1
- package/dist/infra/utils/params.mjs +0 -21
- package/dist/infra/utils/params.mjs.map +0 -1
- package/dist/infra/utils/parser.mjs +0 -24
- package/dist/infra/utils/parser.mjs.map +0 -1
- package/dist/infra/utils/percentage.mjs +0 -20
- package/dist/infra/utils/percentage.mjs.map +0 -1
- package/dist/middlewares/chain.mjs +0 -37
- package/dist/middlewares/chain.mjs.map +0 -1
- package/dist/middlewares/create-auth-middleware.mjs +0 -28
- package/dist/middlewares/create-auth-middleware.mjs.map +0 -1
- package/dist/middlewares/types.mjs +0 -11
- package/dist/middlewares/types.mjs.map +0 -1
- package/dist/modules/accounts/actions/account-management.action.mjs +0 -82
- package/dist/modules/accounts/actions/account-management.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/find-current-account.action.mjs +0 -10
- package/dist/modules/accounts/actions/find-current-account.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/list-currencies.action.mjs +0 -10
- package/dist/modules/accounts/actions/list-currencies.action.mjs.map +0 -1
- package/dist/modules/accounts/actions/list-timezones.action.mjs +0 -10
- package/dist/modules/accounts/actions/list-timezones.action.mjs.map +0 -1
- package/dist/modules/accounts/hooks/current-account.hook.mjs +0 -24
- package/dist/modules/accounts/hooks/current-account.hook.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useAccountManagement.mjs +0 -71
- package/dist/modules/accounts/hooks/useAccountManagement.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useCurrencies.mjs +0 -17
- package/dist/modules/accounts/hooks/useCurrencies.mjs.map +0 -1
- package/dist/modules/accounts/hooks/useTimezones.mjs +0 -17
- package/dist/modules/accounts/hooks/useTimezones.mjs.map +0 -1
- package/dist/modules/accounts/services/account.service.mjs.map +0 -1
- package/dist/modules/accounts/services/currency.service.mjs +0 -24
- package/dist/modules/accounts/services/currency.service.mjs.map +0 -1
- package/dist/modules/accounts/services/timezone.service.mjs +0 -65
- package/dist/modules/accounts/services/timezone.service.mjs.map +0 -1
- package/dist/modules/accounts/services/two-factor.service.mjs +0 -77
- package/dist/modules/accounts/services/two-factor.service.mjs.map +0 -1
- package/dist/modules/accounts/types.mjs +0 -1
- package/dist/modules/auth/actions/login.action.mjs +0 -14
- package/dist/modules/auth/actions/login.action.mjs.map +0 -1
- package/dist/modules/auth/actions/logout.action.mjs +0 -14
- package/dist/modules/auth/actions/logout.action.mjs.map +0 -1
- package/dist/modules/auth/actions/register.action.mjs +0 -14
- package/dist/modules/auth/actions/register.action.mjs.map +0 -1
- package/dist/modules/auth/actions/validate-session.action.mjs.map +0 -1
- package/dist/modules/auth/actions/verify-two-factor.action.mjs.map +0 -1
- package/dist/modules/auth/hooks/login.hook.mjs +0 -18
- package/dist/modules/auth/hooks/login.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/logout.hook.mjs +0 -13
- package/dist/modules/auth/hooks/logout.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/register.hook.mjs +0 -13
- package/dist/modules/auth/hooks/register.hook.mjs.map +0 -1
- package/dist/modules/auth/hooks/useUserQuery.mjs +0 -63
- package/dist/modules/auth/hooks/useUserQuery.mjs.map +0 -1
- package/dist/modules/auth/schema.mjs +0 -1
- package/dist/modules/auth/services/auth.service.mjs.map +0 -1
- package/dist/modules/auth/utils/get-user-context.mjs +0 -24
- package/dist/modules/auth/utils/get-user-context.mjs.map +0 -1
- package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs +0 -10
- package/dist/modules/ia-credits/actions/list-ia-credits.action.mjs.map +0 -1
- package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs +0 -76
- package/dist/modules/ia-credits/hooks/ia-credits.hook.mjs.map +0 -1
- package/dist/modules/ia-credits/services/ia-credits.service.mjs +0 -31
- package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +0 -1
- package/dist/modules/ia-credits/types.mjs +0 -25
- package/dist/modules/ia-credits/types.mjs.map +0 -1
- package/dist/modules/projects/actions/add-project-user.action.mjs +0 -10
- package/dist/modules/projects/actions/add-project-user.action.mjs.map +0 -1
- package/dist/modules/projects/actions/list-available-users.action.mjs +0 -10
- package/dist/modules/projects/actions/list-available-users.action.mjs.map +0 -1
- package/dist/modules/projects/actions/list-project-users.action.mjs +0 -10
- package/dist/modules/projects/actions/list-project-users.action.mjs.map +0 -1
- package/dist/modules/projects/actions/remove-project-user.action.mjs +0 -10
- package/dist/modules/projects/actions/remove-project-user.action.mjs.map +0 -1
- package/dist/modules/projects/hooks/list-available-users.hook.mjs +0 -34
- package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +0 -1
- package/dist/modules/projects/hooks/list-project-users.hook.mjs +0 -34
- package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +0 -1
- package/dist/modules/projects/services/project-users.service.mjs +0 -78
- package/dist/modules/projects/services/project-users.service.mjs.map +0 -1
- package/dist/modules/projects/types.mjs +0 -22
- package/dist/modules/projects/types.mjs.map +0 -1
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs +0 -10
- package/dist/modules/subscriptions/actions/list-subscriptions.action.mjs.map +0 -1
- package/dist/modules/subscriptions/constants/addons.constants.mjs +0 -12
- package/dist/modules/subscriptions/constants/addons.constants.mjs.map +0 -1
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs +0 -20
- package/dist/modules/subscriptions/hooks/find-active-subscription.hook.mjs.map +0 -1
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs +0 -18
- package/dist/modules/subscriptions/hooks/list-subscriptions.hook.mjs.map +0 -1
- package/dist/modules/subscriptions/services/subscriptions.service.mjs +0 -32
- package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +0 -1
- package/dist/modules/subscriptions/types.mjs +0 -57
- package/dist/modules/subscriptions/types.mjs.map +0 -1
- package/dist/modules/users/action/find-user-by-id.action.mjs +0 -10
- package/dist/modules/users/action/find-user-by-id.action.mjs.map +0 -1
- package/dist/modules/users/action/list-messages.action.mjs +0 -13
- package/dist/modules/users/action/list-messages.action.mjs.map +0 -1
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs +0 -10
- package/dist/modules/users/action/mark-all-messages-as-read.action.mjs.map +0 -1
- package/dist/modules/users/action/mark-message-as-read.action.mjs +0 -10
- package/dist/modules/users/action/mark-message-as-read.action.mjs.map +0 -1
- package/dist/modules/users/hooks/messages.hook.mjs +0 -57
- package/dist/modules/users/hooks/messages.hook.mjs.map +0 -1
- package/dist/modules/users/schema/messages.schema.mjs +0 -21
- package/dist/modules/users/schema/messages.schema.mjs.map +0 -1
- package/dist/modules/users/schema.mjs +0 -11
- package/dist/modules/users/schema.mjs.map +0 -1
- package/dist/modules/users/services/messages.service.mjs +0 -35
- package/dist/modules/users/services/messages.service.mjs.map +0 -1
- package/dist/modules/users/services/user.service.mjs.map +0 -1
- package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs +0 -15
- package/dist/modules/whitelabel/actions/find-whitelabel-styles.action.mjs.map +0 -1
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs +0 -21
- package/dist/modules/whitelabel/actions/find-whitelabel.action.mjs.map +0 -1
- package/dist/modules/whitelabel/schema.mjs +0 -1
- package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs +0 -76
- package/dist/modules/whitelabel/services/whitelabel-styles.service.mjs.map +0 -1
- package/dist/modules/whitelabel/services/whitelabel.service.mjs.map +0 -1
- package/dist/modules/whitelabel/styles-schema.mjs +0 -1
- package/dist/providers/auth.provider.mjs +0 -94
- package/dist/providers/auth.provider.mjs.map +0 -1
- package/dist/providers/query.provider.mjs +0 -99
- package/dist/providers/query.provider.mjs.map +0 -1
- package/dist/providers/whitelabel.provider.mjs +0 -31
- package/dist/providers/whitelabel.provider.mjs.map +0 -1
- package/dist/store/useAccountModals.mjs +0 -18
- package/dist/store/useAccountModals.mjs.map +0 -1
- package/dist/store/useMdSidebarStore.mjs +0 -11
- package/dist/store/useMdSidebarStore.mjs.map +0 -1
- package/dist/store/useMobileNavbarSheet.mjs +0 -14
- package/dist/store/useMobileNavbarSheet.mjs.map +0 -1
- package/dist/store/useModalManager.mjs +0 -75
- package/dist/store/useModalManager.mjs.map +0 -1
- package/dist/utils/browser/clipboard.mjs +0 -36
- package/dist/utils/browser/clipboard.mjs.map +0 -1
- package/dist/utils/file/index.mjs +0 -9
- package/dist/utils/file/index.mjs.map +0 -1
- package/dist/utils/format/masks.mjs +0 -56
- package/dist/utils/format/masks.mjs.map +0 -1
- package/dist/utils/intl/locales.mjs +0 -12
- package/dist/utils/intl/locales.mjs.map +0 -1
- package/dist/utils/safeServerAction.mjs.map +0 -1
- package/dist/utils/validators/account.mjs +0 -26
- package/dist/utils/validators/account.mjs.map +0 -1
- package/dist/utils/validators/common.mjs +0 -47
- package/dist/utils/validators/common.mjs.map +0 -1
- package/dist/utils/withAction.mjs +0 -13
- package/dist/utils/withAction.mjs.map +0 -1
- /package/dist/{components/navigation/types.mjs.map → account-management.action-7QQCACDJ.mjs.map} +0 -0
- /package/dist/{modules/accounts/types.mjs.map → account.service-XTZDEIPS.mjs.map} +0 -0
- /package/dist/{modules/auth/schema.mjs.map → find-user-by-id.action-BUFTU3ZY.mjs.map} +0 -0
- /package/dist/{modules/whitelabel/schema.mjs.map → user.service-VDR4JKHO.mjs.map} +0 -0
- /package/dist/{modules/whitelabel/styles-schema.mjs.map → validate-session.action-K7RWN2GE.mjs.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/account/DisableTwoFactorAuthModal.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { ShieldCheck } from 'lucide-react';\r\nimport { Button } from '../ui/buttons/Button';\r\nimport {\r\n Dialog,\r\n DialogContent,\r\n DialogDescription,\r\n DialogHeader,\r\n DialogTitle,\r\n} from '../ui/overlay/Dialog';\r\nimport { InputOTP, InputOTPGroup, InputOTPSlot } from '../ui/form/InputOtp';\r\nimport useDisableTwoFactorAuthForm from './hooks/useDisableTwoFactorAuthForm';\r\n\r\ninterface DisableTwoFactorAuthModalProps {\r\n open: boolean;\r\n onClose: () => void;\r\n onSuccess?: () => void;\r\n}\r\n\r\nexport default function DisableTwoFactorAuthModal({\r\n open,\r\n onClose,\r\n onSuccess,\r\n}: DisableTwoFactorAuthModalProps) {\r\n const { code, setCode, isValid, isLoading, handleClose, handleSubmit } =\r\n useDisableTwoFactorAuthForm({ onClose, onSuccess });\r\n\r\n return (\r\n <Dialog open={open} onOpenChange={handleClose}>\r\n <DialogContent className=\"flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-dvh top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-117.5! lg:h-auto! lg:rounded-lg lg:border lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!\">\r\n <form\r\n onSubmit={(e) => {\r\n e.preventDefault();\r\n handleSubmit();\r\n }}\r\n className=\"flex flex-col flex-1 lg:flex-none\"\r\n >\r\n <div className=\"flex flex-col gap-4 lg:gap-5 p-4 lg:p-5 flex-1 lg:flex-none\">\r\n <div className=\"flex items-center justify-center w-fit bg-gray-50 rounded-lg p-2\">\r\n <ShieldCheck size={20} className=\"text-gray-600\" />\r\n </div>\r\n <DialogHeader className=\"p-0 gap-2\">\r\n <DialogTitle className=\"paragraph-medium-semibold text-gray-950\">\r\n Desabilitar autenticação 2FA\r\n </DialogTitle>\r\n <DialogDescription className=\"paragraph-small-regular text-gray-600\">\r\n Informe o código de 6 dígitos do seu aplicativo autenticador para confirmar a\r\n desativação.\r\n </DialogDescription>\r\n </DialogHeader>\r\n\r\n <div className=\"flex flex-col gap-2\">\r\n <span className=\"paragraph-small-medium text-gray-700\">Código do autenticador</span>\r\n <InputOTP maxLength={6} value={code} onChange={setCode}>\r\n <InputOTPGroup className=\"gap-2\">\r\n {Array.from({ length: 6 }).map((_, i) => (\r\n <InputOTPSlot\r\n key={i}\r\n index={i}\r\n className=\"w-11! lg:w-12! h-13! lg:h-14! rounded-lg! text-lg border-gray-200\"\r\n />\r\n ))}\r\n </InputOTPGroup>\r\n </InputOTP>\r\n </div>\r\n </div>\r\n\r\n <div className=\"flex flex-row items-center gap-2 p-4 lg:p-5 border-t border-gray-200 mt-auto lg:mt-0\">\r\n <Button className=\"h-10! flex-1\" disabled={!isValid || isLoading} type=\"submit\">\r\n {isLoading ? 'Desabilitando...' : 'Desabilitar 2FA'}\r\n </Button>\r\n <Button\r\n variant=\"secondary\"\r\n className=\"h-10! flex-1\"\r\n type=\"button\"\r\n onClick={handleClose}\r\n >\r\n Cancelar\r\n </Button>\r\n </div>\r\n </form>\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n}\r\n"],"mappings":";AAwCc,cAEF,YAFE;AAtCd,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU,eAAe,oBAAoB;AACtD,OAAO,iCAAiC;AAQzB,SAAR,0BAA2C;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AACF,GAAmC;AACjC,QAAM,EAAE,MAAM,SAAS,SAAS,WAAW,aAAa,aAAa,IACnE,4BAA4B,EAAE,SAAS,UAAU,CAAC;AAEpD,SACE,oBAAC,UAAO,MAAY,cAAc,aAChC,8BAAC,iBAAc,WAAU,gTACvB;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,CAAC,MAAM;AACf,UAAE,eAAe;AACjB,qBAAa;AAAA,MACf;AAAA,MACA,WAAU;AAAA,MAEV;AAAA,6BAAC,SAAI,WAAU,+DACb;AAAA,8BAAC,SAAI,WAAU,oEACb,8BAAC,eAAY,MAAM,IAAI,WAAU,iBAAgB,GACnD;AAAA,UACA,qBAAC,gBAAa,WAAU,aACtB;AAAA,gCAAC,eAAY,WAAU,2CAA0C,gDAEjE;AAAA,YACA,oBAAC,qBAAkB,WAAU,yCAAwC,oHAGrE;AAAA,aACF;AAAA,UAEA,qBAAC,SAAI,WAAU,uBACb;AAAA,gCAAC,UAAK,WAAU,wCAAuC,uCAAsB;AAAA,YAC7E,oBAAC,YAAS,WAAW,GAAG,OAAO,MAAM,UAAU,SAC7C,8BAAC,iBAAc,WAAU,SACtB,gBAAM,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,CAAC,GAAG,MACjC;AAAA,cAAC;AAAA;AAAA,gBAEC,OAAO;AAAA,gBACP,WAAU;AAAA;AAAA,cAFL;AAAA,YAGP,CACD,GACH,GACF;AAAA,aACF;AAAA,WACF;AAAA,QAEA,qBAAC,SAAI,WAAU,wFACb;AAAA,8BAAC,UAAO,WAAU,gBAAe,UAAU,CAAC,WAAW,WAAW,MAAK,UACpE,sBAAY,qBAAqB,mBACpC;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,WAAU;AAAA,cACV,MAAK;AAAA,cACL,SAAS;AAAA,cACV;AAAA;AAAA,UAED;AAAA,WACF;AAAA;AAAA;AAAA,EACF,GACF,GACF;AAEJ;","names":[]}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { TriangleAlert } from "lucide-react";
|
|
4
|
-
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../ui/overlay/Dialog";
|
|
5
|
-
import { Button } from "../ui/buttons/Button";
|
|
6
|
-
import { useAccountModals } from "../../store/useAccountModals";
|
|
7
|
-
function IsntPossibleDeleteAccountModal() {
|
|
8
|
-
const { activeModal, close, config } = useAccountModals();
|
|
9
|
-
const { onGoToSubscription } = config;
|
|
10
|
-
const open = activeModal === "isntPossibleDelete";
|
|
11
|
-
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: close, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!", children: [
|
|
12
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
|
|
13
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5", children: /* @__PURE__ */ jsx(TriangleAlert, { size: 20, className: "text-red-500" }) }),
|
|
14
|
-
/* @__PURE__ */ jsxs(DialogHeader, { className: "p-0 gap-2", children: [
|
|
15
|
-
/* @__PURE__ */ jsx(DialogTitle, { className: "paragraph-medium-semibold text-gray-950", children: "N\xE3o \xE9 poss\xEDvel excluir a conta" }),
|
|
16
|
-
/* @__PURE__ */ jsxs(DialogDescription, { className: "paragraph-small-regular text-gray-600", children: [
|
|
17
|
-
"Voc\xEA tem uma assinatura ativa. Para excluir sua conta,",
|
|
18
|
-
" ",
|
|
19
|
-
/* @__PURE__ */ jsx("span", { className: "font-semibold text-gray-950", children: "primeiro cancele a assinatura" }),
|
|
20
|
-
" na p\xE1gina Assinatura e depois tente novamente."
|
|
21
|
-
] })
|
|
22
|
-
] })
|
|
23
|
-
] }),
|
|
24
|
-
/* @__PURE__ */ jsx("div", { className: "h-px bg-gray-200 -mx-6" }),
|
|
25
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2", children: [
|
|
26
|
-
/* @__PURE__ */ jsx(Button, { className: "h-10 flex-1", onClick: close, children: "Ok, entendi" }),
|
|
27
|
-
/* @__PURE__ */ jsx(
|
|
28
|
-
Button,
|
|
29
|
-
{
|
|
30
|
-
variant: "secondary",
|
|
31
|
-
className: "h-10 flex-1",
|
|
32
|
-
onClick: onGoToSubscription ?? close,
|
|
33
|
-
children: "Ir para assinatura"
|
|
34
|
-
}
|
|
35
|
-
)
|
|
36
|
-
] })
|
|
37
|
-
] }) });
|
|
38
|
-
}
|
|
39
|
-
export {
|
|
40
|
-
IsntPossibleDeleteAccountModal as default
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=IsntPossibleDeleteAccountModal.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/account/IsntPossibleDeleteAccountModal.tsx"],"sourcesContent":["'use client';\n\nimport { TriangleAlert } from 'lucide-react';\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\nimport { Button } from '../ui/buttons/Button';\nimport { useAccountModals } from '../../store/useAccountModals';\n\nexport default function IsntPossibleDeleteAccountModal() {\n const { activeModal, close, config } = useAccountModals();\n const { onGoToSubscription } = config;\n const open = activeModal === 'isntPossibleDelete';\n\n return (\n <Dialog open={open} onOpenChange={close}>\n <DialogContent className=\"max-w-[calc(100%-2rem)]! w-full rounded-lg border sm:max-w-[400px]! lg:max-w-[470px]! lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!\">\n <div className=\"flex flex-col gap-5\">\n <div className=\"flex items-center justify-center w-fit bg-red-50 rounded-lg p-2.5\">\n <TriangleAlert size={20} className=\"text-red-500\" />\n </div>\n <DialogHeader className=\"p-0 gap-2\">\n <DialogTitle className=\"paragraph-medium-semibold text-gray-950\">\n Não é possível excluir a conta\n </DialogTitle>\n <DialogDescription className=\"paragraph-small-regular text-gray-600\">\n Você tem uma assinatura ativa. Para excluir sua conta,{' '}\n <span className=\"font-semibold text-gray-950\">primeiro cancele a assinatura</span> na\n página Assinatura e depois tente novamente.\n </DialogDescription>\n </DialogHeader>\n </div>\n\n <div className=\"h-px bg-gray-200 -mx-6\" />\n\n <div className=\"flex flex-row items-center gap-2\">\n <Button className=\"h-10 flex-1\" onClick={close}>\n Ok, entendi\n </Button>\n <Button\n variant=\"secondary\"\n className=\"h-10 flex-1\"\n onClick={onGoToSubscription ?? close}\n >\n Ir para assinatura\n </Button>\n </div>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAiBY,cAMA,YANA;AAfZ,SAAS,qBAAqB;AAC9B,SAAS,QAAQ,eAAe,mBAAmB,cAAc,mBAAmB;AACpF,SAAS,cAAc;AACvB,SAAS,wBAAwB;AAElB,SAAR,iCAAkD;AACvD,QAAM,EAAE,aAAa,OAAO,OAAO,IAAI,iBAAiB;AACxD,QAAM,EAAE,mBAAmB,IAAI;AAC/B,QAAM,OAAO,gBAAgB;AAE7B,SACE,oBAAC,UAAO,MAAY,cAAc,OAChC,+BAAC,iBAAc,WAAU,mMACvB;AAAA,yBAAC,SAAI,WAAU,uBACb;AAAA,0BAAC,SAAI,WAAU,qEACb,8BAAC,iBAAc,MAAM,IAAI,WAAU,gBAAe,GACpD;AAAA,MACA,qBAAC,gBAAa,WAAU,aACtB;AAAA,4BAAC,eAAY,WAAU,2CAA0C,qDAEjE;AAAA,QACA,qBAAC,qBAAkB,WAAU,yCAAwC;AAAA;AAAA,UACZ;AAAA,UACvD,oBAAC,UAAK,WAAU,+BAA8B,2CAA6B;AAAA,UAAO;AAAA,WAEpF;AAAA,SACF;AAAA,OACF;AAAA,IAEA,oBAAC,SAAI,WAAU,0BAAyB;AAAA,IAExC,qBAAC,SAAI,WAAU,oCACb;AAAA,0BAAC,UAAO,WAAU,eAAc,SAAS,OAAO,yBAEhD;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,SAAS,sBAAsB;AAAA,UAChC;AAAA;AAAA,MAED;AAAA,OACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { ArrowLeft, X, Copy, RefreshCw } from "lucide-react";
|
|
4
|
-
import { Button } from "../ui/buttons/Button";
|
|
5
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "../ui/overlay/Dialog";
|
|
6
|
-
import { Separator } from "../ui/data-display/Separator";
|
|
7
|
-
import { InputOTP, InputOTPGroup, InputOTPSlot } from "../ui/form/InputOtp";
|
|
8
|
-
import useTwoFactorAuthForm from "./hooks/useTwoFactorAuthForm";
|
|
9
|
-
function TwoFactorAuthModal({ open, onClose, onSuccess }) {
|
|
10
|
-
const {
|
|
11
|
-
code,
|
|
12
|
-
setCode,
|
|
13
|
-
isCodeComplete,
|
|
14
|
-
isGenerating,
|
|
15
|
-
isConfirming,
|
|
16
|
-
generateFailed,
|
|
17
|
-
retryGenerate,
|
|
18
|
-
qrcode,
|
|
19
|
-
backupCodes,
|
|
20
|
-
step,
|
|
21
|
-
handleSubmit,
|
|
22
|
-
handleFinalize,
|
|
23
|
-
handleCopyCodes,
|
|
24
|
-
resetForm
|
|
25
|
-
} = useTwoFactorAuthForm({ onSuccess, open });
|
|
26
|
-
const handleClose = () => {
|
|
27
|
-
resetForm();
|
|
28
|
-
onClose();
|
|
29
|
-
};
|
|
30
|
-
if (step === "recovery") {
|
|
31
|
-
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(
|
|
32
|
-
DialogContent,
|
|
33
|
-
{
|
|
34
|
-
showCloseButton: false,
|
|
35
|
-
className: "flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-[100dvh] top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-[470px]! lg:h-auto! lg:rounded-lg lg:border lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!",
|
|
36
|
-
children: [
|
|
37
|
-
/* @__PURE__ */ jsx(DialogHeader, { className: "sr-only", children: /* @__PURE__ */ jsx(DialogTitle, { children: "C\xF3digos de seguran\xE7a" }) }),
|
|
38
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center px-4 py-3 relative border-b border-gray-200 lg:border-b-0", children: [
|
|
39
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-medium-semibold text-gray-950 text-center", children: "C\xF3digos de seguran\xE7a" }),
|
|
40
|
-
/* @__PURE__ */ jsx(
|
|
41
|
-
Button,
|
|
42
|
-
{
|
|
43
|
-
type: "button",
|
|
44
|
-
variant: "ghost",
|
|
45
|
-
className: "size-8! p-0 absolute right-4",
|
|
46
|
-
onClick: handleClose,
|
|
47
|
-
children: /* @__PURE__ */ jsx(X, { size: 18 })
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
] }),
|
|
51
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5 lg:gap-6 px-4 lg:px-5 py-5 lg:py-6 flex-1 lg:flex-none", children: [
|
|
52
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
53
|
-
/* @__PURE__ */ jsx("h3", { className: "paragraph-medium-semibold text-gray-950 max-w-[269px]", children: "Salve estes c\xF3digos de recupera\xE7\xE3o de emerg\xEAncia" }),
|
|
54
|
-
/* @__PURE__ */ jsxs("div", { className: "paragraph-small-regular text-gray-600", children: [
|
|
55
|
-
/* @__PURE__ */ jsx("p", { children: "Se voc\xEA perder acesso ao seu telefone, n\xE3o ser\xE1 poss\xEDvel fazer login em sua conta sem um c\xF3digo de dois fatores." }),
|
|
56
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
57
|
-
/* @__PURE__ */ jsx("p", { children: "Imprima, copie ou escreva em um local seguro os c\xF3digos abaixo." })
|
|
58
|
-
] })
|
|
59
|
-
] }),
|
|
60
|
-
/* @__PURE__ */ jsxs("div", { className: "bg-gray-50 rounded-lg p-4 flex flex-col gap-4", children: [
|
|
61
|
-
/* @__PURE__ */ jsx("div", { className: "paragraph-small-medium text-gray-950 whitespace-nowrap", children: backupCodes.map((backupCode, i) => /* @__PURE__ */ jsx("p", { children: backupCode }, i)) }),
|
|
62
|
-
/* @__PURE__ */ jsxs(
|
|
63
|
-
Button,
|
|
64
|
-
{
|
|
65
|
-
type: "button",
|
|
66
|
-
variant: "secondary",
|
|
67
|
-
className: "h-8! w-fit",
|
|
68
|
-
onClick: handleCopyCodes,
|
|
69
|
-
children: [
|
|
70
|
-
/* @__PURE__ */ jsx(Copy, { size: 16 }),
|
|
71
|
-
"Copiar c\xF3digos"
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
] })
|
|
76
|
-
] }),
|
|
77
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center p-4 lg:p-5 border-t border-gray-200 justify-between mt-auto lg:mt-0", children: [
|
|
78
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "h-10!", type: "button", onClick: handleClose, children: "Cancelar" }),
|
|
79
|
-
/* @__PURE__ */ jsx(Button, { className: "h-10!", type: "button", onClick: handleFinalize, children: "Finalizar" })
|
|
80
|
-
] })
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
) });
|
|
84
|
-
}
|
|
85
|
-
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(
|
|
86
|
-
DialogContent,
|
|
87
|
-
{
|
|
88
|
-
showCloseButton: false,
|
|
89
|
-
className: "flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-[100dvh] top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-[470px]! lg:h-auto! lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!",
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ jsx(DialogHeader, { className: "sr-only", children: /* @__PURE__ */ jsx(DialogTitle, { children: "Autentica\xE7\xE3o de dois fatores" }) }),
|
|
92
|
-
/* @__PURE__ */ jsxs("div", { className: "shrink-0 flex items-center justify-center px-4 py-3 relative border-b border-gray-200 lg:border-b-0", children: [
|
|
93
|
-
/* @__PURE__ */ jsx(
|
|
94
|
-
Button,
|
|
95
|
-
{
|
|
96
|
-
type: "button",
|
|
97
|
-
variant: "ghost",
|
|
98
|
-
className: "size-8! p-0 absolute left-4",
|
|
99
|
-
onClick: handleClose,
|
|
100
|
-
children: /* @__PURE__ */ jsx(ArrowLeft, { size: 20 })
|
|
101
|
-
}
|
|
102
|
-
),
|
|
103
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-medium-semibold text-gray-950 text-center", children: "Autentica\xE7\xE3o de dois fatores" }),
|
|
104
|
-
/* @__PURE__ */ jsx(
|
|
105
|
-
Button,
|
|
106
|
-
{
|
|
107
|
-
type: "button",
|
|
108
|
-
variant: "ghost",
|
|
109
|
-
className: "size-8! p-0 absolute right-4",
|
|
110
|
-
onClick: handleClose,
|
|
111
|
-
children: /* @__PURE__ */ jsx(X, { size: 18 })
|
|
112
|
-
}
|
|
113
|
-
)
|
|
114
|
-
] }),
|
|
115
|
-
/* @__PURE__ */ jsxs(
|
|
116
|
-
"form",
|
|
117
|
-
{
|
|
118
|
-
className: "flex-1 min-h-0 flex flex-col",
|
|
119
|
-
onSubmit: (e) => {
|
|
120
|
-
e.preventDefault();
|
|
121
|
-
if (isCodeComplete) handleSubmit();
|
|
122
|
-
},
|
|
123
|
-
children: [
|
|
124
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0 overflow-y-auto overscroll-contain lg:overflow-visible", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4 lg:gap-8 px-4 lg:px-5 py-4 lg:py-6 pb-60 lg:pb-6", children: [
|
|
125
|
-
/* @__PURE__ */ jsxs("p", { className: "paragraph-small-regular text-gray-950 text-center max-w-full lg:max-w-[412px]", children: [
|
|
126
|
-
"Instale um aplicativo autenticador no seu celular (ex.:",
|
|
127
|
-
" ",
|
|
128
|
-
/* @__PURE__ */ jsx(
|
|
129
|
-
"a",
|
|
130
|
-
{
|
|
131
|
-
href: "https://support.google.com/accounts/answer/1066447",
|
|
132
|
-
target: "_blank",
|
|
133
|
-
rel: "noopener noreferrer",
|
|
134
|
-
className: "paragraph-small-medium underline",
|
|
135
|
-
children: "Google Authenticator"
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
"), escaneie o QR Code ao lado ou copie a chave no aplicativo e, em seguida, digite o c\xF3digo de 6 d\xEDgitos gerado para continuar."
|
|
139
|
-
] }),
|
|
140
|
-
/* @__PURE__ */ jsx("div", { className: "border border-gray-200 rounded-lg overflow-hidden p-2 lg:p-3 flex items-center justify-center w-[136px] h-[136px] lg:w-[203px] lg:h-[203px]", children: generateFailed ? /* @__PURE__ */ jsxs(
|
|
141
|
-
"button",
|
|
142
|
-
{
|
|
143
|
-
type: "button",
|
|
144
|
-
onClick: () => retryGenerate(),
|
|
145
|
-
className: "flex flex-col items-center gap-1.5 text-center",
|
|
146
|
-
children: [
|
|
147
|
-
/* @__PURE__ */ jsx(RefreshCw, { size: 20, className: "text-gray-400" }),
|
|
148
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-medium text-gray-500", children: "Tentar novamente" })
|
|
149
|
-
]
|
|
150
|
-
}
|
|
151
|
-
) : isGenerating || !qrcode ? /* @__PURE__ */ jsx("div", { className: "skeleton w-full h-full rounded" }) : (
|
|
152
|
-
// eslint-disable-next-line @next/next/no-img-element
|
|
153
|
-
/* @__PURE__ */ jsx(
|
|
154
|
-
"img",
|
|
155
|
-
{
|
|
156
|
-
src: qrcode,
|
|
157
|
-
alt: "QR Code para autentica\xE7\xE3o de dois fatores",
|
|
158
|
-
className: "w-full h-full"
|
|
159
|
-
}
|
|
160
|
-
)
|
|
161
|
-
) }),
|
|
162
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 w-full", children: [
|
|
163
|
-
/* @__PURE__ */ jsx(Separator, { className: "flex-1" }),
|
|
164
|
-
/* @__PURE__ */ jsx("span", { className: "paragraph-xsmall-medium text-gray-500 opacity-80 whitespace-nowrap", children: "Cole os 6 d\xEDgitos abaixo" }),
|
|
165
|
-
/* @__PURE__ */ jsx(Separator, { className: "flex-1" })
|
|
166
|
-
] }),
|
|
167
|
-
/* @__PURE__ */ jsx("div", { className: "scroll-mt-20", children: /* @__PURE__ */ jsx(InputOTP, { maxLength: 6, value: code, onChange: setCode, children: /* @__PURE__ */ jsx(InputOTPGroup, { className: "gap-2", children: Array.from({ length: 6 }).map((_, i) => /* @__PURE__ */ jsx(
|
|
168
|
-
InputOTPSlot,
|
|
169
|
-
{
|
|
170
|
-
index: i,
|
|
171
|
-
className: "w-11! lg:w-12! h-13! lg:h-14! rounded-lg! text-lg border-gray-200"
|
|
172
|
-
},
|
|
173
|
-
i
|
|
174
|
-
)) }) }) })
|
|
175
|
-
] }) }),
|
|
176
|
-
/* @__PURE__ */ jsxs("div", { className: "shrink-0 flex items-center p-4 lg:p-5 border-t border-gray-200 justify-between gap-2 bg-white", children: [
|
|
177
|
-
/* @__PURE__ */ jsx(Button, { variant: "secondary", className: "h-10!", type: "button", onClick: handleClose, children: "Cancelar" }),
|
|
178
|
-
/* @__PURE__ */ jsx(Button, { type: "submit", className: "h-10!", disabled: !isCodeComplete || isConfirming, children: isConfirming ? "Ativando..." : "Ativar autentica\xE7\xE3o" })
|
|
179
|
-
] })
|
|
180
|
-
]
|
|
181
|
-
}
|
|
182
|
-
)
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
) });
|
|
186
|
-
}
|
|
187
|
-
export {
|
|
188
|
-
TwoFactorAuthModal as default
|
|
189
|
-
};
|
|
190
|
-
//# sourceMappingURL=TwoFactorAuthModal.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/account/TwoFactorAuthModal.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { ArrowLeft, X, Copy, RefreshCw } from 'lucide-react';\r\nimport { Button } from '../ui/buttons/Button';\r\nimport { Dialog, DialogContent, DialogHeader, DialogTitle } from '../ui/overlay/Dialog';\r\nimport { Separator } from '../ui/data-display/Separator';\r\nimport { InputOTP, InputOTPGroup, InputOTPSlot } from '../ui/form/InputOtp';\r\nimport useTwoFactorAuthForm from './hooks/useTwoFactorAuthForm';\r\n\r\ninterface TwoFactorAuthModalProps {\r\n open: boolean;\r\n onClose: () => void;\r\n onSuccess?: () => void;\r\n}\r\n\r\nexport default function TwoFactorAuthModal({ open, onClose, onSuccess }: TwoFactorAuthModalProps) {\r\n const {\r\n code,\r\n setCode,\r\n isCodeComplete,\r\n isGenerating,\r\n isConfirming,\r\n generateFailed,\r\n retryGenerate,\r\n qrcode,\r\n backupCodes,\r\n step,\r\n handleSubmit,\r\n handleFinalize,\r\n handleCopyCodes,\r\n resetForm,\r\n } = useTwoFactorAuthForm({ onSuccess, open });\r\n\r\n const handleClose = () => {\r\n resetForm();\r\n onClose();\r\n };\r\n\r\n if (step === 'recovery') {\r\n return (\r\n <Dialog open={open} onOpenChange={handleClose}>\r\n <DialogContent\r\n showCloseButton={false}\r\n className=\"flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-[100dvh] top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-[470px]! lg:h-auto! lg:rounded-lg lg:border lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!\"\r\n >\r\n <DialogHeader className=\"sr-only\">\r\n <DialogTitle>Códigos de segurança</DialogTitle>\r\n </DialogHeader>\r\n <div className=\"flex items-center justify-center px-4 py-3 relative border-b border-gray-200 lg:border-b-0\">\r\n <span className=\"paragraph-medium-semibold text-gray-950 text-center\">\r\n Códigos de segurança\r\n </span>\r\n <Button\r\n type=\"button\"\r\n variant=\"ghost\"\r\n className=\"size-8! p-0 absolute right-4\"\r\n onClick={handleClose}\r\n >\r\n <X size={18} />\r\n </Button>\r\n </div>\r\n\r\n <div className=\"flex flex-col gap-5 lg:gap-6 px-4 lg:px-5 py-5 lg:py-6 flex-1 lg:flex-none\">\r\n <div className=\"flex flex-col gap-2\">\r\n <h3 className=\"paragraph-medium-semibold text-gray-950 max-w-[269px]\">\r\n Salve estes códigos de recuperação de emergência\r\n </h3>\r\n <div className=\"paragraph-small-regular text-gray-600\">\r\n <p>\r\n Se você perder acesso ao seu telefone, não será possível fazer login em sua conta\r\n sem um código de dois fatores.\r\n </p>\r\n <br />\r\n <p>Imprima, copie ou escreva em um local seguro os códigos abaixo.</p>\r\n </div>\r\n </div>\r\n\r\n <div className=\"bg-gray-50 rounded-lg p-4 flex flex-col gap-4\">\r\n <div className=\"paragraph-small-medium text-gray-950 whitespace-nowrap\">\r\n {backupCodes.map((backupCode, i) => (\r\n <p key={i}>{backupCode}</p>\r\n ))}\r\n </div>\r\n <Button\r\n type=\"button\"\r\n variant=\"secondary\"\r\n className=\"h-8! w-fit\"\r\n onClick={handleCopyCodes}\r\n >\r\n <Copy size={16} />\r\n Copiar códigos\r\n </Button>\r\n </div>\r\n </div>\r\n\r\n <div className=\"flex items-center p-4 lg:p-5 border-t border-gray-200 justify-between mt-auto lg:mt-0\">\r\n <Button variant=\"secondary\" className=\"h-10!\" type=\"button\" onClick={handleClose}>\r\n Cancelar\r\n </Button>\r\n <Button className=\"h-10!\" type=\"button\" onClick={handleFinalize}>\r\n Finalizar\r\n </Button>\r\n </div>\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n }\r\n\r\n return (\r\n <Dialog open={open} onOpenChange={handleClose}>\r\n <DialogContent\r\n showCloseButton={false}\r\n className=\"flex flex-col p-0 gap-0 max-w-full! border-0 rounded-t-2xl rounded-b-none h-[100dvh] top-0! bottom-0! left-0! right-0! translate-x-0! translate-y-0! lg:max-w-[470px]! lg:h-auto! lg:max-h-[90vh] lg:rounded-lg lg:border lg:top-[50%]! lg:left-[50%]! lg:right-auto! lg:bottom-auto! lg:translate-x-[-50%]! lg:translate-y-[-50%]!\"\r\n >\r\n <DialogHeader className=\"sr-only\">\r\n <DialogTitle>Autenticação de dois fatores</DialogTitle>\r\n </DialogHeader>\r\n <div className=\"shrink-0 flex items-center justify-center px-4 py-3 relative border-b border-gray-200 lg:border-b-0\">\r\n <Button\r\n type=\"button\"\r\n variant=\"ghost\"\r\n className=\"size-8! p-0 absolute left-4\"\r\n onClick={handleClose}\r\n >\r\n <ArrowLeft size={20} />\r\n </Button>\r\n <span className=\"paragraph-medium-semibold text-gray-950 text-center\">\r\n Autenticação de dois fatores\r\n </span>\r\n <Button\r\n type=\"button\"\r\n variant=\"ghost\"\r\n className=\"size-8! p-0 absolute right-4\"\r\n onClick={handleClose}\r\n >\r\n <X size={18} />\r\n </Button>\r\n </div>\r\n\r\n <form\r\n className=\"flex-1 min-h-0 flex flex-col\"\r\n onSubmit={(e) => {\r\n e.preventDefault();\r\n if (isCodeComplete) handleSubmit();\r\n }}\r\n >\r\n <div className=\"flex-1 min-h-0 overflow-y-auto overscroll-contain lg:overflow-visible\">\r\n <div className=\"flex flex-col items-center gap-4 lg:gap-8 px-4 lg:px-5 py-4 lg:py-6 pb-60 lg:pb-6\">\r\n <p className=\"paragraph-small-regular text-gray-950 text-center max-w-full lg:max-w-[412px]\">\r\n Instale um aplicativo autenticador no seu celular (ex.:{' '}\r\n <a\r\n href=\"https://support.google.com/accounts/answer/1066447\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className=\"paragraph-small-medium underline\"\r\n >\r\n Google Authenticator\r\n </a>\r\n ), escaneie o QR Code ao lado ou copie a chave no aplicativo e, em seguida, digite o\r\n código de 6 dígitos gerado para continuar.\r\n </p>\r\n\r\n <div className=\"border border-gray-200 rounded-lg overflow-hidden p-2 lg:p-3 flex items-center justify-center w-[136px] h-[136px] lg:w-[203px] lg:h-[203px]\">\r\n {generateFailed ? (\r\n <button\r\n type=\"button\"\r\n onClick={() => retryGenerate()}\r\n className=\"flex flex-col items-center gap-1.5 text-center\"\r\n >\r\n <RefreshCw size={20} className=\"text-gray-400\" />\r\n <span className=\"paragraph-xsmall-medium text-gray-500\">Tentar novamente</span>\r\n </button>\r\n ) : isGenerating || !qrcode ? (\r\n <div className=\"skeleton w-full h-full rounded\" />\r\n ) : (\r\n // eslint-disable-next-line @next/next/no-img-element\r\n <img\r\n src={qrcode}\r\n alt=\"QR Code para autenticação de dois fatores\"\r\n className=\"w-full h-full\"\r\n />\r\n )}\r\n </div>\r\n\r\n <div className=\"flex items-center gap-3 w-full\">\r\n <Separator className=\"flex-1\" />\r\n <span className=\"paragraph-xsmall-medium text-gray-500 opacity-80 whitespace-nowrap\">\r\n Cole os 6 dígitos abaixo\r\n </span>\r\n <Separator className=\"flex-1\" />\r\n </div>\r\n\r\n <div className=\"scroll-mt-20\">\r\n <InputOTP maxLength={6} value={code} onChange={setCode}>\r\n <InputOTPGroup className=\"gap-2\">\r\n {Array.from({ length: 6 }).map((_, i) => (\r\n <InputOTPSlot\r\n key={i}\r\n index={i}\r\n className=\"w-11! lg:w-12! h-13! lg:h-14! rounded-lg! text-lg border-gray-200\"\r\n />\r\n ))}\r\n </InputOTPGroup>\r\n </InputOTP>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"shrink-0 flex items-center p-4 lg:p-5 border-t border-gray-200 justify-between gap-2 bg-white\">\r\n <Button variant=\"secondary\" className=\"h-10!\" type=\"button\" onClick={handleClose}>\r\n Cancelar\r\n </Button>\r\n <Button type=\"submit\" className=\"h-10!\" disabled={!isCodeComplete || isConfirming}>\r\n {isConfirming ? 'Ativando...' : 'Ativar autenticação'}\r\n </Button>\r\n </div>\r\n </form>\r\n </DialogContent>\r\n </Dialog>\r\n );\r\n}\r\n"],"mappings":"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","names":[]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { buildLocaleOptions } from "../../utils/intl/locales";
|
|
2
|
-
const GENDER_OPTIONS = [
|
|
3
|
-
{ value: "masculino", label: "Masculino", apiValue: 1 },
|
|
4
|
-
{ value: "feminino", label: "Feminino", apiValue: 0 }
|
|
5
|
-
];
|
|
6
|
-
const LANGUAGE_OPTIONS = buildLocaleOptions();
|
|
7
|
-
const CURRENCY_OPTIONS = [
|
|
8
|
-
{ value: "BRL", label: "BRL (R$)", displayValue: "BRL (R$)" },
|
|
9
|
-
{ value: "USD", label: "USD ($)", displayValue: "USD ($)" },
|
|
10
|
-
{ value: "EUR", label: "EUR (\u20AC)", displayValue: "EUR (\u20AC)" }
|
|
11
|
-
];
|
|
12
|
-
const TIME_FORMAT_OPTIONS = [
|
|
13
|
-
{ value: "24h", label: "24 horas", displayValue: "24 horas" },
|
|
14
|
-
{ value: "12h", label: "12 horas (AM/PM)", displayValue: "12 horas (AM/PM)" }
|
|
15
|
-
];
|
|
16
|
-
const NOTIFICATION_TYPES = [
|
|
17
|
-
"Atualiza\xE7\xF5es de projetos",
|
|
18
|
-
"Alertas de seguran\xE7a",
|
|
19
|
-
"Mudan\xE7as no plano ou faturamento",
|
|
20
|
-
"Manuten\xE7\xF5es programadas"
|
|
21
|
-
];
|
|
22
|
-
export {
|
|
23
|
-
CURRENCY_OPTIONS,
|
|
24
|
-
GENDER_OPTIONS,
|
|
25
|
-
LANGUAGE_OPTIONS,
|
|
26
|
-
NOTIFICATION_TYPES,
|
|
27
|
-
TIME_FORMAT_OPTIONS
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/account/constants.ts"],"sourcesContent":["import { buildLocaleOptions } from '../../utils/intl/locales';\r\n\r\nexport const GENDER_OPTIONS = [\r\n { value: 'masculino', label: 'Masculino', apiValue: 1 },\r\n { value: 'feminino', label: 'Feminino', apiValue: 0 },\r\n];\r\n\r\nexport const LANGUAGE_OPTIONS = buildLocaleOptions();\r\n\r\nexport const CURRENCY_OPTIONS = [\r\n { value: 'BRL', label: 'BRL (R$)', displayValue: 'BRL (R$)' },\r\n { value: 'USD', label: 'USD ($)', displayValue: 'USD ($)' },\r\n { value: 'EUR', label: 'EUR (€)', displayValue: 'EUR (€)' },\r\n];\r\n\r\nexport const TIME_FORMAT_OPTIONS = [\r\n { value: '24h', label: '24 horas', displayValue: '24 horas' },\r\n { value: '12h', label: '12 horas (AM/PM)', displayValue: '12 horas (AM/PM)' },\r\n];\r\n\r\nexport const NOTIFICATION_TYPES = [\r\n 'Atualizações de projetos',\r\n 'Alertas de segurança',\r\n 'Mudanças no plano ou faturamento',\r\n 'Manutenções programadas',\r\n];\r\n"],"mappings":"AAAA,SAAS,0BAA0B;AAE5B,MAAM,iBAAiB;AAAA,EAC5B,EAAE,OAAO,aAAa,OAAO,aAAa,UAAU,EAAE;AAAA,EACtD,EAAE,OAAO,YAAY,OAAO,YAAY,UAAU,EAAE;AACtD;AAEO,MAAM,mBAAmB,mBAAmB;AAE5C,MAAM,mBAAmB;AAAA,EAC9B,EAAE,OAAO,OAAO,OAAO,YAAY,cAAc,WAAW;AAAA,EAC5D,EAAE,OAAO,OAAO,OAAO,WAAW,cAAc,UAAU;AAAA,EAC1D,EAAE,OAAO,OAAO,OAAO,gBAAW,cAAc,eAAU;AAC5D;AAEO,MAAM,sBAAsB;AAAA,EACjC,EAAE,OAAO,OAAO,OAAO,YAAY,cAAc,WAAW;AAAA,EAC5D,EAAE,OAAO,OAAO,OAAO,oBAAoB,cAAc,mBAAmB;AAC9E;AAEO,MAAM,qBAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useCallback } from "react";
|
|
4
|
-
import { useForm } from "react-hook-form";
|
|
5
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
6
|
-
import { toast } from "sonner";
|
|
7
|
-
import { Toast } from "../../ui/feedback/Toast";
|
|
8
|
-
import { changeEmailSchema } from "../../../utils/validators/account";
|
|
9
|
-
import { requestEmailChangeAction } from "../../../modules/accounts/actions/account-management.action";
|
|
10
|
-
function useChangeEmailForm() {
|
|
11
|
-
const [showVerification, setShowVerification] = useState(false);
|
|
12
|
-
const { register, handleSubmit, reset, watch, formState: { errors, isSubmitting } } = useForm({
|
|
13
|
-
resolver: zodResolver(changeEmailSchema),
|
|
14
|
-
mode: "onChange",
|
|
15
|
-
defaultValues: { email: "" }
|
|
16
|
-
});
|
|
17
|
-
const handleContinue = handleSubmit(async (data) => {
|
|
18
|
-
const result = await requestEmailChangeAction(data.email);
|
|
19
|
-
if (!result.success) {
|
|
20
|
-
toast.custom((t) => /* @__PURE__ */ jsx(
|
|
21
|
-
Toast,
|
|
22
|
-
{
|
|
23
|
-
variant: "error",
|
|
24
|
-
message: result.error ?? "E-mail j\xE1 existente ou ocorreu um erro. Tente novamente mais tarde.",
|
|
25
|
-
toastId: t
|
|
26
|
-
}
|
|
27
|
-
));
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
setShowVerification(true);
|
|
31
|
-
});
|
|
32
|
-
const handleBack = useCallback(() => {
|
|
33
|
-
setShowVerification(false);
|
|
34
|
-
}, []);
|
|
35
|
-
const resetForm = useCallback(() => {
|
|
36
|
-
reset();
|
|
37
|
-
setShowVerification(false);
|
|
38
|
-
}, [reset]);
|
|
39
|
-
return {
|
|
40
|
-
showVerification,
|
|
41
|
-
emailToVerify: watch("email"),
|
|
42
|
-
isSubmitting,
|
|
43
|
-
errors,
|
|
44
|
-
register,
|
|
45
|
-
handleContinue,
|
|
46
|
-
handleBack,
|
|
47
|
-
resetForm
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
export {
|
|
51
|
-
useChangeEmailForm as default
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=useChangeEmailForm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/account/hooks/useChangeEmailForm.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { useState, useCallback } from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { zodResolver } from '@hookform/resolvers/zod';\r\nimport { toast } from 'sonner';\r\nimport { Toast } from '../../ui/feedback/Toast';\r\nimport { changeEmailSchema, type ChangeEmailFormData } from '../../../utils/validators/account';\r\nimport { requestEmailChangeAction } from '../../../modules/accounts/actions/account-management.action';\r\n\r\nexport default function useChangeEmailForm() {\r\n const [showVerification, setShowVerification] = useState(false);\r\n\r\n const { register, handleSubmit, reset, watch, formState: { errors, isSubmitting } } = useForm<ChangeEmailFormData>({\r\n resolver: zodResolver(changeEmailSchema),\r\n mode: 'onChange',\r\n defaultValues: { email: '' },\r\n });\r\n\r\n const handleContinue = handleSubmit(async (data) => {\r\n const result = await requestEmailChangeAction(data.email);\r\n\r\n if (!result.success) {\r\n toast.custom((t) => (\r\n <Toast\r\n variant=\"error\"\r\n message={result.error ?? 'E-mail já existente ou ocorreu um erro. Tente novamente mais tarde.'}\r\n toastId={t}\r\n />\r\n ));\r\n return;\r\n }\r\n\r\n setShowVerification(true);\r\n });\r\n\r\n const handleBack = useCallback(() => {\r\n setShowVerification(false);\r\n }, []);\r\n\r\n const resetForm = useCallback(() => {\r\n reset();\r\n setShowVerification(false);\r\n }, [reset]);\r\n\r\n return {\r\n showVerification,\r\n emailToVerify: watch('email'),\r\n isSubmitting,\r\n errors,\r\n register,\r\n handleContinue,\r\n handleBack,\r\n resetForm,\r\n };\r\n}\r\n"],"mappings":";AAwBQ;AAtBR,SAAS,UAAU,mBAAmB;AACtC,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,aAAa;AACtB,SAAS,yBAAmD;AAC5D,SAAS,gCAAgC;AAE1B,SAAR,qBAAsC;AAC3C,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAS,KAAK;AAE9D,QAAM,EAAE,UAAU,cAAc,OAAO,OAAO,WAAW,EAAE,QAAQ,aAAa,EAAE,IAAI,QAA6B;AAAA,IACjH,UAAU,YAAY,iBAAiB;AAAA,IACvC,MAAM;AAAA,IACN,eAAe,EAAE,OAAO,GAAG;AAAA,EAC7B,CAAC;AAED,QAAM,iBAAiB,aAAa,OAAO,SAAS;AAClD,UAAM,SAAS,MAAM,yBAAyB,KAAK,KAAK;AAExD,QAAI,CAAC,OAAO,SAAS;AACnB,YAAM,OAAO,CAAC,MACZ;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,OAAO,SAAS;AAAA,UACzB,SAAS;AAAA;AAAA,MACX,CACD;AACD;AAAA,IACF;AAEA,wBAAoB,IAAI;AAAA,EAC1B,CAAC;AAED,QAAM,aAAa,YAAY,MAAM;AACnC,wBAAoB,KAAK;AAAA,EAC3B,GAAG,CAAC,CAAC;AAEL,QAAM,YAAY,YAAY,MAAM;AAClC,UAAM;AACN,wBAAoB,KAAK;AAAA,EAC3B,GAAG,CAAC,KAAK,CAAC;AAEV,SAAO;AAAA,IACL;AAAA,IACA,eAAe,MAAM,OAAO;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useForm } from "react-hook-form";
|
|
4
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
5
|
-
import { useMutation } from "@tanstack/react-query";
|
|
6
|
-
import { toast } from "sonner";
|
|
7
|
-
import { Toast } from "../../ui/feedback/Toast";
|
|
8
|
-
import { changePasswordSchema } from "../../../utils/validators/account";
|
|
9
|
-
import { changePasswordAction } from "../../../modules/accounts/actions/account-management.action";
|
|
10
|
-
function useChangePasswordForm({ onSuccess } = {}) {
|
|
11
|
-
const form = useForm({
|
|
12
|
-
resolver: zodResolver(changePasswordSchema),
|
|
13
|
-
mode: "onChange",
|
|
14
|
-
defaultValues: {
|
|
15
|
-
currentPassword: "",
|
|
16
|
-
newPassword: ""
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const mutation = useMutation({
|
|
20
|
-
mutationFn: changePasswordAction,
|
|
21
|
-
onSuccess: (result) => {
|
|
22
|
-
if (!result.success) {
|
|
23
|
-
toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "error", message: result.error ?? "Erro ao alterar senha", toastId: t }));
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "success", message: "Senha alterada com sucesso", toastId: t }));
|
|
27
|
-
form.reset();
|
|
28
|
-
onSuccess?.();
|
|
29
|
-
},
|
|
30
|
-
onError: () => {
|
|
31
|
-
toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "error", message: "Erro ao alterar senha. Tente novamente.", toastId: t }));
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
const onSubmit = (data) => {
|
|
35
|
-
mutation.mutate(data);
|
|
36
|
-
};
|
|
37
|
-
return {
|
|
38
|
-
register: form.register,
|
|
39
|
-
handleSubmit: form.handleSubmit(onSubmit),
|
|
40
|
-
errors: form.formState.errors,
|
|
41
|
-
isLoading: mutation.isPending
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
export {
|
|
45
|
-
useChangePasswordForm as default
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=useChangePasswordForm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/account/hooks/useChangePasswordForm.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { useForm } from 'react-hook-form';\r\nimport { zodResolver } from '@hookform/resolvers/zod';\r\nimport { useMutation } from '@tanstack/react-query';\r\nimport { toast } from 'sonner';\r\nimport { Toast } from '../../ui/feedback/Toast';\r\nimport { changePasswordSchema, type ChangePasswordFormData } from '../../../utils/validators/account';\r\nimport { changePasswordAction } from '../../../modules/accounts/actions/account-management.action';\r\n\r\ninterface UseChangePasswordFormProps {\r\n onSuccess?: () => void;\r\n}\r\n\r\nexport default function useChangePasswordForm({ onSuccess }: UseChangePasswordFormProps = {}) {\r\n const form = useForm<ChangePasswordFormData>({\r\n resolver: zodResolver(changePasswordSchema),\r\n mode: 'onChange',\r\n defaultValues: {\r\n currentPassword: '',\r\n newPassword: '',\r\n },\r\n });\r\n\r\n const mutation = useMutation({\r\n mutationFn: changePasswordAction,\r\n onSuccess: (result) => {\r\n if (!result.success) {\r\n toast.custom((t) => (\r\n <Toast variant=\"error\" message={result.error ?? 'Erro ao alterar senha'} toastId={t} />\r\n ));\r\n return;\r\n }\r\n\r\n toast.custom((t) => (\r\n <Toast variant=\"success\" message=\"Senha alterada com sucesso\" toastId={t} />\r\n ));\r\n\r\n form.reset();\r\n onSuccess?.();\r\n },\r\n onError: () => {\r\n toast.custom((t) => (\r\n <Toast variant=\"error\" message=\"Erro ao alterar senha. Tente novamente.\" toastId={t} />\r\n ));\r\n },\r\n });\r\n\r\n const onSubmit = (data: ChangePasswordFormData) => {\r\n mutation.mutate(data);\r\n };\r\n\r\n return {\r\n register: form.register,\r\n handleSubmit: form.handleSubmit(onSubmit),\r\n errors: form.formState.errors,\r\n isLoading: mutation.isPending,\r\n };\r\n}\r\n"],"mappings":";AA6BU;AA3BV,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,aAAa;AACtB,SAAS,4BAAyD;AAClE,SAAS,4BAA4B;AAMtB,SAAR,sBAAuC,EAAE,UAAU,IAAgC,CAAC,GAAG;AAC5F,QAAM,OAAO,QAAgC;AAAA,IAC3C,UAAU,YAAY,oBAAoB;AAAA,IAC1C,MAAM;AAAA,IACN,eAAe;AAAA,MACb,iBAAiB;AAAA,MACjB,aAAa;AAAA,IACf;AAAA,EACF,CAAC;AAED,QAAM,WAAW,YAAY;AAAA,IAC3B,YAAY;AAAA,IACZ,WAAW,CAAC,WAAW;AACrB,UAAI,CAAC,OAAO,SAAS;AACnB,cAAM,OAAO,CAAC,MACZ,oBAAC,SAAM,SAAQ,SAAQ,SAAS,OAAO,SAAS,yBAAyB,SAAS,GAAG,CACtF;AACD;AAAA,MACF;AAEA,YAAM,OAAO,CAAC,MACZ,oBAAC,SAAM,SAAQ,WAAU,SAAQ,8BAA6B,SAAS,GAAG,CAC3E;AAED,WAAK,MAAM;AACX,kBAAY;AAAA,IACd;AAAA,IACA,SAAS,MAAM;AACb,YAAM,OAAO,CAAC,MACZ,oBAAC,SAAM,SAAQ,SAAQ,SAAQ,2CAA0C,SAAS,GAAG,CACtF;AAAA,IACH;AAAA,EACF,CAAC;AAED,QAAM,WAAW,CAAC,SAAiC;AACjD,aAAS,OAAO,IAAI;AAAA,EACtB;AAEA,SAAO;AAAA,IACL,UAAU,KAAK;AAAA,IACf,cAAc,KAAK,aAAa,QAAQ;AAAA,IACxC,QAAQ,KAAK,UAAU;AAAA,IACvB,WAAW,SAAS;AAAA,EACtB;AACF;","names":[]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useCallback } from "react";
|
|
4
|
-
import { useForm } from "react-hook-form";
|
|
5
|
-
import { zodResolver } from "@hookform/resolvers/zod";
|
|
6
|
-
import { toast } from "sonner";
|
|
7
|
-
import { Toast } from "../../ui/feedback/Toast";
|
|
8
|
-
import { changePhoneSchema } from "../../../utils/validators/account";
|
|
9
|
-
import { formatPhone } from "../../../utils/format/masks";
|
|
10
|
-
import { requestPhoneChangeAction } from "../../../modules/accounts/actions/account-management.action";
|
|
11
|
-
function useChangePhoneForm() {
|
|
12
|
-
const [showVerification, setShowVerification] = useState(false);
|
|
13
|
-
const form = useForm({
|
|
14
|
-
resolver: zodResolver(changePhoneSchema),
|
|
15
|
-
mode: "onChange",
|
|
16
|
-
defaultValues: { phone: "" }
|
|
17
|
-
});
|
|
18
|
-
const phoneValue = form.watch("phone");
|
|
19
|
-
const errors = form.formState.errors;
|
|
20
|
-
const isSubmitting = form.formState.isSubmitting;
|
|
21
|
-
const handlePhoneChange = useCallback(
|
|
22
|
-
(e) => {
|
|
23
|
-
const formatted = formatPhone(e.target.value);
|
|
24
|
-
form.setValue("phone", formatted, { shouldValidate: true });
|
|
25
|
-
},
|
|
26
|
-
[form]
|
|
27
|
-
);
|
|
28
|
-
const handleContinue = form.handleSubmit(async (data) => {
|
|
29
|
-
const result = await requestPhoneChangeAction(data.phone);
|
|
30
|
-
if (!result.success) {
|
|
31
|
-
toast.custom((t) => /* @__PURE__ */ jsx(
|
|
32
|
-
Toast,
|
|
33
|
-
{
|
|
34
|
-
variant: "error",
|
|
35
|
-
message: result.error ?? "N\xFAmero j\xE1 existente ou ocorreu um erro. Tente novamente mais tarde.",
|
|
36
|
-
toastId: t
|
|
37
|
-
}
|
|
38
|
-
));
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
setShowVerification(true);
|
|
42
|
-
});
|
|
43
|
-
const handleBack = useCallback(() => {
|
|
44
|
-
setShowVerification(false);
|
|
45
|
-
}, []);
|
|
46
|
-
const resetForm = useCallback(() => {
|
|
47
|
-
form.reset();
|
|
48
|
-
setShowVerification(false);
|
|
49
|
-
}, [form]);
|
|
50
|
-
return {
|
|
51
|
-
showVerification,
|
|
52
|
-
phoneValue,
|
|
53
|
-
isSubmitting,
|
|
54
|
-
errors,
|
|
55
|
-
handlePhoneChange,
|
|
56
|
-
handleContinue,
|
|
57
|
-
handleBack,
|
|
58
|
-
resetForm
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export {
|
|
62
|
-
useChangePhoneForm as default
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=useChangePhoneForm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/account/hooks/useChangePhoneForm.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { useState, useCallback } from 'react';\r\nimport { useForm } from 'react-hook-form';\r\nimport { zodResolver } from '@hookform/resolvers/zod';\r\nimport { toast } from 'sonner';\r\nimport { Toast } from '../../ui/feedback/Toast';\r\nimport { changePhoneSchema, type ChangePhoneFormData } from '../../../utils/validators/account';\r\nimport { formatPhone } from '../../../utils/format/masks';\r\nimport { requestPhoneChangeAction } from '../../../modules/accounts/actions/account-management.action';\r\n\r\nexport default function useChangePhoneForm() {\r\n const [showVerification, setShowVerification] = useState(false);\r\n\r\n const form = useForm<ChangePhoneFormData>({\r\n resolver: zodResolver(changePhoneSchema),\r\n mode: 'onChange',\r\n defaultValues: { phone: '' },\r\n });\r\n\r\n const phoneValue = form.watch('phone');\r\n const errors = form.formState.errors;\r\n const isSubmitting = form.formState.isSubmitting;\r\n\r\n const handlePhoneChange = useCallback(\r\n (e: React.ChangeEvent<HTMLInputElement>) => {\r\n const formatted = formatPhone(e.target.value);\r\n form.setValue('phone', formatted, { shouldValidate: true });\r\n },\r\n [form]\r\n );\r\n\r\n const handleContinue = form.handleSubmit(async (data) => {\r\n const result = await requestPhoneChangeAction(data.phone);\r\n\r\n if (!result.success) {\r\n toast.custom((t) => (\r\n <Toast\r\n variant=\"error\"\r\n message={result.error ?? 'Número já existente ou ocorreu um erro. Tente novamente mais tarde.'}\r\n toastId={t}\r\n />\r\n ));\r\n return;\r\n }\r\n\r\n setShowVerification(true);\r\n });\r\n\r\n const handleBack = useCallback(() => {\r\n setShowVerification(false);\r\n }, []);\r\n\r\n const resetForm = useCallback(() => {\r\n form.reset();\r\n setShowVerification(false);\r\n }, [form]);\r\n\r\n return {\r\n showVerification,\r\n phoneValue,\r\n isSubmitting,\r\n errors,\r\n handlePhoneChange,\r\n handleContinue,\r\n handleBack,\r\n resetForm,\r\n };\r\n}\r\n"],"mappings":";AAqCQ;AAnCR,SAAS,UAAU,mBAAmB;AACtC,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,aAAa;AACtB,SAAS,yBAAmD;AAC5D,SAAS,mBAAmB;AAC5B,SAAS,gCAAgC;AAE1B,SAAR,qBAAsC;AAC3C,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAS,KAAK;AAE9D,QAAM,OAAO,QAA6B;AAAA,IACxC,UAAU,YAAY,iBAAiB;AAAA,IACvC,MAAM;AAAA,IACN,eAAe,EAAE,OAAO,GAAG;AAAA,EAC7B,CAAC;AAED,QAAM,aAAa,KAAK,MAAM,OAAO;AACrC,QAAM,SAAS,KAAK,UAAU;AAC9B,QAAM,eAAe,KAAK,UAAU;AAEpC,QAAM,oBAAoB;AAAA,IACxB,CAAC,MAA2C;AAC1C,YAAM,YAAY,YAAY,EAAE,OAAO,KAAK;AAC5C,WAAK,SAAS,SAAS,WAAW,EAAE,gBAAgB,KAAK,CAAC;AAAA,IAC5D;AAAA,IACA,CAAC,IAAI;AAAA,EACP;AAEA,QAAM,iBAAiB,KAAK,aAAa,OAAO,SAAS;AACvD,UAAM,SAAS,MAAM,yBAAyB,KAAK,KAAK;AAExD,QAAI,CAAC,OAAO,SAAS;AACnB,YAAM,OAAO,CAAC,MACZ;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,SAAS,OAAO,SAAS;AAAA,UACzB,SAAS;AAAA;AAAA,MACX,CACD;AACD;AAAA,IACF;AAEA,wBAAoB,IAAI;AAAA,EAC1B,CAAC;AAED,QAAM,aAAa,YAAY,MAAM;AACnC,wBAAoB,KAAK;AAAA,EAC3B,GAAG,CAAC,CAAC;AAEL,QAAM,YAAY,YAAY,MAAM;AAClC,SAAK,MAAM;AACX,wBAAoB,KAAK;AAAA,EAC3B,GAAG,CAAC,IAAI,CAAC;AAET,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useState, useCallback, useEffect } from "react";
|
|
3
|
-
import { AccountSectionType } from "../../../enums/AccountSectionType";
|
|
4
|
-
function useConfigurationsModal({
|
|
5
|
-
isOpen,
|
|
6
|
-
initialSection
|
|
7
|
-
}) {
|
|
8
|
-
const [activeSection, setActiveSection] = useState(
|
|
9
|
-
AccountSectionType.MY_PROFILE
|
|
10
|
-
);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (isOpen && initialSection) {
|
|
13
|
-
setActiveSection(initialSection);
|
|
14
|
-
} else if (isOpen && !initialSection) {
|
|
15
|
-
setActiveSection(AccountSectionType.MY_PROFILE);
|
|
16
|
-
}
|
|
17
|
-
}, [isOpen, initialSection]);
|
|
18
|
-
const handleSectionChange = useCallback((section) => {
|
|
19
|
-
setActiveSection(section);
|
|
20
|
-
}, []);
|
|
21
|
-
const resetSection = useCallback(() => {
|
|
22
|
-
setActiveSection(AccountSectionType.MY_PROFILE);
|
|
23
|
-
}, []);
|
|
24
|
-
return {
|
|
25
|
-
activeSection,
|
|
26
|
-
setActiveSection: handleSectionChange,
|
|
27
|
-
resetSection
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export {
|
|
31
|
-
useConfigurationsModal as default
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=useConfigurationsModal.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/account/hooks/useConfigurationsModal.ts"],"sourcesContent":["'use client';\r\n\r\nimport { useState, useCallback, useEffect } from 'react';\r\nimport { AccountSectionType } from '../../../enums/AccountSectionType';\r\n\r\ninterface UseConfigurationsModalProps {\r\n isOpen: boolean;\r\n initialSection?: AccountSectionType;\r\n}\r\n\r\nexport default function useConfigurationsModal({\r\n isOpen,\r\n initialSection,\r\n}: UseConfigurationsModalProps) {\r\n const [activeSection, setActiveSection] = useState<AccountSectionType>(\r\n AccountSectionType.MY_PROFILE\r\n );\r\n\r\n useEffect(() => {\r\n if (isOpen && initialSection) {\r\n setActiveSection(initialSection);\r\n } else if (isOpen && !initialSection) {\r\n setActiveSection(AccountSectionType.MY_PROFILE);\r\n }\r\n }, [isOpen, initialSection]);\r\n\r\n const handleSectionChange = useCallback((section: AccountSectionType) => {\r\n setActiveSection(section);\r\n }, []);\r\n\r\n const resetSection = useCallback(() => {\r\n setActiveSection(AccountSectionType.MY_PROFILE);\r\n }, []);\r\n\r\n return {\r\n activeSection,\r\n setActiveSection: handleSectionChange,\r\n resetSection,\r\n };\r\n}\r\n"],"mappings":";AAEA,SAAS,UAAU,aAAa,iBAAiB;AACjD,SAAS,0BAA0B;AAOpB,SAAR,uBAAwC;AAAA,EAC7C;AAAA,EACA;AACF,GAAgC;AAC9B,QAAM,CAAC,eAAe,gBAAgB,IAAI;AAAA,IACxC,mBAAmB;AAAA,EACrB;AAEA,YAAU,MAAM;AACd,QAAI,UAAU,gBAAgB;AAC5B,uBAAiB,cAAc;AAAA,IACjC,WAAW,UAAU,CAAC,gBAAgB;AACpC,uBAAiB,mBAAmB,UAAU;AAAA,IAChD;AAAA,EACF,GAAG,CAAC,QAAQ,cAAc,CAAC;AAE3B,QAAM,sBAAsB,YAAY,CAAC,YAAgC;AACvE,qBAAiB,OAAO;AAAA,EAC1B,GAAG,CAAC,CAAC;AAEL,QAAM,eAAe,YAAY,MAAM;AACrC,qBAAiB,mBAAmB,UAAU;AAAA,EAChD,GAAG,CAAC,CAAC;AAEL,SAAO;AAAA,IACL;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useCallback } from "react";
|
|
4
|
-
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
5
|
-
import { toast } from "sonner";
|
|
6
|
-
import { Toast } from "../../ui/feedback/Toast";
|
|
7
|
-
import { USER_QUERY_KEY } from "../../../modules/auth/hooks/useUserQuery";
|
|
8
|
-
import { disableTwoFactorAction } from "../../../modules/accounts/actions/account-management.action";
|
|
9
|
-
function useDisableTwoFactorAuthForm({
|
|
10
|
-
onClose,
|
|
11
|
-
onSuccess
|
|
12
|
-
}) {
|
|
13
|
-
const [code, setCode] = useState("");
|
|
14
|
-
const queryClient = useQueryClient();
|
|
15
|
-
const isValid = code.length === 6;
|
|
16
|
-
const mutation = useMutation({
|
|
17
|
-
mutationFn: (otpCode) => disableTwoFactorAction(otpCode),
|
|
18
|
-
onSuccess: (result) => {
|
|
19
|
-
if (!result.success) {
|
|
20
|
-
toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "error", message: result.error ?? "C\xF3digo inv\xE1lido", toastId: t }));
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });
|
|
24
|
-
toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "success", message: "Autentica\xE7\xE3o de dois fatores desabilitada", toastId: t }));
|
|
25
|
-
setCode("");
|
|
26
|
-
onSuccess?.();
|
|
27
|
-
},
|
|
28
|
-
onError: () => {
|
|
29
|
-
toast.custom((t) => /* @__PURE__ */ jsx(Toast, { variant: "error", message: "Erro ao desabilitar 2FA. Tente novamente.", toastId: t }));
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const { mutate, reset } = mutation;
|
|
33
|
-
const handleClose = useCallback(() => {
|
|
34
|
-
setCode("");
|
|
35
|
-
reset();
|
|
36
|
-
onClose();
|
|
37
|
-
}, [onClose, reset]);
|
|
38
|
-
const handleSubmit = useCallback(() => {
|
|
39
|
-
if (!isValid) return;
|
|
40
|
-
mutate(code);
|
|
41
|
-
}, [code, isValid, mutate]);
|
|
42
|
-
return {
|
|
43
|
-
code,
|
|
44
|
-
setCode,
|
|
45
|
-
isValid,
|
|
46
|
-
isLoading: mutation.isPending,
|
|
47
|
-
handleClose,
|
|
48
|
-
handleSubmit
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export {
|
|
52
|
-
useDisableTwoFactorAuthForm as default
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=useDisableTwoFactorAuthForm.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/account/hooks/useDisableTwoFactorAuthForm.tsx"],"sourcesContent":["'use client';\r\n\r\nimport { useState, useCallback } from 'react';\r\nimport { useMutation, useQueryClient } from '@tanstack/react-query';\r\nimport { toast } from 'sonner';\r\nimport { Toast } from '../../ui/feedback/Toast';\r\nimport { USER_QUERY_KEY } from '../../../modules/auth/hooks/useUserQuery';\r\nimport { disableTwoFactorAction } from '../../../modules/accounts/actions/account-management.action';\r\n\r\ninterface UseDisableTwoFactorAuthFormProps {\r\n onClose: () => void;\r\n onSuccess?: () => void;\r\n}\r\n\r\nexport default function useDisableTwoFactorAuthForm({\r\n onClose,\r\n onSuccess,\r\n}: UseDisableTwoFactorAuthFormProps) {\r\n const [code, setCode] = useState('');\r\n const queryClient = useQueryClient();\r\n\r\n const isValid = code.length === 6;\r\n\r\n const mutation = useMutation({\r\n mutationFn: (otpCode: string) => disableTwoFactorAction(otpCode),\r\n onSuccess: (result) => {\r\n if (!result.success) {\r\n toast.custom((t) => (\r\n <Toast variant=\"error\" message={result.error ?? 'Código inválido'} toastId={t} />\r\n ));\r\n return;\r\n }\r\n\r\n queryClient.invalidateQueries({ queryKey: USER_QUERY_KEY });\r\n toast.custom((t) => (\r\n <Toast variant=\"success\" message=\"Autenticação de dois fatores desabilitada\" toastId={t} />\r\n ));\r\n setCode('');\r\n onSuccess?.();\r\n },\r\n onError: () => {\r\n toast.custom((t) => (\r\n <Toast variant=\"error\" message=\"Erro ao desabilitar 2FA. Tente novamente.\" toastId={t} />\r\n ));\r\n },\r\n });\r\n\r\n const { mutate, reset } = mutation;\r\n\r\n const handleClose = useCallback(() => {\r\n setCode('');\r\n reset();\r\n onClose();\r\n }, [onClose, reset]);\r\n\r\n const handleSubmit = useCallback(() => {\r\n if (!isValid) return;\r\n mutate(code);\r\n }, [code, isValid, mutate]);\r\n\r\n return {\r\n code,\r\n setCode,\r\n isValid,\r\n isLoading: mutation.isPending,\r\n handleClose,\r\n handleSubmit,\r\n };\r\n}\r\n"],"mappings":";AA4BU;AA1BV,SAAS,UAAU,mBAAmB;AACtC,SAAS,aAAa,sBAAsB;AAC5C,SAAS,aAAa;AACtB,SAAS,aAAa;AACtB,SAAS,sBAAsB;AAC/B,SAAS,8BAA8B;AAOxB,SAAR,4BAA6C;AAAA,EAClD;AAAA,EACA;AACF,GAAqC;AACnC,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,EAAE;AACnC,QAAM,cAAc,eAAe;AAEnC,QAAM,UAAU,KAAK,WAAW;AAEhC,QAAM,WAAW,YAAY;AAAA,IAC3B,YAAY,CAAC,YAAoB,uBAAuB,OAAO;AAAA,IAC/D,WAAW,CAAC,WAAW;AACrB,UAAI,CAAC,OAAO,SAAS;AACnB,cAAM,OAAO,CAAC,MACZ,oBAAC,SAAM,SAAQ,SAAQ,SAAS,OAAO,SAAS,yBAAmB,SAAS,GAAG,CAChF;AACD;AAAA,MACF;AAEA,kBAAY,kBAAkB,EAAE,UAAU,eAAe,CAAC;AAC1D,YAAM,OAAO,CAAC,MACZ,oBAAC,SAAM,SAAQ,WAAU,SAAQ,mDAA4C,SAAS,GAAG,CAC1F;AACD,cAAQ,EAAE;AACV,kBAAY;AAAA,IACd;AAAA,IACA,SAAS,MAAM;AACb,YAAM,OAAO,CAAC,MACZ,oBAAC,SAAM,SAAQ,SAAQ,SAAQ,6CAA4C,SAAS,GAAG,CACxF;AAAA,IACH;AAAA,EACF,CAAC;AAED,QAAM,EAAE,QAAQ,MAAM,IAAI;AAE1B,QAAM,cAAc,YAAY,MAAM;AACpC,YAAQ,EAAE;AACV,UAAM;AACN,YAAQ;AAAA,EACV,GAAG,CAAC,SAAS,KAAK,CAAC;AAEnB,QAAM,eAAe,YAAY,MAAM;AACrC,QAAI,CAAC,QAAS;AACd,WAAO,IAAI;AAAA,EACb,GAAG,CAAC,MAAM,SAAS,MAAM,CAAC;AAE1B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW,SAAS;AAAA,IACpB;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|