@gusto/embedded-react-sdk 0.45.0 → 0.46.2

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 (233) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
  3. package/dist/components/Common/DataView/DataCards/DataCards.js +14 -13
  4. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  5. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
  6. package/dist/components/Common/DataView/DataTable/DataTable.js +51 -50
  7. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  8. package/dist/components/Common/DataView/DataView.d.ts +1 -0
  9. package/dist/components/Common/DataView/DataView.js.map +1 -1
  10. package/dist/components/Common/DataView/useDataView.d.ts +8 -1
  11. package/dist/components/Common/DataView/useDataView.js +20 -17
  12. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  13. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +20 -4
  14. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  15. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +20 -4
  16. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  17. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +22 -6
  18. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  19. package/dist/components/Company/BankAccount/BankAccountForm/context.js +20 -4
  20. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  21. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +20 -4
  22. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  23. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/fields.js +4 -4
  24. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +28 -12
  25. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  26. package/dist/components/Company/Industry/Context.js +23 -7
  27. package/dist/components/Company/Industry/Context.js.map +1 -1
  28. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +20 -4
  29. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  30. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +20 -4
  31. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  32. package/dist/components/Company/OnboardingOverview/context.js +20 -4
  33. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  34. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/fields.js +5 -5
  35. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +20 -4
  36. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  37. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +20 -4
  38. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  39. package/dist/components/Contractor/Address/useAddress.js +22 -6
  40. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  41. package/dist/components/Contractor/Profile/useContractorProfile.js +52 -42
  42. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  43. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.d.ts +9 -0
  44. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js +76 -0
  45. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js.map +1 -0
  46. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js +8 -0
  47. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js.map +1 -0
  48. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.d.ts +11 -0
  49. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +85 -0
  50. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -0
  51. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js +8 -0
  52. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.module.scss.js.map +1 -0
  53. package/dist/components/Employee/Compensation/management/EditCompensation/index.d.ts +3 -0
  54. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.d.ts +25 -0
  55. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js +81 -0
  56. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js.map +1 -0
  57. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js +8 -0
  58. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js.map +1 -0
  59. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +18 -0
  60. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +171 -0
  61. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -0
  62. package/dist/components/Employee/Compensation/management/index.d.ts +6 -0
  63. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +6 -1
  64. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +67 -209
  65. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
  66. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +18 -0
  67. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +169 -0
  68. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -0
  69. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +16 -0
  70. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +36 -30
  71. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
  72. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +1 -1
  73. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js +4 -4
  74. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
  75. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +212 -187
  76. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
  77. package/dist/components/Employee/Compensation/shared/useJobForm/fields.js +6 -6
  78. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.d.ts +8 -0
  79. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js +22 -17
  80. package/dist/components/Employee/Compensation/shared/useJobForm/jobSchema.js.map +1 -1
  81. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +12 -2
  82. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +115 -110
  83. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
  84. package/dist/components/Employee/Dashboard/BasicDetailsView.d.ts +8 -3
  85. package/dist/components/Employee/Dashboard/BasicDetailsView.js +108 -84
  86. package/dist/components/Employee/Dashboard/BasicDetailsView.js.map +1 -1
  87. package/dist/components/Employee/Dashboard/Dashboard.d.ts +2 -0
  88. package/dist/components/Employee/Dashboard/Dashboard.js +86 -68
  89. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
  90. package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +8 -4
  91. package/dist/components/Employee/Dashboard/DashboardComponents.js +147 -93
  92. package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
  93. package/dist/components/Employee/Dashboard/DocumentsView.js +18 -11
  94. package/dist/components/Employee/Dashboard/DocumentsView.js.map +1 -1
  95. package/dist/components/Employee/Dashboard/JobAndPayView.js +304 -264
  96. package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
  97. package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +10 -0
  98. package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -0
  99. package/dist/components/Employee/Dashboard/TaxesView.d.ts +7 -2
  100. package/dist/components/Employee/Dashboard/TaxesView.js +68 -54
  101. package/dist/components/Employee/Dashboard/TaxesView.js.map +1 -1
  102. package/dist/components/Employee/Dashboard/dashboardStateMachine.js +152 -142
  103. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
  104. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +6 -0
  105. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +13 -12
  106. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -1
  107. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.d.ts +12 -5
  108. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js +21 -21
  109. package/dist/components/Employee/Dashboard/hooks/useEmployeeBasicDetails.js.map +1 -1
  110. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +13 -3
  111. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +53 -55
  112. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
  113. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.d.ts +10 -4
  114. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js +10 -12
  115. package/dist/components/Employee/Dashboard/hooks/useEmployeeForms.js.map +1 -1
  116. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.d.ts +10 -3
  117. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js +19 -14
  118. package/dist/components/Employee/Dashboard/hooks/useEmployeeTaxes.js.map +1 -1
  119. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js +8 -8
  120. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js +4 -4
  121. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +20 -4
  122. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  123. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/fields.js +1 -1
  124. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +37 -40
  125. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
  126. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +1 -2
  127. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +64 -71
  128. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
  129. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +2 -0
  130. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +25 -0
  131. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -0
  132. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +13 -0
  133. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js +37 -0
  134. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -0
  135. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +6 -0
  136. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +69 -0
  137. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -0
  138. package/dist/components/Employee/EmployeeListFlow/index.d.ts +3 -0
  139. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/fields.js +4 -4
  140. package/dist/components/Employee/HomeAddress/management/HomeAddress.js +15 -12
  141. package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
  142. package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +2 -1
  143. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +86 -83
  144. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
  145. package/dist/components/Employee/PaymentMethod/shared/useBankForm/fields.js +1 -1
  146. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/splitFieldFactory.js +4 -4
  147. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/fields.js +8 -8
  148. package/dist/components/Employee/Profile/shared/useHomeAddressForm/fields.js +5 -5
  149. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js +4 -4
  150. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldComponents.js +8 -8
  151. package/dist/components/Employee/Taxes/useTaxes.js +20 -4
  152. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  153. package/dist/components/Employee/WorkAddress/management/WorkAddress.js +14 -11
  154. package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
  155. package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +2 -1
  156. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +92 -89
  157. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
  158. package/dist/components/Employee/exports/employeeManagement.d.ts +2 -0
  159. package/dist/components/Employee/exports/employeeManagement.js +18 -16
  160. package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
  161. package/dist/components/Employee/index.d.ts +2 -0
  162. package/dist/components/Employee/index.js +32 -30
  163. package/dist/components/Employee/index.js.map +1 -1
  164. package/dist/components/Flow/FlowHeader.js +34 -31
  165. package/dist/components/Flow/FlowHeader.js.map +1 -1
  166. package/dist/components/Flow/useFlow.d.ts +12 -0
  167. package/dist/components/Flow/useFlow.js.map +1 -1
  168. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +34 -26
  169. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  170. package/dist/components/Payroll/usePreparedPayrollData.js +36 -22
  171. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  172. package/dist/components/TimeOff/PolicyList/PolicyList.js +92 -69
  173. package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
  174. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +23 -23
  175. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
  176. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js +52 -40
  177. package/dist/components/TimeOff/PolicySettings/PolicySettingsPresentation.js.map +1 -1
  178. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
  179. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  180. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +73 -56
  181. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
  182. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +58 -58
  183. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
  184. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
  185. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +91 -87
  186. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
  187. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
  188. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +91 -124
  189. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
  190. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
  191. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +72 -87
  192. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
  193. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +1 -6
  194. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +160 -220
  195. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
  196. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +7 -3
  197. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +77 -54
  198. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
  199. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.test.d.ts +1 -0
  200. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +12 -11
  201. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
  202. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +177 -147
  203. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
  204. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -1
  205. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +38 -36
  206. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
  207. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +2 -0
  208. package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +10 -10
  209. package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +17 -15
  210. package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -1
  211. package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +9 -9
  212. package/dist/i18n/en/Employee.Compensation.json.js +68 -56
  213. package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
  214. package/dist/i18n/en/Employee.Dashboard.json.js +26 -24
  215. package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
  216. package/dist/i18n/en/Employee.DocumentManager.json.js +1 -1
  217. package/dist/i18n/en/Employee.HomeAddress.Management.json.js +12 -10
  218. package/dist/i18n/en/Employee.HomeAddress.Management.json.js.map +1 -1
  219. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +32 -30
  220. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
  221. package/dist/i18n/en/Employee.WorkAddress.Management.json.js +16 -14
  222. package/dist/i18n/en/Employee.WorkAddress.Management.json.js.map +1 -1
  223. package/dist/i18n/en/common.json.d.ts +21 -0
  224. package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +33 -32
  225. package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
  226. package/dist/partner-hook-utils/types.d.ts +4 -0
  227. package/dist/shared/constants.d.ts +4 -0
  228. package/dist/shared/constants.js +20 -18
  229. package/dist/shared/constants.js.map +1 -1
  230. package/dist/style.css +1 -1
  231. package/dist/types/i18next.d.ts +45 -11
  232. package/docs/reference/endpoint-inventory.json +24 -8
  233. package/package.json +1 -1
@@ -1,127 +1,145 @@
1
- import { jsxs as l, jsx as n } from "react/jsx-runtime";
2
- import { useCallback as re, useState as N } from "react";
3
- import { useTranslation as k } from "react-i18next";
4
- import { useGustoEmbeddedContext as Ye } from "@gusto/embedded-api/react-query/_context";
5
- import { payrollsGetPayStub as Ve } from "@gusto/embedded-api/funcs/payrollsGetPayStub";
6
- import { useErrorBoundary as We } from "react-error-boundary";
7
- import { useJobsAndCompensationsDeleteMutation as Ge } from "@gusto/embedded-api/react-query/jobsAndCompensationsDelete";
8
- import { usePendingChangeDetailRenderer as Ie } from "./usePendingChangeDetailRenderer.js";
9
- import { PendingChangesReviewModal as qe } from "./PendingChangesReviewModal.js";
1
+ import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
+ import { useCallback as ue, useState as O } from "react";
3
+ import { useTranslation as E } from "react-i18next";
4
+ import { useGustoEmbeddedContext as on } from "@gusto/embedded-api/react-query/_context";
5
+ import { payrollsGetPayStub as an } from "@gusto/embedded-api/funcs/payrollsGetPayStub";
6
+ import { useErrorBoundary as rn } from "react-error-boundary";
7
+ import { useJobsAndCompensationsDeleteMutation as sn } from "@gusto/embedded-api/react-query/jobsAndCompensationsDelete";
8
+ import { usePendingChangeDetailRenderer as dn } from "./usePendingChangeDetailRenderer.js";
9
+ import { PendingChangesReviewModal as cn } from "./PendingChangesReviewModal.js";
10
+ import me from "./JobAndPayView.module.scss.js";
10
11
  import { Flex as c } from "../../Common/Flex/Flex.js";
11
- import { useComponentContext as Ke } from "../../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import { useComponentContext as ln } from "../../../contexts/ComponentAdapter/useComponentContext.js";
12
13
  import "classnames";
13
- import { componentEvents as h, FlsaStatus as Xe, PAYMENT_METHODS as $e } from "../../../shared/constants.js";
14
- import { EmptyData as J } from "../../Common/EmptyData/EmptyData.js";
15
- import { BaseLayout as se } from "../../Base/Base.js";
16
- import { composeErrorHandler as ze } from "../../../partner-hook-utils/composeErrorHandler.js";
17
- import { readableStreamToBlob as Qe } from "../../../helpers/readableStreamToBlob.js";
18
- import { formatDateLongWithYear as C } from "../../../helpers/dateFormatting.js";
19
- import { useFormatCompensationRate as Ze } from "../../../helpers/formattedStrings.js";
20
- import de from "../../../hooks/useNumberFormatter.js";
21
- import { useI18n as O } from "../../../i18n/I18n.js";
22
- import { useDeleteBankAccount as en } from "../PaymentMethod/shared/useDeleteBankAccount.js";
23
- import { DeleteBankAccountDialog as nn } from "../PaymentMethod/shared/DeleteBankAccountDialog.js";
24
- import { usePaymentMethodList as tn } from "../PaymentMethod/shared/usePaymentMethodList.js";
25
- import { useDeductionsList as on } from "../Deductions/shared/useDeductionsList.js";
26
- import { useDeleteDeduction as an } from "../Deductions/shared/useDeleteDeduction.js";
27
- import { DeleteDeductionDialog as rn } from "../Deductions/shared/DeleteDeductionDialog.js";
28
- import { formatDeductionAmount as sn } from "../Deductions/shared/formatDeductionAmount.js";
14
+ import { componentEvents as P, FlsaStatus as pe, PAYMENT_METHODS as un } from "../../../shared/constants.js";
15
+ import { Loading as v } from "../../Common/Loading/Loading.js";
16
+ import { EmptyData as R } from "../../Common/EmptyData/EmptyData.js";
17
+ import { BaseLayout as mn } from "../../Base/Base.js";
18
+ import { composeErrorHandler as pn } from "../../../partner-hook-utils/composeErrorHandler.js";
19
+ import { readableStreamToBlob as yn } from "../../../helpers/readableStreamToBlob.js";
20
+ import { formatDateToStringDate as bn, formatDateLongWithYear as j } from "../../../helpers/dateFormatting.js";
21
+ import { useFormatCompensationRate as gn } from "../../../helpers/formattedStrings.js";
22
+ import ye from "../../../hooks/useNumberFormatter.js";
23
+ import { useI18n as _ } from "../../../i18n/I18n.js";
24
+ import { useDeleteBankAccount as hn } from "../PaymentMethod/shared/useDeleteBankAccount.js";
25
+ import { DeleteBankAccountDialog as fn } from "../PaymentMethod/shared/DeleteBankAccountDialog.js";
26
+ import { usePaymentMethodList as Pn } from "../PaymentMethod/shared/usePaymentMethodList.js";
27
+ import { useDeductionsList as An } from "../Deductions/shared/useDeductionsList.js";
28
+ import { useDeleteDeduction as Cn } from "../Deductions/shared/useDeleteDeduction.js";
29
+ import { DeleteDeductionDialog as Dn } from "../Deductions/shared/DeleteDeductionDialog.js";
30
+ import { formatDeductionAmount as jn } from "../Deductions/shared/formatDeductionAmount.js";
29
31
  import x from "../../../assets/icons/plus-circle.svg.js";
30
- import dn from "../../../assets/icons/percent-circle.svg.js";
31
- import ln from "../../../assets/icons/download-cloud.svg.js";
32
- import _ from "../../../assets/icons/trashcan.svg.js";
33
- import le from "../../../assets/icons/pencil.svg.js";
34
- import { useEmployeeCompensation as cn } from "./hooks/useEmployeeCompensation.js";
35
- import { HamburgerMenu as R } from "../../Common/HamburgerMenu/HamburgerMenu.js";
36
- import { useDataView as w } from "../../Common/DataView/useDataView.js";
37
- import { DataView as v } from "../../Common/DataView/DataView.js";
38
- function ce(d) {
39
- if (d === void 0) return null;
40
- const u = parseFloat(d);
32
+ import Ln from "../../../assets/icons/percent-circle.svg.js";
33
+ import wn from "../../../assets/icons/download-cloud.svg.js";
34
+ import H from "../../../assets/icons/trashcan.svg.js";
35
+ import be from "../../../assets/icons/pencil.svg.js";
36
+ import { useEmployeeCompensation as En } from "./hooks/useEmployeeCompensation.js";
37
+ import { VisuallyHidden as vn } from "../../Common/VisuallyHidden/VisuallyHidden.js";
38
+ import { HamburgerMenu as F } from "../../Common/HamburgerMenu/HamburgerMenu.js";
39
+ import { useDataView as k } from "../../Common/DataView/useDataView.js";
40
+ import { DataView as T } from "../../Common/DataView/DataView.js";
41
+ function ge(s) {
42
+ if (s === void 0) return null;
43
+ const u = parseFloat(s);
41
44
  return Number.isFinite(u) ? u : null;
42
45
  }
43
- function Kn({
44
- employeeId: d,
46
+ function bt({
47
+ employeeId: s,
45
48
  onEvent: u,
46
- onEditCompensation: F,
47
- onAddJob: ue,
48
- onAddAnotherJob: me,
49
- onAddDeduction: pe,
50
- onEditDeduction: ye
49
+ onEditCompensation: V,
50
+ onAddJob: he,
51
+ onAddAnotherJob: fe,
52
+ onAddDeduction: Pe,
53
+ onEditDeduction: Ae
51
54
  }) {
52
- O("Employee.PaymentMethod"), O("Employee.Compensation"), O("Employee.Deductions");
53
- const { t } = k("Employee.Dashboard"), { t: P } = k("Employee.PaymentMethod"), { t: be } = k("Employee.Compensation"), { t: T } = k("Employee.Deductions"), o = Ke(), H = Ze(), B = de("currency"), ge = de("percent"), Y = Ye(), { showBoundary: V } = We(), a = cn({ employeeId: d }), D = a.isLoading ? [] : a.data.jobs, he = a.isLoading ? void 0 : a.data.primaryFlsaStatus, j = a.isLoading ? [] : a.data.pendingChanges, Pe = a.isLoading ? !1 : a.data.hasMultipleJobs, fe = a.isLoading ? [] : a.data.payStubs, Ae = a.isLoading ? void 0 : a.pagination.payStubs, W = a.isLoading ? null : a.status.cancellingCompensationUuid, S = a.isLoading ? void 0 : a.actions.cancelPendingChange, M = a.isLoading ? void 0 : a.data.employeeFirstName, G = re(
55
+ _("Employee.PaymentMethod"), _("Employee.Compensation"), _("Employee.Deductions");
56
+ const { t } = E("Employee.Dashboard"), { t: A } = E("Employee.PaymentMethod"), { t: Ce } = E("Employee.Compensation"), { t: S } = E("Employee.Deductions"), o = ln(), Y = gn(), B = ye("currency"), De = ye("percent"), W = on(), { showBoundary: I } = rn(), y = En({ employeeId: s }), {
57
+ jobs: C,
58
+ primaryFlsaStatus: je,
59
+ pendingChanges: G,
60
+ hasMultipleJobs: Le,
61
+ payStubs: we,
62
+ employeeFirstName: U
63
+ } = y.data, Ee = y.pagination.payStubs, q = y.status.cancellingCompensationUuid, { cancelPendingChange: K } = y.actions, N = y.status.isCompensationLoading, ve = y.status.isPayStubsLoading, X = ue(
54
64
  async (e) => {
55
- if (!S) return;
56
- await S(e) && u(h.EMPLOYEE_COMPENSATION_CHANGE_CANCELLED, {
57
- employeeId: d,
65
+ await K(e) && u(P.EMPLOYEE_COMPENSATION_CHANGE_CANCELLED, {
66
+ employeeId: s,
58
67
  compensationId: e.compensationUuid
59
68
  });
60
69
  },
61
- [S, u, d]
62
- ), [Ce, I] = N(
70
+ [K, u, s]
71
+ ), [xe, z] = O(
63
72
  () => /* @__PURE__ */ new Set()
64
- ), De = re(
73
+ ), ke = ue(
65
74
  async (e) => {
66
- const i = window.open("", "_blank", "noopener,noreferrer"), E = t("jobAndPay.paystubs.downloadLoadingMessage");
75
+ const i = window.open("", "_blank"), f = t("jobAndPay.paystubs.downloadLoadingMessage");
67
76
  if (i) {
68
77
  const r = i.document;
69
- r.title = E;
70
- const p = r.createElement("style");
71
- p.textContent = "body{font-family:system-ui,-apple-system,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;color:#444;gap:12px}.spinner{width:20px;height:20px;border:2px solid #ccc;border-top-color:#444;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}", r.head.appendChild(p);
78
+ r.title = f;
79
+ const m = r.createElement("style");
80
+ m.textContent = "body{font-family:system-ui,-apple-system,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;color:#444;gap:12px}.spinner{width:20px;height:20px;border:2px solid #ccc;border-top-color:#444;border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}", r.head.appendChild(m);
72
81
  const g = r.createElement("div");
73
82
  g.className = "spinner", g.setAttribute("aria-hidden", "true");
74
- const ae = r.createElement("span");
75
- ae.textContent = E, r.body.replaceChildren(g, ae);
83
+ const le = r.createElement("span");
84
+ le.textContent = f, r.body.replaceChildren(g, le);
76
85
  }
77
- I((r) => {
78
- const p = new Set(r);
79
- return p.add(e), p;
86
+ z((r) => {
87
+ const m = new Set(r);
88
+ return m.add(e), m;
80
89
  });
81
90
  try {
82
- const r = await Ve(Y, {
91
+ const r = await an(W, {
83
92
  payrollId: e,
84
- employeeId: d
93
+ employeeId: s
85
94
  });
86
95
  if (!r.value?.responseStream)
87
96
  throw new Error(t("jobAndPay.paystubs.downloadError"));
88
- const p = await Qe(r.value.responseStream, "application/pdf"), g = URL.createObjectURL(p);
89
- i && (i.location.href = g), URL.revokeObjectURL(g);
97
+ const m = await yn(r.value.responseStream, "application/pdf"), g = URL.createObjectURL(m);
98
+ i ? (i.addEventListener("load", () => {
99
+ URL.revokeObjectURL(g);
100
+ }), i.location.href = g) : URL.revokeObjectURL(g);
90
101
  } catch (r) {
91
- i && i.close(), V(r instanceof Error ? r : new Error(String(r)));
102
+ i && i.close(), I(r instanceof Error ? r : new Error(String(r)));
92
103
  } finally {
93
- I((r) => {
94
- const p = new Set(r);
95
- return p.delete(e), p;
104
+ z((r) => {
105
+ const m = new Set(r);
106
+ return m.delete(e), m;
96
107
  });
97
108
  }
98
109
  },
99
- [Y, d, t, V]
100
- ), [f, U] = N(null), { mutateAsync: je, isPending: q } = Ge(), Le = async () => {
101
- if (!f) return;
102
- const e = f.uuid;
103
- await je({ request: { jobId: e } }), u(h.EMPLOYEE_JOB_DELETED, { employeeId: d, jobId: e }), U(null);
104
- }, s = D.length === 1 ? D[0] : void 0, A = Pe, Ee = D.length >= 1 && he === Xe.NONEXEMPT, K = s ? ce(s.rate) : null, [ke, X] = N(!1), xe = Ie(M), we = j.length > 0, $ = A && j.length > 1, ve = we && !$, b = j[0], m = tn({ employeeId: d }), z = m.isLoading ? void 0 : m.data.paymentMethod, L = m.isLoading ? [] : m.data.bankAccounts, Te = m.isLoading ? void 0 : m.status.deletePendingBankAccountUuid, { pendingDeleteAccount: Q, setPendingDeleteAccount: Z, handleConfirmDelete: Be } = en(async (e) => {
105
- if (m.isLoading) return;
106
- const i = await m.actions.onDelete(e);
107
- i && u(h.EMPLOYEE_BANK_ACCOUNT_DELETED, i.data);
108
- }), y = on({ employeeId: d }), Se = y.isLoading ? [] : y.data.deductions, ee = y.isLoading ? void 0 : y.status.deletingGarnishmentUuid, {
109
- pendingDeleteDeduction: ne,
110
- setPendingDeleteDeduction: te,
111
- handleConfirmDelete: Me
112
- } = an(async (e) => {
113
- if (y.isLoading) return;
114
- const i = await y.actions.onDelete(e);
115
- i && u(h.EMPLOYEE_DEDUCTION_DELETED, i.data.garnishment);
116
- }), oe = ze([a, m, y]), Ue = [
110
+ [W, s, t, I]
111
+ ), [D, J] = O(null), { mutateAsync: Te, isPending: $ } = sn(), Se = async () => {
112
+ if (!D) return;
113
+ const e = D.uuid;
114
+ await Te({ request: { jobId: e } }), u(P.EMPLOYEE_JOB_DELETED, { employeeId: s, jobId: e }), J(null);
115
+ }, a = C.length === 1 ? C[0] : void 0, h = Le, Be = bn(/* @__PURE__ */ new Date()) ?? "", Ue = C.find((e) => e.primary)?.compensations?.some(
116
+ (e) => e.effectiveDate !== void 0 && e.effectiveDate > Be && e.flsaStatus !== pe.NONEXEMPT
117
+ ) ?? !1, Ne = C.length >= 1 && je === pe.NONEXEMPT && !Ue, Q = a ? ge(a.rate) : null, Z = a?.compensations?.find(
118
+ (e) => e.uuid === a.currentCompensationUuid
119
+ ), Je = Z?.effectiveDate ? /* @__PURE__ */ d(c, { flexDirection: "column", gap: 0, children: [
120
+ /* @__PURE__ */ n(o.Text, { variant: "supporting", children: t("jobAndPay.compensation.effectiveDate") }),
121
+ /* @__PURE__ */ n(o.Text, { children: j(Z.effectiveDate) })
122
+ ] }) : null, [Me, ee] = O(!1), Oe = dn(U), Re = G.filter((e) => e.isNewJob), L = G.filter((e) => !e.isNewJob), M = new Set(Re.map((e) => e.jobUuid)), _e = a ? M.has(a.uuid) : !1, He = M.size > 0, ne = L.length > 0, te = h && L.length > 1, Fe = ne && !te, b = L[0], l = Pn({ employeeId: s }), oe = l.isLoading ? void 0 : l.data.paymentMethod, w = l.isLoading ? [] : l.data.bankAccounts, Ve = l.isLoading ? void 0 : l.status.deletePendingBankAccountUuid, { pendingDeleteAccount: ie, setPendingDeleteAccount: ae, handleConfirmDelete: Ye } = hn(async (e) => {
123
+ if (l.isLoading) return;
124
+ const i = await l.actions.onDelete(e);
125
+ i && u(P.EMPLOYEE_BANK_ACCOUNT_DELETED, i.data);
126
+ }), p = An({ employeeId: s }), We = p.isLoading ? [] : p.data.deductions, re = p.isLoading ? void 0 : p.status.deletingGarnishmentUuid, {
127
+ pendingDeleteDeduction: se,
128
+ setPendingDeleteDeduction: de,
129
+ handleConfirmDelete: Ie
130
+ } = Cn(async (e) => {
131
+ if (p.isLoading) return;
132
+ const i = await p.actions.onDelete(e);
133
+ i && u(P.EMPLOYEE_DEDUCTION_DELETED, i.data.garnishment);
134
+ }), Ge = pn([y, l, p]), qe = [
117
135
  {
118
136
  key: "jobTitle",
119
137
  title: t("jobAndPay.compensation.columns.jobTitle"),
120
138
  render: (e) => {
121
- const i = ce(e.rate);
122
- return /* @__PURE__ */ l(c, { flexDirection: "column", gap: 0, children: [
139
+ const i = ge(e.rate);
140
+ return /* @__PURE__ */ d(c, { flexDirection: "column", gap: 0, children: [
123
141
  /* @__PURE__ */ n(o.Text, { children: e.title || "-" }),
124
- i !== null && e.paymentUnit ? /* @__PURE__ */ n(o.Text, { variant: "supporting", children: H(i, e.paymentUnit) }) : null
142
+ i !== null && e.paymentUnit ? /* @__PURE__ */ n(o.Text, { variant: "supporting", children: Y(i, e.paymentUnit) }) : null
125
143
  ] });
126
144
  }
127
145
  },
@@ -130,45 +148,55 @@ function Kn({
130
148
  title: t("jobAndPay.compensation.columns.payType"),
131
149
  render: (e) => {
132
150
  const i = e.compensations?.find(
133
- (E) => E.uuid === e.currentCompensationUuid
151
+ (f) => f.uuid === e.currentCompensationUuid
134
152
  )?.flsaStatus;
135
- return i !== void 0 ? be(`flsaStatusLabels.${i}`) : "-";
153
+ return i !== void 0 ? Ce(`flsaStatusLabels.${i}`) : "-";
136
154
  }
137
155
  },
138
156
  {
139
- key: "startDate",
140
- title: t("jobAndPay.compensation.columns.startDate"),
141
- render: (e) => e.hireDate ? C(e.hireDate) : "-"
142
- }
143
- ], Ne = w({
144
- data: D,
145
- columns: Ue,
157
+ key: "effectiveDate",
158
+ title: t("jobAndPay.compensation.columns.effectiveDate"),
159
+ render: (e) => {
160
+ const i = e.compensations?.find((f) => f.uuid === e.currentCompensationUuid);
161
+ return i?.effectiveDate ? j(i.effectiveDate) : "-";
162
+ }
163
+ },
164
+ ...He ? [
165
+ {
166
+ key: "status",
167
+ title: /* @__PURE__ */ n(vn, { children: t("jobAndPay.compensation.columns.status") }),
168
+ render: (e) => M.has(e.uuid) ? /* @__PURE__ */ n(o.Badge, { status: "warning", children: t("jobAndPay.compensation.pendingStatus") }) : null
169
+ }
170
+ ] : []
171
+ ], Ke = k({
172
+ data: C,
173
+ columns: qe,
146
174
  itemMenu: (e) => /* @__PURE__ */ n(
147
- R,
175
+ F,
148
176
  {
149
177
  triggerLabel: t("jobAndPay.compensation.hamburgerTitle"),
150
- isLoading: q,
178
+ isLoading: $,
151
179
  items: [
152
180
  {
153
181
  label: t("jobAndPay.compensation.editJobCta"),
154
- icon: /* @__PURE__ */ n(le, { "aria-hidden": !0 }),
182
+ icon: /* @__PURE__ */ n(be, { "aria-hidden": !0 }),
155
183
  onClick: () => {
156
- F?.(e);
184
+ V?.(e);
157
185
  }
158
186
  },
159
187
  ...e.primary ? [] : [
160
188
  {
161
189
  label: t("jobAndPay.compensation.deleteJobCta"),
162
- icon: /* @__PURE__ */ n(_, { "aria-hidden": !0 }),
190
+ icon: /* @__PURE__ */ n(H, { "aria-hidden": !0 }),
163
191
  onClick: () => {
164
- U({ uuid: e.uuid, title: e.title ?? "" });
192
+ J({ uuid: e.uuid, title: e.title ?? "" });
165
193
  }
166
194
  }
167
195
  ]
168
196
  ]
169
197
  }
170
198
  )
171
- }), Je = [
199
+ }), Xe = [
172
200
  {
173
201
  key: "nickname",
174
202
  title: t("jobAndPay.payment.nickname"),
@@ -184,7 +212,7 @@ function Kn({
184
212
  title: t("jobAndPay.payment.accountType"),
185
213
  render: (e) => e.accountType || "-"
186
214
  }
187
- ], Oe = [
215
+ ], ze = [
188
216
  {
189
217
  key: "description",
190
218
  title: t("jobAndPay.deductions.deduction"),
@@ -198,17 +226,17 @@ function Kn({
198
226
  {
199
227
  key: "amount",
200
228
  title: t("jobAndPay.deductions.withhold"),
201
- render: (e) => sn(e, {
229
+ render: (e) => jn(e, {
202
230
  formatCurrency: B,
203
- formatPercent: ge,
231
+ formatPercent: De,
204
232
  formatPerPaycheck: (i) => t("jobAndPay.deductions.amountPerPaycheck", { value: i })
205
233
  })
206
234
  }
207
- ], _e = [
235
+ ], $e = [
208
236
  {
209
237
  key: "payday",
210
238
  title: t("jobAndPay.paystubs.payday"),
211
- render: (e) => C(e.checkDate) || "-"
239
+ render: (e) => j(e.checkDate) || "-"
212
240
  },
213
241
  {
214
242
  key: "checkAmount",
@@ -231,66 +259,66 @@ function Kn({
231
259
  {
232
260
  key: "paymentMethod",
233
261
  title: t("jobAndPay.paystubs.paymentMethod"),
234
- render: () => z?.type || t("jobAndPay.paystubs.noPaymentMethod")
262
+ render: () => oe?.type || t("jobAndPay.paystubs.noPaymentMethod")
235
263
  }
236
- ], Re = w({
237
- data: L,
238
- columns: Je,
264
+ ], Qe = k({
265
+ data: w,
266
+ columns: Xe,
239
267
  itemMenu: (e) => /* @__PURE__ */ n(
240
- R,
268
+ F,
241
269
  {
242
270
  items: [
243
271
  {
244
- label: P("deleteBankAccountCta"),
272
+ label: A("deleteBankAccountCta"),
245
273
  onClick: () => {
246
- Z({
274
+ ae({
247
275
  uuid: e.uuid,
248
276
  hiddenAccountNumber: e.hiddenAccountNumber
249
277
  });
250
278
  },
251
- icon: /* @__PURE__ */ n(_, { "aria-hidden": !0 })
279
+ icon: /* @__PURE__ */ n(H, { "aria-hidden": !0 })
252
280
  }
253
281
  ],
254
- triggerLabel: P("hamburgerTitle")
282
+ triggerLabel: A("hamburgerTitle")
255
283
  }
256
284
  )
257
- }), Fe = w({
258
- data: Se,
259
- columns: Oe,
285
+ }), Ze = k({
286
+ data: We,
287
+ columns: ze,
260
288
  itemMenu: (e) => /* @__PURE__ */ n(
261
- R,
289
+ F,
262
290
  {
263
- isLoading: ee === e.uuid,
291
+ isLoading: re === e.uuid,
264
292
  items: [
265
293
  {
266
- label: T("editCta"),
267
- onClick: () => ye?.(e),
268
- icon: /* @__PURE__ */ n(le, { "aria-hidden": !0 })
294
+ label: S("editCta"),
295
+ onClick: () => Ae?.(e),
296
+ icon: /* @__PURE__ */ n(be, { "aria-hidden": !0 })
269
297
  },
270
298
  {
271
- label: T("deleteCta"),
299
+ label: S("deleteCta"),
272
300
  onClick: () => {
273
- te(e);
301
+ de(e);
274
302
  },
275
- icon: /* @__PURE__ */ n(_, { "aria-hidden": !0 })
303
+ icon: /* @__PURE__ */ n(H, { "aria-hidden": !0 })
276
304
  }
277
305
  ],
278
- triggerLabel: T("hamburgerTitle")
306
+ triggerLabel: S("hamburgerTitle")
279
307
  }
280
308
  ),
281
309
  emptyState: () => /* @__PURE__ */ n(
282
- J,
310
+ R,
283
311
  {
284
312
  title: t("jobAndPay.deductions.emptyState.title"),
285
313
  description: t("jobAndPay.deductions.emptyState.description")
286
314
  }
287
315
  )
288
- }), He = w({
289
- data: fe,
290
- columns: _e,
291
- pagination: Ae,
316
+ }), en = k({
317
+ data: we,
318
+ columns: $e,
319
+ pagination: Ee,
292
320
  itemMenu: (e) => {
293
- const i = !!e.payrollUuid && Ce.has(e.payrollUuid);
321
+ const i = !!e.payrollUuid && xe.has(e.payrollUuid);
294
322
  return /* @__PURE__ */ n(
295
323
  o.ButtonIcon,
296
324
  {
@@ -299,140 +327,152 @@ function Kn({
299
327
  isDisabled: !e.payrollUuid,
300
328
  isLoading: i,
301
329
  onClick: () => {
302
- e.payrollUuid && De(e.payrollUuid);
330
+ e.payrollUuid && ke(e.payrollUuid);
303
331
  },
304
- children: /* @__PURE__ */ n(ln, { "aria-hidden": !0 })
332
+ children: /* @__PURE__ */ n(wn, { "aria-hidden": !0 })
305
333
  }
306
334
  );
307
335
  },
308
336
  emptyState: () => /* @__PURE__ */ n(
309
- J,
337
+ R,
310
338
  {
311
339
  title: t("jobAndPay.paystubs.emptyState.title"),
312
340
  description: t("jobAndPay.paystubs.emptyState.description")
313
341
  }
314
342
  )
315
- });
316
- if (a.isLoading || m.isLoading || y.isLoading)
317
- return /* @__PURE__ */ n(se, { isLoading: !0, error: oe.errors });
318
- const ie = z?.type === $e.directDeposit;
319
- return /* @__PURE__ */ n(se, { error: oe.errors, children: /* @__PURE__ */ l(c, { flexDirection: "column", gap: 24, children: [
343
+ }), nn = l.isLoading && l.errorHandling.errors.length === 0, tn = p.isLoading && p.errorHandling.errors.length === 0, ce = oe?.type === un.directDeposit;
344
+ return /* @__PURE__ */ n(mn, { error: Ge.errors, children: /* @__PURE__ */ d(c, { flexDirection: "column", gap: 24, children: [
320
345
  /* @__PURE__ */ n(
321
346
  o.Box,
322
347
  {
323
- withPadding: !A,
348
+ withPadding: !h,
324
349
  header: /* @__PURE__ */ n(
325
350
  o.BoxHeader,
326
351
  {
327
352
  title: t("jobAndPay.compensation.title"),
328
- action: A ? null : s ? /* @__PURE__ */ n(
329
- o.Button,
330
- {
331
- variant: "secondary",
332
- onClick: () => {
333
- F?.(s);
334
- },
335
- children: t("jobAndPay.compensation.editCta")
336
- }
337
- ) : /* @__PURE__ */ n(
338
- o.Button,
339
- {
340
- variant: "secondary",
341
- onClick: ue,
342
- icon: /* @__PURE__ */ n(x, {}),
343
- children: t("jobAndPay.compensation.addJobCta")
344
- }
353
+ action: (
354
+ // While the compensation card is loading we don't yet
355
+ // know if the employee has jobs — suppress the action
356
+ // so we don't surface an "Add job" CTA against an
357
+ // employee who already has one.
358
+ N || h ? null : a ? /* @__PURE__ */ n(
359
+ o.Button,
360
+ {
361
+ variant: "secondary",
362
+ onClick: () => {
363
+ V?.(a);
364
+ },
365
+ children: t("jobAndPay.compensation.editCta")
366
+ }
367
+ ) : /* @__PURE__ */ n(
368
+ o.Button,
369
+ {
370
+ variant: "secondary",
371
+ onClick: he,
372
+ icon: /* @__PURE__ */ n(x, {}),
373
+ children: t("jobAndPay.compensation.addJobCta")
374
+ }
375
+ )
345
376
  )
346
377
  }
347
378
  ),
348
- footer: Ee ? /* @__PURE__ */ n(
379
+ footer: !N && Ne ? /* @__PURE__ */ n(
349
380
  o.Button,
350
381
  {
351
382
  variant: "secondary",
352
- onClick: me,
383
+ onClick: fe,
353
384
  icon: /* @__PURE__ */ n(x, {}),
354
385
  children: t("jobAndPay.compensation.addAnotherJobCta")
355
386
  }
356
387
  ) : void 0,
357
- children: /* @__PURE__ */ l(c, { flexDirection: "column", gap: 16, children: [
358
- ve && b && /* @__PURE__ */ n(
359
- o.Alert,
388
+ children: N ? /* @__PURE__ */ n(v, {}) : /* @__PURE__ */ d(c, { flexDirection: "column", gap: 16, children: [
389
+ ne && /* @__PURE__ */ n(
390
+ "div",
360
391
  {
361
- status: "warning",
362
- disableScrollIntoView: !0,
363
- label: A ? t("jobAndPay.compensation.pendingChange.alertLabelWithJob", {
364
- jobTitle: b.jobTitle,
365
- date: C(b.effectiveDate)
366
- }) : t("jobAndPay.compensation.pendingChange.alertLabel", {
367
- date: C(b.effectiveDate)
368
- }),
369
- children: /* @__PURE__ */ l(c, { flexDirection: "column", gap: 12, children: [
370
- /* @__PURE__ */ n(
371
- o.UnorderedList,
392
+ className: [me.alertWrapper, h && me.alertWrapperPadded].filter(Boolean).join(" "),
393
+ children: /* @__PURE__ */ d(c, { flexDirection: "column", gap: 16, children: [
394
+ Fe && b && /* @__PURE__ */ n(
395
+ o.Alert,
372
396
  {
373
- items: b.details.map((e) => xe(e))
397
+ status: "warning",
398
+ disableScrollIntoView: !0,
399
+ label: h ? t("jobAndPay.compensation.pendingChange.alertLabelWithJob", {
400
+ jobTitle: b.jobTitle,
401
+ date: j(b.effectiveDate)
402
+ }) : t("jobAndPay.compensation.pendingChange.alertLabel", {
403
+ date: j(b.effectiveDate)
404
+ }),
405
+ children: /* @__PURE__ */ d(c, { flexDirection: "column", gap: 12, children: [
406
+ /* @__PURE__ */ n(
407
+ o.UnorderedList,
408
+ {
409
+ items: b.details.map((e) => Oe(e))
410
+ }
411
+ ),
412
+ /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
413
+ o.Button,
414
+ {
415
+ variant: "secondary",
416
+ isLoading: q === b.compensationUuid,
417
+ onClick: () => {
418
+ X(b);
419
+ },
420
+ children: t("jobAndPay.compensation.pendingChange.cancelCta")
421
+ }
422
+ ) })
423
+ ] })
374
424
  }
375
425
  ),
376
- /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(
377
- o.Button,
426
+ te && /* @__PURE__ */ n(
427
+ o.Alert,
378
428
  {
379
- variant: "secondary",
380
- isLoading: W === b.compensationUuid,
381
- onClick: () => {
382
- G(b);
383
- },
384
- children: t("jobAndPay.compensation.pendingChange.cancelCta")
429
+ status: "warning",
430
+ disableScrollIntoView: !0,
431
+ label: t("jobAndPay.compensation.pendingChange.summaryLabel", {
432
+ name: U ?? ""
433
+ }),
434
+ action: /* @__PURE__ */ n(
435
+ o.Button,
436
+ {
437
+ variant: "secondary",
438
+ onClick: () => {
439
+ ee(!0);
440
+ },
441
+ children: t("jobAndPay.compensation.pendingChange.reviewCta")
442
+ }
443
+ )
385
444
  }
386
- ) })
445
+ )
387
446
  ] })
388
447
  }
389
448
  ),
390
- $ && /* @__PURE__ */ n(
391
- o.Alert,
392
- {
393
- status: "warning",
394
- disableScrollIntoView: !0,
395
- label: t("jobAndPay.compensation.pendingChange.summaryLabel", {
396
- name: M ?? ""
397
- }),
398
- action: /* @__PURE__ */ n(
399
- o.Button,
400
- {
401
- variant: "secondary",
402
- onClick: () => {
403
- X(!0);
404
- },
405
- children: t("jobAndPay.compensation.pendingChange.reviewCta")
406
- }
407
- )
408
- }
409
- ),
410
- A ? /* @__PURE__ */ n(
411
- v,
449
+ h ? /* @__PURE__ */ n(
450
+ T,
412
451
  {
413
452
  label: t("jobAndPay.compensation.tableLabel"),
414
453
  isWithinBox: !0,
415
- ...Ne
454
+ ...Ke
416
455
  }
417
- ) : s ? /* @__PURE__ */ l(c, { flexDirection: "column", gap: 12, children: [
418
- s.title && /* @__PURE__ */ l(c, { flexDirection: "column", gap: 0, children: [
456
+ ) : a ? /* @__PURE__ */ d(c, { flexDirection: "column", gap: 12, children: [
457
+ a.title && /* @__PURE__ */ d(c, { flexDirection: "column", gap: 0, children: [
419
458
  /* @__PURE__ */ n(o.Text, { variant: "supporting", children: t("jobAndPay.compensation.jobTitle") }),
420
- /* @__PURE__ */ n(o.Text, { children: s.title })
459
+ /* @__PURE__ */ n(o.Text, { children: a.title })
421
460
  ] }),
422
- s.paymentUnit && /* @__PURE__ */ l(c, { flexDirection: "column", gap: 0, children: [
461
+ a.paymentUnit && /* @__PURE__ */ d(c, { flexDirection: "column", gap: 0, children: [
423
462
  /* @__PURE__ */ n(o.Text, { variant: "supporting", children: t("jobAndPay.compensation.type") }),
424
- /* @__PURE__ */ n(o.Text, { children: s.paymentUnit === "Hour" ? t("jobAndPay.compensation.types.hourly") : s.paymentUnit === "Salary" || s.paymentUnit === "Year" ? t("jobAndPay.compensation.types.salary") : s.paymentUnit })
463
+ /* @__PURE__ */ n(o.Text, { children: a.paymentUnit === "Hour" ? t("jobAndPay.compensation.types.hourly") : a.paymentUnit === "Salary" || a.paymentUnit === "Year" ? t("jobAndPay.compensation.types.salary") : a.paymentUnit })
425
464
  ] }),
426
- K !== null && s.paymentUnit && /* @__PURE__ */ l(c, { flexDirection: "column", gap: 0, children: [
465
+ Q !== null && a.paymentUnit && /* @__PURE__ */ d(c, { flexDirection: "column", gap: 0, children: [
427
466
  /* @__PURE__ */ n(o.Text, { variant: "supporting", children: t("jobAndPay.compensation.wage") }),
428
- /* @__PURE__ */ n(o.Text, { children: H(K, s.paymentUnit) })
467
+ /* @__PURE__ */ n(o.Text, { children: Y(Q, a.paymentUnit) })
429
468
  ] }),
430
- s.hireDate && /* @__PURE__ */ l(c, { flexDirection: "column", gap: 0, children: [
431
- /* @__PURE__ */ n(o.Text, { variant: "supporting", children: t("jobAndPay.compensation.startDate") }),
432
- /* @__PURE__ */ n(o.Text, { children: C(s.hireDate) })
469
+ Je,
470
+ _e && /* @__PURE__ */ d(c, { flexDirection: "column", gap: 0, children: [
471
+ /* @__PURE__ */ n(o.Text, { variant: "supporting", children: t("jobAndPay.compensation.columns.status") }),
472
+ /* @__PURE__ */ n("div", { children: /* @__PURE__ */ n(o.Badge, { status: "warning", children: t("jobAndPay.compensation.pendingStatus") }) })
433
473
  ] })
434
474
  ] }) : /* @__PURE__ */ n(
435
- J,
475
+ R,
436
476
  {
437
477
  title: t("jobAndPay.compensation.emptyState.title"),
438
478
  description: t("jobAndPay.compensation.emptyState.description")
@@ -444,20 +484,20 @@ function Kn({
444
484
  /* @__PURE__ */ n(
445
485
  o.Box,
446
486
  {
447
- withPadding: L.length === 0,
487
+ withPadding: w.length === 0,
448
488
  header: /* @__PURE__ */ n(
449
489
  o.BoxHeader,
450
490
  {
451
491
  title: t("jobAndPay.payment.title"),
452
- action: /* @__PURE__ */ l(c, { gap: 8, alignItems: "center", justifyContent: "flex-end", children: [
453
- ie && L.length > 1 && /* @__PURE__ */ n(
492
+ action: /* @__PURE__ */ d(c, { gap: 8, alignItems: "center", justifyContent: "flex-end", children: [
493
+ ce && w.length > 1 && /* @__PURE__ */ n(
454
494
  o.Button,
455
495
  {
456
496
  variant: "secondary",
457
497
  onClick: () => {
458
- u(h.EMPLOYEE_SPLIT_PAYCHECK, { employeeId: d });
498
+ u(P.EMPLOYEE_SPLIT_PAYCHECK, { employeeId: s });
459
499
  },
460
- icon: /* @__PURE__ */ n(dn, {}),
500
+ icon: /* @__PURE__ */ n(Ln, {}),
461
501
  children: t("jobAndPay.payment.splitPaycheckCta")
462
502
  }
463
503
  ),
@@ -466,7 +506,7 @@ function Kn({
466
506
  {
467
507
  variant: "secondary",
468
508
  onClick: () => {
469
- u(h.EMPLOYEE_BANK_ACCOUNT_CREATE, { employeeId: d });
509
+ u(P.EMPLOYEE_BANK_ACCOUNT_CREATE, { employeeId: s });
470
510
  },
471
511
  icon: /* @__PURE__ */ n(x, {}),
472
512
  children: t("jobAndPay.payment.addBankAccountCta")
@@ -475,15 +515,15 @@ function Kn({
475
515
  ] })
476
516
  }
477
517
  ),
478
- children: L.length === 0 ? /* @__PURE__ */ l(c, { flexDirection: "column", gap: 0, children: [
479
- /* @__PURE__ */ n(o.Text, { variant: "supporting", children: P("paymentMethodLabel") }),
480
- /* @__PURE__ */ n(o.Text, { children: P(ie ? "directDepositLabel" : "checkLabel") })
518
+ children: nn ? /* @__PURE__ */ n(v, {}) : w.length === 0 ? /* @__PURE__ */ d(c, { flexDirection: "column", gap: 0, children: [
519
+ /* @__PURE__ */ n(o.Text, { variant: "supporting", children: A("paymentMethodLabel") }),
520
+ /* @__PURE__ */ n(o.Text, { children: A(ce ? "directDepositLabel" : "checkLabel") })
481
521
  ] }) : /* @__PURE__ */ n(
482
- v,
522
+ T,
483
523
  {
484
524
  label: t("jobAndPay.payment.listLabel"),
485
525
  isWithinBox: !0,
486
- ...Re
526
+ ...Qe
487
527
  }
488
528
  )
489
529
  }
@@ -500,19 +540,19 @@ function Kn({
500
540
  o.Button,
501
541
  {
502
542
  variant: "secondary",
503
- onClick: pe,
543
+ onClick: Pe,
504
544
  icon: /* @__PURE__ */ n(x, {}),
505
545
  children: t("jobAndPay.deductions.addDeductionCta")
506
546
  }
507
547
  )
508
548
  }
509
549
  ),
510
- children: /* @__PURE__ */ n(
511
- v,
550
+ children: tn ? /* @__PURE__ */ n(v, {}) : /* @__PURE__ */ n(
551
+ T,
512
552
  {
513
553
  label: t("jobAndPay.deductions.listLabel"),
514
554
  isWithinBox: !0,
515
- ...Fe
555
+ ...Ze
516
556
  }
517
557
  )
518
558
  }
@@ -522,73 +562,73 @@ function Kn({
522
562
  {
523
563
  withPadding: !1,
524
564
  header: /* @__PURE__ */ n(o.BoxHeader, { title: t("jobAndPay.paystubs.title") }),
525
- children: /* @__PURE__ */ n(v, { label: t("jobAndPay.paystubs.listLabel"), isWithinBox: !0, ...He })
565
+ children: ve ? /* @__PURE__ */ n(v, {}) : /* @__PURE__ */ n(T, { label: t("jobAndPay.paystubs.listLabel"), isWithinBox: !0, ...en })
526
566
  }
527
567
  ),
528
568
  /* @__PURE__ */ n(
529
- qe,
569
+ cn,
530
570
  {
531
- isOpen: ke,
532
- pendingChanges: j,
533
- employeeFirstName: M,
534
- cancellingCompensationUuid: W,
571
+ isOpen: Me,
572
+ pendingChanges: L,
573
+ employeeFirstName: U,
574
+ cancellingCompensationUuid: q,
535
575
  onClose: () => {
536
- X(!1);
576
+ ee(!1);
537
577
  },
538
578
  onCancelChange: (e) => {
539
- G(e);
579
+ X(e);
540
580
  }
541
581
  }
542
582
  ),
543
583
  /* @__PURE__ */ n(
544
- nn,
584
+ fn,
545
585
  {
546
- pendingDeleteAccount: Q,
547
- isPrimaryActionLoading: Te === Q?.uuid,
586
+ pendingDeleteAccount: ie,
587
+ isPrimaryActionLoading: Ve === ie?.uuid,
548
588
  onClose: () => {
549
- Z(null);
589
+ ae(null);
550
590
  },
551
591
  onConfirm: () => {
552
- Be();
592
+ Ye();
553
593
  }
554
594
  }
555
595
  ),
556
596
  /* @__PURE__ */ n(
557
- rn,
597
+ Dn,
558
598
  {
559
- pendingDeleteDeduction: ne,
560
- isPrimaryActionLoading: ee === ne?.uuid,
599
+ pendingDeleteDeduction: se,
600
+ isPrimaryActionLoading: re === se?.uuid,
561
601
  onClose: () => {
562
- te(null);
602
+ de(null);
563
603
  },
564
604
  onConfirm: () => {
565
- Me();
605
+ Ie();
566
606
  }
567
607
  }
568
608
  ),
569
609
  /* @__PURE__ */ n(
570
610
  o.Dialog,
571
611
  {
572
- isOpen: f !== null,
612
+ isOpen: D !== null,
573
613
  onClose: () => {
574
- U(null);
614
+ J(null);
575
615
  },
576
616
  onPrimaryActionClick: () => {
577
- Le();
617
+ Se();
578
618
  },
579
- isPrimaryActionLoading: q,
619
+ isPrimaryActionLoading: $,
580
620
  isDestructive: !0,
581
621
  title: t("jobAndPay.compensation.deleteJobDialog.title"),
582
622
  primaryActionLabel: t("jobAndPay.compensation.deleteJobDialog.confirmCta"),
583
623
  closeActionLabel: t("jobAndPay.compensation.deleteJobDialog.cancelCta"),
584
- children: f ? t("jobAndPay.compensation.deleteJobDialog.description", {
585
- jobTitle: f.title
624
+ children: D ? t("jobAndPay.compensation.deleteJobDialog.description", {
625
+ jobTitle: D.title
586
626
  }) : null
587
627
  }
588
628
  )
589
629
  ] }) });
590
630
  }
591
631
  export {
592
- Kn as JobAndPayView
632
+ bt as JobAndPayView
593
633
  };
594
634
  //# sourceMappingURL=JobAndPayView.js.map