@gusto/embedded-react-sdk 0.55.2 → 0.55.3

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 (75) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/components/Common/FieldLayout/FieldLayout.js +6 -6
  3. package/dist/components/Common/Fieldset/Fieldset.js +6 -6
  4. package/dist/components/Common/HorizontalFieldLayout/HorizontalFieldLayout.js +6 -6
  5. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js +58 -49
  6. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.js.map +1 -1
  7. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js +14 -10
  8. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBox.module.scss.js.map +1 -1
  9. package/dist/components/Common/UI/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +4 -0
  10. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -3
  11. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  12. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -3
  13. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  14. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -5
  15. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  16. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -3
  17. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  18. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.d.ts +4 -0
  19. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  20. package/dist/components/Company/DocumentSigner/DocumentList/List.js +11 -8
  21. package/dist/components/Company/DocumentSigner/DocumentList/List.js.map +1 -1
  22. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  23. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  24. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -8
  25. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  26. package/dist/components/Company/Industry/Context.js +8 -6
  27. package/dist/components/Company/Industry/Context.js.map +1 -1
  28. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -3
  29. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  30. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -3
  31. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  32. package/dist/components/Company/OnboardingOverview/context.js +5 -3
  33. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  34. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -3
  35. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  36. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -3
  37. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  38. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +5 -3
  39. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  40. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +116 -116
  41. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
  42. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.d.ts +4 -0
  43. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +19 -19
  44. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  45. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js +16 -13
  46. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/List.js.map +1 -1
  47. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  48. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  49. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.d.ts +4 -0
  50. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
  51. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +75 -71
  52. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  53. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +137 -138
  54. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  55. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +1 -1
  56. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  57. package/dist/components/Payroll/PayrollOverview/PayrollOverview.d.ts +8 -1
  58. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +174 -161
  59. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  60. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  61. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +42 -41
  62. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  63. package/dist/components/Payroll/helpers.d.ts +0 -15
  64. package/dist/components/Payroll/helpers.js +13 -18
  65. package/dist/components/Payroll/helpers.js.map +1 -1
  66. package/dist/components/Payroll/usePreparedPayrollData.js +10 -8
  67. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  68. package/dist/i18n/en/Company.DocumentList.json.js +34 -32
  69. package/dist/i18n/en/Company.DocumentList.json.js.map +1 -1
  70. package/dist/i18n/en/Employee.DocumentSigner.json.js +24 -22
  71. package/dist/i18n/en/Employee.DocumentSigner.json.js.map +1 -1
  72. package/dist/i18n/en/Payroll.PayrollOverview.json.js +5 -5
  73. package/dist/i18n/types.d.ts +311 -1
  74. package/dist/style.css +1 -1
  75. package/package.json +5 -5
@@ -1,98 +1,97 @@
1
- import { jsx as C, jsxs as fe, Fragment as Ce } from "react/jsx-runtime";
2
- import { useState as f, useRef as q, useMemo as F, useEffect as D } from "react";
1
+ import { jsx as f, jsxs as fe, Fragment as Ce } from "react/jsx-runtime";
2
+ import { useState as y, useRef as B, useMemo as q, useEffect as D } from "react";
3
3
  import { useQueryClient as Pe } from "@tanstack/react-query";
4
4
  import { usePayrollsGetSuspense as Ue } from "@gusto/embedded-api/react-query/payrollsGet";
5
- import { payrollsCalculate as ge } from "@gusto/embedded-api/funcs/payrollsCalculate";
6
- import { useGustoEmbeddedContext as he } from "@gusto/embedded-api/react-query/_context";
7
- import { PayrollProcessingRequestStatus as O } from "@gusto/embedded-api/models/components/payrollprocessingrequest";
8
- import { useTranslation as Le } from "react-i18next";
5
+ import { payrollsCalculate as Le } from "@gusto/embedded-api/funcs/payrollsCalculate";
6
+ import { useGustoEmbeddedContext as ge } from "@gusto/embedded-api/react-query/_context";
7
+ import { PayrollProcessingRequestStatus as E } from "@gusto/embedded-api/models/components/payrollprocessingrequest";
8
+ import { useTranslation as he } from "react-i18next";
9
9
  import { usePayrollsUpdateMutation as Se } from "@gusto/embedded-api/react-query/payrollsUpdate";
10
10
  import { usePayrollsCalculateGrossUpMutation as Ae } from "@gusto/embedded-api/react-query/payrollsCalculateGrossUp";
11
11
  import { usePayrollsGetBlockersSuspense as _e } from "@gusto/embedded-api/react-query/payrollsGetBlockers";
12
12
  import { payrollSubmitHandler as we } from "../PayrollBlocker/payrollHelpers.js";
13
- import { hasDirectDepositEmployees as Re } from "../helpers.js";
14
- import { PayrollOverview as Ee } from "../PayrollOverview/PayrollOverview.js";
13
+ import { PayrollOverview as Re } from "../PayrollOverview/PayrollOverview.js";
15
14
  import { PayrollConfigurationPresentation as De } from "./PayrollConfigurationPresentation.js";
16
- import { usePayrollConfigurationData as Oe } from "./usePayrollConfigurationData.js";
17
- import { isGrossUpEligible as Te, getGrossUpTargetCompensationName as xe } from "./grossUpHelpers.js";
18
- import { BaseComponent as be } from "../../Base/Base.js";
15
+ import { usePayrollConfigurationData as Ee } from "./usePayrollConfigurationData.js";
16
+ import { isGrossUpEligible as Oe, getGrossUpTargetCompensationName as Te } from "./grossUpHelpers.js";
17
+ import { BaseComponent as xe } from "../../Base/Base.js";
19
18
  import { componentEvents as l } from "../../../shared/constants.js";
20
- import { useComponentDictionary as ke, useI18n as Ne } from "../../../i18n/I18n.js";
21
- import { useBase as Ge } from "../../Base/useBase.js";
22
- import { useDateFormatter as Ye } from "../../../hooks/useDateFormatter.js";
23
- import { SDKInternalError as j } from "../../../types/sdkError.js";
24
- import { API_QUERY_NAMESPACE as Me } from "../../../contexts/ApiProvider/apiVersion.js";
25
- import { GrossUpModal as Be } from "../GrossUpModal/GrossUpModal.js";
26
- const qe = (t) => t?.status === O.Calculating, Fe = (t, u) => u != null && (t?.status === O.CalculateSuccess || t == null);
27
- function fo(t) {
28
- return /* @__PURE__ */ C(be, { ...t, children: /* @__PURE__ */ C(je, { ...t, children: t.children }) });
19
+ import { useComponentDictionary as be, useI18n as ke } from "../../../i18n/I18n.js";
20
+ import { useBase as Ne } from "../../Base/useBase.js";
21
+ import { useDateFormatter as Ge } from "../../../hooks/useDateFormatter.js";
22
+ import { SDKInternalError as F } from "../../../types/sdkError.js";
23
+ import { API_QUERY_NAMESPACE as Ye } from "../../../contexts/ApiProvider/apiVersion.js";
24
+ import { GrossUpModal as Me } from "../GrossUpModal/GrossUpModal.js";
25
+ const Be = (t) => t?.status === E.Calculating, qe = (t, u) => u != null && (t?.status === E.CalculateSuccess || t == null);
26
+ function mo(t) {
27
+ return /* @__PURE__ */ f(xe, { ...t, children: /* @__PURE__ */ f(Fe, { ...t, children: t.children }) });
29
28
  }
30
- const je = ({
29
+ const Fe = ({
31
30
  onEvent: t,
32
31
  companyId: u,
33
32
  payrollId: i,
34
- dictionary: v,
35
- alerts: W,
36
- withReimbursements: T = !0
33
+ dictionary: j,
34
+ alerts: v,
35
+ withReimbursements: O = !0
37
36
  }) => {
38
- ke("Payroll.PayrollConfiguration", v), Ne("Payroll.PayrollConfiguration");
39
- const { t: p } = Le("Payroll.PayrollConfiguration"), { baseSubmitHandler: P } = Ge(), c = Ye(), [n, m] = f(!1), [g, x] = f(!1), h = q(null), K = he(), H = Pe(), { data: s } = Ue(
37
+ be("Payroll.PayrollConfiguration", j), ke("Payroll.PayrollConfiguration");
38
+ const { t: c } = he("Payroll.PayrollConfiguration"), { baseSubmitHandler: C } = Ne(), p = Ge(), [n, m] = y(!1), [U, T] = y(!1), L = B(null), W = ge(), K = Pe(), { data: s } = Ue(
40
39
  {
41
40
  companyId: u,
42
41
  payrollId: i,
43
42
  include: ["taxes", "benefits", "deductions", "payroll_status_meta"]
44
43
  },
45
44
  { refetchInterval: n ? 5e3 : !1 }
46
- ), V = F(
45
+ ), H = q(
47
46
  () => s.payrollShow?.employeeCompensations?.filter((e) => e.excluded).map((e) => e.employeeUuid).filter(Boolean) ?? [],
48
47
  [s.payrollShow?.employeeCompensations]
49
48
  ), {
50
- employeeDetails: I,
51
- employeeCompensations: b,
52
- paySchedule: Q,
53
- payPeriod: J,
54
- payrollCategory: L,
55
- pagination: z,
56
- isLoading: X,
57
- isAlreadyProcessed: S,
58
- refetch: A
59
- } = Oe({
49
+ employeeDetails: V,
50
+ employeeCompensations: x,
51
+ paySchedule: I,
52
+ payPeriod: Q,
53
+ payrollCategory: g,
54
+ pagination: J,
55
+ isLoading: z,
56
+ isAlreadyProcessed: h,
57
+ refetch: S
58
+ } = Ee({
60
59
  companyId: u,
61
60
  payrollId: i,
62
- isCalculating: n || g,
63
- excludedEmployeeUuids: V
64
- }), _ = F(
61
+ isCalculating: n || U,
62
+ excludedEmployeeUuids: H
63
+ }), A = q(
65
64
  () => ({
66
65
  type: "error",
67
- title: p("alerts.alreadyProcessed"),
66
+ title: c("alerts.alreadyProcessed"),
68
67
  alertKey: "alreadyProcessed"
69
68
  }),
70
- [p]
71
- ), w = q(!1);
69
+ [c]
70
+ ), _ = B(!1);
72
71
  D(() => {
73
- if (!S) {
74
- w.current = !1;
72
+ if (!h) {
73
+ _.current = !1;
75
74
  return;
76
75
  }
77
- w.current || (w.current = !0, t(l.RUN_PAYROLL_ALREADY_PROCESSED, {
76
+ _.current || (_.current = !0, t(l.RUN_PAYROLL_ALREADY_PROCESSED, {
78
77
  payrollId: i,
79
- alert: _,
78
+ alert: A,
80
79
  payPeriod: s.payrollShow?.payPeriod
81
80
  }));
82
81
  }, [
83
- S,
82
+ h,
84
83
  t,
85
84
  i,
86
- _,
85
+ A,
87
86
  s.payrollShow?.payPeriod
88
87
  ]);
89
- const { mutateAsync: k, isPending: Z } = Se(), { mutateAsync: $ } = Ae(), [d, N] = f(null), [ee, R] = f(!1), G = Te(L), U = xe(L), oe = (e) => {
90
- N(e), R(!0), t(l.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid: e });
91
- }, te = async (e) => {
88
+ const { mutateAsync: b, isPending: X } = Se(), { mutateAsync: Z } = Ae(), [d, k] = y(null), [$, w] = y(!1), N = Oe(g), P = Te(g), ee = (e) => {
89
+ k(e), w(!0), t(l.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid: e });
90
+ }, oe = async (e) => {
92
91
  if (!d) return null;
93
92
  let o = null;
94
- return await P(null, async () => {
95
- o = (await $({
93
+ return await C(null, async () => {
94
+ o = (await Z({
96
95
  request: {
97
96
  payrollUuid: i,
98
97
  payrollGrossUpRequest: {
@@ -106,25 +105,25 @@ const je = ({
106
105
  employeeUuid: d
107
106
  });
108
107
  }), o;
109
- }, ae = async (e) => {
110
- if (!d || !U)
111
- throw new j(
108
+ }, te = async (e) => {
109
+ if (!d || !P)
110
+ throw new F(
112
111
  "Unable to apply gross-up: missing employee or target compensation."
113
112
  );
114
- const o = b.find((a) => a.employeeUuid === d);
113
+ const o = x.find((a) => a.employeeUuid === d);
115
114
  if (!o)
116
- throw new j("Unable to apply gross-up: employee compensation not found.");
117
- const r = o.fixedCompensations ?? [], y = r.some(
118
- (a) => a.name?.toLowerCase() === U.toLowerCase()
119
- ), B = r.map((a) => ({
115
+ throw new F("Unable to apply gross-up: employee compensation not found.");
116
+ const r = o.fixedCompensations ?? [], pe = r.some(
117
+ (a) => a.name?.toLowerCase() === P.toLowerCase()
118
+ ), M = r.map((a) => ({
120
119
  name: a.name,
121
120
  jobUuid: a.jobUuid,
122
- amount: a.name?.toLowerCase() === U.toLowerCase() ? e : "0"
121
+ amount: a.name?.toLowerCase() === P.toLowerCase() ? e : "0"
123
122
  }));
124
- if (!y) {
123
+ if (!pe) {
125
124
  const a = o.hourlyCompensations?.[0]?.jobUuid ?? r[0]?.jobUuid ?? "";
126
- B.push({
127
- name: U,
125
+ M.push({
126
+ name: P,
128
127
  jobUuid: a,
129
128
  amount: e
130
129
  });
@@ -136,14 +135,14 @@ const je = ({
136
135
  })), de = (o.paidTimeOff ?? []).map((a) => ({
137
136
  name: a.name,
138
137
  hours: "0"
139
- })), ye = M({
138
+ })), ye = Y({
140
139
  ...o,
141
- fixedCompensations: B,
140
+ fixedCompensations: M,
142
141
  hourlyCompensations: me,
143
142
  paidTimeOff: de
144
143
  });
145
- await P({}, async () => {
146
- const a = await k({
144
+ await C({}, async () => {
145
+ const a = await b({
147
146
  request: {
148
147
  companyId: u,
149
148
  payrollId: i,
@@ -154,43 +153,43 @@ const je = ({
154
153
  });
155
154
  t(l.RUN_PAYROLL_EMPLOYEE_SAVED, {
156
155
  payrollPrepared: a.payrollPrepared
157
- }), await A();
158
- }), N(null), R(!1);
159
- }, se = async (e) => {
156
+ }), await S();
157
+ }), k(null), w(!1);
158
+ }, ae = async (e) => {
160
159
  try {
161
- await ae(e);
160
+ await te(e);
162
161
  } catch {
163
162
  }
164
- }, { data: re } = _e({
163
+ }, { data: se } = _e({
165
164
  companyUuid: u
166
- }), Y = (re.payrollBlockers ?? []).map((e) => ({
165
+ }), G = (se.payrollBlockers ?? []).map((e) => ({
167
166
  key: e.key,
168
167
  message: e.message
169
- })), [le, E] = f(Y), ie = async () => {
170
- E([]), h.current = s.payrollShow?.calculatedAt?.getTime() ?? null, await P({}, async () => {
168
+ })), [re, R] = y(G), le = async () => {
169
+ R([]), L.current = s.payrollShow?.calculatedAt?.getTime() ?? null, await C({}, async () => {
171
170
  const e = await we(async () => {
172
- x(!0);
171
+ T(!0);
173
172
  try {
174
- const o = await ge(K, {
173
+ const o = await Le(W, {
175
174
  companyId: u,
176
175
  payrollId: i
177
176
  });
178
177
  if (!o.ok)
179
178
  throw o.error;
180
- H.invalidateQueries({ queryKey: [Me] }), m(!0);
179
+ K.invalidateQueries({ queryKey: [Ye] }), m(!0);
181
180
  } finally {
182
- x(!1);
181
+ T(!1);
183
182
  }
184
183
  });
185
- !e.success && e.blockers.length > 0 && E(e.blockers);
184
+ !e.success && e.blockers.length > 0 && R(e.blockers);
186
185
  });
187
- }, ne = (e) => {
186
+ }, ie = (e) => {
188
187
  t(l.RUN_PAYROLL_EMPLOYEE_EDIT, {
189
188
  employeeId: e.uuid,
190
189
  firstName: e.firstName,
191
190
  lastName: e.lastName
192
191
  });
193
- }, M = (e) => {
192
+ }, Y = (e) => {
194
193
  const { paymentMethod: o } = e;
195
194
  return {
196
195
  employeeUuid: e.employeeUuid,
@@ -203,11 +202,11 @@ const je = ({
203
202
  ...o && o !== "Historical" ? { paymentMethod: o } : {},
204
203
  memo: e.memo || void 0
205
204
  };
206
- }, ue = async (e) => {
205
+ }, ne = async (e) => {
207
206
  t(l.RUN_PAYROLL_EMPLOYEE_SKIP, {
208
207
  employeeId: e.employeeUuid
209
- }), await P({}, async () => {
210
- const o = M(e), r = await k({
208
+ }), await C({}, async () => {
209
+ const o = Y(e), r = await b({
211
210
  request: {
212
211
  companyId: u,
213
212
  payrollId: i,
@@ -220,29 +219,29 @@ const je = ({
220
219
  });
221
220
  t(l.RUN_PAYROLL_EMPLOYEE_SAVED, {
222
221
  payrollPrepared: r.payrollPrepared
223
- }), await A();
222
+ }), await S();
224
223
  });
225
- }, pe = () => {
224
+ }, ue = () => {
226
225
  t(l.RUN_PAYROLL_BLOCKERS_VIEW_ALL);
227
226
  };
228
227
  D(() => {
229
- qe(s.payrollShow?.processingRequest) && !n && (h.current = s.payrollShow?.calculatedAt?.getTime() ?? null, m(!0));
230
- const e = s.payrollShow?.calculatedAt, o = e?.getTime() !== h.current;
231
- n && o && Fe(s.payrollShow?.processingRequest, e) && (t(l.RUN_PAYROLL_CALCULATED, {
228
+ Be(s.payrollShow?.processingRequest) && !n && (L.current = s.payrollShow?.calculatedAt?.getTime() ?? null, m(!0));
229
+ const e = s.payrollShow?.calculatedAt, o = e?.getTime() !== L.current;
230
+ n && o && qe(s.payrollShow?.processingRequest, e) && (t(l.RUN_PAYROLL_CALCULATED, {
232
231
  payrollId: i,
233
232
  alert: {
234
233
  type: "success",
235
- title: p("alerts.progressSaved"),
234
+ title: c("alerts.progressSaved"),
236
235
  alertKey: "progressSaved"
237
236
  },
238
237
  payPeriod: s.payrollShow?.payPeriod
239
- }), E([]), m(!1)), n && s.payrollShow?.processingRequest?.status === O.ProcessingFailed && (t(l.RUN_PAYROLL_PROCESSING_FAILED), m(!1));
238
+ }), R([]), m(!1)), n && s.payrollShow?.processingRequest?.status === E.ProcessingFailed && (t(l.RUN_PAYROLL_PROCESSING_FAILED), m(!1));
240
239
  }, [
241
240
  s.payrollShow?.processingRequest?.status,
242
241
  s.payrollShow?.calculatedAt,
243
242
  n,
244
243
  t,
245
- p,
244
+ c,
246
245
  i
247
246
  ]), D(() => {
248
247
  if (!n) return;
@@ -257,76 +256,76 @@ const je = ({
257
256
  const e = s.payrollShow?.payrollStatusMeta;
258
257
  if (e?.payrollLate && e.initialCheckDate && e.expectedDebitTime && e.expectedCheckDate)
259
258
  return {
260
- label: p("alerts.payrollLate", {
261
- initialCheckDate: c.formatShortWithWeekday(e.initialCheckDate)
259
+ label: c("alerts.payrollLate", {
260
+ initialCheckDate: p.formatShortWithWeekday(e.initialCheckDate)
262
261
  }),
263
- content: p("alerts.payrollLateText", {
264
- ...c.formatWithTime(e.expectedDebitTime),
265
- newCheckDate: c.formatShortWithWeekday(e.expectedCheckDate)
262
+ content: c("alerts.payrollLateText", {
263
+ ...p.formatWithTime(e.expectedDebitTime),
264
+ newCheckDate: p.formatShortWithWeekday(e.expectedCheckDate)
266
265
  }),
267
266
  variant: "warning"
268
267
  };
269
- const { payrollShow: r } = s, y = r?.employeeCompensations;
270
- if (r && y && y.length > 0 && Re(y))
268
+ const { payrollShow: r } = s;
269
+ if (r?.checkDate && r.payrollDeadline)
271
270
  return {
272
- label: p("alerts.directDepositDeadline", {
273
- payDate: c.formatShortWithWeekday(r.checkDate),
274
- ...c.formatWithTime(r.payrollDeadline)
271
+ label: c("alerts.directDepositDeadline", {
272
+ payDate: p.formatShortWithWeekday(r.checkDate),
273
+ ...p.formatWithTime(r.payrollDeadline)
275
274
  }),
276
- content: p("alerts.directDepositDeadlineText"),
275
+ content: c("alerts.directDepositDeadlineText"),
277
276
  variant: "info"
278
277
  };
279
278
  })();
280
- return S ? /* @__PURE__ */ C(
281
- Ee,
279
+ return h ? /* @__PURE__ */ f(
280
+ Re,
282
281
  {
283
282
  companyId: u,
284
283
  payrollId: i,
285
284
  onEvent: (o, r) => {
286
- o === l.RUN_PAYROLL_CANCELLED && A(), t(o, r);
285
+ o === l.RUN_PAYROLL_CANCELLED && S(), t(o, r);
287
286
  },
288
- withReimbursements: T,
289
- alerts: [_]
287
+ withReimbursements: O,
288
+ alerts: [A]
290
289
  }
291
290
  ) : /* @__PURE__ */ fe(Ce, { children: [
292
- /* @__PURE__ */ C(
291
+ /* @__PURE__ */ f(
293
292
  De,
294
293
  {
295
- onCalculatePayroll: ie,
296
- isCalculateDisabled: Y.length > 0,
297
- onEdit: ne,
298
- onToggleExclude: ue,
299
- onViewBlockers: pe,
300
- employeeCompensations: b,
301
- employeeDetails: I,
302
- payPeriod: J,
303
- paySchedule: Q,
304
- payrollCategory: L,
305
- alerts: W,
294
+ onCalculatePayroll: le,
295
+ isCalculateDisabled: G.length > 0,
296
+ onEdit: ie,
297
+ onToggleExclude: ne,
298
+ onViewBlockers: ue,
299
+ employeeCompensations: x,
300
+ employeeDetails: V,
301
+ payPeriod: Q,
302
+ paySchedule: I,
303
+ payrollCategory: g,
304
+ alerts: v,
306
305
  payrollAlert: ce,
307
- isPending: n || X || Z || g,
308
- isCalculating: g || n,
309
- payrollBlockers: le,
310
- pagination: z,
311
- withReimbursements: T,
312
- grossUpEnabled: G,
313
- onGrossUpSelect: oe
306
+ isPending: n || z || X || U,
307
+ isCalculating: U || n,
308
+ payrollBlockers: re,
309
+ pagination: J,
310
+ withReimbursements: O,
311
+ grossUpEnabled: N,
312
+ onGrossUpSelect: ee
314
313
  }
315
314
  ),
316
- G && /* @__PURE__ */ C(
317
- Be,
315
+ N && /* @__PURE__ */ f(
316
+ Me,
318
317
  {
319
- isOpen: ee,
320
- onCalculateGrossUp: te,
321
- onApply: se,
318
+ isOpen: $,
319
+ onCalculateGrossUp: oe,
320
+ onApply: ae,
322
321
  onCancel: () => {
323
- R(!1);
322
+ w(!1);
324
323
  }
325
324
  }
326
325
  )
327
326
  ] });
328
327
  };
329
328
  export {
330
- fo as PayrollConfiguration
329
+ mo as PayrollConfiguration
331
330
  };
332
331
  //# sourceMappingURL=PayrollConfiguration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayrollConfiguration.js","sources":["../../../../src/components/Payroll/PayrollConfiguration/PayrollConfiguration.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { payrollsCalculate } from '@gusto/embedded-api/funcs/payrollsCalculate'\nimport { useGustoEmbeddedContext } from '@gusto/embedded-api/react-query/_context'\nimport type { PayrollProcessingRequest } from '@gusto/embedded-api/models/components/payrollprocessingrequest'\nimport { PayrollProcessingRequestStatus } from '@gusto/embedded-api/models/components/payrollprocessingrequest'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useTranslation } from 'react-i18next'\nimport { usePayrollsUpdateMutation } from '@gusto/embedded-api/react-query/payrollsUpdate'\nimport { usePayrollsCalculateGrossUpMutation } from '@gusto/embedded-api/react-query/payrollsCalculateGrossUp'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateEmployeeCompensations } from '@gusto/embedded-api/models/components/payrollupdate'\nimport { usePayrollsGetBlockersSuspense } from '@gusto/embedded-api/react-query/payrollsGetBlockers'\nimport { payrollSubmitHandler, type ApiPayrollBlocker } from '../PayrollBlocker/payrollHelpers'\nimport { hasDirectDepositEmployees } from '../helpers'\nimport { GrossUpModal } from '../GrossUpModal'\nimport { PayrollOverview } from '../PayrollOverview/PayrollOverview'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport { PayrollConfigurationPresentation } from './PayrollConfigurationPresentation'\nimport { usePayrollConfigurationData } from './usePayrollConfigurationData'\nimport { getGrossUpTargetCompensationName, isGrossUpEligible } from './grossUpHelpers'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { useBase } from '@/components/Base'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { API_QUERY_NAMESPACE } from '@/contexts/ApiProvider/apiVersion'\n\nconst isCalculatingStatus = (processingRequest?: PayrollProcessingRequest | null) =>\n processingRequest?.status === PayrollProcessingRequestStatus.Calculating\n\nconst isCalculatedStatus = (\n processingRequest?: PayrollProcessingRequest | null,\n calculatedAt?: Date | null,\n) =>\n calculatedAt != null &&\n (processingRequest?.status === PayrollProcessingRequestStatus.CalculateSuccess ||\n processingRequest == null)\n\n/**\n * Props for {@link PayrollConfiguration}.\n *\n * @public\n */\nexport interface PayrollConfigurationProps extends BaseComponentInterface<'Payroll.PayrollConfiguration'> {\n /** The associated company identifier. */\n companyId: string\n /** The associated payroll identifier. */\n payrollId: string\n /** Optional alert components to render above the configuration content. */\n alerts?: ReactNode\n /** Whether to show the reimbursements column in the compensation table. Defaults to `true`. */\n withReimbursements?: boolean\n}\n\n/**\n * Handles the configuration phase of payroll processing, allowing users to review and modify employee compensation before calculating the payroll.\n *\n * @remarks\n * If the payroll turns out to already be processed (e.g. another actor submitted it while this\n * screen was open), this component emits `runPayroll/alreadyProcessed` and then renders\n * {@link PayrollOverview} in its place — the read-only breakdown with the gated \"Cancel payroll\"\n * action — instead of the configuration table. Events from that delegated view (e.g.\n * `runPayroll/cancelled`) are emitted through this component's own `onEvent`.\n *\n * Emits the following events:\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `runPayroll/employee/edit` | An employee row is selected for editing | `{ employeeId, firstName, lastName }` |\n * | `runPayroll/employee/skip` | An employee is skipped or unskipped for this payroll | `{ employeeId }` |\n * | `runPayroll/employee/saved` | Employee compensation changes are persisted | `{ payrollPrepared }` |\n * | `runPayroll/calculated` | Payroll calculation completes successfully | `{ payrollId, alert, payPeriod }` |\n * | `runPayroll/alreadyProcessed` | The payroll turns out to already be processed while configuring it | `{ payrollId, alert, payPeriod }` |\n * | `runPayroll/processingFailed` | Payroll calculation fails or times out | — |\n * | `runPayroll/blockers/viewAll` | The \"view all blockers\" affordance is selected | — |\n * | `runPayroll/grossUp/selected` | The set-net-earnings menu item is selected for an employee | `{ employeeUuid }` |\n * | `runPayroll/grossUp/calculated` | A gross-up amount is calculated from a target net pay | `{ grossUp, netPay, employeeUuid }` |\n *\n * @param props - See {@link PayrollConfigurationProps}.\n * @returns The payroll configuration screen.\n * @public\n */\nexport function PayrollConfiguration(props: PayrollConfigurationProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n onEvent,\n companyId,\n payrollId,\n dictionary,\n alerts,\n withReimbursements = true,\n}: PayrollConfigurationProps) => {\n useComponentDictionary('Payroll.PayrollConfiguration', dictionary)\n useI18n('Payroll.PayrollConfiguration')\n const { t } = useTranslation('Payroll.PayrollConfiguration')\n const { baseSubmitHandler } = useBase()\n const dateFormatter = useDateFormatter()\n\n const [isPolling, setIsPolling] = useState(false)\n const [isCalculatingPayroll, setIsCalculatingPayroll] = useState(false)\n const previousCalculatedAtRef = useRef<number | null>(null)\n const gustoClient = useGustoEmbeddedContext()\n const queryClient = useQueryClient()\n\n const { data: payrollData } = usePayrollsGetSuspense(\n {\n companyId,\n payrollId,\n include: ['taxes', 'benefits', 'deductions', 'payroll_status_meta'],\n },\n { refetchInterval: isPolling ? 5_000 : false },\n )\n\n const excludedEmployeeUuids = useMemo(\n () =>\n payrollData.payrollShow?.employeeCompensations\n ?.filter(comp => comp.excluded)\n .map(comp => comp.employeeUuid!)\n .filter(Boolean) ?? [],\n [payrollData.payrollShow?.employeeCompensations],\n )\n\n const {\n employeeDetails,\n employeeCompensations,\n paySchedule,\n payPeriod,\n payrollCategory,\n pagination,\n isLoading,\n isAlreadyProcessed,\n refetch,\n } = usePayrollConfigurationData({\n companyId,\n payrollId,\n isCalculating: isPolling || isCalculatingPayroll,\n excludedEmployeeUuids,\n })\n\n const alreadyProcessedAlert: PayrollFlowAlert = useMemo(\n () => ({\n type: 'error',\n title: t('alerts.alreadyProcessed'),\n alertKey: 'alreadyProcessed',\n }),\n [t],\n )\n\n const hasFiredAlreadyProcessedRef = useRef(false)\n\n useEffect(() => {\n if (!isAlreadyProcessed) {\n hasFiredAlreadyProcessedRef.current = false\n return\n }\n if (hasFiredAlreadyProcessedRef.current) return\n hasFiredAlreadyProcessedRef.current = true\n onEvent(componentEvents.RUN_PAYROLL_ALREADY_PROCESSED, {\n payrollId,\n alert: alreadyProcessedAlert,\n payPeriod: payrollData.payrollShow?.payPeriod,\n })\n }, [\n isAlreadyProcessed,\n onEvent,\n payrollId,\n alreadyProcessedAlert,\n payrollData.payrollShow?.payPeriod,\n ])\n\n const { mutateAsync: updatePayroll, isPending: isUpdatingPayroll } = usePayrollsUpdateMutation()\n\n const { mutateAsync: calculateGrossUpMutation } = usePayrollsCalculateGrossUpMutation()\n\n const [grossUpEmployeeUuid, setGrossUpEmployeeUuid] = useState<string | null>(null)\n const [isGrossUpModalOpen, setIsGrossUpModalOpen] = useState(false)\n\n const grossUpEnabled = isGrossUpEligible(payrollCategory)\n const grossUpTargetCompensation = getGrossUpTargetCompensationName(payrollCategory)\n\n const onGrossUpSelect = (employeeUuid: string) => {\n setGrossUpEmployeeUuid(employeeUuid)\n setIsGrossUpModalOpen(true)\n onEvent(componentEvents.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid })\n }\n\n const onCalculateGrossUp = async (netPay: number): Promise<string | null> => {\n if (!grossUpEmployeeUuid) return null\n let grossUp: string | null = null\n\n await baseSubmitHandler(null, async () => {\n const result = await calculateGrossUpMutation({\n request: {\n payrollUuid: payrollId,\n payrollGrossUpRequest: {\n employeeUuid: grossUpEmployeeUuid,\n netPay: netPay.toString(),\n },\n },\n })\n\n grossUp = result.payrollGrossUpResponse?.grossUp ?? null\n\n if (grossUp) {\n onEvent(componentEvents.RUN_PAYROLL_GROSS_UP_CALCULATED, {\n grossUp,\n netPay,\n employeeUuid: grossUpEmployeeUuid,\n })\n }\n })\n\n return grossUp\n }\n\n const onGrossUpApply = async (grossAmount: string) => {\n if (!grossUpEmployeeUuid || !grossUpTargetCompensation) {\n throw new SDKInternalError(\n 'Unable to apply gross-up: missing employee or target compensation.',\n )\n }\n\n const employeeComp = employeeCompensations.find(ec => ec.employeeUuid === grossUpEmployeeUuid)\n if (!employeeComp) {\n throw new SDKInternalError('Unable to apply gross-up: employee compensation not found.')\n }\n\n const existingFixed = employeeComp.fixedCompensations ?? []\n const hasTargetCompensation = existingFixed.some(\n fc => fc.name?.toLowerCase() === grossUpTargetCompensation.toLowerCase(),\n )\n\n const updatedFixedCompensations = existingFixed.map(fc => ({\n name: fc.name,\n jobUuid: fc.jobUuid,\n amount:\n fc.name?.toLowerCase() === grossUpTargetCompensation.toLowerCase() ? grossAmount : '0',\n }))\n\n if (!hasTargetCompensation) {\n const primaryJobUuid =\n employeeComp.hourlyCompensations?.[0]?.jobUuid ?? existingFixed[0]?.jobUuid ?? ''\n updatedFixedCompensations.push({\n name: grossUpTargetCompensation,\n jobUuid: primaryJobUuid,\n amount: grossAmount,\n })\n }\n\n const updatedHourlyCompensations = (employeeComp.hourlyCompensations ?? []).map(hc => ({\n name: hc.name,\n jobUuid: hc.jobUuid,\n hours: '0',\n }))\n\n const updatedPaidTimeOff = (employeeComp.paidTimeOff ?? []).map(pto => ({\n name: pto.name,\n hours: '0',\n }))\n\n const transformedCompensation = transformEmployeeCompensation({\n ...employeeComp,\n fixedCompensations: updatedFixedCompensations,\n hourlyCompensations: updatedHourlyCompensations,\n paidTimeOff: updatedPaidTimeOff,\n })\n\n await baseSubmitHandler({}, async () => {\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [{ ...transformedCompensation, excluded: false }],\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n })\n await refetch()\n })\n\n setGrossUpEmployeeUuid(null)\n setIsGrossUpModalOpen(false)\n }\n\n const handleGrossUpApply = async (grossAmount: string) => {\n try {\n await onGrossUpApply(grossAmount)\n } catch {\n // Modal stays open; error is surfaced by baseSubmitHandler\n }\n }\n\n const { data: blockersData } = usePayrollsGetBlockersSuspense({\n companyUuid: companyId,\n })\n\n const payrollBlockerList = blockersData.payrollBlockers ?? []\n\n const blockersFromApi: ApiPayrollBlocker[] = payrollBlockerList.map(blocker => ({\n key: blocker.key,\n message: blocker.message,\n }))\n\n const [payrollBlockers, setPayrollBlockers] = useState(blockersFromApi)\n\n const onCalculatePayroll = async () => {\n setPayrollBlockers([])\n previousCalculatedAtRef.current = payrollData.payrollShow?.calculatedAt?.getTime() ?? null\n\n await baseSubmitHandler({}, async () => {\n const result = await payrollSubmitHandler(async () => {\n setIsCalculatingPayroll(true)\n try {\n const calcResult = await payrollsCalculate(gustoClient, {\n companyId,\n payrollId,\n })\n if (!calcResult.ok) {\n throw calcResult.error\n }\n // `payrollsCalculate` is a raw func, so it skips the global onSuccess\n // invalidation that mutation hooks get; invalidate here so cached payroll\n // reads (e.g. PayrollOverview's separate key) refetch fresh. SDK-1018.\n void queryClient.invalidateQueries({ queryKey: [API_QUERY_NAMESPACE] })\n setIsPolling(true)\n } finally {\n setIsCalculatingPayroll(false)\n }\n })\n\n if (!result.success && result.blockers.length > 0) {\n setPayrollBlockers(result.blockers)\n }\n })\n }\n\n const onEdit = (employee: Employee) => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT, {\n employeeId: employee.uuid,\n firstName: employee.firstName,\n lastName: employee.lastName,\n })\n }\n\n const transformEmployeeCompensation = (\n compensation: PayrollEmployeeCompensationsType,\n ): PayrollUpdateEmployeeCompensations => {\n const { paymentMethod } = compensation\n return {\n employeeUuid: compensation.employeeUuid,\n version: compensation.version,\n excluded: compensation.excluded,\n fixedCompensations: compensation.fixedCompensations,\n hourlyCompensations: compensation.hourlyCompensations,\n paidTimeOff: compensation.paidTimeOff,\n deductions: compensation.deductions,\n ...(paymentMethod && paymentMethod !== 'Historical' ? { paymentMethod } : {}),\n memo: compensation.memo || undefined,\n }\n }\n\n const onToggleExclude = async (employeeCompensation: PayrollEmployeeCompensationsType) => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SKIP, {\n employeeId: employeeCompensation.employeeUuid,\n })\n await baseSubmitHandler({}, async () => {\n const transformedCompensation = transformEmployeeCompensation(employeeCompensation)\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [\n { ...transformedCompensation, excluded: !transformedCompensation.excluded },\n ],\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n })\n await refetch()\n })\n }\n\n const onViewBlockers = () => {\n onEvent(componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL)\n }\n\n useEffect(() => {\n if (isCalculatingStatus(payrollData.payrollShow?.processingRequest) && !isPolling) {\n previousCalculatedAtRef.current = payrollData.payrollShow?.calculatedAt?.getTime() ?? null\n setIsPolling(true)\n }\n const currentCalculatedAt = payrollData.payrollShow?.calculatedAt\n const isNewCalculation = currentCalculatedAt?.getTime() !== previousCalculatedAtRef.current\n if (\n isPolling &&\n isNewCalculation &&\n isCalculatedStatus(payrollData.payrollShow?.processingRequest, currentCalculatedAt)\n ) {\n onEvent(componentEvents.RUN_PAYROLL_CALCULATED, {\n payrollId,\n alert: {\n type: 'success',\n title: t('alerts.progressSaved'),\n alertKey: 'progressSaved',\n },\n payPeriod: payrollData.payrollShow?.payPeriod,\n })\n setPayrollBlockers([])\n setIsPolling(false)\n }\n if (\n isPolling &&\n payrollData.payrollShow?.processingRequest?.status ===\n PayrollProcessingRequestStatus.ProcessingFailed\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setIsPolling(false)\n }\n }, [\n payrollData.payrollShow?.processingRequest?.status,\n payrollData.payrollShow?.calculatedAt,\n isPolling,\n onEvent,\n t,\n payrollId,\n ])\n\n useEffect(() => {\n if (!isPolling) return\n\n const POLLING_TIMEOUT_MS = 3 * 60 * 1000\n const timeoutId = setTimeout(() => {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setIsPolling(false)\n }, POLLING_TIMEOUT_MS)\n\n return () => {\n clearTimeout(timeoutId)\n }\n }, [isPolling, onEvent])\n\n const payrollAlert = (() => {\n const statusMeta = payrollData.payrollShow?.payrollStatusMeta\n\n const isLatePayroll =\n statusMeta?.payrollLate &&\n statusMeta.initialCheckDate &&\n statusMeta.expectedDebitTime &&\n statusMeta.expectedCheckDate\n\n if (isLatePayroll) {\n return {\n label: t('alerts.payrollLate', {\n initialCheckDate: dateFormatter.formatShortWithWeekday(statusMeta.initialCheckDate),\n }),\n content: t('alerts.payrollLateText', {\n ...dateFormatter.formatWithTime(statusMeta.expectedDebitTime),\n newCheckDate: dateFormatter.formatShortWithWeekday(statusMeta.expectedCheckDate),\n }),\n variant: 'warning' as const,\n }\n }\n\n const { payrollShow } = payrollData\n const allCompensations = payrollShow?.employeeCompensations\n\n if (\n payrollShow &&\n allCompensations &&\n allCompensations.length > 0 &&\n hasDirectDepositEmployees(allCompensations)\n ) {\n return {\n label: t('alerts.directDepositDeadline', {\n payDate: dateFormatter.formatShortWithWeekday(payrollShow.checkDate),\n ...dateFormatter.formatWithTime(payrollShow.payrollDeadline),\n }),\n content: t('alerts.directDepositDeadlineText'),\n variant: 'info' as const,\n }\n }\n\n return undefined\n })()\n\n if (isAlreadyProcessed) {\n const onAlreadyProcessedOverviewEvent = (type: EventType, data?: unknown) => {\n if (type === componentEvents.RUN_PAYROLL_CANCELLED) {\n // Cancelling un-processes the payroll, making it editable again — re-run prepare so\n // this component drops back into the configuration table for the same payrollId.\n void refetch()\n }\n onEvent(type, data)\n }\n\n return (\n <PayrollOverview\n companyId={companyId}\n payrollId={payrollId}\n onEvent={onAlreadyProcessedOverviewEvent}\n withReimbursements={withReimbursements}\n alerts={[alreadyProcessedAlert]}\n />\n )\n }\n\n return (\n <>\n <PayrollConfigurationPresentation\n onCalculatePayroll={onCalculatePayroll}\n isCalculateDisabled={blockersFromApi.length > 0}\n onEdit={onEdit}\n onToggleExclude={onToggleExclude}\n onViewBlockers={onViewBlockers}\n employeeCompensations={employeeCompensations}\n employeeDetails={employeeDetails}\n payPeriod={payPeriod}\n paySchedule={paySchedule}\n payrollCategory={payrollCategory}\n alerts={alerts}\n payrollAlert={payrollAlert}\n isPending={isPolling || isLoading || isUpdatingPayroll || isCalculatingPayroll}\n isCalculating={isCalculatingPayroll || isPolling}\n payrollBlockers={payrollBlockers}\n pagination={pagination}\n withReimbursements={withReimbursements}\n grossUpEnabled={grossUpEnabled}\n onGrossUpSelect={onGrossUpSelect}\n />\n {grossUpEnabled && (\n <GrossUpModal\n isOpen={isGrossUpModalOpen}\n onCalculateGrossUp={onCalculateGrossUp}\n onApply={handleGrossUpApply}\n onCancel={() => {\n setIsGrossUpModalOpen(false)\n }}\n />\n )}\n </>\n )\n}\n"],"names":["isCalculatingStatus","processingRequest","PayrollProcessingRequestStatus","isCalculatedStatus","calculatedAt","PayrollConfiguration","props","jsx","BaseComponent","Root","onEvent","companyId","payrollId","dictionary","alerts","withReimbursements","useComponentDictionary","useI18n","t","useTranslation","baseSubmitHandler","useBase","dateFormatter","useDateFormatter","isPolling","setIsPolling","useState","isCalculatingPayroll","setIsCalculatingPayroll","previousCalculatedAtRef","useRef","gustoClient","useGustoEmbeddedContext","queryClient","useQueryClient","payrollData","usePayrollsGetSuspense","excludedEmployeeUuids","useMemo","comp","employeeDetails","employeeCompensations","paySchedule","payPeriod","payrollCategory","pagination","isLoading","isAlreadyProcessed","refetch","usePayrollConfigurationData","alreadyProcessedAlert","hasFiredAlreadyProcessedRef","useEffect","componentEvents","updatePayroll","isUpdatingPayroll","usePayrollsUpdateMutation","calculateGrossUpMutation","usePayrollsCalculateGrossUpMutation","grossUpEmployeeUuid","setGrossUpEmployeeUuid","isGrossUpModalOpen","setIsGrossUpModalOpen","grossUpEnabled","isGrossUpEligible","grossUpTargetCompensation","getGrossUpTargetCompensationName","onGrossUpSelect","employeeUuid","onCalculateGrossUp","netPay","grossUp","onGrossUpApply","grossAmount","SDKInternalError","employeeComp","ec","existingFixed","hasTargetCompensation","fc","updatedFixedCompensations","primaryJobUuid","updatedHourlyCompensations","hc","updatedPaidTimeOff","pto","transformedCompensation","transformEmployeeCompensation","result","handleGrossUpApply","blockersData","usePayrollsGetBlockersSuspense","blockersFromApi","blocker","payrollBlockers","setPayrollBlockers","onCalculatePayroll","payrollSubmitHandler","calcResult","payrollsCalculate","API_QUERY_NAMESPACE","onEdit","employee","compensation","paymentMethod","onToggleExclude","employeeCompensation","onViewBlockers","currentCalculatedAt","isNewCalculation","POLLING_TIMEOUT_MS","timeoutId","payrollAlert","statusMeta","payrollShow","allCompensations","hasDirectDepositEmployees","PayrollOverview","type","data","jsxs","Fragment","PayrollConfigurationPresentation","GrossUpModal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAMA,KAAsB,CAACC,MAC3BA,GAAmB,WAAWC,EAA+B,aAEzDC,KAAqB,CACzBF,GACAG,MAEAA,KAAgB,SACfH,GAAmB,WAAWC,EAA+B,oBAC5DD,KAAqB;AA+ClB,SAASI,GAAqBC,GAAkC;AACrE,SACE,gBAAAC,EAACC,IAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMG,KAAO,CAAC;AAAA,EACZ,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAiC;AAC/B,EAAAC,GAAuB,gCAAgCH,CAAU,GACjEI,GAAQ,8BAA8B;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,GAAe,8BAA8B,GACrD,EAAE,mBAAAC,EAAA,IAAsBC,GAAA,GACxBC,IAAgBC,GAAA,GAEhB,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAsBC,CAAuB,IAAIF,EAAS,EAAK,GAChEG,IAA0BC,EAAsB,IAAI,GACpDC,IAAcC,GAAA,GACdC,IAAcC,GAAA,GAEd,EAAE,MAAMC,EAAA,IAAgBC;AAAA,IAC5B;AAAA,MACE,WAAAzB;AAAA,MACA,WAAAC;AAAA,MACA,SAAS,CAAC,SAAS,YAAY,cAAc,qBAAqB;AAAA,IAAA;AAAA,IAEpE,EAAE,iBAAiBY,IAAY,MAAQ,GAAA;AAAA,EAA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,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"PayrollConfiguration.js","sources":["../../../../src/components/Payroll/PayrollConfiguration/PayrollConfiguration.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { payrollsCalculate } from '@gusto/embedded-api/funcs/payrollsCalculate'\nimport { useGustoEmbeddedContext } from '@gusto/embedded-api/react-query/_context'\nimport type { PayrollProcessingRequest } from '@gusto/embedded-api/models/components/payrollprocessingrequest'\nimport { PayrollProcessingRequestStatus } from '@gusto/embedded-api/models/components/payrollprocessingrequest'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useTranslation } from 'react-i18next'\nimport { usePayrollsUpdateMutation } from '@gusto/embedded-api/react-query/payrollsUpdate'\nimport { usePayrollsCalculateGrossUpMutation } from '@gusto/embedded-api/react-query/payrollsCalculateGrossUp'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateEmployeeCompensations } from '@gusto/embedded-api/models/components/payrollupdate'\nimport { usePayrollsGetBlockersSuspense } from '@gusto/embedded-api/react-query/payrollsGetBlockers'\nimport { payrollSubmitHandler, type ApiPayrollBlocker } from '../PayrollBlocker/payrollHelpers'\nimport { GrossUpModal } from '../GrossUpModal'\nimport { PayrollOverview } from '../PayrollOverview/PayrollOverview'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport { PayrollConfigurationPresentation } from './PayrollConfigurationPresentation'\nimport { usePayrollConfigurationData } from './usePayrollConfigurationData'\nimport { getGrossUpTargetCompensationName, isGrossUpEligible } from './grossUpHelpers'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { useBase } from '@/components/Base'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { SDKInternalError } from '@/types/sdkError'\nimport { API_QUERY_NAMESPACE } from '@/contexts/ApiProvider/apiVersion'\n\nconst isCalculatingStatus = (processingRequest?: PayrollProcessingRequest | null) =>\n processingRequest?.status === PayrollProcessingRequestStatus.Calculating\n\nconst isCalculatedStatus = (\n processingRequest?: PayrollProcessingRequest | null,\n calculatedAt?: Date | null,\n) =>\n calculatedAt != null &&\n (processingRequest?.status === PayrollProcessingRequestStatus.CalculateSuccess ||\n processingRequest == null)\n\n/**\n * Props for {@link PayrollConfiguration}.\n *\n * @public\n */\nexport interface PayrollConfigurationProps extends BaseComponentInterface<'Payroll.PayrollConfiguration'> {\n /** The associated company identifier. */\n companyId: string\n /** The associated payroll identifier. */\n payrollId: string\n /** Optional alert components to render above the configuration content. */\n alerts?: ReactNode\n /** Whether to show the reimbursements column in the compensation table. Defaults to `true`. */\n withReimbursements?: boolean\n}\n\n/**\n * Handles the configuration phase of payroll processing, allowing users to review and modify employee compensation before calculating the payroll.\n *\n * @remarks\n * If the payroll turns out to already be processed (e.g. another actor submitted it while this\n * screen was open), this component emits `runPayroll/alreadyProcessed` and then renders\n * {@link PayrollOverview} in its place — the read-only breakdown with the gated \"Cancel payroll\"\n * action — instead of the configuration table. Events from that delegated view (e.g.\n * `runPayroll/cancelled`) are emitted through this component's own `onEvent`.\n *\n * Emits the following events:\n *\n * @events\n * | Event | Description | Data |\n * | ----- | ----------- | ---- |\n * | `runPayroll/employee/edit` | An employee row is selected for editing | `{ employeeId, firstName, lastName }` |\n * | `runPayroll/employee/skip` | An employee is skipped or unskipped for this payroll | `{ employeeId }` |\n * | `runPayroll/employee/saved` | Employee compensation changes are persisted | `{ payrollPrepared }` |\n * | `runPayroll/calculated` | Payroll calculation completes successfully | `{ payrollId, alert, payPeriod }` |\n * | `runPayroll/alreadyProcessed` | The payroll turns out to already be processed while configuring it | `{ payrollId, alert, payPeriod }` |\n * | `runPayroll/processingFailed` | Payroll calculation fails or times out | — |\n * | `runPayroll/blockers/viewAll` | The \"view all blockers\" affordance is selected | — |\n * | `runPayroll/grossUp/selected` | The set-net-earnings menu item is selected for an employee | `{ employeeUuid }` |\n * | `runPayroll/grossUp/calculated` | A gross-up amount is calculated from a target net pay | `{ grossUp, netPay, employeeUuid }` |\n *\n * @param props - See {@link PayrollConfigurationProps}.\n * @returns The payroll configuration screen.\n * @public\n */\nexport function PayrollConfiguration(props: PayrollConfigurationProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n onEvent,\n companyId,\n payrollId,\n dictionary,\n alerts,\n withReimbursements = true,\n}: PayrollConfigurationProps) => {\n useComponentDictionary('Payroll.PayrollConfiguration', dictionary)\n useI18n('Payroll.PayrollConfiguration')\n const { t } = useTranslation('Payroll.PayrollConfiguration')\n const { baseSubmitHandler } = useBase()\n const dateFormatter = useDateFormatter()\n\n const [isPolling, setIsPolling] = useState(false)\n const [isCalculatingPayroll, setIsCalculatingPayroll] = useState(false)\n const previousCalculatedAtRef = useRef<number | null>(null)\n const gustoClient = useGustoEmbeddedContext()\n const queryClient = useQueryClient()\n\n const { data: payrollData } = usePayrollsGetSuspense(\n {\n companyId,\n payrollId,\n include: ['taxes', 'benefits', 'deductions', 'payroll_status_meta'],\n },\n { refetchInterval: isPolling ? 5_000 : false },\n )\n\n const excludedEmployeeUuids = useMemo(\n () =>\n payrollData.payrollShow?.employeeCompensations\n ?.filter(comp => comp.excluded)\n .map(comp => comp.employeeUuid!)\n .filter(Boolean) ?? [],\n [payrollData.payrollShow?.employeeCompensations],\n )\n\n const {\n employeeDetails,\n employeeCompensations,\n paySchedule,\n payPeriod,\n payrollCategory,\n pagination,\n isLoading,\n isAlreadyProcessed,\n refetch,\n } = usePayrollConfigurationData({\n companyId,\n payrollId,\n isCalculating: isPolling || isCalculatingPayroll,\n excludedEmployeeUuids,\n })\n\n const alreadyProcessedAlert: PayrollFlowAlert = useMemo(\n () => ({\n type: 'error',\n title: t('alerts.alreadyProcessed'),\n alertKey: 'alreadyProcessed',\n }),\n [t],\n )\n\n const hasFiredAlreadyProcessedRef = useRef(false)\n\n useEffect(() => {\n if (!isAlreadyProcessed) {\n hasFiredAlreadyProcessedRef.current = false\n return\n }\n if (hasFiredAlreadyProcessedRef.current) return\n hasFiredAlreadyProcessedRef.current = true\n onEvent(componentEvents.RUN_PAYROLL_ALREADY_PROCESSED, {\n payrollId,\n alert: alreadyProcessedAlert,\n payPeriod: payrollData.payrollShow?.payPeriod,\n })\n }, [\n isAlreadyProcessed,\n onEvent,\n payrollId,\n alreadyProcessedAlert,\n payrollData.payrollShow?.payPeriod,\n ])\n\n const { mutateAsync: updatePayroll, isPending: isUpdatingPayroll } = usePayrollsUpdateMutation()\n\n const { mutateAsync: calculateGrossUpMutation } = usePayrollsCalculateGrossUpMutation()\n\n const [grossUpEmployeeUuid, setGrossUpEmployeeUuid] = useState<string | null>(null)\n const [isGrossUpModalOpen, setIsGrossUpModalOpen] = useState(false)\n\n const grossUpEnabled = isGrossUpEligible(payrollCategory)\n const grossUpTargetCompensation = getGrossUpTargetCompensationName(payrollCategory)\n\n const onGrossUpSelect = (employeeUuid: string) => {\n setGrossUpEmployeeUuid(employeeUuid)\n setIsGrossUpModalOpen(true)\n onEvent(componentEvents.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid })\n }\n\n const onCalculateGrossUp = async (netPay: number): Promise<string | null> => {\n if (!grossUpEmployeeUuid) return null\n let grossUp: string | null = null\n\n await baseSubmitHandler(null, async () => {\n const result = await calculateGrossUpMutation({\n request: {\n payrollUuid: payrollId,\n payrollGrossUpRequest: {\n employeeUuid: grossUpEmployeeUuid,\n netPay: netPay.toString(),\n },\n },\n })\n\n grossUp = result.payrollGrossUpResponse?.grossUp ?? null\n\n if (grossUp) {\n onEvent(componentEvents.RUN_PAYROLL_GROSS_UP_CALCULATED, {\n grossUp,\n netPay,\n employeeUuid: grossUpEmployeeUuid,\n })\n }\n })\n\n return grossUp\n }\n\n const onGrossUpApply = async (grossAmount: string) => {\n if (!grossUpEmployeeUuid || !grossUpTargetCompensation) {\n throw new SDKInternalError(\n 'Unable to apply gross-up: missing employee or target compensation.',\n )\n }\n\n const employeeComp = employeeCompensations.find(ec => ec.employeeUuid === grossUpEmployeeUuid)\n if (!employeeComp) {\n throw new SDKInternalError('Unable to apply gross-up: employee compensation not found.')\n }\n\n const existingFixed = employeeComp.fixedCompensations ?? []\n const hasTargetCompensation = existingFixed.some(\n fc => fc.name?.toLowerCase() === grossUpTargetCompensation.toLowerCase(),\n )\n\n const updatedFixedCompensations = existingFixed.map(fc => ({\n name: fc.name,\n jobUuid: fc.jobUuid,\n amount:\n fc.name?.toLowerCase() === grossUpTargetCompensation.toLowerCase() ? grossAmount : '0',\n }))\n\n if (!hasTargetCompensation) {\n const primaryJobUuid =\n employeeComp.hourlyCompensations?.[0]?.jobUuid ?? existingFixed[0]?.jobUuid ?? ''\n updatedFixedCompensations.push({\n name: grossUpTargetCompensation,\n jobUuid: primaryJobUuid,\n amount: grossAmount,\n })\n }\n\n const updatedHourlyCompensations = (employeeComp.hourlyCompensations ?? []).map(hc => ({\n name: hc.name,\n jobUuid: hc.jobUuid,\n hours: '0',\n }))\n\n const updatedPaidTimeOff = (employeeComp.paidTimeOff ?? []).map(pto => ({\n name: pto.name,\n hours: '0',\n }))\n\n const transformedCompensation = transformEmployeeCompensation({\n ...employeeComp,\n fixedCompensations: updatedFixedCompensations,\n hourlyCompensations: updatedHourlyCompensations,\n paidTimeOff: updatedPaidTimeOff,\n })\n\n await baseSubmitHandler({}, async () => {\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [{ ...transformedCompensation, excluded: false }],\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n })\n await refetch()\n })\n\n setGrossUpEmployeeUuid(null)\n setIsGrossUpModalOpen(false)\n }\n\n const handleGrossUpApply = async (grossAmount: string) => {\n try {\n await onGrossUpApply(grossAmount)\n } catch {\n // Modal stays open; error is surfaced by baseSubmitHandler\n }\n }\n\n const { data: blockersData } = usePayrollsGetBlockersSuspense({\n companyUuid: companyId,\n })\n\n const payrollBlockerList = blockersData.payrollBlockers ?? []\n\n const blockersFromApi: ApiPayrollBlocker[] = payrollBlockerList.map(blocker => ({\n key: blocker.key,\n message: blocker.message,\n }))\n\n const [payrollBlockers, setPayrollBlockers] = useState(blockersFromApi)\n\n const onCalculatePayroll = async () => {\n setPayrollBlockers([])\n previousCalculatedAtRef.current = payrollData.payrollShow?.calculatedAt?.getTime() ?? null\n\n await baseSubmitHandler({}, async () => {\n const result = await payrollSubmitHandler(async () => {\n setIsCalculatingPayroll(true)\n try {\n const calcResult = await payrollsCalculate(gustoClient, {\n companyId,\n payrollId,\n })\n if (!calcResult.ok) {\n throw calcResult.error\n }\n // `payrollsCalculate` is a raw func, so it skips the global onSuccess\n // invalidation that mutation hooks get; invalidate here so cached payroll\n // reads (e.g. PayrollOverview's separate key) refetch fresh. SDK-1018.\n void queryClient.invalidateQueries({ queryKey: [API_QUERY_NAMESPACE] })\n setIsPolling(true)\n } finally {\n setIsCalculatingPayroll(false)\n }\n })\n\n if (!result.success && result.blockers.length > 0) {\n setPayrollBlockers(result.blockers)\n }\n })\n }\n\n const onEdit = (employee: Employee) => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT, {\n employeeId: employee.uuid,\n firstName: employee.firstName,\n lastName: employee.lastName,\n })\n }\n\n const transformEmployeeCompensation = (\n compensation: PayrollEmployeeCompensationsType,\n ): PayrollUpdateEmployeeCompensations => {\n const { paymentMethod } = compensation\n return {\n employeeUuid: compensation.employeeUuid,\n version: compensation.version,\n excluded: compensation.excluded,\n fixedCompensations: compensation.fixedCompensations,\n hourlyCompensations: compensation.hourlyCompensations,\n paidTimeOff: compensation.paidTimeOff,\n deductions: compensation.deductions,\n ...(paymentMethod && paymentMethod !== 'Historical' ? { paymentMethod } : {}),\n memo: compensation.memo || undefined,\n }\n }\n\n const onToggleExclude = async (employeeCompensation: PayrollEmployeeCompensationsType) => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SKIP, {\n employeeId: employeeCompensation.employeeUuid,\n })\n await baseSubmitHandler({}, async () => {\n const transformedCompensation = transformEmployeeCompensation(employeeCompensation)\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [\n { ...transformedCompensation, excluded: !transformedCompensation.excluded },\n ],\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n })\n await refetch()\n })\n }\n\n const onViewBlockers = () => {\n onEvent(componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL)\n }\n\n useEffect(() => {\n if (isCalculatingStatus(payrollData.payrollShow?.processingRequest) && !isPolling) {\n previousCalculatedAtRef.current = payrollData.payrollShow?.calculatedAt?.getTime() ?? null\n setIsPolling(true)\n }\n const currentCalculatedAt = payrollData.payrollShow?.calculatedAt\n const isNewCalculation = currentCalculatedAt?.getTime() !== previousCalculatedAtRef.current\n if (\n isPolling &&\n isNewCalculation &&\n isCalculatedStatus(payrollData.payrollShow?.processingRequest, currentCalculatedAt)\n ) {\n onEvent(componentEvents.RUN_PAYROLL_CALCULATED, {\n payrollId,\n alert: {\n type: 'success',\n title: t('alerts.progressSaved'),\n alertKey: 'progressSaved',\n },\n payPeriod: payrollData.payrollShow?.payPeriod,\n })\n setPayrollBlockers([])\n setIsPolling(false)\n }\n if (\n isPolling &&\n payrollData.payrollShow?.processingRequest?.status ===\n PayrollProcessingRequestStatus.ProcessingFailed\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setIsPolling(false)\n }\n }, [\n payrollData.payrollShow?.processingRequest?.status,\n payrollData.payrollShow?.calculatedAt,\n isPolling,\n onEvent,\n t,\n payrollId,\n ])\n\n useEffect(() => {\n if (!isPolling) return\n\n const POLLING_TIMEOUT_MS = 3 * 60 * 1000\n const timeoutId = setTimeout(() => {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setIsPolling(false)\n }, POLLING_TIMEOUT_MS)\n\n return () => {\n clearTimeout(timeoutId)\n }\n }, [isPolling, onEvent])\n\n const payrollAlert = (() => {\n const statusMeta = payrollData.payrollShow?.payrollStatusMeta\n\n const isLatePayroll =\n statusMeta?.payrollLate &&\n statusMeta.initialCheckDate &&\n statusMeta.expectedDebitTime &&\n statusMeta.expectedCheckDate\n\n if (isLatePayroll) {\n return {\n label: t('alerts.payrollLate', {\n initialCheckDate: dateFormatter.formatShortWithWeekday(statusMeta.initialCheckDate),\n }),\n content: t('alerts.payrollLateText', {\n ...dateFormatter.formatWithTime(statusMeta.expectedDebitTime),\n newCheckDate: dateFormatter.formatShortWithWeekday(statusMeta.expectedCheckDate),\n }),\n variant: 'warning' as const,\n }\n }\n\n const { payrollShow } = payrollData\n\n if (payrollShow?.checkDate && payrollShow.payrollDeadline) {\n return {\n label: t('alerts.directDepositDeadline', {\n payDate: dateFormatter.formatShortWithWeekday(payrollShow.checkDate),\n ...dateFormatter.formatWithTime(payrollShow.payrollDeadline),\n }),\n content: t('alerts.directDepositDeadlineText'),\n variant: 'info' as const,\n }\n }\n\n return undefined\n })()\n\n if (isAlreadyProcessed) {\n const onAlreadyProcessedOverviewEvent = (type: EventType, data?: unknown) => {\n if (type === componentEvents.RUN_PAYROLL_CANCELLED) {\n // Cancelling un-processes the payroll, making it editable again — re-run prepare so\n // this component drops back into the configuration table for the same payrollId.\n void refetch()\n }\n onEvent(type, data)\n }\n\n return (\n <PayrollOverview\n companyId={companyId}\n payrollId={payrollId}\n onEvent={onAlreadyProcessedOverviewEvent}\n withReimbursements={withReimbursements}\n alerts={[alreadyProcessedAlert]}\n />\n )\n }\n\n return (\n <>\n <PayrollConfigurationPresentation\n onCalculatePayroll={onCalculatePayroll}\n isCalculateDisabled={blockersFromApi.length > 0}\n onEdit={onEdit}\n onToggleExclude={onToggleExclude}\n onViewBlockers={onViewBlockers}\n employeeCompensations={employeeCompensations}\n employeeDetails={employeeDetails}\n payPeriod={payPeriod}\n paySchedule={paySchedule}\n payrollCategory={payrollCategory}\n alerts={alerts}\n payrollAlert={payrollAlert}\n isPending={isPolling || isLoading || isUpdatingPayroll || isCalculatingPayroll}\n isCalculating={isCalculatingPayroll || isPolling}\n payrollBlockers={payrollBlockers}\n pagination={pagination}\n withReimbursements={withReimbursements}\n grossUpEnabled={grossUpEnabled}\n onGrossUpSelect={onGrossUpSelect}\n />\n {grossUpEnabled && (\n <GrossUpModal\n isOpen={isGrossUpModalOpen}\n onCalculateGrossUp={onCalculateGrossUp}\n onApply={handleGrossUpApply}\n onCancel={() => {\n setIsGrossUpModalOpen(false)\n }}\n />\n )}\n </>\n )\n}\n"],"names":["isCalculatingStatus","processingRequest","PayrollProcessingRequestStatus","isCalculatedStatus","calculatedAt","PayrollConfiguration","props","jsx","BaseComponent","Root","onEvent","companyId","payrollId","dictionary","alerts","withReimbursements","useComponentDictionary","useI18n","t","useTranslation","baseSubmitHandler","useBase","dateFormatter","useDateFormatter","isPolling","setIsPolling","useState","isCalculatingPayroll","setIsCalculatingPayroll","previousCalculatedAtRef","useRef","gustoClient","useGustoEmbeddedContext","queryClient","useQueryClient","payrollData","usePayrollsGetSuspense","excludedEmployeeUuids","useMemo","comp","employeeDetails","employeeCompensations","paySchedule","payPeriod","payrollCategory","pagination","isLoading","isAlreadyProcessed","refetch","usePayrollConfigurationData","alreadyProcessedAlert","hasFiredAlreadyProcessedRef","useEffect","componentEvents","updatePayroll","isUpdatingPayroll","usePayrollsUpdateMutation","calculateGrossUpMutation","usePayrollsCalculateGrossUpMutation","grossUpEmployeeUuid","setGrossUpEmployeeUuid","isGrossUpModalOpen","setIsGrossUpModalOpen","grossUpEnabled","isGrossUpEligible","grossUpTargetCompensation","getGrossUpTargetCompensationName","onGrossUpSelect","employeeUuid","onCalculateGrossUp","netPay","grossUp","onGrossUpApply","grossAmount","SDKInternalError","employeeComp","ec","existingFixed","hasTargetCompensation","fc","updatedFixedCompensations","primaryJobUuid","updatedHourlyCompensations","hc","updatedPaidTimeOff","pto","transformedCompensation","transformEmployeeCompensation","result","handleGrossUpApply","blockersData","usePayrollsGetBlockersSuspense","blockersFromApi","blocker","payrollBlockers","setPayrollBlockers","onCalculatePayroll","payrollSubmitHandler","calcResult","payrollsCalculate","API_QUERY_NAMESPACE","onEdit","employee","compensation","paymentMethod","onToggleExclude","employeeCompensation","onViewBlockers","currentCalculatedAt","isNewCalculation","POLLING_TIMEOUT_MS","timeoutId","payrollAlert","statusMeta","payrollShow","PayrollOverview","type","data","jsxs","Fragment","PayrollConfigurationPresentation","GrossUpModal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAMA,KAAsB,CAACC,MAC3BA,GAAmB,WAAWC,EAA+B,aAEzDC,KAAqB,CACzBF,GACAG,MAEAA,KAAgB,SACfH,GAAmB,WAAWC,EAA+B,oBAC5DD,KAAqB;AA+ClB,SAASI,GAAqBC,GAAkC;AACrE,SACE,gBAAAC,EAACC,IAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMG,KAAO,CAAC;AAAA,EACZ,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAiC;AAC/B,EAAAC,GAAuB,gCAAgCH,CAAU,GACjEI,GAAQ,8BAA8B;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,GAAe,8BAA8B,GACrD,EAAE,mBAAAC,EAAA,IAAsBC,GAAA,GACxBC,IAAgBC,GAAA,GAEhB,CAACC,GAAWC,CAAY,IAAIC,E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A9B;AAAA,QACA,gBAAAgD;AAAA,QACA,iBAAAI;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDJ,KACC,gBAAAxD;AAAA,MAACkH;AAAA,MAAA;AAAA,QACC,QAAQ5D;AAAA,QACR,oBAAAQ;AAAA,QACA,SAASoB;AAAA,QACT,UAAU,MAAM;AACd,UAAA3B,EAAsB,EAAK;AAAA,QAC7B;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GAEJ;AAEJ;"}
@@ -16,7 +16,7 @@ function De({
16
16
  excludedEmployeeUuids: S = []
17
17
  }) {
18
18
  const D = oe(), i = te(), { currentPage: c, itemsPerPage: A, getPaginationProps: Q } = le({
19
- defaultItemsPerPage: 10
19
+ defaultItemsPerPage: 25
20
20
  }), [T, k] = q([]), [x, h] = q(!1), P = v(!1), { data: l, isFetching: w } = ee(
21
21
  {
22
22
  companyId: n,