@gusto/embedded-react-sdk 0.32.0 → 0.33.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 (208) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/components/Common/MultiSelectComboBox/MultiSelectComboBox.d.ts +2 -0
  3. package/dist/components/Common/MultiSelectComboBox/MultiSelectComboBoxTypes.d.ts +16 -0
  4. package/dist/components/Common/MultiSelectComboBox/index.d.ts +3 -0
  5. package/dist/components/Common/SignatureForm/SignatureForm.js +11 -12
  6. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  7. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureFormFields.js +2 -2
  9. package/dist/components/Common/UI/Badge/Badge.js +39 -8
  10. package/dist/components/Common/UI/Badge/Badge.js.map +1 -1
  11. package/dist/components/Common/UI/Badge/Badge.module.scss.js +8 -4
  12. package/dist/components/Common/UI/Badge/Badge.module.scss.js.map +1 -1
  13. package/dist/components/Common/UI/Badge/BadgeTypes.d.ts +12 -0
  14. package/dist/components/Common/UI/Badge/BadgeTypes.js.map +1 -1
  15. package/dist/components/Company/AssignSignatory/AssignSignatory.js +1 -1
  16. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +1 -1
  17. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  18. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +17 -16
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -4
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  22. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +6 -5
  24. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -4
  26. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  27. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -6
  28. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  29. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +5 -6
  30. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  31. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -4
  32. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  33. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +5 -6
  34. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  35. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
  36. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  37. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  38. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -2
  39. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  40. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  41. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
  42. package/dist/components/Company/FederalTaxes/Form.js +3 -4
  43. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  44. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +5 -6
  45. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  46. package/dist/components/Company/Industry/Context.js +6 -7
  47. package/dist/components/Company/Industry/Context.js.map +1 -1
  48. package/dist/components/Company/Locations/LocationForm/Form.js +6 -5
  49. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  50. package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -2
  51. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -4
  52. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  53. package/dist/components/Company/Locations/LocationsList/LocationsList.js +2 -2
  54. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -4
  55. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  56. package/dist/components/Company/OnboardingOverview/Completed.js +2 -3
  57. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  58. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +5 -6
  59. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  60. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -2
  61. package/dist/components/Company/OnboardingOverview/context.js +3 -4
  62. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  63. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -2
  64. package/dist/components/Company/PaySchedule/_parts/Edit.js +24 -23
  65. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  66. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
  67. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  68. package/dist/components/Company/PaySchedule/_parts/List.js +11 -12
  69. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  70. package/dist/components/Company/PaySchedule/usePaySchedule.js +5 -6
  71. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  72. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +40 -46
  73. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  74. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -4
  75. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  76. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -4
  77. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  78. package/dist/components/Contractor/Address/Address.js +2 -2
  79. package/dist/components/Contractor/Address/Form.js +8 -7
  80. package/dist/components/Contractor/Address/Form.js.map +1 -1
  81. package/dist/components/Contractor/Address/useAddress.js +5 -6
  82. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  83. package/dist/components/Contractor/ContractorList/index.js +17 -17
  84. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -2
  85. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +1 -1
  86. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +108 -100
  87. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  88. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +4 -1
  89. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +54 -51
  90. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  91. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +13 -12
  92. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  93. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +17 -18
  94. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  95. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +1 -1
  96. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +2 -3
  97. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  98. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +6 -7
  99. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  100. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +2 -3
  101. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  102. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +2 -3
  103. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  104. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  105. package/dist/components/Contractor/Profile/useContractorProfile.js +2 -3
  106. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  107. package/dist/components/Contractor/Submit/Submit.js +1 -1
  108. package/dist/components/Employee/Compensation/Edit.js +14 -14
  109. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +10 -11
  110. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  111. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +11 -12
  112. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  113. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +11 -12
  114. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  115. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +1 -1
  116. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
  117. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  118. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +1 -1
  119. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  120. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  121. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +3 -4
  122. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  123. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +20 -21
  124. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  125. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +7 -7
  126. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +1 -1
  127. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +3 -4
  128. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  129. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +2 -3
  130. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
  131. package/dist/components/Employee/EmployeeList/EmployeeList.js +3 -4
  132. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  133. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  134. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  135. package/dist/components/Employee/EmployeeList/useEmployeeList.js +3 -4
  136. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  137. package/dist/components/Employee/FederalTaxes/FederalForm.js +7 -7
  138. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +3 -4
  139. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  140. package/dist/components/Employee/Landing/Landing.js +8 -8
  141. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  142. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -2
  143. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +1 -1
  144. package/dist/components/Employee/PaymentMethod/Split.js +8 -8
  145. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +5 -6
  146. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  147. package/dist/components/Employee/Profile/AdminPersonalDetails.js +1 -1
  148. package/dist/components/Employee/Profile/HomeAddress.js +10 -9
  149. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  150. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +11 -10
  151. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  152. package/dist/components/Employee/Profile/useProfile.js +3 -4
  153. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  154. package/dist/components/Employee/StateTaxes/useStateTaxes.js +3 -4
  155. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  156. package/dist/components/Employee/Taxes/FederalForm.js +7 -7
  157. package/dist/components/Employee/Taxes/useTaxes.js +3 -4
  158. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  159. package/dist/components/Flow/Flow.js +2 -3
  160. package/dist/components/Flow/Flow.js.map +1 -1
  161. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +16 -16
  162. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  163. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +4 -4
  164. package/dist/components/InformationRequests/InformationRequests.js +1 -1
  165. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +9 -9
  166. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +6 -7
  167. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  168. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +1 -1
  169. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +1 -1
  170. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +2 -3
  171. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  172. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +12 -12
  173. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +22 -18
  174. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  175. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.test.d.ts +1 -0
  176. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +12 -8
  177. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  178. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +39 -38
  179. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  180. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +39 -38
  181. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  182. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +17 -18
  183. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  184. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +38 -35
  185. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  186. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
  187. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  188. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +2 -3
  189. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  190. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +2 -3
  191. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  192. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +3 -2
  193. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  194. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +7 -8
  195. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  196. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +2 -3
  197. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  198. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +1 -1
  199. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +6 -6
  200. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +2 -3
  201. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  202. package/dist/components/Payroll/usePreparedPayrollData.js +2 -3
  203. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  204. package/dist/i18n/en/common.json.d.ts +4 -1
  205. package/dist/i18n/en/common.json.js +5 -5
  206. package/dist/style.css +1 -1
  207. package/dist/types/i18next.d.ts +3 -0
  208. package/package.json +5 -5
@@ -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;"}
@@ -9,13 +9,12 @@ import "../../../Base/useBase.js";
9
9
  import "../../../../shared/constants.js";
10
10
  import "classnames";
11
11
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
- import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
13
12
  import "dompurify";
14
13
  import "../../../../contexts/LocaleProvider/useLocale.js";
15
14
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
16
- const [d, u] = t("StateTaxesListContext");
15
+ const [c, d] = t("StateTaxesListContext");
17
16
  export {
18
- u as StateTaxesListProvider,
19
- d as useStateTaxesList
17
+ d as StateTaxesListProvider,
18
+ c as useStateTaxesList
20
19
  };
21
20
  //# 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;"}
@@ -11,13 +11,13 @@ import { Actions as B } from "./Actions.js";
11
11
  import { Form as N } from "../../Common/Form/Form.js";
12
12
  import { useComponentDictionary as j, useI18n as q } from "../../../i18n/I18n.js";
13
13
  import { Flex as w } from "../../Common/Flex/Flex.js";
14
- import "classnames";
15
- import { contractorEvents as d } from "../../../shared/constants.js";
16
14
  import "react-i18next";
15
+ import "classnames";
17
16
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
18
17
  import "react";
19
18
  import { BaseComponent as G } from "../../Base/Base.js";
20
19
  import { useBase as H } from "../../Base/useBase.js";
20
+ import { contractorEvents as d } from "../../../shared/constants.js";
21
21
  function mt(r) {
22
22
  return /* @__PURE__ */ t(G, { ...r, children: /* @__PURE__ */ t(M, { ...r, children: r.children }) });
23
23
  }
@@ -1,14 +1,15 @@
1
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import { useTranslation as i } from "react-i18next";
1
+ import { jsxs as i, jsx as r } from "react/jsx-runtime";
2
+ import { useTranslation as s } 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 { TextInputField as t } from "../../Common/Fields/TextInputField/TextInputField.js";
5
+ import "classnames";
6
6
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
7
7
  import "react";
8
+ import { TextInputField as t } from "../../Common/Fields/TextInputField/TextInputField.js";
8
9
  import { SelectField as m } from "../../Common/Fields/SelectField/SelectField.js";
9
- function R() {
10
- const { t: e } = i("Contractor.Address");
11
- return /* @__PURE__ */ s(l, { gridTemplateColumns: { base: "1fr", small: ["1fr", "1fr"] }, gap: 20, children: [
10
+ function T() {
11
+ const { t: e } = s("Contractor.Address");
12
+ return /* @__PURE__ */ i(l, { gridTemplateColumns: { base: "1fr", small: ["1fr", "1fr"] }, gap: 20, children: [
12
13
  /* @__PURE__ */ r(
13
14
  t,
14
15
  {
@@ -46,6 +47,6 @@ function R() {
46
47
  ] });
47
48
  }
48
49
  export {
49
- R as Form
50
+ T as Form
50
51
  };
51
52
  //# 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;"}
@@ -10,22 +10,21 @@ import "../../Base/useBase.js";
10
10
  import "../../../shared/constants.js";
11
11
  import "classnames";
12
12
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
- import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
13
  import "dompurify";
15
14
  import "../../../contexts/LocaleProvider/useLocale.js";
16
15
  import { createCompoundContext as r } from "../../Base/createCompoundContext.js";
17
- const z = t.object({
16
+ const u = t.object({
18
17
  street1: t.string().min(1),
19
18
  street2: t.string().optional(),
20
19
  city: t.string().min(1),
21
20
  state: t.string().min(1),
22
21
  zip: t.string().min(1)
23
- }), [b, h] = r(
22
+ }), [z, b] = r(
24
23
  "ContractorAddressContext"
25
24
  );
26
25
  export {
27
- z as AddressFormSchema,
28
- h as AddressProvider,
29
- b as useAddress
26
+ u as AddressFormSchema,
27
+ b as AddressProvider,
28
+ z as useAddress
30
29
  };
31
30
  //# 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;"}
@@ -4,17 +4,17 @@ import { useContractorsDeleteMutation as w } from "@gusto/embedded-api/react-que
4
4
  import { useContractors as H } from "./useContractorList.js";
5
5
  import { Flex as f } from "../../Common/Flex/Flex.js";
6
6
  import "classnames";
7
- import { CONTRACTOR_TYPE as k, componentEvents as m } from "../../../shared/constants.js";
8
- import { EmptyData as U } from "../../Common/EmptyData/EmptyData.js";
7
+ import { EmptyData as k } from "../../Common/EmptyData/EmptyData.js";
9
8
  import { ActionsLayout as h } from "../../Common/ActionsLayout/ActionsLayout.js";
10
- import { HamburgerMenu as j } from "../../Common/HamburgerMenu/HamburgerMenu.js";
11
- import { firstLastName as M } from "../../../helpers/formattedStrings.js";
12
- import V from "../../../assets/icons/pencil.svg.js";
9
+ import { HamburgerMenu as U } from "../../Common/HamburgerMenu/HamburgerMenu.js";
10
+ import { firstLastName as j } from "../../../helpers/formattedStrings.js";
11
+ import M from "../../../assets/icons/pencil.svg.js";
13
12
  import { useComponentContext as u } from "../../../contexts/ComponentAdapter/useComponentContext.js";
14
- import { ContractorOnboardingStatusBadge as F } from "../../Common/OnboardingStatusBadge/index.js";
15
- import { useI18n as q } from "../../../i18n/I18n.js";
16
- import { BaseComponent as G } from "../../Base/Base.js";
17
- import { useBase as Y } from "../../Base/useBase.js";
13
+ import { ContractorOnboardingStatusBadge as V } from "../../Common/OnboardingStatusBadge/index.js";
14
+ import { useI18n as F } from "../../../i18n/I18n.js";
15
+ import { BaseComponent as q } from "../../Base/Base.js";
16
+ import { useBase as G } from "../../Base/useBase.js";
17
+ import { CONTRACTOR_TYPE as Y, componentEvents as m } from "../../../shared/constants.js";
18
18
  import z from "../../../assets/icons/trashcan.svg.js";
19
19
  import { useDataView as J } from "../../Common/DataView/useDataView.js";
20
20
  import { DataView as K } from "../../Common/DataView/DataView.js";
@@ -27,14 +27,14 @@ function Q({ count: o, handleAdd: a }) {
27
27
  }
28
28
  function W({ handleAdd: o }) {
29
29
  const { Button: a } = u(), { t: r } = d("Contractor.ContractorList");
30
- return /* @__PURE__ */ t(U, { title: r("emptyTableTitle"), description: r("emptyTableDescription"), children: /* @__PURE__ */ t(h, { justifyContent: "center", children: /* @__PURE__ */ t(a, { onClick: o, children: r("addContractorCta") }) }) });
30
+ return /* @__PURE__ */ t(k, { title: r("emptyTableTitle"), description: r("emptyTableDescription"), children: /* @__PURE__ */ t(h, { justifyContent: "center", children: /* @__PURE__ */ t(a, { onClick: o, children: r("addContractorCta") }) }) });
31
31
  }
32
32
  function Tt(o) {
33
- return /* @__PURE__ */ t(G, { ...o, children: /* @__PURE__ */ t(X, { ...o, children: o.children }) });
33
+ return /* @__PURE__ */ t(q, { ...o, children: /* @__PURE__ */ t(X, { ...o, children: o.children }) });
34
34
  }
35
35
  function X({ companyId: o, className: a, dictionary: r, successMessage: i }) {
36
- q("Contractor.ContractorList");
37
- const { t: n } = d("Contractor.ContractorList"), { onEvent: s, baseSubmitHandler: g } = Y(), { Alert: T, Button: P } = u(), {
36
+ F("Contractor.ContractorList");
37
+ const { t: n } = d("Contractor.ContractorList"), { onEvent: s, baseSubmitHandler: g } = G(), { Alert: T, Button: P } = u(), {
38
38
  contractors: L,
39
39
  totalCount: C,
40
40
  handleNextPage: N,
@@ -49,12 +49,12 @@ function X({ companyId: o, className: a, dictionary: r, successMessage: i }) {
49
49
  columns: [
50
50
  {
51
51
  title: n("listHeaders.name"),
52
- render: (e) => e.type === k.BUSINESS ? e.businessName : M({ first_name: e.firstName, last_name: e.lastName })
52
+ render: (e) => e.type === Y.BUSINESS ? e.businessName : j({ first_name: e.firstName, last_name: e.lastName })
53
53
  },
54
54
  {
55
55
  title: n("listHeaders.status"),
56
56
  render: ({ onboarded: e, onboardingStatus: c }) => /* @__PURE__ */ t(
57
- F,
57
+ V,
58
58
  {
59
59
  onboarded: e,
60
60
  onboardingStatus: c
@@ -64,12 +64,12 @@ function X({ companyId: o, className: a, dictionary: r, successMessage: i }) {
64
64
  ],
65
65
  data: L,
66
66
  itemMenu: (e) => /* @__PURE__ */ t(
67
- j,
67
+ U,
68
68
  {
69
69
  items: [
70
70
  {
71
71
  label: n("editCta"),
72
- icon: /* @__PURE__ */ t(V, { "aria-hidden": !0 }),
72
+ icon: /* @__PURE__ */ t(M, { "aria-hidden": !0 }),
73
73
  onClick: () => {
74
74
  _(e.uuid);
75
75
  }
@@ -2,10 +2,10 @@ import { jsxs as a, Fragment as t, jsx as r } from "react/jsx-runtime";
2
2
  import { useTranslation as n } from "react-i18next";
3
3
  import "../../../shared/constants.js";
4
4
  import "classnames";
5
- import { RadioGroupField as i } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
6
- import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
7
5
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
8
6
  import "react";
7
+ import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
8
+ import { RadioGroupField as i } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
9
9
  function N({ bankAccount: u }) {
10
10
  const { t: e } = n("Contractor.PaymentMethod", { keyPrefix: "bankAccountForm" });
11
11
  return /* @__PURE__ */ a(t, { children: [
@@ -3,9 +3,9 @@ import { useTranslation as r } from "react-i18next";
3
3
  import { z as t } from "zod";
4
4
  import { PAYMENT_METHODS as o } from "../../../shared/constants.js";
5
5
  import "classnames";
6
- import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
7
6
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
8
7
  import "react";
8
+ import { RadioGroupField as p } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
9
9
  t.object({
10
10
  type: t.enum(["Check", "Direct Deposit"])
11
11
  });
@@ -1,37 +1,38 @@
1
- import { jsx as h, jsxs as I, Fragment as W } from "react/jsx-runtime";
2
- import { useContractorsListSuspense as K } from "@gusto/embedded-api/react-query/contractorsList";
3
- import { useContractorPaymentGroupsCreateMutation as J } from "@gusto/embedded-api/react-query/contractorPaymentGroupsCreate";
4
- import { useContractorPaymentGroupsPreviewMutation as Q } from "@gusto/embedded-api/react-query/contractorPaymentGroupsPreview";
5
- import { useState as p, useMemo as R } from "react";
6
- import X from "dompurify";
7
- import { RFCDate as S } from "@gusto/embedded-api/types/rfcdate";
8
- import { useForm as Z } from "react-hook-form";
9
- import { zodResolver as $ } from "@hookform/resolvers/zod";
10
- import { useTranslation as tt } from "react-i18next";
11
- import { useBankAccountsGet as et } from "@gusto/embedded-api/react-query/bankAccountsGet";
12
- import { usePaymentConfigsGet as ot } from "@gusto/embedded-api/react-query/paymentConfigsGet";
13
- import { CreatePaymentPresentation as rt } from "./CreatePaymentPresentation.js";
14
- import { EditContractorPaymentPresentation as nt } from "./EditContractorPaymentPresentation.js";
15
- import { createEditContractorPaymentFormSchema as st } from "./EditContractorPaymentFormSchema.js";
16
- import { PreviewPresentation as at } from "./PreviewPresentation.js";
17
- import { useComponentDictionary as it } from "../../../../i18n/I18n.js";
18
- import { BaseComponent as ct } from "../../../Base/Base.js";
19
- import { useBase as mt } from "../../../Base/useBase.js";
20
- import { ContractorOnboardingStatus as ut, componentEvents as C } from "../../../../shared/constants.js";
21
- import { firstLastName as pt } from "../../../../helpers/formattedStrings.js";
22
- function Yt(c) {
23
- return /* @__PURE__ */ h(ct, { ...c, children: /* @__PURE__ */ h(yt, { ...c, children: c.children }) });
1
+ import { jsx as h, jsxs as K, Fragment as J } from "react/jsx-runtime";
2
+ import { useContractorsListSuspense as Q } from "@gusto/embedded-api/react-query/contractorsList";
3
+ import { useContractorPaymentGroupsCreateMutation as X } from "@gusto/embedded-api/react-query/contractorPaymentGroupsCreate";
4
+ import { useContractorPaymentGroupsPreviewMutation as Z } from "@gusto/embedded-api/react-query/contractorPaymentGroupsPreview";
5
+ import { useState as u, useMemo as S } from "react";
6
+ import $ from "dompurify";
7
+ import { RFCDate as U } from "@gusto/embedded-api/types/rfcdate";
8
+ import { useForm as tt } from "react-hook-form";
9
+ import { zodResolver as et } from "@hookform/resolvers/zod";
10
+ import { useTranslation as ot } from "react-i18next";
11
+ import { useBankAccountsGet as rt } from "@gusto/embedded-api/react-query/bankAccountsGet";
12
+ import { usePaymentConfigsGet as nt } from "@gusto/embedded-api/react-query/paymentConfigsGet";
13
+ import { CreatePaymentPresentation as st } from "./CreatePaymentPresentation.js";
14
+ import { EditContractorPaymentPresentation as at } from "./EditContractorPaymentPresentation.js";
15
+ import { createEditContractorPaymentFormSchema as it } from "./EditContractorPaymentFormSchema.js";
16
+ import { PreviewPresentation as ct } from "./PreviewPresentation.js";
17
+ import { payrollSubmitHandler as mt } from "../../../Payroll/PayrollBlocker/payrollHelpers.js";
18
+ import { useComponentDictionary as ut } from "../../../../i18n/I18n.js";
19
+ import { BaseComponent as lt } from "../../../Base/Base.js";
20
+ import { useBase as pt } from "../../../Base/useBase.js";
21
+ import { ContractorOnboardingStatus as yt, componentEvents as y } from "../../../../shared/constants.js";
22
+ import { firstLastName as dt } from "../../../../helpers/formattedStrings.js";
23
+ function jt(c) {
24
+ return /* @__PURE__ */ h(lt, { ...c, children: /* @__PURE__ */ h(Pt, { ...c, children: c.children }) });
24
25
  }
25
- const yt = ({ companyId: c, dictionary: U, onEvent: y }) => {
26
- it("Contractor.Payments.CreatePayment", U);
27
- const { t: b } = tt("Contractor.Payments.CreatePayment"), [v, g] = p(!1), [T, _] = p(
26
+ const Pt = ({ companyId: c, dictionary: _, onEvent: l }) => {
27
+ ut("Contractor.Payments.CreatePayment", _);
28
+ const { t: b } = ot("Contractor.Payments.CreatePayment"), [v, g] = u(!1), [T, B] = u(
28
29
  (/* @__PURE__ */ new Date()).toISOString().split("T")[0] || ""
29
- ), { baseSubmitHandler: M } = mt(), [w, d] = p({}), [l, D] = p(null), [N, A] = p({}), { mutateAsync: G, isPending: O } = J(), {
30
- mutateAsync: B,
31
- isPending: k
32
- } = Q(), { data: L } = K({ companyUuid: c }), a = (L.contractorList || []).filter(
33
- (t) => t.isActive && t.onboardingStatus === ut.ONBOARDING_COMPLETED
34
- ), { data: V } = et({ companyId: c }), { data: H } = ot({ companyUuid: c }), Y = V?.companyBankAccounts?.[0], q = H?.paymentConfigs?.paymentSpeed, x = R(
30
+ ), { baseSubmitHandler: M } = pt(), [D, d] = u({}), [P, N] = u(null), [G, w] = u([]), [k, A] = u({}), { mutateAsync: V, isPending: O } = X(), {
31
+ mutateAsync: L,
32
+ isPending: R
33
+ } = Z(), { data: H } = Q({ companyUuid: c }), a = (H.contractorList || []).filter(
34
+ (t) => t.isActive && t.onboardingStatus === yt.ONBOARDING_COMPLETED
35
+ ), { data: Y } = rt({ companyId: c }), { data: F } = nt({ companyUuid: c }), q = Y?.companyBankAccounts?.[0], x = F?.paymentConfigs?.paymentSpeed, I = S(
35
36
  () => a.map((t) => {
36
37
  const e = t.paymentMethod ? t.paymentMethod : "Direct Deposit";
37
38
  return {
@@ -45,10 +46,10 @@ const yt = ({ companyId: c, dictionary: U, onEvent: y }) => {
45
46
  };
46
47
  }),
47
48
  [a]
48
- ), [u, F] = p(x), j = R(
49
- () => u.reduce(
49
+ ), [p, j] = u(I), z = S(
50
+ () => p.reduce(
50
51
  (t, e) => {
51
- const o = a.find((z) => z.uuid === e.contractorUuid), s = o?.wageType === "Hourly", i = Number(e.hours || "0"), n = Number(e.wage || "0"), r = Number(e.bonus || "0"), m = Number(e.reimbursement || "0"), E = s ? i * Number(o.hourlyRate || "0") : 0, f = s ? 0 : n;
52
+ const o = a.find((W) => W.uuid === e.contractorUuid), i = o?.wageType === "Hourly", n = Number(e.hours || "0"), s = Number(e.wage || "0"), r = Number(e.bonus || "0"), m = Number(e.reimbursement || "0"), E = i ? n * Number(o.hourlyRate || "0") : 0, f = i ? 0 : s;
52
53
  return {
53
54
  wage: t.wage + f,
54
55
  bonus: t.bonus + r,
@@ -58,9 +59,9 @@ const yt = ({ companyId: c, dictionary: U, onEvent: y }) => {
58
59
  },
59
60
  { wage: 0, bonus: 0, reimbursement: 0, total: 0 }
60
61
  ),
61
- [u, a]
62
- ), P = Z({
63
- resolver: $(st()),
62
+ [p, a]
63
+ ), C = tt({
64
+ resolver: et(it()),
64
65
  defaultValues: {
65
66
  wageType: "Hourly",
66
67
  hours: 0,
@@ -73,64 +74,64 @@ const yt = ({ companyId: c, dictionary: U, onEvent: y }) => {
73
74
  contractorPaymentMethod: void 0
74
75
  }
75
76
  });
76
- return /* @__PURE__ */ I(W, { children: [
77
- l && /* @__PURE__ */ h(
78
- at,
77
+ return /* @__PURE__ */ K(J, { children: [
78
+ P && /* @__PURE__ */ h(
79
+ ct,
79
80
  {
80
- contractorPaymentGroup: l,
81
+ contractorPaymentGroup: P,
81
82
  contractors: a,
82
83
  onBackToEdit: () => {
83
- D(null), A({}), y(C.CONTRACTOR_PAYMENT_BACK_TO_EDIT);
84
+ N(null), w([]), A({}), l(y.CONTRACTOR_PAYMENT_BACK_TO_EDIT);
84
85
  },
85
86
  onSubmit: async () => {
86
87
  await M(null, async () => {
87
- const t = u.filter((n) => n.isTouched);
88
- if (t.length === 0 || !l?.creationToken)
88
+ const t = p.filter((s) => s.isTouched);
89
+ if (t.length === 0 || !P?.creationToken)
89
90
  return;
90
- const e = l.creationToken, o = Object.entries(N).map(
91
- ([n, r]) => ({
92
- blockerType: n,
91
+ const e = P.creationToken, o = Object.entries(k).map(
92
+ ([s, r]) => ({
93
+ blockerType: s,
93
94
  selectedOption: r
94
95
  })
95
- ), s = {
96
- checkDate: new S(T),
97
- contractorPayments: t.map(({ isTouched: n, ...r }) => r),
96
+ ), i = {
97
+ checkDate: new U(T),
98
+ contractorPayments: t.map(({ isTouched: s, ...r }) => r),
98
99
  creationToken: e,
99
100
  ...o.length > 0 && { submissionBlockers: o }
100
- }, i = await G({
101
+ }, n = await V({
101
102
  request: {
102
103
  companyId: c,
103
- requestBody: s
104
+ requestBody: i
104
105
  }
105
106
  });
106
- y(C.CONTRACTOR_PAYMENT_CREATED, i.contractorPaymentGroup || {});
107
+ l(y.CONTRACTOR_PAYMENT_CREATED, n.contractorPaymentGroup || {});
107
108
  });
108
109
  },
109
- isLoading: O || k,
110
- bankAccount: Y,
111
- selectedUnblockOptions: N,
110
+ isLoading: O || R,
111
+ bankAccount: q,
112
+ selectedUnblockOptions: k,
112
113
  onUnblockOptionChange: (t, e) => {
113
114
  A((o) => ({
114
115
  ...o,
115
116
  [t]: e
116
117
  }));
117
118
  },
118
- paymentSpeed: q
119
+ paymentSpeed: x
119
120
  }
120
121
  ),
121
- !l && /* @__PURE__ */ h(
122
- rt,
122
+ !P && /* @__PURE__ */ h(
123
+ st,
123
124
  {
124
125
  contractors: a,
125
- contractorPayments: u,
126
+ contractorPayments: p,
126
127
  paymentDate: T,
127
- onPaymentDateChange: _,
128
+ onPaymentDateChange: B,
128
129
  onSaveAndContinue: async () => {
129
130
  await M(null, async () => {
130
- const t = u.filter((o) => o.isTouched);
131
+ const t = p.filter((o) => o.isTouched);
131
132
  if (t.length === 0) {
132
133
  d({
133
- ...w,
134
+ ...D,
134
135
  error: {
135
136
  type: "error",
136
137
  title: b("alerts.noContractorPayments")
@@ -138,69 +139,76 @@ const yt = ({ companyId: c, dictionary: U, onEvent: y }) => {
138
139
  });
139
140
  return;
140
141
  }
141
- d({});
142
- const e = await B({
143
- request: {
144
- companyId: c,
145
- requestBody: {
146
- contractorPayments: t.map(({ isTouched: o, ...s }) => s),
147
- checkDate: new S(T)
142
+ d({}), w([]);
143
+ const e = await mt(async () => {
144
+ const o = await L({
145
+ request: {
146
+ companyId: c,
147
+ requestBody: {
148
+ contractorPayments: t.map(({ isTouched: i, ...n }) => n),
149
+ checkDate: new U(T)
150
+ }
148
151
  }
149
- }
152
+ });
153
+ N(o.contractorPaymentGroupPreview || null), l(y.CONTRACTOR_PAYMENT_PREVIEW, o.contractorPaymentGroupPreview);
150
154
  });
151
- D(e.contractorPaymentGroupPreview || null), y(C.CONTRACTOR_PAYMENT_PREVIEW, e.contractorPaymentGroupPreview);
155
+ !e.success && e.blockers.length > 0 && w(e.blockers);
152
156
  });
153
157
  },
154
158
  onEditContractor: (t) => {
155
- const e = a.find((n) => n.uuid === t), o = u.find(
156
- (n) => n.contractorUuid === t
157
- ), s = o?.paymentMethod || "Direct Deposit", i = ["Check", "Direct Deposit"].includes(s) ? s : "Check";
158
- P.reset(
159
+ const e = a.find((s) => s.uuid === t), o = p.find(
160
+ (s) => s.contractorUuid === t
161
+ ), i = o?.paymentMethod || "Direct Deposit", n = ["Check", "Direct Deposit"].includes(i) ? i : "Check";
162
+ C.reset(
159
163
  {
160
164
  wageType: e?.wageType || "Hourly",
161
165
  hours: Number(o?.hours || "0"),
162
166
  wage: Number(o?.wage || "0"),
163
167
  bonus: Number(o?.bonus || "0"),
164
168
  reimbursement: Number(o?.reimbursement || "0"),
165
- paymentMethod: i,
169
+ paymentMethod: n,
166
170
  hourlyRate: Number(e?.hourlyRate || "0"),
167
171
  contractorUuid: t,
168
172
  contractorPaymentMethod: e?.paymentMethod || void 0
169
173
  },
170
174
  { keepDirty: !1, keepValues: !1 }
171
- ), d({}), g(!0), y(C.CONTRACTOR_PAYMENT_EDIT);
175
+ ), d({}), g(!0), l(y.CONTRACTOR_PAYMENT_EDIT);
176
+ },
177
+ totals: z,
178
+ alerts: D,
179
+ payrollBlockers: G,
180
+ onViewBlockers: () => {
181
+ l(y.CONTRACTOR_PAYMENT_RFI_RESPOND);
172
182
  },
173
- totals: j,
174
- alerts: w,
175
- isLoading: O || k
183
+ isLoading: O || R
176
184
  }
177
185
  ),
178
186
  /* @__PURE__ */ h(
179
- nt,
187
+ at,
180
188
  {
181
189
  isOpen: v,
182
190
  onClose: () => {
183
191
  g(!1);
184
192
  },
185
- formMethods: P,
193
+ formMethods: C,
186
194
  onSubmit: (t) => {
187
195
  const o = a.find((r) => r.uuid === t.contractorUuid)?.paymentMethod;
188
196
  if (!["Check", "Direct Deposit"].includes(t.paymentMethod)) {
189
- P.setError("paymentMethod", {
197
+ C.setError("paymentMethod", {
190
198
  type: "manual",
191
199
  message: b("editContractorPayment.errors.unsupportedPaymentMethod")
192
200
  });
193
201
  return;
194
202
  }
195
203
  if (o === "Check" && t.paymentMethod === "Direct Deposit") {
196
- P.setError("paymentMethod", {
204
+ C.setError("paymentMethod", {
197
205
  type: "manual",
198
206
  message: b("editContractorPayment.errors.directDepositNotAvailable")
199
207
  });
200
208
  return;
201
209
  }
202
- const s = (t.wage ?? 0) > 0 || (t.hours ?? 0) > 0 || (t.bonus ?? 0) > 0 || (t.reimbursement ?? 0) > 0;
203
- F(
210
+ const i = (t.wage ?? 0) > 0 || (t.hours ?? 0) > 0 || (t.bonus ?? 0) > 0 || (t.reimbursement ?? 0) > 0;
211
+ j(
204
212
  (r) => r.map(
205
213
  (m) => m.contractorUuid === t.contractorUuid ? {
206
214
  contractorUuid: m.contractorUuid,
@@ -209,24 +217,24 @@ const yt = ({ companyId: c, dictionary: U, onEvent: y }) => {
209
217
  bonus: String(t.bonus ?? 0),
210
218
  reimbursement: String(t.reimbursement ?? 0),
211
219
  paymentMethod: t.paymentMethod,
212
- isTouched: s
220
+ isTouched: i
213
221
  } : m
214
222
  )
215
223
  );
216
- const i = a.find(
224
+ const n = a.find(
217
225
  (r) => r.uuid === t.contractorUuid
218
- ), n = X.sanitize(
219
- i?.type === "Individual" ? pt({
220
- first_name: i.firstName,
221
- last_name: i.lastName
222
- }) : i?.businessName || ""
226
+ ), s = $.sanitize(
227
+ n?.type === "Individual" ? dt({
228
+ first_name: n.firstName,
229
+ last_name: n.lastName
230
+ }) : n?.businessName || ""
223
231
  );
224
232
  d((r) => ({
225
233
  ...r,
226
234
  [t.contractorUuid]: {
227
235
  type: "success",
228
236
  title: b("alerts.contractorPaymentUpdated", {
229
- contractorName: n,
237
+ contractorName: s,
230
238
  interpolation: { escapeValue: !1 }
231
239
  }),
232
240
  onDismiss: () => {
@@ -236,15 +244,15 @@ const yt = ({ companyId: c, dictionary: U, onEvent: y }) => {
236
244
  });
237
245
  }
238
246
  }
239
- })), g(!1), y(C.CONTRACTOR_PAYMENT_UPDATE, t);
247
+ })), g(!1), l(y.CONTRACTOR_PAYMENT_UPDATE, t);
240
248
  },
241
- contractorPaymentMethod: a.find((t) => t.uuid === P.getValues("contractorUuid"))?.paymentMethod ?? void 0
249
+ contractorPaymentMethod: a.find((t) => t.uuid === C.getValues("contractorUuid"))?.paymentMethod ?? void 0
242
250
  }
243
251
  )
244
252
  ] });
245
253
  };
246
254
  export {
247
- Yt as CreatePayment,
248
- yt as Root
255
+ jt as CreatePayment,
256
+ Pt as Root
249
257
  };
250
258
  //# sourceMappingURL=CreatePayment.js.map