@gusto/embedded-react-sdk 0.37.0-rc.2 → 0.37.0-rc.4

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 (201) hide show
  1. package/README.md +3 -0
  2. package/dist/components/Common/SignatureForm/SignatureFormActions.js +8 -7
  3. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  4. package/dist/components/Common/SignatureForm/SignatureFormFields.js +5 -4
  5. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  6. package/dist/components/Common/UI/DatePicker/DatePicker.d.ts +1 -1
  7. package/dist/components/Common/UI/DatePicker/DatePicker.js +88 -69
  8. package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
  9. package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +13 -0
  10. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
  11. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  12. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
  13. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  14. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +4 -3
  15. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
  17. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +4 -3
  19. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +6 -5
  21. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  22. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +6 -6
  23. package/dist/components/Company/BankAccount/BankAccountForm/context.js +4 -3
  24. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  25. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
  26. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  27. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
  28. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  29. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
  30. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  31. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  32. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  33. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  34. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  35. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  36. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  37. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +6 -5
  38. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  39. package/dist/components/Company/Industry/Actions.js +6 -5
  40. package/dist/components/Company/Industry/Actions.js.map +1 -1
  41. package/dist/components/Company/Industry/Context.js +7 -6
  42. package/dist/components/Company/Industry/Context.js.map +1 -1
  43. package/dist/components/Company/Industry/Edit.js +11 -10
  44. package/dist/components/Company/Industry/Edit.js.map +1 -1
  45. package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
  46. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  47. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +4 -3
  48. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  49. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  50. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  51. package/dist/components/Company/Locations/LocationsList/List.js +7 -6
  52. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  53. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +4 -3
  54. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  55. package/dist/components/Company/OnboardingOverview/context.js +4 -3
  56. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  57. package/dist/components/Company/PaySchedule/PaySchedule.js +60 -58
  58. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  59. package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -10
  60. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  61. package/dist/components/Company/PaySchedule/_parts/Edit.js +40 -37
  62. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  63. package/dist/components/Company/PaySchedule/usePaySchedule.d.ts +1 -0
  64. package/dist/components/Company/PaySchedule/usePaySchedule.js +6 -5
  65. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  66. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +6 -5
  67. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  68. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +4 -3
  69. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  70. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
  71. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  72. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
  73. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  74. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +4 -3
  75. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  76. package/dist/components/Contractor/Address/Form.js +4 -4
  77. package/dist/components/Contractor/Address/useAddress.js +6 -5
  78. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  79. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +3 -2
  80. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  81. package/dist/components/Contractor/Profile/useContractorProfile.js +3 -2
  82. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  83. package/dist/components/Employee/Compensation/Actions.js +1 -1
  84. package/dist/components/Employee/Compensation/List.js +6 -5
  85. package/dist/components/Employee/Compensation/List.js.map +1 -1
  86. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +3 -2
  87. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  88. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +3 -2
  89. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  90. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +3 -2
  91. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  92. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
  93. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  94. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +4 -3
  95. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  96. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +4 -3
  97. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  98. package/dist/components/Employee/EmployeeList/Actions.js +5 -4
  99. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  100. package/dist/components/Employee/EmployeeList/List.js +10 -10
  101. package/dist/components/Employee/EmployeeList/useEmployeeList.js +4 -3
  102. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  103. package/dist/components/Employee/FederalTaxes/Actions.js +3 -2
  104. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  105. package/dist/components/Employee/FederalTaxes/FederalForm.js +5 -4
  106. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  107. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +4 -3
  108. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  109. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  110. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  111. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +4 -4
  112. package/dist/components/Employee/PaymentMethod/Split.js +1 -1
  113. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +6 -5
  114. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  115. package/dist/components/Employee/Profile/Actions.js +7 -6
  116. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  117. package/dist/components/Employee/Profile/AdminPersonalDetails.js +5 -4
  118. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  119. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +9 -8
  120. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  121. package/dist/components/Employee/Profile/useProfile.js +4 -3
  122. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  123. package/dist/components/Employee/StateTaxes/Actions.js +7 -6
  124. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  125. package/dist/components/Employee/StateTaxes/useStateTaxes.js +4 -3
  126. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  127. package/dist/components/Employee/Taxes/Actions.js +8 -7
  128. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  129. package/dist/components/Employee/Taxes/FederalForm.js +5 -4
  130. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  131. package/dist/components/Employee/Taxes/useTaxes.js +4 -3
  132. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  133. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +48 -48
  134. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
  135. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +15 -14
  136. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
  137. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +44 -46
  138. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
  139. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -2
  140. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  141. package/dist/components/Payroll/GrossUpModal/GrossUpModal.module.scss.js +4 -4
  142. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +25 -23
  143. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  144. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +11 -10
  145. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -1
  146. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -0
  147. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  148. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +3 -2
  149. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
  150. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +105 -106
  151. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  152. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +54 -54
  153. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  154. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +2 -1
  155. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +29 -27
  156. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
  157. package/dist/components/Payroll/PayrollExecutionFlow/index.d.ts +1 -1
  158. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.d.ts +1 -1
  159. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +60 -60
  160. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  161. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js +22 -20
  162. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
  163. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +143 -143
  164. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  165. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +44 -55
  166. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
  167. package/dist/components/Payroll/helpers.d.ts +1 -0
  168. package/dist/components/Payroll/helpers.js +71 -69
  169. package/dist/components/Payroll/helpers.js.map +1 -1
  170. package/dist/components/Payroll/usePreparedPayrollData.js +3 -2
  171. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  172. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +9 -8
  173. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -1
  174. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +12 -11
  175. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -1
  176. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +3 -2
  177. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -1
  178. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +8 -7
  179. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -1
  180. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +9 -8
  181. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -1
  182. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +13 -12
  183. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -1
  184. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +4 -4
  185. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +4 -4
  186. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +86 -89
  187. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +1 -1
  188. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +1 -1
  189. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +1 -1
  190. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  191. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  192. package/dist/i18n/en/Company.PaySchedule.json.js +6 -6
  193. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +38 -34
  194. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
  195. package/dist/i18n/en/Payroll.PayrollOverview.json.js +62 -58
  196. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  197. package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +8 -8
  198. package/dist/style.css +1 -1
  199. package/dist/types/i18next.d.ts +6 -1
  200. package/docs/reference/endpoint-inventory.json +9 -0
  201. package/package.json +5 -5
@@ -1,51 +1,53 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
- import { usePayrollsGetSuspense as c } from "@gusto/embedded-api/react-query/payrollsGet";
3
- import { PayrollExecutionFlow as p } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
2
+ import { usePayrollsGetSuspense as m } from "@gusto/embedded-api/react-query/payrollsGet";
3
+ import { PayrollExecutionFlow as c } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
4
+ import { isDismissalPayroll as f } from "../helpers.js";
4
5
  import { useFlow as a } from "../../Flow/useFlow.js";
5
6
  import { ensureRequired as l } from "../../../helpers/ensureRequired.js";
6
- import { BaseComponent as f } from "../../Base/Base.js";
7
- import { OffCycleCreation as s } from "../OffCycleCreation/OffCycleCreation.js";
8
- function h() {
9
- const { companyId: o, payrollType: e, onEvent: t } = a();
7
+ import { BaseComponent as p } from "../../Base/Base.js";
8
+ import { OffCycleCreation as y } from "../OffCycleCreation/OffCycleCreation.js";
9
+ function v() {
10
+ const { companyId: o, payrollType: r, onEvent: e } = a();
10
11
  return /* @__PURE__ */ n(
11
- s,
12
+ y,
12
13
  {
13
14
  companyId: l(o),
14
- payrollType: e,
15
- onEvent: t
15
+ payrollType: r,
16
+ onEvent: e
16
17
  }
17
18
  );
18
19
  }
19
- function v() {
20
- const { companyId: o, payrollUuid: e, onEvent: t, withReimbursements: r } = a(), i = l(o), m = l(e);
21
- return /* @__PURE__ */ n(f, { onEvent: t, children: /* @__PURE__ */ n(
20
+ function O() {
21
+ const { companyId: o, payrollUuid: r, onEvent: e, withReimbursements: t } = a(), i = l(o), s = l(r);
22
+ return /* @__PURE__ */ n(p, { onEvent: e, children: /* @__PURE__ */ n(
22
23
  u,
23
24
  {
24
25
  companyId: i,
25
- payrollId: m,
26
- onEvent: t,
27
- withReimbursements: r
26
+ payrollId: s,
27
+ onEvent: e,
28
+ withReimbursements: t
28
29
  }
29
30
  ) });
30
31
  }
31
32
  function u({
32
33
  companyId: o,
33
- payrollId: e,
34
- ...t
34
+ payrollId: r,
35
+ ...e
35
36
  }) {
36
- const { data: r } = c({ companyId: o, payrollId: e }), i = r.payrollShow?.payPeriod;
37
+ const { data: t } = m({ companyId: o, payrollId: r }), i = t.payrollShow?.payPeriod;
37
38
  return /* @__PURE__ */ n(
38
- p,
39
+ c,
39
40
  {
40
41
  companyId: o,
41
- payrollId: e,
42
+ payrollId: r,
42
43
  initialPayPeriod: i,
43
- ...t
44
+ isDismissalPayroll: f(t.payrollShow?.offCycleReason),
45
+ ...e
44
46
  }
45
47
  );
46
48
  }
47
49
  export {
48
- h as OffCycleCreationContextual,
49
- v as OffCycleExecutionContextual
50
+ v as OffCycleCreationContextual,
51
+ O as OffCycleExecutionContextual
50
52
  };
51
53
  //# sourceMappingURL=OffCycleFlowComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleFlowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { OffCycleCreation } from '../OffCycleCreation'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport type { OffCycleReason } from '../OffCycleReasonSelection'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { BaseComponent } from '@/components/Base/Base'\n\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n payrollType?: OffCycleReason\n withReimbursements?: boolean\n}\n\nexport interface OffCycleFlowProps {\n companyId: string\n payrollType?: OffCycleReason\n onEvent: OnEventType<EventType, unknown>\n withReimbursements?: boolean\n}\n\nexport function OffCycleCreationContextual() {\n const { companyId, payrollType, onEvent } = useFlow<OffCycleFlowContextInterface>()\n return (\n <OffCycleCreation\n companyId={ensureRequired(companyId)}\n payrollType={payrollType}\n onEvent={onEvent}\n />\n )\n}\n\nexport function OffCycleExecutionContextual() {\n const { companyId, payrollUuid, onEvent, withReimbursements } =\n useFlow<OffCycleFlowContextInterface>()\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <BaseComponent onEvent={onEvent}>\n <OffCycleExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n withReimbursements={withReimbursements}\n />\n </BaseComponent>\n )\n}\n\ntype OffCycleExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs' | 'withReimbursements'\n>\n\nfunction OffCycleExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: OffCycleExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n {...rest}\n />\n )\n}\n"],"names":["OffCycleCreationContextual","companyId","payrollType","onEvent","useFlow","jsx","OffCycleCreation","ensureRequired","OffCycleExecutionContextual","payrollUuid","withReimbursements","resolvedCompanyId","resolvedPayrollId","BaseComponent","OffCycleExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow"],"mappings":";;;;;;;AA2BO,SAASA,IAA6B;AAC3C,QAAM,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,EAAA,IAAYC,EAAA;AAC5C,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeN,CAAS;AAAA,MACnC,aAAAC;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEO,SAASK,IAA8B;AAC5C,QAAM,EAAE,WAAAP,GAAW,aAAAQ,GAAa,SAAAN,GAAS,oBAAAO,EAAA,IACvCN,EAAA,GAEIO,IAAoBJ,EAAeN,CAAS,GAC5CW,IAAoBL,EAAeE,CAAW;AAEpD,SACE,gBAAAJ,EAACQ,KAAc,SAAAV,GACb,UAAA,gBAAAE;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,MACX,WAAWC;AAAA,MACX,SAAAT;AAAA,MACA,oBAAAO;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASI,EAA0B;AAAA,EACjC,WAAAb;AAAA,EACA,WAAAc;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAAjB,GAAW,WAAAc,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAZ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,WAAAnB;AAAA,MACA,WAAAc;AAAA,MACA,kBAAAI;AAAA,MACC,GAAGH;AAAA,IAAA;AAAA,EAAA;AAGV;"}
1
+ {"version":3,"file":"OffCycleFlowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { OffCycleCreation } from '../OffCycleCreation'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport type { OffCycleReason } from '../OffCycleReasonSelection'\nimport { isDismissalPayroll } from '../helpers'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { BaseComponent } from '@/components/Base/Base'\n\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n payrollType?: OffCycleReason\n withReimbursements?: boolean\n}\n\nexport interface OffCycleFlowProps {\n companyId: string\n payrollType?: OffCycleReason\n onEvent: OnEventType<EventType, unknown>\n withReimbursements?: boolean\n}\n\nexport function OffCycleCreationContextual() {\n const { companyId, payrollType, onEvent } = useFlow<OffCycleFlowContextInterface>()\n return (\n <OffCycleCreation\n companyId={ensureRequired(companyId)}\n payrollType={payrollType}\n onEvent={onEvent}\n />\n )\n}\n\nexport function OffCycleExecutionContextual() {\n const { companyId, payrollUuid, onEvent, withReimbursements } =\n useFlow<OffCycleFlowContextInterface>()\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <BaseComponent onEvent={onEvent}>\n <OffCycleExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n withReimbursements={withReimbursements}\n />\n </BaseComponent>\n )\n}\n\ntype OffCycleExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs' | 'withReimbursements'\n>\n\nfunction OffCycleExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: OffCycleExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n isDismissalPayroll={isDismissalPayroll(data.payrollShow?.offCycleReason)}\n {...rest}\n />\n )\n}\n"],"names":["OffCycleCreationContextual","companyId","payrollType","onEvent","useFlow","jsx","OffCycleCreation","ensureRequired","OffCycleExecutionContextual","payrollUuid","withReimbursements","resolvedCompanyId","resolvedPayrollId","BaseComponent","OffCycleExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow","isDismissalPayroll"],"mappings":";;;;;;;;AA4BO,SAASA,IAA6B;AAC3C,QAAM,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,EAAA,IAAYC,EAAA;AAC5C,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeN,CAAS;AAAA,MACnC,aAAAC;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEO,SAASK,IAA8B;AAC5C,QAAM,EAAE,WAAAP,GAAW,aAAAQ,GAAa,SAAAN,GAAS,oBAAAO,EAAA,IACvCN,EAAA,GAEIO,IAAoBJ,EAAeN,CAAS,GAC5CW,IAAoBL,EAAeE,CAAW;AAEpD,SACE,gBAAAJ,EAACQ,KAAc,SAAAV,GACb,UAAA,gBAAAE;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,MACX,WAAWC;AAAA,MACX,SAAAT;AAAA,MACA,oBAAAO;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASI,EAA0B;AAAA,EACjC,WAAAb;AAAA,EACA,WAAAc;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAAjB,GAAW,WAAAc,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAZ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,WAAAnB;AAAA,MACA,WAAAc;AAAA,MACA,kBAAAI;AAAA,MACA,oBAAoBE,EAAmBJ,EAAK,aAAa,cAAc;AAAA,MACtE,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -1,19 +1,20 @@
1
- import { jsxs as i, jsx as a } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
2
  import { useTranslation as l } from "react-i18next";
3
- import r from "./OffCyclePayPeriodDateFormPresentation.module.scss.js";
3
+ import a from "./OffCyclePayPeriodDateFormPresentation.module.scss.js";
4
4
  import { useI18n as o } from "../../../i18n/I18n.js";
5
+ import "../../../shared/constants.js";
5
6
  import { CheckboxField as c } from "../../Common/Fields/CheckboxField/CheckboxField.js";
6
7
  import { DatePickerField as t } from "../../Common/Fields/DatePickerField/DatePickerField.js";
7
- function D() {
8
+ function h() {
8
9
  o("Payroll.OffCyclePayPeriodDateForm");
9
10
  const { t: e } = l("Payroll.OffCyclePayPeriodDateForm");
10
- return /* @__PURE__ */ i("div", { className: r.root, children: [
11
- /* @__PURE__ */ i("div", { className: r.dateFields, children: [
12
- /* @__PURE__ */ a(t, { name: "startDate", label: e("startDateLabel"), isRequired: !0 }),
13
- /* @__PURE__ */ a(t, { name: "endDate", label: e("endDateLabel"), isRequired: !0 })
11
+ return /* @__PURE__ */ i("div", { className: a.root, children: [
12
+ /* @__PURE__ */ i("div", { className: a.dateFields, children: [
13
+ /* @__PURE__ */ r(t, { name: "startDate", label: e("startDateLabel"), isRequired: !0 }),
14
+ /* @__PURE__ */ r(t, { name: "endDate", label: e("endDateLabel"), isRequired: !0 })
14
15
  ] }),
15
- /* @__PURE__ */ a("div", { className: r.checkDateField, children: /* @__PURE__ */ a(t, { name: "checkDate", label: e("checkDateLabel"), isRequired: !0 }) }),
16
- /* @__PURE__ */ a(
16
+ /* @__PURE__ */ r("div", { className: a.checkDateField, children: /* @__PURE__ */ r(t, { name: "checkDate", label: e("checkDateLabel"), isRequired: !0 }) }),
17
+ /* @__PURE__ */ r(
17
18
  c,
18
19
  {
19
20
  name: "isCheckOnly",
@@ -24,6 +25,6 @@ function D() {
24
25
  ] });
25
26
  }
26
27
  export {
27
- D as OffCyclePayPeriodDateFormPresentation
28
+ h as OffCyclePayPeriodDateFormPresentation
28
29
  };
29
30
  //# sourceMappingURL=OffCyclePayPeriodDateFormPresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffCyclePayPeriodDateFormPresentation.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport styles from './OffCyclePayPeriodDateFormPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { CheckboxField, DatePickerField } from '@/components/Common'\n\nexport function OffCyclePayPeriodDateFormPresentation() {\n useI18n('Payroll.OffCyclePayPeriodDateForm')\n const { t } = useTranslation('Payroll.OffCyclePayPeriodDateForm')\n\n return (\n <div className={styles.root}>\n <div className={styles.dateFields}>\n <DatePickerField name=\"startDate\" label={t('startDateLabel')} isRequired />\n <DatePickerField name=\"endDate\" label={t('endDateLabel')} isRequired />\n </div>\n\n <div className={styles.checkDateField}>\n <DatePickerField name=\"checkDate\" label={t('checkDateLabel')} isRequired />\n </div>\n\n <CheckboxField\n name=\"isCheckOnly\"\n label={t('checkOnlyLabel')}\n description={t('checkOnlyDescription')}\n />\n </div>\n )\n}\n"],"names":["OffCyclePayPeriodDateFormPresentation","useI18n","t","useTranslation","jsxs","styles","jsx","DatePickerField","CheckboxField"],"mappings":";;;;;;AAKO,SAASA,IAAwC;AACtD,EAAAC,EAAQ,mCAAmC;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC;AAEhE,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,MACrB,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAA,EAAI,WAAWC,EAAO,YACrB,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAgB,MAAK,aAAY,OAAOL,EAAE,gBAAgB,GAAG,YAAU,IAAC;AAAA,MACzE,gBAAAI,EAACC,KAAgB,MAAK,WAAU,OAAOL,EAAE,cAAc,GAAG,YAAU,GAAA,CAAC;AAAA,IAAA,GACvE;AAAA,IAEA,gBAAAI,EAAC,OAAA,EAAI,WAAWD,EAAO,gBACrB,UAAA,gBAAAC,EAACC,GAAA,EAAgB,MAAK,aAAY,OAAOL,EAAE,gBAAgB,GAAG,YAAU,IAAC,GAC3E;AAAA,IAEA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAON,EAAE,gBAAgB;AAAA,QACzB,aAAaA,EAAE,sBAAsB;AAAA,MAAA;AAAA,IAAA;AAAA,EACvC,GACF;AAEJ;"}
1
+ {"version":3,"file":"OffCyclePayPeriodDateFormPresentation.js","sources":["../../../../src/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport styles from './OffCyclePayPeriodDateFormPresentation.module.scss'\nimport { useI18n } from '@/i18n'\nimport { CheckboxField, DatePickerField } from '@/components/Common'\n\nexport function OffCyclePayPeriodDateFormPresentation() {\n useI18n('Payroll.OffCyclePayPeriodDateForm')\n const { t } = useTranslation('Payroll.OffCyclePayPeriodDateForm')\n\n return (\n <div className={styles.root}>\n <div className={styles.dateFields}>\n <DatePickerField name=\"startDate\" label={t('startDateLabel')} isRequired />\n <DatePickerField name=\"endDate\" label={t('endDateLabel')} isRequired />\n </div>\n\n <div className={styles.checkDateField}>\n <DatePickerField name=\"checkDate\" label={t('checkDateLabel')} isRequired />\n </div>\n\n <CheckboxField\n name=\"isCheckOnly\"\n label={t('checkOnlyLabel')}\n description={t('checkOnlyDescription')}\n />\n </div>\n )\n}\n"],"names":["OffCyclePayPeriodDateFormPresentation","useI18n","t","useTranslation","jsxs","styles","jsx","DatePickerField","CheckboxField"],"mappings":";;;;;;;AAKO,SAASA,IAAwC;AACtD,EAAAC,EAAQ,mCAAmC;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mCAAmC;AAEhE,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,MACrB,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAA,EAAI,WAAWC,EAAO,YACrB,UAAA;AAAA,MAAA,gBAAAC,EAACC,GAAA,EAAgB,MAAK,aAAY,OAAOL,EAAE,gBAAgB,GAAG,YAAU,IAAC;AAAA,MACzE,gBAAAI,EAACC,KAAgB,MAAK,WAAU,OAAOL,EAAE,cAAc,GAAG,YAAU,GAAA,CAAC;AAAA,IAAA,GACvE;AAAA,IAEA,gBAAAI,EAAC,OAAA,EAAI,WAAWD,EAAO,gBACrB,UAAA,gBAAAC,EAACC,GAAA,EAAgB,MAAK,aAAY,OAAOL,EAAE,gBAAgB,GAAG,YAAU,IAAC,GAC3E;AAAA,IAEA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAON,EAAE,gBAAgB;AAAA,QACzB,aAAaA,EAAE,sBAAsB;AAAA,MAAA;AAAA,IAAA;AAAA,EACvC,GACF;AAEJ;"}
@@ -1,6 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { useMemo as r } from "react";
3
3
  import { useTranslation as s } from "react-i18next";
4
+ import "../../../shared/constants.js";
4
5
  import { RadioGroupField as l } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
5
6
  function f({
6
7
  name: e,
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleReasonSelectionPresentation.js","sources":["../../../../src/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { OffCycleReason } from './types'\nimport { RadioGroupField } from '@/components/Common'\n\ninterface OffCycleReasonSelectionPresentationProps {\n name: string\n onChange?: (value: OffCycleReason) => void\n}\n\nexport function OffCycleReasonSelectionPresentation({\n name,\n onChange,\n}: OffCycleReasonSelectionPresentationProps) {\n const { t } = useTranslation('Payroll.OffCycleReasonSelection')\n\n const options = useMemo(\n () => [\n {\n value: 'correction' as OffCycleReason,\n label: t('options.correction.label'),\n description: t('options.correction.description'),\n },\n {\n value: 'bonus' as OffCycleReason,\n label: t('options.bonus.label'),\n description: t('options.bonus.description'),\n },\n ],\n [t],\n )\n\n return (\n <RadioGroupField<OffCycleReason>\n name={name}\n label={t('title')}\n options={options}\n isRequired\n onChange={onChange}\n />\n )\n}\n"],"names":["OffCycleReasonSelectionPresentation","name","onChange","t","useTranslation","options","useMemo","jsx","RadioGroupField"],"mappings":";;;;AAUO,SAASA,EAAoC;AAAA,EAClD,MAAAC;AAAA,EACA,UAAAC;AACF,GAA6C;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,iCAAiC,GAExDC,IAAUC;AAAA,IACd,MAAM;AAAA,MACJ;AAAA,QACE,OAAO;AAAA,QACP,OAAOH,EAAE,0BAA0B;AAAA,QACnC,aAAaA,EAAE,gCAAgC;AAAA,MAAA;AAAA,MAEjD;AAAA,QACE,OAAO;AAAA,QACP,OAAOA,EAAE,qBAAqB;AAAA,QAC9B,aAAaA,EAAE,2BAA2B;AAAA,MAAA;AAAA,IAC5C;AAAA,IAEF,CAACA,CAAC;AAAA,EAAA;AAGJ,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAP;AAAA,MACA,OAAOE,EAAE,OAAO;AAAA,MAChB,SAAAE;AAAA,MACA,YAAU;AAAA,MACV,UAAAH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"OffCycleReasonSelectionPresentation.js","sources":["../../../../src/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport type { OffCycleReason } from './types'\nimport { RadioGroupField } from '@/components/Common'\n\ninterface OffCycleReasonSelectionPresentationProps {\n name: string\n onChange?: (value: OffCycleReason) => void\n}\n\nexport function OffCycleReasonSelectionPresentation({\n name,\n onChange,\n}: OffCycleReasonSelectionPresentationProps) {\n const { t } = useTranslation('Payroll.OffCycleReasonSelection')\n\n const options = useMemo(\n () => [\n {\n value: 'correction' as OffCycleReason,\n label: t('options.correction.label'),\n description: t('options.correction.description'),\n },\n {\n value: 'bonus' as OffCycleReason,\n label: t('options.bonus.label'),\n description: t('options.bonus.description'),\n },\n ],\n [t],\n )\n\n return (\n <RadioGroupField<OffCycleReason>\n name={name}\n label={t('title')}\n options={options}\n isRequired\n onChange={onChange}\n />\n )\n}\n"],"names":["OffCycleReasonSelectionPresentation","name","onChange","t","useTranslation","options","useMemo","jsx","RadioGroupField"],"mappings":";;;;;AAUO,SAASA,EAAoC;AAAA,EAClD,MAAAC;AAAA,EACA,UAAAC;AACF,GAA6C;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,iCAAiC,GAExDC,IAAUC;AAAA,IACd,MAAM;AAAA,MACJ;AAAA,QACE,OAAO;AAAA,QACP,OAAOH,EAAE,0BAA0B;AAAA,QACnC,aAAaA,EAAE,gCAAgC;AAAA,MAAA;AAAA,MAEjD;AAAA,QACE,OAAO;AAAA,QACP,OAAOA,EAAE,qBAAqB;AAAA,QAC9B,aAAaA,EAAE,2BAA2B;AAAA,MAAA;AAAA,IAC5C;AAAA,IAEF,CAACA,CAAC;AAAA,EAAA;AAGJ,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAP;AAAA,MACA,OAAOE,EAAE,OAAO;AAAA,MAChB,SAAAE;AAAA,MACA,YAAU;AAAA,MACV,UAAAH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -5,12 +5,13 @@ import { useTranslation as L } from "react-i18next";
5
5
  import { WithholdingPayPeriod as N } from "@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls";
6
6
  import { WITHHOLDING_PAY_PERIOD_I18N_KEY as p } from "../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js";
7
7
  import l from "./OffCycleTaxWithholdingModal.module.scss.js";
8
+ import "../../../shared/constants.js";
8
9
  import { ActionsLayout as T } from "../../Common/ActionsLayout/ActionsLayout.js";
9
10
  import { useComponentContext as W } from "../../../contexts/ComponentAdapter/useComponentContext.js";
10
11
  import { useI18n as w } from "../../../i18n/I18n.js";
11
12
  import { SelectField as D } from "../../Common/Fields/SelectField/SelectField.js";
12
13
  import { RadioGroupField as H } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
13
- function Y({
14
+ function K({
14
15
  isOpen: h,
15
16
  defaultConfig: f,
16
17
  onDone: g,
@@ -95,6 +96,6 @@ function Y({
95
96
  );
96
97
  }
97
98
  export {
98
- Y as OffCycleTaxWithholdingModal
99
+ K as OffCycleTaxWithholdingModal
99
100
  };
100
101
  //# sourceMappingURL=OffCycleTaxWithholdingModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OffCycleTaxWithholdingModal.js","sources":["../../../../src/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.tsx"],"sourcesContent":["import { useMemo, useRef } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { WithholdingPayPeriod } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { WITHHOLDING_PAY_PERIOD_I18N_KEY } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type { OffCycleTaxWithholdingConfig } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport styles from './OffCycleTaxWithholdingModal.module.scss'\nimport type { OffCycleTaxWithholdingModalProps } from './OffCycleTaxWithholdingModalTypes'\nimport { ActionsLayout, SelectField, RadioGroupField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport function OffCycleTaxWithholdingModal({\n isOpen,\n defaultConfig,\n onDone,\n onCancel,\n}: OffCycleTaxWithholdingModalProps) {\n useI18n('Payroll.OffCycleTaxWithholding')\n const { t } = useTranslation('Payroll.OffCycleTaxWithholding')\n const { Modal, Heading, Text, Button } = useComponentContext()\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const formHandlers = useForm<OffCycleTaxWithholdingConfig>({\n defaultValues: defaultConfig,\n })\n\n const currentWithholdingPayPeriod = useWatch({\n control: formHandlers.control,\n name: 'withholdingPayPeriod',\n })\n\n const frequencyOptions = useMemo(\n () =>\n Object.values(WithholdingPayPeriod).map(value => ({\n value,\n label: t(WITHHOLDING_PAY_PERIOD_I18N_KEY[value]),\n })),\n [t],\n )\n\n const frequencyDisplayText = t(\n WITHHOLDING_PAY_PERIOD_I18N_KEY[currentWithholdingPayPeriod],\n ).toLowerCase()\n\n const withholdingRateOptions = useMemo(\n () => [\n {\n value: 'supplemental' as const,\n label: t('modal.supplementalSection.useSupplementalRate'),\n description: t('modal.supplementalSection.useSupplementalRateDescription'),\n },\n {\n value: 'regular' as const,\n label: t('modal.supplementalSection.useRegularRate', {\n frequency: frequencyDisplayText,\n }),\n description: t('modal.supplementalSection.useRegularRateDescription'),\n },\n ],\n [t, frequencyDisplayText],\n )\n\n const handleSubmit = formHandlers.handleSubmit(onDone)\n\n return (\n <Modal\n isOpen={isOpen}\n onClose={onCancel}\n containerRef={modalContainerRef}\n footer={\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('modal.cancelButton')}\n </Button>\n <Button variant=\"primary\" onClick={handleSubmit}>\n {t('modal.doneButton')}\n </Button>\n </ActionsLayout>\n }\n >\n <FormProvider {...formHandlers}>\n <div className={styles.content}>\n <Heading as=\"h2\">{t('modal.title')}</Heading>\n\n <div className={styles.section}>\n <Heading as=\"h3\">{t('modal.regularSection.title')}</Heading>\n <Text variant=\"supporting\">{t('modal.regularSection.subtitle')}</Text>\n\n <div className={styles.rateInfo}>\n <Text weight=\"semibold\">{t('modal.regularSection.rateLabel')}</Text>\n <Text variant=\"supporting\">{t('modal.regularSection.rateDescription')}</Text>\n </div>\n\n <SelectField\n name=\"withholdingPayPeriod\"\n label={t('modal.regularSection.rateLabel')}\n options={frequencyOptions}\n shouldVisuallyHideLabel\n portalContainer={modalContainerRef.current ?? undefined}\n />\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.section}>\n <Heading as=\"h3\">{t('modal.supplementalSection.title')}</Heading>\n <RadioGroupField\n name=\"withholdingRate\"\n label={t('modal.supplementalSection.title')}\n options={withholdingRateOptions}\n shouldVisuallyHideLabel\n />\n </div>\n </div>\n </FormProvider>\n </Modal>\n )\n}\n"],"names":["OffCycleTaxWithholdingModal","isOpen","defaultConfig","onDone","onCancel","useI18n","t","useTranslation","Modal","Heading","Text","Button","useComponentContext","modalContainerRef","useRef","formHandlers","useForm","currentWithholdingPayPeriod","useWatch","frequencyOptions","useMemo","WithholdingPayPeriod","value","WITHHOLDING_PAY_PERIOD_I18N_KEY","frequencyDisplayText","withholdingRateOptions","handleSubmit","jsx","ActionsLayout","FormProvider","styles","jsxs","SelectField","RadioGroupField"],"mappings":"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"}
1
+ {"version":3,"file":"OffCycleTaxWithholdingModal.js","sources":["../../../../src/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.tsx"],"sourcesContent":["import { useMemo, useRef } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { WithholdingPayPeriod } from '@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls'\nimport { WITHHOLDING_PAY_PERIOD_I18N_KEY } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport type { OffCycleTaxWithholdingConfig } from '../OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes'\nimport styles from './OffCycleTaxWithholdingModal.module.scss'\nimport type { OffCycleTaxWithholdingModalProps } from './OffCycleTaxWithholdingModalTypes'\nimport { ActionsLayout, SelectField, RadioGroupField } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\n\nexport function OffCycleTaxWithholdingModal({\n isOpen,\n defaultConfig,\n onDone,\n onCancel,\n}: OffCycleTaxWithholdingModalProps) {\n useI18n('Payroll.OffCycleTaxWithholding')\n const { t } = useTranslation('Payroll.OffCycleTaxWithholding')\n const { Modal, Heading, Text, Button } = useComponentContext()\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const formHandlers = useForm<OffCycleTaxWithholdingConfig>({\n defaultValues: defaultConfig,\n })\n\n const currentWithholdingPayPeriod = useWatch({\n control: formHandlers.control,\n name: 'withholdingPayPeriod',\n })\n\n const frequencyOptions = useMemo(\n () =>\n Object.values(WithholdingPayPeriod).map(value => ({\n value,\n label: t(WITHHOLDING_PAY_PERIOD_I18N_KEY[value]),\n })),\n [t],\n )\n\n const frequencyDisplayText = t(\n WITHHOLDING_PAY_PERIOD_I18N_KEY[currentWithholdingPayPeriod],\n ).toLowerCase()\n\n const withholdingRateOptions = useMemo(\n () => [\n {\n value: 'supplemental' as const,\n label: t('modal.supplementalSection.useSupplementalRate'),\n description: t('modal.supplementalSection.useSupplementalRateDescription'),\n },\n {\n value: 'regular' as const,\n label: t('modal.supplementalSection.useRegularRate', {\n frequency: frequencyDisplayText,\n }),\n description: t('modal.supplementalSection.useRegularRateDescription'),\n },\n ],\n [t, frequencyDisplayText],\n )\n\n const handleSubmit = formHandlers.handleSubmit(onDone)\n\n return (\n <Modal\n isOpen={isOpen}\n onClose={onCancel}\n containerRef={modalContainerRef}\n footer={\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onCancel}>\n {t('modal.cancelButton')}\n </Button>\n <Button variant=\"primary\" onClick={handleSubmit}>\n {t('modal.doneButton')}\n </Button>\n </ActionsLayout>\n }\n >\n <FormProvider {...formHandlers}>\n <div className={styles.content}>\n <Heading as=\"h2\">{t('modal.title')}</Heading>\n\n <div className={styles.section}>\n <Heading as=\"h3\">{t('modal.regularSection.title')}</Heading>\n <Text variant=\"supporting\">{t('modal.regularSection.subtitle')}</Text>\n\n <div className={styles.rateInfo}>\n <Text weight=\"semibold\">{t('modal.regularSection.rateLabel')}</Text>\n <Text variant=\"supporting\">{t('modal.regularSection.rateDescription')}</Text>\n </div>\n\n <SelectField\n name=\"withholdingPayPeriod\"\n label={t('modal.regularSection.rateLabel')}\n options={frequencyOptions}\n shouldVisuallyHideLabel\n portalContainer={modalContainerRef.current ?? undefined}\n />\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.section}>\n <Heading as=\"h3\">{t('modal.supplementalSection.title')}</Heading>\n <RadioGroupField\n name=\"withholdingRate\"\n label={t('modal.supplementalSection.title')}\n options={withholdingRateOptions}\n shouldVisuallyHideLabel\n />\n </div>\n </div>\n </FormProvider>\n </Modal>\n )\n}\n"],"names":["OffCycleTaxWithholdingModal","isOpen","defaultConfig","onDone","onCancel","useI18n","t","useTranslation","Modal","Heading","Text","Button","useComponentContext","modalContainerRef","useRef","formHandlers","useForm","currentWithholdingPayPeriod","useWatch","frequencyOptions","useMemo","WithholdingPayPeriod","value","WITHHOLDING_PAY_PERIOD_I18N_KEY","frequencyDisplayText","withholdingRateOptions","handleSubmit","jsx","ActionsLayout","FormProvider","styles","jsxs","SelectField","RadioGroupField"],"mappings":"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"}
@@ -1,64 +1,64 @@
1
- import { jsx as S, jsxs as ie, Fragment as ne } from "react/jsx-runtime";
2
- import { useState as d, useEffect as G } from "react";
3
- import { usePayrollsGetSuspense as pe } from "@gusto/embedded-api/react-query/payrollsGet";
4
- import { payrollsCalculate as ue } from "@gusto/embedded-api/funcs/payrollsCalculate";
5
- import { useGustoEmbeddedContext as ce } from "@gusto/embedded-api/react-query/_context";
6
- import { PayrollProcessingRequestStatus as L } from "@gusto/embedded-api/models/components/payrollprocessingrequest";
7
- import { useTranslation as me } from "react-i18next";
8
- import { usePayrollsUpdateMutation as ye } from "@gusto/embedded-api/react-query/payrollsUpdate";
9
- import { usePayrollsCalculateGrossUpMutation as de } from "@gusto/embedded-api/react-query/payrollsCalculateGrossUp";
10
- import { usePayrollsGetBlockersSuspense as fe } from "@gusto/embedded-api/react-query/payrollsGetBlockers";
11
- import { payrollSubmitHandler as Ce } from "../PayrollBlocker/payrollHelpers.js";
12
- import { PayrollConfigurationPresentation as Se } from "./PayrollConfigurationPresentation.js";
13
- import { usePayrollConfigurationData as Pe } from "./usePayrollConfigurationData.js";
14
- import { isGrossUpEligible as Ue, getGrossUpTargetCompensationName as ge } from "./grossUpHelpers.js";
15
- import { BaseComponent as he } from "../../Base/Base.js";
1
+ import { jsx as S, jsxs as ne, Fragment as pe } from "react/jsx-runtime";
2
+ import { useState as d, useRef as ue, useEffect as G } from "react";
3
+ import { usePayrollsGetSuspense as ce } from "@gusto/embedded-api/react-query/payrollsGet";
4
+ import { payrollsCalculate as me } from "@gusto/embedded-api/funcs/payrollsCalculate";
5
+ import { useGustoEmbeddedContext as ye } from "@gusto/embedded-api/react-query/_context";
6
+ import { PayrollProcessingRequestStatus as w } from "@gusto/embedded-api/models/components/payrollprocessingrequest";
7
+ import { useTranslation as de } from "react-i18next";
8
+ import { usePayrollsUpdateMutation as fe } from "@gusto/embedded-api/react-query/payrollsUpdate";
9
+ import { usePayrollsCalculateGrossUpMutation as Ce } from "@gusto/embedded-api/react-query/payrollsCalculateGrossUp";
10
+ import { usePayrollsGetBlockersSuspense as Se } from "@gusto/embedded-api/react-query/payrollsGetBlockers";
11
+ import { payrollSubmitHandler as Pe } from "../PayrollBlocker/payrollHelpers.js";
12
+ import { PayrollConfigurationPresentation as Ue } from "./PayrollConfigurationPresentation.js";
13
+ import { usePayrollConfigurationData as ge } from "./usePayrollConfigurationData.js";
14
+ import { isGrossUpEligible as he, getGrossUpTargetCompensationName as Le } from "./grossUpHelpers.js";
15
+ import { BaseComponent as we } from "../../Base/Base.js";
16
16
  import { componentEvents as r } from "../../../shared/constants.js";
17
- import { useComponentDictionary as Le, useI18n as we } from "../../../i18n/I18n.js";
18
- import { useBase as _e } from "../../Base/useBase.js";
19
- import { useDateFormatter as Re } from "../../../hooks/useDateFormatter.js";
20
- import { SDKInternalError as T } from "../../../types/sdkError.js";
21
- import { GrossUpModal as De } from "../GrossUpModal/GrossUpModal.js";
22
- const Ae = (o) => o?.status === L.Calculating, Ee = (o, n) => n != null && (o?.status === L.CalculateSuccess || o == null);
23
- function $e(o) {
24
- return /* @__PURE__ */ S(he, { ...o, children: /* @__PURE__ */ S(Oe, { ...o, children: o.children }) });
17
+ import { useComponentDictionary as _e, useI18n as Re } from "../../../i18n/I18n.js";
18
+ import { useBase as Ae } from "../../Base/useBase.js";
19
+ import { useDateFormatter as De } from "../../../hooks/useDateFormatter.js";
20
+ import { SDKInternalError as x } from "../../../types/sdkError.js";
21
+ import { GrossUpModal as Ee } from "../GrossUpModal/GrossUpModal.js";
22
+ const Oe = (o) => o?.status === w.Calculating, be = (o, n) => n != null && (o?.status === w.CalculateSuccess || o == null);
23
+ function et(o) {
24
+ return /* @__PURE__ */ S(we, { ...o, children: /* @__PURE__ */ S(Te, { ...o, children: o.children }) });
25
25
  }
26
- const Oe = ({
26
+ const Te = ({
27
27
  onEvent: o,
28
28
  companyId: n,
29
29
  payrollId: p,
30
- dictionary: x,
31
- alerts: N,
32
- withReimbursements: M = !0
30
+ dictionary: N,
31
+ alerts: M,
32
+ withReimbursements: Y = !0
33
33
  }) => {
34
- Le("Payroll.PayrollConfiguration", x), we("Payroll.PayrollConfiguration");
35
- const { t: u } = me("Payroll.PayrollConfiguration"), { baseSubmitHandler: f } = _e(), c = Re(), [l, m] = d(!1), [P, w] = d(!1), Y = ce(), {
36
- employeeDetails: B,
37
- employeeCompensations: _,
38
- paySchedule: j,
39
- payPeriod: F,
40
- payrollCategory: U,
41
- pagination: W,
42
- isLoading: q,
43
- refetch: R
44
- } = Pe({
34
+ _e("Payroll.PayrollConfiguration", N), Re("Payroll.PayrollConfiguration");
35
+ const { t: u } = de("Payroll.PayrollConfiguration"), { baseSubmitHandler: f } = Ae(), c = De(), [l, m] = d(!1), [P, _] = d(!1), U = ue(null), B = ye(), {
36
+ employeeDetails: j,
37
+ employeeCompensations: R,
38
+ paySchedule: F,
39
+ payPeriod: W,
40
+ payrollCategory: g,
41
+ pagination: q,
42
+ isLoading: I,
43
+ refetch: A
44
+ } = ge({
45
45
  companyId: n,
46
46
  payrollId: p,
47
47
  isCalculating: l || P
48
- }), { data: a } = pe(
48
+ }), { data: a } = ce(
49
49
  {
50
50
  companyId: n,
51
51
  payrollId: p,
52
52
  include: ["taxes", "benefits", "deductions", "payroll_status_meta"]
53
53
  },
54
54
  { refetchInterval: l ? 5e3 : !1 }
55
- ), { mutateAsync: D, isPending: I } = ye(), { mutateAsync: H } = de(), [y, A] = d(null), [K, g] = d(!1), E = Ue(U), C = ge(U), V = (e) => {
56
- A(e), g(!0), o(r.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid: e });
57
- }, J = async (e) => {
55
+ ), { mutateAsync: D, isPending: H } = fe(), { mutateAsync: K } = Ce(), [y, E] = d(null), [V, h] = d(!1), O = he(g), C = Le(g), J = (e) => {
56
+ E(e), h(!0), o(r.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid: e });
57
+ }, z = async (e) => {
58
58
  if (!y) return null;
59
59
  let t = null;
60
60
  return await f(null, async () => {
61
- t = (await H({
61
+ t = (await K({
62
62
  request: {
63
63
  payrollUuid: p,
64
64
  payrollGrossUpRequest: {
@@ -72,22 +72,22 @@ const Oe = ({
72
72
  employeeUuid: y
73
73
  });
74
74
  }), t;
75
- }, z = async (e) => {
75
+ }, Q = async (e) => {
76
76
  if (!y || !C)
77
- throw new T(
77
+ throw new x(
78
78
  "Unable to apply gross-up: missing employee or target compensation."
79
79
  );
80
- const t = _.find((s) => s.employeeUuid === y);
80
+ const t = R.find((s) => s.employeeUuid === y);
81
81
  if (!t)
82
- throw new T("Unable to apply gross-up: employee compensation not found.");
83
- const i = t.fixedCompensations ?? [], ae = i.some(
82
+ throw new x("Unable to apply gross-up: employee compensation not found.");
83
+ const i = t.fixedCompensations ?? [], se = i.some(
84
84
  (s) => s.name?.toLowerCase() === C.toLowerCase()
85
85
  ), k = i.map((s) => ({
86
86
  name: s.name,
87
87
  jobUuid: s.jobUuid,
88
88
  amount: s.name?.toLowerCase() === C.toLowerCase() ? e : "0"
89
89
  }));
90
- if (!ae) {
90
+ if (!se) {
91
91
  const s = t.hourlyCompensations?.[0]?.jobUuid ?? i[0]?.jobUuid ?? "";
92
92
  k.push({
93
93
  name: C,
@@ -95,18 +95,18 @@ const Oe = ({
95
95
  amount: e
96
96
  });
97
97
  }
98
- const se = (t.hourlyCompensations ?? []).map((s) => ({
98
+ const le = (t.hourlyCompensations ?? []).map((s) => ({
99
99
  name: s.name,
100
100
  jobUuid: s.jobUuid,
101
101
  hours: "0"
102
- })), le = (t.paidTimeOff ?? []).map((s) => ({
102
+ })), re = (t.paidTimeOff ?? []).map((s) => ({
103
103
  name: s.name,
104
104
  hours: "0"
105
- })), re = b({
105
+ })), ie = T({
106
106
  ...t,
107
107
  fixedCompensations: k,
108
- hourlyCompensations: se,
109
- paidTimeOff: le
108
+ hourlyCompensations: le,
109
+ paidTimeOff: re
110
110
  });
111
111
  await f({}, async () => {
112
112
  const s = await D({
@@ -114,30 +114,30 @@ const Oe = ({
114
114
  companyId: n,
115
115
  payrollId: p,
116
116
  payrollUpdate: {
117
- employeeCompensations: [{ ...re, excluded: !1 }]
117
+ employeeCompensations: [{ ...ie, excluded: !1 }]
118
118
  }
119
119
  }
120
120
  });
121
121
  o(r.RUN_PAYROLL_EMPLOYEE_SAVED, {
122
122
  payrollPrepared: s.payrollPrepared
123
- }), await R();
124
- }), A(null), g(!1);
125
- }, Q = async (e) => {
123
+ }), await A();
124
+ }), E(null), h(!1);
125
+ }, X = async (e) => {
126
126
  try {
127
- await z(e);
127
+ await Q(e);
128
128
  } catch {
129
129
  }
130
- }, { data: X } = fe({
130
+ }, { data: Z } = Se({
131
131
  companyUuid: n
132
- }), O = (X.payrollBlockers ?? []).map((e) => ({
132
+ }), b = (Z.payrollBlockers ?? []).map((e) => ({
133
133
  key: e.key,
134
134
  message: e.message
135
- })), [Z, h] = d(O), $ = async () => {
136
- h([]), await f({}, async () => {
137
- const e = await Ce(async () => {
138
- w(!0);
135
+ })), [$, L] = d(b), v = async () => {
136
+ L([]), U.current = a.payrollShow?.calculatedAt?.getTime() ?? null, await f({}, async () => {
137
+ const e = await Pe(async () => {
138
+ _(!0);
139
139
  try {
140
- const t = await ue(Y, {
140
+ const t = await me(B, {
141
141
  companyId: n,
142
142
  payrollId: p
143
143
  });
@@ -145,18 +145,18 @@ const Oe = ({
145
145
  throw t.error;
146
146
  m(!0);
147
147
  } finally {
148
- w(!1);
148
+ _(!1);
149
149
  }
150
150
  });
151
- !e.success && e.blockers.length > 0 && h(e.blockers);
151
+ !e.success && e.blockers.length > 0 && L(e.blockers);
152
152
  });
153
- }, v = (e) => {
153
+ }, ee = (e) => {
154
154
  o(r.RUN_PAYROLL_EMPLOYEE_EDIT, {
155
155
  employeeId: e.uuid,
156
156
  firstName: e.firstName,
157
157
  lastName: e.lastName
158
158
  });
159
- }, b = ({
159
+ }, T = ({
160
160
  paymentMethod: e,
161
161
  reimbursements: t,
162
162
  ...i
@@ -164,11 +164,11 @@ const Oe = ({
164
164
  ...i,
165
165
  ...e && e !== "Historical" ? { paymentMethod: e } : {},
166
166
  memo: i.memo || void 0
167
- }), ee = async (e) => {
167
+ }), te = async (e) => {
168
168
  o(r.RUN_PAYROLL_EMPLOYEE_SKIP, {
169
169
  employeeId: e.employeeUuid
170
170
  }), await f({}, async () => {
171
- const t = b(e), i = await D({
171
+ const t = T(e), i = await D({
172
172
  request: {
173
173
  companyId: n,
174
174
  payrollId: p,
@@ -181,16 +181,15 @@ const Oe = ({
181
181
  });
182
182
  o(r.RUN_PAYROLL_EMPLOYEE_SAVED, {
183
183
  payrollPrepared: i.payrollPrepared
184
- }), await R();
184
+ }), await A();
185
185
  });
186
186
  }, oe = () => {
187
187
  o(r.RUN_PAYROLL_BLOCKERS_VIEW_ALL);
188
188
  };
189
189
  G(() => {
190
- Ae(a.payrollShow?.processingRequest) && !l && m(!0), l && Ee(
191
- a.payrollShow?.processingRequest,
192
- a.payrollShow?.calculatedAt
193
- ) && (o(r.RUN_PAYROLL_CALCULATED, {
190
+ Oe(a.payrollShow?.processingRequest) && !l && (U.current = a.payrollShow?.calculatedAt?.getTime() ?? null, m(!0));
191
+ const e = a.payrollShow?.calculatedAt, t = e?.getTime() !== U.current;
192
+ l && t && be(a.payrollShow?.processingRequest, e) && (o(r.RUN_PAYROLL_CALCULATED, {
194
193
  payrollId: p,
195
194
  alert: {
196
195
  type: "success",
@@ -198,7 +197,7 @@ const Oe = ({
198
197
  alertKey: "progressSaved"
199
198
  },
200
199
  payPeriod: a.payrollShow?.payPeriod
201
- }), h([]), m(!1)), l && a.payrollShow?.processingRequest?.status === L.ProcessingFailed && (o(r.RUN_PAYROLL_PROCESSING_FAILED), m(!1));
200
+ }), L([]), m(!1)), l && a.payrollShow?.processingRequest?.status === w.ProcessingFailed && (o(r.RUN_PAYROLL_PROCESSING_FAILED), m(!1));
202
201
  }, [
203
202
  a.payrollShow?.processingRequest?.status,
204
203
  a.payrollShow?.calculatedAt,
@@ -215,7 +214,7 @@ const Oe = ({
215
214
  clearTimeout(t);
216
215
  };
217
216
  }, [l, o]);
218
- const te = a.payrollShow?.payrollStatusMeta?.payrollLate && a.payrollShow.payrollStatusMeta.initialCheckDate && a.payrollShow.payrollStatusMeta.expectedDebitTime && a.payrollShow.payrollStatusMeta.expectedCheckDate ? {
217
+ const ae = a.payrollShow?.payrollStatusMeta?.payrollLate && a.payrollShow.payrollStatusMeta.initialCheckDate && a.payrollShow.payrollStatusMeta.expectedDebitTime && a.payrollShow.payrollStatusMeta.expectedCheckDate ? {
219
218
  label: u("alerts.payrollLate", {
220
219
  initialCheckDate: c.formatShortWithWeekday(
221
220
  a.payrollShow.payrollStatusMeta.initialCheckDate
@@ -238,46 +237,46 @@ const Oe = ({
238
237
  content: u("alerts.directDepositDeadlineText"),
239
238
  variant: "info"
240
239
  } : void 0;
241
- return /* @__PURE__ */ ie(ne, { children: [
240
+ return /* @__PURE__ */ ne(pe, { children: [
242
241
  /* @__PURE__ */ S(
243
- Se,
242
+ Ue,
244
243
  {
245
- onCalculatePayroll: $,
246
- isCalculateDisabled: O.length > 0,
247
- onEdit: v,
248
- onToggleExclude: ee,
244
+ onCalculatePayroll: v,
245
+ isCalculateDisabled: b.length > 0,
246
+ onEdit: ee,
247
+ onToggleExclude: te,
249
248
  onViewBlockers: oe,
250
- employeeCompensations: _,
251
- employeeDetails: B,
252
- payPeriod: F,
253
- paySchedule: j,
254
- payrollCategory: U,
255
- alerts: N,
256
- payrollAlert: te,
257
- isPending: l || q || I || P,
249
+ employeeCompensations: R,
250
+ employeeDetails: j,
251
+ payPeriod: W,
252
+ paySchedule: F,
253
+ payrollCategory: g,
254
+ alerts: M,
255
+ payrollAlert: ae,
256
+ isPending: l || I || H || P,
258
257
  isCalculating: P || l,
259
- payrollBlockers: Z,
260
- pagination: W,
261
- withReimbursements: M,
262
- grossUpEnabled: E,
263
- onGrossUpSelect: V
258
+ payrollBlockers: $,
259
+ pagination: q,
260
+ withReimbursements: Y,
261
+ grossUpEnabled: O,
262
+ onGrossUpSelect: J
264
263
  }
265
264
  ),
266
- E && /* @__PURE__ */ S(
267
- De,
265
+ O && /* @__PURE__ */ S(
266
+ Ee,
268
267
  {
269
- isOpen: K,
270
- onCalculateGrossUp: J,
271
- onApply: Q,
268
+ isOpen: V,
269
+ onCalculateGrossUp: z,
270
+ onApply: X,
272
271
  onCancel: () => {
273
- g(!1);
272
+ h(!1);
274
273
  }
275
274
  }
276
275
  )
277
276
  ] });
278
277
  };
279
278
  export {
280
- $e as PayrollConfiguration,
281
- Oe as Root
279
+ et as PayrollConfiguration,
280
+ Te as Root
282
281
  };
283
282
  //# sourceMappingURL=PayrollConfiguration.js.map