@gusto/embedded-react-sdk 0.23.0 → 0.24.0

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 (123) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/components/Common/PayrollLoading/PayrollLoading.d.ts +2 -0
  3. package/dist/components/Common/PayrollLoading/PayrollLoading.js +19 -0
  4. package/dist/components/Common/PayrollLoading/PayrollLoading.js.map +1 -0
  5. package/dist/components/Common/PayrollLoading/PayrollLoadingTypes.d.ts +5 -0
  6. package/dist/components/Common/PayrollLoading/index.d.ts +3 -0
  7. package/dist/components/Common/index.d.ts +1 -0
  8. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  9. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  10. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  11. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  12. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  13. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  14. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  15. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  16. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  17. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  18. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  19. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  20. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -9
  21. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  22. package/dist/components/Company/Industry/Context.js +6 -7
  23. package/dist/components/Company/Industry/Context.js.map +1 -1
  24. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  25. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  26. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  27. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  28. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  29. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  30. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
  31. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  32. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  33. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  34. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  35. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  36. package/dist/components/Contractor/Address/useAddress.js +5 -6
  37. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  38. package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
  39. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  40. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +2 -3
  41. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  42. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +2 -3
  43. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  44. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +2 -3
  45. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  46. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  47. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  48. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  49. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  50. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
  51. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  52. package/dist/components/Employee/FederalTaxes/FederalForm.js +2 -0
  53. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  54. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
  55. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  56. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
  57. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  58. package/dist/components/Employee/Profile/useProfile.js +3 -4
  59. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  60. package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
  61. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  62. package/dist/components/Employee/Taxes/FederalForm.js +6 -4
  63. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  64. package/dist/components/Employee/Taxes/useTaxes.js +3 -4
  65. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  66. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +4 -4
  67. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +26 -21
  68. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  69. package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -1
  70. package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +8 -1
  71. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.d.ts +2 -1
  72. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +56 -54
  73. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  74. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +2 -1
  75. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +90 -91
  76. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  77. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.d.ts +2 -1
  78. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +33 -31
  79. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  80. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +2 -1
  81. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +88 -87
  82. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  83. package/dist/components/Payroll/PayrollFlow/PayrollFlow.d.ts +1 -1
  84. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js +24 -18
  85. package/dist/components/Payroll/PayrollFlow/PayrollFlow.js.map +1 -1
  86. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +5 -0
  87. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +77 -51
  88. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  89. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +4 -1
  90. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +29 -21
  91. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  92. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +5 -0
  93. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +36 -26
  94. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  95. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +4 -1
  96. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -60
  97. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  98. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  99. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +239 -234
  100. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  101. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.d.ts +2 -1
  102. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +25 -15
  103. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  104. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +2 -1
  105. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +152 -137
  106. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  107. package/dist/components/Payroll/index.d.ts +1 -0
  108. package/dist/components/Payroll/usePreparedPayrollData.js +5 -6
  109. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  110. package/dist/contexts/ApiProvider/ApiProvider.d.ts +3 -1
  111. package/dist/contexts/ApiProvider/ApiProvider.js +26 -18
  112. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  113. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  114. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  115. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  116. package/dist/contexts/GustoProvider/GustoProvider.d.ts +2 -0
  117. package/dist/contexts/GustoProvider/GustoProvider.js +12 -11
  118. package/dist/contexts/GustoProvider/GustoProvider.js.map +1 -1
  119. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +24 -14
  120. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  121. package/dist/index.d.ts +1 -0
  122. package/dist/style.css +1 -1
  123. package/package.json +5 -5
@@ -1,64 +1,73 @@
1
- import { jsx as c, jsxs as z } from "react/jsx-runtime";
2
- import { usePayrollsSubmitMutation as J } from "@gusto/embedded-api/react-query/payrollsSubmit";
3
- import { usePayrollsCancelMutation as Q } from "@gusto/embedded-api/react-query/payrollsCancel";
4
- import { usePayrollsGetSuspense as X } from "@gusto/embedded-api/react-query/payrollsGet";
5
- import { useTranslation as Z } from "react-i18next";
6
- import { useBankAccountsGetSuspense as $ } from "@gusto/embedded-api/react-query/bankAccountsGet";
7
- import { useEmployeesListSuspense as ee } from "@gusto/embedded-api/react-query/employeesList";
8
- import { useWireInRequestsGet as te } from "@gusto/embedded-api/react-query/wireInRequestsGet";
1
+ import { jsx as c, jsxs as Q } from "react/jsx-runtime";
2
+ import { usePayrollsSubmitMutation as X } from "@gusto/embedded-api/react-query/payrollsSubmit";
3
+ import { usePayrollsCancelMutation as Z } from "@gusto/embedded-api/react-query/payrollsCancel";
4
+ import { usePayrollsGetSuspense as $ } from "@gusto/embedded-api/react-query/payrollsGet";
5
+ import { useTranslation as ee } from "react-i18next";
6
+ import { useBankAccountsGetSuspense as te } from "@gusto/embedded-api/react-query/bankAccountsGet";
7
+ import { useEmployeesListSuspense as se } from "@gusto/embedded-api/react-query/employeesList";
8
+ import { useWireInRequestsGet as oe } from "@gusto/embedded-api/react-query/wireInRequestsGet";
9
9
  import { useState as b, useEffect as S } from "react";
10
- import { useGustoEmbeddedContext as se } from "@gusto/embedded-api/react-query/_context";
11
- import { payrollsGetPayStub as oe } from "@gusto/embedded-api/funcs/payrollsGetPayStub";
12
- import { useErrorBoundary as re } from "react-error-boundary";
13
- import { ConfirmWireDetails as ne } from "../ConfirmWireDetails/ConfirmWireDetails.js";
14
- import { PayrollOverviewPresentation as ie } from "./PayrollOverviewPresentation.js";
15
- import { PAYROLL_PROCESSING_STATUS as R, componentEvents as l, PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES as ae, payrollWireEvents as le } from "../../../shared/constants.js";
16
- import { BaseComponent as ce } from "../../Base/Base.js";
17
- import { useBase as ue } from "../../Base/useBase.js";
18
- import { useComponentDictionary as me, useI18n as pe } from "../../../i18n/I18n.js";
19
- import { readableStreamToBlob as de } from "../../../helpers/readableStreamToBlob.js";
20
- import fe from "../../../hooks/useNumberFormatter.js";
21
- import { useDateFormatter as ye } from "../../../hooks/useDateFormatter.js";
22
- import { useComponentContext as Pe } from "../../../contexts/ComponentAdapter/useComponentContext.js";
23
- import { renderErrorList as be } from "../../../helpers/apiErrorToList.js";
24
- import { Flex as Re } from "../../Common/Flex/Flex.js";
10
+ import { useGustoEmbeddedContext as re } from "@gusto/embedded-api/react-query/_context";
11
+ import { payrollsGetPayStub as ne } from "@gusto/embedded-api/funcs/payrollsGetPayStub";
12
+ import { useErrorBoundary as ie } from "react-error-boundary";
13
+ import { ConfirmWireDetails as ae } from "../ConfirmWireDetails/ConfirmWireDetails.js";
14
+ import { PayrollOverviewPresentation as le } from "./PayrollOverviewPresentation.js";
15
+ import { PAYROLL_PROCESSING_STATUS as R, componentEvents as l, PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES as ce, payrollWireEvents as ue } from "../../../shared/constants.js";
16
+ import { BaseComponent as me } from "../../Base/Base.js";
17
+ import { useBase as pe } from "../../Base/useBase.js";
18
+ import { useComponentDictionary as de, useI18n as fe } from "../../../i18n/I18n.js";
19
+ import { readableStreamToBlob as ye } from "../../../helpers/readableStreamToBlob.js";
20
+ import Pe from "../../../hooks/useNumberFormatter.js";
21
+ import { useDateFormatter as be } from "../../../hooks/useDateFormatter.js";
22
+ import { useComponentContext as Re } from "../../../contexts/ComponentAdapter/useComponentContext.js";
23
+ import { renderErrorList as we } from "../../../helpers/apiErrorToList.js";
24
+ import { Flex as Se } from "../../Common/Flex/Flex.js";
25
25
  import "classnames";
26
- const we = (o = []) => o.filter(
26
+ const Oe = (o = []) => o.filter(
27
27
  (i) => i.status === "unresolved" && i.unblockOptions && i.unblockOptions.length > 0
28
- ), Se = (o = []) => {
28
+ ), Le = (o = []) => {
29
29
  const i = o.find((n) => n.status === "unresolved");
30
30
  return i?.unblockOptions ? i.unblockOptions.find(
31
31
  (n) => n.unblockType === "submit_wire"
32
32
  )?.metadata.wireInRequestUuid : void 0;
33
33
  };
34
- function Ze(o) {
35
- return /* @__PURE__ */ c(ce, { ...o, children: /* @__PURE__ */ c(Oe, { ...o, children: o.children }) });
34
+ function et(o) {
35
+ return /* @__PURE__ */ c(me, { ...o, children: /* @__PURE__ */ c(De, { ...o, children: o.children }) });
36
36
  }
37
- const Oe = ({
37
+ const De = ({
38
38
  companyId: o,
39
39
  payrollId: i,
40
40
  dictionary: O,
41
41
  onEvent: n,
42
- alerts: k
42
+ alerts: k,
43
+ withReimbursements: A = !0,
44
+ ConfirmWireDetailsComponent: g = ae
43
45
  }) => {
44
- me("Payroll.PayrollOverview", O), pe("Payroll.PayrollOverview");
45
- const { baseSubmitHandler: L } = ue(), { t: a } = Z("Payroll.PayrollOverview"), [u, p] = b(!1), [A, d] = b(k || []), [D, g] = b({}), [f, m] = b(!1), { showBoundary: B } = re(), _ = fe("currency"), y = ye(), { Button: v, UnorderedList: T, Text: h } = Pe(), { data: w } = X(
46
+ de("Payroll.PayrollOverview", O), fe("Payroll.PayrollOverview");
47
+ const { baseSubmitHandler: L } = pe(), { t: a } = ee("Payroll.PayrollOverview"), [u, p] = b(!1), [B, d] = b(k || []), [D, v] = b({}), [f, m] = b(!1), { showBoundary: T } = ie(), _ = Pe("currency"), y = be(), { Button: q, UnorderedList: N, Text: h } = Re(), { data: w } = $(
46
48
  {
47
49
  companyId: o,
48
50
  payrollId: i,
49
51
  include: ["taxes", "benefits", "deductions"]
50
52
  },
51
53
  { refetchInterval: u ? 5e3 : !1 }
52
- ), e = w.payrollShow, q = we(e.submissionBlockers), P = Se(e.creditBlockers), { data: N } = te(
54
+ ), e = w.payrollShow, I = Oe(e.submissionBlockers), P = Le(e.creditBlockers), { data: W } = oe(
53
55
  {
54
56
  wireInRequestUuid: P || ""
55
57
  },
56
58
  { enabled: !!P }
57
- ), E = N?.wireInRequest, C = () => {
59
+ ), E = W?.wireInRequest, C = () => {
58
60
  n(l.RUN_PAYROLL_EDIT);
59
- }, I = P && /* @__PURE__ */ c(ne, { companyId: o, wireInId: P, onEvent: (t, r) => {
60
- t === le.PAYROLL_WIRE_FORM_DONE && m(!0), n(t, r);
61
- } });
61
+ }, Y = P && /* @__PURE__ */ c(
62
+ g,
63
+ {
64
+ companyId: o,
65
+ wireInId: P,
66
+ onEvent: (t, r) => {
67
+ t === ue.PAYROLL_WIRE_FORM_DONE && m(!0), n(t, r);
68
+ }
69
+ }
70
+ );
62
71
  S(() => {
63
72
  E?.status === "pending_review" && !f && m(!0);
64
73
  }, [E?.status, f]), S(() => {
@@ -91,9 +100,9 @@ const Oe = ({
91
100
  {
92
101
  type: "error",
93
102
  title: a("alerts.payrollProcessingFailedTitle"),
94
- content: /* @__PURE__ */ z(Re, { flexDirection: "column", gap: 16, children: [
95
- /* @__PURE__ */ c(T, { items: be(e.processingRequest.errors ?? []) }),
96
- /* @__PURE__ */ c(v, { variant: "secondary", onClick: C, children: a("alerts.payrollProcessingFailedCtaLabel") })
103
+ content: /* @__PURE__ */ Q(Se, { flexDirection: "column", gap: 16, children: [
104
+ /* @__PURE__ */ c(N, { items: we(e.processingRequest.errors ?? []) }),
105
+ /* @__PURE__ */ c(q, { variant: "secondary", onClick: C, children: a("alerts.payrollProcessingFailedCtaLabel") })
97
106
  ] })
98
107
  }
99
108
  ]), m(!1), p(!1));
@@ -108,14 +117,14 @@ const Oe = ({
108
117
  e.payrollStatusMeta?.expectedDebitTime,
109
118
  e.payrollDeadline
110
119
  ]);
111
- const { data: W } = $({
120
+ const { data: F } = te({
112
121
  companyId: o
113
- }), Y = W.companyBankAccounts?.[0], { data: F } = ee({
122
+ }), M = F.companyBankAccounts?.[0], { data: G } = se({
114
123
  companyId: o
115
- }), { mutateAsync: M, isPending: G } = J(), { mutateAsync: x, isPending: j } = Q();
124
+ }), { mutateAsync: x, isPending: j } = X(), { mutateAsync: V, isPending: H } = Z();
116
125
  if (!e.calculatedAt)
117
126
  throw new Error(a("alerts.payrollNotCalculated"));
118
- const V = se(), H = e.employeeCompensations?.reduce(
127
+ const K = re(), z = e.employeeCompensations?.reduce(
119
128
  (t, r) => (r.taxes?.forEach((s) => {
120
129
  t[s.name] = {
121
130
  employee: (t[s.name]?.employee ?? 0) + (s.employer ? 0 : s.amount),
@@ -125,18 +134,18 @@ const Oe = ({
125
134
  {}
126
135
  ) || {};
127
136
  return /* @__PURE__ */ c(
128
- ie,
137
+ le,
129
138
  {
130
139
  onEdit: C,
131
140
  onSubmit: async () => {
132
141
  await L(w, async () => {
133
- const t = await M({
142
+ const t = await x({
134
143
  request: {
135
144
  companyId: o,
136
145
  payrollId: i,
137
146
  requestBody: {
138
147
  submissionBlockers: Object.entries(D).filter(
139
- ([r]) => ae.includes(r)
148
+ ([r]) => ce.includes(r)
140
149
  ).map(([r, s]) => ({
141
150
  blockerType: r,
142
151
  selectedOption: s
@@ -149,7 +158,7 @@ const Oe = ({
149
158
  },
150
159
  onCancel: async () => {
151
160
  await L(w, async () => {
152
- const t = await x({
161
+ const t = await V({
153
162
  request: {
154
163
  companyId: o,
155
164
  payrollId: i
@@ -164,33 +173,34 @@ const Oe = ({
164
173
  onPaystubDownload: async (t) => {
165
174
  const r = window.open("", "_blank");
166
175
  try {
167
- const s = await oe(V, { payrollId: i, employeeId: t });
176
+ const s = await ne(K, { payrollId: i, employeeId: t });
168
177
  if (!s.value?.responseStream)
169
178
  throw new Error(a("alerts.paystubPdfError"));
170
- const K = await de(s.value.responseStream, "application/pdf"), U = URL.createObjectURL(K);
179
+ const J = await ye(s.value.responseStream, "application/pdf"), U = URL.createObjectURL(J);
171
180
  r && (r.location.href = U), n(l.RUN_PAYROLL_PDF_PAYSTUB_VIEWED, { employeeId: t }), URL.revokeObjectURL(U);
172
181
  } catch (s) {
173
- r && r.close(), B(s);
182
+ r && r.close(), T(s);
174
183
  }
175
184
  },
176
- isSubmitting: G || u || j,
185
+ isSubmitting: j || u || H,
177
186
  isProcessed: e.processingRequest?.status === R.submit_success,
178
187
  payrollData: e,
179
- bankAccount: Y,
180
- employeeDetails: F.showEmployees || [],
181
- taxes: H,
182
- alerts: A,
183
- submissionBlockers: q,
188
+ bankAccount: M,
189
+ employeeDetails: G.showEmployees || [],
190
+ taxes: z,
191
+ alerts: B,
192
+ submissionBlockers: I,
184
193
  selectedUnblockOptions: D,
185
194
  onUnblockOptionChange: (t, r) => {
186
- g((s) => ({ ...s, [t]: r }));
195
+ v((s) => ({ ...s, [t]: r }));
187
196
  },
188
- wireInConfirmationRequest: I
197
+ wireInConfirmationRequest: Y,
198
+ withReimbursements: A
189
199
  }
190
200
  );
191
201
  };
192
202
  export {
193
- Ze as PayrollOverview,
194
- Oe as Root
203
+ et as PayrollOverview,
204
+ De as Root
195
205
  };
196
206
  //# sourceMappingURL=PayrollOverview.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollOverview.js","sources":["../../../../src/components/Payroll/PayrollOverview/PayrollOverview.tsx"],"sourcesContent":["import { usePayrollsSubmitMutation } from '@gusto/embedded-api/react-query/payrollsSubmit'\nimport { usePayrollsCancelMutation } from '@gusto/embedded-api/react-query/payrollsCancel'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { useTranslation } from 'react-i18next'\nimport { useBankAccountsGetSuspense } from '@gusto/embedded-api/react-query/bankAccountsGet'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { useWireInRequestsGet } from '@gusto/embedded-api/react-query/wireInRequestsGet'\nimport { useEffect, useState } from 'react'\nimport { useGustoEmbeddedContext } from '@gusto/embedded-api/react-query/_context'\nimport { payrollsGetPayStub } from '@gusto/embedded-api/funcs/payrollsGetPayStub'\nimport { useErrorBoundary } from 'react-error-boundary'\nimport type { PayrollSubmissionBlockersType } from '@gusto/embedded-api/models/components/payrollsubmissionblockerstype'\nimport type { PayrollCreditBlockersType } from '@gusto/embedded-api/models/components/payrollcreditblockerstype'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport { ConfirmWireDetails } from '../ConfirmWireDetails/ConfirmWireDetails'\nimport { PayrollOverviewPresentation } from './PayrollOverviewPresentation'\nimport {\n componentEvents,\n payrollWireEvents,\n PAYROLL_PROCESSING_STATUS,\n PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES,\n type EventType,\n} from '@/shared/constants'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { readableStreamToBlob } from '@/helpers/readableStreamToBlob'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { renderErrorList } from '@/helpers/apiErrorToList'\nimport { Flex } from '@/components/Common'\n\ninterface PayrollOverviewProps extends BaseComponentInterface<'Payroll.PayrollOverview'> {\n companyId: string\n payrollId: string\n alerts?: PayrollFlowAlert[]\n}\n\nconst findUnresolvedBlockersWithOptions = (blockers: PayrollSubmissionBlockersType[] = []) => {\n return blockers.filter(\n blocker =>\n blocker.status === 'unresolved' &&\n blocker.unblockOptions &&\n blocker.unblockOptions.length > 0,\n )\n}\n\nconst findWireInRequestUuid = (\n creditBlockers: PayrollCreditBlockersType[] = [],\n): string | undefined => {\n const unresolvedCreditBlocker = creditBlockers.find(blocker => blocker.status === 'unresolved')\n\n if (!unresolvedCreditBlocker?.unblockOptions) {\n return undefined\n }\n\n const wireUnblockOption = unresolvedCreditBlocker.unblockOptions.find(\n option => option.unblockType === 'submit_wire',\n )\n\n return wireUnblockOption?.metadata.wireInRequestUuid\n}\n\nexport function PayrollOverview(props: PayrollOverviewProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n companyId,\n payrollId,\n dictionary,\n onEvent,\n alerts,\n}: PayrollOverviewProps) => {\n useComponentDictionary('Payroll.PayrollOverview', dictionary)\n useI18n('Payroll.PayrollOverview')\n const { baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.PayrollOverview')\n const [isPolling, setIsPolling] = useState(false)\n const [internalAlerts, setInternalAlerts] = useState<PayrollFlowAlert[]>(alerts || [])\n const [selectedUnblockOptions, setSelectedUnblockOptions] = useState<Record<string, string>>({})\n const [showWireDetailsConfirmation, setShowWireDetailsConfirmation] = useState(false)\n const { showBoundary } = useErrorBoundary()\n const formatCurrency = useNumberFormatter('currency')\n const dateFormatter = useDateFormatter()\n const { Button, UnorderedList, Text } = useComponentContext()\n const { data } = usePayrollsGetSuspense(\n {\n companyId,\n payrollId: payrollId,\n include: ['taxes', 'benefits', 'deductions'],\n },\n { refetchInterval: isPolling ? 5_000 : false },\n )\n const payrollData = data.payrollShow!\n const submissionBlockers = findUnresolvedBlockersWithOptions(payrollData.submissionBlockers)\n const wireInId = findWireInRequestUuid(payrollData.creditBlockers)\n\n const { data: wireInRequestData } = useWireInRequestsGet(\n {\n wireInRequestUuid: wireInId || '',\n },\n { enabled: !!wireInId },\n )\n const wireInRequest = wireInRequestData?.wireInRequest\n\n const onEdit = () => {\n onEvent(componentEvents.RUN_PAYROLL_EDIT)\n }\n\n const handleWireEvent = (type: EventType, data?: unknown) => {\n if (type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE) {\n setShowWireDetailsConfirmation(true)\n }\n onEvent(type, data)\n }\n\n const wireInConfirmationRequest = wireInId && (\n <ConfirmWireDetails companyId={companyId} wireInId={wireInId} onEvent={handleWireEvent} />\n )\n\n useEffect(() => {\n if (wireInRequest?.status === 'pending_review' && !showWireDetailsConfirmation) {\n setShowWireDetailsConfirmation(true)\n }\n }, [wireInRequest?.status, showWireDetailsConfirmation])\n\n useEffect(() => {\n if (showWireDetailsConfirmation) {\n const checkDate = dateFormatter.formatShortWithYear(payrollData.checkDate)\n\n setInternalAlerts([\n {\n type: 'success',\n title: t('alerts.wireDetailsSubmittedTitle'),\n content: <Text>{t('alerts.wireDetailsSubmittedMessage', { checkDate })}</Text>,\n onDismiss: () => {\n setShowWireDetailsConfirmation(false)\n },\n },\n ])\n }\n }, [showWireDetailsConfirmation, payrollData.checkDate, t, dateFormatter, Text])\n\n useEffect(() => {\n // Start polling when payroll is submitting and not already polling\n if (\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submitting &&\n !isPolling\n ) {\n setIsPolling(true)\n }\n // Stop polling and emit event when payroll is processed successfully\n if (\n isPolling &&\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submit_success\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSED)\n setInternalAlerts([\n {\n type: 'success',\n title: t('alerts.payrollProcessedTitle'),\n content: t('alerts.payrollProcessedMessage', {\n amount: formatCurrency(Number(payrollData.totals?.netPayDebit)),\n date: dateFormatter.formatShortWithYear(\n payrollData.payrollStatusMeta?.expectedDebitTime ?? payrollData.payrollDeadline,\n ),\n }),\n },\n ])\n setShowWireDetailsConfirmation(false)\n setIsPolling(false)\n }\n // If we are polling and payroll is in failed state, stop polling, and emit failure event\n if (\n isPolling &&\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.processing_failed\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setInternalAlerts([\n {\n type: 'error',\n title: t('alerts.payrollProcessingFailedTitle'),\n content: (\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={renderErrorList(payrollData.processingRequest.errors ?? [])} />\n <Button variant=\"secondary\" onClick={onEdit}>\n {t('alerts.payrollProcessingFailedCtaLabel')}\n </Button>\n </Flex>\n ),\n },\n ])\n setShowWireDetailsConfirmation(false)\n setIsPolling(false)\n }\n }, [\n payrollData.processingRequest?.status,\n isPolling,\n onEvent,\n t,\n dateFormatter,\n formatCurrency,\n payrollData.totals?.netPayDebit,\n payrollData.payrollStatusMeta?.expectedDebitTime,\n payrollData.payrollDeadline,\n ])\n\n const { data: bankAccountData } = useBankAccountsGetSuspense({\n companyId,\n })\n const bankAccount = bankAccountData.companyBankAccounts?.[0]\n\n const { data: employeeData } = useEmployeesListSuspense({\n companyId,\n })\n\n const { mutateAsync: submitPayroll, isPending } = usePayrollsSubmitMutation()\n\n const { mutateAsync: cancelPayroll, isPending: isPendingCancel } = usePayrollsCancelMutation()\n\n if (!payrollData.calculatedAt) {\n throw new Error(t('alerts.payrollNotCalculated'))\n }\n const gustoEmbedded = useGustoEmbeddedContext()\n\n const taxes =\n payrollData.employeeCompensations?.reduce(\n (acc, compensation) => {\n compensation.taxes?.forEach(tax => {\n acc[tax.name] = {\n employee: (acc[tax.name]?.employee ?? 0) + (tax.employer ? 0 : tax.amount),\n employer: (acc[tax.name]?.employer ?? 0) + (tax.employer ? tax.amount : 0),\n }\n })\n\n return acc\n },\n {} as Record<string, { employee: number; employer: number }>,\n ) || {}\n\n const onCancel = async () => {\n await baseSubmitHandler(data, async () => {\n const result = await cancelPayroll({\n request: {\n companyId,\n payrollId,\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_CANCELLED, result)\n setInternalAlerts([])\n })\n }\n const onPayrollReceipt = () => {\n onEvent(componentEvents.RUN_PAYROLL_RECEIPT_GET, { payrollId })\n }\n\n const onPaystubDownload = async (employeeId: string) => {\n // Open a blank window *synchronously* with the click\n const newWindow = window.open('', '_blank')\n\n try {\n // Fetch the PDF from your API\n const response = await payrollsGetPayStub(gustoEmbedded, { payrollId, employeeId })\n if (!response.value?.responseStream) {\n throw new Error(t('alerts.paystubPdfError'))\n }\n const pdfBlob = await readableStreamToBlob(response.value.responseStream, 'application/pdf')\n\n const url = URL.createObjectURL(pdfBlob)\n\n // Load the PDF into the new window\n if (newWindow) {\n newWindow.location.href = url\n }\n onEvent(componentEvents.RUN_PAYROLL_PDF_PAYSTUB_VIEWED, { employeeId })\n URL.revokeObjectURL(url) // Clean up the URL object after use\n } catch (err) {\n if (newWindow) {\n newWindow.close()\n }\n showBoundary(err)\n }\n }\n const onSubmit = async () => {\n await baseSubmitHandler(data, async () => {\n const result = await submitPayroll({\n request: {\n companyId,\n payrollId,\n requestBody: {\n submissionBlockers: Object.entries(selectedUnblockOptions)\n .filter(([blockerType]) =>\n PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES.includes(blockerType),\n )\n .map(([blockerType, selectedOption]) => ({\n blockerType,\n selectedOption,\n })),\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_SUBMITTED, result)\n setIsPolling(true)\n })\n }\n\n return (\n <PayrollOverviewPresentation\n onEdit={onEdit}\n onSubmit={onSubmit}\n onCancel={onCancel}\n onPayrollReceipt={onPayrollReceipt}\n onPaystubDownload={onPaystubDownload}\n isSubmitting={isPending || isPolling || isPendingCancel}\n isProcessed={\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submit_success\n }\n payrollData={payrollData}\n bankAccount={bankAccount}\n employeeDetails={employeeData.showEmployees || []}\n taxes={taxes}\n alerts={internalAlerts}\n submissionBlockers={submissionBlockers}\n selectedUnblockOptions={selectedUnblockOptions}\n onUnblockOptionChange={(blockerType, value) => {\n setSelectedUnblockOptions(prev => ({ ...prev, [blockerType]: value }))\n }}\n wireInConfirmationRequest={wireInConfirmationRequest}\n />\n )\n}\n"],"names":["findUnresolvedBlockersWithOptions","blockers","blocker","findWireInRequestUuid","creditBlockers","unresolvedCreditBlocker","option","PayrollOverview","props","jsx","BaseComponent","Root","companyId","payrollId","dictionary","onEvent","alerts","useComponentDictionary","useI18n","baseSubmitHandler","useBase","t","useTranslation","isPolling","setIsPolling","useState","internalAlerts","setInternalAlerts","selectedUnblockOptions","setSelectedUnblockOptions","showWireDetailsConfirmation","setShowWireDetailsConfirmation","showBoundary","useErrorBoundary","formatCurrency","useNumberFormatter","dateFormatter","useDateFormatter","Button","UnorderedList","Text","useComponentContext","data","usePayrollsGetSuspense","payrollData","submissionBlockers","wireInId","wireInRequestData","useWireInRequestsGet","wireInRequest","onEdit","componentEvents","wireInConfirmationRequest","ConfirmWireDetails","type","payrollWireEvents","useEffect","checkDate","PAYROLL_PROCESSING_STATUS","jsxs","Flex","renderErrorList","bankAccountData","useBankAccountsGetSuspense","bankAccount","employeeData","useEmployeesListSuspense","submitPayroll","isPending","usePayrollsSubmitMutation","cancelPayroll","isPendingCancel","usePayrollsCancelMutation","gustoEmbedded","useGustoEmbeddedContext","taxes","acc","compensation","tax","PayrollOverviewPresentation","result","blockerType","PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES","selectedOption","employeeId","newWindow","response","payrollsGetPayStub","pdfBlob","readableStreamToBlob","url","err","value","prev"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAMA,KAAoC,CAACC,IAA4C,OAC9EA,EAAS;AAAA,EACd,CAAAC,MACEA,EAAQ,WAAW,gBACnBA,EAAQ,kBACRA,EAAQ,eAAe,SAAS;AAAA,GAIhCC,KAAwB,CAC5BC,IAA8C,OACvB;AACvB,QAAMC,IAA0BD,EAAe,KAAK,CAAAF,MAAWA,EAAQ,WAAW,YAAY;AAE9F,SAAKG,GAAyB,iBAIJA,EAAwB,eAAe;AAAA,IAC/D,CAAAC,MAAUA,EAAO,gBAAgB;AAAA,EAAA,GAGT,SAAS,oBAPjC;AAQJ;AAEO,SAASC,GAAgBC,GAA6B;AAC3D,SACE,gBAAAC,EAACC,IAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,KAAO,CAAC;AAAA,EACnB,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC;AACF,MAA4B;AAC1B,EAAAC,GAAuB,2BAA2BH,CAAU,GAC5DI,GAAQ,yBAAyB;AACjC,QAAM,EAAE,mBAAAC,EAAA,IAAsBC,GAAA,GACxB,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChD,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAgBC,CAAiB,IAAIF,EAA6BT,KAAU,CAAA,CAAE,GAC/E,CAACY,GAAwBC,CAAyB,IAAIJ,EAAiC,CAAA,CAAE,GACzF,CAACK,GAA6BC,CAA8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AAA,CAAY,GACtE,IAAI,gBAAgBM,CAAG;AAAA,QACzB,SAASC,GAAK;AACZ,UAAIN,KACFA,EAAU,MAAA,GAEZrD,EAAa2D,CAAG;AAAA,QAClB;AAAA,MACF;AAAA,MA+BI,cAAcvB,KAAa7C,KAAagD;AAAA,MACxC,aACE3B,EAAY,mBAAmB,WAAWc,EAA0B;AAAA,MAEtE,aAAAd;AAAA,MACA,aAAAoB;AAAA,MACA,iBAAiBC,EAAa,iBAAiB,CAAA;AAAA,MAC/C,OAAAU;AAAA,MACA,QAAQjD;AAAA,MACR,oBAAAmB;AAAA,MACA,wBAAAjB;AAAA,MACA,uBAAuB,CAACqD,GAAaW,MAAU;AAC7C,QAAA/D,EAA0B,CAAAgE,OAAS,EAAE,GAAGA,GAAM,CAACZ,CAAW,GAAGW,IAAQ;AAAA,MACvE;AAAA,MACA,2BAAAxC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PayrollOverview.js","sources":["../../../../src/components/Payroll/PayrollOverview/PayrollOverview.tsx"],"sourcesContent":["import { usePayrollsSubmitMutation } from '@gusto/embedded-api/react-query/payrollsSubmit'\nimport { usePayrollsCancelMutation } from '@gusto/embedded-api/react-query/payrollsCancel'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { useTranslation } from 'react-i18next'\nimport { useBankAccountsGetSuspense } from '@gusto/embedded-api/react-query/bankAccountsGet'\nimport { useEmployeesListSuspense } from '@gusto/embedded-api/react-query/employeesList'\nimport { useWireInRequestsGet } from '@gusto/embedded-api/react-query/wireInRequestsGet'\nimport { useEffect, useState } from 'react'\nimport { useGustoEmbeddedContext } from '@gusto/embedded-api/react-query/_context'\nimport { payrollsGetPayStub } from '@gusto/embedded-api/funcs/payrollsGetPayStub'\nimport { useErrorBoundary } from 'react-error-boundary'\nimport type { PayrollSubmissionBlockersType } from '@gusto/embedded-api/models/components/payrollsubmissionblockerstype'\nimport type { PayrollCreditBlockersType } from '@gusto/embedded-api/models/components/payrollcreditblockerstype'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport {\n ConfirmWireDetails,\n type ConfirmWireDetailsComponentType,\n} from '../ConfirmWireDetails/ConfirmWireDetails'\nimport { PayrollOverviewPresentation } from './PayrollOverviewPresentation'\nimport {\n componentEvents,\n payrollWireEvents,\n PAYROLL_PROCESSING_STATUS,\n PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES,\n type EventType,\n} from '@/shared/constants'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { readableStreamToBlob } from '@/helpers/readableStreamToBlob'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { renderErrorList } from '@/helpers/apiErrorToList'\nimport { Flex } from '@/components/Common'\n\ninterface PayrollOverviewProps extends BaseComponentInterface<'Payroll.PayrollOverview'> {\n companyId: string\n payrollId: string\n alerts?: PayrollFlowAlert[]\n withReimbursements?: boolean\n ConfirmWireDetailsComponent?: ConfirmWireDetailsComponentType\n}\n\nconst findUnresolvedBlockersWithOptions = (blockers: PayrollSubmissionBlockersType[] = []) => {\n return blockers.filter(\n blocker =>\n blocker.status === 'unresolved' &&\n blocker.unblockOptions &&\n blocker.unblockOptions.length > 0,\n )\n}\n\nconst findWireInRequestUuid = (\n creditBlockers: PayrollCreditBlockersType[] = [],\n): string | undefined => {\n const unresolvedCreditBlocker = creditBlockers.find(blocker => blocker.status === 'unresolved')\n\n if (!unresolvedCreditBlocker?.unblockOptions) {\n return undefined\n }\n\n const wireUnblockOption = unresolvedCreditBlocker.unblockOptions.find(\n option => option.unblockType === 'submit_wire',\n )\n\n return wireUnblockOption?.metadata.wireInRequestUuid\n}\n\nexport function PayrollOverview(props: PayrollOverviewProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n companyId,\n payrollId,\n dictionary,\n onEvent,\n alerts,\n withReimbursements = true,\n ConfirmWireDetailsComponent = ConfirmWireDetails,\n}: PayrollOverviewProps) => {\n useComponentDictionary('Payroll.PayrollOverview', dictionary)\n useI18n('Payroll.PayrollOverview')\n const { baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.PayrollOverview')\n const [isPolling, setIsPolling] = useState(false)\n const [internalAlerts, setInternalAlerts] = useState<PayrollFlowAlert[]>(alerts || [])\n const [selectedUnblockOptions, setSelectedUnblockOptions] = useState<Record<string, string>>({})\n const [showWireDetailsConfirmation, setShowWireDetailsConfirmation] = useState(false)\n const { showBoundary } = useErrorBoundary()\n const formatCurrency = useNumberFormatter('currency')\n const dateFormatter = useDateFormatter()\n const { Button, UnorderedList, Text } = useComponentContext()\n const { data } = usePayrollsGetSuspense(\n {\n companyId,\n payrollId: payrollId,\n include: ['taxes', 'benefits', 'deductions'],\n },\n { refetchInterval: isPolling ? 5_000 : false },\n )\n const payrollData = data.payrollShow!\n const submissionBlockers = findUnresolvedBlockersWithOptions(payrollData.submissionBlockers)\n const wireInId = findWireInRequestUuid(payrollData.creditBlockers)\n\n const { data: wireInRequestData } = useWireInRequestsGet(\n {\n wireInRequestUuid: wireInId || '',\n },\n { enabled: !!wireInId },\n )\n const wireInRequest = wireInRequestData?.wireInRequest\n\n const onEdit = () => {\n onEvent(componentEvents.RUN_PAYROLL_EDIT)\n }\n\n const handleWireEvent = (type: EventType, data?: unknown) => {\n if (type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE) {\n setShowWireDetailsConfirmation(true)\n }\n onEvent(type, data)\n }\n\n const wireInConfirmationRequest = wireInId && (\n <ConfirmWireDetailsComponent\n companyId={companyId}\n wireInId={wireInId}\n onEvent={handleWireEvent}\n />\n )\n\n useEffect(() => {\n if (wireInRequest?.status === 'pending_review' && !showWireDetailsConfirmation) {\n setShowWireDetailsConfirmation(true)\n }\n }, [wireInRequest?.status, showWireDetailsConfirmation])\n\n useEffect(() => {\n if (showWireDetailsConfirmation) {\n const checkDate = dateFormatter.formatShortWithYear(payrollData.checkDate)\n\n setInternalAlerts([\n {\n type: 'success',\n title: t('alerts.wireDetailsSubmittedTitle'),\n content: <Text>{t('alerts.wireDetailsSubmittedMessage', { checkDate })}</Text>,\n onDismiss: () => {\n setShowWireDetailsConfirmation(false)\n },\n },\n ])\n }\n }, [showWireDetailsConfirmation, payrollData.checkDate, t, dateFormatter, Text])\n\n useEffect(() => {\n // Start polling when payroll is submitting and not already polling\n if (\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submitting &&\n !isPolling\n ) {\n setIsPolling(true)\n }\n // Stop polling and emit event when payroll is processed successfully\n if (\n isPolling &&\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submit_success\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSED)\n setInternalAlerts([\n {\n type: 'success',\n title: t('alerts.payrollProcessedTitle'),\n content: t('alerts.payrollProcessedMessage', {\n amount: formatCurrency(Number(payrollData.totals?.netPayDebit)),\n date: dateFormatter.formatShortWithYear(\n payrollData.payrollStatusMeta?.expectedDebitTime ?? payrollData.payrollDeadline,\n ),\n }),\n },\n ])\n setShowWireDetailsConfirmation(false)\n setIsPolling(false)\n }\n // If we are polling and payroll is in failed state, stop polling, and emit failure event\n if (\n isPolling &&\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.processing_failed\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setInternalAlerts([\n {\n type: 'error',\n title: t('alerts.payrollProcessingFailedTitle'),\n content: (\n <Flex flexDirection=\"column\" gap={16}>\n <UnorderedList items={renderErrorList(payrollData.processingRequest.errors ?? [])} />\n <Button variant=\"secondary\" onClick={onEdit}>\n {t('alerts.payrollProcessingFailedCtaLabel')}\n </Button>\n </Flex>\n ),\n },\n ])\n setShowWireDetailsConfirmation(false)\n setIsPolling(false)\n }\n }, [\n payrollData.processingRequest?.status,\n isPolling,\n onEvent,\n t,\n dateFormatter,\n formatCurrency,\n payrollData.totals?.netPayDebit,\n payrollData.payrollStatusMeta?.expectedDebitTime,\n payrollData.payrollDeadline,\n ])\n\n const { data: bankAccountData } = useBankAccountsGetSuspense({\n companyId,\n })\n const bankAccount = bankAccountData.companyBankAccounts?.[0]\n\n const { data: employeeData } = useEmployeesListSuspense({\n companyId,\n })\n\n const { mutateAsync: submitPayroll, isPending } = usePayrollsSubmitMutation()\n\n const { mutateAsync: cancelPayroll, isPending: isPendingCancel } = usePayrollsCancelMutation()\n\n if (!payrollData.calculatedAt) {\n throw new Error(t('alerts.payrollNotCalculated'))\n }\n const gustoEmbedded = useGustoEmbeddedContext()\n\n const taxes =\n payrollData.employeeCompensations?.reduce(\n (acc, compensation) => {\n compensation.taxes?.forEach(tax => {\n acc[tax.name] = {\n employee: (acc[tax.name]?.employee ?? 0) + (tax.employer ? 0 : tax.amount),\n employer: (acc[tax.name]?.employer ?? 0) + (tax.employer ? tax.amount : 0),\n }\n })\n\n return acc\n },\n {} as Record<string, { employee: number; employer: number }>,\n ) || {}\n\n const onCancel = async () => {\n await baseSubmitHandler(data, async () => {\n const result = await cancelPayroll({\n request: {\n companyId,\n payrollId,\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_CANCELLED, result)\n setInternalAlerts([])\n })\n }\n const onPayrollReceipt = () => {\n onEvent(componentEvents.RUN_PAYROLL_RECEIPT_GET, { payrollId })\n }\n\n const onPaystubDownload = async (employeeId: string) => {\n // Open a blank window *synchronously* with the click\n const newWindow = window.open('', '_blank')\n\n try {\n // Fetch the PDF from your API\n const response = await payrollsGetPayStub(gustoEmbedded, { payrollId, employeeId })\n if (!response.value?.responseStream) {\n throw new Error(t('alerts.paystubPdfError'))\n }\n const pdfBlob = await readableStreamToBlob(response.value.responseStream, 'application/pdf')\n\n const url = URL.createObjectURL(pdfBlob)\n\n // Load the PDF into the new window\n if (newWindow) {\n newWindow.location.href = url\n }\n onEvent(componentEvents.RUN_PAYROLL_PDF_PAYSTUB_VIEWED, { employeeId })\n URL.revokeObjectURL(url) // Clean up the URL object after use\n } catch (err) {\n if (newWindow) {\n newWindow.close()\n }\n showBoundary(err)\n }\n }\n const onSubmit = async () => {\n await baseSubmitHandler(data, async () => {\n const result = await submitPayroll({\n request: {\n companyId,\n payrollId,\n requestBody: {\n submissionBlockers: Object.entries(selectedUnblockOptions)\n .filter(([blockerType]) =>\n PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES.includes(blockerType),\n )\n .map(([blockerType, selectedOption]) => ({\n blockerType,\n selectedOption,\n })),\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_SUBMITTED, result)\n setIsPolling(true)\n })\n }\n\n return (\n <PayrollOverviewPresentation\n onEdit={onEdit}\n onSubmit={onSubmit}\n onCancel={onCancel}\n onPayrollReceipt={onPayrollReceipt}\n onPaystubDownload={onPaystubDownload}\n isSubmitting={isPending || isPolling || isPendingCancel}\n isProcessed={\n payrollData.processingRequest?.status === PAYROLL_PROCESSING_STATUS.submit_success\n }\n payrollData={payrollData}\n bankAccount={bankAccount}\n employeeDetails={employeeData.showEmployees || []}\n taxes={taxes}\n alerts={internalAlerts}\n submissionBlockers={submissionBlockers}\n selectedUnblockOptions={selectedUnblockOptions}\n onUnblockOptionChange={(blockerType, value) => {\n setSelectedUnblockOptions(prev => ({ ...prev, [blockerType]: value }))\n }}\n wireInConfirmationRequest={wireInConfirmationRequest}\n withReimbursements={withReimbursements}\n />\n )\n}\n"],"names":["findUnresolvedBlockersWithOptions","blockers","blocker","findWireInRequestUuid","creditBlockers","unresolvedCreditBlocker","option","PayrollOverview","props","jsx","BaseComponent","Root","companyId","payrollId","dictionary","onEvent","alerts","withReimbursements","ConfirmWireDetailsComponent","ConfirmWireDetails","useComponentDictionary","useI18n","baseSubmitHandler","useBase","t","useTranslation","isPolling","setIsPolling","useState","internalAlerts","setInternalAlerts","selectedUnblockOptions","setSelectedUnblockOptions","showWireDetailsConfirmation","setShowWireDetailsConfirmation","showBoundary","useErrorBoundary","formatCurrency","useNumberFormatter","dateFormatter","useDateFormatter","Button","UnorderedList","Text","useComponentContext","data","usePayrollsGetSuspense","payrollData","submissionBlockers","wireInId","wireInRequestData","useWireInRequestsGet","wireInRequest","onEdit","componentEvents","wireInConfirmationRequest","type","payrollWireEvents","useEffect","checkDate","PAYROLL_PROCESSING_STATUS","jsxs","Flex","renderErrorList","bankAccountData","useBankAccountsGetSuspense","bankAccount","employeeData","useEmployeesListSuspense","submitPayroll","isPending","usePayrollsSubmitMutation","cancelPayroll","isPendingCancel","usePayrollsCancelMutation","gustoEmbedded","useGustoEmbeddedContext","taxes","acc","compensation","tax","PayrollOverviewPresentation","result","blockerType","PAYROLL_RESOLVABLE_SUBMISSION_BLOCKER_TYPES","selectedOption","employeeId","newWindow","response","payrollsGetPayStub","pdfBlob","readableStreamToBlob","url","err","value","prev"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAMA,KAAoC,CAACC,IAA4C,OAC9EA,EAAS;AAAA,EACd,CAAAC,MACEA,EAAQ,WAAW,gBACnBA,EAAQ,kBACRA,EAAQ,eAAe,SAAS;AAAA,GAIhCC,KAAwB,CAC5BC,IAA8C,OACvB;AACvB,QAAMC,IAA0BD,EAAe,KAAK,CAAAF,MAAWA,EAAQ,WAAW,YAAY;AAE9F,SAAKG,GAAyB,iBAIJA,EAAwB,eAAe;AAAA,IAC/D,CAAAC,MAAUA,EAAO,gBAAgB;AAAA,EAAA,GAGT,SAAS,oBAPjC;AAQJ;AAEO,SAASC,GAAgBC,GAA6B;AAC3D,SACE,gBAAAC,EAACC,IAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,KAAO,CAAC;AAAA,EACnB,WAAAC;AAAA,EACA,WAAAC;AA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QuC,EAAgB,yBAAyB,EAAE,WAAAzC,EAAA,CAAW;AAAA,MAChE;AAAA,MA0DI,mBAxDsB,OAAOyE,MAAuB;AAEtD,cAAMC,IAAY,OAAO,KAAK,IAAI,QAAQ;AAE1C,YAAI;AAEF,gBAAMC,IAAW,MAAMC,GAAmBd,GAAe,EAAE,WAAA9D,GAAW,YAAAyE,GAAY;AAClF,cAAI,CAACE,EAAS,OAAO;AACnB,kBAAM,IAAI,MAAMhE,EAAE,wBAAwB,CAAC;AAE7C,gBAAMkE,IAAU,MAAMC,GAAqBH,EAAS,MAAM,gBAAgB,iBAAiB,GAErFI,IAAM,IAAI,gBAAgBF,CAAO;AAGvC,UAAIH,MACFA,EAAU,SAAS,OAAOK,IAE5B7E,EAAQuC,EAAgB,gCAAgC,EAAE,YAAAgC,EAAA,CAAY,GACtE,IAAI,gBAAgBM,CAAG;AAAA,QACzB,SAASC,GAAK;AACZ,UAAIN,KACFA,EAAU,MAAA,GAEZpD,EAAa0D,CAAG;AAAA,QAClB;AAAA,MACF;AAAA,MA+BI,cAAcvB,KAAa5C,KAAa+C;AAAA,MACxC,aACE1B,EAAY,mBAAmB,WAAWa,EAA0B;AAAA,MAEtE,aAAAb;AAAA,MACA,aAAAmB;AAAA,MACA,iBAAiBC,EAAa,iBAAiB,CAAA;AAAA,MAC/C,OAAAU;AAAA,MACA,QAAQhD;AAAA,MACR,oBAAAmB;AAAA,MACA,wBAAAjB;AAAA,MACA,uBAAuB,CAACoD,GAAaW,MAAU;AAC7C,QAAA9D,EAA0B,CAAA+D,OAAS,EAAE,GAAGA,GAAM,CAACZ,CAAW,GAAGW,IAAQ;AAAA,MACvE;AAAA,MACA,2BAAAvC;AAAA,MACA,oBAAAtC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -23,6 +23,7 @@ interface PayrollOverviewProps {
23
23
  onPayrollReceipt: () => void;
24
24
  onPaystubDownload: (employeeId: string) => void;
25
25
  onUnblockOptionChange?: (blockerType: string, value: string) => void;
26
+ withReimbursements?: boolean;
26
27
  }
27
- export declare const PayrollOverviewPresentation: ({ onEdit, onSubmit, onCancel, onPayrollReceipt, onPaystubDownload, employeeDetails, payrollData, bankAccount, taxes, isSubmitting, isProcessed, alerts, submissionBlockers, selectedUnblockOptions, onUnblockOptionChange, wireInConfirmationRequest, }: PayrollOverviewProps) => import("react/jsx-runtime").JSX.Element;
28
+ export declare const PayrollOverviewPresentation: ({ onEdit, onSubmit, onCancel, onPayrollReceipt, onPaystubDownload, employeeDetails, payrollData, bankAccount, taxes, isSubmitting, isProcessed, alerts, submissionBlockers, selectedUnblockOptions, onUnblockOptionChange, wireInConfirmationRequest, withReimbursements, }: PayrollOverviewProps) => import("react/jsx-runtime").JSX.Element;
28
29
  export {};