@gusto/embedded-react-sdk 0.8.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. package/CHANGELOG.md +91 -2
  2. package/dist/components/Common/DataView/DataCards/DataCards.js +21 -21
  3. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  4. package/dist/components/Common/OnboardingStatusBadge/index.d.ts +21 -0
  5. package/dist/components/Common/OnboardingStatusBadge/index.js +17 -0
  6. package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -0
  7. package/dist/components/Common/SignatureForm/SignatureFormActions.js +8 -7
  8. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  9. package/dist/components/Common/SignatureForm/SignatureFormFields.js +5 -4
  10. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  11. package/dist/components/Common/TaxInputs/TaxInputs.js +42 -36
  12. package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
  13. package/dist/components/Common/UI/ComboBox/ComboBox.js +28 -27
  14. package/dist/components/Common/UI/ComboBox/ComboBox.js.map +1 -1
  15. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +6 -6
  16. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +7 -6
  17. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +9 -8
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -3
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  22. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +7 -6
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  24. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -3
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  26. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -5
  27. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  28. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +3 -2
  29. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  30. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -3
  31. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  32. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +7 -6
  33. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  34. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +8 -7
  35. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  36. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +6 -5
  37. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  38. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  39. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  40. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  41. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  42. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  43. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  44. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +13 -11
  45. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  46. package/dist/components/Company/Industry/Actions.js +6 -5
  47. package/dist/components/Company/Industry/Actions.js.map +1 -1
  48. package/dist/components/Company/Industry/Context.js +8 -6
  49. package/dist/components/Company/Industry/Context.js.map +1 -1
  50. package/dist/components/Company/Industry/Edit.js +11 -10
  51. package/dist/components/Company/Industry/Edit.js.map +1 -1
  52. package/dist/components/Company/Locations/LocationForm/Actions.js +3 -2
  53. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  54. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -3
  55. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  56. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  57. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  58. package/dist/components/Company/Locations/LocationsList/List.js +7 -6
  59. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  60. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -3
  61. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  62. package/dist/components/Company/OnboardingOverview/context.js +5 -3
  63. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  64. package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -10
  65. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  66. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -5
  67. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  68. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +10 -9
  69. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  70. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js +1 -1
  71. package/dist/components/Company/StateTaxes/StateTaxesForm/Form.js.map +1 -1
  72. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +29 -29
  73. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  74. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -3
  75. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  76. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +7 -6
  77. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  78. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +6 -5
  79. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  80. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -3
  81. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  82. package/dist/components/Contractor/Address/Actions.d.ts +1 -0
  83. package/dist/components/Contractor/Address/Actions.js +13 -0
  84. package/dist/components/Contractor/Address/Actions.js.map +1 -0
  85. package/dist/components/Contractor/Address/Address.d.ts +16 -0
  86. package/dist/components/Contractor/Address/Address.js +74 -0
  87. package/dist/components/Contractor/Address/Address.js.map +1 -0
  88. package/dist/components/Contractor/Address/Form.d.ts +1 -0
  89. package/dist/components/Contractor/Address/Form.js +57 -0
  90. package/dist/components/Contractor/Address/Form.js.map +1 -0
  91. package/dist/components/Contractor/Address/Head.d.ts +1 -0
  92. package/dist/components/Contractor/Address/Head.js +15 -0
  93. package/dist/components/Contractor/Address/Head.js.map +1 -0
  94. package/dist/components/Contractor/Address/index.d.ts +2 -0
  95. package/dist/components/Contractor/Address/useAddress.d.ts +33 -0
  96. package/dist/components/Contractor/Address/useAddress.js +28 -0
  97. package/dist/components/Contractor/Address/useAddress.js.map +1 -0
  98. package/dist/components/Contractor/List/index.d.ts +25 -0
  99. package/dist/components/Contractor/List/index.js +84 -0
  100. package/dist/components/Contractor/List/index.js.map +1 -0
  101. package/dist/components/Contractor/List/useContractorList.d.ts +20 -0
  102. package/dist/components/Contractor/List/useContractorList.js +31 -0
  103. package/dist/components/Contractor/List/useContractorList.js.map +1 -0
  104. package/dist/components/Contractor/PaymentMethod/BankAccountForm.d.ts +2 -0
  105. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +53 -0
  106. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -0
  107. package/dist/components/Contractor/PaymentMethod/PaymentMethod.d.ts +31 -0
  108. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +108 -0
  109. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -0
  110. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.d.ts +11 -0
  111. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +35 -0
  112. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -0
  113. package/dist/components/Contractor/PaymentMethod/types.d.ts +8 -0
  114. package/dist/components/Contractor/index.d.ts +4 -0
  115. package/dist/components/Contractor/index.js +9 -0
  116. package/dist/components/Contractor/index.js.map +1 -0
  117. package/dist/components/Employee/Compensation/Actions.js +1 -1
  118. package/dist/components/Employee/Compensation/Compensation.js +1 -1
  119. package/dist/components/Employee/Compensation/Compensation.js.map +1 -1
  120. package/dist/components/Employee/Compensation/Edit.js +59 -56
  121. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  122. package/dist/components/Employee/Compensation/List.js +6 -5
  123. package/dist/components/Employee/Compensation/List.js.map +1 -1
  124. package/dist/components/Employee/Compensation/useCompensation.d.ts +2 -0
  125. package/dist/components/Employee/Compensation/useCompensation.js +16 -14
  126. package/dist/components/Employee/Compensation/useCompensation.js.map +1 -1
  127. package/dist/components/Employee/Deductions/Actions.js +9 -8
  128. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  129. package/dist/components/Employee/Deductions/DeductionForm.js +14 -5
  130. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  131. package/dist/components/Employee/Deductions/Deductions.js +25 -25
  132. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  133. package/dist/components/Employee/Deductions/DeductionsList.js +3 -2
  134. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  135. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +3 -2
  136. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  137. package/dist/components/Employee/Deductions/useDeductions.js +8 -6
  138. package/dist/components/Employee/Deductions/useDeductions.js.map +1 -1
  139. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +5 -4
  140. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  141. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -3
  142. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  143. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -3
  144. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  145. package/dist/components/Employee/EmployeeList/Actions.js +5 -4
  146. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  147. package/dist/components/Employee/EmployeeList/EmployeeList.js +1 -1
  148. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  149. package/dist/components/Employee/EmployeeList/List.js +56 -51
  150. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  151. package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +2 -1
  152. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -3
  153. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  154. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +48 -43
  155. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  156. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  157. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  158. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +1 -1
  159. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  160. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  161. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  162. package/dist/components/Employee/PaymentMethod/PaymentMethod.js +3 -4
  163. package/dist/components/Employee/PaymentMethod/PaymentMethod.js.map +1 -1
  164. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
  165. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  166. package/dist/components/Employee/PaymentMethod/Split.js +88 -76
  167. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  168. package/dist/components/Employee/PaymentMethod/usePaymentMethod.d.ts +2 -2
  169. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +35 -29
  170. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  171. package/dist/components/Employee/Profile/Actions.js +7 -6
  172. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  173. package/dist/components/Employee/Profile/AdminPersonalDetails.d.ts +49 -20
  174. package/dist/components/Employee/Profile/AdminPersonalDetails.js +27 -25
  175. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  176. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +10 -9
  177. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  178. package/dist/components/Employee/Profile/Profile.js +124 -116
  179. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  180. package/dist/components/Employee/Profile/useProfile.js +5 -3
  181. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  182. package/dist/components/Employee/Taxes/Actions.js +8 -7
  183. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  184. package/dist/components/Employee/Taxes/FederalForm.js +5 -4
  185. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  186. package/dist/components/Employee/Taxes/StateForm.d.ts +1 -1
  187. package/dist/components/Employee/Taxes/StateForm.js +27 -25
  188. package/dist/components/Employee/Taxes/StateForm.js.map +1 -1
  189. package/dist/components/Employee/Taxes/Taxes.d.ts +1 -1
  190. package/dist/components/Employee/Taxes/Taxes.js +90 -83
  191. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  192. package/dist/components/Employee/Taxes/useTaxes.d.ts +2 -2
  193. package/dist/components/Employee/Taxes/useTaxes.js +5 -3
  194. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  195. package/dist/components/index.d.ts +1 -0
  196. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +8 -7
  197. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  198. package/dist/i18n/I18n.js +5 -5
  199. package/dist/i18n/I18n.js.map +1 -1
  200. package/dist/i18n/en/Contractor.Address.json.js +35 -0
  201. package/dist/i18n/en/Contractor.Address.json.js.map +1 -0
  202. package/dist/i18n/en/Contractor.ContractorList.json.js +25 -0
  203. package/dist/i18n/en/Contractor.ContractorList.json.js.map +1 -0
  204. package/dist/i18n/en/Contractor.PaymentMethod.json.js +35 -0
  205. package/dist/i18n/en/Contractor.PaymentMethod.json.js.map +1 -0
  206. package/dist/i18n/en/Employee.Compensation.json.js +22 -20
  207. package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
  208. package/dist/i18n/en/Employee.PaymentMethod.json.js +18 -17
  209. package/dist/i18n/en/Employee.PaymentMethod.json.js.map +1 -1
  210. package/dist/i18n/en/common.json.d.ts +21 -9
  211. package/dist/i18n/en/common.json.js +35 -23
  212. package/dist/i18n/en/common.json.js.map +1 -1
  213. package/dist/index.js +11 -9
  214. package/dist/index.js.map +1 -1
  215. package/dist/shared/constants.d.ts +20 -0
  216. package/dist/shared/constants.js +62 -45
  217. package/dist/shared/constants.js.map +1 -1
  218. package/dist/style.css +1 -1
  219. package/dist/types/i18next.d.ts +71 -1
  220. package/package.json +7 -3
  221. package/dist/components/Employee/PaymentMethod/Constants.d.ts +0 -8
  222. package/dist/components/Employee/PaymentMethod/Constants.js +0 -6
  223. package/dist/components/Employee/PaymentMethod/Constants.js.map +0 -1
@@ -1,49 +1,49 @@
1
- import { jsx as t, jsxs as pe, Fragment as ye } from "react/jsx-runtime";
2
- import { zodResolver as Ae } from "@hookform/resolvers/zod";
3
- import { useRef as Ee } from "react";
4
- import { useForm as fe, useWatch as he, FormProvider as De } from "react-hook-form";
5
- import { useLocationsGetSuspense as Oe } from "@gusto/embedded-api/react-query/locationsGet";
6
- import { useEmployeesCreateMutation as Se } from "@gusto/embedded-api/react-query/employeesCreate";
7
- import { useEmployeesGetSuspense as Pe } from "@gusto/embedded-api/react-query/employeesGet";
8
- import { useEmployeeAddressesGetSuspense as ge } from "@gusto/embedded-api/react-query/employeeAddressesGet";
9
- import { useEmployeeAddressesCreateMutation as be } from "@gusto/embedded-api/react-query/employeeAddressesCreate";
10
- import { useEmployeeAddressesUpdateMutation as Ne } from "@gusto/embedded-api/react-query/employeeAddressesUpdate";
11
- import { useEmployeeAddressesUpdateWorkAddressMutation as Ie } from "@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress";
12
- import { useEmployeesUpdateMutation as _e } from "@gusto/embedded-api/react-query/employeesUpdate";
13
- import { useEmployeeAddressesGetWorkAddressesSuspense as we } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
14
- import { useEmployeeAddressesCreateWorkAddressMutation as ke } from "@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress";
15
- import { RFCDate as Me } from "@gusto/embedded-api/types/rfcdate";
16
- import { useEmployeesUpdateOnboardingStatusMutation as Re } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
17
- import { invalidateEmployeesList as Le } from "@gusto/embedded-api/react-query/employeesList";
18
- import { useQueryClient as Be } from "@tanstack/react-query";
19
- import { AdminPersonalDetailsSchema as Ce, AdminPersonalDetails as L } from "./AdminPersonalDetails.js";
20
- import { SelfPersonalDetailsSchema as ve, SelfPersonalDetails as B } from "./SelfPersonalDetails.js";
21
- import { Head as C } from "./Head.js";
22
- import { Actions as v } from "./Actions.js";
23
- import { HomeAddressSchema as We, HomeAddress as W } from "./HomeAddress.js";
24
- import { WorkAddress as U } from "./WorkAddress.js";
25
- import { ProfileProvider as Ue } from "./useProfile.js";
26
- import { getEmployeeAddressForProfile as qe } from "./getEmployeeAddressForProfile.js";
27
- import { Form as Te } from "../../Common/Form/Form.js";
28
- import { BaseComponent as He } from "../../Base/Base.js";
29
- import { useBase as Ge } from "../../Base/useBase.js";
30
- import { useI18n as R, useComponentDictionary as Fe } from "../../../i18n/I18n.js";
31
- import { EmployeeOnboardingStatus as l, EmployeeSelfOnboardingStatuses as Ve, componentEvents as d } from "../../../shared/constants.js";
32
- import { useFlow as Ye } from "../../Flow/useFlow.js";
33
- import { ensureRequired as xe } from "../../../helpers/ensureRequired.js";
1
+ import { jsx as t, jsxs as Ee, Fragment as he } from "react/jsx-runtime";
2
+ import { zodResolver as De } from "@hookform/resolvers/zod";
3
+ import { useState as Se, useRef as Oe, useEffect as Pe } from "react";
4
+ import { useForm as ge, useWatch as be, FormProvider as Ne } from "react-hook-form";
5
+ import { useLocationsGetSuspense as Ie } from "@gusto/embedded-api/react-query/locationsGet";
6
+ import { useEmployeesCreateMutation as _e } from "@gusto/embedded-api/react-query/employeesCreate";
7
+ import { useEmployeesGetSuspense as we } from "@gusto/embedded-api/react-query/employeesGet";
8
+ import { useEmployeeAddressesGetSuspense as ke } from "@gusto/embedded-api/react-query/employeeAddressesGet";
9
+ import { useEmployeeAddressesCreateMutation as Me } from "@gusto/embedded-api/react-query/employeeAddressesCreate";
10
+ import { useEmployeeAddressesUpdateMutation as Be } from "@gusto/embedded-api/react-query/employeeAddressesUpdate";
11
+ import { useEmployeeAddressesUpdateWorkAddressMutation as Re } from "@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress";
12
+ import { useEmployeesUpdateMutation as Le } from "@gusto/embedded-api/react-query/employeesUpdate";
13
+ import { useEmployeeAddressesGetWorkAddressesSuspense as ve } from "@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses";
14
+ import { useEmployeeAddressesCreateWorkAddressMutation as Ce } from "@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress";
15
+ import { RFCDate as R } from "@gusto/embedded-api/types/rfcdate";
16
+ import { useEmployeesUpdateOnboardingStatusMutation as We } from "@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus";
17
+ import { invalidateEmployeesList as Ue } from "@gusto/embedded-api/react-query/employeesList";
18
+ import { useQueryClient as qe } from "@tanstack/react-query";
19
+ import { AdminPersonalDetailsSchema as L, AdminSelfOnboardingPersonalDetailsSchema as Te, AdminPersonalDetails as C } from "./AdminPersonalDetails.js";
20
+ import { SelfPersonalDetailsSchema as He, SelfPersonalDetails as W } from "./SelfPersonalDetails.js";
21
+ import { Head as U } from "./Head.js";
22
+ import { Actions as q } from "./Actions.js";
23
+ import { HomeAddressSchema as Ge, HomeAddress as T } from "./HomeAddress.js";
24
+ import { WorkAddress as H } from "./WorkAddress.js";
25
+ import { ProfileProvider as Fe } from "./useProfile.js";
26
+ import { getEmployeeAddressForProfile as Ve } from "./getEmployeeAddressForProfile.js";
27
+ import { Form as Ye } from "../../Common/Form/Form.js";
28
+ import { BaseComponent as xe } from "../../Base/Base.js";
29
+ import { useBase as ze } from "../../Base/useBase.js";
30
+ import { useI18n as v, useComponentDictionary as je } from "../../../i18n/I18n.js";
31
+ import { EmployeeOnboardingStatus as l, EmployeeSelfOnboardingStatuses as Ke, componentEvents as d } from "../../../shared/constants.js";
32
+ import { useFlow as Qe } from "../../Flow/useFlow.js";
33
+ import { ensureRequired as Je } from "../../../helpers/ensureRequired.js";
34
34
  function m(r) {
35
- return /* @__PURE__ */ t(He, { ...r, children: r.employeeId ? /* @__PURE__ */ t(ze, { ...r, employeeId: r.employeeId, children: r.children }) : /* @__PURE__ */ t(q, { ...r, children: r.children }) });
35
+ return /* @__PURE__ */ t(xe, { ...r, children: r.employeeId ? /* @__PURE__ */ t(Xe, { ...r, employeeId: r.employeeId, children: r.children }) : /* @__PURE__ */ t(G, { ...r, children: r.children }) });
36
36
  }
37
- function ze({ employeeId: r, ...a }) {
37
+ function Xe({ employeeId: r, ...a }) {
38
38
  const {
39
39
  data: { employee: u }
40
- } = Pe({ employeeId: r }), {
40
+ } = we({ employeeId: r }), {
41
41
  data: { employeeAddressList: c }
42
- } = ge({ employeeId: r }), {
43
- data: { employeeWorkAddressList: i }
44
- } = we({ employeeId: r });
42
+ } = ke({ employeeId: r }), {
43
+ data: { employeeWorkAddressesList: i }
44
+ } = ve({ employeeId: r });
45
45
  return /* @__PURE__ */ t(
46
- q,
46
+ G,
47
47
  {
48
48
  ...a,
49
49
  employee: u,
@@ -52,31 +52,31 @@ function ze({ employeeId: r, ...a }) {
52
52
  }
53
53
  );
54
54
  }
55
- const q = ({
55
+ const G = ({
56
56
  isAdmin: r = !1,
57
57
  isSelfOnboardingEnabled: a = !0,
58
58
  dictionary: u,
59
59
  ...c
60
60
  }) => {
61
- R("Employee.Profile"), R("Employee.HomeAddress"), Fe("Employee.Profile", u);
61
+ v("Employee.Profile"), v("Employee.HomeAddress"), je("Employee.Profile", u);
62
62
  const {
63
63
  companyId: i,
64
- employee: f,
65
- homeAddresses: T,
66
- workAddresses: S,
67
- children: P,
68
- className: H = "",
64
+ employee: D,
65
+ homeAddresses: F,
66
+ workAddresses: g,
67
+ children: b,
68
+ className: V = "",
69
69
  defaultValues: s
70
- } = c, { onEvent: n, baseSubmitHandler: G } = Ge(), F = Be(), { data: V } = Oe({ companyId: i }), Y = V.locationList, { mutateAsync: x, isPending: z } = Se(), { mutateAsync: j, isPending: K } = _e(), { mutateAsync: Q, isPending: J } = ke(), { mutateAsync: X, isPending: Z } = Ie(), { mutateAsync: $, isPending: ee } = be(), { mutateAsync: re, isPending: te } = Ne(), {
71
- mutateAsync: oe,
72
- isPending: se
73
- } = Re({
74
- onSettled: () => Le(F, [i])
75
- }), g = { employee: f, workAddresses: S }, ne = qe(T), de = g.workAddresses?.find((O) => O.active), e = Ee({
76
- employee: g.employee,
77
- homeAddress: ne,
78
- workAddress: de
79
- }), h = {
70
+ } = c, { onEvent: n, baseSubmitHandler: Y } = ze(), x = qe(), [z, N] = Se(L), { data: j } = Ie({ companyId: i }), K = j.locationList, { mutateAsync: Q, isPending: J } = _e(), { mutateAsync: X, isPending: Z } = Le(), { mutateAsync: $, isPending: ee } = Ce(), { mutateAsync: re, isPending: te } = Re(), { mutateAsync: oe, isPending: se } = Me(), { mutateAsync: ne, isPending: de } = Be(), {
71
+ mutateAsync: ie,
72
+ isPending: me
73
+ } = We({
74
+ onSettled: () => Ue(x, [i])
75
+ }), I = { employee: D, workAddresses: g }, ae = Ve(F), le = I.workAddresses?.find((P) => P.active), e = Oe({
76
+ employee: I.employee,
77
+ homeAddress: ae,
78
+ workAddress: le
79
+ }), S = {
80
80
  firstName: e.current.employee?.firstName ?? s?.employee?.firstName ?? "",
81
81
  middleInitial: e.current.employee?.middleInitial ?? s?.employee?.middleInitial ?? "",
82
82
  lastName: e.current.employee?.lastName ?? s?.employee?.lastName ?? "",
@@ -91,29 +91,33 @@ const q = ({
91
91
  zip: e.current.homeAddress?.zip ?? s?.homeAddress?.zip ?? "",
92
92
  state: e.current.homeAddress?.state ?? s?.homeAddress?.state ?? "",
93
93
  courtesyWithholding: e.current.homeAddress?.courtesyWithholding ?? !1
94
- }, ie = e.current.employee?.onboarded || e.current.employee?.onboardingStatus === l.ONBOARDING_COMPLETED || e.current.employee?.onboardingStatus !== void 0 && e.current.employee.onboardingStatus !== l.ADMIN_ONBOARDING_INCOMPLETE ? { ...h, enableSsn: !1, selfOnboarding: !0 } : {
95
- ...h,
94
+ }, ue = e.current.employee?.onboarded || e.current.employee?.onboardingStatus === l.ONBOARDING_COMPLETED || e.current.employee?.onboardingStatus !== void 0 && e.current.employee.onboardingStatus !== l.ADMIN_ONBOARDING_INCOMPLETE ? { ...S, enableSsn: !1, selfOnboarding: !0 } : {
95
+ ...S,
96
96
  selfOnboarding: a && e.current.employee?.onboardingStatus ? (
97
97
  // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses
98
- Ve.has(e.current.employee.onboarding_status)
98
+ Ke.has(e.current.employee.onboarding_status)
99
99
  ) : !1,
100
100
  enableSsn: !e.current.employee?.hasSsn,
101
101
  ssn: ""
102
- }, me = {
103
- ...h,
102
+ }, ce = {
103
+ ...S,
104
104
  enableSsn: !e.current.employee?.hasSsn,
105
105
  ssn: ""
106
- }, D = fe({
107
- resolver: Ae(
108
- (r ? Ce : ve).and(We)
106
+ }, O = ge({
107
+ resolver: De(
108
+ (r ? z : He).and(Ge)
109
109
  ),
110
- defaultValues: r ? ie : me
111
- }), { handleSubmit: ae } = D, b = he({ control: D.control, name: "selfOnboarding" }), le = async (O) => {
112
- await G(O, async (A) => {
113
- const { workAddress: N, startDate: ce, selfOnboarding: E, ...I } = A;
110
+ defaultValues: r ? ue : ce
111
+ }), { handleSubmit: pe } = O, A = be({ control: O.control, name: "selfOnboarding" });
112
+ Pe(() => {
113
+ r && N(A ? Te : L);
114
+ }, [A, r]);
115
+ const ye = async (P) => {
116
+ await Y(P, async (f) => {
117
+ const { workAddress: _, startDate: fe, selfOnboarding: E, ...h } = f;
114
118
  if (e.current.employee) {
115
119
  if (E && e.current.employee.onboardingStatus === l.ADMIN_ONBOARDING_INCOMPLETE || !E && e.current.employee.onboardingStatus === l.SELF_ONBOARDING_PENDING_INVITE) {
116
- const { employeeOnboardingStatus: p } = await oe({
120
+ const { employeeOnboardingStatus: p } = await ie({
117
121
  request: {
118
122
  employeeId: e.current.employee.uuid,
119
123
  requestBody: {
@@ -126,53 +130,57 @@ const q = ({
126
130
  onboardingStatus: p.onboardingStatus
127
131
  }, n(d.EMPLOYEE_ONBOARDING_STATUS_UPDATED, p);
128
132
  }
129
- const { employee: o } = await j({
133
+ const { employee: o } = await X({
130
134
  request: {
131
135
  employeeId: e.current.employee.uuid,
132
- requestBody: { ...I, version: e.current.employee.version }
136
+ requestBody: { ...h, version: e.current.employee.version }
133
137
  }
134
138
  });
135
139
  e.current = { ...e.current, employee: o }, n(d.EMPLOYEE_UPDATED, o);
136
140
  } else {
137
- const { employee: o } = await x({
141
+ const { employee: o } = await Q({
138
142
  request: {
139
143
  companyId: i,
140
- requestBody: { ...I, selfOnboarding: E }
144
+ requestBody: {
145
+ ...h,
146
+ selfOnboarding: E,
147
+ dateOfBirth: h.dateOfBirth ? new R(h.dateOfBirth) : void 0
148
+ }
141
149
  }
142
150
  });
143
151
  e.current = { ...e.current, employee: o }, n(d.EMPLOYEE_CREATED, o);
144
152
  }
145
153
  if (typeof e.current.employee?.uuid != "string")
146
154
  throw new Error("Employee id is not available");
147
- if ((!b || !r) && !A.selfOnboarding) {
148
- const { street1: o, street2: p, city: _, state: w, zip: k, courtesyWithholding: M } = A;
155
+ if ((!A || !r) && !f.selfOnboarding) {
156
+ const { street1: o, street2: p, city: w, state: k, zip: M, courtesyWithholding: B } = f;
149
157
  if (e.current.homeAddress) {
150
- const { employeeAddress: y } = await re({
158
+ const { employeeAddress: y } = await ne({
151
159
  request: {
152
160
  homeAddressUuid: e.current.homeAddress.uuid,
153
161
  requestBody: {
154
162
  version: e.current.homeAddress.version,
155
163
  street1: o,
156
164
  street2: p,
157
- city: _,
158
- state: w,
159
- zip: k,
160
- courtesyWithholding: M
165
+ city: w,
166
+ state: k,
167
+ zip: M,
168
+ courtesyWithholding: B
161
169
  }
162
170
  }
163
171
  });
164
172
  e.current = { ...e.current, homeAddress: y }, n(d.EMPLOYEE_HOME_ADDRESS_UPDATED, y);
165
173
  } else {
166
- const { employeeAddress: y } = await $({
174
+ const { employeeAddress: y } = await oe({
167
175
  request: {
168
176
  employeeId: e.current.employee.uuid,
169
177
  requestBody: {
170
178
  street1: o,
171
179
  street2: p,
172
- city: _,
173
- state: w,
174
- zip: k,
175
- courtesyWithholding: M
180
+ city: w,
181
+ state: k,
182
+ zip: M,
183
+ courtesyWithholding: B
176
184
  }
177
185
  }
178
186
  });
@@ -181,23 +189,23 @@ const q = ({
181
189
  }
182
190
  if (r)
183
191
  if (e.current.workAddress) {
184
- const { employeeWorkAddress: o } = await X({
192
+ const { employeeWorkAddress: o } = await re({
185
193
  request: {
186
194
  workAddressUuid: e.current.workAddress.uuid,
187
195
  requestBody: {
188
196
  version: e.current.workAddress.version,
189
- locationUuid: N
197
+ locationUuid: _
190
198
  }
191
199
  }
192
200
  });
193
201
  e.current = { ...e.current, workAddress: o }, n(d.EMPLOYEE_WORK_ADDRESS_UPDATED, o);
194
202
  } else {
195
- const { employeeWorkAddress: o } = await Q({
203
+ const { employeeWorkAddress: o } = await $({
196
204
  request: {
197
205
  employeeId: e.current.employee?.uuid,
198
206
  requestBody: {
199
- locationUuid: N,
200
- effectiveDate: new Me(A.startDate || /* @__PURE__ */ new Date())
207
+ locationUuid: _,
208
+ effectiveDate: new R(f.startDate || /* @__PURE__ */ new Date())
201
209
  }
202
210
  }
203
211
  });
@@ -205,58 +213,58 @@ const q = ({
205
213
  }
206
214
  n(d.EMPLOYEE_PROFILE_DONE, {
207
215
  ...e.current.employee,
208
- startDate: ce
216
+ startDate: fe
209
217
  });
210
218
  });
211
- }, ue = () => {
219
+ }, Ae = () => {
212
220
  n(d.CANCEL);
213
221
  };
214
- return /* @__PURE__ */ t("section", { className: H, children: /* @__PURE__ */ t(
215
- Ue,
222
+ return /* @__PURE__ */ t("section", { className: V, children: /* @__PURE__ */ t(
223
+ Fe,
216
224
  {
217
225
  value: {
218
- companyLocations: Y,
219
- workAddresses: S,
226
+ companyLocations: K,
227
+ workAddresses: g,
220
228
  employee: e.current.employee ?? void 0,
221
- isSelfOnboardingIntended: b,
222
- handleCancel: ue,
229
+ isSelfOnboardingIntended: A,
230
+ handleCancel: Ae,
223
231
  isAdmin: r,
224
232
  isSelfOnboardingEnabled: a,
225
- isPending: K || Z || ee || te || z || J || se
233
+ isPending: Z || te || se || de || J || ee || me
226
234
  },
227
- children: /* @__PURE__ */ t(De, { ...D, children: /* @__PURE__ */ t(Te, { onSubmit: ae(le), children: P || /* @__PURE__ */ pe(ye, { children: [
235
+ children: /* @__PURE__ */ t(Ne, { ...O, children: /* @__PURE__ */ t(Ye, { onSubmit: pe(ye), children: b || /* @__PURE__ */ Ee(he, { children: [
236
+ /* @__PURE__ */ t(U, {}),
228
237
  /* @__PURE__ */ t(C, {}),
229
- /* @__PURE__ */ t(L, {}),
230
- /* @__PURE__ */ t(B, {}),
231
238
  /* @__PURE__ */ t(W, {}),
232
- /* @__PURE__ */ t(U, {}),
233
- /* @__PURE__ */ t(v, {})
239
+ /* @__PURE__ */ t(T, {}),
240
+ /* @__PURE__ */ t(H, {}),
241
+ /* @__PURE__ */ t(q, {})
234
242
  ] }) }) })
235
243
  }
236
244
  ) });
237
245
  };
238
- m.Head = C;
239
- m.Actions = v;
240
- m.AdminPersonalDetails = L;
241
- m.SelfPersonalDetails = B;
242
- m.HomeAddress = W;
243
- m.WorkAddress = U;
244
- const Ir = () => {
245
- const { companyId: r, employeeId: a, onEvent: u, isAdmin: c, defaultValues: i, isSelfOnboardingEnabled: f } = Ye();
246
+ m.Head = U;
247
+ m.Actions = q;
248
+ m.AdminPersonalDetails = C;
249
+ m.SelfPersonalDetails = W;
250
+ m.HomeAddress = T;
251
+ m.WorkAddress = H;
252
+ const Br = () => {
253
+ const { companyId: r, employeeId: a, onEvent: u, isAdmin: c, defaultValues: i, isSelfOnboardingEnabled: D } = Qe();
246
254
  return /* @__PURE__ */ t(
247
255
  m,
248
256
  {
249
- companyId: xe(r),
257
+ companyId: Je(r),
250
258
  employeeId: a,
251
259
  onEvent: u,
252
260
  isAdmin: c,
253
261
  defaultValues: i?.profile,
254
- isSelfOnboardingEnabled: f
262
+ isSelfOnboardingEnabled: D
255
263
  }
256
264
  );
257
265
  };
258
266
  export {
259
267
  m as Profile,
260
- Ir as ProfileContextual
268
+ Br as ProfileContextual
261
269
  };
262
270
  //# sourceMappingURL=Profile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Profile.js","sources":["../../../../src/components/Employee/Profile/Profile.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { useRef } from 'react'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeesCreateMutation } from '@gusto/embedded-api/react-query/employeesCreate'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useEmployeeAddressesGetSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGet'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { useEmployeeAddressesCreateMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreate'\nimport { useEmployeeAddressesUpdateMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdate'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { useEmployeesUpdateMutation } from '@gusto/embedded-api/react-query/employeesUpdate'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport { invalidateEmployeesList } from '@gusto/embedded-api/react-query/employeesList'\nimport { useQueryClient } from '@tanstack/react-query'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport { AdminPersonalDetails, AdminPersonalDetailsSchema } from './AdminPersonalDetails'\nimport { SelfPersonalDetails, SelfPersonalDetailsSchema } from './SelfPersonalDetails'\nimport { type PersonalDetailsPayload, type PersonalDetailsInputs } from './PersonalDetailsInputs'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { HomeAddress, HomeAddressSchema, type HomeAddressInputs } from './HomeAddress'\nimport { WorkAddress } from './WorkAddress'\nimport { ProfileProvider } from './useProfile'\nimport { getEmployeeAddressForProfile } from './getEmployeeAddressForProfile'\nimport { Form } from '@/components/Common/Form'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport type { RequireAtLeastOne, WithRequired } from '@/types/Helpers'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport type ProfileDefaultValues = RequireAtLeastOne<{\n employee?: RequireAtLeastOne<{\n firstName?: string\n middleInitial?: string\n lastName?: string\n email?: string\n dateOfBirth?: string\n }>\n homeAddress?: RequireAtLeastOne<{\n street1?: string\n street2?: string\n city?: string\n state?: string\n zip?: string\n }>\n}>\ninterface ProfileProps extends CommonComponentInterface<'Employee.Profile'> {\n employeeId?: string\n companyId: string\n defaultValues?: ProfileDefaultValues\n isAdmin?: boolean\n isSelfOnboardingEnabled?: boolean\n}\n\ninterface ProfileConditionalProps {\n employee?: Employee\n homeAddresses?: EmployeeAddress[]\n workAddresses?: EmployeeWorkAddress[]\n}\n\nexport function Profile(props: ProfileProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {props.employeeId ? (\n <RootWithEmployee {...props} employeeId={props.employeeId}>\n {props.children}\n </RootWithEmployee>\n ) : (\n <Root {...props}>{props.children}</Root>\n )}\n </BaseComponent>\n )\n}\n\n/**Accounting for conditional logic where employee data needs to be fetched only if employeeId is present */\nfunction RootWithEmployee({ employeeId, ...props }: WithRequired<ProfileProps, 'employeeId'>) {\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const {\n data: { employeeAddressList },\n } = useEmployeeAddressesGetSuspense({ employeeId })\n const {\n data: { employeeWorkAddressList },\n } = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n return (\n <Root\n {...props}\n employee={employee}\n homeAddresses={employeeAddressList}\n workAddresses={employeeWorkAddressList}\n />\n )\n}\n\nconst Root = ({\n isAdmin = false,\n isSelfOnboardingEnabled = true,\n dictionary,\n ...props\n}: ProfileProps & ProfileConditionalProps) => {\n useI18n('Employee.Profile')\n useI18n('Employee.HomeAddress')\n useComponentDictionary('Employee.Profile', dictionary)\n const {\n companyId,\n employee,\n homeAddresses,\n workAddresses,\n children,\n className = '',\n defaultValues,\n } = props\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n\n const { data } = useLocationsGetSuspense({ companyId })\n const companyLocations = data.locationList!\n\n const { mutateAsync: createEmployee, isPending: isPendingCreateEmployee } =\n useEmployeesCreateMutation()\n const { mutateAsync: mutateEmployee, isPending: isPendingEmployeeUpdate } =\n useEmployeesUpdateMutation()\n\n const { mutateAsync: createEmployeeWorkAddress, isPending: isPendingCreateWA } =\n useEmployeeAddressesCreateWorkAddressMutation()\n const { mutateAsync: mutateEmployeeWorkAddress, isPending: isPendingWorkAddressUpdate } =\n useEmployeeAddressesUpdateWorkAddressMutation()\n\n const { mutateAsync: createEmployeeHomeAddress, isPending: isPendingAddHA } =\n useEmployeeAddressesCreateMutation()\n const { mutateAsync: mutateEmployeeHomeAddress, isPending: isPendingUpdateHA } =\n useEmployeeAddressesUpdateMutation()\n\n const {\n mutateAsync: updateEmployeeOnboardingStatus,\n isPending: isPendingUpdateOnboardingStatus,\n } = useEmployeesUpdateOnboardingStatusMutation({\n onSettled: () => invalidateEmployeesList(queryClient, [companyId]),\n })\n\n const existingData = { employee, workAddresses, homeAddresses }\n\n const currentHomeAddress = getEmployeeAddressForProfile(homeAddresses)\n\n const currentWorkAddress = existingData.workAddresses?.find(address => address.active)\n const mergedData = useRef({\n employee: existingData.employee,\n homeAddress: currentHomeAddress,\n workAddress: currentWorkAddress,\n })\n const initialValues = {\n firstName: mergedData.current.employee?.firstName ?? defaultValues?.employee?.firstName ?? '',\n middleInitial:\n mergedData.current.employee?.middleInitial ?? defaultValues?.employee?.middleInitial ?? '',\n lastName: mergedData.current.employee?.lastName ?? defaultValues?.employee?.lastName ?? '',\n workAddress: mergedData.current.workAddress?.locationUuid,\n startDate: mergedData.current.employee?.jobs?.[0]?.hireDate\n ? new Date(mergedData.current.employee.jobs[0].hireDate)\n : null, // By default employee response contains only current job - therefore jobs[0]\n email: mergedData.current.employee?.email ?? defaultValues?.employee?.email ?? '',\n dateOfBirth: mergedData.current.employee?.dateOfBirth\n ? new Date(mergedData.current.employee.dateOfBirth)\n : defaultValues?.employee?.dateOfBirth\n ? new Date(defaultValues.employee.dateOfBirth)\n : null,\n\n street1: mergedData.current.homeAddress?.street1 ?? defaultValues?.homeAddress?.street1 ?? '',\n street2: mergedData.current.homeAddress?.street2 ?? defaultValues?.homeAddress?.street2 ?? '',\n city: mergedData.current.homeAddress?.city ?? defaultValues?.homeAddress?.city ?? '',\n zip: mergedData.current.homeAddress?.zip ?? defaultValues?.homeAddress?.zip ?? '',\n state: mergedData.current.homeAddress?.state ?? defaultValues?.homeAddress?.state ?? '',\n courtesyWithholding: mergedData.current.homeAddress?.courtesyWithholding ?? false,\n }\n\n const adminDefaultValues =\n mergedData.current.employee?.onboarded ||\n mergedData.current.employee?.onboardingStatus ===\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (mergedData.current.employee?.onboardingStatus !== undefined &&\n mergedData.current.employee.onboardingStatus !==\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE)\n ? { ...initialValues, enableSsn: false, selfOnboarding: true }\n : {\n ...initialValues,\n selfOnboarding: isSelfOnboardingEnabled\n ? mergedData.current.employee?.onboardingStatus\n ? // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(mergedData.current.employee.onboarding_status)\n : false\n : false,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n } // In edit mode ssn is submitted only if it has been modified\n\n const selfDetaultValues = {\n ...initialValues,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n }\n\n const formMethods = useForm<\n PersonalDetailsInputs & HomeAddressInputs,\n unknown,\n PersonalDetailsPayload & HomeAddressInputs\n >({\n resolver: zodResolver(\n (isAdmin ? AdminPersonalDetailsSchema : SelfPersonalDetailsSchema).and(HomeAddressSchema),\n ),\n defaultValues: isAdmin ? adminDefaultValues : selfDetaultValues,\n })\n\n const { handleSubmit } = formMethods\n const watchedSelfOnboarding = useWatch({ control: formMethods.control, name: 'selfOnboarding' })\n\n const onSubmit: SubmitHandler<PersonalDetailsPayload & HomeAddressInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { workAddress, startDate, selfOnboarding, ...body } = payload\n //create or update employee\n if (!mergedData.current.employee) {\n const { employee: employeeData } = await createEmployee({\n request: {\n companyId,\n requestBody: { ...body, selfOnboarding },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_CREATED, employeeData)\n } else {\n // Updating self-onboarding status\n if (\n (selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE) ||\n (!selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE)\n ) {\n const { employeeOnboardingStatus } = await updateEmployeeOnboardingStatus({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n onboardingStatus: selfOnboarding\n ? EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n : EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n mergedData.current.employee = {\n ...mergedData.current.employee,\n onboardingStatus: employeeOnboardingStatus!\n .onboardingStatus as (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus],\n }\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, employeeOnboardingStatus)\n }\n const { employee: employeeData } = await mutateEmployee({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: { ...body, version: mergedData.current.employee.version as string },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_UPDATED, employeeData)\n }\n if (typeof mergedData.current.employee?.uuid !== 'string') {\n throw new Error('Employee id is not available')\n }\n //create or update home address - only if not intended for self onboarding\n if (!watchedSelfOnboarding || !isAdmin) {\n //typeguard: in this scenario payload will contain address information\n if (!payload.selfOnboarding) {\n const { street1, street2, city, state, zip, courtesyWithholding } = payload\n if (!mergedData.current.homeAddress) {\n // Creating home address - for new employee effective_date is the same as work start date\n const { employeeAddress } = await createEmployeeHomeAddress({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_CREATED, employeeAddress)\n } else {\n const { employeeAddress } = await mutateEmployeeHomeAddress({\n request: {\n homeAddressUuid: mergedData.current.homeAddress.uuid as string,\n requestBody: {\n version: mergedData.current.homeAddress.version as string,\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_UPDATED, employeeAddress)\n }\n }\n }\n\n if (isAdmin) {\n //create or update workaddress\n if (!mergedData.current.workAddress) {\n const { employeeWorkAddress } = await createEmployeeWorkAddress({\n request: {\n employeeId: mergedData.current.employee?.uuid as string,\n requestBody: {\n locationUuid: workAddress,\n effectiveDate: new RFCDate(payload.startDate || new Date()),\n },\n },\n })\n\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, employeeWorkAddress)\n } else {\n //effective_date is excluded from update operation since it cannot be changed on initial work address\n const { employeeWorkAddress } = await mutateEmployeeWorkAddress({\n request: {\n workAddressUuid: mergedData.current.workAddress.uuid,\n requestBody: {\n version: mergedData.current.workAddress.version,\n locationUuid: workAddress,\n },\n },\n })\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, employeeWorkAddress)\n }\n }\n\n onEvent(componentEvents.EMPLOYEE_PROFILE_DONE, {\n ...mergedData.current.employee,\n startDate,\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n return (\n <section className={className}>\n <ProfileProvider\n value={{\n companyLocations,\n workAddresses,\n employee: mergedData.current.employee ?? undefined,\n isSelfOnboardingIntended: watchedSelfOnboarding,\n handleCancel,\n isAdmin,\n isSelfOnboardingEnabled,\n isPending:\n isPendingEmployeeUpdate ||\n isPendingWorkAddressUpdate ||\n isPendingAddHA ||\n isPendingUpdateHA ||\n isPendingCreateEmployee ||\n isPendingCreateWA ||\n isPendingUpdateOnboardingStatus,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </ProfileProvider>\n </section>\n )\n}\n\nProfile.Head = Head\nProfile.Actions = Actions\nProfile.AdminPersonalDetails = AdminPersonalDetails\nProfile.SelfPersonalDetails = SelfPersonalDetails\nProfile.HomeAddress = HomeAddress\nProfile.WorkAddress = WorkAddress\n\nexport const ProfileContextual = () => {\n const { companyId, employeeId, onEvent, isAdmin, defaultValues, isSelfOnboardingEnabled } =\n useFlow<OnboardingContextInterface>()\n\n return (\n <Profile\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n isAdmin={isAdmin}\n defaultValues={defaultValues?.profile}\n isSelfOnboardingEnabled={isSelfOnboardingEnabled}\n />\n )\n}\n"],"names":["Profile","props","jsx","BaseComponent","RootWithEmployee","Root","employeeId","employee","useEmployeesGetSuspense","employeeAddressList","useEmployeeAddressesGetSuspense","employeeWorkAddressList","useEmployeeAddressesGetWorkAddressesSuspense","isAdmin","isSelfOnboardingEnabled","dictionary","useI18n","useComponentDictionary","companyId","homeAddresses","workAddresses","children","className","defaultValues","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","data","useLocationsGetSuspense","companyLocations","createEmployee","isPendingCreateEmployee","useEmployeesCreateMutation","mutateEmployee","isPendingEmployeeUpdate","useEmployeesUpdateMutation","createEmployeeWorkAddress","isPendingCreateWA","useEmployeeAddressesCreateWorkAddressMutation","mutateEmployeeWorkAddress","isPendingWorkAddressUpdate","useEmployeeAddressesUpdateWorkAddressMutation","createEmployeeHomeAddress","isPendingAddHA","useEmployeeAddressesCreateMutation","mutateEmployeeHomeAddress","isPendingUpdateHA","useEmployeeAddressesUpdateMutation","updateEmployeeOnboardingStatus","isPendingUpdateOnboardingStatus","useEmployeesUpdateOnboardingStatusMutation","invalidateEmployeesList","existingData","currentHomeAddress","getEmployeeAddressForProfile","currentWorkAddress","address","mergedData","useRef","initialValues","adminDefaultValues","EmployeeOnboardingStatus","EmployeeSelfOnboardingStatuses","selfDetaultValues","formMethods","useForm","zodResolver","AdminPersonalDetailsSchema","SelfPersonalDetailsSchema","HomeAddressSchema","handleSubmit","watchedSelfOnboarding","useWatch","onSubmit","payload","workAddress","startDate","selfOnboarding","body","employeeOnboardingStatus","componentEvents","employeeData","street1","street2","city","state","zip","courtesyWithholding","employeeAddress","employeeWorkAddress","RFCDate","handleCancel","ProfileProvider","FormProvider","Form","jsxs","Fragment","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","ProfileContextual","useFlow","ensureRequired"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EO,SAASA,EAAQC,GAA8C;AAElE,SAAA,gBAAAC,EAACC,MAAe,GAAGF,GAChB,YAAM,aACL,gBAAAC,EAACE,IAAkB,EAAA,GAAGH,GAAO,YAAYA,EAAM,YAC5C,UAAAA,EAAM,SACT,CAAA,IAEA,gBAAAC,EAACG,KAAM,GAAGJ,GAAQ,UAAMA,EAAA,SAAA,CAAS,EAErC,CAAA;AAEJ;AAGA,SAASG,GAAiB,EAAE,YAAAE,GAAY,GAAGL,KAAmD;AACtF,QAAA;AAAA,IACJ,MAAM,EAAE,UAAAM,EAAS;AAAA,EA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,GAAK,EAAA;AAAA,0BACLC,GAAqB,EAAA;AAAA,0BACrBC,GAAoB,EAAA;AAAA,0BACpBC,GAAY,EAAA;AAAA,0BACZC,GAAY,EAAA;AAAA,0BACZC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EAEJ,CAAA,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEAxG,EAAQ,OAAOmG;AACfnG,EAAQ,UAAUwG;AAClBxG,EAAQ,uBAAuBoG;AAC/BpG,EAAQ,sBAAsBqG;AAC9BrG,EAAQ,cAAcsG;AACtBtG,EAAQ,cAAcuG;AAEf,MAAME,KAAoB,MAAM;AAC/B,QAAA,EAAE,WAAAvF,GAAW,YAAAZ,GAAY,SAAAkB,GAAS,SAAAX,GAAS,eAAAU,GAAe,yBAAAT,MAC9D4F,GAAoC;AAGpC,SAAA,gBAAAxG;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,WAAW2G,GAAezF,CAAS;AAAA,MACnC,YAAAZ;AAAA,MACA,SAAAkB;AAAA,MACA,SAAAX;AAAA,MACA,eAAeU,GAAe;AAAA,MAC9B,yBAAAT;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"Profile.js","sources":["../../../../src/components/Employee/Profile/Profile.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { useRef, useState, useEffect } from 'react'\nimport type { SubmitHandler } from 'react-hook-form'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useLocationsGetSuspense } from '@gusto/embedded-api/react-query/locationsGet'\nimport { useEmployeesCreateMutation } from '@gusto/embedded-api/react-query/employeesCreate'\nimport { useEmployeesGetSuspense } from '@gusto/embedded-api/react-query/employeesGet'\nimport { type Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useEmployeeAddressesGetSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGet'\nimport { type EmployeeAddress } from '@gusto/embedded-api/models/components/employeeaddress'\nimport { useEmployeeAddressesCreateMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreate'\nimport { useEmployeeAddressesUpdateMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdate'\nimport { useEmployeeAddressesUpdateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesUpdateWorkAddress'\nimport { useEmployeesUpdateMutation } from '@gusto/embedded-api/react-query/employeesUpdate'\nimport { useEmployeeAddressesGetWorkAddressesSuspense } from '@gusto/embedded-api/react-query/employeeAddressesGetWorkAddresses'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { useEmployeeAddressesCreateWorkAddressMutation } from '@gusto/embedded-api/react-query/employeeAddressesCreateWorkAddress'\nimport { RFCDate } from '@gusto/embedded-api/types/rfcdate'\nimport { useEmployeesUpdateOnboardingStatusMutation } from '@gusto/embedded-api/react-query/employeesUpdateOnboardingStatus'\nimport { invalidateEmployeesList } from '@gusto/embedded-api/react-query/employeesList'\nimport { useQueryClient } from '@tanstack/react-query'\nimport type { OnboardingContextInterface } from '../OnboardingFlow/OnboardingFlow'\nimport {\n AdminPersonalDetails,\n AdminPersonalDetailsSchema,\n AdminSelfOnboardingPersonalDetailsSchema,\n} from './AdminPersonalDetails'\nimport { SelfPersonalDetails, SelfPersonalDetailsSchema } from './SelfPersonalDetails'\nimport { type PersonalDetailsPayload, type PersonalDetailsInputs } from './PersonalDetailsInputs'\nimport { Head } from './Head'\nimport { Actions } from './Actions'\nimport { HomeAddress, HomeAddressSchema, type HomeAddressInputs } from './HomeAddress'\nimport { WorkAddress } from './WorkAddress'\nimport { ProfileProvider } from './useProfile'\nimport { getEmployeeAddressForProfile } from './getEmployeeAddressForProfile'\nimport { Form } from '@/components/Common/Form'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport {\n componentEvents,\n EmployeeOnboardingStatus,\n EmployeeSelfOnboardingStatuses,\n} from '@/shared/constants'\nimport type { RequireAtLeastOne, WithRequired } from '@/types/Helpers'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport type ProfileDefaultValues = RequireAtLeastOne<{\n employee?: RequireAtLeastOne<{\n firstName?: string\n middleInitial?: string\n lastName?: string\n email?: string\n dateOfBirth?: string\n }>\n homeAddress?: RequireAtLeastOne<{\n street1?: string\n street2?: string\n city?: string\n state?: string\n zip?: string\n }>\n}>\ninterface ProfileProps extends CommonComponentInterface<'Employee.Profile'> {\n employeeId?: string\n companyId: string\n defaultValues?: ProfileDefaultValues\n isAdmin?: boolean\n isSelfOnboardingEnabled?: boolean\n}\n\ninterface ProfileConditionalProps {\n employee?: Employee\n homeAddresses?: EmployeeAddress[]\n workAddresses?: EmployeeWorkAddress[]\n}\n\nexport function Profile(props: ProfileProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n {props.employeeId ? (\n <RootWithEmployee {...props} employeeId={props.employeeId}>\n {props.children}\n </RootWithEmployee>\n ) : (\n <Root {...props}>{props.children}</Root>\n )}\n </BaseComponent>\n )\n}\n\n/**Accounting for conditional logic where employee data needs to be fetched only if employeeId is present */\nfunction RootWithEmployee({ employeeId, ...props }: WithRequired<ProfileProps, 'employeeId'>) {\n const {\n data: { employee },\n } = useEmployeesGetSuspense({ employeeId })\n const {\n data: { employeeAddressList },\n } = useEmployeeAddressesGetSuspense({ employeeId })\n const {\n data: { employeeWorkAddressesList },\n } = useEmployeeAddressesGetWorkAddressesSuspense({ employeeId })\n return (\n <Root\n {...props}\n employee={employee}\n homeAddresses={employeeAddressList}\n workAddresses={employeeWorkAddressesList}\n />\n )\n}\n\nconst Root = ({\n isAdmin = false,\n isSelfOnboardingEnabled = true,\n dictionary,\n ...props\n}: ProfileProps & ProfileConditionalProps) => {\n useI18n('Employee.Profile')\n useI18n('Employee.HomeAddress')\n useComponentDictionary('Employee.Profile', dictionary)\n const {\n companyId,\n employee,\n homeAddresses,\n workAddresses,\n children,\n className = '',\n defaultValues,\n } = props\n const { onEvent, baseSubmitHandler } = useBase()\n const queryClient = useQueryClient()\n\n const [AdminSchema, setAdminSchema] = useState<\n typeof AdminPersonalDetailsSchema | typeof AdminSelfOnboardingPersonalDetailsSchema\n >(AdminPersonalDetailsSchema)\n\n const { data } = useLocationsGetSuspense({ companyId })\n const companyLocations = data.locationList!\n\n const { mutateAsync: createEmployee, isPending: isPendingCreateEmployee } =\n useEmployeesCreateMutation()\n const { mutateAsync: mutateEmployee, isPending: isPendingEmployeeUpdate } =\n useEmployeesUpdateMutation()\n\n const { mutateAsync: createEmployeeWorkAddress, isPending: isPendingCreateWA } =\n useEmployeeAddressesCreateWorkAddressMutation()\n const { mutateAsync: mutateEmployeeWorkAddress, isPending: isPendingWorkAddressUpdate } =\n useEmployeeAddressesUpdateWorkAddressMutation()\n\n const { mutateAsync: createEmployeeHomeAddress, isPending: isPendingAddHA } =\n useEmployeeAddressesCreateMutation()\n const { mutateAsync: mutateEmployeeHomeAddress, isPending: isPendingUpdateHA } =\n useEmployeeAddressesUpdateMutation()\n\n const {\n mutateAsync: updateEmployeeOnboardingStatus,\n isPending: isPendingUpdateOnboardingStatus,\n } = useEmployeesUpdateOnboardingStatusMutation({\n onSettled: () => invalidateEmployeesList(queryClient, [companyId]),\n })\n\n const existingData = { employee, workAddresses, homeAddresses }\n\n const currentHomeAddress = getEmployeeAddressForProfile(homeAddresses)\n\n const currentWorkAddress = existingData.workAddresses?.find(address => address.active)\n const mergedData = useRef({\n employee: existingData.employee,\n homeAddress: currentHomeAddress,\n workAddress: currentWorkAddress,\n })\n const initialValues = {\n firstName: mergedData.current.employee?.firstName ?? defaultValues?.employee?.firstName ?? '',\n middleInitial:\n mergedData.current.employee?.middleInitial ?? defaultValues?.employee?.middleInitial ?? '',\n lastName: mergedData.current.employee?.lastName ?? defaultValues?.employee?.lastName ?? '',\n workAddress: mergedData.current.workAddress?.locationUuid,\n startDate: mergedData.current.employee?.jobs?.[0]?.hireDate\n ? new Date(mergedData.current.employee.jobs[0].hireDate)\n : null, // By default employee response contains only current job - therefore jobs[0]\n email: mergedData.current.employee?.email ?? defaultValues?.employee?.email ?? '',\n dateOfBirth: mergedData.current.employee?.dateOfBirth\n ? new Date(mergedData.current.employee.dateOfBirth)\n : defaultValues?.employee?.dateOfBirth\n ? new Date(defaultValues.employee.dateOfBirth)\n : null,\n\n street1: mergedData.current.homeAddress?.street1 ?? defaultValues?.homeAddress?.street1 ?? '',\n street2: mergedData.current.homeAddress?.street2 ?? defaultValues?.homeAddress?.street2 ?? '',\n city: mergedData.current.homeAddress?.city ?? defaultValues?.homeAddress?.city ?? '',\n zip: mergedData.current.homeAddress?.zip ?? defaultValues?.homeAddress?.zip ?? '',\n state: mergedData.current.homeAddress?.state ?? defaultValues?.homeAddress?.state ?? '',\n courtesyWithholding: mergedData.current.homeAddress?.courtesyWithholding ?? false,\n }\n\n const adminDefaultValues =\n mergedData.current.employee?.onboarded ||\n mergedData.current.employee?.onboardingStatus ===\n EmployeeOnboardingStatus.ONBOARDING_COMPLETED ||\n (mergedData.current.employee?.onboardingStatus !== undefined &&\n mergedData.current.employee.onboardingStatus !==\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE)\n ? { ...initialValues, enableSsn: false, selfOnboarding: true }\n : {\n ...initialValues,\n selfOnboarding: isSelfOnboardingEnabled\n ? mergedData.current.employee?.onboardingStatus\n ? // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses\n EmployeeSelfOnboardingStatuses.has(mergedData.current.employee.onboarding_status)\n : false\n : false,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n } // In edit mode ssn is submitted only if it has been modified\n\n const selfDetaultValues = {\n ...initialValues,\n enableSsn: !mergedData.current.employee?.hasSsn,\n ssn: '',\n }\n\n const formMethods = useForm<\n PersonalDetailsInputs & HomeAddressInputs,\n unknown,\n PersonalDetailsPayload & HomeAddressInputs\n >({\n resolver: zodResolver(\n (isAdmin ? AdminSchema : SelfPersonalDetailsSchema).and(HomeAddressSchema),\n ),\n defaultValues: isAdmin ? adminDefaultValues : selfDetaultValues,\n })\n\n const { handleSubmit } = formMethods\n const watchedSelfOnboarding = useWatch({ control: formMethods.control, name: 'selfOnboarding' })\n\n useEffect(() => {\n if (isAdmin) {\n if (watchedSelfOnboarding) {\n setAdminSchema(AdminSelfOnboardingPersonalDetailsSchema)\n } else {\n setAdminSchema(AdminPersonalDetailsSchema)\n }\n }\n }, [watchedSelfOnboarding, isAdmin])\n\n const onSubmit: SubmitHandler<PersonalDetailsPayload & HomeAddressInputs> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { workAddress, startDate, selfOnboarding, ...body } = payload\n //create or update employee\n if (!mergedData.current.employee) {\n const { employee: employeeData } = await createEmployee({\n request: {\n companyId,\n requestBody: {\n ...body,\n selfOnboarding,\n dateOfBirth: body.dateOfBirth ? new RFCDate(body.dateOfBirth) : undefined,\n },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_CREATED, employeeData)\n } else {\n // Updating self-onboarding status\n if (\n (selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE) ||\n (!selfOnboarding &&\n mergedData.current.employee.onboardingStatus ===\n EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE)\n ) {\n const { employeeOnboardingStatus } = await updateEmployeeOnboardingStatus({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n onboardingStatus: selfOnboarding\n ? EmployeeOnboardingStatus.SELF_ONBOARDING_PENDING_INVITE\n : EmployeeOnboardingStatus.ADMIN_ONBOARDING_INCOMPLETE,\n },\n },\n })\n mergedData.current.employee = {\n ...mergedData.current.employee,\n onboardingStatus: employeeOnboardingStatus!\n .onboardingStatus as (typeof EmployeeOnboardingStatus)[keyof typeof EmployeeOnboardingStatus],\n }\n onEvent(componentEvents.EMPLOYEE_ONBOARDING_STATUS_UPDATED, employeeOnboardingStatus)\n }\n const { employee: employeeData } = await mutateEmployee({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: { ...body, version: mergedData.current.employee.version as string },\n },\n })\n mergedData.current = { ...mergedData.current, employee: employeeData }\n onEvent(componentEvents.EMPLOYEE_UPDATED, employeeData)\n }\n if (typeof mergedData.current.employee?.uuid !== 'string') {\n throw new Error('Employee id is not available')\n }\n //create or update home address - only if not intended for self onboarding\n if (!watchedSelfOnboarding || !isAdmin) {\n //typeguard: in this scenario payload will contain address information\n if (!payload.selfOnboarding) {\n const { street1, street2, city, state, zip, courtesyWithholding } = payload\n if (!mergedData.current.homeAddress) {\n // Creating home address - for new employee effective_date is the same as work start date\n const { employeeAddress } = await createEmployeeHomeAddress({\n request: {\n employeeId: mergedData.current.employee.uuid,\n requestBody: {\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_CREATED, employeeAddress)\n } else {\n const { employeeAddress } = await mutateEmployeeHomeAddress({\n request: {\n homeAddressUuid: mergedData.current.homeAddress.uuid,\n requestBody: {\n version: mergedData.current.homeAddress.version,\n street1,\n street2,\n city,\n state,\n zip,\n courtesyWithholding,\n },\n },\n })\n mergedData.current = { ...mergedData.current, homeAddress: employeeAddress }\n onEvent(componentEvents.EMPLOYEE_HOME_ADDRESS_UPDATED, employeeAddress)\n }\n }\n }\n\n if (isAdmin) {\n //create or update workaddress\n if (!mergedData.current.workAddress) {\n const { employeeWorkAddress } = await createEmployeeWorkAddress({\n request: {\n employeeId: mergedData.current.employee?.uuid as string,\n requestBody: {\n locationUuid: workAddress,\n effectiveDate: new RFCDate(payload.startDate || new Date()),\n },\n },\n })\n\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_CREATED, employeeWorkAddress)\n } else {\n //effective_date is excluded from update operation since it cannot be changed on initial work address\n const { employeeWorkAddress } = await mutateEmployeeWorkAddress({\n request: {\n workAddressUuid: mergedData.current.workAddress.uuid,\n requestBody: {\n version: mergedData.current.workAddress.version,\n locationUuid: workAddress,\n },\n },\n })\n mergedData.current = { ...mergedData.current, workAddress: employeeWorkAddress }\n onEvent(componentEvents.EMPLOYEE_WORK_ADDRESS_UPDATED, employeeWorkAddress)\n }\n }\n\n onEvent(componentEvents.EMPLOYEE_PROFILE_DONE, {\n ...mergedData.current.employee,\n startDate,\n })\n })\n }\n\n const handleCancel = () => {\n onEvent(componentEvents.CANCEL)\n }\n return (\n <section className={className}>\n <ProfileProvider\n value={{\n companyLocations,\n workAddresses,\n employee: mergedData.current.employee ?? undefined,\n isSelfOnboardingIntended: watchedSelfOnboarding,\n handleCancel,\n isAdmin,\n isSelfOnboardingEnabled,\n isPending:\n isPendingEmployeeUpdate ||\n isPendingWorkAddressUpdate ||\n isPendingAddHA ||\n isPendingUpdateHA ||\n isPendingCreateEmployee ||\n isPendingCreateWA ||\n isPendingUpdateOnboardingStatus,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <AdminPersonalDetails />\n <SelfPersonalDetails />\n <HomeAddress />\n <WorkAddress />\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </ProfileProvider>\n </section>\n )\n}\n\nProfile.Head = Head\nProfile.Actions = Actions\nProfile.AdminPersonalDetails = AdminPersonalDetails\nProfile.SelfPersonalDetails = SelfPersonalDetails\nProfile.HomeAddress = HomeAddress\nProfile.WorkAddress = WorkAddress\n\nexport const ProfileContextual = () => {\n const { companyId, employeeId, onEvent, isAdmin, defaultValues, isSelfOnboardingEnabled } =\n useFlow<OnboardingContextInterface>()\n\n return (\n <Profile\n companyId={ensureRequired(companyId)}\n employeeId={employeeId}\n onEvent={onEvent}\n isAdmin={isAdmin}\n defaultValues={defaultValues?.profile}\n isSelfOnboardingEnabled={isSelfOnboardingEnabled}\n />\n )\n}\n"],"names":["Profile","props","jsx","BaseComponent","RootWithEmployee","Root","employeeId","employee","useEmployeesGetSuspense","employeeAddressList","useEmployeeAddressesGetSuspense","employeeWorkAddressesList","useEmployeeAddressesGetWorkAddressesSuspense","isAdmin","isSelfOnboardingEnabled","dictionary","useI18n","useComponentDictionary","companyId","homeAddresses","workAddresses","children","className","defaultValues","onEvent","baseSubmitHandler","useBase","queryClient","useQueryClient","AdminSchema","setAdminSchema","useState","AdminPersonalDetailsSchema","data","useLocationsGetSuspense","companyLocations","createEmployee","isPendingCreateEmployee","useEmployeesCreateMutation","mutateEmployee","isPendingEmployeeUpdate","useEmployeesUpdateMutation","createEmployeeWorkAddress","isPendingCreateWA","useEmployeeAddressesCreateWorkAddressMutation","mutateEmployeeWorkAddress","isPendingWorkAddressUpdate","useEmployeeAddressesUpdateWorkAddressMutation","createEmployeeHomeAddress","isPendingAddHA","useEmployeeAddressesCreateMutation","mutateEmployeeHomeAddress","isPendingUpdateHA","useEmployeeAddressesUpdateMutation","updateEmployeeOnboardingStatus","isPendingUpdateOnboardingStatus","useEmployeesUpdateOnboardingStatusMutation","invalidateEmployeesList","existingData","currentHomeAddress","getEmployeeAddressForProfile","currentWorkAddress","address","mergedData","useRef","initialValues","adminDefaultValues","EmployeeOnboardingStatus","EmployeeSelfOnboardingStatuses","selfDetaultValues","formMethods","useForm","zodResolver","SelfPersonalDetailsSchema","HomeAddressSchema","handleSubmit","watchedSelfOnboarding","useWatch","useEffect","AdminSelfOnboardingPersonalDetailsSchema","onSubmit","payload","workAddress","startDate","selfOnboarding","body","employeeOnboardingStatus","componentEvents","employeeData","RFCDate","street1","street2","city","state","zip","courtesyWithholding","employeeAddress","employeeWorkAddress","handleCancel","ProfileProvider","FormProvider","Form","jsxs","Fragment","Head","AdminPersonalDetails","SelfPersonalDetails","HomeAddress","WorkAddress","Actions","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7G;AAAA,IAACF;AAAA,IAAA;AAAA,MACC,WAAWgH,GAAe9F,CAAS;AAAA,MACnC,YAAAZ;AAAA,MACA,SAAAkB;AAAA,MACA,SAAAX;AAAA,MACA,eAAeU,GAAe;AAAA,MAC9B,yBAAAT;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -6,11 +6,13 @@ import "@gusto/embedded-api/models/errors/apierror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "../../Base/useBase.js";
9
+ import "../../../shared/constants.js";
9
10
  import "dompurify";
11
+ import "../../../contexts/ComponentAdapter/useComponentContext.js";
10
12
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
11
- const [x, C] = o("ProfileContext");
13
+ const [c, d] = o("ProfileContext");
12
14
  export {
13
- C as ProfileProvider,
14
- x as useProfile
15
+ d as ProfileProvider,
16
+ c as useProfile
15
17
  };
16
18
  //# sourceMappingURL=useProfile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":";;;;;;;;;;AAiBA,MAAM,CAACA,GAAYC,CAAe,IAAIC,EAA0C,gBAAgB;"}
1
+ {"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;AAiBA,MAAM,CAACA,GAAYC,CAAe,IAAIC,EAA0C,gBAAgB;"}
@@ -1,13 +1,14 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { useTranslation as e } from "react-i18next";
3
- import { useTaxes as i } from "./useTaxes.js";
4
- import { ActionsLayout as r } from "../../Common/ActionsLayout/ActionsLayout.js";
2
+ import { useTranslation as i } from "react-i18next";
3
+ import { useTaxes as r } from "./useTaxes.js";
4
+ import "../../../shared/constants.js";
5
+ import { ActionsLayout as e } from "../../Common/ActionsLayout/ActionsLayout.js";
5
6
  import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
6
- const x = () => {
7
- const { t } = e("Employee.Taxes"), { isPending: n } = i(), s = m();
8
- return /* @__PURE__ */ o(r, { children: /* @__PURE__ */ o(s.Button, { type: "submit", isLoading: n, children: t("submitCta") }) });
7
+ const d = () => {
8
+ const { t } = i("Employee.Taxes"), { isPending: n } = r(), s = m();
9
+ return /* @__PURE__ */ o(e, { children: /* @__PURE__ */ o(s.Button, { type: "submit", isLoading: n, children: t("submitCta") }) });
9
10
  };
10
11
  export {
11
- x as Actions
12
+ d as Actions
12
13
  };
13
14
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Taxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useTaxes } from './useTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Employee.Taxes')\n const { isPending } = useTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,gBAAgB,GACvC,EAAE,WAAAC,EAAU,IAAIC,EAAS,GACzBC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAE,EAAA,WAAW,EAChB,CAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Taxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useTaxes } from './useTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Employee.Taxes')\n const { isPending } = useTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,gBAAgB,GACvC,EAAE,WAAAC,EAAU,IAAIC,EAAS,GACzBC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAE,EAAA,WAAW,EAChB,CAAA,GACF;AAEJ;"}
@@ -1,11 +1,12 @@
1
1
  import { jsxs as l, Fragment as a, jsx as r } from "react/jsx-runtime";
2
2
  import { useTranslation as s, Trans as m } from "react-i18next";
3
3
  import { z as t } from "zod";
4
+ import "../../../shared/constants.js";
4
5
  import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
5
6
  import { SelectField as d } from "../../Common/Fields/SelectField/SelectField.js";
6
7
  import { RadioGroupField as f } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
7
8
  import { NumberInputField as i } from "../../Common/Fields/NumberInputField/NumberInputField.js";
8
- const x = t.object({
9
+ const R = t.object({
9
10
  filingStatus: t.string().min(1),
10
11
  twoJobs: t.string().min(1),
11
12
  dependentsAmount: t.number().transform(String),
@@ -14,7 +15,7 @@ const x = t.object({
14
15
  extraWithholding: t.number().transform(String),
15
16
  w4DataType: t.enum(["pre_2020_w4", "rev_2020_w4"])
16
17
  });
17
- function R() {
18
+ function q() {
18
19
  const { t: e } = s("Employee.Taxes"), o = u(), n = [
19
20
  { value: "Single", label: e("filingStatusSingle") },
20
21
  { value: "Married", label: e("filingStatusMarried") },
@@ -100,7 +101,7 @@ function R() {
100
101
  ] });
101
102
  }
102
103
  export {
103
- R as FederalForm,
104
- x as FederalFormSchema
104
+ q as FederalForm,
105
+ R as FederalFormSchema
105
106
  };
106
107
  //# sourceMappingURL=FederalForm.js.map