@greatapps/common 1.1.789 → 1.1.791

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 (785) hide show
  1. package/dist/components/account/AccountHubLinkHandler.mjs +36 -0
  2. package/dist/components/account/AccountHubLinkHandler.mjs.map +1 -0
  3. package/dist/components/account/AccountModalLayout.mjs +137 -0
  4. package/dist/components/account/AccountModalLayout.mjs.map +1 -0
  5. package/dist/components/account/AccountModals.mjs +10 -3
  6. package/dist/components/account/AccountModals.mjs.map +1 -1
  7. package/dist/components/account/DeleteAccountModal.mjs +1 -1
  8. package/dist/components/account/DeleteAccountModal.mjs.map +1 -1
  9. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs +8 -1
  10. package/dist/components/account/IsntPossibleDeleteAccountModal.mjs.map +1 -1
  11. package/dist/components/account/MyAccountModal.mjs +167 -0
  12. package/dist/components/account/MyAccountModal.mjs.map +1 -0
  13. package/dist/components/account/TwoFactorAuthModal.mjs +1 -1
  14. package/dist/components/account/TwoFactorAuthModal.mjs.map +1 -1
  15. package/dist/components/account/hooks/useAccountHubActions.mjs +85 -0
  16. package/dist/components/account/hooks/useAccountHubActions.mjs.map +1 -0
  17. package/dist/components/account/hooks/useAddCardWithPaymentSwitch.mjs +44 -0
  18. package/dist/components/account/hooks/useAddCardWithPaymentSwitch.mjs.map +1 -0
  19. package/dist/components/account/hooks/useAffiliatesActions.mjs +69 -0
  20. package/dist/components/account/hooks/useAffiliatesActions.mjs.map +1 -0
  21. package/dist/components/account/hooks/useMyAccountModal.mjs +27 -0
  22. package/dist/components/account/hooks/useMyAccountModal.mjs.map +1 -0
  23. package/dist/components/account/hooks/useProjectsActions.mjs +40 -0
  24. package/dist/components/account/hooks/useProjectsActions.mjs.map +1 -0
  25. package/dist/components/account/hooks/useSubscriptionActions.mjs +87 -0
  26. package/dist/components/account/hooks/useSubscriptionActions.mjs.map +1 -0
  27. package/dist/components/account/hooks/useTeamActions.mjs +31 -0
  28. package/dist/components/account/hooks/useTeamActions.mjs.map +1 -0
  29. package/dist/components/account/sections/AffiliatesSection.mjs +313 -0
  30. package/dist/components/account/sections/AffiliatesSection.mjs.map +1 -0
  31. package/dist/components/account/sections/ChangePasswordSection.mjs +5 -5
  32. package/dist/components/account/sections/ChangePasswordSection.mjs.map +1 -1
  33. package/dist/components/account/sections/MyProfileSection.mjs +194 -144
  34. package/dist/components/account/sections/MyProfileSection.mjs.map +1 -1
  35. package/dist/components/account/sections/PreferencesSection.mjs +60 -49
  36. package/dist/components/account/sections/PreferencesSection.mjs.map +1 -1
  37. package/dist/components/account/sections/ProjectsSection.mjs +77 -0
  38. package/dist/components/account/sections/ProjectsSection.mjs.map +1 -0
  39. package/dist/components/account/sections/SecuritySection.mjs +55 -36
  40. package/dist/components/account/sections/SecuritySection.mjs.map +1 -1
  41. package/dist/components/account/sections/SubscriptionSection.mjs +29 -0
  42. package/dist/components/account/sections/SubscriptionSection.mjs.map +1 -0
  43. package/dist/components/account/sections/TeamSection.mjs +119 -0
  44. package/dist/components/account/sections/TeamSection.mjs.map +1 -0
  45. package/dist/components/account/sections/TokenSection.mjs +41 -43
  46. package/dist/components/account/sections/TokenSection.mjs.map +1 -1
  47. package/dist/components/account/sections/affiliates/AffiliateCommissionCard.mjs +73 -0
  48. package/dist/components/account/sections/affiliates/AffiliateCommissionCard.mjs.map +1 -0
  49. package/dist/components/account/sections/affiliates/AffiliateFlows.mjs +20 -0
  50. package/dist/components/account/sections/affiliates/AffiliateFlows.mjs.map +1 -0
  51. package/dist/components/account/sections/affiliates/AffiliateLeadsSheet.mjs +99 -0
  52. package/dist/components/account/sections/affiliates/AffiliateLeadsSheet.mjs.map +1 -0
  53. package/dist/components/account/sections/affiliates/AffiliateStatsCard.mjs +31 -0
  54. package/dist/components/account/sections/affiliates/AffiliateStatsCard.mjs.map +1 -0
  55. package/dist/components/account/sections/affiliates/AffiliateStepCard.mjs +15 -0
  56. package/dist/components/account/sections/affiliates/AffiliateStepCard.mjs.map +1 -0
  57. package/dist/components/account/sections/affiliates/AffiliateTransactionsList.mjs +108 -0
  58. package/dist/components/account/sections/affiliates/AffiliateTransactionsList.mjs.map +1 -0
  59. package/dist/components/account/sections/affiliates/NoReceivingAccountModal.mjs +49 -0
  60. package/dist/components/account/sections/affiliates/NoReceivingAccountModal.mjs.map +1 -0
  61. package/dist/components/account/sections/affiliates/ReceivingAccountModal.mjs +182 -0
  62. package/dist/components/account/sections/affiliates/ReceivingAccountModal.mjs.map +1 -0
  63. package/dist/components/account/sections/affiliates/RequestWithdrawalSheet.mjs +476 -0
  64. package/dist/components/account/sections/affiliates/RequestWithdrawalSheet.mjs.map +1 -0
  65. package/dist/components/account/sections/affiliates/ViewAttachmentModal.mjs +34 -0
  66. package/dist/components/account/sections/affiliates/ViewAttachmentModal.mjs.map +1 -0
  67. package/dist/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.mjs +27 -0
  68. package/dist/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.mjs.map +1 -0
  69. package/dist/components/account/sections/affiliates/reports/AffiliatesReportsTab.mjs +30 -0
  70. package/dist/components/account/sections/affiliates/reports/AffiliatesReportsTab.mjs.map +1 -0
  71. package/dist/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.mjs +120 -0
  72. package/dist/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.mjs.map +1 -0
  73. package/dist/components/account/sections/projects/DeleteProjectModal.mjs +205 -0
  74. package/dist/components/account/sections/projects/DeleteProjectModal.mjs.map +1 -0
  75. package/dist/components/account/sections/projects/ProjectFlows.mjs +16 -0
  76. package/dist/components/account/sections/projects/ProjectFlows.mjs.map +1 -0
  77. package/dist/components/account/sections/projects/ProjectMembersStack.mjs +53 -0
  78. package/dist/components/account/sections/projects/ProjectMembersStack.mjs.map +1 -0
  79. package/dist/components/account/sections/projects/ProjectRow.mjs +85 -0
  80. package/dist/components/account/sections/projects/ProjectRow.mjs.map +1 -0
  81. package/dist/components/account/sections/projects/ProjectSheet.mjs +499 -0
  82. package/dist/components/account/sections/projects/ProjectSheet.mjs.map +1 -0
  83. package/dist/components/account/sections/projects/ProjectsDisabledModal.mjs +55 -0
  84. package/dist/components/account/sections/projects/ProjectsDisabledModal.mjs.map +1 -0
  85. package/dist/components/account/sections/projects/project-form.schema.mjs +28 -0
  86. package/dist/components/account/sections/projects/project-form.schema.mjs.map +1 -0
  87. package/dist/components/account/sections/shared/ConnectListRow.mjs +45 -0
  88. package/dist/components/account/sections/shared/ConnectListRow.mjs.map +1 -0
  89. package/dist/components/account/sections/shared/DateFilterPopover.mjs +51 -0
  90. package/dist/components/account/sections/shared/DateFilterPopover.mjs.map +1 -0
  91. package/dist/components/account/sections/shared/EntityAvatar.mjs +41 -0
  92. package/dist/components/account/sections/shared/EntityAvatar.mjs.map +1 -0
  93. package/dist/components/account/sections/shared/FilterPopover.mjs +62 -0
  94. package/dist/components/account/sections/shared/FilterPopover.mjs.map +1 -0
  95. package/dist/components/account/sections/shared/FormSection.mjs +14 -0
  96. package/dist/components/account/sections/shared/FormSection.mjs.map +1 -0
  97. package/dist/components/account/sections/shared/IconBox.mjs +18 -0
  98. package/dist/components/account/sections/shared/IconBox.mjs.map +1 -0
  99. package/dist/components/account/sections/shared/InfiniteScrollList.mjs +36 -0
  100. package/dist/components/account/sections/shared/InfiniteScrollList.mjs.map +1 -0
  101. package/dist/components/account/sections/shared/ListPagination.mjs +69 -0
  102. package/dist/components/account/sections/shared/ListPagination.mjs.map +1 -0
  103. package/dist/components/account/sections/shared/RowActionsMenu.mjs +52 -0
  104. package/dist/components/account/sections/shared/RowActionsMenu.mjs.map +1 -0
  105. package/dist/components/account/sections/shared/SectionLoadError.mjs +20 -0
  106. package/dist/components/account/sections/shared/SectionLoadError.mjs.map +1 -0
  107. package/dist/components/account/sections/shared/StatusBadge.mjs +26 -0
  108. package/dist/components/account/sections/shared/StatusBadge.mjs.map +1 -0
  109. package/dist/components/account/sections/shared/WorkspaceSection.mjs +10 -0
  110. package/dist/components/account/sections/shared/WorkspaceSection.mjs.map +1 -0
  111. package/dist/components/account/sections/subscription/AiCreditsUsage.mjs +106 -0
  112. package/dist/components/account/sections/subscription/AiCreditsUsage.mjs.map +1 -0
  113. package/dist/components/account/sections/subscription/BillingAddressSheet.mjs +407 -0
  114. package/dist/components/account/sections/subscription/BillingAddressSheet.mjs.map +1 -0
  115. package/dist/components/account/sections/subscription/BoletoDetailsDialog.mjs +73 -0
  116. package/dist/components/account/sections/subscription/BoletoDetailsDialog.mjs.map +1 -0
  117. package/dist/components/account/sections/subscription/BoletoGeneratedDialog.mjs +22 -0
  118. package/dist/components/account/sections/subscription/BoletoGeneratedDialog.mjs.map +1 -0
  119. package/dist/components/account/sections/subscription/CancelPlanDialog.mjs +161 -0
  120. package/dist/components/account/sections/subscription/CancelPlanDialog.mjs.map +1 -0
  121. package/dist/components/account/sections/subscription/ChargeRow.mjs +127 -0
  122. package/dist/components/account/sections/subscription/ChargeRow.mjs.map +1 -0
  123. package/dist/components/account/sections/subscription/ChargeStatusBadge.mjs +27 -0
  124. package/dist/components/account/sections/subscription/ChargeStatusBadge.mjs.map +1 -0
  125. package/dist/components/account/sections/subscription/ChargesList.mjs +88 -0
  126. package/dist/components/account/sections/subscription/ChargesList.mjs.map +1 -0
  127. package/dist/components/account/sections/subscription/ManageCardsSheet.mjs +49 -0
  128. package/dist/components/account/sections/subscription/ManageCardsSheet.mjs.map +1 -0
  129. package/dist/components/account/sections/subscription/OverdueReceiptOpener.mjs +26 -0
  130. package/dist/components/account/sections/subscription/OverdueReceiptOpener.mjs.map +1 -0
  131. package/dist/components/account/sections/subscription/PayChargeDialog.mjs +222 -0
  132. package/dist/components/account/sections/subscription/PayChargeDialog.mjs.map +1 -0
  133. package/dist/components/account/sections/subscription/PaymentConfirmationDialog.mjs +61 -0
  134. package/dist/components/account/sections/subscription/PaymentConfirmationDialog.mjs.map +1 -0
  135. package/dist/components/account/sections/subscription/PaymentMethodsCard.mjs +72 -0
  136. package/dist/components/account/sections/subscription/PaymentMethodsCard.mjs.map +1 -0
  137. package/dist/components/account/sections/subscription/PendingChangeDialog.mjs +117 -0
  138. package/dist/components/account/sections/subscription/PendingChangeDialog.mjs.map +1 -0
  139. package/dist/components/account/sections/subscription/PixDetailsDialog.mjs +165 -0
  140. package/dist/components/account/sections/subscription/PixDetailsDialog.mjs.map +1 -0
  141. package/dist/components/account/sections/subscription/PixPaymentDialog.mjs +155 -0
  142. package/dist/components/account/sections/subscription/PixPaymentDialog.mjs.map +1 -0
  143. package/dist/components/account/sections/subscription/PlanDetailsSheet.mjs +253 -0
  144. package/dist/components/account/sections/subscription/PlanDetailsSheet.mjs.map +1 -0
  145. package/dist/components/account/sections/subscription/ReceiptDetailsSheet.mjs +237 -0
  146. package/dist/components/account/sections/subscription/ReceiptDetailsSheet.mjs.map +1 -0
  147. package/dist/components/account/sections/subscription/SubscriptionFlows.mjs +40 -0
  148. package/dist/components/account/sections/subscription/SubscriptionFlows.mjs.map +1 -0
  149. package/dist/components/account/sections/subscription/SubscriptionPlanCard.mjs +303 -0
  150. package/dist/components/account/sections/subscription/SubscriptionPlanCard.mjs.map +1 -0
  151. package/dist/components/account/sections/subscription/UsageReportSheet.mjs +163 -0
  152. package/dist/components/account/sections/subscription/UsageReportSheet.mjs.map +1 -0
  153. package/dist/components/account/sections/subscription/change-plan/ChangePlanSheet.mjs +75 -0
  154. package/dist/components/account/sections/subscription/change-plan/ChangePlanSheet.mjs.map +1 -0
  155. package/dist/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.mjs +55 -0
  156. package/dist/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.mjs.map +1 -0
  157. package/dist/components/account/sections/subscription/change-plan/components/AddonsBlock.mjs +188 -0
  158. package/dist/components/account/sections/subscription/change-plan/components/AddonsBlock.mjs.map +1 -0
  159. package/dist/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.mjs +66 -0
  160. package/dist/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.mjs.map +1 -0
  161. package/dist/components/account/sections/subscription/change-plan/components/CouponBlock.mjs +42 -0
  162. package/dist/components/account/sections/subscription/change-plan/components/CouponBlock.mjs.map +1 -0
  163. package/dist/components/account/sections/subscription/change-plan/components/CouponDialog.mjs +119 -0
  164. package/dist/components/account/sections/subscription/change-plan/components/CouponDialog.mjs.map +1 -0
  165. package/dist/components/account/sections/subscription/change-plan/components/PricePreview.mjs +17 -0
  166. package/dist/components/account/sections/subscription/change-plan/components/PricePreview.mjs.map +1 -0
  167. package/dist/components/account/sections/subscription/change-plan/components/SummaryBlock.mjs +130 -0
  168. package/dist/components/account/sections/subscription/change-plan/components/SummaryBlock.mjs.map +1 -0
  169. package/dist/components/account/sections/subscription/change-plan/plan-comparison.mjs +38 -0
  170. package/dist/components/account/sections/subscription/change-plan/plan-comparison.mjs.map +1 -0
  171. package/dist/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.mjs +127 -0
  172. package/dist/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.mjs.map +1 -0
  173. package/dist/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.mjs +111 -0
  174. package/dist/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.mjs.map +1 -0
  175. package/dist/components/account/sections/subscription/change-plan/steps/PlanViewStep.mjs +69 -0
  176. package/dist/components/account/sections/subscription/change-plan/steps/PlanViewStep.mjs.map +1 -0
  177. package/dist/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.mjs +88 -0
  178. package/dist/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.mjs.map +1 -0
  179. package/dist/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.mjs +115 -0
  180. package/dist/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.mjs.map +1 -0
  181. package/dist/components/account/sections/subscription/change-plan/useChangePlanState.mjs +918 -0
  182. package/dist/components/account/sections/subscription/change-plan/useChangePlanState.mjs.map +1 -0
  183. package/dist/components/account/sections/subscription/downgrade/CannotDowngradeDialog.mjs +216 -0
  184. package/dist/components/account/sections/subscription/downgrade/CannotDowngradeDialog.mjs.map +1 -0
  185. package/dist/components/account/sections/subscription/downgrade/DowngradeReasonDialog.mjs +128 -0
  186. package/dist/components/account/sections/subscription/downgrade/DowngradeReasonDialog.mjs.map +1 -0
  187. package/dist/components/account/sections/subscription/plans/PlanCard.mjs +281 -0
  188. package/dist/components/account/sections/subscription/plans/PlanCard.mjs.map +1 -0
  189. package/dist/components/account/sections/subscription/plans/PlanCardSkeleton.mjs +53 -0
  190. package/dist/components/account/sections/subscription/plans/PlanCardSkeleton.mjs.map +1 -0
  191. package/dist/components/account/sections/subscription/plans/PlansCatalogDialog.mjs +119 -0
  192. package/dist/components/account/sections/subscription/plans/PlansCatalogDialog.mjs.map +1 -0
  193. package/dist/components/account/sections/team/DeleteUserModal.mjs +116 -0
  194. package/dist/components/account/sections/team/DeleteUserModal.mjs.map +1 -0
  195. package/dist/components/account/sections/team/TeamFlows.mjs +14 -0
  196. package/dist/components/account/sections/team/TeamFlows.mjs.map +1 -0
  197. package/dist/components/account/sections/team/TeamMemberRow.mjs +99 -0
  198. package/dist/components/account/sections/team/TeamMemberRow.mjs.map +1 -0
  199. package/dist/components/account/sections/team/UserSheet.mjs +570 -0
  200. package/dist/components/account/sections/team/UserSheet.mjs.map +1 -0
  201. package/dist/components/account/sections/team/steps/NotificationsStep.mjs +80 -0
  202. package/dist/components/account/sections/team/steps/NotificationsStep.mjs.map +1 -0
  203. package/dist/components/account/sections/team/steps/ProjectSelectionStep.mjs +180 -0
  204. package/dist/components/account/sections/team/steps/ProjectSelectionStep.mjs.map +1 -0
  205. package/dist/components/account/sections/team/steps/UserInformationStep.mjs +371 -0
  206. package/dist/components/account/sections/team/steps/UserInformationStep.mjs.map +1 -0
  207. package/dist/components/account/sections/team/user-form.schema.mjs +37 -0
  208. package/dist/components/account/sections/team/user-form.schema.mjs.map +1 -0
  209. package/dist/components/account/types/workspace-actions.type.mjs +1 -0
  210. package/dist/components/account/types/workspace-actions.type.mjs.map +1 -0
  211. package/dist/components/layouts/ProfilePopover.mjs +10 -12
  212. package/dist/components/layouts/ProfilePopover.mjs.map +1 -1
  213. package/dist/components/layouts/UsersSelectorPopover.mjs +7 -4
  214. package/dist/components/layouts/UsersSelectorPopover.mjs.map +1 -1
  215. package/dist/components/modals/AccountDeletionWarningModal.mjs +4 -5
  216. package/dist/components/modals/AccountDeletionWarningModal.mjs.map +1 -1
  217. package/dist/components/modals/AccountFrozenModal.mjs +6 -3
  218. package/dist/components/modals/AccountFrozenModal.mjs.map +1 -1
  219. package/dist/components/modals/Modals.mjs +3 -3
  220. package/dist/components/modals/Modals.mjs.map +1 -1
  221. package/dist/components/modals/PaidPlanRequiredModal.mjs +4 -5
  222. package/dist/components/modals/PaidPlanRequiredModal.mjs.map +1 -1
  223. package/dist/components/modals/cards/AddFirstCardWarningModal.mjs +63 -0
  224. package/dist/components/modals/cards/AddFirstCardWarningModal.mjs.map +1 -0
  225. package/dist/components/modals/cards/SwitchPaymentToCardModal.mjs +187 -0
  226. package/dist/components/modals/cards/SwitchPaymentToCardModal.mjs.map +1 -0
  227. package/dist/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.mjs +5 -4
  228. package/dist/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.mjs.map +1 -1
  229. package/dist/components/ui/data-display/CardItem.mjs +9 -1
  230. package/dist/components/ui/data-display/CardItem.mjs.map +1 -1
  231. package/dist/components/ui/data-display/PaymentMethodIcons.mjs +50 -0
  232. package/dist/components/ui/data-display/PaymentMethodIcons.mjs.map +1 -0
  233. package/dist/components/ui/form/BillingPeriodSelector.mjs +108 -0
  234. package/dist/components/ui/form/BillingPeriodSelector.mjs.map +1 -0
  235. package/dist/components/ui/form/PaymentMethodToggle.mjs +82 -0
  236. package/dist/components/ui/form/PaymentMethodToggle.mjs.map +1 -0
  237. package/dist/components/ui/form/RadioOptionFieldIcon.mjs +57 -0
  238. package/dist/components/ui/form/RadioOptionFieldIcon.mjs.map +1 -0
  239. package/dist/components/ui/form/SegmentedControl.mjs +56 -0
  240. package/dist/components/ui/form/SegmentedControl.mjs.map +1 -0
  241. package/dist/components/ui/overlay/Dialog.mjs +41 -6
  242. package/dist/components/ui/overlay/Dialog.mjs.map +1 -1
  243. package/dist/components/ui/overlay/Sheet.mjs +43 -13
  244. package/dist/components/ui/overlay/Sheet.mjs.map +1 -1
  245. package/dist/components/ui/overlay/layers.mjs +72 -26
  246. package/dist/components/ui/overlay/layers.mjs.map +1 -1
  247. package/dist/enums/AccountHubFlow.mjs +13 -0
  248. package/dist/enums/AccountHubFlow.mjs.map +1 -0
  249. package/dist/enums/DateFilterPeriod.mjs +22 -0
  250. package/dist/enums/DateFilterPeriod.mjs.map +1 -0
  251. package/dist/enums/WorkspaceSectionType.mjs +11 -0
  252. package/dist/enums/WorkspaceSectionType.mjs.map +1 -0
  253. package/dist/handlers.mjs +24 -0
  254. package/dist/handlers.mjs.map +1 -1
  255. package/dist/hooks/useDebounce.mjs +5 -3
  256. package/dist/hooks/useDebounce.mjs.map +1 -1
  257. package/dist/hooks/useUploadProgress.mjs +33 -0
  258. package/dist/hooks/useUploadProgress.mjs.map +1 -0
  259. package/dist/i18n/messages/en-us.mjs +863 -3
  260. package/dist/i18n/messages/en-us.mjs.map +1 -1
  261. package/dist/i18n/messages/es-es.mjs +863 -3
  262. package/dist/i18n/messages/es-es.mjs.map +1 -1
  263. package/dist/i18n/messages/pt-br.mjs +863 -3
  264. package/dist/i18n/messages/pt-br.mjs.map +1 -1
  265. package/dist/index.mjs +87 -7
  266. package/dist/index.mjs.map +1 -1
  267. package/dist/infra/http/paged.mjs +20 -0
  268. package/dist/infra/http/paged.mjs.map +1 -0
  269. package/dist/middleware.mjs +2 -0
  270. package/dist/middleware.mjs.map +1 -1
  271. package/dist/middlewares/create-auth-middleware.mjs +1 -3
  272. package/dist/middlewares/create-auth-middleware.mjs.map +1 -1
  273. package/dist/middlewares/create-legacy-account-routes-middleware.mjs +44 -0
  274. package/dist/middlewares/create-legacy-account-routes-middleware.mjs.map +1 -0
  275. package/dist/middlewares/is-route-equals.mjs +7 -0
  276. package/dist/middlewares/is-route-equals.mjs.map +1 -0
  277. package/dist/modules/accounts/actions/account-management.action.mjs +20 -1
  278. package/dist/modules/accounts/actions/account-management.action.mjs.map +1 -1
  279. package/dist/modules/accounts/constants/account-hub-link.constants.mjs +9 -0
  280. package/dist/modules/accounts/constants/account-hub-link.constants.mjs.map +1 -0
  281. package/dist/modules/accounts/constants/legacy-account-routes.constants.mjs +5 -0
  282. package/dist/modules/accounts/constants/legacy-account-routes.constants.mjs.map +1 -0
  283. package/dist/modules/accounts/handlers/list-account-members.handler.mjs +22 -0
  284. package/dist/modules/accounts/handlers/list-account-members.handler.mjs.map +1 -0
  285. package/dist/modules/accounts/hooks/add-user-projects.hook.mjs +51 -0
  286. package/dist/modules/accounts/hooks/add-user-projects.hook.mjs.map +1 -0
  287. package/dist/modules/accounts/hooks/create-account-user.hook.mjs +20 -0
  288. package/dist/modules/accounts/hooks/create-account-user.hook.mjs.map +1 -0
  289. package/dist/modules/accounts/hooks/remove-user-projects.hook.mjs +47 -0
  290. package/dist/modules/accounts/hooks/remove-user-projects.hook.mjs.map +1 -0
  291. package/dist/modules/accounts/hooks/use-account-members.hook.mjs +20 -0
  292. package/dist/modules/accounts/hooks/use-account-members.hook.mjs.map +1 -0
  293. package/dist/modules/accounts/services/account.service.mjs +59 -0
  294. package/dist/modules/accounts/services/account.service.mjs.map +1 -1
  295. package/dist/modules/accounts/types/account-hub-link.type.mjs +1 -0
  296. package/dist/modules/accounts/types/account-hub-link.type.mjs.map +1 -0
  297. package/dist/modules/accounts/utils/build-account-hub-url.mjs +16 -0
  298. package/dist/modules/accounts/utils/build-account-hub-url.mjs.map +1 -0
  299. package/dist/modules/accounts/utils/is-account-hub-flow.mjs +9 -0
  300. package/dist/modules/accounts/utils/is-account-hub-flow.mjs.map +1 -0
  301. package/dist/modules/accounts/utils/is-account-section.mjs +9 -0
  302. package/dist/modules/accounts/utils/is-account-section.mjs.map +1 -0
  303. package/dist/modules/accounts/utils/is-my-account-section.mjs +13 -0
  304. package/dist/modules/accounts/utils/is-my-account-section.mjs.map +1 -0
  305. package/dist/modules/accounts/utils/map-legacy-account-route.mjs +93 -0
  306. package/dist/modules/accounts/utils/map-legacy-account-route.mjs.map +1 -0
  307. package/dist/modules/accounts/utils/parse-account-hub-link.mjs +20 -0
  308. package/dist/modules/accounts/utils/parse-account-hub-link.mjs.map +1 -0
  309. package/dist/modules/affiliates/actions/ensure-affiliate.action.mjs +10 -0
  310. package/dist/modules/affiliates/actions/ensure-affiliate.action.mjs.map +1 -0
  311. package/dist/modules/affiliates/actions/request-deposit.action.mjs +10 -0
  312. package/dist/modules/affiliates/actions/request-deposit.action.mjs.map +1 -0
  313. package/dist/modules/affiliates/actions/update-affiliate.action.mjs +10 -0
  314. package/dist/modules/affiliates/actions/update-affiliate.action.mjs.map +1 -0
  315. package/dist/modules/affiliates/constants/affiliate.constants.mjs +11 -0
  316. package/dist/modules/affiliates/constants/affiliate.constants.mjs.map +1 -0
  317. package/dist/modules/affiliates/constants/query-keys.constants.mjs +15 -0
  318. package/dist/modules/affiliates/constants/query-keys.constants.mjs.map +1 -0
  319. package/dist/modules/affiliates/handlers/affiliate-report-analytics.handler.mjs +16 -0
  320. package/dist/modules/affiliates/handlers/affiliate-report-analytics.handler.mjs.map +1 -0
  321. package/dist/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.mjs +12 -0
  322. package/dist/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.mjs.map +1 -0
  323. package/dist/modules/affiliates/handlers/current-affiliate.handler.mjs +12 -0
  324. package/dist/modules/affiliates/handlers/current-affiliate.handler.mjs.map +1 -0
  325. package/dist/modules/affiliates/handlers/list-affiliate-coupons.handler.mjs +12 -0
  326. package/dist/modules/affiliates/handlers/list-affiliate-coupons.handler.mjs.map +1 -0
  327. package/dist/modules/affiliates/handlers/list-affiliate-leads.handler.mjs +22 -0
  328. package/dist/modules/affiliates/handlers/list-affiliate-leads.handler.mjs.map +1 -0
  329. package/dist/modules/affiliates/handlers/list-affiliate-transactions.handler.mjs +22 -0
  330. package/dist/modules/affiliates/handlers/list-affiliate-transactions.handler.mjs.map +1 -0
  331. package/dist/modules/affiliates/hooks/use-affiliate-coupons.hook.mjs +17 -0
  332. package/dist/modules/affiliates/hooks/use-affiliate-coupons.hook.mjs.map +1 -0
  333. package/dist/modules/affiliates/hooks/use-affiliate-leads.hook.mjs +22 -0
  334. package/dist/modules/affiliates/hooks/use-affiliate-leads.hook.mjs.map +1 -0
  335. package/dist/modules/affiliates/hooks/use-affiliate-report-analytics.hook.mjs +17 -0
  336. package/dist/modules/affiliates/hooks/use-affiliate-report-analytics.hook.mjs.map +1 -0
  337. package/dist/modules/affiliates/hooks/use-affiliate-transactions.hook.mjs +20 -0
  338. package/dist/modules/affiliates/hooks/use-affiliate-transactions.hook.mjs.map +1 -0
  339. package/dist/modules/affiliates/hooks/use-current-affiliate.hook.mjs +17 -0
  340. package/dist/modules/affiliates/hooks/use-current-affiliate.hook.mjs.map +1 -0
  341. package/dist/modules/affiliates/hooks/use-ensure-affiliate.hook.mjs +23 -0
  342. package/dist/modules/affiliates/hooks/use-ensure-affiliate.hook.mjs.map +1 -0
  343. package/dist/modules/affiliates/hooks/use-request-deposit.hook.mjs +28 -0
  344. package/dist/modules/affiliates/hooks/use-request-deposit.hook.mjs.map +1 -0
  345. package/dist/modules/affiliates/hooks/use-update-affiliate.hook.mjs +22 -0
  346. package/dist/modules/affiliates/hooks/use-update-affiliate.hook.mjs.map +1 -0
  347. package/dist/modules/affiliates/hooks/use-withdrawal-limits.hook.mjs +17 -0
  348. package/dist/modules/affiliates/hooks/use-withdrawal-limits.hook.mjs.map +1 -0
  349. package/dist/modules/affiliates/services/affiliates.service.mjs +183 -0
  350. package/dist/modules/affiliates/services/affiliates.service.mjs.map +1 -0
  351. package/dist/modules/affiliates/types/affiliate.type.mjs +100 -0
  352. package/dist/modules/affiliates/types/affiliate.type.mjs.map +1 -0
  353. package/dist/modules/affiliates/utils/get-affiliate-share-link.mjs +9 -0
  354. package/dist/modules/affiliates/utils/get-affiliate-share-link.mjs.map +1 -0
  355. package/dist/modules/charges/actions/get-nota-fiscal.action.mjs +10 -0
  356. package/dist/modules/charges/actions/get-nota-fiscal.action.mjs.map +1 -0
  357. package/dist/modules/charges/actions/refresh-pix.action.mjs +10 -0
  358. package/dist/modules/charges/actions/refresh-pix.action.mjs.map +1 -0
  359. package/dist/modules/charges/hooks/nota-fiscal.hook.mjs +13 -0
  360. package/dist/modules/charges/hooks/nota-fiscal.hook.mjs.map +1 -0
  361. package/dist/modules/charges/hooks/refresh-pix.hook.mjs +13 -0
  362. package/dist/modules/charges/hooks/refresh-pix.hook.mjs.map +1 -0
  363. package/dist/modules/charges/services/charges.service.mjs +67 -0
  364. package/dist/modules/charges/services/charges.service.mjs.map +1 -1
  365. package/dist/modules/charges/types/nota-fiscal.type.mjs +1 -0
  366. package/dist/modules/charges/types/nota-fiscal.type.mjs.map +1 -0
  367. package/dist/modules/charges/types/refresh-pix.type.mjs +1 -0
  368. package/dist/modules/charges/types/refresh-pix.type.mjs.map +1 -0
  369. package/dist/modules/charges/utils/get-charge-download-url.mjs +8 -0
  370. package/dist/modules/charges/utils/get-charge-download-url.mjs.map +1 -0
  371. package/dist/modules/coupons/constants/query-keys.constants.mjs +5 -0
  372. package/dist/modules/coupons/constants/query-keys.constants.mjs.map +1 -0
  373. package/dist/modules/coupons/handlers/find-coupon-by-code.handler.mjs +17 -0
  374. package/dist/modules/coupons/handlers/find-coupon-by-code.handler.mjs.map +1 -0
  375. package/dist/modules/coupons/handlers/find-coupon-by-id.handler.mjs +16 -0
  376. package/dist/modules/coupons/handlers/find-coupon-by-id.handler.mjs.map +1 -0
  377. package/dist/modules/coupons/hooks/use-coupon-by-code.hook.mjs +15 -0
  378. package/dist/modules/coupons/hooks/use-coupon-by-code.hook.mjs.map +1 -0
  379. package/dist/modules/coupons/hooks/use-coupon-by-id.hook.mjs +18 -0
  380. package/dist/modules/coupons/hooks/use-coupon-by-id.hook.mjs.map +1 -0
  381. package/dist/modules/coupons/services/coupons.service.mjs +44 -0
  382. package/dist/modules/coupons/services/coupons.service.mjs.map +1 -0
  383. package/dist/modules/coupons/types/coupon.type.mjs +61 -0
  384. package/dist/modules/coupons/types/coupon.type.mjs.map +1 -0
  385. package/dist/modules/coupons/utils/coupon-restrictions.mjs +60 -0
  386. package/dist/modules/coupons/utils/coupon-restrictions.mjs.map +1 -0
  387. package/dist/modules/domains/handlers/count-domains.handler.mjs +12 -0
  388. package/dist/modules/domains/handlers/count-domains.handler.mjs.map +1 -0
  389. package/dist/modules/domains/hooks/count-domains.hook.mjs +17 -0
  390. package/dist/modules/domains/hooks/count-domains.hook.mjs.map +1 -0
  391. package/dist/modules/domains/services/domains.service.mjs +18 -0
  392. package/dist/modules/domains/services/domains.service.mjs.map +1 -0
  393. package/dist/modules/ia-credits/handlers/list-ia-credit-operations.handler.mjs +15 -0
  394. package/dist/modules/ia-credits/handlers/list-ia-credit-operations.handler.mjs.map +1 -0
  395. package/dist/modules/ia-credits/hooks/ia-credit-operations.hook.mjs +28 -0
  396. package/dist/modules/ia-credits/hooks/ia-credit-operations.hook.mjs.map +1 -0
  397. package/dist/modules/ia-credits/services/ia-credits.service.mjs +23 -2
  398. package/dist/modules/ia-credits/services/ia-credits.service.mjs.map +1 -1
  399. package/dist/modules/pages/handlers/count-pages.handler.mjs +4 -2
  400. package/dist/modules/pages/handlers/count-pages.handler.mjs.map +1 -1
  401. package/dist/modules/pages/hooks/count-published-pages.hook.mjs +26 -0
  402. package/dist/modules/pages/hooks/count-published-pages.hook.mjs.map +1 -0
  403. package/dist/modules/pages/services/pages.service.mjs +3 -2
  404. package/dist/modules/pages/services/pages.service.mjs.map +1 -1
  405. package/dist/modules/plans/constants/plan-tooltips.constants.mjs +14 -0
  406. package/dist/modules/plans/constants/plan-tooltips.constants.mjs.map +1 -0
  407. package/dist/modules/plans/hooks/use-enriched-plans.hook.mjs +28 -0
  408. package/dist/modules/plans/hooks/use-enriched-plans.hook.mjs.map +1 -0
  409. package/dist/modules/plans/hooks/use-ui-plans.hook.mjs +20 -0
  410. package/dist/modules/plans/hooks/use-ui-plans.hook.mjs.map +1 -0
  411. package/dist/modules/projects/hooks/add-project-users.hook.mjs +25 -0
  412. package/dist/modules/projects/hooks/add-project-users.hook.mjs.map +1 -0
  413. package/dist/modules/projects/hooks/list-all-account-users.hook.mjs +3 -6
  414. package/dist/modules/projects/hooks/list-all-account-users.hook.mjs.map +1 -1
  415. package/dist/modules/projects/hooks/list-available-users.hook.mjs +3 -6
  416. package/dist/modules/projects/hooks/list-available-users.hook.mjs.map +1 -1
  417. package/dist/modules/projects/hooks/list-infinite-projects.hook.mjs +3 -6
  418. package/dist/modules/projects/hooks/list-infinite-projects.hook.mjs.map +1 -1
  419. package/dist/modules/projects/hooks/list-project-users.hook.mjs +3 -6
  420. package/dist/modules/projects/hooks/list-project-users.hook.mjs.map +1 -1
  421. package/dist/modules/projects/hooks/remove-project-users.hook.mjs +25 -0
  422. package/dist/modules/projects/hooks/remove-project-users.hook.mjs.map +1 -0
  423. package/dist/modules/projects/services/project-users.service.mjs +5 -0
  424. package/dist/modules/projects/services/project-users.service.mjs.map +1 -1
  425. package/dist/modules/projects/types.mjs +3 -2
  426. package/dist/modules/projects/types.mjs.map +1 -1
  427. package/dist/modules/subscriptions/actions/cancel-subscription.action.mjs +10 -0
  428. package/dist/modules/subscriptions/actions/cancel-subscription.action.mjs.map +1 -0
  429. package/dist/modules/subscriptions/actions/create-subscription.action.mjs +10 -0
  430. package/dist/modules/subscriptions/actions/create-subscription.action.mjs.map +1 -0
  431. package/dist/modules/subscriptions/actions/find-pending-pix-status.action.mjs +10 -0
  432. package/dist/modules/subscriptions/actions/find-pending-pix-status.action.mjs.map +1 -0
  433. package/dist/modules/subscriptions/actions/find-subscription-by-id.action.mjs +10 -0
  434. package/dist/modules/subscriptions/actions/find-subscription-by-id.action.mjs.map +1 -0
  435. package/dist/modules/subscriptions/constants/addons.constants.mjs +35 -0
  436. package/dist/modules/subscriptions/constants/addons.constants.mjs.map +1 -1
  437. package/dist/modules/subscriptions/constants/downgrade.constants.mjs +25 -0
  438. package/dist/modules/subscriptions/constants/downgrade.constants.mjs.map +1 -0
  439. package/dist/modules/subscriptions/constants/subscription.constants.mjs +2 -0
  440. package/dist/modules/subscriptions/constants/subscription.constants.mjs.map +1 -1
  441. package/dist/modules/subscriptions/handlers/pending-pix-status.handler.mjs +15 -0
  442. package/dist/modules/subscriptions/handlers/pending-pix-status.handler.mjs.map +1 -0
  443. package/dist/modules/subscriptions/hooks/cancel-subscription.hook.mjs +25 -0
  444. package/dist/modules/subscriptions/hooks/cancel-subscription.hook.mjs.map +1 -0
  445. package/dist/modules/subscriptions/hooks/create-subscription.hook.mjs +33 -0
  446. package/dist/modules/subscriptions/hooks/create-subscription.hook.mjs.map +1 -0
  447. package/dist/modules/subscriptions/hooks/find-subscription-by-id.hook.mjs +18 -0
  448. package/dist/modules/subscriptions/hooks/find-subscription-by-id.hook.mjs.map +1 -0
  449. package/dist/modules/subscriptions/hooks/pending-pix-status.hook.mjs +25 -0
  450. package/dist/modules/subscriptions/hooks/pending-pix-status.hook.mjs.map +1 -0
  451. package/dist/modules/subscriptions/services/subscriptions.service.mjs +71 -0
  452. package/dist/modules/subscriptions/services/subscriptions.service.mjs.map +1 -1
  453. package/dist/modules/subscriptions/types/cancel-subscription.type.mjs +9 -0
  454. package/dist/modules/subscriptions/types/cancel-subscription.type.mjs.map +1 -0
  455. package/dist/modules/subscriptions/types/create-subscription.type.mjs +62 -0
  456. package/dist/modules/subscriptions/types/create-subscription.type.mjs.map +1 -0
  457. package/dist/modules/subscriptions/types/pending-pix-status.type.mjs +28 -0
  458. package/dist/modules/subscriptions/types/pending-pix-status.type.mjs.map +1 -0
  459. package/dist/modules/subscriptions/types/subscription.type.mjs +9 -1
  460. package/dist/modules/subscriptions/types/subscription.type.mjs.map +1 -1
  461. package/dist/modules/subscriptions/utils/addon-buckets.mjs +69 -0
  462. package/dist/modules/subscriptions/utils/addon-buckets.mjs.map +1 -0
  463. package/dist/modules/subscriptions/utils/confirm-payment-if-required.mjs +8 -2
  464. package/dist/modules/subscriptions/utils/confirm-payment-if-required.mjs.map +1 -1
  465. package/dist/modules/subscriptions/utils/first-period-pricing.mjs +25 -0
  466. package/dist/modules/subscriptions/utils/first-period-pricing.mjs.map +1 -0
  467. package/dist/modules/subscriptions/utils/is-api-subscription.mjs +8 -0
  468. package/dist/modules/subscriptions/utils/is-api-subscription.mjs.map +1 -0
  469. package/dist/modules/subscriptions/utils/is-boleto-payer.mjs +17 -0
  470. package/dist/modules/subscriptions/utils/is-boleto-payer.mjs.map +1 -0
  471. package/dist/modules/subscriptions/utils/is-free-subscription.mjs +8 -0
  472. package/dist/modules/subscriptions/utils/is-free-subscription.mjs.map +1 -0
  473. package/dist/modules/subscriptions/utils/periodicity.mjs +55 -1
  474. package/dist/modules/subscriptions/utils/periodicity.mjs.map +1 -1
  475. package/dist/modules/subscriptions/utils/resolve-subscription-plan-name.mjs +27 -0
  476. package/dist/modules/subscriptions/utils/resolve-subscription-plan-name.mjs.map +1 -0
  477. package/dist/modules/users/hooks/messages.hook.mjs +3 -5
  478. package/dist/modules/users/hooks/messages.hook.mjs.map +1 -1
  479. package/dist/server.mjs +6 -0
  480. package/dist/server.mjs.map +1 -1
  481. package/dist/store/useAccountModals.mjs +9 -2
  482. package/dist/store/useAccountModals.mjs.map +1 -1
  483. package/dist/store/useAffiliateFlows.mjs +23 -0
  484. package/dist/store/useAffiliateFlows.mjs.map +1 -0
  485. package/dist/store/useProjectFlows.mjs +18 -0
  486. package/dist/store/useProjectFlows.mjs.map +1 -0
  487. package/dist/store/useSubscriptionFlows.mjs +58 -0
  488. package/dist/store/useSubscriptionFlows.mjs.map +1 -0
  489. package/dist/store/useTeamFlows.mjs +15 -0
  490. package/dist/store/useTeamFlows.mjs.map +1 -0
  491. package/dist/testing/factories/coupon.factory.mjs +19 -0
  492. package/dist/testing/factories/coupon.factory.mjs.map +1 -0
  493. package/dist/testing/factories/index.mjs +6 -0
  494. package/dist/testing/factories/index.mjs.map +1 -1
  495. package/dist/testing/factories/project-user.factory.mjs +17 -0
  496. package/dist/testing/factories/project-user.factory.mjs.map +1 -0
  497. package/dist/testing/factories/project.factory.mjs +21 -0
  498. package/dist/testing/factories/project.factory.mjs.map +1 -0
  499. package/dist/testing/react/providers.mjs +1 -1
  500. package/dist/testing/react/providers.mjs.map +1 -1
  501. package/dist/utils/browser/chart-custom-tooltip.mjs +69 -0
  502. package/dist/utils/browser/chart-custom-tooltip.mjs.map +1 -0
  503. package/dist/utils/browser/get-css-variable.mjs +9 -0
  504. package/dist/utils/browser/get-css-variable.mjs.map +1 -0
  505. package/dist/utils/constants/scrollbar.mjs +5 -0
  506. package/dist/utils/constants/scrollbar.mjs.map +1 -0
  507. package/dist/utils/date-filter-period.mjs +34 -0
  508. package/dist/utils/date-filter-period.mjs.map +1 -0
  509. package/dist/utils/file/index.mjs +11 -1
  510. package/dist/utils/file/index.mjs.map +1 -1
  511. package/dist/utils/format/initials.mjs +8 -0
  512. package/dist/utils/format/initials.mjs.map +1 -0
  513. package/dist/utils/format/masks.mjs +32 -1
  514. package/dist/utils/format/masks.mjs.map +1 -1
  515. package/dist/utils/qrcode/to-data-url.mjs +12 -0
  516. package/dist/utils/qrcode/to-data-url.mjs.map +1 -0
  517. package/dist/utils/validators/account.mjs +1 -7
  518. package/dist/utils/validators/account.mjs.map +1 -1
  519. package/package.json +20 -8
  520. package/src/components/account/AccountHubLinkHandler.tsx +39 -0
  521. package/src/components/account/AccountModalLayout.tsx +190 -0
  522. package/src/components/account/AccountModals.tsx +12 -2
  523. package/src/components/account/DeleteAccountModal.tsx +1 -1
  524. package/src/components/account/IsntPossibleDeleteAccountModal.tsx +9 -1
  525. package/src/components/account/MyAccountModal.tsx +215 -0
  526. package/src/components/account/TwoFactorAuthModal.tsx +1 -1
  527. package/src/components/account/hooks/useAccountHubActions.ts +95 -0
  528. package/src/components/account/hooks/useAddCardWithPaymentSwitch.ts +70 -0
  529. package/src/components/account/hooks/useAffiliatesActions.tsx +78 -0
  530. package/src/components/account/hooks/useMyAccountModal.ts +40 -0
  531. package/src/components/account/hooks/useProjectsActions.ts +44 -0
  532. package/src/components/account/hooks/useSubscriptionActions.ts +99 -0
  533. package/src/components/account/hooks/useTeamActions.ts +35 -0
  534. package/src/components/account/sections/AffiliatesSection.tsx +342 -0
  535. package/src/components/account/sections/ChangePasswordSection.tsx +6 -10
  536. package/src/components/account/sections/MyProfileSection.tsx +207 -143
  537. package/src/components/account/sections/PreferencesSection.tsx +55 -51
  538. package/src/components/account/sections/ProjectsSection.tsx +110 -0
  539. package/src/components/account/sections/SecuritySection.tsx +72 -62
  540. package/src/components/account/sections/SubscriptionSection.tsx +36 -0
  541. package/src/components/account/sections/TeamSection.tsx +161 -0
  542. package/src/components/account/sections/TokenSection.tsx +4 -8
  543. package/src/components/account/sections/affiliates/AffiliateCommissionCard.tsx +83 -0
  544. package/src/components/account/sections/affiliates/AffiliateFlows.tsx +20 -0
  545. package/src/components/account/sections/affiliates/AffiliateLeadsSheet.tsx +143 -0
  546. package/src/components/account/sections/affiliates/AffiliateStatsCard.tsx +56 -0
  547. package/src/components/account/sections/affiliates/AffiliateStepCard.tsx +20 -0
  548. package/src/components/account/sections/affiliates/AffiliateTransactionsList.tsx +194 -0
  549. package/src/components/account/sections/affiliates/NoReceivingAccountModal.tsx +63 -0
  550. package/src/components/account/sections/affiliates/ReceivingAccountModal.tsx +213 -0
  551. package/src/components/account/sections/affiliates/RequestWithdrawalSheet.tsx +586 -0
  552. package/src/components/account/sections/affiliates/ViewAttachmentModal.tsx +47 -0
  553. package/src/components/account/sections/affiliates/reports/AffiliatesIndicatorsChart.tsx +45 -0
  554. package/src/components/account/sections/affiliates/reports/AffiliatesReportsTab.tsx +44 -0
  555. package/src/components/account/sections/affiliates/reports/useAffiliatesIndicatorsChart.ts +148 -0
  556. package/src/components/account/sections/projects/DeleteProjectModal.tsx +246 -0
  557. package/src/components/account/sections/projects/ProjectFlows.tsx +16 -0
  558. package/src/components/account/sections/projects/ProjectMembersStack.tsx +75 -0
  559. package/src/components/account/sections/projects/ProjectRow.tsx +96 -0
  560. package/src/components/account/sections/projects/ProjectSheet.tsx +603 -0
  561. package/src/components/account/sections/projects/ProjectsDisabledModal.tsx +69 -0
  562. package/src/components/account/sections/projects/project-form.schema.ts +30 -0
  563. package/src/components/account/sections/shared/ConnectListRow.tsx +68 -0
  564. package/src/components/account/sections/shared/DateFilterPopover.tsx +58 -0
  565. package/src/components/account/sections/shared/EntityAvatar.tsx +54 -0
  566. package/src/components/account/sections/shared/FilterPopover.tsx +79 -0
  567. package/src/components/account/sections/shared/FormSection.tsx +23 -0
  568. package/src/components/account/sections/shared/IconBox.tsx +21 -0
  569. package/src/components/account/sections/shared/InfiniteScrollList.tsx +57 -0
  570. package/src/components/account/sections/shared/ListPagination.tsx +84 -0
  571. package/src/components/account/sections/shared/RowActionsMenu.tsx +66 -0
  572. package/src/components/account/sections/shared/SectionLoadError.tsx +27 -0
  573. package/src/components/account/sections/shared/StatusBadge.tsx +33 -0
  574. package/src/components/account/sections/shared/WorkspaceSection.tsx +22 -0
  575. package/src/components/account/sections/subscription/AiCreditsUsage.tsx +152 -0
  576. package/src/components/account/sections/subscription/BillingAddressSheet.tsx +460 -0
  577. package/src/components/account/sections/subscription/BoletoDetailsDialog.tsx +104 -0
  578. package/src/components/account/sections/subscription/BoletoGeneratedDialog.tsx +24 -0
  579. package/src/components/account/sections/subscription/CancelPlanDialog.tsx +221 -0
  580. package/src/components/account/sections/subscription/ChargeRow.tsx +161 -0
  581. package/src/components/account/sections/subscription/ChargeStatusBadge.tsx +29 -0
  582. package/src/components/account/sections/subscription/ChargesList.tsx +125 -0
  583. package/src/components/account/sections/subscription/ManageCardsSheet.tsx +93 -0
  584. package/src/components/account/sections/subscription/OverdueReceiptOpener.tsx +29 -0
  585. package/src/components/account/sections/subscription/PayChargeDialog.tsx +306 -0
  586. package/src/components/account/sections/subscription/PaymentConfirmationDialog.tsx +70 -0
  587. package/src/components/account/sections/subscription/PaymentMethodsCard.tsx +117 -0
  588. package/src/components/account/sections/subscription/PendingChangeDialog.tsx +168 -0
  589. package/src/components/account/sections/subscription/PixDetailsDialog.tsx +246 -0
  590. package/src/components/account/sections/subscription/PixPaymentDialog.tsx +242 -0
  591. package/src/components/account/sections/subscription/PlanDetailsSheet.tsx +380 -0
  592. package/src/components/account/sections/subscription/ReceiptDetailsSheet.tsx +318 -0
  593. package/src/components/account/sections/subscription/SubscriptionFlows.tsx +40 -0
  594. package/src/components/account/sections/subscription/SubscriptionPlanCard.tsx +433 -0
  595. package/src/components/account/sections/subscription/UsageReportSheet.tsx +244 -0
  596. package/src/components/account/sections/subscription/change-plan/ChangePlanSheet.tsx +95 -0
  597. package/src/components/account/sections/subscription/change-plan/components/AbTestDetailsDialog.tsx +57 -0
  598. package/src/components/account/sections/subscription/change-plan/components/AddonsBlock.tsx +214 -0
  599. package/src/components/account/sections/subscription/change-plan/components/AlternativeBucketsSection.tsx +92 -0
  600. package/src/components/account/sections/subscription/change-plan/components/CouponBlock.tsx +42 -0
  601. package/src/components/account/sections/subscription/change-plan/components/CouponDialog.tsx +134 -0
  602. package/src/components/account/sections/subscription/change-plan/components/PricePreview.tsx +28 -0
  603. package/src/components/account/sections/subscription/change-plan/components/SummaryBlock.tsx +194 -0
  604. package/src/components/account/sections/subscription/change-plan/plan-comparison.ts +52 -0
  605. package/src/components/account/sections/subscription/change-plan/steps/PaymentSummaryStep.tsx +161 -0
  606. package/src/components/account/sections/subscription/change-plan/steps/PlanComparisonStep.tsx +165 -0
  607. package/src/components/account/sections/subscription/change-plan/steps/PlanViewStep.tsx +89 -0
  608. package/src/components/account/sections/subscription/change-plan/steps/ReactivationConfigStep.tsx +117 -0
  609. package/src/components/account/sections/subscription/change-plan/steps/ReactivationPaymentStep.tsx +139 -0
  610. package/src/components/account/sections/subscription/change-plan/useChangePlanState.tsx +1158 -0
  611. package/src/components/account/sections/subscription/downgrade/CannotDowngradeDialog.tsx +297 -0
  612. package/src/components/account/sections/subscription/downgrade/DowngradeReasonDialog.tsx +154 -0
  613. package/src/components/account/sections/subscription/plans/PlanCard.tsx +417 -0
  614. package/src/components/account/sections/subscription/plans/PlanCardSkeleton.tsx +70 -0
  615. package/src/components/account/sections/subscription/plans/PlansCatalogDialog.tsx +156 -0
  616. package/src/components/account/sections/team/DeleteUserModal.tsx +134 -0
  617. package/src/components/account/sections/team/TeamFlows.tsx +14 -0
  618. package/src/components/account/sections/team/TeamMemberRow.tsx +151 -0
  619. package/src/components/account/sections/team/UserSheet.tsx +688 -0
  620. package/src/components/account/sections/team/steps/NotificationsStep.tsx +109 -0
  621. package/src/components/account/sections/team/steps/ProjectSelectionStep.tsx +219 -0
  622. package/src/components/account/sections/team/steps/UserInformationStep.tsx +423 -0
  623. package/src/components/account/sections/team/user-form.schema.ts +43 -0
  624. package/src/components/account/types/workspace-actions.type.ts +56 -0
  625. package/src/components/layouts/ProfilePopover.tsx +11 -12
  626. package/src/components/layouts/UsersSelectorPopover.tsx +7 -4
  627. package/src/components/modals/AccountDeletionWarningModal.tsx +4 -5
  628. package/src/components/modals/AccountFrozenModal.tsx +6 -3
  629. package/src/components/modals/Modals.tsx +6 -3
  630. package/src/components/modals/PaidPlanRequiredModal.tsx +4 -5
  631. package/src/components/modals/cards/AddFirstCardWarningModal.tsx +72 -0
  632. package/src/components/modals/cards/SwitchPaymentToCardModal.tsx +232 -0
  633. package/src/components/modals/promo/AiCreditsOfferModal/AiCreditsOfferModal.tsx +5 -4
  634. package/src/components/ui/data-display/CardItem.tsx +9 -5
  635. package/src/components/ui/data-display/PaymentMethodIcons.tsx +43 -0
  636. package/src/components/ui/form/BillingPeriodSelector.tsx +173 -0
  637. package/src/components/ui/form/PaymentMethodToggle.tsx +119 -0
  638. package/src/components/ui/form/RadioOptionFieldIcon.tsx +64 -0
  639. package/src/components/ui/form/SegmentedControl.tsx +77 -0
  640. package/src/components/ui/overlay/Dialog.tsx +70 -33
  641. package/src/components/ui/overlay/Sheet.tsx +89 -56
  642. package/src/components/ui/overlay/layers.tsx +114 -27
  643. package/src/enums/AccountHubFlow.ts +8 -0
  644. package/src/enums/DateFilterPeriod.ts +17 -0
  645. package/src/enums/WorkspaceSectionType.ts +6 -0
  646. package/src/handlers.ts +14 -0
  647. package/src/hooks/useDebounce.ts +5 -3
  648. package/src/hooks/useUploadProgress.ts +42 -0
  649. package/src/i18n/messages/en-us.ts +904 -2
  650. package/src/i18n/messages/es-es.ts +908 -2
  651. package/src/i18n/messages/pt-br.ts +908 -2
  652. package/src/index.ts +56 -1
  653. package/src/infra/http/paged.ts +24 -0
  654. package/src/middleware.ts +1 -0
  655. package/src/middlewares/create-auth-middleware.ts +1 -4
  656. package/src/middlewares/create-legacy-account-routes-middleware.ts +54 -0
  657. package/src/middlewares/is-route-equals.ts +3 -0
  658. package/src/modules/accounts/actions/account-management.action.ts +22 -1
  659. package/src/modules/accounts/constants/account-hub-link.constants.ts +3 -0
  660. package/src/modules/accounts/constants/legacy-account-routes.constants.ts +1 -0
  661. package/src/modules/accounts/handlers/list-account-members.handler.ts +23 -0
  662. package/src/modules/accounts/hooks/add-user-projects.hook.ts +72 -0
  663. package/src/modules/accounts/hooks/create-account-user.hook.ts +21 -0
  664. package/src/modules/accounts/hooks/remove-user-projects.hook.ts +68 -0
  665. package/src/modules/accounts/hooks/use-account-members.hook.ts +31 -0
  666. package/src/modules/accounts/services/account.service.ts +71 -0
  667. package/src/modules/accounts/types/account-hub-link.type.ts +13 -0
  668. package/src/modules/accounts/types.ts +9 -0
  669. package/src/modules/accounts/utils/build-account-hub-url.ts +14 -0
  670. package/src/modules/accounts/utils/is-account-hub-flow.ts +7 -0
  671. package/src/modules/accounts/utils/is-account-section.ts +7 -0
  672. package/src/modules/accounts/utils/is-my-account-section.ts +12 -0
  673. package/src/modules/accounts/utils/map-legacy-account-route.ts +108 -0
  674. package/src/modules/accounts/utils/parse-account-hub-link.ts +21 -0
  675. package/src/modules/affiliates/actions/ensure-affiliate.action.ts +9 -0
  676. package/src/modules/affiliates/actions/request-deposit.action.ts +9 -0
  677. package/src/modules/affiliates/actions/update-affiliate.action.ts +9 -0
  678. package/src/modules/affiliates/constants/affiliate.constants.ts +11 -0
  679. package/src/modules/affiliates/constants/query-keys.constants.ts +7 -0
  680. package/src/modules/affiliates/handlers/affiliate-report-analytics.handler.ts +16 -0
  681. package/src/modules/affiliates/handlers/affiliate-withdrawal-limits.handler.ts +10 -0
  682. package/src/modules/affiliates/handlers/current-affiliate.handler.ts +10 -0
  683. package/src/modules/affiliates/handlers/list-affiliate-coupons.handler.ts +10 -0
  684. package/src/modules/affiliates/handlers/list-affiliate-leads.handler.ts +23 -0
  685. package/src/modules/affiliates/handlers/list-affiliate-transactions.handler.ts +23 -0
  686. package/src/modules/affiliates/hooks/use-affiliate-coupons.hook.ts +19 -0
  687. package/src/modules/affiliates/hooks/use-affiliate-leads.hook.ts +27 -0
  688. package/src/modules/affiliates/hooks/use-affiliate-report-analytics.hook.ts +19 -0
  689. package/src/modules/affiliates/hooks/use-affiliate-transactions.hook.ts +25 -0
  690. package/src/modules/affiliates/hooks/use-current-affiliate.hook.ts +19 -0
  691. package/src/modules/affiliates/hooks/use-ensure-affiliate.hook.ts +24 -0
  692. package/src/modules/affiliates/hooks/use-request-deposit.hook.ts +29 -0
  693. package/src/modules/affiliates/hooks/use-update-affiliate.hook.ts +24 -0
  694. package/src/modules/affiliates/hooks/use-withdrawal-limits.hook.ts +20 -0
  695. package/src/modules/affiliates/services/affiliates.service.ts +240 -0
  696. package/src/modules/affiliates/types/affiliate.type.ts +180 -0
  697. package/src/modules/affiliates/utils/get-affiliate-share-link.ts +8 -0
  698. package/src/modules/charges/actions/get-nota-fiscal.action.ts +8 -0
  699. package/src/modules/charges/actions/refresh-pix.action.ts +8 -0
  700. package/src/modules/charges/hooks/nota-fiscal.hook.ts +13 -0
  701. package/src/modules/charges/hooks/refresh-pix.hook.ts +13 -0
  702. package/src/modules/charges/services/charges.service.ts +121 -0
  703. package/src/modules/charges/types/nota-fiscal.type.ts +20 -0
  704. package/src/modules/charges/types/refresh-pix.type.ts +14 -0
  705. package/src/modules/charges/utils/get-charge-download-url.ts +10 -0
  706. package/src/modules/coupons/constants/query-keys.constants.ts +1 -0
  707. package/src/modules/coupons/handlers/find-coupon-by-code.handler.ts +16 -0
  708. package/src/modules/coupons/handlers/find-coupon-by-id.handler.ts +15 -0
  709. package/src/modules/coupons/hooks/use-coupon-by-code.hook.ts +16 -0
  710. package/src/modules/coupons/hooks/use-coupon-by-id.hook.ts +20 -0
  711. package/src/modules/coupons/services/coupons.service.ts +54 -0
  712. package/src/modules/coupons/types/coupon.type.ts +70 -0
  713. package/src/modules/coupons/utils/coupon-restrictions.ts +112 -0
  714. package/src/modules/domains/handlers/count-domains.handler.ts +10 -0
  715. package/src/modules/domains/hooks/count-domains.hook.ts +17 -0
  716. package/src/modules/domains/services/domains.service.ts +18 -0
  717. package/src/modules/ia-credits/handlers/list-ia-credit-operations.handler.ts +14 -0
  718. package/src/modules/ia-credits/hooks/ia-credit-operations.hook.ts +33 -0
  719. package/src/modules/ia-credits/services/ia-credits.service.ts +32 -1
  720. package/src/modules/pages/handlers/count-pages.handler.ts +5 -2
  721. package/src/modules/pages/hooks/count-published-pages.hook.ts +26 -0
  722. package/src/modules/pages/services/pages.service.ts +3 -2
  723. package/src/modules/plans/constants/plan-tooltips.constants.ts +16 -0
  724. package/src/modules/plans/hooks/use-enriched-plans.hook.ts +31 -0
  725. package/src/modules/plans/hooks/use-ui-plans.hook.ts +22 -0
  726. package/src/modules/projects/hooks/add-project-users.hook.ts +29 -0
  727. package/src/modules/projects/hooks/list-all-account-users.hook.ts +3 -6
  728. package/src/modules/projects/hooks/list-available-users.hook.ts +3 -6
  729. package/src/modules/projects/hooks/list-infinite-projects.hook.ts +3 -6
  730. package/src/modules/projects/hooks/list-project-users.hook.ts +3 -6
  731. package/src/modules/projects/hooks/remove-project-users.hook.ts +29 -0
  732. package/src/modules/projects/services/project-users.service.ts +135 -130
  733. package/src/modules/projects/types.ts +89 -88
  734. package/src/modules/subscriptions/actions/cancel-subscription.action.ts +12 -0
  735. package/src/modules/subscriptions/actions/create-subscription.action.ts +9 -0
  736. package/src/modules/subscriptions/actions/find-pending-pix-status.action.ts +8 -0
  737. package/src/modules/subscriptions/actions/find-subscription-by-id.action.ts +8 -0
  738. package/src/modules/subscriptions/constants/addons.constants.ts +50 -0
  739. package/src/modules/subscriptions/constants/downgrade.constants.ts +30 -0
  740. package/src/modules/subscriptions/constants/subscription.constants.ts +3 -0
  741. package/src/modules/subscriptions/handlers/pending-pix-status.handler.ts +17 -0
  742. package/src/modules/subscriptions/hooks/cancel-subscription.hook.ts +28 -0
  743. package/src/modules/subscriptions/hooks/create-subscription.hook.ts +34 -0
  744. package/src/modules/subscriptions/hooks/find-subscription-by-id.hook.ts +17 -0
  745. package/src/modules/subscriptions/hooks/pending-pix-status.hook.ts +30 -0
  746. package/src/modules/subscriptions/services/subscriptions.service.ts +401 -301
  747. package/src/modules/subscriptions/types/cancel-subscription.type.ts +8 -0
  748. package/src/modules/subscriptions/types/create-subscription.type.ts +79 -0
  749. package/src/modules/subscriptions/types/pending-pix-status.type.ts +33 -0
  750. package/src/modules/subscriptions/types/subscription.type.ts +157 -147
  751. package/src/modules/subscriptions/utils/addon-buckets.ts +129 -0
  752. package/src/modules/subscriptions/utils/confirm-payment-if-required.ts +9 -2
  753. package/src/modules/subscriptions/utils/first-period-pricing.ts +63 -0
  754. package/src/modules/subscriptions/utils/is-api-subscription.ts +6 -0
  755. package/src/modules/subscriptions/utils/is-boleto-payer.ts +21 -0
  756. package/src/modules/subscriptions/utils/is-free-subscription.ts +6 -0
  757. package/src/modules/subscriptions/utils/periodicity.ts +101 -0
  758. package/src/modules/subscriptions/utils/resolve-subscription-plan-name.ts +44 -0
  759. package/src/modules/users/hooks/messages.hook.ts +3 -5
  760. package/src/server.ts +102 -99
  761. package/src/store/useAccountModals.ts +22 -5
  762. package/src/store/useAffiliateFlows.ts +46 -0
  763. package/src/store/useProjectFlows.ts +42 -0
  764. package/src/store/useSubscriptionFlows.ts +176 -0
  765. package/src/store/useTeamFlows.ts +34 -0
  766. package/src/testing/factories/coupon.factory.ts +17 -0
  767. package/src/testing/factories/index.ts +3 -0
  768. package/src/testing/factories/project-user.factory.ts +15 -0
  769. package/src/testing/factories/project.factory.ts +19 -0
  770. package/src/testing/react/providers.tsx +2 -1
  771. package/src/utils/browser/chart-custom-tooltip.ts +85 -0
  772. package/src/utils/browser/get-css-variable.ts +6 -0
  773. package/src/utils/constants/scrollbar.ts +10 -0
  774. package/src/utils/date-filter-period.ts +34 -0
  775. package/src/utils/file/index.ts +13 -0
  776. package/src/utils/format/initials.ts +10 -0
  777. package/src/utils/format/masks.ts +41 -0
  778. package/src/utils/qrcode/to-data-url.ts +23 -0
  779. package/src/utils/validators/account.ts +0 -8
  780. package/dist/components/account/ConfigurationsMyAccountModal.mjs +0 -143
  781. package/dist/components/account/ConfigurationsMyAccountModal.mjs.map +0 -1
  782. package/dist/components/account/hooks/useConfigurationsModal.mjs +0 -34
  783. package/dist/components/account/hooks/useConfigurationsModal.mjs.map +0 -1
  784. package/src/components/account/ConfigurationsMyAccountModal.tsx +0 -179
  785. package/src/components/account/hooks/useConfigurationsModal.ts +0 -45
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { cn } from "../../../infra/utils/clsx";
4
+ function SegmentedControl({
5
+ value,
6
+ onChange,
7
+ options,
8
+ className,
9
+ optionClassName,
10
+ selectedClassName,
11
+ unselectedClassName
12
+ }) {
13
+ const handleKeyDown = (event) => {
14
+ if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
15
+ event.preventDefault();
16
+ const currentIndex = options.findIndex((option) => option.value === value);
17
+ if (currentIndex === -1) return;
18
+ const direction = event.key === "ArrowRight" ? 1 : -1;
19
+ const nextIndex = (currentIndex + direction + options.length) % options.length;
20
+ onChange(options[nextIndex].value);
21
+ };
22
+ const baseSelected = selectedClassName ?? "bg-white text-zinc-950 shadow-[0px_2px_10px_0px_rgba(26,26,26,0.05)]";
23
+ const baseUnselected = unselectedClassName ?? "text-zinc-950";
24
+ return /* @__PURE__ */ jsx(
25
+ "div",
26
+ {
27
+ className: cn("inline-flex items-stretch rounded-[12px] bg-zinc-100 p-1.5 gap-1", className),
28
+ role: "radiogroup",
29
+ onKeyDown: handleKeyDown,
30
+ children: options.map((option) => {
31
+ const isActive = option.value === value;
32
+ return /* @__PURE__ */ jsx(
33
+ "button",
34
+ {
35
+ type: "button",
36
+ role: "radio",
37
+ "aria-checked": isActive,
38
+ className: cn(
39
+ "px-3 py-1.5 rounded-lg paragraph-small-semibold transition-colors cursor-pointer",
40
+ isActive ? baseSelected : baseUnselected,
41
+ optionClassName,
42
+ option.className
43
+ ),
44
+ onClick: () => onChange(option.value),
45
+ children: option.label
46
+ },
47
+ String(option.value)
48
+ );
49
+ })
50
+ }
51
+ );
52
+ }
53
+ export {
54
+ SegmentedControl
55
+ };
56
+ //# sourceMappingURL=SegmentedControl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/components/ui/form/SegmentedControl.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../../infra/utils/clsx';\n\ntype SegmentedControlOption<Value extends string | number> = {\n value: Value;\n label: React.ReactNode;\n className?: string;\n};\n\ninterface SegmentedControlProps<Value extends string | number> {\n value: Value;\n onChange: (value: Value) => void;\n options: SegmentedControlOption<Value>[];\n className?: string;\n optionClassName?: string;\n selectedClassName?: string;\n unselectedClassName?: string;\n}\n\n/** Alternador de opções curtas (periodicidade da vitrine, por exemplo). */\nexport function SegmentedControl<Value extends string | number = string>({\n value,\n onChange,\n options,\n className,\n optionClassName,\n selectedClassName,\n unselectedClassName,\n}: SegmentedControlProps<Value>) {\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight') return;\n\n event.preventDefault();\n const currentIndex = options.findIndex((option) => option.value === value);\n if (currentIndex === -1) return;\n\n const direction = event.key === 'ArrowRight' ? 1 : -1;\n const nextIndex = (currentIndex + direction + options.length) % options.length;\n onChange(options[nextIndex].value);\n };\n\n const baseSelected =\n selectedClassName ?? 'bg-white text-zinc-950 shadow-[0px_2px_10px_0px_rgba(26,26,26,0.05)]';\n const baseUnselected = unselectedClassName ?? 'text-zinc-950';\n\n return (\n <div\n className={cn('inline-flex items-stretch rounded-[12px] bg-zinc-100 p-1.5 gap-1', className)}\n role=\"radiogroup\"\n onKeyDown={handleKeyDown}\n >\n {options.map((option) => {\n const isActive = option.value === value;\n\n return (\n <button\n key={String(option.value)}\n type=\"button\"\n role=\"radio\"\n aria-checked={isActive}\n className={cn(\n 'px-3 py-1.5 rounded-lg paragraph-small-semibold transition-colors cursor-pointer',\n isActive ? baseSelected : baseUnselected,\n optionClassName,\n option.className\n )}\n onClick={() => onChange(option.value)}\n >\n {option.label}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";AAyDU;AAtDV,SAAS,UAAU;AAmBZ,SAAS,iBAAyD;AAAA,EACvE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAiC;AAC/B,QAAM,gBAAgB,CAAC,UAA+C;AACpE,QAAI,MAAM,QAAQ,eAAe,MAAM,QAAQ,aAAc;AAE7D,UAAM,eAAe;AACrB,UAAM,eAAe,QAAQ,UAAU,CAAC,WAAW,OAAO,UAAU,KAAK;AACzE,QAAI,iBAAiB,GAAI;AAEzB,UAAM,YAAY,MAAM,QAAQ,eAAe,IAAI;AACnD,UAAM,aAAa,eAAe,YAAY,QAAQ,UAAU,QAAQ;AACxE,aAAS,QAAQ,SAAS,EAAE,KAAK;AAAA,EACnC;AAEA,QAAM,eACJ,qBAAqB;AACvB,QAAM,iBAAiB,uBAAuB;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,oEAAoE,SAAS;AAAA,MAC3F,MAAK;AAAA,MACL,WAAW;AAAA,MAEV,kBAAQ,IAAI,CAAC,WAAW;AACvB,cAAM,WAAW,OAAO,UAAU;AAElC,eACE;AAAA,UAAC;AAAA;AAAA,YAEC,MAAK;AAAA,YACL,MAAK;AAAA,YACL,gBAAc;AAAA,YACd,WAAW;AAAA,cACT;AAAA,cACA,WAAW,eAAe;AAAA,cAC1B;AAAA,cACA,OAAO;AAAA,YACT;AAAA,YACA,SAAS,MAAM,SAAS,OAAO,KAAK;AAAA,YAEnC,iBAAO;AAAA;AAAA,UAZH,OAAO,OAAO,KAAK;AAAA,QAa1B;AAAA,MAEJ,CAAC;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -1,13 +1,41 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
3
4
  import * as DialogPrimitive from "@radix-ui/react-dialog";
4
5
  import { IconX } from "@tabler/icons-react";
5
6
  import { cn } from "../../../infra/utils/clsx";
6
- import { OverlayLayerContext, useDialogLayer, useOverlayLayer } from "./layers";
7
+ import {
8
+ OverlayLayerContext,
9
+ OverlayTopContext,
10
+ useDialogLayer,
11
+ useIsTopOverlay,
12
+ useOverlayPosition,
13
+ useTopLayerScrollIsolation
14
+ } from "./layers";
7
15
  function Dialog({
16
+ open,
17
+ defaultOpen,
18
+ onOpenChange,
19
+ modal,
8
20
  ...props
9
21
  }) {
10
- return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
22
+ const [openState, setOpenState] = React.useState(defaultOpen ?? false);
23
+ const { layer, isTop } = useOverlayPosition(open ?? openState);
24
+ const handleOpenChange = (next) => {
25
+ setOpenState(next);
26
+ onOpenChange?.(next);
27
+ };
28
+ return /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value: layer, children: /* @__PURE__ */ jsx(OverlayTopContext.Provider, { value: isTop, children: /* @__PURE__ */ jsx(
29
+ DialogPrimitive.Root,
30
+ {
31
+ "data-slot": "dialog",
32
+ open,
33
+ defaultOpen,
34
+ onOpenChange: handleOpenChange,
35
+ modal,
36
+ ...props
37
+ }
38
+ ) }) });
11
39
  }
12
40
  function DialogTrigger({
13
41
  ...props
@@ -48,16 +76,23 @@ function DialogContent({
48
76
  showCloseButton = true,
49
77
  overlayClassName,
50
78
  hideOverlay = false,
79
+ ref,
51
80
  ...props
52
81
  }) {
53
- const { layer, presenceRef } = useOverlayLayer();
54
- return /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value: layer, children: /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
82
+ const layer = useDialogLayer();
83
+ const contentRef = React.useRef(null);
84
+ useTopLayerScrollIsolation(contentRef, useIsTopOverlay());
85
+ return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
55
86
  !hideOverlay && /* @__PURE__ */ jsx(DialogOverlay, { className: overlayClassName }),
56
87
  /* @__PURE__ */ jsxs(
57
88
  DialogPrimitive.Content,
58
89
  {
59
- ref: presenceRef,
60
90
  "data-slot": "dialog-content",
91
+ ref: (node) => {
92
+ contentRef.current = node;
93
+ if (typeof ref === "function") ref(node);
94
+ else if (ref) ref.current = node;
95
+ },
61
96
  className: cn(
62
97
  "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
63
98
  layer.content,
@@ -80,7 +115,7 @@ function DialogContent({
80
115
  ]
81
116
  }
82
117
  )
83
- ] }) });
118
+ ] });
84
119
  }
85
120
  function DialogHeader({ className, ...props }) {
86
121
  return /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ui/overlay/Dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport { OverlayLayerContext, useDialogLayer, useOverlayLayer } from \"./layers\";\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n const layer = useDialogLayer();\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/50\",\n layer.overlay,\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n overlayClassName,\n hideOverlay = false,\n ...props\n}: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n overlayClassName?: string;\n hideOverlay?: boolean;\n}) {\n const { layer, presenceRef } = useOverlayLayer();\n return (\n <OverlayLayerContext.Provider value={layer}>\n <DialogPortal data-slot=\"dialog-portal\">\n {!hideOverlay && <DialogOverlay className={overlayClassName} />}\n <DialogPrimitive.Content\n ref={presenceRef}\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n layer.content,\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <div className=\"absolute top-0.5 right-0\">\n <div className=\"p-4\">\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none\"\n >\n <IconX className=\"size-[18px]\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </div>\n </div>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n </OverlayLayerContext.Provider>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n \"p-5 flex flex-col gap-2 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":";AAWS,cAsEO,YAtEP;AART,YAAY,qBAAqB;AACjC,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,qBAAqB,gBAAgB,uBAAuB;AAErE,SAAS,OAAO;AAAA,EACd,GAAG;AACL,GAAsD;AACpD,SAAO,oBAAC,gBAAgB,MAAhB,EAAqB,aAAU,UAAU,GAAG,OAAO;AAC7D;AAEA,SAAS,cAAc;AAAA,EACrB,GAAG;AACL,GAAyD;AACvD,SAAO,oBAAC,gBAAgB,SAAhB,EAAwB,aAAU,kBAAkB,GAAG,OAAO;AACxE;AAEA,SAAS,aAAa;AAAA,EACpB,GAAG;AACL,GAAwD;AACtD,SAAO,oBAAC,gBAAgB,QAAhB,EAAuB,aAAU,iBAAiB,GAAG,OAAO;AACtE;AAEA,SAAS,YAAY;AAAA,EACnB,GAAG;AACL,GAAuD;AACrD,SAAO,oBAAC,gBAAgB,OAAhB,EAAsB,aAAU,gBAAgB,GAAG,OAAO;AACpE;AAEA,SAAS,cAAc;AAAA,EACrB;AAAA,EACA,GAAG;AACL,GAAyD;AACvD,QAAM,QAAQ,eAAe;AAC7B,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA,MAAM;AAAA,QACN;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,cAAc;AAAA,EACrB;AAAA,EACA;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA,cAAc;AAAA,EACd,GAAG;AACL,GAIG;AACD,QAAM,EAAE,OAAO,YAAY,IAAI,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AA,EACA,GAAG;AACL,GAA6D;AAC3D,SACE;AAAA,IAAC,gBAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/ui/overlay/Dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport {\n OverlayLayerContext,\n OverlayTopContext,\n useDialogLayer,\n useIsTopOverlay,\n useOverlayPosition,\n useTopLayerScrollIsolation,\n} from \"./layers\";\n\nfunction Dialog({\n open,\n defaultOpen,\n onOpenChange,\n modal,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n const [openState, setOpenState] = React.useState(defaultOpen ?? false);\n const { layer, isTop } = useOverlayPosition(open ?? openState);\n\n const handleOpenChange = (next: boolean) => {\n setOpenState(next);\n onOpenChange?.(next);\n };\n\n return (\n <OverlayLayerContext.Provider value={layer}>\n <OverlayTopContext.Provider value={isTop}>\n <DialogPrimitive.Root\n data-slot=\"dialog\"\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={handleOpenChange}\n modal={modal}\n {...props}\n />\n </OverlayTopContext.Provider>\n </OverlayLayerContext.Provider>\n );\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n const layer = useDialogLayer();\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 bg-black/50\",\n layer.overlay,\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n overlayClassName,\n hideOverlay = false,\n ref,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n overlayClassName?: string;\n hideOverlay?: boolean;\n}) {\n const layer = useDialogLayer();\n const contentRef = React.useRef<HTMLDivElement>(null);\n useTopLayerScrollIsolation(contentRef, useIsTopOverlay());\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n {!hideOverlay && <DialogOverlay className={overlayClassName} />}\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n ref={(node) => {\n contentRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n layer.content,\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <div className=\"absolute top-0.5 right-0\">\n <div className=\"p-4\">\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none\"\n >\n <IconX className=\"size-[18px]\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </div>\n </div>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\n \"p-5 flex flex-col gap-2 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":";AAiCM,cAsFQ,YAtFR;AA/BN,YAAY,WAAW;AACvB,YAAY,qBAAqB;AACjC,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,OAAO;AAAA,EACd;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAsD;AACpD,QAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,eAAe,KAAK;AACrE,QAAM,EAAE,OAAO,MAAM,IAAI,mBAAmB,QAAQ,SAAS;AAE7D,QAAM,mBAAmB,CAAC,SAAkB;AAC1C,iBAAa,IAAI;AACjB,mBAAe,IAAI;AAA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hB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
@@ -5,14 +5,34 @@ import * as SheetPrimitive from "@radix-ui/react-dialog";
5
5
  import { IconX } from "@tabler/icons-react";
6
6
  import { cn } from "../../../infra/utils/clsx";
7
7
  import { hideCrisp, showCrisp } from "../../embeds/CrispEmbed";
8
- import { OverlayLayerContext, useDialogLayer, useOverlayLayer } from "./layers";
9
- function Sheet({ onOpenChange, modal = false, ...props }) {
10
- const handleOpenChange = React.useCallback((open) => {
11
- if (open) hideCrisp();
8
+ import {
9
+ OverlayLayerContext,
10
+ OverlayTopContext,
11
+ useDialogLayer,
12
+ useIsTopOverlay,
13
+ useOverlayPosition,
14
+ useTopLayerScrollIsolation
15
+ } from "./layers";
16
+ function Sheet({ open, defaultOpen, onOpenChange, modal = true, ...props }) {
17
+ const [openState, setOpenState] = React.useState(defaultOpen ?? false);
18
+ const { layer, isTop } = useOverlayPosition(open ?? openState);
19
+ const handleOpenChange = React.useCallback((next) => {
20
+ if (next) hideCrisp();
12
21
  else showCrisp();
13
- onOpenChange?.(open);
22
+ setOpenState(next);
23
+ onOpenChange?.(next);
14
24
  }, [onOpenChange]);
15
- return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "sheet", modal, onOpenChange: handleOpenChange, ...props });
25
+ return /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value: layer, children: /* @__PURE__ */ jsx(OverlayTopContext.Provider, { value: isTop, children: /* @__PURE__ */ jsx(
26
+ SheetPrimitive.Root,
27
+ {
28
+ "data-slot": "sheet",
29
+ modal,
30
+ open,
31
+ defaultOpen,
32
+ onOpenChange: handleOpenChange,
33
+ ...props
34
+ }
35
+ ) }) });
16
36
  }
17
37
  function SheetTrigger({
18
38
  ...props
@@ -38,12 +58,15 @@ function SheetOverlay({
38
58
  "div",
39
59
  {
40
60
  "data-slot": "sheet-overlay",
61
+ ...props,
41
62
  className: cn(
42
- "animate-in fade-in-0 fixed inset-0 bg-black/50 cursor-default",
63
+ // `pointer-events-auto` explícito: este overlay é um div nosso, e quando o sheet abre
64
+ // por cima de um dialog o Radix trava `pointer-events: none` no body — sem isto ele
65
+ // herdaria o bloqueio, viraria só cor e os cliques atravessariam para o que está atrás.
66
+ "animate-in fade-in-0 fixed inset-0 bg-black/50 cursor-default pointer-events-auto",
43
67
  layer.overlay,
44
68
  className
45
- ),
46
- ...props
69
+ )
47
70
  }
48
71
  ) });
49
72
  }
@@ -53,16 +76,23 @@ function SheetContent({
53
76
  side = "right",
54
77
  showCloseButton = true,
55
78
  noAnimation = false,
79
+ ref,
56
80
  ...props
57
81
  }) {
58
- const { layer, presenceRef } = useOverlayLayer();
59
- return /* @__PURE__ */ jsx(OverlayLayerContext.Provider, { value: layer, children: /* @__PURE__ */ jsxs(SheetPortal, { children: [
82
+ const layer = useDialogLayer();
83
+ const contentRef = React.useRef(null);
84
+ useTopLayerScrollIsolation(contentRef, useIsTopOverlay());
85
+ return /* @__PURE__ */ jsxs(SheetPortal, { children: [
60
86
  /* @__PURE__ */ jsx(SheetOverlay, { className: noAnimation ? "!animate-none" : void 0 }),
61
87
  /* @__PURE__ */ jsxs(
62
88
  SheetPrimitive.Content,
63
89
  {
64
- ref: presenceRef,
65
90
  "data-slot": "sheet-content",
91
+ ref: (node) => {
92
+ contentRef.current = node;
93
+ if (typeof ref === "function") ref(node);
94
+ else if (ref) ref.current = node;
95
+ },
66
96
  onInteractOutside: (e) => e.preventDefault(),
67
97
  onPointerDownOutside: (e) => e.preventDefault(),
68
98
  className: cn(
@@ -96,7 +126,7 @@ function SheetContent({
96
126
  ]
97
127
  }
98
128
  )
99
- ] }) });
129
+ ] });
100
130
  }
101
131
  function SheetHeader({ className, ...props }) {
102
132
  return /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ui/overlay/Sheet.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport { hideCrisp, showCrisp } from \"../../embeds/CrispEmbed\";\nimport { OverlayLayerContext, useDialogLayer, useOverlayLayer } from \"./layers\";\n\nfunction Sheet({ onOpenChange, modal = false, ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n const handleOpenChange = React.useCallback((open: boolean) => {\n if (open) hideCrisp();\n else showCrisp();\n onOpenChange?.(open);\n }, [onOpenChange]);\n\n return <SheetPrimitive.Root data-slot=\"sheet\" modal={modal} onOpenChange={handleOpenChange} {...props} />;\n}\n\nfunction SheetTrigger({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\nfunction SheetClose({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\nfunction SheetPortal({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n}\n\nfunction SheetOverlay({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n const layer = useDialogLayer();\n return (\n <SheetPrimitive.Close tabIndex={-1} asChild>\n <div\n data-slot=\"sheet-overlay\"\n className={cn(\n \"animate-in fade-in-0 fixed inset-0 bg-black/50 cursor-default\",\n layer.overlay,\n className,\n )}\n {...props}\n />\n </SheetPrimitive.Close>\n );\n}\n\nfunction SheetContent({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n noAnimation = false,\n ...props\n}: React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n showCloseButton?: boolean;\n noAnimation?: boolean;\n}) {\n const { layer, presenceRef } = useOverlayLayer();\n return (\n <OverlayLayerContext.Provider value={layer}>\n <SheetPortal>\n <SheetOverlay className={noAnimation ? \"!animate-none\" : undefined} />\n <SheetPrimitive.Content\n ref={presenceRef}\n data-slot=\"sheet-content\"\n onInteractOutside={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n className={cn(\n \"bg-background fixed flex flex-col gap-4 shadow-lg\",\n layer.content,\n !noAnimation &&\n \"data-[state=open]:animate-in data-[state=closed]:animate-out transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n !noAnimation &&\n side === \"right\" &&\n \"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right\",\n !noAnimation &&\n side === \"left\" &&\n \"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left\",\n !noAnimation &&\n side === \"top\" &&\n \"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n !noAnimation &&\n side === \"bottom\" &&\n \"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n side === \"right\" &&\n \"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm\",\n side === \"left\" &&\n \"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm\",\n side === \"top\" && \"inset-x-0 top-0 h-auto border-b\",\n side === \"bottom\" && \"inset-x-0 bottom-0 h-auto border-t\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n className=\"absolute top-3 right-3 hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none\"\n >\n <IconX className=\"size-[18px]\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPortal>\n </OverlayLayerContext.Provider>\n );\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\"flex flex-col gap-1.5 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetTitle({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"],"mappings":";AAgBS,cA4FG,YA5FH;AAdT,YAAY,WAAW;AACvB,YAAY,oBAAoB;AAChC,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,WAAW,iBAAiB;AACrC,SAAS,qBAAqB,gBAAgB,uBAAuB;AAErE,SAAS,MAAM,EAAE,cAAc,QAAQ,OAAO,GAAG,MAAM,GAAqD;AAC1G,QAAM,mBAAmB,MAAM,YAAY,CAAC,SAAkB;AAC5D,QAAI,KAAM,WAAU;AAAA,QACf,WAAU;AACf,mBAAe,IAAI;AAAA,EACrB,GAAG,CAAC,YAAY,CAAC;AAEjB,SAAO,oBAAC,eAAe,MAAf,EAAoB,aAAU,SAAQ,OAAc,cAAc,kBAAmB,GAAG,OAAO;AACzG;AAEA,SAAS,aAAa;AAAA,EACpB,GAAG;AACL,GAAwD;AACtD,SAAO,oBAAC,eAAe,SAAf,EAAuB,aAAU,iBAAiB,GAAG,OAAO;AACtE;AAEA,SAAS,WAAW;AAAA,EAClB,GAAG;AACL,GAAsD;AACpD,SAAO,oBAAC,eAAe,OAAf,EAAqB,aAAU,eA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ACA,mBACC;AAAA,YAAC,eAAe;AAAA,YAAf;AAAA,cACC,aAAU;AAAA,cACV,WAAU;AAAA,cAEV;AAAA,oCAAC,SAAM,WAAU,eAAc;AAAA,gBAC/B,oBAAC,UAAK,WAAU,WAAU,mBAAK;AAAA;AAAA;AAAA,UACjC;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAgC;AACzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,6BAA6B,SAAS;AAAA,MACnD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAgC;AACzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,WAAW;AAAA,EAClB;AAAA,EACA,GAAG;AACL,GAAsD;AACpD,SACE;AAAA,IAAC,eAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA,GAAG;AACL,GAA4D;AAC1D,SACE;AAAA,IAAC,eAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/ui/overlay/Sheet.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as SheetPrimitive from \"@radix-ui/react-dialog\";\nimport { IconX } from '@tabler/icons-react';\nimport { cn } from \"../../../infra/utils/clsx\";\nimport { hideCrisp, showCrisp } from \"../../embeds/CrispEmbed\";\nimport {\n OverlayLayerContext,\n OverlayTopContext,\n useDialogLayer,\n useIsTopOverlay,\n useOverlayPosition,\n useTopLayerScrollIsolation,\n} from \"./layers\";\n\n/** `modal` ligado por padrão: drawer segura o foco e o fundo enquanto está aberto. */\nfunction Sheet({ open, defaultOpen, onOpenChange, modal = true, ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {\n const [openState, setOpenState] = React.useState(defaultOpen ?? false);\n const { layer, isTop } = useOverlayPosition(open ?? openState);\n\n const handleOpenChange = React.useCallback((next: boolean) => {\n if (next) hideCrisp();\n else showCrisp();\n setOpenState(next);\n onOpenChange?.(next);\n }, [onOpenChange]);\n\n return (\n <OverlayLayerContext.Provider value={layer}>\n <OverlayTopContext.Provider value={isTop}>\n <SheetPrimitive.Root\n data-slot=\"sheet\"\n modal={modal}\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={handleOpenChange}\n {...props}\n />\n </OverlayTopContext.Provider>\n </OverlayLayerContext.Provider>\n );\n}\n\nfunction SheetTrigger({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />;\n}\n\nfunction SheetClose({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Close>) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />;\n}\n\nfunction SheetPortal({\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Portal>) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />;\n}\n\nfunction SheetOverlay({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n const layer = useDialogLayer();\n return (\n <SheetPrimitive.Close tabIndex={-1} asChild>\n <div\n data-slot=\"sheet-overlay\"\n {...props}\n className={cn(\n // `pointer-events-auto` explícito: este overlay é um div nosso, e quando o sheet abre\n // por cima de um dialog o Radix trava `pointer-events: none` no body — sem isto ele\n // herdaria o bloqueio, viraria só cor e os cliques atravessariam para o que está atrás.\n \"animate-in fade-in-0 fixed inset-0 bg-black/50 cursor-default pointer-events-auto\",\n layer.overlay,\n className,\n )}\n />\n </SheetPrimitive.Close>\n );\n}\n\nfunction SheetContent({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n noAnimation = false,\n ref,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Content> & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n showCloseButton?: boolean;\n noAnimation?: boolean;\n}) {\n const layer = useDialogLayer();\n const contentRef = React.useRef<HTMLDivElement>(null);\n useTopLayerScrollIsolation(contentRef, useIsTopOverlay());\n return (\n <SheetPortal>\n <SheetOverlay className={noAnimation ? \"!animate-none\" : undefined} />\n <SheetPrimitive.Content\n data-slot=\"sheet-content\"\n ref={(node) => {\n contentRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n onInteractOutside={(e) => e.preventDefault()}\n onPointerDownOutside={(e) => e.preventDefault()}\n className={cn(\n \"bg-background fixed flex flex-col gap-4 shadow-lg\",\n layer.content,\n !noAnimation &&\n \"data-[state=open]:animate-in data-[state=closed]:animate-out transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n !noAnimation &&\n side === \"right\" &&\n \"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right\",\n !noAnimation &&\n side === \"left\" &&\n \"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left\",\n !noAnimation &&\n side === \"top\" &&\n \"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n !noAnimation &&\n side === \"bottom\" &&\n \"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n side === \"right\" &&\n \"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm\",\n side === \"left\" &&\n \"inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm\",\n side === \"top\" && \"inset-x-0 top-0 h-auto border-b\",\n side === \"bottom\" && \"inset-x-0 bottom-0 h-auto border-t\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n className=\"absolute top-3 right-3 hover:cursor-pointer flex size-8 items-center justify-center rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-950 focus:outline-none\"\n >\n <IconX className=\"size-[18px]\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPortal>\n );\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-header\"\n className={cn(\"flex flex-col gap-1.5 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetTitle({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Title>) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: React.ComponentProps<typeof SheetPrimitive.Description>) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"],"mappings":";AA+BM,cA+GI,YA/GJ;AA7BN,YAAY,WAAW;AACvB,YAAY,oBAAoB;AAChC,SAAS,aAAa;AACtB,SAAS,UAAU;AACnB,SAAS,WAAW,iBAAiB;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,MAAM,EAAE,MAAM,aAAa,cAAc,QAAQ,MAAM,GAAG,MAAM,GAAqD;AAC5H,QAAM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AAG,6BAA6B,SAAS;AAAA,MACnD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAgC;AACzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,mCAAmC,SAAS;AAAA,MACzD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,WAAW;AAAA,EAClB;AAAA,EACA,GAAG;AACL,GAAsD;AACpD,SACE;AAAA,IAAC,eAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,iBAAiB;AAAA,EACxB;AAAA,EACA,GAAG;AACL,GAA4D;AAC1D,SACE;AAAA,IAAC,eAAe;AAAA,IAAf;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iCAAiC,SAAS;AAAA,MACvD,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
@@ -14,35 +14,49 @@ const ROOT_LAYER = { overlay: "z-[1000]", content: "z-[1001]", popover: "z-[1002
14
14
  const openOverlays = /* @__PURE__ */ new Set();
15
15
  const overlayListeners = /* @__PURE__ */ new Set();
16
16
  let saturationWarned = false;
17
- function subscribeOverlays(onStoreChange) {
18
- overlayListeners.add(onStoreChange);
19
- return () => {
20
- overlayListeners.delete(onStoreChange);
21
- };
17
+ function notifyOverlays() {
18
+ overlayListeners.forEach((listener) => listener());
22
19
  }
23
- const OverlayLayerContext = React.createContext(ROOT_LAYER);
24
- function useOverlayLayer() {
25
- const token = React.useRef({});
26
- const rank = React.useSyncExternalStore(
27
- subscribeOverlays,
28
- () => Math.max(Array.from(openOverlays).indexOf(token.current), 0),
29
- () => 0
20
+ function warnOnSaturation() {
21
+ if (process.env.NODE_ENV === "production" || saturationWarned || openOverlays.size <= OVERLAY_LAYERS.length) return;
22
+ saturationWarned = true;
23
+ console.warn(
24
+ `[great-lib-common] ${openOverlays.size} overlays visiveis, mas a escala de z so tem ${OVERLAY_LAYERS.length} faixas. Deste nivel em diante todos dividem a ultima faixa e o overlay de cima cai sob o conteudo de baixo. Se o empilhamento for legitimo, adicione uma faixa em ui/overlay/layers.tsx.`
30
25
  );
31
- const presenceRef = React.useCallback(() => {
32
- openOverlays.add(token.current);
33
- overlayListeners.forEach((notify) => notify());
34
- if (process.env.NODE_ENV !== "production" && openOverlays.size > OVERLAY_LAYERS.length && !saturationWarned) {
35
- saturationWarned = true;
36
- console.warn(
37
- `[great-lib-common] ${openOverlays.size} overlays visiveis, mas a escala de z so tem ${OVERLAY_LAYERS.length} faixas. Deste nivel em diante todos dividem a ultima faixa e o overlay de cima cai sob o conteudo de baixo. Se o empilhamento for legitimo, adicione uma faixa em ui/overlay/layers.tsx.`
38
- );
39
- }
26
+ }
27
+ const OverlayLayerContext = React.createContext(ROOT_LAYER);
28
+ const OverlayTopContext = React.createContext(true);
29
+ function useIsTopOverlay() {
30
+ return React.useContext(OverlayTopContext);
31
+ }
32
+ function readPosition(token) {
33
+ const tokens = Array.from(openOverlays);
34
+ const index = tokens.indexOf(token);
35
+ return { rank: Math.max(index, 0), isTop: index === tokens.length - 1 };
36
+ }
37
+ function useOverlayPosition(open) {
38
+ const [position, setPosition] = React.useState({ rank: 0, isTop: true });
39
+ React.useLayoutEffect(() => {
40
+ if (!open) return;
41
+ const token = {};
42
+ const sync = () => setPosition(readPosition(token));
43
+ overlayListeners.add(sync);
44
+ openOverlays.add(token);
45
+ notifyOverlays();
46
+ warnOnSaturation();
40
47
  return () => {
41
- openOverlays.delete(token.current);
42
- overlayListeners.forEach((notify) => notify());
48
+ overlayListeners.delete(sync);
49
+ openOverlays.delete(token);
50
+ notifyOverlays();
43
51
  };
44
- }, []);
45
- return { layer: OVERLAY_LAYERS[Math.min(rank, OVERLAY_LAYERS.length - 1)], presenceRef };
52
+ }, [open]);
53
+ return {
54
+ layer: OVERLAY_LAYERS[Math.min(position.rank, OVERLAY_LAYERS.length - 1)],
55
+ isTop: position.isTop
56
+ };
57
+ }
58
+ function useOverlayLayer(open) {
59
+ return useOverlayPosition(open).layer;
46
60
  }
47
61
  function useDialogLayer() {
48
62
  return React.useContext(OverlayLayerContext);
@@ -50,12 +64,44 @@ function useDialogLayer() {
50
64
  function DialogLayer({ children }) {
51
65
  return children;
52
66
  }
67
+ const FLOATING_CONTENT_SELECTOR = [
68
+ "[data-radix-popper-content-wrapper]",
69
+ "[data-radix-menu-content]",
70
+ '[data-slot="select-content"]',
71
+ '[data-slot="popover-content"]',
72
+ '[data-slot="dropdown-menu-content"]',
73
+ '[data-slot="command-list"]',
74
+ '[role="listbox"]',
75
+ '[role="menu"]'
76
+ ].join(",");
77
+ function useTopLayerScrollIsolation(ref, enabled) {
78
+ React.useEffect(() => {
79
+ if (!enabled) return;
80
+ const stopForThisLayer = (event) => {
81
+ const target = event.target;
82
+ if (!target) return;
83
+ const isFloatingContent = target instanceof Element && target.closest(FLOATING_CONTENT_SELECTOR) !== null;
84
+ if (isFloatingContent || ref.current?.contains(target)) event.stopPropagation();
85
+ };
86
+ const options = { capture: true };
87
+ document.addEventListener("wheel", stopForThisLayer, options);
88
+ document.addEventListener("touchmove", stopForThisLayer, options);
89
+ return () => {
90
+ document.removeEventListener("wheel", stopForThisLayer, options);
91
+ document.removeEventListener("touchmove", stopForThisLayer, options);
92
+ };
93
+ }, [ref, enabled]);
94
+ }
53
95
  export {
54
96
  DialogLayer,
55
97
  OVERLAY_LAYERS,
56
98
  OverlayLayerContext,
99
+ OverlayTopContext,
57
100
  ROOT_LAYER,
58
101
  useDialogLayer,
59
- useOverlayLayer
102
+ useIsTopOverlay,
103
+ useOverlayLayer,
104
+ useOverlayPosition,
105
+ useTopLayerScrollIsolation
60
106
  };
61
107
  //# sourceMappingURL=layers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/ui/overlay/layers.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nexport const OVERLAY_LAYERS = [\n { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-[1003]\" },\n { overlay: \"z-[1010]\", content: \"z-[1011]\", popover: \"z-[1012]\", tooltip: \"z-[1013]\" },\n { overlay: \"z-[1020]\", content: \"z-[1021]\", popover: \"z-[1022]\", tooltip: \"z-[1023]\" },\n { overlay: \"z-[1030]\", content: \"z-[1031]\", popover: \"z-[1032]\", tooltip: \"z-[1033]\" },\n { overlay: \"z-[1040]\", content: \"z-[1041]\", popover: \"z-[1042]\", tooltip: \"z-[1043]\" },\n { overlay: \"z-[1050]\", content: \"z-[1051]\", popover: \"z-[1052]\", tooltip: \"z-[1053]\" },\n { overlay: \"z-[1060]\", content: \"z-[1061]\", popover: \"z-[1062]\", tooltip: \"z-[1063]\" },\n { overlay: \"z-[1070]\", content: \"z-[1071]\", popover: \"z-[1072]\", tooltip: \"z-[1073]\" },\n] as const;\n\nexport const ROOT_LAYER = { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-50\" } as const;\n\nexport type DialogLayerClasses = (typeof OVERLAY_LAYERS)[number] | typeof ROOT_LAYER;\n\nconst openOverlays = new Set<object>();\nconst overlayListeners = new Set<() => void>();\nlet saturationWarned = false;\n\nfunction subscribeOverlays(onStoreChange: () => void) {\n overlayListeners.add(onStoreChange);\n return () => {\n overlayListeners.delete(onStoreChange);\n };\n}\n\nexport const OverlayLayerContext = React.createContext<DialogLayerClasses>(ROOT_LAYER);\n\nexport function useOverlayLayer() {\n const token = React.useRef({});\n const rank = React.useSyncExternalStore(\n subscribeOverlays,\n () => Math.max(Array.from(openOverlays).indexOf(token.current), 0),\n () => 0,\n );\n\n const presenceRef = React.useCallback(() => {\n openOverlays.add(token.current);\n overlayListeners.forEach((notify) => notify());\n if (process.env.NODE_ENV !== \"production\" && openOverlays.size > OVERLAY_LAYERS.length && !saturationWarned) {\n saturationWarned = true;\n console.warn(\n `[great-lib-common] ${openOverlays.size} overlays visiveis, mas a escala de z so tem ${OVERLAY_LAYERS.length} faixas. ` +\n `Deste nivel em diante todos dividem a ultima faixa e o overlay de cima cai sob o conteudo de baixo. ` +\n `Se o empilhamento for legitimo, adicione uma faixa em ui/overlay/layers.tsx.`,\n );\n }\n return () => {\n openOverlays.delete(token.current);\n overlayListeners.forEach((notify) => notify());\n };\n }, []);\n\n return { layer: OVERLAY_LAYERS[Math.min(rank, OVERLAY_LAYERS.length - 1)], presenceRef };\n}\n\nexport function useDialogLayer(): DialogLayerClasses {\n return React.useContext(OverlayLayerContext);\n}\n\nexport function DialogLayer({ children }: { children: React.ReactNode }) {\n return children;\n}\n"],"mappings":";AAEA,YAAY,WAAW;AAEhB,MAAM,iBAAiB;AAAA,EAC5B,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AACvF;AAEO,MAAM,aAAa,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,OAAO;AAI3G,MAAM,eAAe,oBAAI,IAAY;AACrC,MAAM,mBAAmB,oBAAI,IAAgB;AAC7C,IAAI,mBAAmB;AAEvB,SAAS,kBAAkB,eAA2B;AACpD,mBAAiB,IAAI,aAAa;AAClC,SAAO,MAAM;AACX,qBAAiB,OAAO,aAAa;AAAA,EACvC;AACF;AAEO,MAAM,sBAAsB,MAAM,cAAkC,UAAU;AAE9E,SAAS,kBAAkB;AAChC,QAAM,QAAQ,MAAM,OAAO,CAAC,CAAC;AAC7B,QAAM,OAAO,MAAM;AAAA,IACjB;AAAA,IACA,MAAM,KAAK,IAAI,MAAM,KAAK,YAAY,EAAE,QAAQ,MAAM,OAAO,GAAG,CAAC;AAAA,IACjE,MAAM;AAAA,EACR;AAEA,QAAM,cAAc,MAAM,YAAY,MAAM;AAC1C,iBAAa,IAAI,MAAM,OAAO;AAC9B,qBAAiB,QAAQ,CAAC,WAAW,OAAO,CAAC;AAC7C,QAAI,QAAQ,IAAI,aAAa,gBAAgB,aAAa,OAAO,eAAe,UAAU,CAAC,kBAAkB;AAC3G,yBAAmB;AACnB,cAAQ;AAAA,QACN,sBAAsB,aAAa,IAAI,gDAAgD,eAAe,MAAM;AAAA,MAG9G;AAAA,IACF;AACA,WAAO,MAAM;AACX,mBAAa,OAAO,MAAM,OAAO;AACjC,uBAAiB,QAAQ,CAAC,WAAW,OAAO,CAAC;AAAA,IAC/C;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO,EAAE,OAAO,eAAe,KAAK,IAAI,MAAM,eAAe,SAAS,CAAC,CAAC,GAAG,YAAY;AACzF;AAEO,SAAS,iBAAqC;AACnD,SAAO,MAAM,WAAW,mBAAmB;AAC7C;AAEO,SAAS,YAAY,EAAE,SAAS,GAAkC;AACvE,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/ui/overlay/layers.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nexport const OVERLAY_LAYERS = [\n { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-[1003]\" },\n { overlay: \"z-[1010]\", content: \"z-[1011]\", popover: \"z-[1012]\", tooltip: \"z-[1013]\" },\n { overlay: \"z-[1020]\", content: \"z-[1021]\", popover: \"z-[1022]\", tooltip: \"z-[1023]\" },\n { overlay: \"z-[1030]\", content: \"z-[1031]\", popover: \"z-[1032]\", tooltip: \"z-[1033]\" },\n { overlay: \"z-[1040]\", content: \"z-[1041]\", popover: \"z-[1042]\", tooltip: \"z-[1043]\" },\n { overlay: \"z-[1050]\", content: \"z-[1051]\", popover: \"z-[1052]\", tooltip: \"z-[1053]\" },\n { overlay: \"z-[1060]\", content: \"z-[1061]\", popover: \"z-[1062]\", tooltip: \"z-[1063]\" },\n { overlay: \"z-[1070]\", content: \"z-[1071]\", popover: \"z-[1072]\", tooltip: \"z-[1073]\" },\n] as const;\n\nexport const ROOT_LAYER = { overlay: \"z-[1000]\", content: \"z-[1001]\", popover: \"z-[1002]\", tooltip: \"z-50\" } as const;\n\nexport type DialogLayerClasses = (typeof OVERLAY_LAYERS)[number] | typeof ROOT_LAYER;\n\nconst openOverlays = new Set<object>();\nconst overlayListeners = new Set<() => void>();\nlet saturationWarned = false;\n\nfunction notifyOverlays() {\n overlayListeners.forEach((listener) => listener());\n}\n\nfunction warnOnSaturation() {\n if (process.env.NODE_ENV === \"production\" || saturationWarned || openOverlays.size <= OVERLAY_LAYERS.length) return;\n saturationWarned = true;\n console.warn(\n `[great-lib-common] ${openOverlays.size} overlays visiveis, mas a escala de z so tem ${OVERLAY_LAYERS.length} faixas. ` +\n `Deste nivel em diante todos dividem a ultima faixa e o overlay de cima cai sob o conteudo de baixo. ` +\n `Se o empilhamento for legitimo, adicione uma faixa em ui/overlay/layers.tsx.`,\n );\n}\n\nexport const OverlayLayerContext = React.createContext<DialogLayerClasses>(ROOT_LAYER);\n\n/** Se a camada em volta é a do topo da pilha (ver `useTopLayerScrollIsolation`). */\nexport const OverlayTopContext = React.createContext<boolean>(true);\n\nexport function useIsTopOverlay(): boolean {\n return React.useContext(OverlayTopContext);\n}\n\ntype OverlayPosition = { layer: DialogLayerClasses; isTop: boolean };\n\nfunction readPosition(token: object): { rank: number; isTop: boolean } {\n const tokens = Array.from(openOverlays);\n const index = tokens.indexOf(token);\n return { rank: Math.max(index, 0), isTop: index === tokens.length - 1 };\n}\n\n/**\n * Faixa de z do overlay e se ele é o de cima da pilha.\n *\n * O `isTop` existe por causa do bloqueio de scroll: o Radix cancela wheel e touchmove de tudo\n * que não seja filho do conteúdo dele, e cada overlay vive no próprio portal. Com dois modais\n * ativos, o de baixo cancelaria a rolagem do de cima — então quem não está no topo deixa de ser\n * modal enquanto houver alguém acima.\n */\nexport function useOverlayPosition(open: boolean): OverlayPosition {\n const [position, setPosition] = React.useState({ rank: 0, isTop: true });\n\n React.useLayoutEffect(() => {\n if (!open) return;\n\n const token = {};\n const sync = () => setPosition(readPosition(token));\n\n overlayListeners.add(sync);\n openOverlays.add(token);\n notifyOverlays();\n warnOnSaturation();\n\n return () => {\n overlayListeners.delete(sync);\n openOverlays.delete(token);\n notifyOverlays();\n };\n }, [open]);\n\n return {\n layer: OVERLAY_LAYERS[Math.min(position.rank, OVERLAY_LAYERS.length - 1)],\n isTop: position.isTop,\n };\n}\n\nexport function useOverlayLayer(open: boolean): DialogLayerClasses {\n return useOverlayPosition(open).layer;\n}\n\nexport function useDialogLayer(): DialogLayerClasses {\n return React.useContext(OverlayLayerContext);\n}\n\nexport function DialogLayer({ children }: { children: React.ReactNode }) {\n return children;\n}\n\n/**\n * Isola a rolagem desta camada do bloqueio de scroll das camadas de baixo.\n *\n * O bloqueio do Radix escuta wheel e touchmove no document e cancela tudo que não seja filho do\n * conteúdo dele. Cada overlay vive no próprio portal, então o modal de baixo cancelava a rolagem\n * do drawer de cima — e de um jeito traiçoeiro: evento avulso passava, rajada de trackpad era\n * cancelada inteira. Parar a propagação na captura impede que aquele ouvinte chegue a ver o\n * evento, e o navegador rola normalmente.\n *\n * O custo é que `onWheel`/`onTouchMove` de React dentro desta camada deixam de receber esses dois\n * eventos — nada na lib depende disso (listas paginam por `scroll` e por sentinela).\n */\n/** Portais de conteúdo flutuante do Radix que acompanham a camada aberta. */\nconst FLOATING_CONTENT_SELECTOR = [\n \"[data-radix-popper-content-wrapper]\",\n \"[data-radix-menu-content]\",\n '[data-slot=\"select-content\"]',\n '[data-slot=\"popover-content\"]',\n '[data-slot=\"dropdown-menu-content\"]',\n '[data-slot=\"command-list\"]',\n '[role=\"listbox\"]',\n '[role=\"menu\"]',\n].join(\",\");\n\nexport function useTopLayerScrollIsolation(\n ref: React.RefObject<HTMLElement | null>,\n enabled: boolean,\n) {\n React.useEffect(() => {\n if (!enabled) return;\n\n const stopForThisLayer = (event: Event) => {\n const target = event.target as Node | null;\n if (!target) return;\n\n // Conteúdo flutuante (select, popover, menu) abre em portal próprio, fora do conteúdo da\n // camada, mas pertence a ela — sem isto, lista longa de select dentro do modal não rolava.\n const isFloatingContent =\n target instanceof Element && target.closest(FLOATING_CONTENT_SELECTOR) !== null;\n\n if (isFloatingContent || ref.current?.contains(target)) event.stopPropagation();\n };\n\n const options = { capture: true } as const;\n document.addEventListener(\"wheel\", stopForThisLayer, options);\n document.addEventListener(\"touchmove\", stopForThisLayer, options);\n\n return () => {\n document.removeEventListener(\"wheel\", stopForThisLayer, options);\n document.removeEventListener(\"touchmove\", stopForThisLayer, options);\n };\n }, [ref, enabled]);\n}\n"],"mappings":";AAEA,YAAY,WAAW;AAEhB,MAAM,iBAAiB;AAAA,EAC5B,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY,SAAS,YAAY,SAAS,WAAW;AAAA,EACrF,EAAE,SAAS,YAAY,SAAS,YAAY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HubFlow2["REACTIVATE"] = "reactivate";
5
+ AccountHubFlow2["RECEIPT"] = "receipt";
6
+ AccountHubFlow2["CREATE_PROJECT"] = "create-project";
7
+ AccountHubFlow2["ADD_USER"] = "add-user";
8
+ return AccountHubFlow2;
9
+ })(AccountHubFlow || {});
10
+ export {
11
+ AccountHubFlow
12
+ };
13
+ //# sourceMappingURL=AccountHubFlow.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/enums/AccountHubFlow.ts"],"sourcesContent":["export enum AccountHubFlow {\n PLANS = 'plans',\n ADDONS = 'addons',\n REACTIVATE = 'reactivate',\n RECEIPT = 'receipt',\n CREATE_PROJECT = 'create-project',\n ADD_USER = 'add-user',\n}\n"],"mappings":"AAAO,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,WAAQ;AACR,EAAAA,gBAAA,YAAS;AACT,EAAAA,gBAAA,gBAAa;AACb,EAAAA,gBAAA,aAAU;AACV,EAAAA,gBAAA,oBAAiB;AACjB,EAAAA,gBAAA,cAAW;AAND,SAAAA;AAAA,GAAA;","names":["AccountHubFlow"]}
@@ -0,0 +1,22 @@
1
+ var DateFilterPeriod = /* @__PURE__ */ ((DateFilterPeriod2) => {
2
+ DateFilterPeriod2["TODAY"] = "TODAY";
3
+ DateFilterPeriod2["YESTERDAY"] = "YESTERDAY";
4
+ DateFilterPeriod2["LAST_7_DAYS"] = "LAST_7_DAYS";
5
+ DateFilterPeriod2["LAST_30_DAYS"] = "LAST_30_DAYS";
6
+ DateFilterPeriod2["LAST_MONTH"] = "LAST_MONTH";
7
+ DateFilterPeriod2["ALL_TIME"] = "ALL_TIME";
8
+ return DateFilterPeriod2;
9
+ })(DateFilterPeriod || {});
10
+ const DATE_FILTER_PERIODS = [
11
+ "TODAY" /* TODAY */,
12
+ "YESTERDAY" /* YESTERDAY */,
13
+ "LAST_7_DAYS" /* LAST_7_DAYS */,
14
+ "LAST_30_DAYS" /* LAST_30_DAYS */,
15
+ "LAST_MONTH" /* LAST_MONTH */,
16
+ "ALL_TIME" /* ALL_TIME */
17
+ ];
18
+ export {
19
+ DATE_FILTER_PERIODS,
20
+ DateFilterPeriod
21
+ };
22
+ //# sourceMappingURL=DateFilterPeriod.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/enums/DateFilterPeriod.ts"],"sourcesContent":["export enum DateFilterPeriod {\n TODAY = 'TODAY',\n YESTERDAY = 'YESTERDAY',\n LAST_7_DAYS = 'LAST_7_DAYS',\n LAST_30_DAYS = 'LAST_30_DAYS',\n LAST_MONTH = 'LAST_MONTH',\n ALL_TIME = 'ALL_TIME',\n}\n\nexport const DATE_FILTER_PERIODS = [\n DateFilterPeriod.TODAY,\n DateFilterPeriod.YESTERDAY,\n DateFilterPeriod.LAST_7_DAYS,\n DateFilterPeriod.LAST_30_DAYS,\n DateFilterPeriod.LAST_MONTH,\n DateFilterPeriod.ALL_TIME,\n] as const;\n"],"mappings":"AAAO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,WAAQ;AACR,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,iBAAc;AACd,EAAAA,kBAAA,kBAAe;AACf,EAAAA,kBAAA,gBAAa;AACb,EAAAA,kBAAA,cAAW;AAND,SAAAA;AAAA,GAAA;AASL,MAAM,sBAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["DateFilterPeriod"]}
@@ -0,0 +1,11 @@
1
+ var WorkspaceSectionType = /* @__PURE__ */ ((WorkspaceSectionType2) => {
2
+ WorkspaceSectionType2["SUBSCRIPTION"] = "subscription";
3
+ WorkspaceSectionType2["PROJECTS"] = "projects";
4
+ WorkspaceSectionType2["TEAM"] = "team";
5
+ WorkspaceSectionType2["AFFILIATES"] = "affiliates";
6
+ return WorkspaceSectionType2;
7
+ })(WorkspaceSectionType || {});
8
+ export {
9
+ WorkspaceSectionType
10
+ };
11
+ //# sourceMappingURL=WorkspaceSectionType.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/enums/WorkspaceSectionType.ts"],"sourcesContent":["export enum WorkspaceSectionType {\n SUBSCRIPTION = 'subscription',\n PROJECTS = 'projects',\n TEAM = 'team',\n AFFILIATES = 'affiliates',\n}\n"],"mappings":"AAAO,IAAK,uBAAL,kBAAKA,0BAAL;AACL,EAAAA,sBAAA,kBAAe;AACf,EAAAA,sBAAA,cAAW;AACX,EAAAA,sBAAA,UAAO;AACP,EAAAA,sBAAA,gBAAa;AAJH,SAAAA;AAAA,GAAA;","names":["WorkspaceSectionType"]}
package/dist/handlers.mjs CHANGED
@@ -13,29 +13,53 @@ import { createFindProjectHandler } from "./modules/projects/handlers/find-proje
13
13
  import { createListProjectUsersHandler } from "./modules/projects/handlers/list-project-users.handler";
14
14
  import { createListAvailableUsersHandler } from "./modules/projects/handlers/list-available-users.handler";
15
15
  import { createListAllAccountUsersHandler } from "./modules/projects/handlers/list-all-account-users.handler";
16
+ import { createListAccountMembersHandler } from "./modules/accounts/handlers/list-account-members.handler";
16
17
  import { createListSubscriptionsHandler } from "./modules/subscriptions/handlers/list-subscriptions.handler";
17
18
  import { createCurrentSubscriptionHandler } from "./modules/subscriptions/handlers/current-subscription.handler";
18
19
  import { createFreezeNoticeHandler } from "./modules/subscriptions/handlers/freeze-notice.handler";
19
20
  import { createListMessagesHandler } from "./modules/users/handlers/list-messages.handler";
21
+ import { createCurrentAffiliateHandler } from "./modules/affiliates/handlers/current-affiliate.handler";
22
+ import { createAffiliateReportAnalyticsHandler } from "./modules/affiliates/handlers/affiliate-report-analytics.handler";
23
+ import { createListAffiliateTransactionsHandler } from "./modules/affiliates/handlers/list-affiliate-transactions.handler";
24
+ import { createListAffiliateCouponsHandler } from "./modules/affiliates/handlers/list-affiliate-coupons.handler";
25
+ import { createListAffiliateLeadsHandler } from "./modules/affiliates/handlers/list-affiliate-leads.handler";
26
+ import { createAffiliateWithdrawalLimitsHandler } from "./modules/affiliates/handlers/affiliate-withdrawal-limits.handler";
27
+ import { createPendingPixStatusHandler } from "./modules/subscriptions/handlers/pending-pix-status.handler";
28
+ import { createListIaCreditOperationsHandler } from "./modules/ia-credits/handlers/list-ia-credit-operations.handler";
29
+ import { createFindCouponByIdHandler } from "./modules/coupons/handlers/find-coupon-by-id.handler";
30
+ import { createFindCouponByCodeHandler } from "./modules/coupons/handlers/find-coupon-by-code.handler";
31
+ import { createCountDomainsHandler } from "./modules/domains/handlers/count-domains.handler";
20
32
  export {
33
+ createAffiliateReportAnalyticsHandler,
34
+ createAffiliateWithdrawalLimitsHandler,
35
+ createCountDomainsHandler,
21
36
  createCountPagesHandler,
37
+ createCurrentAffiliateHandler,
22
38
  createCurrentSubscriptionHandler,
23
39
  createFindCardByIdHandler,
24
40
  createFindChargeByIdHandler,
41
+ createFindCouponByCodeHandler,
42
+ createFindCouponByIdHandler,
25
43
  createFindPlanByIdHandler,
26
44
  createFindProjectHandler,
27
45
  createFreezeNoticeHandler,
28
46
  createGetAiCreditsOfferEligibilityHandler,
47
+ createListAccountMembersHandler,
48
+ createListAffiliateCouponsHandler,
49
+ createListAffiliateLeadsHandler,
50
+ createListAffiliateTransactionsHandler,
29
51
  createListAllAccountUsersHandler,
30
52
  createListAvailableUsersHandler,
31
53
  createListCardsHandler,
32
54
  createListChargesHandler,
55
+ createListIaCreditOperationsHandler,
33
56
  createListIaCreditsHandler,
34
57
  createListMessagesHandler,
35
58
  createListPlansHandler,
36
59
  createListProjectUsersHandler,
37
60
  createListProjectsHandler,
38
61
  createListSubscriptionsHandler,
62
+ createPendingPixStatusHandler,
39
63
  createPurchaseIaCreditsHandler
40
64
  };
41
65
  //# sourceMappingURL=handlers.mjs.map