@gusto/embedded-react-sdk 0.54.0 → 0.54.1

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 (168) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/components/Common/Loading/Loading.d.ts +6 -1
  3. package/dist/components/Common/Loading/Loading.js +13 -12
  4. package/dist/components/Common/Loading/Loading.js.map +1 -1
  5. package/dist/components/Common/Loading/Loading.module.scss.js +1 -1
  6. package/dist/components/Common/PayrollLoading/PayrollLoading.js +1 -1
  7. package/dist/components/Common/PayrollLoading/PayrollLoading.js.map +1 -1
  8. package/dist/components/Common/UI/Alert/Alert.js +8 -8
  9. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  10. package/dist/components/Common/UI/Alert/Alert.module.scss.js +18 -16
  11. package/dist/components/Common/UI/Alert/Alert.module.scss.js.map +1 -1
  12. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  13. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  14. package/dist/components/Common/UI/Menu/Menu.js +19 -18
  15. package/dist/components/Common/UI/Menu/Menu.js.map +1 -1
  16. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  17. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  19. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
  20. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
  22. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  23. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
  24. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  25. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  26. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  27. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
  28. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
  29. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  30. package/dist/components/Company/Industry/Context.js +6 -8
  31. package/dist/components/Company/Industry/Context.js.map +1 -1
  32. package/dist/components/Company/Industry/Industry.js +2 -2
  33. package/dist/components/Company/Industry/Industry.js.map +1 -1
  34. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
  35. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  36. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
  37. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  38. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +20 -19
  39. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  40. package/dist/components/Company/OnboardingOverview/context.js +3 -5
  41. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  42. package/dist/components/Company/PaySchedule/PaySchedule.js +20 -19
  43. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  44. package/dist/components/Company/PaySchedule/PayScheduleForm.js +29 -28
  45. package/dist/components/Company/PaySchedule/PayScheduleForm.js.map +1 -1
  46. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.d.ts +1 -1
  47. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
  48. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js.map +1 -1
  49. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js +24 -21
  50. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/payScheduleSchema.js.map +1 -1
  51. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js +11 -11
  52. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -1
  53. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
  54. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  55. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
  56. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  57. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js +14 -13
  58. package/dist/components/Company/StateTaxes/TaxRateManagement/TaxRateHistorySection.js.map +1 -1
  59. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -5
  60. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  61. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js +22 -21
  62. package/dist/components/Contractor/ContractorList/management/ManagementContractorListView.js.map +1 -1
  63. package/dist/components/Contractor/Documents/shared/SignatureForm/useContractorSignatureForm/fields.js +8 -8
  64. package/dist/components/Contractor/Landing/Landing.js +30 -29
  65. package/dist/components/Contractor/Landing/Landing.js.map +1 -1
  66. package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js +18 -17
  67. package/dist/components/Contractor/OnboardingSummary/OnboardingSummary.js.map +1 -1
  68. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/fields.js +1 -1
  69. package/dist/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.d.ts +41 -0
  70. package/dist/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.js +175 -0
  71. package/dist/components/Contractor/Payments/CreateHistoricalPayment/CreateHistoricalPayment.js.map +1 -0
  72. package/dist/components/Contractor/Payments/CreateHistoricalPayment/index.d.ts +1 -0
  73. package/dist/components/Contractor/Payments/CreateHistoricalPayment/useFormDictionary.d.ts +18 -0
  74. package/dist/components/Contractor/Payments/{HistoricalPaymentAmounts → CreateHistoricalPayment}/useFormDictionary.js +37 -7
  75. package/dist/components/Contractor/Payments/CreateHistoricalPayment/useFormDictionary.js.map +1 -0
  76. package/dist/components/Contractor/Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.d.ts +30 -0
  77. package/dist/components/Contractor/Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.js +56 -0
  78. package/dist/components/Contractor/Payments/HistoricalPaymentSummary/HistoricalPaymentSummary.js.map +1 -0
  79. package/dist/components/Contractor/Payments/HistoricalPaymentSummary/index.d.ts +1 -0
  80. package/dist/components/Contractor/Payments/HistoricalPaymentSummary/useFormDictionary.d.ts +9 -0
  81. package/dist/components/Contractor/Payments/HistoricalPaymentSummary/useFormDictionary.js +33 -0
  82. package/dist/components/Contractor/Payments/HistoricalPaymentSummary/useFormDictionary.js.map +1 -0
  83. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +46 -131
  84. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  85. package/dist/components/Contractor/Payments/PaymentSummary/useFormDictionary.d.ts +9 -0
  86. package/dist/components/Contractor/Payments/PaymentSummary/useFormDictionary.js +36 -0
  87. package/dist/components/Contractor/Payments/PaymentSummary/useFormDictionary.js.map +1 -0
  88. package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.d.ts +83 -0
  89. package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.js +124 -0
  90. package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/PaymentSummaryBlock.js.map +1 -0
  91. package/dist/components/Contractor/Payments/shared/PaymentSummaryBlock/index.d.ts +1 -0
  92. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/fields.js +16 -16
  93. package/dist/components/Contractor/exports/contractorManagement.d.ts +2 -2
  94. package/dist/components/Contractor/exports/contractorManagement.js +20 -20
  95. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
  96. package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
  97. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
  98. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
  99. package/dist/components/Employee/Documents/management/DocumentManager.js +2 -1
  100. package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
  101. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  102. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  103. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
  104. package/dist/components/Employee/FederalTaxes/shared/FederalTaxesView.js +1 -1
  105. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
  106. package/dist/components/Employee/Landing/Landing.js +31 -30
  107. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  108. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +59 -58
  109. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  110. package/dist/components/Employee/PaymentMethod/management/PaymentMethodBankForm.js +4 -4
  111. package/dist/components/Employee/PaymentMethod/onboarding/BankForm.js +4 -4
  112. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
  113. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
  114. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
  115. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
  116. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
  117. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
  118. package/dist/components/Flow/Flow.js +27 -20
  119. package/dist/components/Flow/Flow.js.map +1 -1
  120. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +44 -44
  121. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  122. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +108 -108
  123. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  124. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +1 -1
  125. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  126. package/dist/components/Payroll/usePreparedPayrollData.js +8 -10
  127. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  128. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +23 -23
  129. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
  130. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.d.ts +4 -11
  131. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js +8 -8
  132. package/dist/contexts/LoadingIndicatorProvider/useLoadingIndicator.js.map +1 -1
  133. package/dist/i18n/I18n.js +7 -7
  134. package/dist/i18n/I18n.js.map +1 -1
  135. package/dist/i18n/en/Company.PaySchedule.json.js +5 -5
  136. package/dist/i18n/en/Company.StateTaxes.json.js +1 -1
  137. package/dist/i18n/en/Company.TimeOff.EmployeeTable.json.js +20 -18
  138. package/dist/i18n/en/Company.TimeOff.EmployeeTable.json.js.map +1 -1
  139. package/dist/i18n/en/Contractor.ManagementContractorList.json.js +46 -44
  140. package/dist/i18n/en/Contractor.ManagementContractorList.json.js.map +1 -1
  141. package/dist/i18n/en/Contractor.Payments.CreateHistoricalPayment.json.js +36 -0
  142. package/dist/i18n/en/Contractor.Payments.CreateHistoricalPayment.json.js.map +1 -0
  143. package/dist/i18n/en/Contractor.Payments.HistoricalPaymentSummary.json.js +48 -0
  144. package/dist/i18n/en/Contractor.Payments.HistoricalPaymentSummary.json.js.map +1 -0
  145. package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js +7 -7
  146. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +29 -27
  147. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
  148. package/dist/i18n/types.d.ts +219 -105
  149. package/dist/shared/constants.d.ts +12 -4
  150. package/dist/shared/constants.js +23 -19
  151. package/dist/shared/constants.js.map +1 -1
  152. package/dist/style.css +1 -1
  153. package/docs/guides/endpoint-inventory.json +30 -1
  154. package/package.json +17 -16
  155. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/HistoricalPaymentAmounts.d.ts +0 -33
  156. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/HistoricalPaymentAmounts.js +0 -62
  157. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/HistoricalPaymentAmounts.js.map +0 -1
  158. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/index.d.ts +0 -1
  159. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/useFormDictionary.d.ts +0 -9
  160. package/dist/components/Contractor/Payments/HistoricalPaymentAmounts/useFormDictionary.js.map +0 -1
  161. package/dist/components/Contractor/Payments/HistoricalPaymentContractors/HistoricalPaymentContractors.d.ts +0 -27
  162. package/dist/components/Contractor/Payments/HistoricalPaymentContractors/HistoricalPaymentContractors.js +0 -56
  163. package/dist/components/Contractor/Payments/HistoricalPaymentContractors/HistoricalPaymentContractors.js.map +0 -1
  164. package/dist/components/Contractor/Payments/HistoricalPaymentContractors/index.d.ts +0 -1
  165. package/dist/i18n/en/Contractor.Payments.HistoricalPaymentAmounts.json.js +0 -36
  166. package/dist/i18n/en/Contractor.Payments.HistoricalPaymentAmounts.json.js.map +0 -1
  167. package/dist/i18n/en/Contractor.Payments.HistoricalPaymentContractors.json.js +0 -18
  168. package/dist/i18n/en/Contractor.Payments.HistoricalPaymentContractors.json.js.map +0 -1
@@ -1,19 +1,19 @@
1
- import { jsx as e, jsxs as a, Fragment as C } from "react/jsx-runtime";
2
- import { useTranslation as D } from "react-i18next";
3
- import { useEmployeesGetSuspense as v } from "@gusto/embedded-api/react-query/employeesGet";
4
- import { useEmployeesGetOnboardingStatusSuspense as A } from "@gusto/embedded-api/react-query/employeesGetOnboardingStatus";
5
- import y from "dompurify";
6
- import { useMemo as x } from "react";
7
- import { BaseComponent as L } from "../../Base/Base.js";
8
- import { useBase as T } from "../../Base/useBase.js";
1
+ import { jsx as e, jsxs as a, Fragment as v } from "react/jsx-runtime";
2
+ import { useTranslation as I } from "react-i18next";
3
+ import { useEmployeesGetSuspense as A } from "@gusto/embedded-api/react-query/employeesGet";
4
+ import { useEmployeesGetOnboardingStatusSuspense as L } from "@gusto/embedded-api/react-query/employeesGetOnboardingStatus";
5
+ import x from "dompurify";
6
+ import { useMemo as D } from "react";
7
+ import { BaseComponent as T } from "../../Base/Base.js";
8
+ import { useBase as B } from "../../Base/useBase.js";
9
9
  import { Flex as r } from "../../Common/Flex/Flex.js";
10
- import { ActionsLayout as p } from "../../Common/ActionsLayout/ActionsLayout.js";
11
- import { RequirementsList as B } from "../../Common/RequirementsList/RequirementsList.js";
12
- import { useComponentContext as P } from "../../../contexts/ComponentAdapter/useComponentContext.js";
13
- import { useI18n as R, useComponentDictionary as w } from "../../../i18n/I18n.js";
14
- import { EmployeeOnboardingStatus as u, EmployeeSelfOnboardingStatuses as G, componentEvents as f } from "../../../shared/constants.js";
15
- import { useFlow as F } from "../../Flow/useFlow.js";
16
- const M = [
10
+ import { ActionsLayout as u } from "../../Common/ActionsLayout/ActionsLayout.js";
11
+ import { RequirementsList as P } from "../../Common/RequirementsList/RequirementsList.js";
12
+ import { useComponentContext as R } from "../../../contexts/ComponentAdapter/useComponentContext.js";
13
+ import { useI18n as w, useComponentDictionary as G } from "../../../i18n/I18n.js";
14
+ import { EmployeeOnboardingStatus as f, EmployeeSelfOnboardingStatuses as F, componentEvents as g } from "../../../shared/constants.js";
15
+ import { useFlow as M } from "../../Flow/useFlow.js";
16
+ const q = [
17
17
  "personal_details",
18
18
  "compensation_details",
19
19
  "add_work_address",
@@ -24,98 +24,99 @@ const M = [
24
24
  "employee_form_signing",
25
25
  "file_new_hire_report",
26
26
  "admin_review"
27
- ], q = (n) => n !== void 0 && M.includes(n);
28
- function $(n) {
29
- return R("Employee.OnboardingSummary"), w("Employee.OnboardingSummary", n.dictionary), /* @__PURE__ */ e(L, { ...n, children: /* @__PURE__ */ e(j, { ...n, children: n.children }) });
27
+ ], $ = (t) => t !== void 0 && q.includes(t);
28
+ function j(t) {
29
+ return /* @__PURE__ */ e(T, { ...t, children: /* @__PURE__ */ e(k, { ...t, children: t.children }) });
30
30
  }
31
- const j = ({ employeeId: n, className: c, isAdmin: d = !1 }) => {
32
- const { onEvent: s } = T(), { t } = D("Employee.OnboardingSummary"), i = P(), {
33
- data: { employee: I }
34
- } = v({ employeeId: n }), { firstName: g, lastName: h } = I, { data: b } = A({ employeeId: n }), { onboardingStatus: m, onboardingSteps: l } = b.employeeOnboardingStatus, N = l?.length && l.findIndex((o) => o.required && !o.completed) > -1, E = m === u.ONBOARDING_COMPLETED || !N && m === u.SELF_ONBOARDING_PENDING_INVITE, S = m === u.SELF_ONBOARDING_PENDING_INVITE || m !== void 0 && G.has(m), _ = x(() => y.sanitize(g), [g]), O = x(() => y.sanitize(h), [h]);
35
- return /* @__PURE__ */ e("section", { className: c, children: /* @__PURE__ */ a(r, { flexDirection: "column", gap: 20, children: [
36
- /* @__PURE__ */ e(r, { alignItems: "center", flexDirection: "column", gap: 8, children: d ? E ? /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, alignItems: "center", children: [
37
- /* @__PURE__ */ e(i.Heading, { as: "h2", textAlign: "center", children: t("onboardedAdminSubtitle", {
38
- name: `${_} ${O}`,
31
+ const k = ({ employeeId: t, className: l, isAdmin: m = !1, dictionary: c }) => {
32
+ w("Employee.OnboardingSummary"), G("Employee.OnboardingSummary", c);
33
+ const { onEvent: p } = B(), { t: n } = I("Employee.OnboardingSummary"), i = R(), {
34
+ data: { employee: b }
35
+ } = A({ employeeId: t }), { firstName: h, lastName: E } = b, { data: N } = L({ employeeId: t }), { onboardingStatus: s, onboardingSteps: d } = N.employeeOnboardingStatus, C = d?.length && d.findIndex((o) => o.required && !o.completed) > -1, S = s === f.ONBOARDING_COMPLETED || !C && s === f.SELF_ONBOARDING_PENDING_INVITE, _ = s === f.SELF_ONBOARDING_PENDING_INVITE || s !== void 0 && F.has(s), O = D(() => x.sanitize(h), [h]), y = D(() => x.sanitize(E), [E]);
36
+ return /* @__PURE__ */ e("section", { className: l, children: /* @__PURE__ */ a(r, { flexDirection: "column", gap: 20, children: [
37
+ /* @__PURE__ */ e(r, { alignItems: "center", flexDirection: "column", gap: 8, children: m ? S ? /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, alignItems: "center", children: [
38
+ /* @__PURE__ */ e(i.Heading, { as: "h2", textAlign: "center", children: n("onboardedAdminSubtitle", {
39
+ name: `${O} ${y}`,
39
40
  interpolation: { escapeValue: !1 }
40
41
  }) }),
41
- /* @__PURE__ */ e(i.Text, { variant: "supporting", children: t("onboardedAdminDescription") })
42
- ] }) : S ? /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, alignItems: "center", children: [
43
- /* @__PURE__ */ e(i.Heading, { as: "h2", textAlign: "center", children: t("handedOffAdminSubtitle", {
44
- name: `${_} ${O}`,
42
+ /* @__PURE__ */ e(i.Text, { variant: "supporting", children: n("onboardedAdminDescription") })
43
+ ] }) : _ ? /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, alignItems: "center", children: [
44
+ /* @__PURE__ */ e(i.Heading, { as: "h2", textAlign: "center", children: n("handedOffAdminSubtitle", {
45
+ name: `${O} ${y}`,
45
46
  interpolation: { escapeValue: !1 }
46
47
  }) }),
47
- /* @__PURE__ */ e(i.Text, { variant: "supporting", children: t("handedOffAdminDescription") })
48
+ /* @__PURE__ */ e(i.Text, { variant: "supporting", children: n("handedOffAdminDescription") })
48
49
  ] }) : /* @__PURE__ */ e(
49
50
  i.Box,
50
51
  {
51
52
  header: /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, children: [
52
- /* @__PURE__ */ e(i.Heading, { as: "h2", children: t("missingRequirementsSubtitle") }),
53
- /* @__PURE__ */ e(i.Text, { variant: "supporting", children: t("missingRequirementsDescription") })
53
+ /* @__PURE__ */ e(i.Heading, { as: "h2", children: n("missingRequirementsSubtitle") }),
54
+ /* @__PURE__ */ e(i.Text, { variant: "supporting", children: n("missingRequirementsDescription") })
54
55
  ] }),
55
- footer: /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
56
+ footer: /* @__PURE__ */ e(u, { children: /* @__PURE__ */ e(
56
57
  i.Button,
57
58
  {
58
59
  variant: "secondary",
59
60
  onClick: () => {
60
- s(f.EMPLOYEES_LIST);
61
+ p(g.EMPLOYEES_LIST);
61
62
  },
62
- children: t("doneCta")
63
+ children: n("doneCta")
63
64
  }
64
65
  ) }),
65
- children: l && /* @__PURE__ */ e(
66
- B,
66
+ children: d && /* @__PURE__ */ e(
67
+ P,
67
68
  {
68
- requirements: l.filter(
69
- (o) => o.completed !== void 0 && q(o.id)
69
+ requirements: d.filter(
70
+ (o) => o.completed !== void 0 && $(o.id)
70
71
  ).map((o) => ({
71
72
  completed: o.completed,
72
- title: t(`steps.${o.id}`),
73
- description: t(`stepsDescriptions.${o.id}`)
73
+ title: n(`steps.${o.id}`),
74
+ description: n(`stepsDescriptions.${o.id}`)
74
75
  }))
75
76
  }
76
77
  )
77
78
  }
78
- ) : /* @__PURE__ */ e(C, { children: /* @__PURE__ */ a(r, { flexDirection: "column", gap: 20, alignItems: "center", children: [
79
+ ) : /* @__PURE__ */ e(v, { children: /* @__PURE__ */ a(r, { flexDirection: "column", gap: 20, alignItems: "center", children: [
79
80
  /* @__PURE__ */ a(r, { flexDirection: "column", gap: 4, alignItems: "center", children: [
80
- /* @__PURE__ */ e(i.Heading, { as: "h2", textAlign: "center", children: t("onboardedSelfSubtitle") }),
81
- /* @__PURE__ */ e(i.Text, { variant: "supporting", children: t("onboardedSelfDescription") })
81
+ /* @__PURE__ */ e(i.Heading, { as: "h2", textAlign: "center", children: n("onboardedSelfSubtitle") }),
82
+ /* @__PURE__ */ e(i.Text, { variant: "supporting", children: n("onboardedSelfDescription") })
82
83
  ] }),
83
- /* @__PURE__ */ e(p, { justifyContent: "center", children: /* @__PURE__ */ e(
84
+ /* @__PURE__ */ e(u, { justifyContent: "center", children: /* @__PURE__ */ e(
84
85
  i.Button,
85
86
  {
86
87
  variant: "secondary",
87
88
  onClick: () => {
88
- s(f.EMPLOYEE_ONBOARDING_DONE);
89
+ p(g.EMPLOYEE_ONBOARDING_DONE);
89
90
  },
90
- children: t("doneCta")
91
+ children: n("doneCta")
91
92
  }
92
93
  ) })
93
94
  ] }) }) }),
94
- d && (E || S) && /* @__PURE__ */ e(p, { justifyContent: "center", children: /* @__PURE__ */ e(
95
+ m && (S || _) && /* @__PURE__ */ e(u, { justifyContent: "center", children: /* @__PURE__ */ e(
95
96
  i.Button,
96
97
  {
97
98
  variant: "secondary",
98
99
  onClick: () => {
99
- s(f.EMPLOYEES_LIST);
100
+ p(g.EMPLOYEES_LIST);
100
101
  },
101
- children: t("doneCta")
102
+ children: n("doneCta")
102
103
  }
103
104
  ) })
104
105
  ] }) });
105
- }, ie = () => {
106
- const { employeeId: n, onEvent: c, isAdmin: d } = F(), { t: s } = D("common");
107
- if (!n)
106
+ }, oe = () => {
107
+ const { employeeId: t, onEvent: l, isAdmin: m } = M(), { t: c } = I("common");
108
+ if (!t)
108
109
  throw new Error(
109
- s("errors.missingParamsOrContext", {
110
+ c("errors.missingParamsOrContext", {
110
111
  component: "Summary",
111
112
  param: "employeeId",
112
113
  provider: "FlowProvider"
113
114
  })
114
115
  );
115
- return /* @__PURE__ */ e($, { employeeId: n, onEvent: c, isAdmin: d });
116
+ return /* @__PURE__ */ e(j, { employeeId: t, onEvent: l, isAdmin: m });
116
117
  };
117
118
  export {
118
- $ as OnboardingSummary,
119
- ie as OnboardingSummaryContextual
119
+ j as OnboardingSummary,
120
+ oe as OnboardingSummaryContextual
120
121
  };
121
122
  //# sourceMappingURL=OnboardingSummary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardingSummary.js","sources":["../../../../src/components/Employee/OnboardingSummary/OnboardingSummary.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useEmployeesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/employeesGetOnboardingStatus'\nimport DOMPurify from 'dompurify'\nimport { useMemo } from 'react'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { Flex, ActionsLayout } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nconst KNOWN_STEP_IDS = [\n 'personal_details',\n 'compensation_details',\n 'add_work_address',\n 'add_home_address',\n 'federal_tax_setup',\n 'state_tax_setup',\n 'direct_deposit_setup',\n 'employee_form_signing',\n 'file_new_hire_report',\n 'admin_review',\n] as const\n\ntype KnownStepId = (typeof KNOWN_STEP_IDS)[number]\n\nconst isKnownStepId = (id: string | undefined): id is KnownStepId =>\n id !== undefined && (KNOWN_STEP_IDS as readonly string[]).includes(id)\n\n/**\n * Props for {@link OnboardingSummary}.\n *\n * @public\n */\nexport interface OnboardingSummaryProps extends BaseComponentInterface<'Employee.OnboardingSummary'> {\n /** The associated employee identifier. */\n employeeId: string\n /** When `true`, renders the admin-facing view of the onboarding summary. Defaults to `false`. */\n isAdmin?: boolean\n}\n\n/**\n * Displays a summary of an employee's onboarding status, listing completed and\n * outstanding steps. Rendered as a standalone step inside `OnboardingFlow`.\n *\n * @public\n */\nexport function OnboardingSummary(props: OnboardingSummaryProps) {\n useI18n('Employee.OnboardingSummary')\n useComponentDictionary('Employee.OnboardingSummary', props.dictionary)\n\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, className, isAdmin = false }: OnboardingSummaryProps) => {\n const { onEvent } = useBase()\n const { t } = useTranslation('Employee.OnboardingSummary')\n const Components = useComponentContext()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const { firstName, lastName } = employee!\n\n const { data } = useEmployeesGetOnboardingStatusSuspense({ employeeId })\n const { onboardingStatus, onboardingSteps } = data.employeeOnboardingStatus!\n\n const hasMissingRequirements =\n onboardingSteps?.length &&\n onboardingSteps.findIndex(step => step.required && !step.completed) > -1\n\n const isOnboardingCompleted =\n onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (!hasMissingRequirements &&\n onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE)\n\n const isEmployeeCompletingSelfOnboarding =\n onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE ||\n (onboardingStatus !== undefined && EmployeeSelfOnboardingStatuses.has(onboardingStatus))\n\n const sanitizedFirstName = useMemo(() => DOMPurify.sanitize(firstName), [firstName])\n const sanitizedLastName = useMemo(() => DOMPurify.sanitize(lastName), [lastName])\n\n return (\n <section className={className}>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n {isAdmin ? (\n isOnboardingCompleted ? (\n <Flex flexDirection=\"column\" gap={4} alignItems=\"center\">\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardedAdminSubtitle', {\n name: `${sanitizedFirstName} ${sanitizedLastName}`,\n interpolation: { escapeValue: false },\n })}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('onboardedAdminDescription')}\n </Components.Text>\n </Flex>\n ) : isEmployeeCompletingSelfOnboarding ? (\n <Flex flexDirection=\"column\" gap={4} alignItems=\"center\">\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('handedOffAdminSubtitle', {\n name: `${sanitizedFirstName} ${sanitizedLastName}`,\n interpolation: { escapeValue: false },\n })}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('handedOffAdminDescription')}\n </Components.Text>\n </Flex>\n ) : (\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {t('missingRequirementsSubtitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('missingRequirementsDescription')}\n </Components.Text>\n </Flex>\n }\n footer={\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEES_LIST)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n }\n >\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps\n .filter(\n (step): step is typeof step & { id: KnownStepId; completed: boolean } =>\n step.completed !== undefined && isKnownStepId(step.id),\n )\n .map(step => ({\n completed: step.completed,\n title: t(`steps.${step.id}`),\n description: t(`stepsDescriptions.${step.id}`),\n }))}\n />\n )}\n </Components.Box>\n )\n ) : (\n <>\n <Flex flexDirection=\"column\" gap={20} alignItems=\"center\">\n <Flex flexDirection=\"column\" gap={4} alignItems=\"center\">\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardedSelfSubtitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('onboardedSelfDescription')}\n </Components.Text>\n </Flex>\n <ActionsLayout justifyContent=\"center\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_DONE)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </>\n )}\n </Flex>\n\n {isAdmin && (isOnboardingCompleted || isEmployeeCompletingSelfOnboarding) && (\n <ActionsLayout justifyContent={'center'}>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEES_LIST)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n </Flex>\n </section>\n )\n}\n\n/** @internal */\nexport const OnboardingSummaryContextual = () => {\n const { employeeId, onEvent, isAdmin } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Summary',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <OnboardingSummary employeeId={employeeId} onEvent={onEvent} isAdmin={isAdmin} />\n}\n"],"names":["KNOWN_STEP_IDS","isKnownStepId","id","OnboardingSummary","props","useI18n","useComponentDictionary","jsx","BaseComponent","Root","employeeId","className","isAdmin","onEvent","useBase","useTranslation","Components","useComponentContext","employee","useEmployeesGetSuspense","firstName","lastName","data","useEmployeesGetOnboardingStatusSuspense","onboardingStatus","onboardingSteps","hasMissingRequirements","step","isOnboardingCompleted","EmployeeOnboardingStatus","isEmployeeCompletingSelfOnboarding","EmployeeSelfOnboardingStatuses","sanitizedFirstName","useMemo","DOMPurify","sanitizedLastName","jsxs","Flex","ActionsLayout","componentEvents","RequirementsList","OnboardingSummaryContextual","useFlow","t"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAMA,IAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAIMC,IAAgB,CAACC,MACrBA,MAAO,UAAcF,EAAqC,SAASE,CAAE;AAoBhE,SAASC,EAAkBC,GAA+B;AAC/D,SAAAC,EAAQ,4BAA4B,GACpCC,EAAuB,8BAA8BF,EAAM,UAAU,GAGnE,gBAAAG,EAACC,GAAA,EAAe,GAAGJ,GACjB,UAAA,gBAAAG,EAACE,KAAM,GAAGL,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMK,IAAO,CAAC,EAAE,YAAAC,GAAY,WAAAC,GAAW,SAAAC,IA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AAAC,EAAA,IAAM5B,EAAe,QAAQ;AAErC,MAAI,CAACL;AACH,UAAM,IAAI;AAAA,MACRiC,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SAAO,gBAAApC,EAACJ,GAAA,EAAkB,YAAAO,GAAwB,SAAAG,GAAkB,SAAAD,EAAA,CAAkB;AACxF;"}
1
+ {"version":3,"file":"OnboardingSummary.js","sources":["../../../../src/components/Employee/OnboardingSummary/OnboardingSummary.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { useEmployeesGetOnboardingStatusSuspense } from '@gusto/embedded-api/react-query/employeesGetOnboardingStatus'\nimport DOMPurify from 'dompurify'\nimport { useMemo } from 'react'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlowComponents'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { Flex, ActionsLayout } from '@/components/Common'\nimport { RequirementsList } from '@/components/Common/RequirementsList/RequirementsList'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nconst KNOWN_STEP_IDS = [\n 'personal_details',\n 'compensation_details',\n 'add_work_address',\n 'add_home_address',\n 'federal_tax_setup',\n 'state_tax_setup',\n 'direct_deposit_setup',\n 'employee_form_signing',\n 'file_new_hire_report',\n 'admin_review',\n] as const\n\ntype KnownStepId = (typeof KNOWN_STEP_IDS)[number]\n\nconst isKnownStepId = (id: string | undefined): id is KnownStepId =>\n id !== undefined && (KNOWN_STEP_IDS as readonly string[]).includes(id)\n\n/**\n * Props for {@link OnboardingSummary}.\n *\n * @public\n */\nexport interface OnboardingSummaryProps extends BaseComponentInterface<'Employee.OnboardingSummary'> {\n /** The associated employee identifier. */\n employeeId: string\n /** When `true`, renders the admin-facing view of the onboarding summary. Defaults to `false`. */\n isAdmin?: boolean\n}\n\n/**\n * Displays a summary of an employee's onboarding status, listing completed and\n * outstanding steps. Rendered as a standalone step inside `OnboardingFlow`.\n *\n * @public\n */\nexport function OnboardingSummary(props: OnboardingSummaryProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({ employeeId, className, isAdmin = false, dictionary }: OnboardingSummaryProps) => {\n useI18n('Employee.OnboardingSummary')\n useComponentDictionary('Employee.OnboardingSummary', dictionary)\n const { onEvent } = useBase()\n const { t } = useTranslation('Employee.OnboardingSummary')\n const Components = useComponentContext()\n\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const { firstName, lastName } = employee!\n\n const { data } = useEmployeesGetOnboardingStatusSuspense({ employeeId })\n const { onboardingStatus, onboardingSteps } = data.employeeOnboardingStatus!\n\n const hasMissingRequirements =\n onboardingSteps?.length &&\n onboardingSteps.findIndex(step => step.required && !step.completed) > -1\n\n const isOnboardingCompleted =\n onboardingStatus === EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (!hasMissingRequirements &&\n onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE)\n\n const isEmployeeCompletingSelfOnboarding =\n onboardingStatus === EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE ||\n (onboardingStatus !== undefined && EmployeeSelfOnboardingStatuses.has(onboardingStatus))\n\n const sanitizedFirstName = useMemo(() => DOMPurify.sanitize(firstName), [firstName])\n const sanitizedLastName = useMemo(() => DOMPurify.sanitize(lastName), [lastName])\n\n return (\n <section className={className}>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex alignItems=\"center\" flexDirection=\"column\" gap={8}>\n {isAdmin ? (\n isOnboardingCompleted ? (\n <Flex flexDirection=\"column\" gap={4} alignItems=\"center\">\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardedAdminSubtitle', {\n name: `${sanitizedFirstName} ${sanitizedLastName}`,\n interpolation: { escapeValue: false },\n })}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('onboardedAdminDescription')}\n </Components.Text>\n </Flex>\n ) : isEmployeeCompletingSelfOnboarding ? (\n <Flex flexDirection=\"column\" gap={4} alignItems=\"center\">\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('handedOffAdminSubtitle', {\n name: `${sanitizedFirstName} ${sanitizedLastName}`,\n interpolation: { escapeValue: false },\n })}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('handedOffAdminDescription')}\n </Components.Text>\n </Flex>\n ) : (\n <Components.Box\n header={\n <Flex flexDirection=\"column\" gap={4}>\n <Components.Heading as=\"h2\">\n {t('missingRequirementsSubtitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('missingRequirementsDescription')}\n </Components.Text>\n </Flex>\n }\n footer={\n <ActionsLayout>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEES_LIST)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n }\n >\n {onboardingSteps && (\n <RequirementsList\n requirements={onboardingSteps\n .filter(\n (step): step is typeof step & { id: KnownStepId; completed: boolean } =>\n step.completed !== undefined && isKnownStepId(step.id),\n )\n .map(step => ({\n completed: step.completed,\n title: t(`steps.${step.id}`),\n description: t(`stepsDescriptions.${step.id}`),\n }))}\n />\n )}\n </Components.Box>\n )\n ) : (\n <>\n <Flex flexDirection=\"column\" gap={20} alignItems=\"center\">\n <Flex flexDirection=\"column\" gap={4} alignItems=\"center\">\n <Components.Heading as=\"h2\" textAlign=\"center\">\n {t('onboardedSelfSubtitle')}\n </Components.Heading>\n <Components.Text variant=\"supporting\">\n {t('onboardedSelfDescription')}\n </Components.Text>\n </Flex>\n <ActionsLayout justifyContent=\"center\">\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_DONE)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </>\n )}\n </Flex>\n\n {isAdmin && (isOnboardingCompleted || isEmployeeCompletingSelfOnboarding) && (\n <ActionsLayout justifyContent={'center'}>\n <Components.Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(componentEvents.EMPLOYEES_LIST)\n }}\n >\n {t('doneCta')}\n </Components.Button>\n </ActionsLayout>\n )}\n </Flex>\n </section>\n )\n}\n\n/** @internal */\nexport const OnboardingSummaryContextual = () => {\n const { employeeId, onEvent, isAdmin } = useFlow<OnboardingContextInterface>()\n const { t } = useTranslation('common')\n\n if (!employeeId) {\n throw new Error(\n t('errors.missingParamsOrContext', {\n component: 'Summary',\n param: 'employeeId',\n provider: 'FlowProvider',\n }),\n )\n }\n return <OnboardingSummary employeeId={employeeId} onEvent={onEvent} isAdmin={isAdmin} />\n}\n"],"names":["KNOWN_STEP_IDS","isKnownStepId","id","OnboardingSummary","props","jsx","BaseComponent","Root","employeeId","className","isAdmin","dictionary","useI18n","useComponentDictionary","onEvent","useBase","t","useTranslation","Components","useComponentContext","employee","useEmployeesGetSuspense","firstName","lastName","data","useEmployeesGetOnboardingStatusSuspense","onboardingStatus","onboardingSteps","hasMissingRequirements","step","isOnboardingCompleted","EmployeeOnboardingStatus","isEmployeeCompletingSelfOnboarding","EmployeeSelfOnboardingStatuses","sanitizedFirstName","useMemo","DOMPurify","sanitizedLastName","jsxs","Flex","ActionsLayout","componentEvents","RequirementsList","OnboardingSummaryContextual","useFlow"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAMA,IAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAIMC,IAAgB,CAACC,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AA,EAAc,gBAAgB,UAC7B,UAAA,gBAAAnC;AAAA,MAACa,EAAW;AAAA,MAAX;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAAJ,EAAQ2B,EAAgB,cAAc;AAAA,QACxC;AAAA,QAEC,YAAE,SAAS;AAAA,MAAA;AAAA,IAAA,EACd,CACF;AAAA,EAAA,EAAA,CAEJ,EAAA,CACF;AAEJ,GAGaE,KAA8B,MAAM;AAC/C,QAAM,EAAE,YAAAnC,GAAY,SAAAM,GAAS,SAAAJ,EAAA,IAAYkC,EAAA,GACnC,EAAE,GAAA5B,EAAA,IAAMC,EAAe,QAAQ;AAErC,MAAI,CAACT;AACH,UAAM,IAAI;AAAA,MACRQ,EAAE,iCAAiC;AAAA,QACjC,WAAW;AAAA,QACX,OAAO;AAAA,QACP,UAAU;AAAA,MAAA,CACX;AAAA,IAAA;AAGL,SAAO,gBAAAX,EAACF,GAAA,EAAkB,YAAAK,GAAwB,SAAAM,GAAkB,SAAAJ,EAAA,CAAkB;AACxF;"}
@@ -1,17 +1,17 @@
1
1
  import { jsxs as M, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as s } from "react-i18next";
3
3
  import { useManagementBankFormDictionary as p } from "./useFormDictionary.js";
4
- import { Flex as c } from "../../../Common/Flex/Flex.js";
5
- import { useComponentContext as _ } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
4
+ import { useComponentContext as c } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
5
  import { componentEvents as t } from "../../../../shared/constants.js";
6
+ import { Flex as _ } from "../../../Common/Flex/Flex.js";
7
7
  import { BankFormBody as l } from "../shared/BankFormBody/BankFormBody.js";
8
8
  function F({
9
9
  employeeId: e,
10
10
  onEvent: o,
11
11
  ...m
12
12
  }) {
13
- const r = p(), { t: a } = s("Employee.Management.PaymentMethodBankForm"), i = _();
14
- return /* @__PURE__ */ M(c, { flexDirection: "column", gap: 32, children: [
13
+ const r = p(), { t: a } = s("Employee.Management.PaymentMethodBankForm"), i = c();
14
+ return /* @__PURE__ */ M(_, { flexDirection: "column", gap: 32, children: [
15
15
  /* @__PURE__ */ n(i.Heading, { as: "h1", styledAs: "h2", children: a("title") }),
16
16
  /* @__PURE__ */ n(
17
17
  l,
@@ -1,13 +1,13 @@
1
1
  import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as p } from "react-i18next";
3
3
  import { useOnboardingBankFormDictionary as d } from "./useFormDictionary.js";
4
- import { Flex as l } from "../../../Common/Flex/Flex.js";
5
- import { useComponentContext as f } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
4
+ import { useComponentContext as l } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
5
  import { componentEvents as r } from "../../../../shared/constants.js";
6
+ import { Flex as f } from "../../../Common/Flex/Flex.js";
7
7
  import { BankFormBody as C } from "../shared/BankFormBody/BankFormBody.js";
8
8
  function F({ employeeId: t, onEvent: o, ...m }) {
9
- const e = d(), { t: i } = p("Employee.PaymentMethod"), a = f();
10
- return /* @__PURE__ */ c(l, { flexDirection: "column", gap: 32, children: [
9
+ const e = d(), { t: i } = p("Employee.PaymentMethod"), a = l();
10
+ return /* @__PURE__ */ c(f, { flexDirection: "column", gap: 32, children: [
11
11
  /* @__PURE__ */ n(a.Heading, { as: "h1", styledAs: "h2", children: i("addBankAccountFormTitle") }),
12
12
  /* @__PURE__ */ n(
13
13
  C,
@@ -1,6 +1,6 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { TextInputHookField as o } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
3
2
  import { RadioGroupHookField as r } from "../../../../../partner-hook-utils/form/fields/RadioGroupHookField.js";
3
+ import { TextInputHookField as o } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
4
4
  function m(e) {
5
5
  return /* @__PURE__ */ n(o, { ...e, name: "name" });
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import { useWatch as f } from "react-hook-form";
3
- import { NumberInputHookField as s } from "../../../../../partner-hook-utils/form/fields/NumberInputHookField.js";
4
- import { SPLIT_BY as F } from "../../../../../shared/constants.js";
3
+ import { SPLIT_BY as s } from "../../../../../shared/constants.js";
4
+ import { NumberInputHookField as F } from "../../../../../partner-hook-utils/form/fields/NumberInputHookField.js";
5
5
  function B(t) {
6
6
  function n({
7
7
  label: r,
@@ -13,9 +13,9 @@ function B(t) {
13
13
  placeholder: c,
14
14
  FieldComponent: d
15
15
  }) {
16
- const l = o?.form.hookFormInternals.formMethods.control, p = f({ control: l, name: "splitBy" }) === F.amount ? "currency" : "percent";
16
+ const l = o?.form.hookFormInternals.formMethods.control, p = f({ control: l, name: "splitBy" }) === s.amount ? "currency" : "percent";
17
17
  return /* @__PURE__ */ a(
18
- s,
18
+ F,
19
19
  {
20
20
  name: `splitAmount.${t}`,
21
21
  formHookResult: o,
@@ -1,9 +1,9 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
+ import { useFormFieldsMetadataContext as r } from "../../../../../partner-hook-utils/form/FormFieldsMetadataContext.js";
3
+ import { usePlaceholderSSN as m, normalizeSSN as l } from "../../../../../helpers/ssn.js";
4
+ import { SwitchHookField as d } from "../../../../../partner-hook-utils/form/fields/SwitchHookField.js";
2
5
  import { TextInputHookField as a } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
3
- import { DatePickerHookField as r } from "../../../../../partner-hook-utils/form/fields/DatePickerHookField.js";
4
- import { SwitchHookField as m } from "../../../../../partner-hook-utils/form/fields/SwitchHookField.js";
5
- import { useFormFieldsMetadataContext as l } from "../../../../../partner-hook-utils/form/FormFieldsMetadataContext.js";
6
- import { usePlaceholderSSN as d, normalizeSSN as f } from "../../../../../helpers/ssn.js";
6
+ import { DatePickerHookField as f } from "../../../../../partner-hook-utils/form/fields/DatePickerHookField.js";
7
7
  function h(e) {
8
8
  return /* @__PURE__ */ t(a, { ...e, name: "firstName" });
9
9
  }
@@ -17,22 +17,22 @@ function x(e) {
17
17
  return /* @__PURE__ */ t(a, { ...e, name: "email" });
18
18
  }
19
19
  function H(e) {
20
- return /* @__PURE__ */ t(r, { ...e, name: "dateOfBirth" });
20
+ return /* @__PURE__ */ t(f, { ...e, name: "dateOfBirth" });
21
21
  }
22
22
  function O(e) {
23
- const n = l(), i = e.formHookResult?.form.fieldsMetadata ?? n?.metadata ?? {}, o = d(i.ssn?.hasRedactedValue);
23
+ const n = r(), i = e.formHookResult?.form.fieldsMetadata ?? n?.metadata ?? {}, o = m(i.ssn?.hasRedactedValue);
24
24
  return /* @__PURE__ */ t(
25
25
  a,
26
26
  {
27
27
  ...e,
28
28
  name: "ssn",
29
- transform: f,
29
+ transform: l,
30
30
  placeholder: o
31
31
  }
32
32
  );
33
33
  }
34
34
  function I(e) {
35
- return /* @__PURE__ */ t(m, { ...e, name: "selfOnboarding" });
35
+ return /* @__PURE__ */ t(d, { ...e, name: "selfOnboarding" });
36
36
  }
37
37
  export {
38
38
  H as DateOfBirthField,
@@ -1,8 +1,8 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { TextInputHookField as i } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
3
- import { SelectHookField as r } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
2
+ import { DatePickerHookField as r } from "../../../../../partner-hook-utils/form/fields/DatePickerHookField.js";
4
3
  import { CheckboxHookField as n } from "../../../../../partner-hook-utils/form/fields/CheckboxHookField.js";
5
- import { DatePickerHookField as o } from "../../../../../partner-hook-utils/form/fields/DatePickerHookField.js";
4
+ import { TextInputHookField as i } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
5
+ import { SelectHookField as o } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
6
6
  function d(e) {
7
7
  return /* @__PURE__ */ t(i, { ...e, name: "street1" });
8
8
  }
@@ -13,7 +13,7 @@ function F(e) {
13
13
  return /* @__PURE__ */ t(i, { ...e, name: "city" });
14
14
  }
15
15
  function p(e) {
16
- return /* @__PURE__ */ t(r, { ...e, name: "state" });
16
+ return /* @__PURE__ */ t(o, { ...e, name: "state" });
17
17
  }
18
18
  function k(e) {
19
19
  return /* @__PURE__ */ t(i, { ...e, name: "zip" });
@@ -22,7 +22,7 @@ function s(e) {
22
22
  return /* @__PURE__ */ t(n, { ...e, name: "courtesyWithholding" });
23
23
  }
24
24
  function h(e) {
25
- return /* @__PURE__ */ t(o, { ...e, name: "effectiveDate" });
25
+ return /* @__PURE__ */ t(r, { ...e, name: "effectiveDate" });
26
26
  }
27
27
  export {
28
28
  F as CityField,
@@ -1,11 +1,11 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { SelectHookField as t } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
3
- import { DatePickerHookField as i } from "../../../../../partner-hook-utils/form/fields/DatePickerHookField.js";
2
+ import { DatePickerHookField as t } from "../../../../../partner-hook-utils/form/fields/DatePickerHookField.js";
3
+ import { SelectHookField as i } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
4
4
  function c(e) {
5
- return /* @__PURE__ */ o(t, { ...e, name: "locationUuid" });
5
+ return /* @__PURE__ */ o(i, { ...e, name: "locationUuid" });
6
6
  }
7
7
  function m(e) {
8
- return /* @__PURE__ */ o(i, { ...e, name: "effectiveDate" });
8
+ return /* @__PURE__ */ o(t, { ...e, name: "effectiveDate" });
9
9
  }
10
10
  export {
11
11
  m as EffectiveDateField,
@@ -1,11 +1,11 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { useTranslation as r } from "react-i18next";
3
3
  import { EmployeeStateTaxesErrorCodes as c } from "./employeeStateTaxesSchema.js";
4
- import { TextInputHookField as d } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
5
- import { SelectHookField as m } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
4
+ import { DatePickerHookField as d } from "../../../../../partner-hook-utils/form/fields/DatePickerHookField.js";
6
5
  import { NumberInputHookField as l } from "../../../../../partner-hook-utils/form/fields/NumberInputHookField.js";
7
- import { DatePickerHookField as u } from "../../../../../partner-hook-utils/form/fields/DatePickerHookField.js";
8
- import { RadioGroupHookField as f } from "../../../../../partner-hook-utils/form/fields/RadioGroupHookField.js";
6
+ import { TextInputHookField as m } from "../../../../../partner-hook-utils/form/fields/TextInputHookField.js";
7
+ import { RadioGroupHookField as u } from "../../../../../partner-hook-utils/form/fields/RadioGroupHookField.js";
8
+ import { SelectHookField as f } from "../../../../../partner-hook-utils/form/fields/SelectHookField.js";
9
9
  function F() {
10
10
  const { t: o } = r("Employee.StateTaxesView");
11
11
  return { [c.REQUIRED]: o("validations.required") };
@@ -26,21 +26,21 @@ function P({ meta: o, ...e }) {
26
26
  placeholder: e.placeholder ?? n("selectPlaceholder"),
27
27
  FieldComponent: e.FieldComponent
28
28
  };
29
- return /* @__PURE__ */ i(m, { ...s });
29
+ return /* @__PURE__ */ i(f, { ...s });
30
30
  }
31
31
  function H({ meta: o, ...e }) {
32
32
  const t = {
33
33
  ...a(o, e),
34
34
  FieldComponent: e.FieldComponent
35
35
  };
36
- return /* @__PURE__ */ i(f, { ...t });
36
+ return /* @__PURE__ */ i(u, { ...t });
37
37
  }
38
38
  function R({ meta: o, ...e }) {
39
39
  const t = {
40
40
  ...a(o, e),
41
41
  placeholder: e.placeholder
42
42
  };
43
- return /* @__PURE__ */ i(d, { ...t });
43
+ return /* @__PURE__ */ i(m, { ...t });
44
44
  }
45
45
  function v({ meta: o, ...e }) {
46
46
  const t = {
@@ -63,7 +63,7 @@ function E({ meta: o, ...e }) {
63
63
  ...a(o, e),
64
64
  FieldComponent: e.FieldComponent
65
65
  };
66
- return /* @__PURE__ */ i(u, { ...t });
66
+ return /* @__PURE__ */ i(d, { ...t });
67
67
  }
68
68
  export {
69
69
  D as CurrencyStateTaxField,
@@ -1,35 +1,42 @@
1
- import { jsx as n, jsxs as x } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as f } from "react/jsx-runtime";
2
+ import { Suspense as u } from "react";
2
3
  import { useMachine as h } from "react-robot";
3
- import { Flex as l } from "../Common/Flex/Flex.js";
4
- import { FlowContext as u } from "./useFlow.js";
5
- import { FlowHeader as v } from "./FlowHeader.js";
6
- const E = ({
7
- onEvent: m,
8
- machine: s
4
+ import { FlowContext as x } from "./useFlow.js";
5
+ import { FlowHeader as F } from "./FlowHeader.js";
6
+ import { useLoadingIndicator as v } from "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
7
+ import { Flex as s } from "../Common/Flex/Flex.js";
8
+ const E = 40;
9
+ function H() {
10
+ const { LoadingIndicator: n } = v();
11
+ return /* @__PURE__ */ o(n, { height: E });
12
+ }
13
+ const k = ({
14
+ onEvent: n,
15
+ machine: m
9
16
  }) => {
10
- const [o, d, e] = h(s, {
11
- onEvent: p,
17
+ const [e, d, t] = h(m, {
18
+ onEvent: a,
12
19
  component: null
13
20
  });
14
- function p(r, c) {
15
- const i = { type: r, payload: c }, f = d;
16
- e.child ? e.child.send(i) : f(i), m(r, c);
21
+ function a(c, i) {
22
+ const l = { type: c, payload: i }, p = d;
23
+ t.child ? t.child.send(l) : p(l), n(c, i);
17
24
  }
18
- const t = o.context.component;
19
- return /* @__PURE__ */ n(l, { children: /* @__PURE__ */ n(
20
- u.Provider,
25
+ const r = e.context.component;
26
+ return /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(
27
+ x.Provider,
21
28
  {
22
29
  value: {
23
- ...o.context
30
+ ...e.context
24
31
  },
25
- children: /* @__PURE__ */ x(l, { flexDirection: "column", gap: 32, children: [
26
- /* @__PURE__ */ n(v, {}),
27
- t && /* @__PURE__ */ n(t, {})
32
+ children: /* @__PURE__ */ f(s, { flexDirection: "column", gap: 32, children: [
33
+ /* @__PURE__ */ o(u, { fallback: /* @__PURE__ */ o(H, {}), children: /* @__PURE__ */ o(F, {}) }),
34
+ r && /* @__PURE__ */ o(r, {})
28
35
  ] })
29
36
  }
30
37
  ) });
31
38
  };
32
39
  export {
33
- E as Flow
40
+ k as Flow
34
41
  };
35
42
  //# sourceMappingURL=Flow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport type { OnEventType } from '../Base/useBase'\nimport { Flex } from '../Common/Flex'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { FlowHeader } from './FlowHeader'\nimport { type EventType } from '@/shared/constants'\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Drives a robot3 state machine that orchestrates a multi-step SDK flow, rendering the active\n * step component inside a {@link FlowContext} provider with optional header chrome above it.\n *\n * @remarks\n * Re-emits every event produced by the state machine (or the active child machine, when one is\n * nested) to the upstream `onEvent` callback, so the consuming flow component (e.g. `PayrollFlow`,\n * `OnboardingFlow`) can forward them to partner code. The set of event types is defined by the\n * machine itself rather than a fixed catalogue.\n *\n * @typeParam M - The robot3 {@link Machine} type whose context extends {@link FlowContextInterface}.\n * @param props - Component props: the `machine` instance to run and an `onEvent` handler that\n * receives every event the machine emits.\n * @returns A React element rendering the machine's current `component` inside the flow context,\n * with a {@link FlowHeader} above it.\n * @internal\n */\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n })\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n const Component = current.context.component\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n <FlowHeader />\n {Component && <Component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["Flow","onEvent","machine","current","send","service","useMachine","handleEvent","type","data","event","sendFn","Component","Flex","jsx","FlowContext","jsxs","FlowHeader"],"mappings":";;;;;AA+BO,MAAMA,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAM,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWJ,GAAS;AAAA,IACnD,SAASK;AAAA,IACT,WAAW;AAAA,EAAA,CACZ;AAED,WAASA,EAAYC,GAAiBC,GAAqB;AACzD,UAAMC,IAAQ,EAAE,MAAAF,GAAM,SAASC,EAAA,GACzBE,IAASP;AAEf,IAAIC,EAAQ,QACRA,EAAQ,MAAM,KAA8BK,CAAK,IAEnDC,EAAOD,CAAK,GAGdT,EAAQO,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAMG,IAAYT,EAAQ,QAAQ;AAElC,2BACGU,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGZ,EAAQ;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAa,EAACH,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAC,EAACG,GAAA,EAAW;AAAA,QACXL,uBAAcA,GAAA,CAAA,CAAU;AAAA,MAAA,EAAA,CAC3B;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"Flow.js","sources":["../../../src/components/Flow/Flow.tsx"],"sourcesContent":["import { Suspense } from 'react'\nimport { useMachine } from 'react-robot'\nimport { type Machine, type SendFunction } from 'robot3'\nimport type { OnEventType } from '../Base/useBase'\nimport { Flex } from '../Common/Flex'\nimport type { FlowContextInterface } from './useFlow'\nimport { FlowContext } from './useFlow'\nimport { FlowHeader } from './FlowHeader'\nimport { useLoadingIndicator } from '@/contexts/LoadingIndicatorProvider/useLoadingIndicator'\nimport { type EventType } from '@/shared/constants'\n\n/**\n * Header chrome is short (a back-button row is the only header that can suspend),\n * so the header fallback matches its height rather than the full content loader —\n * this keeps the step body at the same level, avoiding a layout shift.\n */\nconst HEADER_LOADER_HEIGHT = 40\n\n/**\n * Fallback for the {@link FlowHeader} Suspense boundary. FlowHeader calls\n * `useTranslation` and renders above the active step's own boundary, so a\n * first-time i18n namespace load during a synchronous transition would otherwise\n * throw React #426. Reuses the SDK loading indicator sized to the header height\n * so the placeholder matches the header chrome and the step body doesn't shift.\n * (Step components manage their own loading via `BaseComponent`/`BaseBoundaries`.)\n */\nfunction FlowHeaderFallback() {\n const { LoadingIndicator } = useLoadingIndicator()\n return <LoadingIndicator height={HEADER_LOADER_HEIGHT} />\n}\n\ntype FlowProps<M extends Machine> = {\n machine: M\n onEvent: OnEventType<EventType, unknown>\n}\n\n/**\n * Drives a robot3 state machine that orchestrates a multi-step SDK flow, rendering the active\n * step component inside a {@link FlowContext} provider with optional header chrome above it.\n *\n * @remarks\n * Re-emits every event produced by the state machine (or the active child machine, when one is\n * nested) to the upstream `onEvent` callback, so the consuming flow component (e.g. `PayrollFlow`,\n * `OnboardingFlow`) can forward them to partner code. The set of event types is defined by the\n * machine itself rather than a fixed catalogue.\n *\n * @typeParam M - The robot3 {@link Machine} type whose context extends {@link FlowContextInterface}.\n * @param props - Component props: the `machine` instance to run and an `onEvent` handler that\n * receives every event the machine emits.\n * @returns A React element rendering the machine's current `component` inside the flow context,\n * with a {@link FlowHeader} above it.\n * @internal\n */\nexport const Flow = <M extends Machine<object, FlowContextInterface>>({\n onEvent,\n machine,\n}: FlowProps<M>) => {\n const [current, send, service] = useMachine(machine, {\n onEvent: handleEvent,\n component: null,\n })\n\n function handleEvent(type: EventType, data: unknown): void {\n const event = { type, payload: data }\n const sendFn = send as SendFunction<string>\n //When dealing with nested state machine, correct machine needs to recieve an event\n if (service.child) {\n ;(service.child.send as SendFunction<string>)(event)\n } else {\n sendFn(event)\n }\n // Pass event upstream - onEvent can be optional on Flow component\n onEvent(type, data)\n }\n\n const Component = current.context.component\n\n return (\n <Flex>\n <FlowContext.Provider\n value={{\n ...current.context,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n <Suspense fallback={<FlowHeaderFallback />}>\n <FlowHeader />\n </Suspense>\n {Component && <Component />}\n </Flex>\n </FlowContext.Provider>\n </Flex>\n )\n}\n"],"names":["HEADER_LOADER_HEIGHT","FlowHeaderFallback","LoadingIndicator","useLoadingIndicator","jsx","Flow","onEvent","machine","current","send","service","useMachine","handleEvent","type","data","event","sendFn","Component","Flex","FlowContext","jsxs","Suspense","FlowHeader"],"mappings":";;;;;;;AAgBA,MAAMA,IAAuB;AAU7B,SAASC,IAAqB;AAC5B,QAAM,EAAE,kBAAAC,EAAA,IAAqBC,EAAA;AAC7B,SAAO,gBAAAC,EAACF,GAAA,EAAiB,QAAQF,EAAA,CAAsB;AACzD;AAwBO,MAAMK,IAAO,CAAkD;AAAA,EACpE,SAAAC;AAAA,EACA,SAAAC;AACF,MAAoB;AAClB,QAAM,CAACC,GAASC,GAAMC,CAAO,IAAIC,EAAWJ,GAAS;AAAA,IACnD,SAASK;AAAA,IACT,WAAW;AAAA,EAAA,CACZ;AAED,WAASA,EAAYC,GAAiBC,GAAqB;AACzD,UAAMC,IAAQ,EAAE,MAAAF,GAAM,SAASC,EAAA,GACzBE,IAASP;AAEf,IAAIC,EAAQ,QACRA,EAAQ,MAAM,KAA8BK,CAAK,IAEnDC,EAAOD,CAAK,GAGdT,EAAQO,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAMG,IAAYT,EAAQ,QAAQ;AAElC,2BACGU,GAAA,EACC,UAAA,gBAAAd;AAAA,IAACe,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGX,EAAQ;AAAA,MAAA;AAAA,MAGb,UAAA,gBAAAY,EAACF,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,QAAA,gBAAAd,EAACiB,KAAS,UAAU,gBAAAjB,EAACH,KAAmB,GACtC,UAAA,gBAAAG,EAACkB,KAAW,EAAA,CACd;AAAA,QACCL,uBAAcA,GAAA,CAAA,CAAU;AAAA,MAAA,EAAA,CAC3B;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}