@gusto/embedded-react-sdk 0.51.0 → 0.51.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (530) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/components/Base/useBaseSubmit.js +4 -4
  3. package/dist/components/Base/useBaseSubmit.js.map +1 -1
  4. package/dist/components/Common/DocumentList/DocumentList.d.ts +8 -1
  5. package/dist/components/Common/DocumentList/DocumentList.js +24 -21
  6. package/dist/components/Common/DocumentList/DocumentList.js.map +1 -1
  7. package/dist/components/Common/OnboardingStatusBadge/index.d.ts +2 -2
  8. package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -1
  9. package/dist/components/Common/TaxInputs/TaxInputs.d.ts +2 -2
  10. package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
  11. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +5 -5
  12. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  13. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.d.ts +1 -1
  14. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +9 -8
  15. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  16. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +3 -3
  17. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  18. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.d.ts +1 -1
  19. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +9 -8
  20. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +11 -10
  22. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  23. package/dist/components/Company/BankAccount/BankAccount.js +1 -1
  24. package/dist/components/Company/BankAccount/BankAccount.js.map +1 -1
  25. package/dist/components/Company/BankAccount/BankAccountComponents.d.ts +1 -1
  26. package/dist/components/Company/BankAccount/BankAccountComponents.js.map +1 -1
  27. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js +1 -1
  28. package/dist/components/Company/BankAccount/BankAccountForm/BankAccountForm.js.map +1 -1
  29. package/dist/components/Company/BankAccount/BankAccountForm/context.js +9 -8
  30. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  31. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js +1 -1
  32. package/dist/components/Company/BankAccount/BankAccountList/BankAccountList.js.map +1 -1
  33. package/dist/components/Company/BankAccount/BankAccountList/context.d.ts +1 -1
  34. package/dist/components/Company/BankAccount/BankAccountList/context.js.map +1 -1
  35. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js +1 -1
  36. package/dist/components/Company/BankAccount/BankAccountVerify/BankAccountVerify.js.map +1 -1
  37. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +2 -2
  38. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  39. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.d.ts +2 -2
  40. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +9 -8
  41. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  42. package/dist/components/Company/DocumentSigner/DocumentSigner.js +1 -1
  43. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  44. package/dist/components/Company/DocumentSigner/documentSignerStateMachine.d.ts +2 -2
  45. package/dist/components/Company/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  46. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.d.ts +1 -1
  47. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js +3 -3
  48. package/dist/components/Company/DocumentSigner/shared/useSignCompanyForm/useSignCompanyForm.js.map +1 -1
  49. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -2
  50. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  51. package/dist/components/Company/FederalTaxes/Form.js +1 -1
  52. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  53. package/dist/components/Company/FederalTaxes/useFederalTaxes.d.ts +1 -1
  54. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +12 -11
  55. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  56. package/dist/components/Company/Industry/Context.js +12 -11
  57. package/dist/components/Company/Industry/Context.js.map +1 -1
  58. package/dist/components/Company/Industry/Industry.js +2 -2
  59. package/dist/components/Company/Industry/Industry.js.map +1 -1
  60. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -7
  61. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  62. package/dist/components/Company/Locations/LocationForm/LocationForm.js +46 -45
  63. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  64. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +9 -8
  65. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  66. package/dist/components/Company/Locations/LocationsList/LocationsList.js +1 -1
  67. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  68. package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -1
  69. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +9 -8
  70. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  71. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +1 -1
  72. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  73. package/dist/components/Company/OnboardingOverview/context.d.ts +1 -1
  74. package/dist/components/Company/OnboardingOverview/context.js +9 -8
  75. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  76. package/dist/components/Company/PaySchedule/PaySchedule.js +1 -1
  77. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  78. package/dist/components/Company/PaySchedule/PayScheduleList.js +1 -1
  79. package/dist/components/Company/PaySchedule/PayScheduleList.js.map +1 -1
  80. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.d.ts +2 -2
  81. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js +6 -6
  82. package/dist/components/Company/PaySchedule/shared/usePayScheduleForm/usePayScheduleForm.js.map +1 -1
  83. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -3
  84. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  85. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +2 -2
  86. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  87. package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.d.ts +1 -1
  88. package/dist/components/Company/StateTaxes/StateTaxesForm/applicableIf.js.map +1 -1
  89. package/dist/components/Company/StateTaxes/StateTaxesForm/context.d.ts +1 -1
  90. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +9 -8
  91. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  92. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +1 -1
  93. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  94. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js +1 -1
  95. package/dist/components/Company/StateTaxes/StateTaxesList/StateTaxesList.js.map +1 -1
  96. package/dist/components/Company/StateTaxes/StateTaxesList/context.d.ts +1 -1
  97. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +9 -8
  98. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  99. package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.d.ts +2 -2
  100. package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.js +3 -3
  101. package/dist/components/Contractor/Address/shared/useContractorAddressForm/useContractorAddressForm.js.map +1 -1
  102. package/dist/components/Contractor/ContractorList/index.js +1 -1
  103. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  104. package/dist/components/Contractor/ContractorList/useContractorList.d.ts +1 -1
  105. package/dist/components/Contractor/ContractorList/useContractorList.js +1 -1
  106. package/dist/components/Contractor/ContractorList/useContractorList.js.map +1 -1
  107. package/dist/components/Contractor/Documents/DocumentSigner/documentSignerStateMachine.d.ts +1 -1
  108. package/dist/components/Contractor/Documents/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  109. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.d.ts +3 -1
  110. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js +64 -51
  111. package/dist/components/Contractor/Documents/DocumentsList/DocumentsList.js.map +1 -1
  112. package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.d.ts +1 -1
  113. package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js +1 -1
  114. package/dist/components/Contractor/Documents/DocumentsList/useContractorDocumentsList/useContractorDocumentsList.js.map +1 -1
  115. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js +201 -161
  116. package/dist/components/Contractor/Documents/SignatureForm/SignatureForm.js.map +1 -1
  117. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.d.ts +2 -2
  118. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js +3 -3
  119. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/useContractorSignatureForm.js.map +1 -1
  120. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.d.ts +1 -1
  121. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js +55 -54
  122. package/dist/components/Contractor/Documents/SignatureForm/useContractorSignatureForm/w9Fields.js.map +1 -1
  123. package/dist/components/Contractor/Landing/Landing.js +2 -2
  124. package/dist/components/Contractor/Landing/Landing.js.map +1 -1
  125. package/dist/components/Contractor/NewHireReport/NewHireReport.js +2 -2
  126. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  127. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.d.ts +1 -1
  128. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js +2 -2
  129. package/dist/components/Contractor/PaymentMethod/shared/useContractorBankAccountForm/useContractorBankAccountForm.js.map +1 -1
  130. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.d.ts +1 -1
  131. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.js +2 -2
  132. package/dist/components/Contractor/PaymentMethod/shared/useContractorPaymentMethodForm/useContractorPaymentMethodForm.js.map +1 -1
  133. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +5 -5
  134. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  135. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +2 -2
  136. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  137. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -2
  138. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  139. package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.d.ts +1 -1
  140. package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js.map +1 -1
  141. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +4 -4
  142. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  143. package/dist/components/Contractor/Payments/CreatePayment/helpers.d.ts +1 -1
  144. package/dist/components/Contractor/Payments/CreatePayment/helpers.js.map +1 -1
  145. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  146. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +3 -3
  147. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
  148. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +2 -2
  149. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  150. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +4 -4
  151. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -1
  152. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +3 -3
  153. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  154. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +3 -3
  155. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -1
  156. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +3 -3
  157. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  158. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +3 -3
  159. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  160. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +1 -1
  161. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  162. package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js +1 -1
  163. package/dist/components/Contractor/Profile/SelfOnboardingContractorProfile.js.map +1 -1
  164. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js +1 -1
  165. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/contractorDetailsSchema.js.map +1 -1
  166. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.d.ts +1 -1
  167. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js +3 -3
  168. package/dist/components/Contractor/Profile/shared/useContractorDetailsForm/useContractorDetailsForm.js.map +1 -1
  169. package/dist/components/Contractor/Submit/Submit.js +3 -3
  170. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  171. package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js +1 -1
  172. package/dist/components/Employee/Compensation/management/CompensationCard/CompensationCard.js.map +1 -1
  173. package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js +1 -1
  174. package/dist/components/Employee/Compensation/management/CompensationEditForm/CompensationEditForm.js.map +1 -1
  175. package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js +1 -1
  176. package/dist/components/Employee/Compensation/management/CompensationEditJobForm/CompensationEditJobForm.js.map +1 -1
  177. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -1
  178. package/dist/components/Employee/Compensation/onboarding/Compensation.d.ts +2 -2
  179. package/dist/components/Employee/Compensation/onboarding/Compensation.js +1 -1
  180. package/dist/components/Employee/Compensation/onboarding/Compensation.js.map +1 -1
  181. package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.d.ts +2 -2
  182. package/dist/components/Employee/Compensation/onboarding/CompensationFlowComponents.js.map +1 -1
  183. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js +2 -2
  184. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsList.js.map +1 -1
  185. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.d.ts +1 -1
  186. package/dist/components/Employee/Compensation/onboarding/JobsList/JobsListPresentation.js.map +1 -1
  187. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -1
  188. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.d.ts +1 -1
  189. package/dist/components/Employee/Compensation/shared/derivePrimaryFlsaStatus.js.map +1 -1
  190. package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.d.ts +2 -2
  191. package/dist/components/Employee/Compensation/shared/getPendingCompensationChanges.js.map +1 -1
  192. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +3 -3
  193. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
  194. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.d.ts +4 -4
  195. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +7 -7
  196. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
  197. package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.d.ts +1 -1
  198. package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.js +4 -4
  199. package/dist/components/Employee/Compensation/shared/useCompensationManagement/useCompensationManagement.js.map +1 -1
  200. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.d.ts +3 -3
  201. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js +7 -7
  202. package/dist/components/Employee/Compensation/shared/useJobForm/useJobForm.js.map +1 -1
  203. package/dist/components/Employee/Dashboard/Dashboard.js +1 -1
  204. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
  205. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
  206. package/dist/components/Employee/Deductions/management/DeductionsCard/DeductionsCard.js.map +1 -1
  207. package/dist/components/Employee/Deductions/management/deductionsStateMachine.js.map +1 -1
  208. package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.d.ts +1 -1
  209. package/dist/components/Employee/Deductions/onboarding/DeductionsList/DeductionsList.js.map +1 -1
  210. package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.d.ts +1 -1
  211. package/dist/components/Employee/Deductions/onboarding/deductionsContextualComponents.js.map +1 -1
  212. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.d.ts +1 -1
  213. package/dist/components/Employee/Deductions/shared/DeductionsForm/ChildSupportFormView.js.map +1 -1
  214. package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.d.ts +1 -1
  215. package/dist/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.js.map +1 -1
  216. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.d.ts +1 -1
  217. package/dist/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.js.map +1 -1
  218. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.d.ts +1 -1
  219. package/dist/components/Employee/Deductions/shared/DeleteDeductionDialog.js.map +1 -1
  220. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.d.ts +1 -1
  221. package/dist/components/Employee/Deductions/shared/formatDeductionAmount.js.map +1 -1
  222. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.d.ts +1 -1
  223. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js +1 -1
  224. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.js.map +1 -1
  225. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.d.ts +1 -1
  226. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.js.map +1 -1
  227. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.d.ts +2 -2
  228. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js +5 -5
  229. package/dist/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.js.map +1 -1
  230. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js +1 -1
  231. package/dist/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.js.map +1 -1
  232. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.d.ts +1 -1
  233. package/dist/components/Employee/Deductions/shared/useDeductionForm/fields.js.map +1 -1
  234. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.d.ts +1 -1
  235. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js +3 -3
  236. package/dist/components/Employee/Deductions/shared/useDeductionForm/useDeductionForm.js.map +1 -1
  237. package/dist/components/Employee/Deductions/shared/useDeductionsList.d.ts +1 -1
  238. package/dist/components/Employee/Deductions/shared/useDeductionsList.js +2 -2
  239. package/dist/components/Employee/Deductions/shared/useDeductionsList.js.map +1 -1
  240. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.d.ts +1 -1
  241. package/dist/components/Employee/Deductions/shared/useDeleteDeduction.js.map +1 -1
  242. package/dist/components/Employee/Documents/management/DocumentManager.js +2 -2
  243. package/dist/components/Employee/Documents/management/DocumentManager.js.map +1 -1
  244. package/dist/components/Employee/Documents/management/DocumentsCard/DocumentsCard.js.map +1 -1
  245. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js +1 -1
  246. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  247. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.d.ts +1 -1
  248. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +9 -8
  249. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  250. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js +2 -2
  251. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentSigner.js.map +1 -1
  252. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js +3 -3
  253. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibility.js.map +1 -1
  254. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +1 -1
  255. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  256. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js +1 -1
  257. package/dist/components/Employee/Documents/onboarding/DocumentSigner/EmploymentEligibility/EmploymentEligibilitySchema.js.map +1 -1
  258. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js +1 -1
  259. package/dist/components/Employee/Documents/onboarding/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  260. package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.d.ts +1 -1
  261. package/dist/components/Employee/Documents/onboarding/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  262. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js +2 -2
  263. package/dist/components/Employee/Documents/onboarding/EmployeeDocuments/EmployeeDocuments.js.map +1 -1
  264. package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.d.ts +1 -1
  265. package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.js +1 -1
  266. package/dist/components/Employee/Documents/shared/useDocumentsList/useDocumentsList.js.map +1 -1
  267. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.d.ts +1 -1
  268. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js +3 -3
  269. package/dist/components/Employee/Documents/shared/useSignEmployeeForm/useSignEmployeeForm.js.map +1 -1
  270. package/dist/components/Employee/EmployeeList/onboarding/EmployeeList.js.map +1 -1
  271. package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.d.ts +1 -1
  272. package/dist/components/Employee/EmployeeList/onboarding/EmployeeListView.js.map +1 -1
  273. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.d.ts +3 -3
  274. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js +3 -3
  275. package/dist/components/Employee/EmployeeList/shared/useEmployeeList.js.map +1 -1
  276. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js +1 -1
  277. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/federalTaxesSchema.js.map +1 -1
  278. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.d.ts +1 -1
  279. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.js +2 -2
  280. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesForm/useFederalTaxesForm.js.map +1 -1
  281. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.d.ts +1 -1
  282. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.js +1 -1
  283. package/dist/components/Employee/FederalTaxes/shared/useFederalTaxesSummary/useFederalTaxesSummary.js.map +1 -1
  284. package/dist/components/Employee/HomeAddress/management/HomeAddressEditForm.js.map +1 -1
  285. package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +1 -1
  286. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
  287. package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.d.ts +1 -1
  288. package/dist/components/Employee/HomeAddress/management/getPendingFutureHomeAddress.js.map +1 -1
  289. package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.d.ts +1 -1
  290. package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js +3 -3
  291. package/dist/components/Employee/HomeAddress/management/useHomeAddressManagement.js.map +1 -1
  292. package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.d.ts +1 -1
  293. package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.js +1 -1
  294. package/dist/components/Employee/HomeAddress/shared/useHomeAddressSummary/useHomeAddressSummary.js.map +1 -1
  295. package/dist/components/Employee/Landing/Landing.js +2 -2
  296. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  297. package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.d.ts +1 -1
  298. package/dist/components/Employee/OnboardingExecutionFlow/OnboardingExecutionFlowComponents.js.map +1 -1
  299. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +2 -2
  300. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js.map +1 -1
  301. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.d.ts +1 -1
  302. package/dist/components/Employee/PaymentMethod/shared/BankFormBody/BankFormBody.js.map +1 -1
  303. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.d.ts +1 -1
  304. package/dist/components/Employee/PaymentMethod/shared/SplitPaymentsFormBody/SplitPaymentsFormBody.js.map +1 -1
  305. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.d.ts +1 -1
  306. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js +1 -1
  307. package/dist/components/Employee/PaymentMethod/shared/useBankForm/useBankForm.js.map +1 -1
  308. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.d.ts +1 -1
  309. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js +2 -2
  310. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodForm/usePaymentMethodForm.js.map +1 -1
  311. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.d.ts +2 -2
  312. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js +4 -4
  313. package/dist/components/Employee/PaymentMethod/shared/usePaymentMethodList.js.map +1 -1
  314. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.d.ts +2 -2
  315. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js +3 -3
  316. package/dist/components/Employee/PaymentMethod/shared/useSplitPaymentsForm/useSplitPaymentsForm.js.map +1 -1
  317. package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.d.ts +1 -1
  318. package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.js +3 -3
  319. package/dist/components/Employee/Paystubs/shared/usePaystubsList/usePaystubsList.js.map +1 -1
  320. package/dist/components/Employee/Profile/onboarding/AdminProfile.js.map +1 -1
  321. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js +1 -1
  322. package/dist/components/Employee/Profile/onboarding/EmployeeProfile.js.map +1 -1
  323. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.d.ts +1 -1
  324. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js +5 -5
  325. package/dist/components/Employee/Profile/shared/useEmployeeDetailsForm/useEmployeeDetailsForm.js.map +1 -1
  326. package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.d.ts +1 -1
  327. package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.js +1 -1
  328. package/dist/components/Employee/Profile/shared/useEmployeeProfileSummary/useEmployeeProfileSummary.js.map +1 -1
  329. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js +1 -1
  330. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useCurrentHomeAddressForm.js.map +1 -1
  331. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.d.ts +1 -1
  332. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js +4 -4
  333. package/dist/components/Employee/Profile/shared/useHomeAddressForm/useHomeAddressForm.js.map +1 -1
  334. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.d.ts +1 -1
  335. package/dist/components/Employee/Profile/shared/useWorkAddressForm/fields.js.map +1 -1
  336. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js +1 -1
  337. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useCurrentWorkAddressForm.js.map +1 -1
  338. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.d.ts +2 -2
  339. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js +5 -5
  340. package/dist/components/Employee/Profile/shared/useWorkAddressForm/useWorkAddressForm.js.map +1 -1
  341. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.d.ts +1 -1
  342. package/dist/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.js.map +1 -1
  343. package/dist/components/Employee/StateTaxes/management/StateTaxesCard/StateTaxesCard.js.map +1 -1
  344. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/__fixtures__/stateTaxesFixtures.d.ts +1 -1
  345. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/__fixtures__/toWireFormat.d.ts +1 -1
  346. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.d.ts +1 -1
  347. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/employeeStateTaxesSchema.js.map +1 -1
  348. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.d.ts +1 -1
  349. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fieldMapping.js.map +1 -1
  350. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.d.ts +1 -1
  351. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/fields.js.map +1 -1
  352. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.d.ts +1 -1
  353. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js +2 -2
  354. package/dist/components/Employee/StateTaxes/shared/useEmployeeStateTaxesForm/useEmployeeStateTaxesForm.js.map +1 -1
  355. package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.d.ts +1 -1
  356. package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.js +1 -1
  357. package/dist/components/Employee/StateTaxes/shared/useStateTaxesSummary/useStateTaxesSummary.js.map +1 -1
  358. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +9 -9
  359. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -1
  360. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +1 -1
  361. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -1
  362. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +4 -4
  363. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -1
  364. package/dist/components/Employee/WorkAddress/management/WorkAddressEditForm.js.map +1 -1
  365. package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +1 -1
  366. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
  367. package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.d.ts +2 -2
  368. package/dist/components/Employee/WorkAddress/management/getPendingFutureWorkAddress.js.map +1 -1
  369. package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.d.ts +1 -1
  370. package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js +3 -3
  371. package/dist/components/Employee/WorkAddress/management/useWorkAddressManagement.js.map +1 -1
  372. package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.d.ts +1 -1
  373. package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.js +1 -1
  374. package/dist/components/Employee/WorkAddress/shared/useEmployeeWorkAddressSummary/useEmployeeWorkAddressSummary.js.map +1 -1
  375. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +4 -4
  376. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  377. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +2 -2
  378. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  379. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +1 -1
  380. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  381. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +2 -2
  382. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
  383. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +3 -3
  384. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  385. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +2 -2
  386. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
  387. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +1 -1
  388. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -1
  389. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +4 -4
  390. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
  391. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +8 -7
  392. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js.map +1 -1
  393. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +1 -1
  394. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  395. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +4 -4
  396. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  397. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js +1 -1
  398. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.js.map +1 -1
  399. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +1 -1
  400. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js +1 -1
  401. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.js.map +1 -1
  402. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +4 -4
  403. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  404. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +2 -2
  405. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  406. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +7 -7
  407. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  408. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +5 -5
  409. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  410. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +4 -4
  411. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +5 -5
  412. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  413. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +3 -3
  414. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  415. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +4 -4
  416. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +1 -1
  417. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  418. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.d.ts +2 -2
  419. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  420. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +1 -1
  421. package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
  422. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  423. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js +1 -1
  424. package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
  425. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -1
  426. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  427. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +2 -2
  428. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -1
  429. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  430. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +4 -4
  431. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  432. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +2 -2
  433. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  434. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +2 -2
  435. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  436. package/dist/components/Payroll/PayrollList/PayrollList.js +8 -8
  437. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  438. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +3 -3
  439. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +1 -1
  440. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  441. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +7 -7
  442. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  443. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +4 -4
  444. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  445. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -2
  446. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  447. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +1 -1
  448. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -1
  449. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js +1 -1
  450. package/dist/components/Payroll/PayrollReceipts/PayrollReceipts.js.map +1 -1
  451. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.d.ts +1 -1
  452. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  453. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +1 -1
  454. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +2 -2
  455. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -1
  456. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +1 -1
  457. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  458. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +2 -2
  459. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  460. package/dist/components/Payroll/Transition/TransitionFlowComponents.js +1 -1
  461. package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -1
  462. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +4 -4
  463. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -1
  464. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +3 -3
  465. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -1
  466. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +1 -1
  467. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -1
  468. package/dist/components/Payroll/helpers.d.ts +6 -6
  469. package/dist/components/Payroll/helpers.js +1 -1
  470. package/dist/components/Payroll/helpers.js.map +1 -1
  471. package/dist/components/Payroll/payrollTypes.js +1 -1
  472. package/dist/components/Payroll/payrollTypes.js.map +1 -1
  473. package/dist/components/Payroll/usePreparedPayrollData.d.ts +2 -2
  474. package/dist/components/Payroll/usePreparedPayrollData.js +16 -15
  475. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  476. package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.d.ts +1 -1
  477. package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js +3 -3
  478. package/dist/components/Payroll/useUnprocessedTransitionPayPeriods.js.map +1 -1
  479. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js +3 -3
  480. package/dist/components/TimeOff/HolidayPolicyDetail/HolidayPolicyDetail.js.map +1 -1
  481. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js +3 -3
  482. package/dist/components/TimeOff/HolidaySelectionForm/HolidaySelectionForm.js.map +1 -1
  483. package/dist/components/TimeOff/PolicyList/PolicyList.js +6 -6
  484. package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
  485. package/dist/components/TimeOff/PolicySettings/PolicySettings.js +30 -29
  486. package/dist/components/TimeOff/PolicySettings/PolicySettings.js.map +1 -1
  487. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js +1 -1
  488. package/dist/components/TimeOff/PolicyTypeSelector/PolicyTypeSelector.js.map +1 -1
  489. package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.d.ts +1 -1
  490. package/dist/components/TimeOff/TimeOffFlow/timeOffPolicyTypes.js.map +1 -1
  491. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +27 -26
  492. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
  493. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +2 -2
  494. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
  495. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +1 -1
  496. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +69 -68
  497. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
  498. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +3 -3
  499. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
  500. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +67 -66
  501. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
  502. package/dist/contexts/ApiProvider/ApiProvider.js +3 -3
  503. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  504. package/dist/contexts/ApiProvider/apiVersion.d.ts +23 -0
  505. package/dist/contexts/ApiProvider/apiVersion.js +6 -0
  506. package/dist/contexts/ApiProvider/apiVersion.js.map +1 -0
  507. package/dist/contexts/ApiProvider/apiVersionHook.js +3 -2
  508. package/dist/contexts/ApiProvider/apiVersionHook.js.map +1 -1
  509. package/dist/contexts/ApiProvider/createSdkQueryClient.d.ts +1 -1
  510. package/dist/contexts/ApiProvider/createSdkQueryClient.js +7 -6
  511. package/dist/contexts/ApiProvider/createSdkQueryClient.js.map +1 -1
  512. package/dist/helpers/apiErrorToList.d.ts +1 -1
  513. package/dist/helpers/apiErrorToList.js.map +1 -1
  514. package/dist/helpers/formattedStrings.d.ts +2 -2
  515. package/dist/helpers/formattedStrings.js.map +1 -1
  516. package/dist/hooks/useCompanyPaymentSpeed.d.ts +1 -1
  517. package/dist/hooks/useCompanyPaymentSpeed.js +1 -1
  518. package/dist/hooks/useCompanyPaymentSpeed.js.map +1 -1
  519. package/dist/i18n/en/Contractor.DocumentsList.json.js +20 -16
  520. package/dist/i18n/en/Contractor.DocumentsList.json.js.map +1 -1
  521. package/dist/i18n/types.d.ts +4 -0
  522. package/dist/models/external.d.ts +204 -204
  523. package/dist/shared/constants.d.ts +1 -1
  524. package/dist/shared/constants.js +2 -2
  525. package/dist/shared/constants.js.map +1 -1
  526. package/dist/types/hooks.d.ts +1 -1
  527. package/dist/types/sdkError.js +3 -3
  528. package/dist/types/sdkError.js.map +1 -1
  529. package/docs/guides/endpoint-inventory.json +1201 -297
  530. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"DeductionsForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useMemo, useState } from 'react'\nimport type {\n Garnishment,\n GarnishmentType,\n} from '@gusto/embedded-api-v-2026-02-01/models/components/garnishment'\nimport { StandardDeductionForm } from './StandardDeductionForm'\nimport { ChildSupportFormView } from './ChildSupportFormView'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/** @internal */\nexport type DeductionsFormDictionary = ResourceDictionary<'Employee.DeductionsForm'>\n\n// Garnishment types the form supports (mirrors the legacy SUPPORTED_GARNISHMENT_TYPES).\nconst SUPPORTED_GARNISHMENT_TYPES: readonly GarnishmentType[] = [\n 'child_support',\n 'federal_tax_lien',\n 'state_tax_lien',\n 'student_loan',\n 'creditor_garnishment',\n 'federal_loan',\n 'other_garnishment',\n] as const\n\ntype Variant = { kind: 'custom' } | { kind: 'garnishment'; type: GarnishmentType }\n\nfunction deductionToVariant(deduction: Garnishment): Variant {\n const type = deduction.garnishmentType\n if (!deduction.courtOrdered) return { kind: 'custom' }\n return {\n kind: 'garnishment',\n type: type && SUPPORTED_GARNISHMENT_TYPES.includes(type) ? type : 'child_support',\n }\n}\n\n/** @internal */\nexport interface DeductionsFormProps {\n /** Optional CSS class for the root section. */\n className?: string\n /** The associated employee identifier. */\n employeeId: string\n /** When provided, the form is in edit mode and the deduction's existing\n * garnishment type selects the inline form variant. Omit for add mode. */\n deduction?: Garnishment | null\n /**\n * Translation overrides for the form's strings. Each consuming block\n * passes the dictionary it resolved from its own namespace so partner\n * overrides on that namespace flow into the form text.\n */\n dictionary?: DeductionsFormDictionary\n /** Called after a successful save with the saved row and whether it was a create or update. */\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n /** Called when the user cancels the form. */\n onCancel: () => void\n}\n\n/** @internal */\nexport function DeductionsForm({\n className,\n employeeId,\n deduction,\n dictionary,\n onSaved,\n onCancel,\n}: DeductionsFormProps) {\n useI18n('Employee.DeductionsForm')\n useComponentDictionary('Employee.DeductionsForm', dictionary)\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const isEdit = !!deduction\n const title = isEdit ? t('editTitle') : t('addTitle')\n\n // Pre-select the variant in edit mode; let the user pick in add mode.\n const initialVariant = useMemo<Variant | null>(\n () => (deduction ? deductionToVariant(deduction) : null),\n [deduction],\n )\n const [variant, setVariant] = useState<Variant | null>(initialVariant)\n\n const garnishmentTypeOptions = useMemo(\n () =>\n SUPPORTED_GARNISHMENT_TYPES.map(value => ({\n value,\n label: garnishmentTypeLabel(t, value),\n })),\n [t],\n )\n\n const handleSelectDeductionType = (selection: string) => {\n if (selection === 'custom') {\n setVariant({ kind: 'custom' })\n } else {\n setVariant({ kind: 'garnishment', type: 'child_support' })\n }\n }\n\n const handleSelectGarnishmentType = (value: string) => {\n setVariant({ kind: 'garnishment', type: value as GarnishmentType })\n }\n\n return (\n <section className={className}>\n <Grid gap={32}>\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n <Components.Text variant=\"supporting\">{t('description')}</Components.Text>\n </Flex>\n\n {!isEdit && (\n <>\n <Flex flexDirection=\"column\" gap={20}>\n <Components.RadioGroup\n label={t('variantLabel')}\n description={t('variantDescription')}\n options={[\n { value: 'garnishment', label: t('garnishmentOption') },\n { value: 'custom', label: t('customOption') },\n ]}\n defaultValue={variant?.kind === 'custom' ? 'custom' : undefined}\n onChange={handleSelectDeductionType}\n isRequired\n />\n\n {variant?.kind === 'garnishment' && (\n <Components.Select\n label={t('garnishmentTypeLabel')}\n placeholder=\"\"\n options={garnishmentTypeOptions}\n value={variant.type}\n onChange={handleSelectGarnishmentType}\n isRequired\n />\n )}\n </Flex>\n\n {variant !== null && <hr />}\n\n {variant === null && (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n </ActionsLayout>\n )}\n </>\n )}\n\n {variant?.kind === 'custom' && (\n <StandardDeductionForm\n employeeId={employeeId}\n deduction={deduction ?? null}\n courtOrdered={false}\n title={t('types.custom')}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )}\n {variant?.kind === 'garnishment' && variant.type === 'child_support' && (\n <ChildSupportFormView\n employeeId={employeeId}\n deduction={deduction ?? null}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )}\n {variant?.kind === 'garnishment' && variant.type !== 'child_support' && (\n <StandardDeductionForm\n employeeId={employeeId}\n deduction={deduction ?? null}\n courtOrdered={true}\n garnishmentType={variant.type}\n title={garnishmentTypeLabel(t, variant.type)}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )}\n </Grid>\n </section>\n )\n}\n\nfunction garnishmentTypeLabel(\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t'],\n value: GarnishmentType,\n): string {\n switch (value) {\n case 'child_support':\n return t('types.childSupport')\n case 'federal_tax_lien':\n return t('types.federalTaxLien')\n case 'state_tax_lien':\n return t('types.stateTaxLien')\n case 'student_loan':\n return t('types.studentLoan')\n case 'creditor_garnishment':\n return t('types.creditorGarnishment')\n case 'federal_loan':\n return t('types.federalLoan')\n case 'other_garnishment':\n return t('types.otherGarnishment')\n }\n}\n"],"names":["SUPPORTED_GARNISHMENT_TYPES","deductionToVariant","deduction","type","DeductionsForm","className","employeeId","dictionary","onSaved","onCancel","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","isEdit","title","initialVariant","useMemo","variant","setVariant","useState","garnishmentTypeOptions","value","garnishmentTypeLabel","handleSelectDeductionType","selection","handleSelectGarnishmentType","jsxs","Grid","Flex","jsx","Fragment","ActionsLayout","StandardDeductionForm","ChildSupportFormView"],"mappings":";;;;;;;;;;AAmBA,MAAMA,IAA0D;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIA,SAASC,EAAmBC,GAAiC;AAC3D,QAAMC,IAAOD,EAAU;AACvB,SAAKA,EAAU,eACR;AAAA,IACL,MAAM;AAAA,IACN,MAAMC,KAAQH,EAA4B,SAASG,CAAI,IAAIA,IAAO;AAAA,EAAA,IAHhC,EAAE,MAAM,SAAA;AAK9C;AAwBO,SAASC,EAAe;AAAA,EAC7B,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAJ;AAAA,EACA,YAAAK;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAAwB;AACtB,EAAAC,EAAQ,yBAAyB,GACjCC,EAAuB,2BAA2BJ,CAAU;AAC5D,QAAM,EAAE,GAAAK,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA,GAEbC,IAAS,CAAC,CAACd,GACXe,IAAiBL,EAATI,IAAW,cAAiB,UAAN,GAG9BE,IAAiBC;AAAA,IACrB,MAAOjB,IAAYD,EAAmBC,CAAS,IAAI;AAAA,IACnD,CAACA,CAAS;AAAA,EAAA,G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;AAAA,EACF,EAAA,CAEJ,EAAA,CACF;AAEJ;AAEA,SAASgB,EACP,GACAD,GACQ;AACR,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAO,EAAE,oBAAoB;AAAA,IAC/B,KAAK;AACH,aAAO,EAAE,sBAAsB;AAAA,IACjC,KAAK;AACH,aAAO,EAAE,oBAAoB;AAAA,IAC/B,KAAK;AACH,aAAO,EAAE,mBAAmB;AAAA,IAC9B,KAAK;AACH,aAAO,EAAE,2BAA2B;AAAA,IACtC,KAAK;AACH,aAAO,EAAE,mBAAmB;AAAA,IAC9B,KAAK;AACH,aAAO,EAAE,wBAAwB;AAAA,EAAA;AAEvC;"}
1
+ {"version":3,"file":"DeductionsForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/DeductionsForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useMemo, useState } from 'react'\nimport type {\n Garnishment,\n GarnishmentType,\n} from '@gusto/embedded-api/models/components/garnishment'\nimport { StandardDeductionForm } from './StandardDeductionForm'\nimport { ChildSupportFormView } from './ChildSupportFormView'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport type { ResourceDictionary } from '@/types/Helpers'\n\n/** @internal */\nexport type DeductionsFormDictionary = ResourceDictionary<'Employee.DeductionsForm'>\n\n// Garnishment types the form supports (mirrors the legacy SUPPORTED_GARNISHMENT_TYPES).\nconst SUPPORTED_GARNISHMENT_TYPES: readonly GarnishmentType[] = [\n 'child_support',\n 'federal_tax_lien',\n 'state_tax_lien',\n 'student_loan',\n 'creditor_garnishment',\n 'federal_loan',\n 'other_garnishment',\n] as const\n\ntype Variant = { kind: 'custom' } | { kind: 'garnishment'; type: GarnishmentType }\n\nfunction deductionToVariant(deduction: Garnishment): Variant {\n const type = deduction.garnishmentType\n if (!deduction.courtOrdered) return { kind: 'custom' }\n return {\n kind: 'garnishment',\n type: type && SUPPORTED_GARNISHMENT_TYPES.includes(type) ? type : 'child_support',\n }\n}\n\n/** @internal */\nexport interface DeductionsFormProps {\n /** Optional CSS class for the root section. */\n className?: string\n /** The associated employee identifier. */\n employeeId: string\n /** When provided, the form is in edit mode and the deduction's existing\n * garnishment type selects the inline form variant. Omit for add mode. */\n deduction?: Garnishment | null\n /**\n * Translation overrides for the form's strings. Each consuming block\n * passes the dictionary it resolved from its own namespace so partner\n * overrides on that namespace flow into the form text.\n */\n dictionary?: DeductionsFormDictionary\n /** Called after a successful save with the saved row and whether it was a create or update. */\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n /** Called when the user cancels the form. */\n onCancel: () => void\n}\n\n/** @internal */\nexport function DeductionsForm({\n className,\n employeeId,\n deduction,\n dictionary,\n onSaved,\n onCancel,\n}: DeductionsFormProps) {\n useI18n('Employee.DeductionsForm')\n useComponentDictionary('Employee.DeductionsForm', dictionary)\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const isEdit = !!deduction\n const title = isEdit ? t('editTitle') : t('addTitle')\n\n // Pre-select the variant in edit mode; let the user pick in add mode.\n const initialVariant = useMemo<Variant | null>(\n () => (deduction ? deductionToVariant(deduction) : null),\n [deduction],\n )\n const [variant, setVariant] = useState<Variant | null>(initialVariant)\n\n const garnishmentTypeOptions = useMemo(\n () =>\n SUPPORTED_GARNISHMENT_TYPES.map(value => ({\n value,\n label: garnishmentTypeLabel(t, value),\n })),\n [t],\n )\n\n const handleSelectDeductionType = (selection: string) => {\n if (selection === 'custom') {\n setVariant({ kind: 'custom' })\n } else {\n setVariant({ kind: 'garnishment', type: 'child_support' })\n }\n }\n\n const handleSelectGarnishmentType = (value: string) => {\n setVariant({ kind: 'garnishment', type: value as GarnishmentType })\n }\n\n return (\n <section className={className}>\n <Grid gap={32}>\n <Flex flexDirection=\"column\" gap={2}>\n <Components.Heading as=\"h2\">{title}</Components.Heading>\n <Components.Text variant=\"supporting\">{t('description')}</Components.Text>\n </Flex>\n\n {!isEdit && (\n <>\n <Flex flexDirection=\"column\" gap={20}>\n <Components.RadioGroup\n label={t('variantLabel')}\n description={t('variantDescription')}\n options={[\n { value: 'garnishment', label: t('garnishmentOption') },\n { value: 'custom', label: t('customOption') },\n ]}\n defaultValue={variant?.kind === 'custom' ? 'custom' : undefined}\n onChange={handleSelectDeductionType}\n isRequired\n />\n\n {variant?.kind === 'garnishment' && (\n <Components.Select\n label={t('garnishmentTypeLabel')}\n placeholder=\"\"\n options={garnishmentTypeOptions}\n value={variant.type}\n onChange={handleSelectGarnishmentType}\n isRequired\n />\n )}\n </Flex>\n\n {variant !== null && <hr />}\n\n {variant === null && (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n </ActionsLayout>\n )}\n </>\n )}\n\n {variant?.kind === 'custom' && (\n <StandardDeductionForm\n employeeId={employeeId}\n deduction={deduction ?? null}\n courtOrdered={false}\n title={t('types.custom')}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )}\n {variant?.kind === 'garnishment' && variant.type === 'child_support' && (\n <ChildSupportFormView\n employeeId={employeeId}\n deduction={deduction ?? null}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )}\n {variant?.kind === 'garnishment' && variant.type !== 'child_support' && (\n <StandardDeductionForm\n employeeId={employeeId}\n deduction={deduction ?? null}\n courtOrdered={true}\n garnishmentType={variant.type}\n title={garnishmentTypeLabel(t, variant.type)}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )}\n </Grid>\n </section>\n )\n}\n\nfunction garnishmentTypeLabel(\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t'],\n value: GarnishmentType,\n): string {\n switch (value) {\n case 'child_support':\n return t('types.childSupport')\n case 'federal_tax_lien':\n return t('types.federalTaxLien')\n case 'state_tax_lien':\n return t('types.stateTaxLien')\n case 'student_loan':\n return t('types.studentLoan')\n case 'creditor_garnishment':\n return t('types.creditorGarnishment')\n case 'federal_loan':\n return t('types.federalLoan')\n case 'other_garnishment':\n return t('types.otherGarnishment')\n }\n}\n"],"names":["SUPPORTED_GARNISHMENT_TYPES","deductionToVariant","deduction","type","DeductionsForm","className","employeeId","dictionary","onSaved","onCancel","useI18n","useComponentDictionary","t","useTranslation","Components","useComponentContext","isEdit","title","initialVariant","useMemo","variant","setVariant","useState","garnishmentTypeOptions","value","garnishmentTypeLabel","handleSelectDeductionType","selection","handleSelectGarnishmentType","jsxs","Grid","Flex","jsx","Fragment","ActionsLayout","StandardDeductionForm","ChildSupportFormView"],"mappings":";;;;;;;;;;AAmBA,MAAMA,IAA0D;AAAA,EAC9D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIA,SAASC,EAAmBC,GAAiC;AAC3D,QAAMC,IAAOD,EAAU;AACvB,SAAKA,EAAU,eACR;AAAA,IACL,MAAM;AAAA,IACN,MAAMC,KAAQH,EAA4B,SAASG,CAAI,IAAIA,IAAO;AAAA,EAAA,IAHhC,EAAE,MAAM,SAAA;AAK9C;AAwBO,SAASC,EAAe;AAAA,EAC7B,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAJ;AAAA,EACA,YAAAK;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAAwB;AACtB,EAAAC,EAAQ,yBAAyB,GACjCC,EAAuB,2BAA2BJ,CAAU;AAC5D,QAAM,EAAE,GAAAK,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA,GAEbC,IAAS,CAAC,CAACd,GACXe,IAAiBL,EAATI,IAAW,cAAiB,UAAN,GAG9BE,IAAiBC;AAAA,IACrB,MAAOjB,IAAYD,EAAmBC,CAAS,IAAI;AAAA,IACnD,CAACA,CAAS;AAAA,EAAA,GAEN,CAACkB,GAASC,CAAU,IAAIC,E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ACF;AAEJ;AAEA,SAASgB,EACP,GACAD,GACQ;AACR,UAAQA,GAAA;AAAA,IACN,KAAK;AACH,aAAO,EAAE,oBAAoB;AAAA,IAC/B,KAAK;AACH,aAAO,EAAE,sBAAsB;AAAA,IACjC,KAAK;AACH,aAAO,EAAE,oBAAoB;AAAA,IAC/B,KAAK;AACH,aAAO,EAAE,mBAAmB;AAAA,IAC9B,KAAK;AACH,aAAO,EAAE,2BAA2B;AAAA,IACtC,KAAK;AACH,aAAO,EAAE,mBAAmB;AAAA,IAC9B,KAAK;AACH,aAAO,EAAE,wBAAwB;AAAA,EAAA;AAEvC;"}
@@ -1,4 +1,4 @@
1
- import { Garnishment, GarnishmentType } from '@gusto/embedded-api-v-2026-02-01/models/components/garnishment';
1
+ import { Garnishment, GarnishmentType } from '@gusto/embedded-api/models/components/garnishment';
2
2
  interface StandardDeductionFormProps {
3
3
  employeeId: string;
4
4
  deduction: Garnishment | null;
@@ -1 +1 @@
1
- {"version":3,"file":"StandardDeductionForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWatch } from 'react-hook-form'\nimport type {\n Garnishment,\n GarnishmentType,\n} from '@gusto/embedded-api-v-2026-02-01/models/components/garnishment'\nimport type { Control } from 'react-hook-form'\nimport { useDeductionForm } from '../useDeductionForm'\nimport type { DeductionFormData } from '../useDeductionForm'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { BaseLayout } from '@/components/Base/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface StandardDeductionFormProps {\n employeeId: string\n deduction: Garnishment | null\n /** Court-ordered garnishments require `garnishmentType`. Custom deductions don't. */\n courtOrdered: boolean\n /** Only meaningful when `courtOrdered: true`. Selects the garnishment type\n * on create. Ignored in edit mode (the existing type is preserved). */\n garnishmentType?: GarnishmentType\n /** Section heading shown above the form. The parent picker is responsible\n * for translating the garnishment-type label so this component doesn't\n * need to repeat the labels mapping. */\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}\n\n/** @internal */\nexport function StandardDeductionForm({\n employeeId,\n deduction,\n courtOrdered,\n garnishmentType,\n title,\n onSaved,\n onCancel,\n}: StandardDeductionFormProps) {\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const form = useDeductionForm({\n employeeId,\n garnishmentId: deduction?.uuid,\n courtOrdered,\n defaultValues: courtOrdered && garnishmentType ? { garnishmentType } : undefined,\n })\n\n if (form.isLoading) {\n return <BaseLayout isLoading error={form.errorHandling.errors} />\n }\n\n const { Fields } = form.form\n return (\n <ReadyForm\n form={form}\n Fields={Fields}\n Components={Components}\n t={t}\n title={title}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )\n}\n\n// Split into a child component so we can call `useWatch` on the form's control\n// only once the hook is in its ready state (the control reference exists then).\nfunction ReadyForm({\n form,\n Fields,\n Components,\n t,\n title,\n onSaved,\n onCancel,\n}: {\n form: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>\n Fields: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>['form']['Fields']\n Components: ReturnType<typeof useComponentContext>\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t']\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}) {\n // useWatch subscribes to changes; getValues only reads once. We need the\n // subscription because `Fields.Amount`'s `format` and `description` props\n // need to re-render when the user toggles Percentage / Fixed amount.\n // The RadioGroup's options carry string values (`'true'`/`'false'`), which\n // round-trip into form state as strings — only `coerceStringBoolean` in the\n // zod preprocessor turns them into actual booleans at validation time. So\n // here we explicitly compare against both shapes; `Boolean('false')` would\n // be truthy and surface the wrong copy under the Amount field.\n const watchedDeductAsPercentageRaw = useWatch({\n control: form.form.hookFormInternals.formMethods.control as Control<DeductionFormData>,\n name: 'deductAsPercentage',\n }) as boolean | 'true' | 'false' | undefined\n const watchedDeductAsPercentage =\n watchedDeductAsPercentageRaw === true || watchedDeductAsPercentageRaw === 'true'\n\n const handleSubmit = async () => {\n const result = await form.actions.onSubmit()\n if (result) onSaved(result.data, result.mode)\n }\n\n return (\n <BaseLayout error={form.errorHandling.errors}>\n <SDKFormProvider formHookResult={form}>\n <Form onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{title}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.Description\n label={t('standard.descriptionLabel')}\n validationMessages={{ REQUIRED: t('standard.descriptionRequired') }}\n />\n <Fields.Recurring\n label={t('standard.frequencyLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.frequencyRecurring') : t('standard.frequencyOneTime')\n }\n validationMessages={{ REQUIRED: t('standard.frequencyRequired') }}\n />\n <Fields.DeductAsPercentage\n label={t('standard.typeLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.typePercentage') : t('standard.typeFixed')\n }\n validationMessages={{ REQUIRED: t('standard.typeRequired') }}\n />\n <Fields.Amount\n label={t('standard.amountLabel')}\n format={watchedDeductAsPercentage ? 'percent' : 'currency'}\n description={\n watchedDeductAsPercentage\n ? t('standard.amountPercentDescription')\n : t('standard.amountFixedDescription')\n }\n min={0}\n validationMessages={{\n REQUIRED: t('standard.amountRequired'),\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n {Fields.TotalAmount && Fields.AnnualMaximum && (\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.TotalAmount\n label={t('standard.totalAmountLabel')}\n description={t('standard.totalAmountDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n <Fields.AnnualMaximum\n label={t('standard.annualMaxLabel')}\n description={t('standard.annualMaxDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={form.status.isPending}>\n {t('actions.save')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n"],"names":["StandardDeductionForm","employeeId","deduction","courtOrdered","garnishmentType","title","onSaved","onCancel","t","useTranslation","Components","useComponentContext","form","useDeductionForm","BaseLayout","Fields","jsx","ReadyForm","watchedDeductAsPercentageRaw","useWatch","watchedDeductAsPercentage","handleSubmit","result","SDKFormProvider","Form","jsxs","Flex","value","ActionsLayout"],"mappings":";;;;;;;;;;;AAiCO,SAASA,EAAsB;AAAA,EACpC,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAA+B;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA,GAEbC,IAAOC,EAAiB;AAAA,IAC5B,YAAAZ;AAAA,IACA,eAAeC,GAAW;AAAA,IAC1B,cAAAC;AAAA,IACA,eAAeA,KAAgBC,IAAkB,EAAE,iBAAAA,MAAoB;AAAA,EAAA,CACxE;AAED,MAAIQ,EAAK;AACP,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAK,cAAc,QAAQ;AAGjE,QAAM,EAAE,QAAAG,MAAWH,EAAK;AACxB,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAL;AAAA,MACA,QAAAG;AAAA,MACA,YAAAL;AAAA,MACA,GAAAF;AA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,GAEJ;AAAA,sBACCoB,GAAA,EACC,UAAA;AAAA,MAAA,gBAAAZ,EAACN,EAAW,QAAX,EAAkB,SAAQ,aAAY,MAAK,UAAS,SAASH,GAC3D,UAAAC,EAAE,gBAAgB,EAAA,CACrB;AAAA,MACA,gBAAAQ,EAACN,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWE,EAAK,OAAO,WACrD,UAAAJ,EAAE,cAAc,EAAA,CACnB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"StandardDeductionForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/DeductionsForm/StandardDeductionForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWatch } from 'react-hook-form'\nimport type {\n Garnishment,\n GarnishmentType,\n} from '@gusto/embedded-api/models/components/garnishment'\nimport type { Control } from 'react-hook-form'\nimport { useDeductionForm } from '../useDeductionForm'\nimport type { DeductionFormData } from '../useDeductionForm'\nimport { Form } from '@/components/Common/Form'\nimport { ActionsLayout } from '@/components/Common'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { BaseLayout } from '@/components/Base/Base'\nimport { SDKFormProvider } from '@/partner-hook-utils/form/SDKFormProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\ninterface StandardDeductionFormProps {\n employeeId: string\n deduction: Garnishment | null\n /** Court-ordered garnishments require `garnishmentType`. Custom deductions don't. */\n courtOrdered: boolean\n /** Only meaningful when `courtOrdered: true`. Selects the garnishment type\n * on create. Ignored in edit mode (the existing type is preserved). */\n garnishmentType?: GarnishmentType\n /** Section heading shown above the form. The parent picker is responsible\n * for translating the garnishment-type label so this component doesn't\n * need to repeat the labels mapping. */\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}\n\n/** @internal */\nexport function StandardDeductionForm({\n employeeId,\n deduction,\n courtOrdered,\n garnishmentType,\n title,\n onSaved,\n onCancel,\n}: StandardDeductionFormProps) {\n const { t } = useTranslation('Employee.DeductionsForm')\n const Components = useComponentContext()\n\n const form = useDeductionForm({\n employeeId,\n garnishmentId: deduction?.uuid,\n courtOrdered,\n defaultValues: courtOrdered && garnishmentType ? { garnishmentType } : undefined,\n })\n\n if (form.isLoading) {\n return <BaseLayout isLoading error={form.errorHandling.errors} />\n }\n\n const { Fields } = form.form\n return (\n <ReadyForm\n form={form}\n Fields={Fields}\n Components={Components}\n t={t}\n title={title}\n onSaved={onSaved}\n onCancel={onCancel}\n />\n )\n}\n\n// Split into a child component so we can call `useWatch` on the form's control\n// only once the hook is in its ready state (the control reference exists then).\nfunction ReadyForm({\n form,\n Fields,\n Components,\n t,\n title,\n onSaved,\n onCancel,\n}: {\n form: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>\n Fields: Extract<ReturnType<typeof useDeductionForm>, { isLoading: false }>['form']['Fields']\n Components: ReturnType<typeof useComponentContext>\n t: ReturnType<typeof useTranslation<'Employee.DeductionsForm'>>['t']\n title: string\n onSaved: (deduction: Garnishment, mode: 'create' | 'update') => void\n onCancel: () => void\n}) {\n // useWatch subscribes to changes; getValues only reads once. We need the\n // subscription because `Fields.Amount`'s `format` and `description` props\n // need to re-render when the user toggles Percentage / Fixed amount.\n // The RadioGroup's options carry string values (`'true'`/`'false'`), which\n // round-trip into form state as strings — only `coerceStringBoolean` in the\n // zod preprocessor turns them into actual booleans at validation time. So\n // here we explicitly compare against both shapes; `Boolean('false')` would\n // be truthy and surface the wrong copy under the Amount field.\n const watchedDeductAsPercentageRaw = useWatch({\n control: form.form.hookFormInternals.formMethods.control as Control<DeductionFormData>,\n name: 'deductAsPercentage',\n }) as boolean | 'true' | 'false' | undefined\n const watchedDeductAsPercentage =\n watchedDeductAsPercentageRaw === true || watchedDeductAsPercentageRaw === 'true'\n\n const handleSubmit = async () => {\n const result = await form.actions.onSubmit()\n if (result) onSaved(result.data, result.mode)\n }\n\n return (\n <BaseLayout error={form.errorHandling.errors}>\n <SDKFormProvider formHookResult={form}>\n <Form onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n <Components.Heading as=\"h3\">{title}</Components.Heading>\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.Description\n label={t('standard.descriptionLabel')}\n validationMessages={{ REQUIRED: t('standard.descriptionRequired') }}\n />\n <Fields.Recurring\n label={t('standard.frequencyLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.frequencyRecurring') : t('standard.frequencyOneTime')\n }\n validationMessages={{ REQUIRED: t('standard.frequencyRequired') }}\n />\n <Fields.DeductAsPercentage\n label={t('standard.typeLabel')}\n getOptionLabel={(value: boolean) =>\n value ? t('standard.typePercentage') : t('standard.typeFixed')\n }\n validationMessages={{ REQUIRED: t('standard.typeRequired') }}\n />\n <Fields.Amount\n label={t('standard.amountLabel')}\n format={watchedDeductAsPercentage ? 'percent' : 'currency'}\n description={\n watchedDeductAsPercentage\n ? t('standard.amountPercentDescription')\n : t('standard.amountFixedDescription')\n }\n min={0}\n validationMessages={{\n REQUIRED: t('standard.amountRequired'),\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n {Fields.TotalAmount && Fields.AnnualMaximum && (\n <Flex flexDirection=\"column\" gap={20}>\n <Fields.TotalAmount\n label={t('standard.totalAmountLabel')}\n description={t('standard.totalAmountDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n <Fields.AnnualMaximum\n label={t('standard.annualMaxLabel')}\n description={t('standard.annualMaxDescription')}\n format=\"currency\"\n min={0}\n validationMessages={{\n NEGATIVE_AMOUNT: t('standard.amountNonNegative'),\n }}\n />\n </Flex>\n )}\n </Flex>\n <ActionsLayout>\n <Components.Button variant=\"secondary\" type=\"button\" onClick={onCancel}>\n {t('actions.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={form.status.isPending}>\n {t('actions.save')}\n </Components.Button>\n </ActionsLayout>\n </Flex>\n </Form>\n </SDKFormProvider>\n </BaseLayout>\n )\n}\n"],"names":["StandardDeductionForm","employeeId","deduction","courtOrdered","garnishmentType","title","onSaved","onCancel","t","useTranslation","Components","useComponentContext","form","useDeductionForm","BaseLayout","Fields","jsx","ReadyForm","watchedDeductAsPercentageRaw","useWatch","watchedDeductAsPercentage","handleSubmit","result","SDKFormProvider","Form","jsxs","Flex","value","ActionsLayout"],"mappings":";;;;;;;;;;;AAiCO,SAASA,EAAsB;AAAA,EACpC,YAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAA+B;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,yBAAyB,GAChDC,IAAaC,EAAA,GAEbC,IAAOC,EAAiB;AAAA,IAC5B,YAAAZ;AAAA,IACA,eAAeC,GAAW;AAAA,IAC1B,cAAAC;AAAA,IACA,eAAeA,KAAgBC,IAAkB,EAAE,iBAAAA,MAAoB;AAAA,EAAA,CACxE;AAED,MAAIQ,EAAK;AACP,6BAAQE,GAAA,EAAW,WAAS,IAAC,OAAOF,EAAK,cAAc,QAAQ;AAGjE,QAAM,EAAE,QAAAG,MAAWH,EAAK;AACxB,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAL;AAAA,MACA,QAAAG;AAAA,MACA,YAAAL;AAAA,MACA,GAAAF;AAAA,MACA,OAAAH;AAAA,MACA,SAAAC;AAAA,MACA,UAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAIA,SAASU,EAAU;AAAA,EACjB,MAAAL;AAAA,EACA,QAAAG;AAAA,EACA,YAAAL;AAAA,EACA,GAAAF;AAAA,EACA,OAAAH;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,GAQG;AASD,QAAMW,IAA+BC,EA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,EAAA,CACnB;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,GACF,EAAA,CACF,GACF,GACF;AAEJ;"}
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { Garnishment } from '@gusto/embedded-api-v-2026-02-01/models/components/garnishment';
2
+ import { Garnishment } from '@gusto/embedded-api/models/components/garnishment';
3
3
  /**
4
4
  * Presentational confirm dialog for deleting a deduction. All copy is
5
5
  * passed in by the caller so each consumer owns its own translation strings
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteDeductionDialog.js","sources":["../../../../../src/components/Employee/Deductions/shared/DeleteDeductionDialog.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { Garnishment } from '@gusto/embedded-api-v-2026-02-01/models/components/garnishment'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/**\n * Presentational confirm dialog for deleting a deduction. All copy is\n * passed in by the caller so each consumer owns its own translation strings\n * — partner overrides on one flow's namespace won't leak into another.\n *\n * @internal\n */\nexport function DeleteDeductionDialog({\n pendingDeleteDeduction,\n isPrimaryActionLoading,\n onClose,\n onConfirm,\n title,\n description,\n confirmLabel,\n cancelLabel,\n}: {\n pendingDeleteDeduction: Garnishment | null\n isPrimaryActionLoading: boolean\n onClose: () => void\n onConfirm: () => void\n title: string\n description: ReactNode\n confirmLabel: string\n cancelLabel: string\n}) {\n const Components = useComponentContext()\n return (\n <Components.Dialog\n isOpen={pendingDeleteDeduction !== null}\n onClose={onClose}\n onPrimaryActionClick={onConfirm}\n isPrimaryActionLoading={isPrimaryActionLoading}\n isDestructive\n title={title}\n primaryActionLabel={confirmLabel}\n closeActionLabel={cancelLabel}\n >\n {pendingDeleteDeduction && description}\n </Components.Dialog>\n )\n}\n"],"names":["DeleteDeductionDialog","pendingDeleteDeduction","isPrimaryActionLoading","onClose","onConfirm","title","description","confirmLabel","cancelLabel","Components","useComponentContext","jsx"],"mappings":";;AAWO,SAASA,EAAsB;AAAA,EACpC,wBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AACF,GASG;AACD,QAAMC,IAAaC,EAAA;AACnB,SACE,gBAAAC;AAAA,IAACF,EAAW;AAAA,IAAX;AAAA,MACC,QAAQR,MAA2B;AAAA,MACnC,SAAAE;AAAA,MACA,sBAAsBC;AAAA,MACtB,wBAAAF;AAAA,MACA,eAAa;AAAA,MACb,OAAAG;AAAA,MACA,oBAAoBE;AAAA,MACpB,kBAAkBC;AAAA,MAEjB,UAAAP,KAA0BK;AAAA,IAAA;AAAA,EAAA;AAGjC;"}
1
+ {"version":3,"file":"DeleteDeductionDialog.js","sources":["../../../../../src/components/Employee/Deductions/shared/DeleteDeductionDialog.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\nimport type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\n/**\n * Presentational confirm dialog for deleting a deduction. All copy is\n * passed in by the caller so each consumer owns its own translation strings\n * — partner overrides on one flow's namespace won't leak into another.\n *\n * @internal\n */\nexport function DeleteDeductionDialog({\n pendingDeleteDeduction,\n isPrimaryActionLoading,\n onClose,\n onConfirm,\n title,\n description,\n confirmLabel,\n cancelLabel,\n}: {\n pendingDeleteDeduction: Garnishment | null\n isPrimaryActionLoading: boolean\n onClose: () => void\n onConfirm: () => void\n title: string\n description: ReactNode\n confirmLabel: string\n cancelLabel: string\n}) {\n const Components = useComponentContext()\n return (\n <Components.Dialog\n isOpen={pendingDeleteDeduction !== null}\n onClose={onClose}\n onPrimaryActionClick={onConfirm}\n isPrimaryActionLoading={isPrimaryActionLoading}\n isDestructive\n title={title}\n primaryActionLabel={confirmLabel}\n closeActionLabel={cancelLabel}\n >\n {pendingDeleteDeduction && description}\n </Components.Dialog>\n )\n}\n"],"names":["DeleteDeductionDialog","pendingDeleteDeduction","isPrimaryActionLoading","onClose","onConfirm","title","description","confirmLabel","cancelLabel","Components","useComponentContext","jsx"],"mappings":";;AAWO,SAASA,EAAsB;AAAA,EACpC,wBAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,aAAAC;AACF,GASG;AACD,QAAMC,IAAaC,EAAA;AACnB,SACE,gBAAAC;AAAA,IAACF,EAAW;AAAA,IAAX;AAAA,MACC,QAAQR,MAA2B;AAAA,MACnC,SAAAE;AAAA,MACA,sBAAsBC;AAAA,MACtB,wBAAAF;AAAA,MACA,eAAa;AAAA,MACb,OAAAG;AAAA,MACA,oBAAoBE;AAAA,MACpB,kBAAkBC;AAAA,MAEjB,UAAAP,KAA0BK;AAAA,IAAA;AAAA,EAAA;AAGjC;"}
@@ -1,4 +1,4 @@
1
- import { Garnishment } from '@gusto/embedded-api-v-2026-02-01/models/components/garnishment';
1
+ import { Garnishment } from '@gusto/embedded-api/models/components/garnishment';
2
2
  /** @internal */
3
3
  export interface DeductionAmountFormatters {
4
4
  formatCurrency: (value: number) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"formatDeductionAmount.js","sources":["../../../../../src/components/Employee/Deductions/shared/formatDeductionAmount.ts"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api-v-2026-02-01/models/components/garnishment'\n\n/** @internal */\nexport interface DeductionAmountFormatters {\n formatCurrency: (value: number) => string\n formatPercent: (value: number) => string\n formatPerPaycheck: (value: string) => string\n}\n\n/** @internal */\nexport function formatDeductionAmount(\n deduction: Pick<Garnishment, 'amount' | 'deductAsPercentage' | 'recurring' | 'payPeriodMaximum'>,\n { formatCurrency, formatPercent, formatPerPaycheck }: DeductionAmountFormatters,\n): string {\n const numericAmount = Number(deduction.amount)\n if (Number.isNaN(numericAmount)) return '-'\n\n // Child-support garnishments are always stored as `deductAsPercentage: true`,\n // but the percentage is optional — a user may withhold only a fixed dollar\n // amount (`payPeriodMaximum`). Rendering that as \"0% per paycheck\" is\n // misleading (SDK-945). When there's no percentage, show the dollar cap the\n // user actually entered, or \"-\" when neither is set.\n if (deduction.deductAsPercentage && numericAmount === 0) {\n const cap = Number(deduction.payPeriodMaximum ?? 0)\n if (!Number.isNaN(cap) && cap > 0) {\n const capFormatted = formatCurrency(cap)\n return deduction.recurring ? formatPerPaycheck(capFormatted) : capFormatted\n }\n return '-'\n }\n\n const formatted = deduction.deductAsPercentage\n ? formatPercent(numericAmount)\n : formatCurrency(numericAmount)\n return deduction.recurring ? formatPerPaycheck(formatted) : formatted\n}\n"],"names":["formatDeductionAmount","deduction","formatCurrency","formatPercent","formatPerPaycheck","numericAmount","cap","capFormatted","formatted"],"mappings":"AAUO,SAASA,EACdC,GACA,EAAE,gBAAAC,GAAgB,eAAAC,GAAe,mBAAAC,KACzB;AACR,QAAMC,IAAgB,OAAOJ,EAAU,MAAM;AAC7C,MAAI,OAAO,MAAMI,CAAa,EAAG,QAAO;AAOxC,MAAIJ,EAAU,sBAAsBI,MAAkB,GAAG;AACvD,UAAMC,IAAM,OAAOL,EAAU,oBAAoB,CAAC;AAClD,QAAI,CAAC,OAAO,MAAMK,CAAG,KAAKA,IAAM,GAAG;AACjC,YAAMC,IAAeL,EAAeI,CAAG;AACvC,aAAOL,EAAU,YAAYG,EAAkBG,CAAY,IAAIA;AAAA,IACjE;AACA,WAAO;AAAA,EACT;AAEA,QAAMC,IAAYP,EAAU,qBACxBE,EAAcE,CAAa,IAC3BH,EAAeG,CAAa;AAChC,SAAOJ,EAAU,YAAYG,EAAkBI,CAAS,IAAIA;AAC9D;"}
1
+ {"version":3,"file":"formatDeductionAmount.js","sources":["../../../../../src/components/Employee/Deductions/shared/formatDeductionAmount.ts"],"sourcesContent":["import type { Garnishment } from '@gusto/embedded-api/models/components/garnishment'\n\n/** @internal */\nexport interface DeductionAmountFormatters {\n formatCurrency: (value: number) => string\n formatPercent: (value: number) => string\n formatPerPaycheck: (value: string) => string\n}\n\n/** @internal */\nexport function formatDeductionAmount(\n deduction: Pick<Garnishment, 'amount' | 'deductAsPercentage' | 'recurring' | 'payPeriodMaximum'>,\n { formatCurrency, formatPercent, formatPerPaycheck }: DeductionAmountFormatters,\n): string {\n const numericAmount = Number(deduction.amount)\n if (Number.isNaN(numericAmount)) return '-'\n\n // Child-support garnishments are always stored as `deductAsPercentage: true`,\n // but the percentage is optional — a user may withhold only a fixed dollar\n // amount (`payPeriodMaximum`). Rendering that as \"0% per paycheck\" is\n // misleading (SDK-945). When there's no percentage, show the dollar cap the\n // user actually entered, or \"-\" when neither is set.\n if (deduction.deductAsPercentage && numericAmount === 0) {\n const cap = Number(deduction.payPeriodMaximum ?? 0)\n if (!Number.isNaN(cap) && cap > 0) {\n const capFormatted = formatCurrency(cap)\n return deduction.recurring ? formatPerPaycheck(capFormatted) : capFormatted\n }\n return '-'\n }\n\n const formatted = deduction.deductAsPercentage\n ? formatPercent(numericAmount)\n : formatCurrency(numericAmount)\n return deduction.recurring ? formatPerPaycheck(formatted) : formatted\n}\n"],"names":["formatDeductionAmount","deduction","formatCurrency","formatPercent","formatPerPaycheck","numericAmount","cap","capFormatted","formatted"],"mappings":"AAUO,SAASA,EACdC,GACA,EAAE,gBAAAC,GAAgB,eAAAC,GAAe,mBAAAC,KACzB;AACR,QAAMC,IAAgB,OAAOJ,EAAU,MAAM;AAC7C,MAAI,OAAO,MAAMI,CAAa,EAAG,QAAO;AAOxC,MAAIJ,EAAU,sBAAsBI,MAAkB,GAAG;AACvD,UAAMC,IAAM,OAAOL,EAAU,oBAAoB,CAAC;AAClD,QAAI,CAAC,OAAO,MAAMK,CAAG,KAAKA,IAAM,GAAG;AACjC,YAAMC,IAAeL,EAAeI,CAAG;AACvC,aAAOL,EAAU,YAAYG,EAAkBG,CAAY,IAAIA;AAAA,IACjE;AACA,WAAO;AAAA,EACT;AAEA,QAAMC,IAAYP,EAAU,qBACxBE,EAAcE,CAAa,IAC3BH,EAAeG,CAAa;AAChC,SAAOJ,EAAU,YAAYG,EAAkBI,CAAS,IAAIA;AAC9D;"}
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { Agencies } from '@gusto/embedded-api-v-2026-02-01/models/components/childsupportdata';
2
+ import { Agencies } from '@gusto/embedded-api/models/components/childsupportdata';
3
3
  /**
4
4
  * Validation error codes emitted by the child support garnishment form schema.
5
5
  * Map these codes to localized copy in `validationMessages` when composing the
@@ -1,5 +1,5 @@
1
1
  import { z as e } from "zod";
2
- import { PaymentPeriod as c } from "@gusto/embedded-api-v-2026-02-01/models/components/garnishmentchildsupport";
2
+ import { PaymentPeriod as c } from "@gusto/embedded-api/models/components/garnishmentchildsupport";
3
3
  import { buildFormSchema as d } from "../../../../../partner-hook-utils/form/buildFormSchema.js";
4
4
  import { coerceNaN as u } from "../../../../../partner-hook-utils/form/preprocessors.js";
5
5
  const i = {
@@ -1 +1 @@
1
- {"version":3,"file":"childSupportGarnishmentFormSchema.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport { PaymentPeriod } from '@gusto/embedded-api-v-2026-02-01/models/components/garnishmentchildsupport'\nimport type { Agencies } from '@gusto/embedded-api-v-2026-02-01/models/components/childsupportdata'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN } from '@/partner-hook-utils/form/preprocessors'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\n/**\n * Validation error codes emitted by the child support garnishment form schema.\n * Map these codes to localized copy in `validationMessages` when composing the\n * hook.\n *\n * @public\n */\nexport const ChildSupportGarnishmentFormErrorCodes = {\n REQUIRED: 'REQUIRED',\n NEGATIVE_AMOUNT: 'NEGATIVE_AMOUNT',\n PERCENT_OUT_OF_RANGE: 'PERCENT_OUT_OF_RANGE',\n} as const\n\n/**\n * Union of validation error code strings emitted by the child support\n * garnishment form schema.\n *\n * @public\n */\nexport type ChildSupportGarnishmentFormErrorCode =\n (typeof ChildSupportGarnishmentFormErrorCodes)[keyof typeof ChildSupportGarnishmentFormErrorCodes]\n\n// ── Required-attribute keys recognized from the API ────────────────────\n\n/**\n * Child support attribute keys that the form recognizes. Each state agency\n * declares which of these keys it requires; the hook exposes the resolved\n * subset via `requiredAttrKeys` so callers can drive their own UI on which\n * `caseNumber` / `orderNumber` / `remittanceNumber` fields are required.\n *\n * @public\n */\nexport const SUPPORTED_REQUIRED_ATTR_KEYS = [\n 'case_number',\n 'order_number',\n 'remittance_number',\n] as const\n\n/**\n * Union of child support attribute key strings recognized by the form.\n *\n * @public\n */\nexport type SupportedRequiredAttrKey = (typeof SUPPORTED_REQUIRED_ATTR_KEYS)[number]\n\n/** @internal */\nexport function getRequiredAttrKeys(agency?: Agencies | null): Set<SupportedRequiredAttrKey> {\n const keys = new Set<SupportedRequiredAttrKey>()\n if (!agency?.requiredAttributes) return keys\n for (const attr of agency.requiredAttributes) {\n if (!attr.key) continue\n if ((SUPPORTED_REQUIRED_ATTR_KEYS as readonly string[]).includes(attr.key)) {\n keys.add(attr.key as SupportedRequiredAttrKey)\n }\n }\n return keys\n}\n\n// ── Field validators ───────────────────────────────────────────────────\n\nconst PERCENT_MIN = 0\nconst PERCENT_MAX = 100\n\nconst fieldValidators = {\n state: z.string(),\n fipsCode: z.string(),\n caseNumber: z.string(),\n orderNumber: z.string(),\n remittanceNumber: z.string(),\n // Currency cap on the pay-period — required, ≥ 0.\n payPeriodMaximum: z.preprocess(\n coerceNaN(0),\n z.number().min(0, { message: ChildSupportGarnishmentFormErrorCodes.NEGATIVE_AMOUNT }),\n ),\n // Percentage of paycheck, 0-100. Required.\n amount: z.preprocess(\n coerceNaN(0),\n z\n .number()\n .min(PERCENT_MIN, {\n message: ChildSupportGarnishmentFormErrorCodes.PERCENT_OUT_OF_RANGE,\n })\n .max(PERCENT_MAX, {\n message: ChildSupportGarnishmentFormErrorCodes.PERCENT_OUT_OF_RANGE,\n }),\n ),\n paymentPeriod: z.enum(PaymentPeriod),\n}\n\n/**\n * Shape of the values managed by the child support garnishment form.\n *\n * @public\n * @interface\n */\nexport type ChildSupportGarnishmentFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\n/** @internal */\nexport type ChildSupportGarnishmentFormOutputs = ChildSupportGarnishmentFormData\n\n// ── Required fields config ─────────────────────────────────────────────\n//\n// `state`, `fipsCode`, `payPeriodMaximum`, `amount`, `paymentPeriod` are\n// always required. The three agency-attribute fields toggle requiredness\n// based on the currently selected agency — see `createChildSupportGarnishmentFormSchema`\n// which assigns 'always' / 'never' per call.\n\n/** @internal */\ninterface ChildSupportGarnishmentFormSchemaOptions {\n mode?: 'create' | 'update'\n /**\n * The agency record matching the currently selected `state`. Used only when\n * `agencyList` is not provided — `requiredAttributes` are pinned to this\n * single agency, so the schema must be rebuilt whenever the user picks a\n * different state. Prefer passing `agencyList` instead so requiredness\n * tracks the form's `state` value dynamically.\n */\n selectedAgency?: Agencies | null\n /**\n * Full list of agencies. When provided, the schema's requiredness for\n * `caseNumber` / `orderNumber` / `remittanceNumber` is computed at validation\n * time by looking up the agency whose `state` matches the form's `state`\n * value — so a single schema instance stays correct as the user changes\n * states. Takes precedence over `selectedAgency`.\n */\n agencyList?: readonly Agencies[]\n}\n\n/** @internal */\nexport function createChildSupportGarnishmentFormSchema({\n mode = 'create',\n selectedAgency,\n agencyList,\n}: ChildSupportGarnishmentFormSchemaOptions = {}) {\n // Read `data.state` eagerly (outside the `agencyList.find` callback) so that\n // `buildFormSchema`'s proxy-based predicate-dep detection always observes\n // the `state` access — otherwise an empty `agencyList` at schema-build time\n // would short-circuit the `find` before the proxy sees `data.state` and\n // `useDeriveFieldsMetadata` would treat the field metadata as static.\n const requiredFieldsConfig = agencyList\n ? ({\n caseNumber: data => {\n const state = data.state\n return getRequiredAttrKeys(agencyList.find(a => a.state === state)).has('case_number')\n },\n orderNumber: data => {\n const state = data.state\n return getRequiredAttrKeys(agencyList.find(a => a.state === state)).has('order_number')\n },\n remittanceNumber: data => {\n const state = data.state\n return getRequiredAttrKeys(agencyList.find(a => a.state === state)).has(\n 'remittance_number',\n )\n },\n } satisfies RequiredFieldConfig<typeof fieldValidators>)\n : (() => {\n const requiredAttrKeys = getRequiredAttrKeys(selectedAgency)\n return {\n caseNumber: requiredAttrKeys.has('case_number') ? 'always' : 'never',\n orderNumber: requiredAttrKeys.has('order_number') ? 'always' : 'never',\n remittanceNumber: requiredAttrKeys.has('remittance_number') ? 'always' : 'never',\n } satisfies RequiredFieldConfig<typeof fieldValidators>\n })()\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: ChildSupportGarnishmentFormErrorCodes.REQUIRED,\n mode,\n })\n}\n"],"names":["ChildSupportGarnishmentFormErrorCodes","SUPPORTED_REQUIRED_ATTR_KEYS","getRequiredAttrKeys","agency","keys","attr","PERCENT_MIN","PERCENT_MAX","fieldValidators","z","coerceNaN","PaymentPeriod","createChildSupportGarnishmentFormSchema","mode","selectedAgency","agencyList","requiredFieldsConfig","data","state","a","requiredAttrKeys","buildFormSchema"],"mappings":";;;;AAkBO,MAAMA,IAAwC;AAAA,EACnD,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,sBAAsB;AACxB,GAqBaC,IAA+B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AACF;AAUO,SAASC,EAAoBC,GAAyD;AAC3F,QAAMC,wBAAW,IAAA;AACjB,MAAI,CAACD,GAAQ,mBAAoB,QAAOC;AACxC,aAAWC,KAAQF,EAAO;AACxB,IAAKE,EAAK,OACLJ,EAAmD,SAASI,EAAK,GAAG,KACvED,EAAK,IAAIC,EAAK,GAA+B;AAGjD,SAAOD;AACT;AAIA,MAAME,IAAc,GACdC,IAAc,KAEdC,IAAkB;AAAA,EACtB,OAAOC,EAAE,OAAA;AAAA,EACT,UAAUA,EAAE,OAAA;AAAA,EACZ,Y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AAA,MAC7D,aAAaA,EAAiB,IAAI,cAAc,IAAI,WAAW;AAAA,MAC/D,kBAAkBA,EAAiB,IAAI,mBAAmB,IAAI,WAAW;AAAA,IAAA;AAAA,EAE7E,GAAA;AAEJ,SAAOC,EAAgBb,GAAiB;AAAA,IACtC,sBAAAQ;AAAA,IACA,mBAAmBhB,EAAsC;AAAA,IACzD,MAAAa;AAAA,EAAA,CACD;AACH;"}
1
+ {"version":3,"file":"childSupportGarnishmentFormSchema.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/childSupportGarnishmentFormSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport type { Agencies } from '@gusto/embedded-api/models/components/childsupportdata'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN } from '@/partner-hook-utils/form/preprocessors'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\n/**\n * Validation error codes emitted by the child support garnishment form schema.\n * Map these codes to localized copy in `validationMessages` when composing the\n * hook.\n *\n * @public\n */\nexport const ChildSupportGarnishmentFormErrorCodes = {\n REQUIRED: 'REQUIRED',\n NEGATIVE_AMOUNT: 'NEGATIVE_AMOUNT',\n PERCENT_OUT_OF_RANGE: 'PERCENT_OUT_OF_RANGE',\n} as const\n\n/**\n * Union of validation error code strings emitted by the child support\n * garnishment form schema.\n *\n * @public\n */\nexport type ChildSupportGarnishmentFormErrorCode =\n (typeof ChildSupportGarnishmentFormErrorCodes)[keyof typeof ChildSupportGarnishmentFormErrorCodes]\n\n// ── Required-attribute keys recognized from the API ────────────────────\n\n/**\n * Child support attribute keys that the form recognizes. Each state agency\n * declares which of these keys it requires; the hook exposes the resolved\n * subset via `requiredAttrKeys` so callers can drive their own UI on which\n * `caseNumber` / `orderNumber` / `remittanceNumber` fields are required.\n *\n * @public\n */\nexport const SUPPORTED_REQUIRED_ATTR_KEYS = [\n 'case_number',\n 'order_number',\n 'remittance_number',\n] as const\n\n/**\n * Union of child support attribute key strings recognized by the form.\n *\n * @public\n */\nexport type SupportedRequiredAttrKey = (typeof SUPPORTED_REQUIRED_ATTR_KEYS)[number]\n\n/** @internal */\nexport function getRequiredAttrKeys(agency?: Agencies | null): Set<SupportedRequiredAttrKey> {\n const keys = new Set<SupportedRequiredAttrKey>()\n if (!agency?.requiredAttributes) return keys\n for (const attr of agency.requiredAttributes) {\n if (!attr.key) continue\n if ((SUPPORTED_REQUIRED_ATTR_KEYS as readonly string[]).includes(attr.key)) {\n keys.add(attr.key as SupportedRequiredAttrKey)\n }\n }\n return keys\n}\n\n// ── Field validators ───────────────────────────────────────────────────\n\nconst PERCENT_MIN = 0\nconst PERCENT_MAX = 100\n\nconst fieldValidators = {\n state: z.string(),\n fipsCode: z.string(),\n caseNumber: z.string(),\n orderNumber: z.string(),\n remittanceNumber: z.string(),\n // Currency cap on the pay-period — required, ≥ 0.\n payPeriodMaximum: z.preprocess(\n coerceNaN(0),\n z.number().min(0, { message: ChildSupportGarnishmentFormErrorCodes.NEGATIVE_AMOUNT }),\n ),\n // Percentage of paycheck, 0-100. Required.\n amount: z.preprocess(\n coerceNaN(0),\n z\n .number()\n .min(PERCENT_MIN, {\n message: ChildSupportGarnishmentFormErrorCodes.PERCENT_OUT_OF_RANGE,\n })\n .max(PERCENT_MAX, {\n message: ChildSupportGarnishmentFormErrorCodes.PERCENT_OUT_OF_RANGE,\n }),\n ),\n paymentPeriod: z.enum(PaymentPeriod),\n}\n\n/**\n * Shape of the values managed by the child support garnishment form.\n *\n * @public\n * @interface\n */\nexport type ChildSupportGarnishmentFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\n/** @internal */\nexport type ChildSupportGarnishmentFormOutputs = ChildSupportGarnishmentFormData\n\n// ── Required fields config ─────────────────────────────────────────────\n//\n// `state`, `fipsCode`, `payPeriodMaximum`, `amount`, `paymentPeriod` are\n// always required. The three agency-attribute fields toggle requiredness\n// based on the currently selected agency — see `createChildSupportGarnishmentFormSchema`\n// which assigns 'always' / 'never' per call.\n\n/** @internal */\ninterface ChildSupportGarnishmentFormSchemaOptions {\n mode?: 'create' | 'update'\n /**\n * The agency record matching the currently selected `state`. Used only when\n * `agencyList` is not provided — `requiredAttributes` are pinned to this\n * single agency, so the schema must be rebuilt whenever the user picks a\n * different state. Prefer passing `agencyList` instead so requiredness\n * tracks the form's `state` value dynamically.\n */\n selectedAgency?: Agencies | null\n /**\n * Full list of agencies. When provided, the schema's requiredness for\n * `caseNumber` / `orderNumber` / `remittanceNumber` is computed at validation\n * time by looking up the agency whose `state` matches the form's `state`\n * value — so a single schema instance stays correct as the user changes\n * states. Takes precedence over `selectedAgency`.\n */\n agencyList?: readonly Agencies[]\n}\n\n/** @internal */\nexport function createChildSupportGarnishmentFormSchema({\n mode = 'create',\n selectedAgency,\n agencyList,\n}: ChildSupportGarnishmentFormSchemaOptions = {}) {\n // Read `data.state` eagerly (outside the `agencyList.find` callback) so that\n // `buildFormSchema`'s proxy-based predicate-dep detection always observes\n // the `state` access — otherwise an empty `agencyList` at schema-build time\n // would short-circuit the `find` before the proxy sees `data.state` and\n // `useDeriveFieldsMetadata` would treat the field metadata as static.\n const requiredFieldsConfig = agencyList\n ? ({\n caseNumber: data => {\n const state = data.state\n return getRequiredAttrKeys(agencyList.find(a => a.state === state)).has('case_number')\n },\n orderNumber: data => {\n const state = data.state\n return getRequiredAttrKeys(agencyList.find(a => a.state === state)).has('order_number')\n },\n remittanceNumber: data => {\n const state = data.state\n return getRequiredAttrKeys(agencyList.find(a => a.state === state)).has(\n 'remittance_number',\n )\n },\n } satisfies RequiredFieldConfig<typeof fieldValidators>)\n : (() => {\n const requiredAttrKeys = getRequiredAttrKeys(selectedAgency)\n return {\n caseNumber: requiredAttrKeys.has('case_number') ? 'always' : 'never',\n orderNumber: requiredAttrKeys.has('order_number') ? 'always' : 'never',\n remittanceNumber: requiredAttrKeys.has('remittance_number') ? 'always' : 'never',\n } satisfies RequiredFieldConfig<typeof fieldValidators>\n })()\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: ChildSupportGarnishmentFormErrorCodes.REQUIRED,\n mode,\n })\n}\n"],"names":["ChildSupportGarnishmentFormErrorCodes","SUPPORTED_REQUIRED_ATTR_KEYS","getRequiredAttrKeys","agency","keys","attr","PERCENT_MIN","PERCENT_MAX","fieldValidators","z","coerceNaN","PaymentPeriod","createChildSupportGarnishmentFormSchema","mode","selectedAgency","agencyList","requiredFieldsConfig","data","state","a","requiredAttrKeys","buildFormSchema"],"mappings":";;;;AAkBO,MAAMA,IAAwC;AAAA,EACnD,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,sBAAsB;AACxB,GAqBaC,IAA+B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AACF;AAUO,SAASC,EAAoBC,GAAyD;AAC3F,QAAMC,wBAAW,IAAA;AACjB,MAAI,CAACD,GAAQ,mBAAoB,QAAOC;AACxC,aAAWC,KAAQF,EAAO;AACxB,IAAKE,EAAK,OACLJ,EAAmD,SAASI,EAAK,GAAG,KACvED,EAAK,IAAIC,EAAK,GAA+B;AAGjD,SAAOD;AACT;AAIA,MAAME,IAAc,GACdC,IAAc,KAEdC,IAAkB;AAAA,EACtB,OAAOC,EAAE,OAAA;AAAA,EACT,UAAUA,EAAE,OAAA;AAAA,EACZ,YAAYA,EAAE,OAAA;AAAA,EACd,aAAaA,EAAE,OAAA;AAAA,EACf,kBAAkBA,EAAE,OAAA;AAAA;AAAA,EAEpB,kBAAkBA,EAAE;AAAA,IAClBC,EAAU,CAAC;AAAA,IACXD,EAAE,SAAS,IAAI,GAAG,EAAE,SAAST,EAAsC,gBAAA,CAAiB;AAAA,EAAA;AAAA;AAAA,EAGtF,QAAQS,EAAE;AAAA,IACRC,EAAU,CAAC;AAAA,IACXD,EACG,OAAA,EACA,IAAIH,GAAa;AAAA,MAChB,SAASN,EA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upport';
1
+ import { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport';
2
2
  import { ChildSupportGarnishmentFormErrorCodes } from './childSupportGarnishmentFormSchema';
3
3
  import { TextInputHookFieldProps } from '../../../../../partner-hook-utils/form/fields/TextInputHookField';
4
4
  import { NumberInputHookFieldProps } from '../../../../../partner-hook-utils/form/fields/NumberInputHookField';
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.tsx"],"sourcesContent":["import type { PaymentPeriod } from '@gusto/embedded-api-v-2026-02-01/models/components/garnishmentchildsupport'\nimport type { ChildSupportGarnishmentFormErrorCodes } from './childSupportGarnishmentFormSchema'\nimport type { TextInputHookFieldProps } from '@/partner-hook-utils/form/fields/TextInputHookField'\nimport type { NumberInputHookFieldProps } from '@/partner-hook-utils/form/fields/NumberInputHookField'\nimport type { SelectHookFieldProps } from '@/partner-hook-utils/form/fields/SelectHookField'\nimport {\n TextInputHookField,\n NumberInputHookField,\n SelectHookField,\n} from '@/partner-hook-utils/form/fields'\nimport type { HookFieldProps } from '@/partner-hook-utils/types'\n\n/**\n * The required-field error code produced by {@link useChildSupportGarnishmentForm} fields that only emit `REQUIRED`.\n *\n * @remarks\n * Used as the `validationMessages` key for the state, county (fips code), case\n * number, order number, remittance number, and payment-period fields. See\n * {@link ChildSupportGarnishmentFormErrorCodes}.\n *\n * @public\n */\nexport type RequiredValidation = typeof ChildSupportGarnishmentFormErrorCodes.REQUIRED\n\n/**\n * The negative-amount error code produced by {@link useChildSupportGarnishmentForm}'s currency fields.\n *\n * @remarks\n * Used as a `validationMessages` key on `Fields.PayPeriodMaximum`. See\n * {@link ChildSupportGarnishmentFormErrorCodes}.\n *\n * @public\n */\nexport type NegativeAmountValidation = typeof ChildSupportGarnishmentFormErrorCodes.NEGATIVE_AMOUNT\n\n/**\n * The percent-out-of-range error code produced by {@link useChildSupportGarnishmentForm}'s percentage field.\n *\n * @remarks\n * Used as a `validationMessages` key on `Fields.Amount` (the percent-of-paycheck input).\n * See {@link ChildSupportGarnishmentFormErrorCodes}.\n *\n * @public\n */\nexport type PercentValidation = typeof ChildSupportGarnishmentFormErrorCodes.PERCENT_OUT_OF_RANGE\n\n/**\n * Validation error codes emitted by the `payPeriodMaximum` field of {@link useChildSupportGarnishmentForm}.\n *\n * @remarks\n * Use these as keys in `validationMessages` on `Fields.PayPeriodMaximum`. See\n * {@link ChildSupportGarnishmentFormErrorCodes} for the full description of each code.\n *\n * @public\n */\nexport type PayPeriodMaximumValidation = RequiredValidation | NegativeAmountValidation\n\n/**\n * Validation error codes emitted by the `amount` field of {@link useChildSupportGarnishmentForm}.\n *\n * @remarks\n * Use these as keys in `validationMessages` on `Fields.Amount`. The field\n * accepts a percentage of paycheck (0–100). See\n * {@link ChildSupportGarnishmentFormErrorCodes} for the full description of each code.\n *\n * @public\n */\nexport type AmountValidation = RequiredValidation | PercentValidation\n\n// ── State (agency) ─────────────────────────────────────────────────────\n//\n// The select carries the raw agency record as `entries`; the consumer can\n// supply `getOptionLabel` to translate the agency name into a localized\n// label (the SDK's option-label fallback is the agency state code).\n\n/**\n * Raw agency entry exposed on {@link useChildSupportGarnishmentForm}'s `data.agencies` and as the `entries` shape for the `State` select.\n *\n * @remarks\n * Supply `getOptionLabel` on `Fields.State` to translate the agency name into a\n * localized label — the SDK's option-label fallback is the agency state code.\n *\n * @public\n */\nexport type StateFieldEntry = {\n /** The agency's state code (e.g. `AK`). */\n state: string\n /** The agency name as returned by the Gusto API. */\n name: string\n /** True when the agency requires payments to be remitted manually rather than through Gusto. */\n manualPaymentRequired?: boolean\n}\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.State` component.\n *\n * @public\n */\nexport type StateFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, StateFieldEntry>\n>\n\n/** @internal */\nexport function StateField(props: StateFieldProps) {\n return <SelectHookField {...props} name=\"state\" />\n}\n\n// ── FipsCode (county) ──────────────────────────────────────────────────\n\n/**\n * Raw county entry exposed on {@link useChildSupportGarnishmentForm}'s `data.counties` and as the `entries` shape for the `FipsCode` select.\n *\n * @remarks\n * `county` is `null` for \"all counties\" entries — the agency's single county\n * record represents the whole state. Supply `getOptionLabel` on\n * `Fields.FipsCode` to translate the county name into a localized label.\n *\n * @public\n */\nexport type CountyEntry = {\n /** The FIPS code for the county. */\n fipsCode: string\n /** The county name, or `null` for an \"all counties\" entry covering the whole state. */\n county: string | null\n}\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.FipsCode` component.\n *\n * @public\n */\nexport type FipsCodeFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, CountyEntry>\n>\n\n/** @internal */\nexport function FipsCodeField(props: FipsCodeFieldProps) {\n return <SelectHookField {...props} name=\"fipsCode\" />\n}\n\n// ── Required agency-attribute text inputs ──────────────────────────────\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.CaseNumber` component.\n *\n * @public\n */\nexport type CaseNumberFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\n/** @internal */\nexport function CaseNumberField(props: CaseNumberFieldProps) {\n return <TextInputHookField {...props} name=\"caseNumber\" />\n}\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.OrderNumber` component.\n *\n * @public\n */\nexport type OrderNumberFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\n/** @internal */\nexport function OrderNumberField(props: OrderNumberFieldProps) {\n return <TextInputHookField {...props} name=\"orderNumber\" />\n}\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.RemittanceNumber` component.\n *\n * @public\n */\nexport type RemittanceNumberFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\n/** @internal */\nexport function RemittanceNumberField(props: RemittanceNumberFieldProps) {\n return <TextInputHookField {...props} name=\"remittanceNumber\" />\n}\n\n// ── Pay-period maximum (currency) ──────────────────────────────────────\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.PayPeriodMaximum` component.\n *\n * @public\n */\nexport type PayPeriodMaximumFieldProps = HookFieldProps<\n NumberInputHookFieldProps<PayPeriodMaximumValidation>\n>\n\n/** @internal */\nexport function PayPeriodMaximumField(props: PayPeriodMaximumFieldProps) {\n return <NumberInputHookField {...props} name=\"payPeriodMaximum\" />\n}\n\n// ── Amount (percent of paycheck, 0-100) ────────────────────────────────\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.Amount` component.\n *\n * @public\n */\nexport type AmountFieldProps = HookFieldProps<NumberInputHookFieldProps<AmountValidation>>\n\n/** @internal */\nexport function AmountField(props: AmountFieldProps) {\n return <NumberInputHookField {...props} name=\"amount\" />\n}\n\n// ── Payment period (select) ────────────────────────────────────────────\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.PaymentPeriod` component.\n *\n * @public\n */\nexport type PaymentPeriodFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, PaymentPeriod>\n>\n\n/** @internal */\nexport function PaymentPeriodField(props: PaymentPeriodFieldProps) {\n return <SelectHookField {...props} name=\"paymentPeriod\" />\n}\n"],"names":["StateField","props","jsx","SelectHookField","FipsCodeField","CaseNumberField","TextInputHookField","OrderNumberField","RemittanceNumberField","PayPeriodMaximumField","NumberInputHookField","AmountField","PaymentPeriodField"],"mappings":";;;;AAuGO,SAASA,EAAWC,GAAwB;AACjD,SAAO,gBAAAC,EAACC,GAAA,EAAiB,GAAGF,GAAO,MAAK,SAAQ;AAClD;AA+BO,SAASG,EAAcH,GAA2B;AACvD,SAAO,gBAAAC,EAACC,GAAA,EAAiB,GAAGF,GAAO,MAAK,YAAW;AACrD;AAYO,SAASI,EAAgBJ,GAA6B;AAC3D,SAAO,gBAAAC,EAACI,GAAA,EAAoB,GAAGL,GAAO,MAAK,cAAa;AAC1D;AAUO,SAASM,EAAiBN,GAA8B;AAC7D,SAAO,gBAAAC,EAACI,GAAA,EAAoB,GAAGL,GAAO,MAAK,eAAc;AAC3D;AAUO,SAASO,EAAsBP,GAAmC;AACvE,SAAO,gBAAAC,EAACI,GAAA,EAAoB,GAAGL,GAAO,MAAK,oBAAmB;AAChE;AAcO,SAASQ,EAAsBR,GAAmC;AACvE,SAAO,gBAAAC,EAACQ,GAAA,EAAsB,GAAGT,GAAO,MAAK,oBAAmB;AAClE;AAYO,SAASU,EAAYV,GAAyB;AACnD,SAAO,gBAAAC,EAACQ,GAAA,EAAsB,GAAGT,GAAO,MAAK,UAAS;AACxD;AAcO,SAASW,EAAmBX,GAAgC;AACjE,SAAO,gBAAAC,EAACC,GAAA,EAAiB,GAAGF,GAAO,MAAK,iBAAgB;AAC1D;"}
1
+ {"version":3,"file":"fields.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/fields.tsx"],"sourcesContent":["import type { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport type { ChildSupportGarnishmentFormErrorCodes } from './childSupportGarnishmentFormSchema'\nimport type { TextInputHookFieldProps } from '@/partner-hook-utils/form/fields/TextInputHookField'\nimport type { NumberInputHookFieldProps } from '@/partner-hook-utils/form/fields/NumberInputHookField'\nimport type { SelectHookFieldProps } from '@/partner-hook-utils/form/fields/SelectHookField'\nimport {\n TextInputHookField,\n NumberInputHookField,\n SelectHookField,\n} from '@/partner-hook-utils/form/fields'\nimport type { HookFieldProps } from '@/partner-hook-utils/types'\n\n/**\n * The required-field error code produced by {@link useChildSupportGarnishmentForm} fields that only emit `REQUIRED`.\n *\n * @remarks\n * Used as the `validationMessages` key for the state, county (fips code), case\n * number, order number, remittance number, and payment-period fields. See\n * {@link ChildSupportGarnishmentFormErrorCodes}.\n *\n * @public\n */\nexport type RequiredValidation = typeof ChildSupportGarnishmentFormErrorCodes.REQUIRED\n\n/**\n * The negative-amount error code produced by {@link useChildSupportGarnishmentForm}'s currency fields.\n *\n * @remarks\n * Used as a `validationMessages` key on `Fields.PayPeriodMaximum`. See\n * {@link ChildSupportGarnishmentFormErrorCodes}.\n *\n * @public\n */\nexport type NegativeAmountValidation = typeof ChildSupportGarnishmentFormErrorCodes.NEGATIVE_AMOUNT\n\n/**\n * The percent-out-of-range error code produced by {@link useChildSupportGarnishmentForm}'s percentage field.\n *\n * @remarks\n * Used as a `validationMessages` key on `Fields.Amount` (the percent-of-paycheck input).\n * See {@link ChildSupportGarnishmentFormErrorCodes}.\n *\n * @public\n */\nexport type PercentValidation = typeof ChildSupportGarnishmentFormErrorCodes.PERCENT_OUT_OF_RANGE\n\n/**\n * Validation error codes emitted by the `payPeriodMaximum` field of {@link useChildSupportGarnishmentForm}.\n *\n * @remarks\n * Use these as keys in `validationMessages` on `Fields.PayPeriodMaximum`. See\n * {@link ChildSupportGarnishmentFormErrorCodes} for the full description of each code.\n *\n * @public\n */\nexport type PayPeriodMaximumValidation = RequiredValidation | NegativeAmountValidation\n\n/**\n * Validation error codes emitted by the `amount` field of {@link useChildSupportGarnishmentForm}.\n *\n * @remarks\n * Use these as keys in `validationMessages` on `Fields.Amount`. The field\n * accepts a percentage of paycheck (0–100). See\n * {@link ChildSupportGarnishmentFormErrorCodes} for the full description of each code.\n *\n * @public\n */\nexport type AmountValidation = RequiredValidation | PercentValidation\n\n// ── State (agency) ─────────────────────────────────────────────────────\n//\n// The select carries the raw agency record as `entries`; the consumer can\n// supply `getOptionLabel` to translate the agency name into a localized\n// label (the SDK's option-label fallback is the agency state code).\n\n/**\n * Raw agency entry exposed on {@link useChildSupportGarnishmentForm}'s `data.agencies` and as the `entries` shape for the `State` select.\n *\n * @remarks\n * Supply `getOptionLabel` on `Fields.State` to translate the agency name into a\n * localized label — the SDK's option-label fallback is the agency state code.\n *\n * @public\n */\nexport type StateFieldEntry = {\n /** The agency's state code (e.g. `AK`). */\n state: string\n /** The agency name as returned by the Gusto API. */\n name: string\n /** True when the agency requires payments to be remitted manually rather than through Gusto. */\n manualPaymentRequired?: boolean\n}\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.State` component.\n *\n * @public\n */\nexport type StateFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, StateFieldEntry>\n>\n\n/** @internal */\nexport function StateField(props: StateFieldProps) {\n return <SelectHookField {...props} name=\"state\" />\n}\n\n// ── FipsCode (county) ──────────────────────────────────────────────────\n\n/**\n * Raw county entry exposed on {@link useChildSupportGarnishmentForm}'s `data.counties` and as the `entries` shape for the `FipsCode` select.\n *\n * @remarks\n * `county` is `null` for \"all counties\" entries — the agency's single county\n * record represents the whole state. Supply `getOptionLabel` on\n * `Fields.FipsCode` to translate the county name into a localized label.\n *\n * @public\n */\nexport type CountyEntry = {\n /** The FIPS code for the county. */\n fipsCode: string\n /** The county name, or `null` for an \"all counties\" entry covering the whole state. */\n county: string | null\n}\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.FipsCode` component.\n *\n * @public\n */\nexport type FipsCodeFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, CountyEntry>\n>\n\n/** @internal */\nexport function FipsCodeField(props: FipsCodeFieldProps) {\n return <SelectHookField {...props} name=\"fipsCode\" />\n}\n\n// ── Required agency-attribute text inputs ──────────────────────────────\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.CaseNumber` component.\n *\n * @public\n */\nexport type CaseNumberFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\n/** @internal */\nexport function CaseNumberField(props: CaseNumberFieldProps) {\n return <TextInputHookField {...props} name=\"caseNumber\" />\n}\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.OrderNumber` component.\n *\n * @public\n */\nexport type OrderNumberFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\n/** @internal */\nexport function OrderNumberField(props: OrderNumberFieldProps) {\n return <TextInputHookField {...props} name=\"orderNumber\" />\n}\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.RemittanceNumber` component.\n *\n * @public\n */\nexport type RemittanceNumberFieldProps = HookFieldProps<TextInputHookFieldProps<RequiredValidation>>\n\n/** @internal */\nexport function RemittanceNumberField(props: RemittanceNumberFieldProps) {\n return <TextInputHookField {...props} name=\"remittanceNumber\" />\n}\n\n// ── Pay-period maximum (currency) ──────────────────────────────────────\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.PayPeriodMaximum` component.\n *\n * @public\n */\nexport type PayPeriodMaximumFieldProps = HookFieldProps<\n NumberInputHookFieldProps<PayPeriodMaximumValidation>\n>\n\n/** @internal */\nexport function PayPeriodMaximumField(props: PayPeriodMaximumFieldProps) {\n return <NumberInputHookField {...props} name=\"payPeriodMaximum\" />\n}\n\n// ── Amount (percent of paycheck, 0-100) ────────────────────────────────\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.Amount` component.\n *\n * @public\n */\nexport type AmountFieldProps = HookFieldProps<NumberInputHookFieldProps<AmountValidation>>\n\n/** @internal */\nexport function AmountField(props: AmountFieldProps) {\n return <NumberInputHookField {...props} name=\"amount\" />\n}\n\n// ── Payment period (select) ────────────────────────────────────────────\n\n/**\n * Props accepted by {@link useChildSupportGarnishmentForm}'s `Fields.PaymentPeriod` component.\n *\n * @public\n */\nexport type PaymentPeriodFieldProps = HookFieldProps<\n SelectHookFieldProps<RequiredValidation, PaymentPeriod>\n>\n\n/** @internal */\nexport function PaymentPeriodField(props: PaymentPeriodFieldProps) {\n return <SelectHookField {...props} name=\"paymentPeriod\" />\n}\n"],"names":["StateField","props","jsx","SelectHookField","FipsCodeField","CaseNumberField","TextInputHookField","OrderNumberField","RemittanceNumberField","PayPeriodMaximumField","NumberInputHookField","AmountField","PaymentPeriodField"],"mappings":";;;;AAuGO,SAASA,EAAWC,GAAwB;AACjD,SAAO,gBAAAC,EAACC,GAAA,EAAiB,GAAGF,GAAO,MAAK,SAAQ;AAClD;AA+BO,SAASG,EAAcH,GAA2B;AACvD,SAAO,gBAAAC,EAACC,GAAA,EAAiB,GAAGF,GAAO,MAAK,YAAW;AACrD;AAYO,SAASI,EAAgBJ,GAA6B;AAC3D,SAAO,gBAAAC,EAACI,GAAA,EAAoB,GAAGL,GAAO,MAAK,cAAa;AAC1D;AAUO,SAASM,EAAiBN,GAA8B;AAC7D,SAAO,gBAAAC,EAACI,GAAA,EAAoB,GAAGL,GAAO,MAAK,eAAc;AAC3D;AAUO,SAASO,EAAsBP,GAAmC;AACvE,SAAO,gBAAAC,EAACI,GAAA,EAAoB,GAAGL,GAAO,MAAK,oBAAmB;AAChE;AAcO,SAASQ,EAAsBR,GAAmC;AACvE,SAAO,gBAAAC,EAACQ,GAAA,EAAsB,GAAGT,GAAO,MAAK,oBAAmB;AAClE;AAYO,SAASU,EAAYV,GAAyB;AACnD,SAAO,gBAAAC,EAACQ,GAAA,EAAsB,GAAGT,GAAO,MAAK,UAAS;AACxD;AAcO,SAASW,EAAmBX,GAAgC;AACjE,SAAO,gBAAAC,EAACC,GAAA,EAAiB,GAAGF,GAAO,MAAK,iBAAgB;AAC1D;"}
@@ -1,7 +1,7 @@
1
1
  import { ComponentType } from 'react';
2
2
  import { UseFormProps } from 'react-hook-form';
3
- import { Garnishment } from '@gusto/embedded-api-v-2026-02-01/models/components/garnishment';
4
- import { Agencies } from '@gusto/embedded-api-v-2026-02-01/models/components/childsupportdata';
3
+ import { Garnishment } from '@gusto/embedded-api/models/components/garnishment';
4
+ import { Agencies } from '@gusto/embedded-api/models/components/childsupportdata';
5
5
  import { ChildSupportGarnishmentFormData, SupportedRequiredAttrKey } from './childSupportGarnishmentFormSchema';
6
6
  import { CountyEntry, StateFieldEntry, StateFieldProps, FipsCodeFieldProps, CaseNumberFieldProps, OrderNumberFieldProps, RemittanceNumberFieldProps, PayPeriodMaximumFieldProps, AmountFieldProps, PaymentPeriodFieldProps } from './fields';
7
7
  import { BaseFormHookReady, FieldMetadata, HookLoadingResult, HookSubmitResult } from '../../../../../partner-hook-utils/types';
@@ -1,11 +1,11 @@
1
1
  import { useMemo as s, useRef as Z, useEffect as k } from "react";
2
2
  import { useForm as ee, useWatch as te } from "react-hook-form";
3
3
  import { zodResolver as re } from "@hookform/resolvers/zod";
4
- import { PaymentPeriod as r } from "@gusto/embedded-api-v-2026-02-01/models/components/garnishmentchildsupport";
5
- import { useGarnishmentsCreateMutation as oe } from "@gusto/embedded-api-v-2026-02-01/react-query/garnishmentsCreate";
6
- import { useGarnishmentsUpdateMutation as ie } from "@gusto/embedded-api-v-2026-02-01/react-query/garnishmentsUpdate";
7
- import { useGarnishmentsList as ne } from "@gusto/embedded-api-v-2026-02-01/react-query/garnishmentsList";
8
- import { useGarnishmentsGetChildSupportData as ae } from "@gusto/embedded-api-v-2026-02-01/react-query/garnishmentsGetChildSupportData";
4
+ import { PaymentPeriod as r } from "@gusto/embedded-api/models/components/garnishmentchildsupport";
5
+ import { useGarnishmentsCreateMutation as oe } from "@gusto/embedded-api/react-query/garnishmentsCreate";
6
+ import { useGarnishmentsUpdateMutation as ie } from "@gusto/embedded-api/react-query/garnishmentsUpdate";
7
+ import { useGarnishmentsList as ne } from "@gusto/embedded-api/react-query/garnishmentsList";
8
+ import { useGarnishmentsGetChildSupportData as ae } from "@gusto/embedded-api/react-query/garnishmentsGetChildSupportData";
9
9
  import { createChildSupportGarnishmentFormSchema as ue, getRequiredAttrKeys as se } from "./childSupportGarnishmentFormSchema.js";
10
10
  import { PaymentPeriodField as me, AmountField as de, PayPeriodMaximumField as ce, RemittanceNumberField as le, OrderNumberField as pe, CaseNumberField as he, FipsCodeField as fe, StateField as be } from "./fields.js";
11
11
  import { useDeriveFieldsMetadata as ye } from "../../../../../partner-hook-utils/form/useDeriveFieldsMetadata.js";
@@ -1 +1 @@
1
- {"version":3,"file":"useChildSupportGarnishmentForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useEffect, useMemo, useRef } from 'react'\nimport { useForm, useWatch } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n type Garnishment,\n type GarnishmentType,\n} from '@gusto/embedded-api-v-2026-02-01/models/components/garnishment'\nimport type { Agencies } from '@gusto/embedded-api-v-2026-02-01/models/components/childsupportdata'\nimport { PaymentPeriod } from '@gusto/embedded-api-v-2026-02-01/models/components/garnishmentchildsupport'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api-v-2026-02-01/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api-v-2026-02-01/react-query/garnishmentsUpdate'\nimport { useGarnishmentsList } from '@gusto/embedded-api-v-2026-02-01/react-query/garnishmentsList'\nimport { useGarnishmentsGetChildSupportData } from '@gusto/embedded-api-v-2026-02-01/react-query/garnishmentsGetChildSupportData'\nimport {\n createChildSupportGarnishmentFormSchema,\n getRequiredAttrKeys,\n type ChildSupportGarnishmentFormData,\n type ChildSupportGarnishmentFormOutputs,\n type SupportedRequiredAttrKey,\n} from './childSupportGarnishmentFormSchema'\nimport {\n StateField,\n FipsCodeField,\n CaseNumberField,\n OrderNumberField,\n RemittanceNumberField,\n PayPeriodMaximumField,\n AmountField,\n PaymentPeriodField,\n type CountyEntry,\n type StateFieldEntry,\n type StateFieldProps,\n type FipsCodeFieldProps,\n type CaseNumberFieldProps,\n type OrderNumberFieldProps,\n type RemittanceNumberFieldProps,\n type PayPeriodMaximumFieldProps,\n type AmountFieldProps,\n type PaymentPeriodFieldProps,\n} from './fields'\nimport { useDeriveFieldsMetadata } from '@/partner-hook-utils/form/useDeriveFieldsMetadata'\nimport { useHookFormInternals } from '@/partner-hook-utils/form/useHookFormInternals'\nimport { createGetFormSubmissionValues } from '@/partner-hook-utils/form/getFormSubmissionValues'\nimport { withOptions } from '@/partner-hook-utils/form/withOptions'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseFormHookReady,\n FieldMetadata,\n FieldsMetadata,\n HookLoadingResult,\n HookSubmitResult,\n} from '@/partner-hook-utils/types'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\n\nconst PAYMENT_PERIOD_OPTIONS = [\n { value: PaymentPeriod.EveryWeek, label: PaymentPeriod.EveryWeek },\n { value: PaymentPeriod.EveryOtherWeek, label: PaymentPeriod.EveryOtherWeek },\n { value: PaymentPeriod.TwicePerMonth, label: PaymentPeriod.TwicePerMonth },\n { value: PaymentPeriod.Monthly, label: PaymentPeriod.Monthly },\n] as const\n\nconst PAYMENT_PERIOD_ENTRIES = [\n PaymentPeriod.EveryWeek,\n PaymentPeriod.EveryOtherWeek,\n PaymentPeriod.TwicePerMonth,\n PaymentPeriod.Monthly,\n] as const\n\n/**\n * Configuration options for {@link useChildSupportGarnishmentForm}.\n *\n * @remarks\n * Presence or absence of `garnishmentId` selects the API verb — see the\n * `garnishmentId` field description.\n *\n * @public\n */\nexport interface UseChildSupportGarnishmentFormProps {\n /** UUID of the employee whose child-support garnishment is being created or edited. */\n employeeId: string\n /**\n * When set, loads that garnishment and updates it (PUT). When omitted, the\n * form is in create mode (POST).\n */\n garnishmentId?: string\n /** Pre-fill form values. Server data takes precedence on update. */\n defaultValues?: Partial<ChildSupportGarnishmentFormData>\n /** Passed through to react-hook-form. Defaults to `'onSubmit'`. */\n validationMode?: UseFormProps['mode']\n /** Auto-focus the first invalid field on submit. Set to `false` when using `composeSubmitHandler` so submit-time focus is coordinated across multiple forms. Defaults to `true`. */\n shouldFocusError?: boolean\n}\n\n/**\n * Pre-bound field components exposed on `useChildSupportGarnishmentForm().form.Fields`.\n *\n * @remarks\n * Each property is either the field component or `undefined`. A field is\n * `undefined` when conditions for rendering it aren't met — see each member\n * for its visibility rule. Always null-check conditional fields (e.g.\n * `{Fields.FipsCode && <Fields.FipsCode ... />}`) before rendering.\n *\n * @public\n */\nexport interface ChildSupportGarnishmentFormFields {\n /** Bound to `state`. Agency (state) select. Always available. */\n State: ComponentType<StateFieldProps>\n /** Bound to `fipsCode`. Only available when the selected agency has more than\n * one fips code, or the sole code is county-scoped (not an \"all counties\"\n * auto-pick). */\n FipsCode: ComponentType<FipsCodeFieldProps> | undefined\n /** Bound to `caseNumber`. Only available when the selected agency requires `case_number`. */\n CaseNumber: ComponentType<CaseNumberFieldProps> | undefined\n /** Bound to `orderNumber`. Only available when the selected agency requires `order_number`. */\n OrderNumber: ComponentType<OrderNumberFieldProps> | undefined\n /** Bound to `remittanceNumber`. Only available when the selected agency requires `remittance_number`. */\n RemittanceNumber: ComponentType<RemittanceNumberFieldProps> | undefined\n /** Bound to `payPeriodMaximum`. Per-pay-period currency cap input. Always available. */\n PayPeriodMaximum: ComponentType<PayPeriodMaximumFieldProps>\n /** Bound to `amount`. Percent-of-paycheck input (0–100). Always available. */\n Amount: ComponentType<AmountFieldProps>\n /** Bound to `paymentPeriod`. Payment period select. Always available. */\n PaymentPeriod: ComponentType<PaymentPeriodFieldProps>\n}\n\n/**\n * Ready-state shape returned by {@link useChildSupportGarnishmentForm} once data has loaded.\n *\n * @remarks\n * Discriminated by `isLoading: false`. Extends {@link BaseFormHookReady} with\n * the child-support-specific `data`, `status`, `actions`, and `form.Fields`\n * shape. Static, entity-derived values live under `data.*`; reactive values\n * that flip with form input live under `status.*`.\n *\n * @public\n */\nexport interface UseChildSupportGarnishmentFormReady extends BaseFormHookReady<\n ChildSupportGarnishmentFormFieldsMetadata,\n ChildSupportGarnishmentFormData,\n ChildSupportGarnishmentFormFields\n> {\n /** Child-support-specific data payload: the available agencies, counties for the selected state, and the loaded garnishment for update mode. */\n data: {\n /** Agencies offered as `State` options; raw entries the consumer can use\n * with `getOptionLabel` for translated names. */\n agencies: StateFieldEntry[]\n /** Counties for the currently selected state. Empty array when no state\n * is selected. */\n counties: CountyEntry[]\n /** The garnishment loaded for update; `null` in create mode. */\n deduction: Garnishment | null\n }\n /** Submission state and reactive flags derived from current form input. */\n status: {\n /** `true` while a create or update mutation is in flight. */\n isPending: boolean\n /** Reflects whether the next submit will POST a new garnishment or PUT an existing one. */\n mode: 'create' | 'update'\n /** The agency record matching the currently selected `state`. */\n selectedAgency: Agencies | null\n /** Mirrors `selectedAgency.manualPaymentRequired`; convenient for showing\n * a warning alert. */\n isManualPaymentRequired: boolean\n /** Which `required_attributes` keys the selected agency declares. */\n requiredAttrKeys: ReadonlySet<SupportedRequiredAttrKey>\n }\n /** Submission action. */\n actions: {\n /** Submits the form. Returns the saved garnishment + mode on success, or `undefined` when validation fails or the request errored. */\n onSubmit: () => Promise<HookSubmitResult<Garnishment> | undefined>\n }\n}\n\n/**\n * Return value of {@link useChildSupportGarnishmentForm}.\n *\n * @remarks\n * Discriminated union: {@link HookLoadingResult} while the agency catalog (and,\n * in update mode, the existing garnishment) is loading;\n * {@link UseChildSupportGarnishmentFormReady} once data is ready.\n *\n * @public\n */\nexport type UseChildSupportGarnishmentFormResult =\n HookLoadingResult | UseChildSupportGarnishmentFormReady\n\n/** @internal */\nfunction buildChildSupportGarnishmentFieldsMetadata(\n base: Record<keyof ChildSupportGarnishmentFormData, FieldMetadata>,\n {\n stateOptions,\n agencies,\n countyOptions,\n counties,\n }: {\n stateOptions: Array<{ value: string; label: string }>\n agencies: StateFieldEntry[]\n countyOptions: Array<{ value: string; label: string }>\n counties: CountyEntry[]\n },\n) {\n return {\n state: withOptions(base.state, stateOptions, agencies),\n fipsCode: withOptions(base.fipsCode, countyOptions, counties),\n caseNumber: base.caseNumber,\n orderNumber: base.orderNumber,\n remittanceNumber: base.remittanceNumber,\n payPeriodMaximum: base.payPeriodMaximum,\n amount: base.amount,\n paymentPeriod: withOptions(\n base.paymentPeriod,\n [...PAYMENT_PERIOD_OPTIONS],\n [...PAYMENT_PERIOD_ENTRIES],\n ),\n } satisfies FieldsMetadata\n}\n\n/**\n * Headless hook for creating or updating a child-support garnishment.\n *\n * @remarks\n * Unlike standard garnishments, child support requires agency-specific\n * attributes (case number, order number, remittance number) that vary by\n * state, plus an optional county selection when the state has multiple\n * counties. The hook loads the agency catalog from the Gusto API, derives\n * which attributes the selected state requires, and exposes the right Fields\n * conditionally.\n *\n * Presence or absence of `garnishmentId` selects the API verb: omit it to\n * POST a new garnishment, supply it to PUT updates against the existing row.\n * For non-child-support deductions (court-ordered garnishments and post-tax\n * custom), use {@link useDeductionForm} instead.\n *\n * @param input - See {@link UseChildSupportGarnishmentFormProps}.\n * @returns A {@link HookLoadingResult} while loading, or a {@link UseChildSupportGarnishmentFormReady} once ready.\n * @public\n *\n * @example\n * ```tsx\n * import { useChildSupportGarnishmentForm, SDKFormProvider } from '@gusto/embedded-react-sdk'\n *\n * function ChildSupportPage({ employeeId, garnishmentId }: { employeeId: string; garnishmentId?: string }) {\n * const form = useChildSupportGarnishmentForm({ employeeId, garnishmentId })\n *\n * if (form.isLoading) return <p>Loading…</p>\n *\n * const { Fields } = form.form\n *\n * return (\n * <SDKFormProvider formHookResult={form}>\n * <form\n * onSubmit={e => {\n * e.preventDefault()\n * void form.actions.onSubmit()\n * }}\n * >\n * <Fields.State\n * label=\"Agency\"\n * getOptionLabel={entry => entry.name}\n * validationMessages={{ REQUIRED: 'Required' }}\n * />\n * {Fields.CaseNumber && (\n * <Fields.CaseNumber label=\"Case number\" validationMessages={{ REQUIRED: 'Required' }} />\n * )}\n * <Fields.Amount\n * label=\"Percentage of paycheck\"\n * validationMessages={{\n * REQUIRED: 'Required',\n * PERCENT_OUT_OF_RANGE: 'Must be between 0 and 100',\n * }}\n * />\n * <button type=\"submit\">Save</button>\n * </form>\n * </SDKFormProvider>\n * )\n * }\n * ```\n */\nexport function useChildSupportGarnishmentForm({\n employeeId,\n garnishmentId,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n}: UseChildSupportGarnishmentFormProps): UseChildSupportGarnishmentFormResult {\n const isCreateMode = !garnishmentId\n const schemaMode = isCreateMode ? 'create' : 'update'\n\n // Agencies + their required-attributes / fips codes come from a single GET.\n const agencyDataQuery = useGarnishmentsGetChildSupportData({})\n const agencyList = useMemo(\n () => agencyDataQuery.data?.childSupportData?.agencies ?? [],\n [agencyDataQuery.data],\n )\n\n // Update mode reads the row from the list endpoint (the garnishments API\n // has no single-row GET).\n const garnishmentsListQuery = useGarnishmentsList({ employeeId }, { enabled: !isCreateMode })\n const fetchedDeduction = useMemo(() => {\n if (isCreateMode) return null\n return garnishmentsListQuery.data?.garnishments?.find(g => g.uuid === garnishmentId) ?? null\n }, [isCreateMode, garnishmentId, garnishmentsListQuery.data])\n\n const resolvedDefaults: ChildSupportGarnishmentFormData = useMemo(\n () => ({\n state: fetchedDeduction?.childSupport?.state ?? partnerDefaults?.state ?? '',\n fipsCode: fetchedDeduction?.childSupport?.fipsCode ?? partnerDefaults?.fipsCode ?? '',\n caseNumber: fetchedDeduction?.childSupport?.caseNumber ?? partnerDefaults?.caseNumber ?? '',\n orderNumber:\n fetchedDeduction?.childSupport?.orderNumber ?? partnerDefaults?.orderNumber ?? '',\n remittanceNumber:\n fetchedDeduction?.childSupport?.remittanceNumber ?? partnerDefaults?.remittanceNumber ?? '',\n amount: fetchedDeduction?.amount\n ? Number(fetchedDeduction.amount)\n : (partnerDefaults?.amount ?? 0),\n payPeriodMaximum: fetchedDeduction?.payPeriodMaximum\n ? Number(fetchedDeduction.payPeriodMaximum)\n : (partnerDefaults?.payPeriodMaximum ?? 0),\n paymentPeriod:\n (fetchedDeduction?.childSupport?.paymentPeriod as PaymentPeriod | undefined) ??\n partnerDefaults?.paymentPeriod ??\n PaymentPeriod.Monthly,\n }),\n [fetchedDeduction, partnerDefaults],\n )\n\n // Pass the full agency list so requiredness for the agency-attribute fields\n // (`caseNumber`, `orderNumber`, `remittanceNumber`) is derived dynamically\n // from the form's `state` value. The schema doesn't need to rebuild when the\n // user changes states — the predicate runs at validation time and via\n // `useDeriveFieldsMetadata` for the (optional) label.\n const [schema, metadataConfig] = useMemo(\n () => createChildSupportGarnishmentFormSchema({ mode: schemaMode, agencyList }),\n [schemaMode, agencyList],\n )\n\n const formMethods = useForm<\n ChildSupportGarnishmentFormData,\n unknown,\n ChildSupportGarnishmentFormOutputs\n >({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const liveWatchedState = useWatch({ control: formMethods.control, name: 'state' })\n const liveSelectedAgency = useMemo(\n () => agencyList.find(a => a.state === liveWatchedState) ?? null,\n [agencyList, liveWatchedState],\n )\n\n // The agency-attribute fields stay in sync with the chosen state: when the\n // user switches states, the previous attribute values would otherwise carry\n // over and potentially submit alongside the wrong agency. The ref tracks\n // the previous value so the wipe only fires on user-driven transitions —\n // NOT on the initial sync when an existing garnishment loads (state moves\n // from '' to e.g. 'AK' as a side effect of `values` updating, which would\n // otherwise clobber the loaded case/order/remittance values).\n const previousWatchedStateRef = useRef<string | null>(null)\n useEffect(() => {\n const previous = previousWatchedStateRef.current\n previousWatchedStateRef.current = liveWatchedState\n // First render (no previous value) → skip the wipe.\n if (previous === null) return\n // Server-side load: previous was '' (initial defaults before the row\n // arrived), now it's the loaded state. That's a sync, not a user toggle.\n if (previous === '') return\n if (previous === liveWatchedState) return\n formMethods.setValue('caseNumber', '')\n formMethods.setValue('orderNumber', '')\n formMethods.setValue('remittanceNumber', '')\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [liveWatchedState])\n\n // When the selected agency has a single \"all counties\" fips code, auto-fill\n // the field so the consumer doesn't have to render the county select.\n const fipsCodes = liveSelectedAgency?.fipsCodes ?? []\n const singleAllCountiesFipsCode =\n fipsCodes.length === 1 && !fipsCodes[0]?.county?.length ? (fipsCodes[0]?.code ?? null) : null\n useEffect(() => {\n if (singleAllCountiesFipsCode) {\n formMethods.setValue('fipsCode', singleAllCountiesFipsCode)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [singleAllCountiesFipsCode])\n\n const createGarnishmentMutation = useGarnishmentsCreateMutation()\n const updateGarnishmentMutation = useGarnishmentsUpdateMutation()\n const isPending = createGarnishmentMutation.isPending || updateGarnishmentMutation.isPending\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('ChildSupportGarnishmentForm')\n\n const errorHandling = composeErrorHandler(\n isCreateMode ? [agencyDataQuery] : [agencyDataQuery, garnishmentsListQuery],\n { submitError, setSubmitError },\n )\n\n // ── Derived data exposed on the ready branch ─────────────────────────\n\n const agencies: StateFieldEntry[] = useMemo(\n () =>\n agencyList.map(a => ({\n state: a.state ?? '',\n name: a.name ?? a.state ?? '',\n manualPaymentRequired: a.manualPaymentRequired ?? false,\n })),\n [agencyList],\n )\n\n const counties: CountyEntry[] = useMemo(\n () =>\n (liveSelectedAgency?.fipsCodes ?? [])\n .filter(f => typeof f.code === 'string')\n .map(f => ({ fipsCode: f.code as string, county: f.county ?? null })),\n [liveSelectedAgency],\n )\n\n const requiredAttrKeys = useMemo(\n () => getRequiredAttrKeys(liveSelectedAgency),\n [liveSelectedAgency],\n )\n\n const hasSelectableCounties =\n counties.length > 1 || (counties.length === 1 && singleAllCountiesFipsCode == null)\n\n // ── Metadata + field-options wiring ─────────────────────────────────\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const stateOptions = agencies.map(a => ({ value: a.state, label: a.name }))\n const countyOptions = counties.map(c => ({\n value: c.fipsCode,\n label: c.county ?? c.fipsCode,\n }))\n\n const fieldsMetadata = buildChildSupportGarnishmentFieldsMetadata(baseMetadata, {\n stateOptions,\n agencies,\n countyOptions,\n counties,\n })\n\n // ── Submit ───────────────────────────────────────────────────────────\n\n const onSubmit = async (): Promise<HookSubmitResult<Garnishment> | undefined> => {\n let submitResult: HookSubmitResult<Garnishment> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: ChildSupportGarnishmentFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const childSupport = {\n state: payload.state,\n paymentPeriod: payload.paymentPeriod,\n fipsCode: payload.fipsCode,\n // Empty strings collapse to null so the API persists \"no value\n // declared\" rather than an empty case number.\n caseNumber: payload.caseNumber || null,\n orderNumber: payload.orderNumber || null,\n remittanceNumber: payload.remittanceNumber || null,\n }\n\n const description = `Child Support - ${childSupport.caseNumber ?? ''}`\n const amountStr = String(payload.amount)\n const payPeriodMaximumStr =\n payload.payPeriodMaximum > 0 ? String(payload.payPeriodMaximum) : null\n\n const requestBody = {\n active: true,\n amount: amountStr,\n description,\n courtOrdered: true,\n garnishmentType: 'child_support' as GarnishmentType,\n times: null,\n deductAsPercentage: true,\n payPeriodMaximum: payPeriodMaximumStr,\n recurring: true,\n childSupport,\n }\n\n let updated: Garnishment | undefined\n\n if (isCreateMode) {\n const result = await createGarnishmentMutation.mutateAsync({\n request: { employeeId, garnishmentRequest: requestBody },\n })\n updated = result.garnishment\n } else {\n if (!fetchedDeduction) {\n throw new SDKInternalError(\n 'Cannot update child-support deduction: no matching garnishment on file',\n )\n }\n const result = await updateGarnishmentMutation.mutateAsync({\n request: {\n garnishmentId: fetchedDeduction.uuid,\n updateGarnishmentRequest: {\n ...requestBody,\n version: fetchedDeduction.version as string,\n },\n },\n })\n updated = result.garnishment\n }\n\n if (!updated) {\n throw new SDKInternalError(\n isCreateMode\n ? 'Child-support deduction creation failed'\n : 'Child-support deduction update failed',\n )\n }\n\n submitResult = {\n mode: isCreateMode ? 'create' : 'update',\n data: updated,\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const hookFormInternals = useHookFormInternals(formMethods)\n\n if (agencyDataQuery.isLoading) {\n return { isLoading: true as const, errorHandling }\n }\n if (!isCreateMode && garnishmentsListQuery.isLoading) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n agencies,\n counties,\n deduction: fetchedDeduction,\n },\n status: {\n isPending,\n mode: isCreateMode ? 'create' : 'update',\n selectedAgency: liveSelectedAgency,\n isManualPaymentRequired: liveSelectedAgency?.manualPaymentRequired ?? false,\n requiredAttrKeys,\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n State: StateField,\n FipsCode: hasSelectableCounties ? FipsCodeField : undefined,\n CaseNumber: requiredAttrKeys.has('case_number') ? CaseNumberField : undefined,\n OrderNumber: requiredAttrKeys.has('order_number') ? OrderNumberField : undefined,\n RemittanceNumber: requiredAttrKeys.has('remittance_number')\n ? RemittanceNumberField\n : undefined,\n PayPeriodMaximum: PayPeriodMaximumField,\n Amount: AmountField,\n PaymentPeriod: PaymentPeriodField,\n },\n fieldsMetadata,\n hookFormInternals,\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\n/**\n * Per-field metadata returned by {@link useChildSupportGarnishmentForm} as `form.fieldsMetadata`.\n *\n * @remarks\n * Carries per-field `isRequired`, `isDisabled`, label, description, and option\n * entries derived from the schema and form state. Use these to drive UI such\n * as disabled state or option lists when not relying on the pre-bound\n * {@link ChildSupportGarnishmentFormFields} components.\n *\n * @public\n */\nexport type ChildSupportGarnishmentFormFieldsMetadata = ReturnType<\n typeof buildChildSupportGarnishmentFieldsMetadata\n>\n"],"names":["PAYMENT_PERIOD_OPTIONS","PaymentPeriod","PAYMENT_PERIOD_ENTRIES","buildChildSupportGarnishmentFieldsMetadata","base","stateOptions","agencies","countyOptions","counties","withOptions","useChildSupportGarnishmentForm","employeeId","garnishmentId","partnerDefaults","validationMode","shouldFocusError","isCreateMode","schemaMode","agencyDataQuery","useGarnishmentsGetChildSupportData","agencyList","useMemo","garnishmentsListQuery","useGarnishmentsList","fetchedDeduction","g","resolvedDefaults","schema","metadataConfig","createChildSupportGarnishmentFormSchema","formMethods","useForm","zodResolver","liveWatchedState","useWatch","liveSelectedAgency","a","previousWatchedStateRef","useRef","useEffect","previous","fipsCodes","singleAllCountiesFipsCode","createGarnishmentMutation","useGarnishmentsCreateMutation","updateGarnishmentMutation","useGarnishmentsUpdateMutation","isPending","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","f","requiredAttrKeys","getRequiredAttrKeys","hasSelectableCounties","baseMetadata","useDeriveFieldsMetadata","c","fieldsMetadata","onSubmit","submitResult","resolve","data","payload","childSupport","description","amountStr","payPeriodMaximumStr","requestBody","updated","SDKInternalError","hookFormInternals","useHookFormInternals","StateField","FipsCodeField","CaseNumberField","OrderNumberField","RemittanceNumberField","PayPeriodMaximumField","AmountField","PaymentPeriodField","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;;AAyDA,MAAMA,KAAyB;AAAA,EAC7B,EAAE,OAAOC,EAAc,WAAW,OAAOA,EAAc,UAAA;AAAA,EACvD,EAAE,OAAOA,EAAc,gBAAgB,OAAOA,EAAc,eAAA;AAAA,EAC5D,EAAE,OAAOA,EAAc,eAAe,OAAOA,EAAc,cAAA;AAAA,EAC3D,EAAE,OAAOA,EAAc,SAAS,OAAOA,EAAc,QAAA;AACvD,GAEMC,KAAyB;AAAA,EAC7BD,EAAc;AAAA,EACdA,EAAc;AAAA,EACdA,EAAc;AAAA,EACdA,EAAc;AAChB;AAyHA,SAASE,GACPC,GACA;AAAA,EACE,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AACF,GAMA;AACA,SAAO;AAAA,IACL,OAAOC,EAAYL,EAAK,OAAOC,GAAcC,CAAQ;AAAA,IACrD,UAAUG,EAAYL,EAAK,UAAUG,GAAeC,CAAQ;AAAA,IAC5D,YAAYJ,EAAK;AAAA,IACjB,aAAaA,EAAK;AAAA,IAClB,kBAAkBA,EAAK;AAAA,IACvB,kBAAkBA,EAAK;AAAA,IACvB,QAAQA,EAAK;AAAA,IACb,eAAeK;AAAA,MACbL,EAAK;AAAA,MACL,CAAC,GAAGJ,EAAsB;AAAA,MAC1B,CAAC,GAAGE,EAAsB;AAAA,IAAA;AAAA,EAC5B;AAEJ;AA+DO,SAASQ,GAA+B;AAAA,EAC7C,Y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A,EAAA;AAAA,QACF;AAAA,MAAA,EACF;AAAA,IACF,CAAC,GAEMD;AAAA,EACT,GAEMW,IAAoBC,GAAqB7C,CAAW;AAE1D,SAAIZ,EAAgB,YACX,EAAE,WAAW,IAAe,eAAAkC,EAAA,IAEjC,CAACpC,KAAgBM,EAAsB,YAClC,EAAE,WAAW,IAAe,eAAA8B,EAAA,IAG9B;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,UAAA9C;AAAA,MACA,UAAAE;AAAA,MACA,WAAWgB;AAAA,IAAA;AAAA,IAEb,QAAQ;AAAA,MACN,WAAAuB;AAAA,MACA,MAAM/B,IAAe,WAAW;AAAA,MAChC,gBAAgBmB;AAAA,MAChB,yBAAyBA,GAAoB,yBAAyB;AAAA,MACtE,kBAAAoB;AAAA,IAAA;AAAA,IAEF,SAAS,EAAE,UAAAO,EAAA;AAAA,IACX,eAAAV;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,OAAOwB;AAAA,QACP,UAAUnB,IAAwBoB,KAAgB;AAAA,QAClD,YAAYtB,EAAiB,IAAI,aAAa,IAAIuB,KAAkB;AAAA,QACpE,aAAavB,EAAiB,IAAI,cAAc,IAAIwB,KAAmB;AAAA,QACvE,kBAAkBxB,EAAiB,IAAI,mBAAmB,IACtDyB,KACA;AAAA,QACJ,kBAAkBC;AAAA,QAClB,QAAQC;AAAA,QACR,eAAeC;AAAA,MAAA;AAAA,MAEjB,gBAAAtB;AAAA,MACA,mBAAAa;AAAA,MACA,yBAAyBU,GAA8BtD,GAAaH,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
1
+ {"version":3,"file":"useChildSupportGarnishmentForm.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useChildSupportGarnishmentForm/useChildSupportGarnishmentForm.tsx"],"sourcesContent":["import type { ComponentType } from 'react'\nimport { useEffect, useMemo, useRef } from 'react'\nimport { useForm, useWatch } from 'react-hook-form'\nimport type { UseFormProps } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n type Garnishment,\n type GarnishmentType,\n} from '@gusto/embedded-api/models/components/garnishment'\nimport type { Agencies } from '@gusto/embedded-api/models/components/childsupportdata'\nimport { PaymentPeriod } from '@gusto/embedded-api/models/components/garnishmentchildsupport'\nimport { useGarnishmentsCreateMutation } from '@gusto/embedded-api/react-query/garnishmentsCreate'\nimport { useGarnishmentsUpdateMutation } from '@gusto/embedded-api/react-query/garnishmentsUpdate'\nimport { useGarnishmentsList } from '@gusto/embedded-api/react-query/garnishmentsList'\nimport { useGarnishmentsGetChildSupportData } from '@gusto/embedded-api/react-query/garnishmentsGetChildSupportData'\nimport {\n createChildSupportGarnishmentFormSchema,\n getRequiredAttrKeys,\n type ChildSupportGarnishmentFormData,\n type ChildSupportGarnishmentFormOutputs,\n type SupportedRequiredAttrKey,\n} from './childSupportGarnishmentFormSchema'\nimport {\n StateField,\n FipsCodeField,\n CaseNumberField,\n OrderNumberField,\n RemittanceNumberField,\n PayPeriodMaximumField,\n AmountField,\n PaymentPeriodField,\n type CountyEntry,\n type StateFieldEntry,\n type StateFieldProps,\n type FipsCodeFieldProps,\n type CaseNumberFieldProps,\n type OrderNumberFieldProps,\n type RemittanceNumberFieldProps,\n type PayPeriodMaximumFieldProps,\n type AmountFieldProps,\n type PaymentPeriodFieldProps,\n} from './fields'\nimport { useDeriveFieldsMetadata } from '@/partner-hook-utils/form/useDeriveFieldsMetadata'\nimport { useHookFormInternals } from '@/partner-hook-utils/form/useHookFormInternals'\nimport { createGetFormSubmissionValues } from '@/partner-hook-utils/form/getFormSubmissionValues'\nimport { withOptions } from '@/partner-hook-utils/form/withOptions'\nimport { composeErrorHandler } from '@/partner-hook-utils/composeErrorHandler'\nimport type {\n BaseFormHookReady,\n FieldMetadata,\n FieldsMetadata,\n HookLoadingResult,\n HookSubmitResult,\n} from '@/partner-hook-utils/types'\nimport { useBaseSubmit } from '@/components/Base/useBaseSubmit'\nimport { SDKInternalError } from '@/types/sdkError'\n\nconst PAYMENT_PERIOD_OPTIONS = [\n { value: PaymentPeriod.EveryWeek, label: PaymentPeriod.EveryWeek },\n { value: PaymentPeriod.EveryOtherWeek, label: PaymentPeriod.EveryOtherWeek },\n { value: PaymentPeriod.TwicePerMonth, label: PaymentPeriod.TwicePerMonth },\n { value: PaymentPeriod.Monthly, label: PaymentPeriod.Monthly },\n] as const\n\nconst PAYMENT_PERIOD_ENTRIES = [\n PaymentPeriod.EveryWeek,\n PaymentPeriod.EveryOtherWeek,\n PaymentPeriod.TwicePerMonth,\n PaymentPeriod.Monthly,\n] as const\n\n/**\n * Configuration options for {@link useChildSupportGarnishmentForm}.\n *\n * @remarks\n * Presence or absence of `garnishmentId` selects the API verb — see the\n * `garnishmentId` field description.\n *\n * @public\n */\nexport interface UseChildSupportGarnishmentFormProps {\n /** UUID of the employee whose child-support garnishment is being created or edited. */\n employeeId: string\n /**\n * When set, loads that garnishment and updates it (PUT). When omitted, the\n * form is in create mode (POST).\n */\n garnishmentId?: string\n /** Pre-fill form values. Server data takes precedence on update. */\n defaultValues?: Partial<ChildSupportGarnishmentFormData>\n /** Passed through to react-hook-form. Defaults to `'onSubmit'`. */\n validationMode?: UseFormProps['mode']\n /** Auto-focus the first invalid field on submit. Set to `false` when using `composeSubmitHandler` so submit-time focus is coordinated across multiple forms. Defaults to `true`. */\n shouldFocusError?: boolean\n}\n\n/**\n * Pre-bound field components exposed on `useChildSupportGarnishmentForm().form.Fields`.\n *\n * @remarks\n * Each property is either the field component or `undefined`. A field is\n * `undefined` when conditions for rendering it aren't met — see each member\n * for its visibility rule. Always null-check conditional fields (e.g.\n * `{Fields.FipsCode && <Fields.FipsCode ... />}`) before rendering.\n *\n * @public\n */\nexport interface ChildSupportGarnishmentFormFields {\n /** Bound to `state`. Agency (state) select. Always available. */\n State: ComponentType<StateFieldProps>\n /** Bound to `fipsCode`. Only available when the selected agency has more than\n * one fips code, or the sole code is county-scoped (not an \"all counties\"\n * auto-pick). */\n FipsCode: ComponentType<FipsCodeFieldProps> | undefined\n /** Bound to `caseNumber`. Only available when the selected agency requires `case_number`. */\n CaseNumber: ComponentType<CaseNumberFieldProps> | undefined\n /** Bound to `orderNumber`. Only available when the selected agency requires `order_number`. */\n OrderNumber: ComponentType<OrderNumberFieldProps> | undefined\n /** Bound to `remittanceNumber`. Only available when the selected agency requires `remittance_number`. */\n RemittanceNumber: ComponentType<RemittanceNumberFieldProps> | undefined\n /** Bound to `payPeriodMaximum`. Per-pay-period currency cap input. Always available. */\n PayPeriodMaximum: ComponentType<PayPeriodMaximumFieldProps>\n /** Bound to `amount`. Percent-of-paycheck input (0–100). Always available. */\n Amount: ComponentType<AmountFieldProps>\n /** Bound to `paymentPeriod`. Payment period select. Always available. */\n PaymentPeriod: ComponentType<PaymentPeriodFieldProps>\n}\n\n/**\n * Ready-state shape returned by {@link useChildSupportGarnishmentForm} once data has loaded.\n *\n * @remarks\n * Discriminated by `isLoading: false`. Extends {@link BaseFormHookReady} with\n * the child-support-specific `data`, `status`, `actions`, and `form.Fields`\n * shape. Static, entity-derived values live under `data.*`; reactive values\n * that flip with form input live under `status.*`.\n *\n * @public\n */\nexport interface UseChildSupportGarnishmentFormReady extends BaseFormHookReady<\n ChildSupportGarnishmentFormFieldsMetadata,\n ChildSupportGarnishmentFormData,\n ChildSupportGarnishmentFormFields\n> {\n /** Child-support-specific data payload: the available agencies, counties for the selected state, and the loaded garnishment for update mode. */\n data: {\n /** Agencies offered as `State` options; raw entries the consumer can use\n * with `getOptionLabel` for translated names. */\n agencies: StateFieldEntry[]\n /** Counties for the currently selected state. Empty array when no state\n * is selected. */\n counties: CountyEntry[]\n /** The garnishment loaded for update; `null` in create mode. */\n deduction: Garnishment | null\n }\n /** Submission state and reactive flags derived from current form input. */\n status: {\n /** `true` while a create or update mutation is in flight. */\n isPending: boolean\n /** Reflects whether the next submit will POST a new garnishment or PUT an existing one. */\n mode: 'create' | 'update'\n /** The agency record matching the currently selected `state`. */\n selectedAgency: Agencies | null\n /** Mirrors `selectedAgency.manualPaymentRequired`; convenient for showing\n * a warning alert. */\n isManualPaymentRequired: boolean\n /** Which `required_attributes` keys the selected agency declares. */\n requiredAttrKeys: ReadonlySet<SupportedRequiredAttrKey>\n }\n /** Submission action. */\n actions: {\n /** Submits the form. Returns the saved garnishment + mode on success, or `undefined` when validation fails or the request errored. */\n onSubmit: () => Promise<HookSubmitResult<Garnishment> | undefined>\n }\n}\n\n/**\n * Return value of {@link useChildSupportGarnishmentForm}.\n *\n * @remarks\n * Discriminated union: {@link HookLoadingResult} while the agency catalog (and,\n * in update mode, the existing garnishment) is loading;\n * {@link UseChildSupportGarnishmentFormReady} once data is ready.\n *\n * @public\n */\nexport type UseChildSupportGarnishmentFormResult =\n HookLoadingResult | UseChildSupportGarnishmentFormReady\n\n/** @internal */\nfunction buildChildSupportGarnishmentFieldsMetadata(\n base: Record<keyof ChildSupportGarnishmentFormData, FieldMetadata>,\n {\n stateOptions,\n agencies,\n countyOptions,\n counties,\n }: {\n stateOptions: Array<{ value: string; label: string }>\n agencies: StateFieldEntry[]\n countyOptions: Array<{ value: string; label: string }>\n counties: CountyEntry[]\n },\n) {\n return {\n state: withOptions(base.state, stateOptions, agencies),\n fipsCode: withOptions(base.fipsCode, countyOptions, counties),\n caseNumber: base.caseNumber,\n orderNumber: base.orderNumber,\n remittanceNumber: base.remittanceNumber,\n payPeriodMaximum: base.payPeriodMaximum,\n amount: base.amount,\n paymentPeriod: withOptions(\n base.paymentPeriod,\n [...PAYMENT_PERIOD_OPTIONS],\n [...PAYMENT_PERIOD_ENTRIES],\n ),\n } satisfies FieldsMetadata\n}\n\n/**\n * Headless hook for creating or updating a child-support garnishment.\n *\n * @remarks\n * Unlike standard garnishments, child support requires agency-specific\n * attributes (case number, order number, remittance number) that vary by\n * state, plus an optional county selection when the state has multiple\n * counties. The hook loads the agency catalog from the Gusto API, derives\n * which attributes the selected state requires, and exposes the right Fields\n * conditionally.\n *\n * Presence or absence of `garnishmentId` selects the API verb: omit it to\n * POST a new garnishment, supply it to PUT updates against the existing row.\n * For non-child-support deductions (court-ordered garnishments and post-tax\n * custom), use {@link useDeductionForm} instead.\n *\n * @param input - See {@link UseChildSupportGarnishmentFormProps}.\n * @returns A {@link HookLoadingResult} while loading, or a {@link UseChildSupportGarnishmentFormReady} once ready.\n * @public\n *\n * @example\n * ```tsx\n * import { useChildSupportGarnishmentForm, SDKFormProvider } from '@gusto/embedded-react-sdk'\n *\n * function ChildSupportPage({ employeeId, garnishmentId }: { employeeId: string; garnishmentId?: string }) {\n * const form = useChildSupportGarnishmentForm({ employeeId, garnishmentId })\n *\n * if (form.isLoading) return <p>Loading…</p>\n *\n * const { Fields } = form.form\n *\n * return (\n * <SDKFormProvider formHookResult={form}>\n * <form\n * onSubmit={e => {\n * e.preventDefault()\n * void form.actions.onSubmit()\n * }}\n * >\n * <Fields.State\n * label=\"Agency\"\n * getOptionLabel={entry => entry.name}\n * validationMessages={{ REQUIRED: 'Required' }}\n * />\n * {Fields.CaseNumber && (\n * <Fields.CaseNumber label=\"Case number\" validationMessages={{ REQUIRED: 'Required' }} />\n * )}\n * <Fields.Amount\n * label=\"Percentage of paycheck\"\n * validationMessages={{\n * REQUIRED: 'Required',\n * PERCENT_OUT_OF_RANGE: 'Must be between 0 and 100',\n * }}\n * />\n * <button type=\"submit\">Save</button>\n * </form>\n * </SDKFormProvider>\n * )\n * }\n * ```\n */\nexport function useChildSupportGarnishmentForm({\n employeeId,\n garnishmentId,\n defaultValues: partnerDefaults,\n validationMode = 'onSubmit',\n shouldFocusError = true,\n}: UseChildSupportGarnishmentFormProps): UseChildSupportGarnishmentFormResult {\n const isCreateMode = !garnishmentId\n const schemaMode = isCreateMode ? 'create' : 'update'\n\n // Agencies + their required-attributes / fips codes come from a single GET.\n const agencyDataQuery = useGarnishmentsGetChildSupportData({})\n const agencyList = useMemo(\n () => agencyDataQuery.data?.childSupportData?.agencies ?? [],\n [agencyDataQuery.data],\n )\n\n // Update mode reads the row from the list endpoint (the garnishments API\n // has no single-row GET).\n const garnishmentsListQuery = useGarnishmentsList({ employeeId }, { enabled: !isCreateMode })\n const fetchedDeduction = useMemo(() => {\n if (isCreateMode) return null\n return garnishmentsListQuery.data?.garnishments?.find(g => g.uuid === garnishmentId) ?? null\n }, [isCreateMode, garnishmentId, garnishmentsListQuery.data])\n\n const resolvedDefaults: ChildSupportGarnishmentFormData = useMemo(\n () => ({\n state: fetchedDeduction?.childSupport?.state ?? partnerDefaults?.state ?? '',\n fipsCode: fetchedDeduction?.childSupport?.fipsCode ?? partnerDefaults?.fipsCode ?? '',\n caseNumber: fetchedDeduction?.childSupport?.caseNumber ?? partnerDefaults?.caseNumber ?? '',\n orderNumber:\n fetchedDeduction?.childSupport?.orderNumber ?? partnerDefaults?.orderNumber ?? '',\n remittanceNumber:\n fetchedDeduction?.childSupport?.remittanceNumber ?? partnerDefaults?.remittanceNumber ?? '',\n amount: fetchedDeduction?.amount\n ? Number(fetchedDeduction.amount)\n : (partnerDefaults?.amount ?? 0),\n payPeriodMaximum: fetchedDeduction?.payPeriodMaximum\n ? Number(fetchedDeduction.payPeriodMaximum)\n : (partnerDefaults?.payPeriodMaximum ?? 0),\n paymentPeriod:\n (fetchedDeduction?.childSupport?.paymentPeriod as PaymentPeriod | undefined) ??\n partnerDefaults?.paymentPeriod ??\n PaymentPeriod.Monthly,\n }),\n [fetchedDeduction, partnerDefaults],\n )\n\n // Pass the full agency list so requiredness for the agency-attribute fields\n // (`caseNumber`, `orderNumber`, `remittanceNumber`) is derived dynamically\n // from the form's `state` value. The schema doesn't need to rebuild when the\n // user changes states — the predicate runs at validation time and via\n // `useDeriveFieldsMetadata` for the (optional) label.\n const [schema, metadataConfig] = useMemo(\n () => createChildSupportGarnishmentFormSchema({ mode: schemaMode, agencyList }),\n [schemaMode, agencyList],\n )\n\n const formMethods = useForm<\n ChildSupportGarnishmentFormData,\n unknown,\n ChildSupportGarnishmentFormOutputs\n >({\n resolver: zodResolver(schema),\n mode: validationMode,\n shouldFocusError,\n defaultValues: resolvedDefaults,\n values: resolvedDefaults,\n resetOptions: { keepDirtyValues: true },\n })\n\n const liveWatchedState = useWatch({ control: formMethods.control, name: 'state' })\n const liveSelectedAgency = useMemo(\n () => agencyList.find(a => a.state === liveWatchedState) ?? null,\n [agencyList, liveWatchedState],\n )\n\n // The agency-attribute fields stay in sync with the chosen state: when the\n // user switches states, the previous attribute values would otherwise carry\n // over and potentially submit alongside the wrong agency. The ref tracks\n // the previous value so the wipe only fires on user-driven transitions —\n // NOT on the initial sync when an existing garnishment loads (state moves\n // from '' to e.g. 'AK' as a side effect of `values` updating, which would\n // otherwise clobber the loaded case/order/remittance values).\n const previousWatchedStateRef = useRef<string | null>(null)\n useEffect(() => {\n const previous = previousWatchedStateRef.current\n previousWatchedStateRef.current = liveWatchedState\n // First render (no previous value) → skip the wipe.\n if (previous === null) return\n // Server-side load: previous was '' (initial defaults before the row\n // arrived), now it's the loaded state. That's a sync, not a user toggle.\n if (previous === '') return\n if (previous === liveWatchedState) return\n formMethods.setValue('caseNumber', '')\n formMethods.setValue('orderNumber', '')\n formMethods.setValue('remittanceNumber', '')\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [liveWatchedState])\n\n // When the selected agency has a single \"all counties\" fips code, auto-fill\n // the field so the consumer doesn't have to render the county select.\n const fipsCodes = liveSelectedAgency?.fipsCodes ?? []\n const singleAllCountiesFipsCode =\n fipsCodes.length === 1 && !fipsCodes[0]?.county?.length ? (fipsCodes[0]?.code ?? null) : null\n useEffect(() => {\n if (singleAllCountiesFipsCode) {\n formMethods.setValue('fipsCode', singleAllCountiesFipsCode)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [singleAllCountiesFipsCode])\n\n const createGarnishmentMutation = useGarnishmentsCreateMutation()\n const updateGarnishmentMutation = useGarnishmentsUpdateMutation()\n const isPending = createGarnishmentMutation.isPending || updateGarnishmentMutation.isPending\n\n const {\n baseSubmitHandler,\n error: submitError,\n setError: setSubmitError,\n } = useBaseSubmit('ChildSupportGarnishmentForm')\n\n const errorHandling = composeErrorHandler(\n isCreateMode ? [agencyDataQuery] : [agencyDataQuery, garnishmentsListQuery],\n { submitError, setSubmitError },\n )\n\n // ── Derived data exposed on the ready branch ─────────────────────────\n\n const agencies: StateFieldEntry[] = useMemo(\n () =>\n agencyList.map(a => ({\n state: a.state ?? '',\n name: a.name ?? a.state ?? '',\n manualPaymentRequired: a.manualPaymentRequired ?? false,\n })),\n [agencyList],\n )\n\n const counties: CountyEntry[] = useMemo(\n () =>\n (liveSelectedAgency?.fipsCodes ?? [])\n .filter(f => typeof f.code === 'string')\n .map(f => ({ fipsCode: f.code as string, county: f.county ?? null })),\n [liveSelectedAgency],\n )\n\n const requiredAttrKeys = useMemo(\n () => getRequiredAttrKeys(liveSelectedAgency),\n [liveSelectedAgency],\n )\n\n const hasSelectableCounties =\n counties.length > 1 || (counties.length === 1 && singleAllCountiesFipsCode == null)\n\n // ── Metadata + field-options wiring ─────────────────────────────────\n\n const baseMetadata = useDeriveFieldsMetadata(metadataConfig, formMethods.control)\n const stateOptions = agencies.map(a => ({ value: a.state, label: a.name }))\n const countyOptions = counties.map(c => ({\n value: c.fipsCode,\n label: c.county ?? c.fipsCode,\n }))\n\n const fieldsMetadata = buildChildSupportGarnishmentFieldsMetadata(baseMetadata, {\n stateOptions,\n agencies,\n countyOptions,\n counties,\n })\n\n // ── Submit ───────────────────────────────────────────────────────────\n\n const onSubmit = async (): Promise<HookSubmitResult<Garnishment> | undefined> => {\n let submitResult: HookSubmitResult<Garnishment> | undefined\n\n await new Promise<void>(resolve => {\n void formMethods.handleSubmit(\n async (data: ChildSupportGarnishmentFormOutputs) => {\n await baseSubmitHandler(data, async payload => {\n const childSupport = {\n state: payload.state,\n paymentPeriod: payload.paymentPeriod,\n fipsCode: payload.fipsCode,\n // Empty strings collapse to null so the API persists \"no value\n // declared\" rather than an empty case number.\n caseNumber: payload.caseNumber || null,\n orderNumber: payload.orderNumber || null,\n remittanceNumber: payload.remittanceNumber || null,\n }\n\n const description = `Child Support - ${childSupport.caseNumber ?? ''}`\n const amountStr = String(payload.amount)\n const payPeriodMaximumStr =\n payload.payPeriodMaximum > 0 ? String(payload.payPeriodMaximum) : null\n\n const requestBody = {\n active: true,\n amount: amountStr,\n description,\n courtOrdered: true,\n garnishmentType: 'child_support' as GarnishmentType,\n times: null,\n deductAsPercentage: true,\n payPeriodMaximum: payPeriodMaximumStr,\n recurring: true,\n childSupport,\n }\n\n let updated: Garnishment | undefined\n\n if (isCreateMode) {\n const result = await createGarnishmentMutation.mutateAsync({\n request: { employeeId, garnishmentRequest: requestBody },\n })\n updated = result.garnishment\n } else {\n if (!fetchedDeduction) {\n throw new SDKInternalError(\n 'Cannot update child-support deduction: no matching garnishment on file',\n )\n }\n const result = await updateGarnishmentMutation.mutateAsync({\n request: {\n garnishmentId: fetchedDeduction.uuid,\n updateGarnishmentRequest: {\n ...requestBody,\n version: fetchedDeduction.version as string,\n },\n },\n })\n updated = result.garnishment\n }\n\n if (!updated) {\n throw new SDKInternalError(\n isCreateMode\n ? 'Child-support deduction creation failed'\n : 'Child-support deduction update failed',\n )\n }\n\n submitResult = {\n mode: isCreateMode ? 'create' : 'update',\n data: updated,\n }\n })\n resolve()\n },\n () => {\n resolve()\n },\n )()\n })\n\n return submitResult\n }\n\n const hookFormInternals = useHookFormInternals(formMethods)\n\n if (agencyDataQuery.isLoading) {\n return { isLoading: true as const, errorHandling }\n }\n if (!isCreateMode && garnishmentsListQuery.isLoading) {\n return { isLoading: true as const, errorHandling }\n }\n\n return {\n isLoading: false as const,\n data: {\n agencies,\n counties,\n deduction: fetchedDeduction,\n },\n status: {\n isPending,\n mode: isCreateMode ? 'create' : 'update',\n selectedAgency: liveSelectedAgency,\n isManualPaymentRequired: liveSelectedAgency?.manualPaymentRequired ?? false,\n requiredAttrKeys,\n },\n actions: { onSubmit },\n errorHandling,\n form: {\n Fields: {\n State: StateField,\n FipsCode: hasSelectableCounties ? FipsCodeField : undefined,\n CaseNumber: requiredAttrKeys.has('case_number') ? CaseNumberField : undefined,\n OrderNumber: requiredAttrKeys.has('order_number') ? OrderNumberField : undefined,\n RemittanceNumber: requiredAttrKeys.has('remittance_number')\n ? RemittanceNumberField\n : undefined,\n PayPeriodMaximum: PayPeriodMaximumField,\n Amount: AmountField,\n PaymentPeriod: PaymentPeriodField,\n },\n fieldsMetadata,\n hookFormInternals,\n getFormSubmissionValues: createGetFormSubmissionValues(formMethods, schema),\n },\n }\n}\n\n/**\n * Per-field metadata returned by {@link useChildSupportGarnishmentForm} as `form.fieldsMetadata`.\n *\n * @remarks\n * Carries per-field `isRequired`, `isDisabled`, label, description, and option\n * entries derived from the schema and form state. Use these to drive UI such\n * as disabled state or option lists when not relying on the pre-bound\n * {@link ChildSupportGarnishmentFormFields} components.\n *\n * @public\n */\nexport type ChildSupportGarnishmentFormFieldsMetadata = ReturnType<\n typeof buildChildSupportGarnishmentFieldsMetadata\n>\n"],"names":["PAYMENT_PERIOD_OPTIONS","PaymentPeriod","PAYMENT_PERIOD_ENTRIES","buildChildSupportGarnishmentFieldsMetadata","base","stateOptions","agencies","countyOptions","counties","withOptions","useChildSupportGarnishmentForm","employeeId","garnishmentId","partnerDefaults","validationMode","shouldFocusError","isCreateMode","schemaMode","agencyDataQuery","useGarnishmentsGetChildSupportData","agencyList","useMemo","garnishmentsListQuery","useGarnishmentsList","fetchedDeduction","g","resolvedDefaults","schema","metadataConfig","createChildSupportGarnishmentFormSchema","formMethods","useForm","zodResolver","liveWatchedState","useWatch","liveSelectedAgency","a","previousWatchedStateRef","useRef","useEffect","previous","fipsCodes","singleAllCountiesFipsCode","createGarnishmentMutation","useGarnishmentsCreateMutation","updateGarnishmentMutation","useGarnishmentsUpdateMutation","isPending","baseSubmitHandler","submitError","setSubmitError","useBaseSubmit","errorHandling","composeErrorHandler","f","requiredAttrKeys","getRequiredAttrKeys","hasSelectableCounties","baseMetadata","useDeriveFieldsMetadata","c","fieldsMetadata","onSubmit","submitResult","resolve","data","payload","childSupport","description","amountStr","payPeriodMaximumStr","requestBody","updated","SDKInternalError","hookFormInternals","useHookFormInternals","StateField","FipsCodeField","CaseNumberField","OrderNumberField","RemittanceNumberField","PayPeriodMaximumField","AmountField","PaymentPeriodField","createGetFormSubmissionValues"],"mappings":";;;;;;;;;;;;;;;;;AAyDA,MAAMA,KAAyB;AAAA,EAC7B,EAAE,OAAOC,EAAc,WAAW,OAAOA,EAAc,UAAA;AAAA,EACvD,EAAE,OAAOA,EAAc,gBAAgB,OAAOA,EAAc,eAAA;AAAA,EAC5D,EAAE,OAAOA,EAAc,eAAe,OAAOA,EAAc,cAAA;AAAA,EAC3D,EAAE,OAAOA,EAAc,SAAS,OAAOA,EAAc,QAAA;AACvD,GAEMC,KAAyB;AAAA,EAC7BD,EAAc;AAAA,EACdA,EAAc;AAAA,EACdA,EAAc;AAAA,EACdA,EAAc;AAChB;AAyHA,SAASE,GACPC,GACA;AAAA,EACE,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AACF,GAMA;AACA,SAAO;AAAA,IACL,OAAOC,EAAYL,EAAK,OAAOC,GAAcC,CAAQ;AAAA,IACrD,UAAUG,EAAYL,EAAK,UAAUG,GAAeC,CAAQ;AAAA,IAC5D,YAAYJ,EAAK;AAAA,IACjB,aAAaA,EAAK;AAAA,IAClB,kBAAkBA,EAAK;AAAA,IACvB,kBAAkBA,EAAK;AAAA,IACvB,QAAQA,EAAK;AAAA,IACb,eAAeK;AAAA,MACbL,EAAK;AAAA,MACL,CAAC,GAAGJ,EAAsB;AAAA,MAC1B,CAAC,GAAGE,EAAsB;AAAA,IAAA;AAAA,EAC5B;AAEJ;AA+DO,SAASQ,GAA+B;AAAA,EAC7C,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,eAAeC;AAAA,EACf,gBAAAC,IAAiB;AAAA,EACjB,kBAAAC,IAAmB;AACrB,GAA8E;AAC5E,QAAMC,IAAe,CAACJ,GAChBK,IA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,eAAAkC,EAAA,IAEjC,CAACpC,KAAgBM,EAAsB,YAClC,EAAE,WAAW,IAAe,eAAA8B,EAAA,IAG9B;AAAA,IACL,WAAW;AAAA,IACX,MAAM;AAAA,MACJ,UAAA9C;AAAA,MACA,UAAAE;AAAA,MACA,WAAWgB;AAAA,IAAA;AAAA,IAEb,QAAQ;AAAA,MACN,WAAAuB;AAAA,MACA,MAAM/B,IAAe,WAAW;AAAA,MAChC,gBAAgBmB;AAAA,MAChB,yBAAyBA,GAAoB,yBAAyB;AAAA,MACtE,kBAAAoB;AAAA,IAAA;AAAA,IAEF,SAAS,EAAE,UAAAO,EAAA;AAAA,IACX,eAAAV;AAAA,IACA,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,OAAOwB;AAAA,QACP,UAAUnB,IAAwBoB,KAAgB;AAAA,QAClD,YAAYtB,EAAiB,IAAI,aAAa,IAAIuB,KAAkB;AAAA,QACpE,aAAavB,EAAiB,IAAI,cAAc,IAAIwB,KAAmB;AAAA,QACvE,kBAAkBxB,EAAiB,IAAI,mBAAmB,IACtDyB,KACA;AAAA,QACJ,kBAAkBC;AAAA,QAClB,QAAQC;AAAA,QACR,eAAeC;AAAA,MAAA;AAAA,MAEjB,gBAAAtB;AAAA,MACA,mBAAAa;AAAA,MACA,yBAAyBU,GAA8BtD,GAAaH,CAAM;AAAA,IAAA;AAAA,EAC5E;AAEJ;"}
@@ -1,5 +1,5 @@
1
1
  import { z as e } from "zod";
2
- import { GarnishmentType as a } from "@gusto/embedded-api-v-2026-02-01/models/components/garnishment";
2
+ import { GarnishmentType as a } from "@gusto/embedded-api/models/components/garnishment";
3
3
  import { buildFormSchema as c } from "../../../../../partner-hook-utils/form/buildFormSchema.js";
4
4
  import { coerceNaN as o, coerceStringBoolean as n } from "../../../../../partner-hook-utils/form/preprocessors.js";
5
5
  const r = {
@@ -1 +1 @@
1
- {"version":3,"file":"deductionFormSchema.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport { GarnishmentType } from '@gusto/embedded-api-v-2026-02-01/models/components/garnishment'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN, coerceStringBoolean } from '@/partner-hook-utils/form/preprocessors'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\n/**\n * Validation error codes emitted by the deduction form schema. Map these\n * codes to localized copy in `validationMessages` when composing the hook.\n *\n * @public\n */\nexport const DeductionFormErrorCodes = {\n REQUIRED: 'REQUIRED',\n NEGATIVE_AMOUNT: 'NEGATIVE_AMOUNT',\n} as const\n\n/**\n * Union of validation error code strings emitted by the deduction form schema.\n *\n * @public\n */\nexport type DeductionFormErrorCode =\n (typeof DeductionFormErrorCodes)[keyof typeof DeductionFormErrorCodes]\n\n// ── Field validators ───────────────────────────────────────────────────\n\nconst fieldValidators = {\n description: z.string(),\n // Radio groups deliver `'true'`/`'false'` strings; coerce to boolean for the\n // submit payload. Matches the useJobForm pattern.\n recurring: z.preprocess(coerceStringBoolean, z.boolean()),\n deductAsPercentage: z.preprocess(coerceStringBoolean, z.boolean()),\n // Currency / percent input. NumberInputField writes `number | undefined`;\n // coerce to a numeric so .min(0) runs reliably. The number-to-string\n // conversion the garnishment API expects happens inside the hook's onSubmit,\n // so the form value stays a number end-to-end (input === output).\n amount: z.preprocess(\n coerceNaN(0),\n z.number().min(0, { message: DeductionFormErrorCodes.NEGATIVE_AMOUNT }),\n ),\n // Optional caps. The hook drops them to `null` on the wire when 0 — matches\n // the legacy DeductionSchema's \"0 means no cap\" behavior.\n totalAmount: z.preprocess(\n coerceNaN(0),\n z.number().min(0, { message: DeductionFormErrorCodes.NEGATIVE_AMOUNT }),\n ),\n annualMaximum: z.preprocess(\n coerceNaN(0),\n z.number().min(0, { message: DeductionFormErrorCodes.NEGATIVE_AMOUNT }),\n ),\n // Only used when `courtOrdered: true` — see `excludeFields` below.\n garnishmentType: z.enum(GarnishmentType),\n}\n\n/**\n * Shape of the values managed by the deduction form.\n *\n * @public\n * @interface\n */\nexport type DeductionFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\n/** @internal */\nexport type DeductionFormOutputs = DeductionFormData\n\n// ── Required fields config ─────────────────────────────────────────────\n//\n// `description`, `recurring`, `deductAsPercentage`, `amount` are required by\n// default. `garnishmentType` is required only when present in the shape\n// (court-ordered branch). `totalAmount` and `annualMaximum` are caps the\n// partner can leave blank.\n\nconst requiredFieldsConfig = {\n totalAmount: 'never',\n annualMaximum: 'never',\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\n/**\n * Keys of optional deduction fields that can be promoted to required via the\n * hook's `optionalFieldsToRequire` option.\n *\n * @public\n */\nexport type DeductionFormOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\n\n/** @internal */\ninterface DeductionFormSchemaOptions {\n mode?: 'create' | 'update'\n /**\n * Court-ordered garnishments require `garnishmentType` (Federal Tax Lien,\n * Student Loan, etc.). Non-court-ordered \"custom\" deductions don't carry a\n * type — the field is excluded from the schema entirely, matching the legacy\n * GarnishmentForm vs CustomDeductionForm split.\n */\n courtOrdered: boolean\n optionalFieldsToRequire?: DeductionFormOptionalFieldsToRequire\n}\n\n/** @internal */\nexport function createDeductionFormSchema(options: DeductionFormSchemaOptions) {\n const { mode = 'create', courtOrdered, optionalFieldsToRequire } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: DeductionFormErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n excludeFields: courtOrdered ? [] : ['garnishmentType'],\n })\n}\n"],"names":["DeductionFormErrorCodes","fieldValidators","z","coerceStringBoolean","coerceNaN","GarnishmentType","requiredFieldsConfig","createDeductionFormSchema","options","mode","courtOrdered","optionalFieldsToRequire","buildFormSchema"],"mappings":";;;;AAiBO,MAAMA,IAA0B;AAAA,EACrC,UAAU;AAAA,EACV,iBAAiB;AACnB,GAYMC,IAAkB;AAAA,EACtB,aAAaC,EAAE,OAAA;AAAA;AAAA;AAAA,EAGf,WAAWA,EAAE,WAAWC,GAAqBD,EAAE,SAAS;AAAA,EACxD,oBAAoBA,EAAE,WAAWC,GAAqBD,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjE,QAAQA,EAAE;AAAA,IACRE,EAAU,CAAC;AAAA,IACXF,EAAE,SAAS,IAAI,GAAG,EAAE,SAASF,EAAwB,gBAAA,CAAiB;AAAA,EAAA;AAAA;AAAA;AAAA,EAIxE,aAAaE,EAAE;AAAA,IACbE,EAAU,CAAC;AAAA,IACXF,EAAE,SAAS,IAAI,GAAG,EAAE,SAASF,EAAwB,gBAAA,CAAiB;AAAA,EAAA;AAAA,EAExE,eAAeE,EAAE;AAAA,IACfE,EAAU,CAAC;AAAA,IACXF,EAAE,SAAS,IAAI,GAAG,EAAE,SAASF,EAAwB,gBAAA,CAAiB;AAAA,EAAA;AAAA;AAAA,EAGxE,iBAAiBE,EAAE,KAAKG,CAAe;AACzC,GAsBMC,IAAuB;AAAA,EAC3B,aAAa;AAAA,EACb,eAAe;AACjB;AA0BO,SAASC,EAA0BC,GAAqC;AAC7E,QAAM,EAAE,MAAAC,IAAO,UAAU,cAAAC,GAAc,yBAAAC,MAA4BH;AAEnE,SAAOI,EAAgBX,GAAiB;AAAA,IACtC,sBAAAK;AAAA,IACA,mBAAmBN,EAAwB;AAAA,IAC3C,MAAAS;AAAA,IACA,yBAAAE;AAAA,IACA,eAAeD,IAAe,CAAA,IAAK,CAAC,iBAAiB;AAAA,EAAA,CACtD;AACH;"}
1
+ {"version":3,"file":"deductionFormSchema.js","sources":["../../../../../../src/components/Employee/Deductions/shared/useDeductionForm/deductionFormSchema.ts"],"sourcesContent":["import { z } from 'zod'\nimport { GarnishmentType } from '@gusto/embedded-api/models/components/garnishment'\nimport {\n buildFormSchema,\n type RequiredFieldConfig,\n type OptionalFieldsToRequire,\n} from '@/partner-hook-utils/form/buildFormSchema'\nimport { coerceNaN, coerceStringBoolean } from '@/partner-hook-utils/form/preprocessors'\n\n// ── Error codes ────────────────────────────────────────────────────────\n\n/**\n * Validation error codes emitted by the deduction form schema. Map these\n * codes to localized copy in `validationMessages` when composing the hook.\n *\n * @public\n */\nexport const DeductionFormErrorCodes = {\n REQUIRED: 'REQUIRED',\n NEGATIVE_AMOUNT: 'NEGATIVE_AMOUNT',\n} as const\n\n/**\n * Union of validation error code strings emitted by the deduction form schema.\n *\n * @public\n */\nexport type DeductionFormErrorCode =\n (typeof DeductionFormErrorCodes)[keyof typeof DeductionFormErrorCodes]\n\n// ── Field validators ───────────────────────────────────────────────────\n\nconst fieldValidators = {\n description: z.string(),\n // Radio groups deliver `'true'`/`'false'` strings; coerce to boolean for the\n // submit payload. Matches the useJobForm pattern.\n recurring: z.preprocess(coerceStringBoolean, z.boolean()),\n deductAsPercentage: z.preprocess(coerceStringBoolean, z.boolean()),\n // Currency / percent input. NumberInputField writes `number | undefined`;\n // coerce to a numeric so .min(0) runs reliably. The number-to-string\n // conversion the garnishment API expects happens inside the hook's onSubmit,\n // so the form value stays a number end-to-end (input === output).\n amount: z.preprocess(\n coerceNaN(0),\n z.number().min(0, { message: DeductionFormErrorCodes.NEGATIVE_AMOUNT }),\n ),\n // Optional caps. The hook drops them to `null` on the wire when 0 — matches\n // the legacy DeductionSchema's \"0 means no cap\" behavior.\n totalAmount: z.preprocess(\n coerceNaN(0),\n z.number().min(0, { message: DeductionFormErrorCodes.NEGATIVE_AMOUNT }),\n ),\n annualMaximum: z.preprocess(\n coerceNaN(0),\n z.number().min(0, { message: DeductionFormErrorCodes.NEGATIVE_AMOUNT }),\n ),\n // Only used when `courtOrdered: true` — see `excludeFields` below.\n garnishmentType: z.enum(GarnishmentType),\n}\n\n/**\n * Shape of the values managed by the deduction form.\n *\n * @public\n * @interface\n */\nexport type DeductionFormData = {\n [K in keyof typeof fieldValidators]: z.infer<(typeof fieldValidators)[K]>\n}\n\n/** @internal */\nexport type DeductionFormOutputs = DeductionFormData\n\n// ── Required fields config ─────────────────────────────────────────────\n//\n// `description`, `recurring`, `deductAsPercentage`, `amount` are required by\n// default. `garnishmentType` is required only when present in the shape\n// (court-ordered branch). `totalAmount` and `annualMaximum` are caps the\n// partner can leave blank.\n\nconst requiredFieldsConfig = {\n totalAmount: 'never',\n annualMaximum: 'never',\n} satisfies RequiredFieldConfig<typeof fieldValidators>\n\n/**\n * Keys of optional deduction fields that can be promoted to required via the\n * hook's `optionalFieldsToRequire` option.\n *\n * @public\n */\nexport type DeductionFormOptionalFieldsToRequire = OptionalFieldsToRequire<\n typeof requiredFieldsConfig\n>\n\n/** @internal */\ninterface DeductionFormSchemaOptions {\n mode?: 'create' | 'update'\n /**\n * Court-ordered garnishments require `garnishmentType` (Federal Tax Lien,\n * Student Loan, etc.). Non-court-ordered \"custom\" deductions don't carry a\n * type — the field is excluded from the schema entirely, matching the legacy\n * GarnishmentForm vs CustomDeductionForm split.\n */\n courtOrdered: boolean\n optionalFieldsToRequire?: DeductionFormOptionalFieldsToRequire\n}\n\n/** @internal */\nexport function createDeductionFormSchema(options: DeductionFormSchemaOptions) {\n const { mode = 'create', courtOrdered, optionalFieldsToRequire } = options\n\n return buildFormSchema(fieldValidators, {\n requiredFieldsConfig,\n requiredErrorCode: DeductionFormErrorCodes.REQUIRED,\n mode,\n optionalFieldsToRequire,\n excludeFields: courtOrdered ? [] : ['garnishmentType'],\n })\n}\n"],"names":["DeductionFormErrorCodes","fieldValidators","z","coerceStringBoolean","coerceNaN","GarnishmentType","requiredFieldsConfig","createDeductionFormSchema","options","mode","courtOrdered","optionalFieldsToRequire","buildFormSchema"],"mappings":";;;;AAiBO,MAAMA,IAA0B;AAAA,EACrC,UAAU;AAAA,EACV,iBAAiB;AACnB,GAYMC,IAAkB;AAAA,EACtB,aAAaC,EAAE,OAAA;AAAA;AAAA;AAAA,EAGf,WAAWA,EAAE,WAAWC,GAAqBD,EAAE,SAAS;AAAA,EACxD,oBAAoBA,EAAE,WAAWC,GAAqBD,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjE,QAAQA,EAAE;AAAA,IACRE,EAAU,CAAC;AAAA,IACXF,EAAE,SAAS,IAAI,GAAG,EAAE,SAASF,EAAwB,gBAAA,CAAiB;AAAA,EAAA;AAAA;AAAA;AAAA,EAIxE,aAAaE,EAAE;AAAA,IACbE,EAAU,CAAC;AAAA,IACXF,EAAE,SAAS,IAAI,GAAG,EAAE,SAASF,EAAwB,gBAAA,CAAiB;AAAA,EAAA;AAAA,EAExE,eAAeE,EAAE;AAAA,IACfE,EAAU,CAAC;AAAA,IACXF,EAAE,SAAS,IAAI,GAAG,EAAE,SAASF,EAAwB,gBAAA,CAAiB;AAAA,EAAA;AAAA;AAAA,EAGxE,iBAAiBE,EAAE,KAAKG,CAAe;AACzC,GAsBMC,IAAuB;AAAA,EAC3B,aAAa;AAAA,EACb,eAAe;AACjB;AA0BO,SAASC,EAA0BC,GAAqC;AAC7E,QAAM,EAAE,MAAAC,IAAO,UAAU,cAAAC,GAAc,yBAAAC,MAA4BH;AAEnE,SAAOI,EAAgBX,GAAiB;AAAA,IACtC,sBAAAK;AAAA,IACA,mBAAmBN,EAAwB;AAAA,IAC3C,MAAAS;AAAA,IACA,yBAAAE;AAAA,IACA,eAAeD,IAAe,CAAA,IAAK,CAAC,iBAAiB;AAAA,EAAA,CACtD;AACH;"}
@@ -1,4 +1,4 @@
1
- import { GarnishmentType } from '@gusto/embedded-api-v-2026-02-01/models/components/garnishment';
1
+ import { GarnishmentType } from '@gusto/embedded-api/models/components/garnishment';
2
2
  import { DeductionFormErrorCodes } from './deductionFormSchema';
3
3
  import { TextInputHookFieldProps } from '../../../../../partner-hook-utils/form/fields/TextInputHookField';
4
4
  import { NumberInputHookFieldProps } from '../../../../../partner-hook-utils/form/fields/NumberInputHookField';