@gusto/embedded-react-sdk 0.37.0-rc.1 → 0.37.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 (240) hide show
  1. package/CHANGELOG.md +44 -8
  2. package/README.md +6 -0
  3. package/dist/UNSTABLE_Hooks.d.ts +1 -1
  4. package/dist/UNSTABLE_Hooks.js +50 -6
  5. package/dist/UNSTABLE_Hooks.js.map +1 -1
  6. package/dist/components/Base/Base.d.ts +2 -1
  7. package/dist/components/Base/Base.js +78 -77
  8. package/dist/components/Base/Base.js.map +1 -1
  9. package/dist/components/Common/Fields/CheckboxField/CheckboxField.d.ts +2 -0
  10. package/dist/components/Common/Fields/CheckboxField/CheckboxField.js +17 -16
  11. package/dist/components/Common/Fields/CheckboxField/CheckboxField.js.map +1 -1
  12. package/dist/components/Common/Fields/DatePickerField/DatePickerField.d.ts +5 -3
  13. package/dist/components/Common/Fields/DatePickerField/DatePickerField.js +46 -36
  14. package/dist/components/Common/Fields/DatePickerField/DatePickerField.js.map +1 -1
  15. package/dist/components/Common/Fields/NumberInputField/NumberInputField.d.ts +2 -0
  16. package/dist/components/Common/Fields/NumberInputField/NumberInputField.js +21 -20
  17. package/dist/components/Common/Fields/NumberInputField/NumberInputField.js.map +1 -1
  18. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.d.ts +3 -1
  19. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js +20 -19
  20. package/dist/components/Common/Fields/RadioGroupField/RadioGroupField.js.map +1 -1
  21. package/dist/components/Common/Fields/SelectField/SelectField.d.ts +3 -1
  22. package/dist/components/Common/Fields/SelectField/SelectField.js +19 -18
  23. package/dist/components/Common/Fields/SelectField/SelectField.js.map +1 -1
  24. package/dist/components/Common/Fields/SwitchField/SwitchField.d.ts +2 -0
  25. package/dist/components/Common/Fields/SwitchField/SwitchField.js +19 -18
  26. package/dist/components/Common/Fields/SwitchField/SwitchField.js.map +1 -1
  27. package/dist/components/Common/Fields/TextInputField/TextInputField.d.ts +2 -0
  28. package/dist/components/Common/Fields/TextInputField/TextInputField.js +10 -9
  29. package/dist/components/Common/Fields/TextInputField/TextInputField.js.map +1 -1
  30. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  31. package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
  32. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +5 -6
  33. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +9 -6
  35. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  36. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +4 -5
  37. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  38. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +9 -6
  39. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  40. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +11 -8
  41. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  42. package/dist/components/Company/BankAccount/BankAccountForm/context.js +9 -6
  43. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  44. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +9 -6
  45. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  46. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +9 -6
  47. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  48. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +15 -12
  49. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  50. package/dist/components/Company/Industry/Context.js +12 -9
  51. package/dist/components/Company/Industry/Context.js.map +1 -1
  52. package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
  53. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  54. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +9 -6
  55. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  56. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +9 -6
  57. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  58. package/dist/components/Company/OnboardingOverview/context.js +9 -6
  59. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  60. package/dist/components/Company/PaySchedule/_parts/Edit.js +9 -10
  61. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  62. package/dist/components/Company/PaySchedule/usePaySchedule.js +11 -8
  63. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  64. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +9 -6
  65. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  66. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +9 -6
  67. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  68. package/dist/components/Contractor/Address/Form.js +6 -7
  69. package/dist/components/Contractor/Address/Form.js.map +1 -1
  70. package/dist/components/Contractor/Address/useAddress.js +11 -8
  71. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  72. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +2 -3
  73. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  74. package/dist/components/Contractor/Profile/useContractorProfile.js +21 -16
  75. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  76. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +14 -11
  77. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  78. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +13 -10
  79. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  80. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +6 -3
  81. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  82. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +2 -3
  83. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  84. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +9 -6
  85. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  86. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +9 -6
  87. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  88. package/dist/components/Employee/EmployeeList/useEmployeeList.js +9 -6
  89. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  90. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +9 -6
  91. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  92. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +11 -8
  93. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  94. package/dist/components/Employee/Profile/HomeAddress.d.ts +3 -3
  95. package/dist/components/Employee/Profile/HomeAddress.js +44 -43
  96. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  97. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +14 -15
  98. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  99. package/dist/components/Employee/Profile/useProfile.js +9 -6
  100. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  101. package/dist/components/Employee/StateTaxes/useStateTaxes.js +9 -6
  102. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  103. package/dist/components/Employee/Taxes/useTaxes.js +9 -6
  104. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  105. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +16 -13
  106. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  107. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +2 -3
  108. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  109. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +185 -177
  110. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  111. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +2 -3
  112. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  113. package/dist/components/Payroll/usePreparedPayrollData.js +7 -5
  114. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  115. package/dist/components/UNSTABLE_Hooks/collectErrors.d.ts +6 -0
  116. package/dist/components/UNSTABLE_Hooks/collectErrors.js +9 -0
  117. package/dist/components/UNSTABLE_Hooks/collectErrors.js.map +1 -0
  118. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +1 -1
  119. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +3 -3
  120. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -1
  121. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +2 -2
  122. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js +13 -0
  123. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.js.map +1 -0
  124. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +11 -6
  125. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js +24 -0
  126. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.js.map +1 -0
  127. package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.d.ts +26 -0
  128. package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js +24 -0
  129. package/dist/components/UNSTABLE_Hooks/form/composeFormSchema.js.map +1 -0
  130. package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.d.ts +53 -0
  131. package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js +34 -0
  132. package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.js.map +1 -0
  133. package/dist/components/UNSTABLE_Hooks/form/composeSubmitHandler.test.d.ts +1 -0
  134. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js +14 -0
  135. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.js.map +1 -0
  136. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.d.ts +9 -0
  137. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js +34 -0
  138. package/dist/components/UNSTABLE_Hooks/form/fields/CheckboxHookField.js.map +1 -0
  139. package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.d.ts +9 -0
  140. package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js +29 -0
  141. package/dist/components/UNSTABLE_Hooks/form/fields/DatePickerHookField.js.map +1 -0
  142. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.d.ts +12 -0
  143. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js +40 -0
  144. package/dist/components/UNSTABLE_Hooks/form/fields/NumberInputHookField.js.map +1 -0
  145. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.d.ts +10 -0
  146. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js +40 -0
  147. package/dist/components/UNSTABLE_Hooks/form/fields/RadioGroupHookField.js.map +1 -0
  148. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.d.ts +10 -0
  149. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js +40 -0
  150. package/dist/components/UNSTABLE_Hooks/form/fields/SelectHookField.js.map +1 -0
  151. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.d.ts +9 -0
  152. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js +34 -0
  153. package/dist/components/UNSTABLE_Hooks/form/fields/SwitchHookField.js.map +1 -0
  154. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.d.ts +11 -0
  155. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js +38 -0
  156. package/dist/components/UNSTABLE_Hooks/form/fields/TextInputHookField.js.map +1 -0
  157. package/dist/components/UNSTABLE_Hooks/form/fields/index.d.ts +15 -0
  158. package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.d.ts +2 -0
  159. package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js +8 -0
  160. package/dist/components/UNSTABLE_Hooks/form/getFieldWithOptions.js.map +1 -0
  161. package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.d.ts +18 -0
  162. package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js +10 -0
  163. package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.js.map +1 -0
  164. package/dist/components/UNSTABLE_Hooks/form/getFormSubmissionValues.test.d.ts +1 -0
  165. package/dist/components/UNSTABLE_Hooks/form/index.d.ts +6 -1
  166. package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.d.ts +6 -0
  167. package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js +14 -0
  168. package/dist/components/UNSTABLE_Hooks/form/resolveRequiredFields.js.map +1 -0
  169. package/dist/components/UNSTABLE_Hooks/form/types.d.ts +12 -0
  170. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +2 -1
  171. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +10 -8
  172. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -1
  173. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +2 -2
  174. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -1
  175. package/dist/components/UNSTABLE_Hooks/form/withOptions.js +7 -0
  176. package/dist/components/UNSTABLE_Hooks/form/withOptions.js.map +1 -0
  177. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.d.ts +5 -0
  178. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js +151 -0
  179. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/CompensationForm.js.map +1 -0
  180. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +97 -0
  181. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +121 -0
  182. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +1 -0
  183. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.d.ts +34 -0
  184. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js +50 -0
  185. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/fields.js.map +1 -0
  186. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +5 -1
  187. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +97 -9
  188. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +255 -3
  189. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -1
  190. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.d.ts +5 -0
  191. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js +114 -0
  192. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/EmployeeDetailsForm.js.map +1 -0
  193. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.d.ts +39 -0
  194. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js +45 -0
  195. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/employeeDetailsSchema.js.map +1 -0
  196. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.d.ts +23 -0
  197. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js +46 -0
  198. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/fields.js.map +1 -0
  199. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/index.d.ts +7 -0
  200. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +77 -0
  201. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js +153 -0
  202. package/dist/components/UNSTABLE_Hooks/hooks/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -0
  203. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.d.ts +5 -0
  204. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js +71 -0
  205. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/WorkAddressForm.js.map +1 -0
  206. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.d.ts +10 -0
  207. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js +14 -0
  208. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/fields.js.map +1 -0
  209. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/index.d.ts +7 -0
  210. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.d.ts +68 -0
  211. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js +129 -0
  212. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/useWorkAddressForm.js.map +1 -0
  213. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.d.ts +25 -0
  214. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js +24 -0
  215. package/dist/components/UNSTABLE_Hooks/hooks/useWorkAddressForm/workAddressSchema.js.map +1 -0
  216. package/dist/components/UNSTABLE_Hooks/index.d.ts +8 -4
  217. package/dist/components/UNSTABLE_Hooks/types.d.ts +9 -6
  218. package/dist/components/UNSTABLE_Hooks/useErrorHandling.d.ts +9 -0
  219. package/dist/components/UNSTABLE_Hooks/useErrorHandling.js +12 -0
  220. package/dist/components/UNSTABLE_Hooks/useErrorHandling.js.map +1 -0
  221. package/dist/components/UNSTABLE_Hooks/useErrorHandling.test.d.ts +1 -0
  222. package/dist/helpers/requiredIf.d.ts +13 -0
  223. package/dist/helpers/requiredIf.js +8 -0
  224. package/dist/helpers/requiredIf.js.map +1 -0
  225. package/dist/i18n/I18n.js +5 -5
  226. package/dist/i18n/I18n.js.map +1 -1
  227. package/dist/i18n/en/UNSTABLE.CompensationForm.json.js +58 -0
  228. package/dist/i18n/en/UNSTABLE.CompensationForm.json.js.map +1 -0
  229. package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js +34 -0
  230. package/dist/i18n/en/UNSTABLE.EmployeeDetailsForm.json.js.map +1 -0
  231. package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js +24 -0
  232. package/dist/i18n/en/UNSTABLE.WorkAddressForm.json.js.map +1 -0
  233. package/dist/models/WA_RISK_CODES.d.ts +5 -2866
  234. package/dist/models/WA_RISK_CODES.js.map +1 -1
  235. package/dist/style.css +1 -1
  236. package/dist/types/i18next.d.ts +117 -1
  237. package/dist/types/sdkError.d.ts +7 -1
  238. package/dist/types/sdkError.js.map +1 -1
  239. package/docs/reference/endpoint-inventory.json +92 -0
  240. package/package.json +9 -9
@@ -4,16 +4,19 @@ import "react-error-boundary";
4
4
  import "react-i18next";
5
5
  import "@tanstack/react-query";
6
6
  import "../../Base/useBase.js";
7
+ import "@gusto/embedded-api/models/errors/apierror";
8
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
11
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
7
12
  import "../../../shared/constants.js";
8
13
  import "classnames";
9
14
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
11
- import "@gusto/embedded-api/models/errors/httpclienterrors";
12
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
15
+ import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
13
16
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
14
- const [w, x] = o("OnboardingOverviewContext");
17
+ const [c, s] = o("OnboardingOverviewContext");
15
18
  export {
16
- x as OnboardingOverviewProvider,
17
- w as useOnboardingOverview
19
+ s as OnboardingOverviewProvider,
20
+ c as useOnboardingOverview
18
21
  };
19
22
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../src/components/Company/OnboardingOverview/context.ts"],"sourcesContent":["import type { OnboardingStep } from '@gusto/embedded-api/models/components/companyonboardingstatus'\nimport { createCompoundContext } from '@/components/Base'\n\ntype OnboardingOverviewContextType = {\n onboardingCompleted?: boolean\n onboardingSteps?: OnboardingStep[]\n handleDone: () => void\n handleContinue: () => void\n}\n\nconst [useOnboardingOverview, OnboardingOverviewProvider] =\n createCompoundContext<OnboardingOverviewContextType>('OnboardingOverviewContext')\n\nexport { useOnboardingOverview, OnboardingOverviewProvider }\n"],"names":["useOnboardingOverview","OnboardingOverviewProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAuBC,CAA0B,IACtDC,EAAqD,2BAA2B;"}
@@ -6,7 +6,6 @@ import { usePaySchedule as T } from "../usePaySchedule.js";
6
6
  import l from "./Edit.module.scss.js";
7
7
  import { Flex as y } from "../../../Common/Flex/Flex.js";
8
8
  import { Grid as x } from "../../../Common/Grid/Grid.js";
9
- import "classnames";
10
9
  import { RadioGroupField as E } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
11
10
  import { TextInputField as N } from "../../../Common/Fields/TextInputField/TextInputField.js";
12
11
  import { DatePickerField as h } from "../../../Common/Fields/DatePickerField/DatePickerField.js";
@@ -14,11 +13,11 @@ import { NumberInputField as f } from "../../../Common/Fields/NumberInputField/N
14
13
  import { useComponentContext as F } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
15
14
  import { useDateFormatter as R } from "../../../../hooks/useDateFormatter.js";
16
15
  import { SelectField as O } from "../../../Common/Fields/SelectField/SelectField.js";
17
- const K = () => {
18
- const o = F(), { t: e } = C("Company.PaySchedule"), P = R(), { payPeriodPreview: r, mode: u, payPreviewLoading: D } = T(), { setValue: d } = q(), [a, v] = g(0), i = p({ name: "frequency" }), n = p({ name: "customTwicePerMonth" }), b = i === "Twice per month" && n === "custom" || i === "Monthly", w = i === "Twice per month" && n === "custom";
16
+ const J = () => {
17
+ const n = F(), { t: e } = C("Company.PaySchedule"), P = R(), { payPeriodPreview: r, mode: u, payPreviewLoading: D } = T(), { setValue: d } = q(), [a, v] = g(0), i = p({ name: "frequency" }), o = p({ name: "customTwicePerMonth" }), b = i === "Twice per month" && o === "custom" || i === "Monthly", w = i === "Twice per month" && o === "custom";
19
18
  return S(() => {
20
- i === "Twice per month" && n === "1st15th" && (d("day1", 15), d("day2", 31));
21
- }, [i, n, d]), u !== "EDIT_PAY_SCHEDULE" && u !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ t("div", { className: l.payScheduleContainer, children: /* @__PURE__ */ m(x, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
19
+ i === "Twice per month" && o === "1st15th" && (d("day1", 15), d("day2", 31));
20
+ }, [i, o, d]), u !== "EDIT_PAY_SCHEDULE" && u !== "ADD_PAY_SCHEDULE" ? null : /* @__PURE__ */ t("div", { className: l.payScheduleContainer, children: /* @__PURE__ */ m(x, { gap: 32, gridTemplateColumns: { base: "1fr", small: "1fr 1fr" }, children: [
22
21
  /* @__PURE__ */ t("div", { className: l.payScheduleForm, children: /* @__PURE__ */ m(y, { flexDirection: "column", children: [
23
22
  /* @__PURE__ */ t(N, { name: "customName", label: e("labels.name"), isRequired: !0 }),
24
23
  /* @__PURE__ */ t(
@@ -70,7 +69,7 @@ const K = () => {
70
69
  ] }) }),
71
70
  /* @__PURE__ */ t(y, { flexDirection: "column", gap: 4, justifyContent: "center", alignItems: "center", children: r && r[a] ? /* @__PURE__ */ m("div", { className: l.calendarContainer, children: [
72
71
  !D && /* @__PURE__ */ t(
73
- o.Select,
72
+ n.Select,
74
73
  {
75
74
  label: e("labels.preview"),
76
75
  isRequired: !0,
@@ -86,7 +85,7 @@ const K = () => {
86
85
  }
87
86
  ),
88
87
  /* @__PURE__ */ t(
89
- o.CalendarPreview,
88
+ n.CalendarPreview,
90
89
  {
91
90
  dateRange: {
92
91
  start: new Date(r[a].startDate),
@@ -109,11 +108,11 @@ const K = () => {
109
108
  a
110
109
  )
111
110
  ] }) : /* @__PURE__ */ t("div", { className: l.calendarContainer, children: /* @__PURE__ */ t(
112
- o.Alert,
111
+ n.Alert,
113
112
  {
114
113
  status: "info",
115
114
  label: e("previewAlert.title", "Pay Schedule Preview"),
116
- children: /* @__PURE__ */ t(o.Text, { children: e(
115
+ children: /* @__PURE__ */ t(n.Text, { children: e(
117
116
  "previewAlert.description",
118
117
  "Complete all the required fields on the left to see a preview of your pay schedule."
119
118
  ) })
@@ -122,6 +121,6 @@ const K = () => {
122
121
  ] }) });
123
122
  };
124
123
  export {
125
- K as Edit
124
+ J as Edit
126
125
  };
127
126
  //# sourceMappingURL=Edit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const dateFormatter = useDateFormatter()\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label={t('labels.name')} isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n isRequired\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <Components.Select\n label={t('labels.preview')}\n isRequired\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: dateFormatter.formatPayPeriodRange(period.startDate, period.endDate),\n }\n })}\n value={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","dateFormatter","useDateFormatter","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","value","numericValue"],"mappings":";;;;;;;;;;;;;;;;AAkBO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAgBC,EAAA,GAChB,EAAE,kBAAAC,GAAkB,MAAAC,GAAM,mBAAAC,EAAA,IAAsBC,EAAA,GAChD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AA,EACF,CACF;AAAA,MAAA;AAAA,IAAA,GAEJ,EAAA,CAEJ;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"Edit.js","sources":["../../../../../src/components/Company/PaySchedule/_parts/Edit.tsx"],"sourcesContent":["import { useFormContext, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { useEffect, useState } from 'react'\nimport type { PayScheduleInputs } from '../usePaySchedule'\nimport { usePaySchedule } from '../usePaySchedule'\nimport style from './Edit.module.scss'\nimport {\n Flex,\n SelectField,\n RadioGroupField,\n Grid,\n TextInputField,\n NumberInputField,\n DatePickerField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\nexport const Edit = () => {\n const Components = useComponentContext()\n const { t } = useTranslation('Company.PaySchedule')\n const dateFormatter = useDateFormatter()\n const { payPeriodPreview, mode, payPreviewLoading } = usePaySchedule()\n const { setValue } = useFormContext<PayScheduleInputs>()\n const [selectedPayPeriodIndex, setSelectedPayPeriodIndex] = useState<number>(0)\n\n const frequency = useWatch({ name: 'frequency' })\n const customTwicePerMonth = useWatch({ name: 'customTwicePerMonth' })\n\n const shouldShowDay1 =\n (frequency === 'Twice per month' && customTwicePerMonth === 'custom') || frequency === 'Monthly'\n const shouldShowDay2 = frequency === 'Twice per month' && customTwicePerMonth === 'custom'\n\n useEffect(() => {\n if (frequency === 'Twice per month' && customTwicePerMonth === '1st15th') {\n setValue('day1', 15)\n setValue('day2', 31)\n }\n }, [frequency, customTwicePerMonth, setValue])\n\n if (mode !== 'EDIT_PAY_SCHEDULE' && mode !== 'ADD_PAY_SCHEDULE') {\n return null\n }\n\n return (\n <div className={style.payScheduleContainer}>\n <Grid gap={32} gridTemplateColumns={{ base: '1fr', small: '1fr 1fr' }}>\n <div className={style.payScheduleForm}>\n <Flex flexDirection={'column'}>\n <TextInputField name=\"customName\" label={t('labels.name')} isRequired />\n <SelectField\n name=\"frequency\"\n label={t('labels.frequency')}\n options={[\n { value: 'Every week', label: t('frequencies.everyWeek') },\n { value: 'Every other week', label: t('frequencies.everyOtherWeek') },\n { value: 'Twice per month', label: t('frequencies.twicePerMonth') },\n { value: 'Monthly', label: t('frequencies.monthly') },\n ]}\n isRequired\n />\n {frequency === 'Twice per month' && (\n <RadioGroupField\n name=\"customTwicePerMonth\"\n label={t('labels.frequencyOptions')}\n description={t('descriptions.frequencyOptionsDescription')}\n options={[\n { value: '1st15th', label: t('frequencyOptions.15thAndLast') },\n { value: 'custom', label: t('frequencyOptions.custom') },\n ]}\n />\n )}\n <DatePickerField\n name=\"anchorPayDate\"\n label={t('labels.firstPayDate')}\n description={t('descriptions.anchorPayDateDescription')}\n isRequired\n />\n <DatePickerField\n name=\"anchorEndOfPayPeriod\"\n label={t('labels.firstPayPeriodEndDate')}\n description={t('descriptions.anchorEndOfPayPeriodDescription')}\n isRequired\n />\n <div className={shouldShowDay1 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day1\" label={t('labels.firstPayDayOfTheMonth')} isRequired />\n </div>\n <div className={shouldShowDay2 ? '' : style.visuallyHidden}>\n <NumberInputField name=\"day2\" label={t('labels.lastPayDayOfTheMonth')} isRequired />\n </div>\n </Flex>\n </div>\n <Flex flexDirection=\"column\" gap={4} justifyContent=\"center\" alignItems=\"center\">\n {payPeriodPreview && payPeriodPreview[selectedPayPeriodIndex] ? (\n <div className={style.calendarContainer}>\n {!payPreviewLoading && (\n <Components.Select\n label={t('labels.preview')}\n isRequired\n options={payPeriodPreview.map((period, index) => {\n return {\n value: String(index),\n label: dateFormatter.formatPayPeriodRange(period.startDate, period.endDate),\n }\n })}\n value={String(selectedPayPeriodIndex)}\n onChange={(value: string) => {\n const numericValue = Number(value)\n if (!isNaN(numericValue)) {\n setSelectedPayPeriodIndex(numericValue)\n }\n }}\n />\n )}\n <Components.CalendarPreview\n key={selectedPayPeriodIndex}\n dateRange={{\n start: new Date(payPeriodPreview[selectedPayPeriodIndex].startDate as string),\n end: new Date(payPeriodPreview[selectedPayPeriodIndex].endDate as string),\n label: t('payPreview.payPeriod') || 'Pay Period',\n }}\n highlightDates={[\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].checkDate as string),\n highlightColor: 'primary',\n label: t('payPreview.payday') || 'Payday',\n },\n {\n date: new Date(payPeriodPreview[selectedPayPeriodIndex].runPayrollBy as string),\n highlightColor: 'secondary',\n label: t('payPreview.payrollDeadline') || 'Payroll Deadline',\n },\n ]}\n />\n </div>\n ) : (\n <div className={style.calendarContainer}>\n <Components.Alert\n status=\"info\"\n label={t('previewAlert.title', 'Pay Schedule Preview')}\n >\n <Components.Text>\n {t(\n 'previewAlert.description',\n 'Complete all the required fields on the left to see a preview of your pay schedule.',\n )}\n </Components.Text>\n </Components.Alert>\n </div>\n )}\n </Flex>\n </Grid>\n </div>\n )\n}\n"],"names":["Edit","Components","useComponentContext","t","useTranslation","dateFormatter","useDateFormatter","payPeriodPreview","mode","payPreviewLoading","usePaySchedule","setValue","useFormContext","selectedPayPeriodIndex","setSelectedPayPeriodIndex","useState","frequency","useWatch","customTwicePerMonth","shouldShowDay1","shouldShowDay2","useEffect","jsx","style","jsxs","Grid","Flex","TextInputField","SelectField","RadioGroupField","DatePickerField","NumberInputField","period","index","value","numericValue"],"mappings":";;;;;;;;;;;;;;;AAkBO,MAAMA,IAAO,MAAM;AACxB,QAAMC,IAAaC,EAAA,GACb,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5CC,IAAgBC,EAAA,GAChB,EAAE,kBAAAC,GAAkB,MAAAC,GAAM,mBAAAC,EAAA,IAAsBC,EAAA,GAChD,EAAE,UAAAC,EAAA,IAAaC,EAAA,GACf,CAACC,GAAwBC,CAAyB,IAAIC,EAAiB,CAAC,GAExEC,IAAYC,EAAS,EAAE,MAAM,aAAa,GAC1CC,IAAsBD,EAAS,EAAE,MAAM,uBAAuB,GAE9DE,IACHH,MAAc,q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Base/useBase.js";
8
+ import "@gusto/embedded-api/models/errors/apierror";
9
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
10
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
11
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
12
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
8
13
  import "../../../shared/constants.js";
9
14
  import "classnames";
10
15
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
11
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
12
- import "@gusto/embedded-api/models/errors/httpclienterrors";
13
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
16
+ import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
17
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
15
- const s = o.object({
18
+ const f = o.object({
16
19
  frequency: o.enum(["Every week", "Every other week", "Twice per month", "Monthly"]),
17
20
  anchorPayDate: o.date().optional(),
18
21
  anchorEndOfPayPeriod: o.date().optional(),
@@ -20,10 +23,10 @@ const s = o.object({
20
23
  day2: o.number().min(1).max(31).optional(),
21
24
  customName: o.string().optional(),
22
25
  customTwicePerMonth: o.string().optional()
23
- }), [x, S] = t("PayScheduleContext");
26
+ }), [w, b] = t("PayScheduleContext");
24
27
  export {
25
- S as PayScheduleProvider,
26
- s as PayScheduleSchema,
27
- x as usePaySchedule
28
+ b as PayScheduleProvider,
29
+ f as PayScheduleSchema,
30
+ w as usePaySchedule
28
31
  };
29
32
  //# sourceMappingURL=usePaySchedule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AA2BO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAA,EAAO,SAAA;AAAA,EACxB,sBAAsBA,EAAE,KAAA,EAAO,SAAA;AAAA,EAC/B,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,qBAAqBA,EAAE,OAAA,EAAS,SAAA;AAClC,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
1
+ {"version":3,"file":"usePaySchedule.js","sources":["../../../../src/components/Company/PaySchedule/usePaySchedule.ts"],"sourcesContent":["import type { PayScheduleCreateUpdate } from '@gusto/embedded-api/models/components/payschedulecreateupdate'\nimport type { PayScheduleList } from '@gusto/embedded-api/models/components/payschedulelist'\nimport type { PayScheduleObject as PayScheduleType } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayPeriods } from '@gusto/embedded-api/models/operations/getv1companiescompanyidpayschedulespreview'\nimport { z } from 'zod'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\nimport { createCompoundContext } from '@/components/Base'\n\nexport type MODE =\n | 'LIST_PAY_SCHEDULES'\n | 'ADD_PAY_SCHEDULE'\n | 'EDIT_PAY_SCHEDULE'\n | 'PREVIEW_PAY_SCHEDULE'\n\ntype PayScheduleContextType = {\n companyId: string\n handleAdd: () => void\n handleEdit: (schedule: PayScheduleType) => void\n handleCancel: () => void\n handleContinue: () => void\n mode: MODE\n paySchedules: PayScheduleList[] | undefined | null\n currentPaySchedule: PayScheduleType | undefined | null\n payPeriodPreview?: PayPeriods[]\n payPreviewLoading?: boolean\n}\n\nexport const PayScheduleSchema = z.object({\n frequency: z.enum(['Every week', 'Every other week', 'Twice per month', 'Monthly']),\n anchorPayDate: z.date().optional(),\n anchorEndOfPayPeriod: z.date().optional(),\n day1: z.number().min(1).max(31).optional(),\n day2: z.number().min(1).max(31).optional(),\n customName: z.string().optional(),\n customTwicePerMonth: z.string().optional(),\n})\n\nexport type PayScheduleInputs = z.input<typeof PayScheduleSchema>\nexport type PayScheduleOutputs = z.output<typeof PayScheduleSchema>\n\nexport type PayScheduleDefaultValues = RequireAtLeastOne<\n Partial<\n Pick<\n PayScheduleCreateUpdate,\n 'anchorPayDate' | 'anchorEndOfPayPeriod' | 'day1' | 'day2' | 'customName' | 'frequency'\n >\n >\n>\n\nconst [usePaySchedule, PayScheduleProvider] =\n createCompoundContext<PayScheduleContextType>('PayScheduleContext')\nexport { usePaySchedule, PayScheduleProvider }\n"],"names":["PayScheduleSchema","z","usePaySchedule","PayScheduleProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AA2BO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,WAAWA,EAAE,KAAK,CAAC,cAAc,oBAAoB,mBAAmB,SAAS,CAAC;AAAA,EAClF,eAAeA,EAAE,KAAA,EAAO,SAAA;AAAA,EACxB,sBAAsBA,EAAE,KAAA,EAAO,SAAA;AAAA,EAC/B,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,MAAMA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,SAAA;AAAA,EAChC,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,qBAAqBA,EAAE,OAAA,EAAS,SAAA;AAClC,CAAC,GAcK,CAACC,GAAgBC,CAAmB,IACxCC,EAA8C,oBAAoB;"}
@@ -4,16 +4,19 @@ import "react-error-boundary";
4
4
  import "react-i18next";
5
5
  import "@tanstack/react-query";
6
6
  import "../../../Base/useBase.js";
7
+ import "@gusto/embedded-api/models/errors/apierror";
8
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
11
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
7
12
  import "../../../../shared/constants.js";
8
13
  import "classnames";
9
14
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
11
- import "@gusto/embedded-api/models/errors/httpclienterrors";
12
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
15
+ import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
13
16
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
14
- const [T, c] = t("StateTaxesFormContext");
17
+ const [u, f] = t("StateTaxesFormContext");
15
18
  export {
16
- c as StateTaxesFormProvider,
17
- T as useStateTaxesForm
19
+ f as StateTaxesFormProvider,
20
+ u as useStateTaxesForm
18
21
  };
19
22
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
@@ -4,16 +4,19 @@ import "react-error-boundary";
4
4
  import "react-i18next";
5
5
  import "@tanstack/react-query";
6
6
  import "../../../Base/useBase.js";
7
+ import "@gusto/embedded-api/models/errors/apierror";
8
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
11
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
7
12
  import "../../../../shared/constants.js";
8
13
  import "classnames";
9
14
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
11
- import "@gusto/embedded-api/models/errors/httpclienterrors";
12
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
15
+ import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
13
16
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
14
- const [T, c] = t("StateTaxesListContext");
17
+ const [u, f] = t("StateTaxesListContext");
15
18
  export {
16
- c as StateTaxesListProvider,
17
- T as useStateTaxesList
19
+ f as StateTaxesListProvider,
20
+ u as useStateTaxesList
18
21
  };
19
22
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { ResponseBody } from '@gusto/embedded-api/models/operations/getv1companiescompanyuuidtaxrequirements'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: ResponseBody[]\n handleContinue: () => void\n handleChange: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
@@ -1,15 +1,14 @@
1
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
- import { useTranslation as s } from "react-i18next";
1
+ import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
+ import { useTranslation as i } from "react-i18next";
3
3
  import { STATES_ABBR as o } from "../../../shared/constants.js";
4
4
  import { Grid as l } from "../../Common/Grid/Grid.js";
5
- import "classnames";
6
5
  import { TextInputField as t } from "../../Common/Fields/TextInputField/TextInputField.js";
7
6
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
8
7
  import "react";
9
8
  import { SelectField as m } from "../../Common/Fields/SelectField/SelectField.js";
10
- function T() {
11
- const { t: e } = s("Contractor.Address");
12
- return /* @__PURE__ */ i(l, { gridTemplateColumns: { base: "1fr", small: ["1fr", "1fr"] }, gap: 20, children: [
9
+ function R() {
10
+ const { t: e } = i("Contractor.Address");
11
+ return /* @__PURE__ */ s(l, { gridTemplateColumns: { base: "1fr", small: ["1fr", "1fr"] }, gap: 20, children: [
13
12
  /* @__PURE__ */ r(
14
13
  t,
15
14
  {
@@ -47,6 +46,6 @@ function T() {
47
46
  ] });
48
47
  }
49
48
  export {
50
- T as Form
49
+ R as Form
51
50
  };
52
51
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sources":["../../../../src/components/Contractor/Address/Form.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { TextInputField, SelectField, Grid } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\n\nexport function Form() {\n const { t } = useTranslation('Contractor.Address')\n\n return (\n <Grid gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }} gap={20}>\n <TextInputField\n name=\"street1\"\n label={t('street1')}\n isRequired\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2')} />\n <TextInputField\n name=\"city\"\n label={t('city')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map(stateAbbr => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common', defaultValue: stateAbbr }),\n value: stateAbbr,\n }))}\n label={t('state')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField name=\"zip\" label={t('zip')} isRequired errorMessage={t('validations.zip')} />\n </Grid>\n )\n}\n"],"names":["Form","t","useTranslation","jsxs","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr"],"mappings":";;;;;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB;AAEjD,SACE,gBAAAC,EAACC,GAAA,EAAK,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAA,GAAK,KAAK,IACtE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,SAAS;AAAA,QAClB,YAAU;AAAA,QACV,cAAcA,EAAE,qBAAqB;AAAA,MAAA;AAAA,IAAA;AAAA,sBAEtCK,GAAA,EAAe,MAAK,WAAU,OAAOL,EAAE,SAAS,GAAG;AAAA,IACpD,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,MAAM;AAAA,QACf,YAAU;AAAA,QACV,cAAcA,EAAE,kBAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEpC,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAASC,EAAY,IAAI,CAAAC,OAAc;AAAA,UACrC,OAAOR,EAAE,cAAcQ,CAAS,IAAI,EAAE,IAAI,UAAU,cAAcA,GAAW;AAAA,UAC7E,OAAOA;AAAA,QAAA,EACP;AAAA,QACF,OAAOR,EAAE,OAAO;AAAA,QAChB,aAAaA,EAAE,kBAAkB;AAAA,QACjC,cAAcA,EAAE,mBAAmB;AAAA,QACnC,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAI,EAACC,GAAA,EAAe,MAAK,OAAM,OAAOL,EAAE,KAAK,GAAG,YAAU,IAAC,cAAcA,EAAE,iBAAiB,EAAA,CAAG;AAAA,EAAA,GAC7F;AAEJ;"}
1
+ {"version":3,"file":"Form.js","sources":["../../../../src/components/Contractor/Address/Form.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { TextInputField, SelectField, Grid } from '@/components/Common'\nimport { STATES_ABBR } from '@/shared/constants'\n\nexport function Form() {\n const { t } = useTranslation('Contractor.Address')\n\n return (\n <Grid gridTemplateColumns={{ base: '1fr', small: ['1fr', '1fr'] }} gap={20}>\n <TextInputField\n name=\"street1\"\n label={t('street1')}\n isRequired\n errorMessage={t('validations.street1')}\n />\n <TextInputField name=\"street2\" label={t('street2')} />\n <TextInputField\n name=\"city\"\n label={t('city')}\n isRequired\n errorMessage={t('validations.city')}\n />\n <SelectField\n name=\"state\"\n options={STATES_ABBR.map(stateAbbr => ({\n label: t(`statesHash.${stateAbbr}`, { ns: 'common', defaultValue: stateAbbr }),\n value: stateAbbr,\n }))}\n label={t('state')}\n placeholder={t('statePlaceholder')}\n errorMessage={t('validations.state')}\n isRequired\n />\n <TextInputField name=\"zip\" label={t('zip')} isRequired errorMessage={t('validations.zip')} />\n </Grid>\n )\n}\n"],"names":["Form","t","useTranslation","jsxs","Grid","jsx","TextInputField","SelectField","STATES_ABBR","stateAbbr"],"mappings":";;;;;;;;AAIO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB;AAEjD,SACE,gBAAAC,EAACC,GAAA,EAAK,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,OAAO,KAAK,EAAA,GAAK,KAAK,IACtE,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,SAAS;AAAA,QAClB,YAAU;AAAA,QACV,cAAcA,EAAE,qBAAqB;AAAA,MAAA;AAAA,IAAA;AAAA,sBAEtCK,GAAA,EAAe,MAAK,WAAU,OAAOL,EAAE,SAAS,GAAG;AAAA,IACpD,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,MAAM;AAAA,QACf,YAAU;AAAA,QACV,cAAcA,EAAE,kBAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,IAEpC,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,SAASC,EAAY,IAAI,CAAAC,OAAc;AAAA,UACrC,OAAOR,EAAE,cAAcQ,CAAS,IAAI,EAAE,IAAI,UAAU,cAAcA,GAAW;AAAA,UAC7E,OAAOA;AAAA,QAAA,EACP;AAAA,QACF,OAAOR,EAAE,OAAO;AAAA,QAChB,aAAaA,EAAE,kBAAkB;AAAA,QACjC,cAAcA,EAAE,mBAAmB;AAAA,QACnC,YAAU;AAAA,MAAA;AAAA,IAAA;AAAA,IAEZ,gBAAAI,EAACC,GAAA,EAAe,MAAK,OAAM,OAAOL,EAAE,KAAK,GAAG,YAAU,IAAC,cAAcA,EAAE,iBAAiB,EAAA,CAAG;AAAA,EAAA,GAC7F;AAEJ;"}
@@ -5,25 +5,28 @@ import "react-error-boundary";
5
5
  import "react-i18next";
6
6
  import "@tanstack/react-query";
7
7
  import "../../Base/useBase.js";
8
+ import "@gusto/embedded-api/models/errors/apierror";
9
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
10
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
11
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
12
+ import "@gusto/embedded-api/models/errors/httpclienterrors";
8
13
  import "../../../shared/constants.js";
9
14
  import "classnames";
10
15
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
11
- import "@gusto/embedded-api/models/errors/gustoembeddederror";
12
- import "@gusto/embedded-api/models/errors/httpclienterrors";
13
- import "@gusto/embedded-api/models/errors/sdkvalidationerror";
16
+ import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
17
  import { createCompoundContext as r } from "../../Base/createCompoundContext.js";
15
- const f = t.object({
18
+ const b = t.object({
16
19
  street1: t.string().min(1),
17
20
  street2: t.string().optional(),
18
21
  city: t.string().min(1),
19
22
  state: t.string().min(1),
20
23
  zip: t.string().min(1)
21
- }), [u, z] = r(
24
+ }), [h, j] = r(
22
25
  "ContractorAddressContext"
23
26
  );
24
27
  export {
25
- f as AddressFormSchema,
26
- z as AddressProvider,
27
- u as useAddress
28
+ b as AddressFormSchema,
29
+ j as AddressProvider,
30
+ h as useAddress
28
31
  };
29
32
  //# sourceMappingURL=useAddress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAddress.js","sources":["../../../../src/components/Contractor/Address/useAddress.ts"],"sourcesContent":["import type { Contractor, ContractorType } from '@gusto/embedded-api/models/components/contractor'\nimport type { ContractorAddress } from '@gusto/embedded-api/models/components/contractoraddress'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport interface AddressContextType {\n contractor?: Contractor\n contractorType?: ContractorType\n address?: ContractorAddress\n isPending: boolean\n}\n\nexport type AddressDefaultValues = RequireAtLeastOne<\n Pick<ContractorAddress, 'street1' | 'street2' | 'city' | 'state' | 'zip'>\n>\n\nexport const AddressFormSchema = z.object({\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: z.string().min(1),\n})\n\nexport type AddressFormValues = z.infer<typeof AddressFormSchema>\n\nconst [useAddress, AddressProvider] = createCompoundContext<AddressContextType>(\n 'ContractorAddressContext',\n)\n\nexport { useAddress, AddressProvider }\n"],"names":["AddressFormSchema","z","useAddress","AddressProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAiBO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAA,EAAS,SAAA;AAAA,EACpB,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKA,EAAE,OAAA,EAAS,IAAI,CAAC;AACvB,CAAC,GAIK,CAACC,GAAYC,CAAe,IAAIC;AAAA,EACpC;AACF;"}
1
+ {"version":3,"file":"useAddress.js","sources":["../../../../src/components/Contractor/Address/useAddress.ts"],"sourcesContent":["import type { Contractor, ContractorType } from '@gusto/embedded-api/models/components/contractor'\nimport type { ContractorAddress } from '@gusto/embedded-api/models/components/contractoraddress'\nimport { z } from 'zod'\nimport { createCompoundContext } from '@/components/Base'\nimport type { RequireAtLeastOne } from '@/types/Helpers'\n\nexport interface AddressContextType {\n contractor?: Contractor\n contractorType?: ContractorType\n address?: ContractorAddress\n isPending: boolean\n}\n\nexport type AddressDefaultValues = RequireAtLeastOne<\n Pick<ContractorAddress, 'street1' | 'street2' | 'city' | 'state' | 'zip'>\n>\n\nexport const AddressFormSchema = z.object({\n street1: z.string().min(1),\n street2: z.string().optional(),\n city: z.string().min(1),\n state: z.string().min(1),\n zip: z.string().min(1),\n})\n\nexport type AddressFormValues = z.infer<typeof AddressFormSchema>\n\nconst [useAddress, AddressProvider] = createCompoundContext<AddressContextType>(\n 'ContractorAddressContext',\n)\n\nexport { useAddress, AddressProvider }\n"],"names":["AddressFormSchema","z","useAddress","AddressProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAiBO,MAAMA,IAAoBC,EAAE,OAAO;AAAA,EACxC,SAASA,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB,SAASA,EAAE,OAAA,EAAS,SAAA;AAAA,EACpB,MAAMA,EAAE,SAAS,IAAI,CAAC;AAAA,EACtB,OAAOA,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,KAAKA,EAAE,OAAA,EAAS,IAAI,CAAC;AACvB,CAAC,GAIK,CAACC,GAAYC,CAAe,IAAIC;AAAA,EACpC;AACF;"}
@@ -5,14 +5,13 @@ import { useTranslation as R } from "react-i18next";
5
5
  import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
6
  import { Flex as i } from "../../../Common/Flex/Flex.js";
7
7
  import { Grid as T } from "../../../Common/Grid/Grid.js";
8
- import "classnames";
9
8
  import { RadioGroupField as I } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
10
9
  import { ActionsLayout as A } from "../../../Common/ActionsLayout/ActionsLayout.js";
11
10
  import { NumberInputField as c } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
12
11
  import { Form as E } from "../../../Common/Form/Form.js";
13
12
  import { useI18n as H } from "../../../../i18n/I18n.js";
14
13
  import j from "../../../../hooks/useNumberFormatter.js";
15
- const Z = ({
14
+ const Y = ({
16
15
  isOpen: h,
17
16
  onClose: m,
18
17
  formMethods: r,
@@ -140,6 +139,6 @@ const Z = ({
140
139
  );
141
140
  };
142
141
  export {
143
- Z as EditContractorPaymentPresentation
142
+ Y as EditContractorPaymentPresentation
144
143
  };
145
144
  //# sourceMappingURL=EditContractorPaymentPresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditContractorPaymentPresentation.js","sources":["../../../../../src/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { FormProvider, useWatch, type UseFormReturn } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { EditContractorPaymentFormValues } from './EditContractorPaymentFormSchema'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ActionsLayout, Flex, Grid, NumberInputField, RadioGroupField } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { useI18n } from '@/i18n'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport type { RadioGroupOption } from '@/index'\n\ninterface EditContractorPaymentPresentationProps {\n isOpen: boolean\n onClose: () => void\n formMethods: UseFormReturn<EditContractorPaymentFormValues>\n onSubmit: (data: EditContractorPaymentFormValues) => void\n contractorPaymentMethod?: string\n}\n\nexport const EditContractorPaymentPresentation = ({\n isOpen,\n onClose,\n formMethods,\n onSubmit,\n contractorPaymentMethod,\n}: EditContractorPaymentPresentationProps) => {\n const formId = useId()\n useI18n('Contractor.Payments.CreatePayment')\n const { t } = useTranslation('Contractor.Payments.CreatePayment', {\n keyPrefix: 'editContractorPayment',\n })\n const { Modal, Button, Text, Heading } = useComponentContext()\n const currencyFormatter = useNumberFormatter('currency')\n\n const wageType = useWatch<EditContractorPaymentFormValues, 'wageType'>({\n name: 'wageType',\n control: formMethods.control,\n })\n const hours = useWatch<EditContractorPaymentFormValues, 'hours'>({\n name: 'hours',\n control: formMethods.control,\n })\n const wage = useWatch<EditContractorPaymentFormValues, 'wage'>({\n name: 'wage',\n control: formMethods.control,\n })\n const bonus = useWatch<EditContractorPaymentFormValues, 'bonus'>({\n name: 'bonus',\n control: formMethods.control,\n })\n const reimbursement = useWatch<EditContractorPaymentFormValues, 'reimbursement'>({\n name: 'reimbursement',\n control: formMethods.control,\n })\n const hourlyRate = useWatch<EditContractorPaymentFormValues, 'hourlyRate'>({\n name: 'hourlyRate',\n control: formMethods.control,\n })\n\n const totalAmount =\n (wageType === 'Fixed' ? 0 : bonus || 0) +\n (reimbursement || 0) +\n (wage || 0) +\n (hours || 0) * (hourlyRate || 0)\n\n const isDirectDepositDisabled = contractorPaymentMethod === 'Check'\n\n const paymentMethodOptions: RadioGroupOption[] = [\n { value: 'Check', label: t('paymentMethods.check') },\n {\n value: 'Direct Deposit',\n label: t('paymentMethods.directDeposit'),\n isDisabled: isDirectDepositDisabled,\n },\n // { value: 'Historical Payment', label: t('paymentMethods.historicalPayment') },\n ]\n\n return (\n <Modal\n isOpen={isOpen}\n onClose={onClose}\n footer={\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onClose}>\n {t('cancelCta')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={formId}\n onClick={() => formMethods.handleSubmit(onSubmit)}\n >\n {t('saveCta')}\n </Button>\n </ActionsLayout>\n }\n >\n <FormProvider {...formMethods}>\n <Form id={formId} onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text>{t('subtitle')}</Text>\n <Text weight=\"bold\">\n {t('totalPay')}: {currencyFormatter(totalAmount)}\n </Text>\n </Flex>\n\n {wageType === 'Hourly' && (\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h3\">{t('hoursSection')}</Heading>\n <NumberInputField\n min={0}\n name=\"hours\"\n isRequired\n label={t('hoursLabel')}\n adornmentEnd={t('hoursAdornment')}\n />\n </Flex>\n )}\n\n {wageType === 'Fixed' && (\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h3\">{t('fixedPaySection')}</Heading>\n <NumberInputField\n min={0}\n name=\"wage\"\n isRequired\n label={t('wageLabel')}\n format=\"currency\"\n />\n </Flex>\n )}\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h3\">{t('additionalEarningsSection')}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [200, 200] }} gap={16}>\n {wageType === 'Hourly' && (\n <NumberInputField\n min={0}\n name=\"bonus\"\n label={t('bonusLabel')}\n format=\"currency\"\n />\n )}\n <NumberInputField\n min={0}\n name=\"reimbursement\"\n label={t('reimbursementLabel')}\n format=\"currency\"\n />\n </Grid>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={16}>\n <RadioGroupField\n name=\"paymentMethod\"\n options={paymentMethodOptions}\n label={t('paymentMethodLabel')}\n />\n </Flex>\n </Flex>\n </Form>\n </FormProvider>\n </Modal>\n )\n}\n"],"names":["EditContractorPaymentPresentation","isOpen","onClose","formMethods","onSubmit","contractorPaymentMethod","formId","useId","useI18n","t","useTranslation","Modal","Button","Text","Heading","useComponentContext","currencyFormatter","useNumberFormatter","wageType","useWatch","hours","wage","bonus","reimbursement","hourlyRate","totalAmount","isDirectDepositDisabled","paymentMethodOptions","jsx","ActionsLayout","FormProvider","Form","jsxs","Flex","NumberInputField","Grid","RadioGroupField"],"mappings":";;;;;;;;;;;;;;AAmBO,MAAMA,IAAoC,CAAC;AAAA,EAChD,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,yBAAAC;AACF,MAA8C;AAC5C,QAAMC,IAASC,EAAA;AACf,EAAAC,EAAQ,mCAAmC;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qCAAqC;AAAA,IAChE,WAAW;AAAA,EAAA,CACZ,GACK,EAAE,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA,GACnCC,IAAoBC,EAAmB,UAAU,GAEjDC,IAAWC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ACF;AAAA,QAGF,gBAAAuB,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,UAAA,gBAAAL,EAACd,GAAA,EAAQ,IAAG,MAAM,UAAAL,EAAE,2BAA2B,GAAE;AAAA,UACjD,gBAAAuB,EAACG,GAAA,EAAK,qBAAqB,EAAE,MAAM,OAAO,OAAO,CAAC,KAAK,GAAG,EAAA,GAAK,KAAK,IACjE,UAAA;AAAA,YAAAjB,MAAa,YACZ,gBAAAU;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,KAAK;AAAA,gBACL,MAAK;AAAA,gBACL,OAAOzB,EAAE,YAAY;AAAA,gBACrB,QAAO;AAAA,cAAA;AAAA,YAAA;AAAA,YAGX,gBAAAmB;AAAA,cAACM;AAAA,cAAA;AAAA,gBACC,KAAK;AAAA,gBACL,MAAK;AAAA,gBACL,OAAOzB,EAAE,oBAAoB;AAAA,gBAC7B,QAAO;AAAA,cAAA;AAAA,YAAA;AAAA,UACT,EAAA,CACF;AAAA,QAAA,GACF;AAAA,QAEA,gBAAAmB,EAACK,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAL;AAAA,UAACQ;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAST;AAAA,YACT,OAAOlB,EAAE,oBAAoB;AAAA,UAAA;AAAA,QAAA,EAC/B,CACF;AAAA,MAAA,EAAA,CACF,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"EditContractorPaymentPresentation.js","sources":["../../../../../src/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.tsx"],"sourcesContent":["import { useId } from 'react'\nimport { FormProvider, useWatch, type UseFormReturn } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { EditContractorPaymentFormValues } from './EditContractorPaymentFormSchema'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ActionsLayout, Flex, Grid, NumberInputField, RadioGroupField } from '@/components/Common'\nimport { Form } from '@/components/Common/Form'\nimport { useI18n } from '@/i18n'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport type { RadioGroupOption } from '@/index'\n\ninterface EditContractorPaymentPresentationProps {\n isOpen: boolean\n onClose: () => void\n formMethods: UseFormReturn<EditContractorPaymentFormValues>\n onSubmit: (data: EditContractorPaymentFormValues) => void\n contractorPaymentMethod?: string\n}\n\nexport const EditContractorPaymentPresentation = ({\n isOpen,\n onClose,\n formMethods,\n onSubmit,\n contractorPaymentMethod,\n}: EditContractorPaymentPresentationProps) => {\n const formId = useId()\n useI18n('Contractor.Payments.CreatePayment')\n const { t } = useTranslation('Contractor.Payments.CreatePayment', {\n keyPrefix: 'editContractorPayment',\n })\n const { Modal, Button, Text, Heading } = useComponentContext()\n const currencyFormatter = useNumberFormatter('currency')\n\n const wageType = useWatch<EditContractorPaymentFormValues, 'wageType'>({\n name: 'wageType',\n control: formMethods.control,\n })\n const hours = useWatch<EditContractorPaymentFormValues, 'hours'>({\n name: 'hours',\n control: formMethods.control,\n })\n const wage = useWatch<EditContractorPaymentFormValues, 'wage'>({\n name: 'wage',\n control: formMethods.control,\n })\n const bonus = useWatch<EditContractorPaymentFormValues, 'bonus'>({\n name: 'bonus',\n control: formMethods.control,\n })\n const reimbursement = useWatch<EditContractorPaymentFormValues, 'reimbursement'>({\n name: 'reimbursement',\n control: formMethods.control,\n })\n const hourlyRate = useWatch<EditContractorPaymentFormValues, 'hourlyRate'>({\n name: 'hourlyRate',\n control: formMethods.control,\n })\n\n const totalAmount =\n (wageType === 'Fixed' ? 0 : bonus || 0) +\n (reimbursement || 0) +\n (wage || 0) +\n (hours || 0) * (hourlyRate || 0)\n\n const isDirectDepositDisabled = contractorPaymentMethod === 'Check'\n\n const paymentMethodOptions: RadioGroupOption[] = [\n { value: 'Check', label: t('paymentMethods.check') },\n {\n value: 'Direct Deposit',\n label: t('paymentMethods.directDeposit'),\n isDisabled: isDirectDepositDisabled,\n },\n // { value: 'Historical Payment', label: t('paymentMethods.historicalPayment') },\n ]\n\n return (\n <Modal\n isOpen={isOpen}\n onClose={onClose}\n footer={\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onClose}>\n {t('cancelCta')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={formId}\n onClick={() => formMethods.handleSubmit(onSubmit)}\n >\n {t('saveCta')}\n </Button>\n </ActionsLayout>\n }\n >\n <FormProvider {...formMethods}>\n <Form id={formId} onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n <Text>{t('subtitle')}</Text>\n <Text weight=\"bold\">\n {t('totalPay')}: {currencyFormatter(totalAmount)}\n </Text>\n </Flex>\n\n {wageType === 'Hourly' && (\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h3\">{t('hoursSection')}</Heading>\n <NumberInputField\n min={0}\n name=\"hours\"\n isRequired\n label={t('hoursLabel')}\n adornmentEnd={t('hoursAdornment')}\n />\n </Flex>\n )}\n\n {wageType === 'Fixed' && (\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h3\">{t('fixedPaySection')}</Heading>\n <NumberInputField\n min={0}\n name=\"wage\"\n isRequired\n label={t('wageLabel')}\n format=\"currency\"\n />\n </Flex>\n )}\n\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h3\">{t('additionalEarningsSection')}</Heading>\n <Grid gridTemplateColumns={{ base: '1fr', small: [200, 200] }} gap={16}>\n {wageType === 'Hourly' && (\n <NumberInputField\n min={0}\n name=\"bonus\"\n label={t('bonusLabel')}\n format=\"currency\"\n />\n )}\n <NumberInputField\n min={0}\n name=\"reimbursement\"\n label={t('reimbursementLabel')}\n format=\"currency\"\n />\n </Grid>\n </Flex>\n\n <Flex flexDirection=\"column\" gap={16}>\n <RadioGroupField\n name=\"paymentMethod\"\n options={paymentMethodOptions}\n label={t('paymentMethodLabel')}\n />\n </Flex>\n </Flex>\n </Form>\n </FormProvider>\n </Modal>\n )\n}\n"],"names":["EditContractorPaymentPresentation","isOpen","onClose","formMethods","onSubmit","contractorPaymentMethod","formId","useId","useI18n","t","useTranslation","Modal","Button","Text","Heading","useComponentContext","currencyFormatter","useNumberFormatter","wageType","useWatch","hours","wage","bonus","reimbursement","hourlyRate","totalAmount","isDirectDepositDisabled","paymentMethodOptions","jsx","ActionsLayout","FormProvider","Form","jsxs","Flex","NumberInputField","Grid","RadioGroupField"],"mappings":";;;;;;;;;;;;;AAmBO,MAAMA,IAAoC,CAAC;AAAA,EAChD,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,yBAAAC;AACF,MAA8C;AAC5C,QAAMC,IAASC,EAAA;AACf,EAAAC,EAAQ,mCAAmC;AAC3C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qCAAqC;AAAA,IAChE,WAAW;AAAA,EAAA,CACZ,GACK,EAAE,OAAAC,GAAO,QAAAC,GAAQ,MAAAC,GAAM,SAAAC,EAAA,IAAYC,EAAA,GACnCC,IAAoBC,EAAmB,UAAU,GAEjDC,IAAWC,EAAsD;AAAA,IACrE,MAAM;AAAA,IACN,SAAShB,EAAY;AAAA,EAAA,CACtB,GACKiB,IAAQD,EAAmD;AAAA,IAC/D,MAAM;AAAA,IACN,SAAShB,EAAY;AAAA,EAAA,CACtB,GACKkB,IAAOF,EAAkD;AAAA,IAC7D,MAAM;AAAA,IACN,SAAShB,EAAY;AAAA,EAAA,CACtB,GACKmB,IAAQH,EAAmD;AAAA,IAC/D,MAAM;AAAA,IACN,SAAShB,EAAY;AAAA,EAAA,CACtB,GACKoB,IAAgBJ,EAA2D;AAAA,IAC/E,MAAM;AAAA,IACN,SAAShB,EAAY;AAAA,EAAA,CACtB,GACKqB,IAAaL,EAAwD;AAAA,IACzE,MAAM;AAAA,IACN,SAAShB,EAAY;AAAA,EAAA,C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AA,cAAA;AAAA,gBACC,KAAK;AAAA,gBACL,MAAK;AAAA,gBACL,OAAOzB,EAAE,oBAAoB;AAAA,gBAC7B,QAAO;AAAA,cAAA;AAAA,YAAA;AAAA,UACT,EAAA,CACF;AAAA,QAAA,GACF;AAAA,QAEA,gBAAAmB,EAACK,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA,gBAAAL;AAAA,UAACQ;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAAST;AAAA,YACT,OAAOlB,EAAE,oBAAoB;AAAA,UAAA;AAAA,QAAA,EAC/B,CACF;AAAA,MAAA,EAAA,CACF,GACF,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -10,10 +10,15 @@ import "react/jsx-runtime";
10
10
  import "react-error-boundary";
11
11
  import "@tanstack/react-query";
12
12
  import { useBase as Q } from "../../Base/useBase.js";
13
- import { ContractorSelfOnboardingStatuses as Y, componentEvents as b, ContractorOnboardingStatus as x } from "../../../shared/constants.js";
13
+ import "@gusto/embedded-api/models/errors/apierror";
14
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
15
+ import "@gusto/embedded-api/models/errors/sdkvalidationerror";
16
+ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
17
+ import { SDKInternalError as Y } from "../../../types/sdkError.js";
18
+ import { ContractorSelfOnboardingStatuses as x, componentEvents as b, ContractorOnboardingStatus as ee } from "../../../shared/constants.js";
14
19
  import "classnames";
15
20
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
16
- import { SDKInternalError as ee } from "../../../types/sdkError.js";
21
+ import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
17
22
  import { useI18n as oe } from "../../../i18n/I18n.js";
18
23
  import { SSN_REGEX as se, NAME_REGEX as N } from "../../../helpers/validations.js";
19
24
  import { removeNonDigits as ae } from "../../../helpers/formattedStrings.js";
@@ -37,7 +42,7 @@ const i = k, a = J, ie = s.object({
37
42
  ein: s.string().optional(),
38
43
  // Wage fields
39
44
  hourlyRate: s.number().min(0).optional()
40
- }), re = (t, f, m) => ie.superRefine(
45
+ }), re = (t, f, d) => ie.superRefine(
41
46
  (e, n) => {
42
47
  if (e.selfOnboarding && !e.email && n.addIssue({
43
48
  code: s.ZodIssueCode.custom,
@@ -72,7 +77,7 @@ const i = k, a = J, ie = s.object({
72
77
  path: ["businessName"],
73
78
  message: t("validations.businessName")
74
79
  }), !e.ein)
75
- !m && !e.selfOnboarding && n.addIssue({
80
+ !d && !e.selfOnboarding && n.addIssue({
76
81
  code: s.ZodIssueCode.custom,
77
82
  path: ["ein"],
78
83
  message: t("validations.ein")
@@ -92,10 +97,10 @@ const i = k, a = J, ie = s.object({
92
97
  });
93
98
  }
94
99
  );
95
- function Fe({
100
+ function He({
96
101
  companyId: t,
97
102
  contractorId: f,
98
- defaultValues: m,
103
+ defaultValues: d,
99
104
  existingContractor: e
100
105
  }) {
101
106
  oe("Contractor.Profile");
@@ -109,12 +114,12 @@ function Fe({
109
114
  contractorType: a.Business,
110
115
  wageType: i.Fixed,
111
116
  startDate: /* @__PURE__ */ new Date(),
112
- ...m,
117
+ ...d,
113
118
  // Override with existing contractor data if available
114
119
  ...e && {
115
120
  selfOnboarding: e.onboardingStatus ? (
116
121
  // @ts-expect-error: onboarding_status during runtime can be one of self onboarding statuses
117
- Y.has(e.onboardingStatus)
122
+ x.has(e.onboardingStatus)
118
123
  ) : !1,
119
124
  contractorType: e.type || a.Business,
120
125
  wageType: e.wageType || i.Fixed,
@@ -130,12 +135,12 @@ function Fe({
130
135
  })() : void 0
131
136
  }
132
137
  }),
133
- [e, m]
134
- ), d = j({
138
+ [e, d]
139
+ ), m = j({
135
140
  resolver: $(T),
136
141
  defaultValues: D
137
- }), { handleSubmit: E, formState: F } = d, u = v({ control: d.control, name: "contractorType" }), P = v({ control: d.control, name: "wageType" }), y = v({
138
- control: d.control,
142
+ }), { handleSubmit: E, formState: F } = m, u = v({ control: m.control, name: "contractorType" }), P = v({ control: m.control, name: "wageType" }), y = v({
143
+ control: m.control,
139
144
  name: "selfOnboarding"
140
145
  }), I = (o) => {
141
146
  const r = {
@@ -170,7 +175,7 @@ function Fe({
170
175
  let c = e?.uuid;
171
176
  if (e) {
172
177
  if (!e.version)
173
- throw new ee("Contractor version is required for updates");
178
+ throw new Y("Contractor version is required for updates");
174
179
  const h = e.version, p = C(r, h), G = await w({
175
180
  request: {
176
181
  contractorUuid: c,
@@ -188,7 +193,7 @@ function Fe({
188
193
  c = p.contractor?.uuid, l(b.CONTRACTOR_CREATED, p.contractor);
189
194
  }
190
195
  l(b.CONTRACTOR_PROFILE_DONE, {
191
- selfOnboarding: r.selfOnboarding && e?.onboardingStatus !== x.ADMIN_ONBOARDING_REVIEW,
196
+ selfOnboarding: r.selfOnboarding && e?.onboardingStatus !== ee.ADMIN_ONBOARDING_REVIEW,
192
197
  contractorId: c
193
198
  });
194
199
  });
@@ -201,7 +206,7 @@ function Fe({
201
206
  ], z = R || O;
202
207
  return {
203
208
  // Form methods and submission
204
- formMethods: d,
209
+ formMethods: m,
205
210
  handleSubmit: E(B),
206
211
  formState: {
207
212
  ...F,
@@ -225,6 +230,6 @@ export {
225
230
  a as ContractorType,
226
231
  i as WageType,
227
232
  re as createContractorProfileValidationSchema,
228
- Fe as useContractorProfile
233
+ He as useContractorProfile
229
234
  };
230
235
  //# sourceMappingURL=useContractorProfile.js.map