@gusto/embedded-react-sdk 0.24.1 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (504) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/dist/assets/icons/icon-file-jpg.svg.js +10 -0
  3. package/dist/assets/icons/icon-file-jpg.svg.js.map +1 -0
  4. package/dist/assets/icons/icon-file-pdf.svg.js +10 -0
  5. package/dist/assets/icons/icon-file-pdf.svg.js.map +1 -0
  6. package/dist/assets/icons/icon-file-png.svg.js +10 -0
  7. package/dist/assets/icons/icon-file-png.svg.js.map +1 -0
  8. package/dist/assets/icons/icon-trashcan.svg.js +10 -0
  9. package/dist/assets/icons/icon-trashcan.svg.js.map +1 -0
  10. package/dist/assets/icons/slash-circle.svg.js +10 -0
  11. package/dist/assets/icons/slash-circle.svg.js.map +1 -0
  12. package/dist/components/Base/Base.d.ts +1 -1
  13. package/dist/components/Base/Base.js +12 -13
  14. package/dist/components/Base/Base.js.map +1 -1
  15. package/dist/components/Common/Fields/FileInputField/FileInputField.d.ts +5 -0
  16. package/dist/components/Common/Fields/FileInputField/FileInputField.js +34 -0
  17. package/dist/components/Common/Fields/FileInputField/FileInputField.js.map +1 -0
  18. package/dist/components/Common/Fields/FileInputField/index.d.ts +2 -0
  19. package/dist/components/Common/PaginationControl/PaginationControl.js +41 -40
  20. package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
  21. package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -0
  22. package/dist/components/Common/SignatureForm/SignatureForm.js +2 -3
  23. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  24. package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -4
  25. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  26. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -7
  27. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  28. package/dist/components/Common/UI/Alert/Alert.js +10 -10
  29. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  30. package/dist/components/Common/UI/Alert/Alert.module.scss.js +14 -14
  31. package/dist/components/Common/UI/Badge/Badge.module.scss.js +1 -1
  32. package/dist/components/Common/UI/Banner/Banner.module.scss.js +4 -4
  33. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +6 -6
  34. package/dist/components/Common/UI/FileInput/FileInput.d.ts +2 -0
  35. package/dist/components/Common/UI/FileInput/FileInput.js +150 -0
  36. package/dist/components/Common/UI/FileInput/FileInput.js.map +1 -0
  37. package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +36 -0
  38. package/dist/components/Common/UI/FileInput/FileInput.module.scss.js.map +1 -0
  39. package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +45 -0
  40. package/dist/components/Common/UI/FileInput/FileInputTypes.js +8 -0
  41. package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -0
  42. package/dist/components/Common/UI/FileInput/index.d.ts +4 -0
  43. package/dist/components/Common/UI/Input/Input.module.scss.js +7 -7
  44. package/dist/components/Common/UI/List/List.module.scss.js +1 -1
  45. package/dist/components/Common/UI/Modal/Modal.js +41 -40
  46. package/dist/components/Common/UI/Modal/Modal.js.map +1 -1
  47. package/dist/components/Common/UI/Modal/Modal.module.scss.js +4 -4
  48. package/dist/components/Common/UI/Select/Select.module.scss.js +6 -6
  49. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +4 -4
  50. package/dist/components/Common/UI/TextInput/TextInput.js +27 -23
  51. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  52. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
  53. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  54. package/dist/components/Company/AssignSignatory/AssignSignatory.js +2 -3
  55. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  56. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -3
  57. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  58. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
  59. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  60. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +5 -6
  61. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  62. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
  63. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  64. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
  65. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  66. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +4 -5
  67. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  68. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
  69. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  70. package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -4
  71. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  72. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
  73. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  74. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
  75. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  76. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +4 -5
  77. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  78. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
  79. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  80. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +2 -3
  81. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  82. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +6 -7
  83. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  84. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
  85. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  86. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
  87. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  88. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +8 -9
  89. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  90. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  91. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  92. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
  93. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  94. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  95. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  96. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  97. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  98. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -3
  99. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  100. package/dist/components/Company/FederalTaxes/Form.js +2 -3
  101. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  102. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -9
  103. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  104. package/dist/components/Company/Industry/Actions.js +7 -8
  105. package/dist/components/Company/Industry/Actions.js.map +1 -1
  106. package/dist/components/Company/Industry/Context.js +8 -7
  107. package/dist/components/Company/Industry/Context.js.map +1 -1
  108. package/dist/components/Company/Industry/Edit.js +2 -3
  109. package/dist/components/Company/Industry/Edit.js.map +1 -1
  110. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
  111. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  112. package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
  113. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  114. package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -3
  115. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  116. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
  117. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  118. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  119. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  120. package/dist/components/Company/Locations/LocationsList/List.js +31 -30
  121. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  122. package/dist/components/Company/Locations/LocationsList/LocationsList.js +29 -29
  123. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  124. package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
  125. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
  126. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  127. package/dist/components/Company/OnboardingOverview/Completed.js +10 -11
  128. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  129. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -7
  130. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  131. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +6 -7
  132. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  133. package/dist/components/Company/OnboardingOverview/context.js +5 -4
  134. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  135. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -3
  136. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  137. package/dist/components/Company/PaySchedule/_parts/Actions.js +2 -3
  138. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  139. package/dist/components/Company/PaySchedule/_parts/Edit.js +9 -10
  140. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  141. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
  142. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  143. package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
  144. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  145. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -6
  146. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  147. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
  148. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  149. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
  150. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  151. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
  152. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  153. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
  154. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  155. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
  156. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  157. package/dist/components/Contractor/Address/Address.js +3 -4
  158. package/dist/components/Contractor/Address/Address.js.map +1 -1
  159. package/dist/components/Contractor/Address/Form.js +6 -7
  160. package/dist/components/Contractor/Address/Form.js.map +1 -1
  161. package/dist/components/Contractor/Address/useAddress.js +7 -6
  162. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  163. package/dist/components/Contractor/ContractorList/index.js +24 -24
  164. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  165. package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
  166. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  167. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +10 -11
  168. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  169. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  170. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  171. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
  172. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  173. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +108 -92
  174. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  175. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +33 -32
  176. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  177. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +25 -7
  178. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  179. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +8 -0
  180. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +58 -0
  181. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -0
  182. package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.d.ts +6 -0
  183. package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js +18 -0
  184. package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js.map +1 -0
  185. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +5 -1
  186. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +84 -52
  187. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  188. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +4 -0
  189. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +32 -13
  190. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  191. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +2 -0
  192. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +100 -53
  193. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  194. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +1 -2
  195. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +46 -21
  196. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
  197. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +6 -15
  198. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +115 -100
  199. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  200. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js +8 -0
  201. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js.map +1 -0
  202. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.d.ts +8 -0
  203. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +51 -0
  204. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -0
  205. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +11 -0
  206. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +155 -0
  207. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -0
  208. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +22 -0
  209. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -0
  210. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +8 -0
  211. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +45 -0
  212. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -0
  213. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +15 -0
  214. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +125 -0
  215. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -0
  216. package/dist/components/Contractor/Payments/PaymentSummary/index.d.ts +3 -0
  217. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +37 -28
  218. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  219. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +5 -1
  220. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +61 -60
  221. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  222. package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
  223. package/dist/components/Contractor/Submit/Submit.js +19 -20
  224. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  225. package/dist/components/Employee/Compensation/Actions.js +12 -13
  226. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  227. package/dist/components/Employee/Compensation/Edit.js +2 -3
  228. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  229. package/dist/components/Employee/Compensation/List.js +22 -23
  230. package/dist/components/Employee/Compensation/List.js.map +1 -1
  231. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +4 -3
  232. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  233. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +4 -3
  234. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  235. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +4 -3
  236. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  237. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +2 -3
  238. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  239. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +2 -3
  240. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  241. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +2 -3
  242. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  243. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +2 -3
  244. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  245. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  246. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  247. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  248. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  249. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
  250. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  251. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  252. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  253. package/dist/components/Employee/EmployeeList/Actions.js +6 -7
  254. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  255. package/dist/components/Employee/EmployeeList/EmployeeList.js +55 -54
  256. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  257. package/dist/components/Employee/EmployeeList/Head.js +5 -6
  258. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  259. package/dist/components/Employee/EmployeeList/List.js +32 -31
  260. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  261. package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +1 -0
  262. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
  263. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  264. package/dist/components/Employee/EmploymentEligibility/EmploymentEligibility.d.ts +3 -0
  265. package/dist/components/Employee/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +37 -0
  266. package/dist/components/Employee/EmploymentEligibility/index.d.ts +4 -0
  267. package/dist/components/Employee/FederalTaxes/Actions.js +5 -6
  268. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  269. package/dist/components/Employee/FederalTaxes/FederalForm.js +4 -5
  270. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  271. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -4
  272. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  273. package/dist/components/Employee/Landing/Landing.js +2 -3
  274. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  275. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  276. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  277. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -3
  278. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  279. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
  280. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  281. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +5 -6
  282. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  283. package/dist/components/Employee/PaymentMethod/Split.js +2 -3
  284. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  285. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -6
  286. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  287. package/dist/components/Employee/Profile/Actions.js +5 -6
  288. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  289. package/dist/components/Employee/Profile/AdminPersonalDetails.js +4 -5
  290. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  291. package/dist/components/Employee/Profile/HomeAddress.js +8 -9
  292. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  293. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +8 -9
  294. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  295. package/dist/components/Employee/Profile/useProfile.js +5 -4
  296. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  297. package/dist/components/Employee/StateTaxes/Actions.js +5 -6
  298. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  299. package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -4
  300. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  301. package/dist/components/Employee/Taxes/Actions.js +6 -7
  302. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  303. package/dist/components/Employee/Taxes/FederalForm.js +6 -7
  304. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  305. package/dist/components/Employee/Taxes/useTaxes.js +5 -4
  306. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  307. package/dist/components/Flow/Flow.js +7 -8
  308. package/dist/components/Flow/Flow.js.map +1 -1
  309. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +15 -0
  310. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +162 -0
  311. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -0
  312. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +20 -0
  313. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js.map +1 -0
  314. package/dist/components/InformationRequests/InformationRequestForm/index.d.ts +2 -0
  315. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +8 -0
  316. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +96 -0
  317. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -0
  318. package/dist/components/InformationRequests/InformationRequestList/index.d.ts +2 -0
  319. package/dist/components/InformationRequests/InformationRequests.d.ts +7 -0
  320. package/dist/components/InformationRequests/InformationRequests.js +68 -0
  321. package/dist/components/InformationRequests/InformationRequests.js.map +1 -0
  322. package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +19 -0
  323. package/dist/components/InformationRequests/InformationRequestsComponents.js +20 -0
  324. package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -0
  325. package/dist/components/InformationRequests/index.d.ts +4 -0
  326. package/dist/components/InformationRequests/index.js +9 -0
  327. package/dist/components/InformationRequests/index.js.map +1 -0
  328. package/dist/components/InformationRequests/informationRequestsStateMachine.d.ts +13 -0
  329. package/dist/components/InformationRequests/informationRequestsStateMachine.js +47 -0
  330. package/dist/components/InformationRequests/informationRequestsStateMachine.js.map +1 -0
  331. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +69 -59
  332. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
  333. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +0 -1
  334. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  335. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +61 -52
  336. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
  337. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +17 -18
  338. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  339. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.d.ts +5 -13
  340. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +102 -27
  341. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  342. package/dist/components/Payroll/PayrollBlocker/index.d.ts +0 -1
  343. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +14 -14
  344. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  345. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +116 -130
  346. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  347. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +6 -3
  348. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +165 -156
  349. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  350. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +2 -4
  351. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
  352. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +21 -0
  353. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +105 -0
  354. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -0
  355. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +41 -37
  356. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  357. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -4
  358. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +151 -146
  359. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  360. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +6 -6
  361. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  362. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
  363. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +45 -38
  364. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  365. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  366. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +179 -97
  367. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  368. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +28 -28
  369. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  370. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +2 -2
  371. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +86 -106
  372. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  373. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +2 -1
  374. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +28 -22
  375. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  376. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +4 -0
  377. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +74 -47
  378. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  379. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +2 -0
  380. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +159 -57
  381. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
  382. package/dist/components/Payroll/PayrollList/PayrollList.js +14 -17
  383. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  384. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -2
  385. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +137 -132
  386. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  387. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -4
  388. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  389. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +102 -96
  390. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  391. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +7 -5
  392. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +253 -250
  393. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  394. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.d.ts +6 -0
  395. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js +5 -0
  396. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js.map +1 -0
  397. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -2
  398. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
  399. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  400. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +2 -2
  401. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -1
  402. package/dist/components/Payroll/RecoveryCases/RecoveryCaseErrorCode.module.scss.js +8 -0
  403. package/dist/components/Payroll/RecoveryCases/RecoveryCaseErrorCode.module.scss.js.map +1 -0
  404. package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +6 -0
  405. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +55 -0
  406. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -0
  407. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +19 -0
  408. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js +19 -0
  409. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js.map +1 -0
  410. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +7 -0
  411. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +104 -0
  412. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -0
  413. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js +8 -0
  414. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js.map +1 -0
  415. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/index.d.ts +2 -0
  416. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +14 -0
  417. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +69 -0
  418. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -0
  419. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/index.d.ts +2 -0
  420. package/dist/components/Payroll/RecoveryCases/index.d.ts +3 -0
  421. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +13 -0
  422. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +47 -0
  423. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -0
  424. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.d.ts +7 -0
  425. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +65 -0
  426. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -0
  427. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +1 -1
  428. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +1 -1
  429. package/dist/components/Payroll/helpers.d.ts +12 -0
  430. package/dist/components/Payroll/helpers.js +129 -117
  431. package/dist/components/Payroll/helpers.js.map +1 -1
  432. package/dist/components/Payroll/index.d.ts +2 -1
  433. package/dist/components/Payroll/index.js +12 -10
  434. package/dist/components/Payroll/index.js.map +1 -1
  435. package/dist/components/Payroll/usePreparedPayrollData.d.ts +5 -2
  436. package/dist/components/Payroll/usePreparedPayrollData.js +44 -32
  437. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  438. package/dist/components/index.d.ts +1 -0
  439. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +27 -25
  440. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  441. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  442. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
  443. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +17 -15
  444. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  445. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  446. package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
  447. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  448. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +1 -1
  449. package/dist/contexts/ThemeProvider/theme.js +5 -5
  450. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  451. package/dist/helpers/dateFormatting.d.ts +1 -0
  452. package/dist/helpers/dateFormatting.js +1 -0
  453. package/dist/helpers/dateFormatting.js.map +1 -1
  454. package/dist/helpers/formattedStrings.d.ts +1 -0
  455. package/dist/helpers/formattedStrings.js +27 -21
  456. package/dist/helpers/formattedStrings.js.map +1 -1
  457. package/dist/helpers/responsive.js +1 -1
  458. package/dist/helpers/responsive.js.map +1 -1
  459. package/dist/i18n/I18n.js +9 -9
  460. package/dist/i18n/I18n.js.map +1 -1
  461. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +44 -36
  462. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
  463. package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +11 -11
  464. package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +28 -0
  465. package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js.map +1 -0
  466. package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js +58 -0
  467. package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js.map +1 -0
  468. package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +14 -14
  469. package/dist/i18n/en/Employee.EmploymentEligibility.json.js +28 -0
  470. package/dist/i18n/en/Employee.EmploymentEligibility.json.js.map +1 -0
  471. package/dist/i18n/en/InformationRequests.InformationRequestForm.json.js +20 -0
  472. package/dist/i18n/en/InformationRequests.InformationRequestForm.json.js.map +1 -0
  473. package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +18 -0
  474. package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -0
  475. package/dist/i18n/en/Payroll.ConfirmWireDetailsBanner.json.js +1 -1
  476. package/dist/i18n/en/Payroll.PayrollBlocker.json.js +24 -20
  477. package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
  478. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +27 -21
  479. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
  480. package/dist/i18n/en/Payroll.PayrollHistory.json.js +6 -6
  481. package/dist/i18n/en/Payroll.PayrollLanding.json.js +7 -3
  482. package/dist/i18n/en/Payroll.PayrollLanding.json.js.map +1 -1
  483. package/dist/i18n/en/Payroll.PayrollOverview.json.js +32 -28
  484. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  485. package/dist/i18n/en/Payroll.RecoveryCasesList.json.js +18 -0
  486. package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -0
  487. package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js +10 -0
  488. package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js.map +1 -0
  489. package/dist/i18n/en/Payroll.WireInstructions.json.js +20 -16
  490. package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -1
  491. package/dist/i18n/en/common.json.d.ts +5 -0
  492. package/dist/i18n/en/common.json.js +4 -2
  493. package/dist/i18n/en/common.json.js.map +1 -1
  494. package/dist/index.js +10 -8
  495. package/dist/index.js.map +1 -1
  496. package/dist/shared/constants.d.ts +30 -0
  497. package/dist/shared/constants.js +73 -54
  498. package/dist/shared/constants.js.map +1 -1
  499. package/dist/style.css +1 -1
  500. package/dist/types/i18next.d.ts +321 -3
  501. package/package.json +32 -21
  502. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.d.ts +0 -6
  503. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js +0 -32
  504. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js.map +0 -1
@@ -1,96 +1,106 @@
1
- import { jsx as r, jsxs as h } from "react/jsx-runtime";
2
- import { useTranslation as T } from "react-i18next";
3
- import { useWireInRequestsListSuspense as v } from "@gusto/embedded-api/react-query/wireInRequestsList";
4
- import { usePayrollsListSuspense as M } from "@gusto/embedded-api/react-query/payrollsList";
5
- import { useState as F, useEffect as Z } from "react";
6
- import { BaseComponent as _ } from "../../../Base/Base.js";
1
+ import { jsx as n, jsxs as h } from "react/jsx-runtime";
2
+ import { useTranslation as v } from "react-i18next";
3
+ import { useWireInRequestsListSuspense as M } from "@gusto/embedded-api/react-query/wireInRequestsList";
4
+ import { usePayrollsListSuspense as N } from "@gusto/embedded-api/react-query/payrollsList";
5
+ import { useState as Z, useEffect as _ } from "react";
6
+ import { BaseComponent as j } from "../../../Base/Base.js";
7
7
  import "../../../Base/useBase.js";
8
- import { useComponentContext as j } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
9
- import { useComponentDictionary as k, useI18n as E } from "../../../../i18n/I18n.js";
8
+ import { useComponentContext as k } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
9
+ import { useComponentDictionary as E, useI18n as G } from "../../../../i18n/I18n.js";
10
10
  import { Flex as g } from "../../../Common/Flex/Flex.js";
11
- import { useDateFormatter as N } from "../../../../hooks/useDateFormatter.js";
12
- function te(i) {
13
- return /* @__PURE__ */ r(_, { ...i, children: /* @__PURE__ */ r(z, { ...i, children: i.children }) });
11
+ import { useDateFormatter as z } from "../../../../hooks/useDateFormatter.js";
12
+ import H from "../../../../hooks/useNumberFormatter.js";
13
+ function ie(i) {
14
+ return /* @__PURE__ */ n(j, { ...i, children: /* @__PURE__ */ n(J, { ...i, children: i.children }) });
14
15
  }
15
- const z = ({
16
+ const J = ({
16
17
  wireInId: i,
17
18
  companyId: u,
18
- dictionary: y,
19
- confirmationAlert: o,
20
- onStartWireTransfer: D
19
+ dictionary: D,
20
+ confirmationAlert: l,
21
+ onStartWireTransfer: C
21
22
  }) => {
22
- k("Payroll.ConfirmWireDetailsBanner", y), E("Payroll.ConfirmWireDetailsBanner");
23
- const { t: s } = T("Payroll.ConfirmWireDetailsBanner"), { Alert: R, Banner: w, Button: C, UnorderedList: P, Text: S } = j(), L = N(), [W, c] = F(!1);
24
- Z(() => {
25
- o && c(!1);
26
- }, [o]);
27
- const { data: x } = v({
23
+ E("Payroll.ConfirmWireDetailsBanner", D), G("Payroll.ConfirmWireDetailsBanner");
24
+ const { t: s } = v("Payroll.ConfirmWireDetailsBanner"), { Alert: P, Banner: L, Button: R, UnorderedList: b, Text: c } = k(), q = z(), [w, d] = Z(!1), S = H("currency");
25
+ _(() => {
26
+ l && d(!1);
27
+ }, [l]);
28
+ const { data: B } = M({
28
29
  companyUuid: u
29
- }), { data: B } = M({
30
+ }), { data: W } = N({
30
31
  companyId: u,
31
32
  processed: !0
32
- }), d = (x.wireInRequestList || []).filter(
33
- (t) => t.status === "awaiting_funds"
34
- ), q = i ? d.filter((t) => t.uuid === i) : d, I = B.payrollList || [], n = q.map((t) => {
35
- const e = I.find((a) => a.payrollUuid === t.paymentUuid), l = e?.payPeriod ? L.formatPayPeriodRange(e.payPeriod.startDate, e.payPeriod.endDate) : "";
33
+ }), p = (B.wireInRequestList || []).filter(
34
+ (e) => e.status === "awaiting_funds"
35
+ ), x = i ? p.filter((e) => e.uuid === i) : p, A = W.payrollList || [], r = x.map((e) => {
36
+ const t = A.find((o) => o.payrollUuid === e.paymentUuid), a = t?.payPeriod ? q.formatPayPeriodRange(t.payPeriod.startDate, t.payPeriod.endDate) : "";
36
37
  return {
37
- wireInRequest: t,
38
- payroll: e,
39
- payrollRange: l
38
+ wireInRequest: e,
39
+ payroll: t,
40
+ payrollRange: a,
41
+ paymentType: e.paymentType,
42
+ requestedAmount: e.requestedAmount ?? ""
40
43
  };
41
- }), f = n.length > 0 && (n.length > 1 || n[0]?.wireInRequest), p = !W && o;
42
- if (!f && !p)
44
+ }), f = r.length > 0 && (r.length > 1 || r[0]?.wireInRequest), y = !w && l;
45
+ if (!f && !y)
43
46
  return null;
44
- const U = (t) => {
45
- const e = new Date(t), a = e.toLocaleTimeString("en-US", {
47
+ const T = (e) => {
48
+ const t = new Date(e), o = t.toLocaleTimeString("en-US", {
46
49
  hour: "numeric",
47
- minute: e.getMinutes() === 0 ? void 0 : "2-digit",
50
+ minute: t.getMinutes() === 0 ? void 0 : "2-digit",
48
51
  hour12: !0,
49
52
  timeZone: "America/Los_Angeles",
50
53
  timeZoneName: "short"
51
- }).replace(/\s?(AM|PM)/i, (A) => A.trim().toLowerCase()), m = e.toLocaleDateString("en-US", {
54
+ }).replace(/\s?(AM|PM)/i, (F) => F.trim().toLowerCase()), m = t.toLocaleDateString("en-US", {
52
55
  month: "long",
53
56
  day: "numeric",
54
57
  year: "numeric",
55
58
  timeZone: "America/Los_Angeles"
56
59
  });
57
- return { time: a, date: m };
58
- }, b = () => {
59
- const t = n.length === 1, { wireInRequest: e, payrollRange: l } = n[0] || {};
60
- if (t) {
61
- if (i && e?.wireInDeadline) {
62
- const { time: a, date: m } = U(e.wireInDeadline);
63
- return s("banner.title", { time: a, date: m });
60
+ return { time: o, date: m };
61
+ }, I = () => {
62
+ const e = r.length === 1, { wireInRequest: t, payrollRange: a } = r[0] || {};
63
+ if (e) {
64
+ if (i && t?.wireInDeadline) {
65
+ const { time: o, date: m } = T(t.wireInDeadline);
66
+ return s("banner.title", { time: o, date: m });
64
67
  }
65
- return s("banner.titleWithPayroll", { payrollRange: l });
68
+ return s("banner.titleWithPayroll", { payrollRange: a });
66
69
  }
67
- return s("banner.titleMultiple", { count: n.length });
70
+ return s("banner.titleMultiple", { count: r.length });
71
+ }, U = () => {
72
+ if (r.length > 1)
73
+ return /* @__PURE__ */ n(
74
+ b,
75
+ {
76
+ items: r.map(
77
+ ({ paymentType: e, payrollRange: t, requestedAmount: a }, o) => e === "Payroll" ? /* @__PURE__ */ n(c, { children: s("banner.requestLabelPayroll", { payrollRange: t }) }, o) : /* @__PURE__ */ n(c, { children: s("banner.requestLabelContractorPaymentGroup", {
78
+ requestedAmount: S(Number(a))
79
+ }) }, o)
80
+ )
81
+ }
82
+ );
68
83
  };
69
84
  return /* @__PURE__ */ h(g, { flexDirection: "column", gap: 16, children: [
70
- p && /* @__PURE__ */ r(
71
- R,
85
+ y && /* @__PURE__ */ n(
86
+ P,
72
87
  {
73
88
  status: "success",
74
- label: o.title,
89
+ label: l.title,
75
90
  onDismiss: () => {
76
- c(!0);
91
+ d(!0);
77
92
  },
78
- children: o.content
93
+ children: l.content
79
94
  }
80
95
  ),
81
- f && /* @__PURE__ */ r(w, { status: "warning", title: b(), children: /* @__PURE__ */ h(g, { flexDirection: "column", gap: 16, alignItems: "flex-start", children: [
82
- /* @__PURE__ */ r("div", { children: s("banner.description") }),
83
- n.length > 1 && /* @__PURE__ */ r(
84
- P,
85
- {
86
- items: n.map(({ payrollRange: t }, e) => /* @__PURE__ */ r(S, { children: t }, e))
87
- }
88
- ),
89
- /* @__PURE__ */ r(C, { variant: "secondary", onClick: D, children: s("cta.startWireTransfer") })
96
+ f && /* @__PURE__ */ n(L, { status: "warning", title: I(), children: /* @__PURE__ */ h(g, { flexDirection: "column", gap: 16, alignItems: "flex-start", children: [
97
+ /* @__PURE__ */ n("div", { children: s("banner.description") }),
98
+ U(),
99
+ /* @__PURE__ */ n(R, { variant: "secondary", onClick: C, children: s("cta.startWireTransfer") })
90
100
  ] }) })
91
101
  ] });
92
102
  };
93
103
  export {
94
- te as ConfirmWireDetailsBanner
104
+ ie as ConfirmWireDetailsBanner
95
105
  };
96
106
  //# sourceMappingURL=ConfirmWireDetailsBanner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmWireDetailsBanner.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport { useState, useEffect } from 'react'\nimport type { ConfirmationAlert } from '../types'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ConfirmWireDetailsBannerProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsBanner'> {\n wireInId?: string\n companyId: string\n confirmationAlert?: ConfirmationAlert\n onStartWireTransfer: () => void\n}\n\nexport function ConfirmWireDetailsBanner(props: ConfirmWireDetailsBannerProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n confirmationAlert,\n onStartWireTransfer,\n}: ConfirmWireDetailsBannerProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsBanner', dictionary)\n useI18n('Payroll.ConfirmWireDetailsBanner')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsBanner')\n const { Alert, Banner, Button, UnorderedList, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const [isConfirmationAlertDismissed, setIsConfirmationAlertDismissed] = useState<boolean>(false)\n\n useEffect(() => {\n if (confirmationAlert) {\n setIsConfirmationAlertDismissed(false)\n }\n }, [confirmationAlert])\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n request => request.status === 'awaiting_funds',\n )\n const wireInRequests = wireInId\n ? activeWireInRequests.filter(request => request.uuid === wireInId)\n : activeWireInRequests\n\n const payrolls = payrollsData.payrollList || []\n\n const wireInRequestsWithPayrolls = wireInRequests.map(wireInRequest => {\n const payroll = payrolls.find(p => p.payrollUuid === wireInRequest.paymentUuid)\n const payrollRange = payroll?.payPeriod\n ? dateFormatter.formatPayPeriodRange(payroll.payPeriod.startDate, payroll.payPeriod.endDate)\n : ''\n return {\n wireInRequest,\n payroll,\n payrollRange,\n }\n })\n\n const shouldShowBanner =\n wireInRequestsWithPayrolls.length > 0 &&\n (wireInRequestsWithPayrolls.length > 1 || wireInRequestsWithPayrolls[0]?.wireInRequest)\n\n const shouldShowConfirmationAlert = !isConfirmationAlertDismissed && confirmationAlert\n\n if (!shouldShowBanner && !shouldShowConfirmationAlert) {\n return null\n }\n\n const formatDeadline = (deadline: string) => {\n const date = new Date(deadline)\n\n const timeRaw = date.toLocaleTimeString('en-US', {\n hour: 'numeric',\n minute: date.getMinutes() === 0 ? undefined : '2-digit',\n hour12: true,\n timeZone: 'America/Los_Angeles',\n timeZoneName: 'short',\n })\n\n const time = timeRaw.replace(/\\s?(AM|PM)/i, match => match.trim().toLowerCase())\n\n const dateString = date.toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n timeZone: 'America/Los_Angeles',\n })\n\n return { time, date: dateString }\n }\n\n const getBannerTitle = () => {\n const isSingleWireInRequest = wireInRequestsWithPayrolls.length === 1\n const { wireInRequest, payrollRange } = wireInRequestsWithPayrolls[0] || {}\n\n if (isSingleWireInRequest) {\n if (wireInId && wireInRequest?.wireInDeadline) {\n const { time, date } = formatDeadline(wireInRequest.wireInDeadline)\n return t('banner.title', { time, date })\n }\n return t('banner.titleWithPayroll', { payrollRange })\n }\n return t('banner.titleMultiple', { count: wireInRequestsWithPayrolls.length })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {shouldShowConfirmationAlert && (\n <Alert\n status=\"success\"\n label={confirmationAlert.title}\n onDismiss={() => {\n setIsConfirmationAlertDismissed(true)\n }}\n >\n {confirmationAlert.content}\n </Alert>\n )}\n {shouldShowBanner && (\n <Banner status=\"warning\" title={getBannerTitle()}>\n <Flex flexDirection=\"column\" gap={16} alignItems=\"flex-start\">\n <div>{t('banner.description')}</div>\n {wireInRequestsWithPayrolls.length > 1 && (\n <UnorderedList\n items={wireInRequestsWithPayrolls.map(({ payrollRange }, index) => (\n <Text key={index}>{payrollRange}</Text>\n ))}\n />\n )}\n <Button variant=\"secondary\" onClick={onStartWireTransfer}>\n {t('cta.startWireTransfer')}\n </Button>\n </Flex>\n </Banner>\n )}\n </Flex>\n )\n}\n"],"names":["ConfirmWireDetailsBanner","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","confirmationAlert","onStartWireTransfer","useComponentDictionary","useI18n","t","useTranslation","Alert","Banner","Button","UnorderedList","Text","useComponentContext","dateFormatter","useDateFormatter","isConfirmationAlertDismissed","setIsConfirmationAlertDismissed","useState","useEffect","wireInRequestsData","useWireInRequestsListSuspense","payrollsData","usePayrollsListSuspense","activeWireInRequests","request","wireInRequests","payrolls","wireInRequestsWithPayrolls","wireInRequest","payroll","p","payrollRange","shouldShowBanner","shouldShowConfirmationAlert","formatDeadline","deadline","date","time","match","dateString","getBannerTitle","isSingleWireInRequest","jsxs","Flex","index"],"mappings":";;;;;;;;;;;AAkBO,SAASA,GAAyBC,GAAsC;AAC7E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMG,IAAO,CAAC;AAAA,EACZ,UAAAC;AAAA,E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AAAf,EAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,IAGtB+B,KACC,gBAAArC,EAACa,GAAA,EAAO,QAAO,WAAU,OAAOgC,EAAA,GAC9B,UAAA,gBAAAE,EAACC,KAAK,eAAc,UAAS,KAAK,IAAI,YAAW,cAC/C,UAAA;AAAA,MAAA,gBAAAhD,EAAC,OAAA,EAAK,UAAAU,EAAE,oBAAoB,EAAA,CAAE;AAAA,MAC7BsB,EAA2B,SAAS,KACnC,gBAAAhC;AAAA,QAACe;AAAA,QAAA;AAAA,UACC,OAAOiB,EAA2B,IAAI,CAAC,EAAE,cAAAI,EAAA,GAAgBa,MACvD,gBAAAjD,EAACgB,GAAA,EAAkB,UAAAoB,EAAA,GAARa,CAAqB,CACjC;AAAA,QAAA;AAAA,MAAA;AAAA,MAGL,gBAAAjD,EAACc,KAAO,SAAQ,aAAY,SAASP,GAClC,UAAAG,EAAE,uBAAuB,EAAA,CAC5B;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"ConfirmWireDetailsBanner.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport { useState, useEffect } from 'react'\nimport type { ConfirmationAlert } from '../types'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\n\ninterface ConfirmWireDetailsBannerProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsBanner'> {\n wireInId?: string\n companyId: string\n confirmationAlert?: ConfirmationAlert\n onStartWireTransfer: () => void\n}\n\nexport function ConfirmWireDetailsBanner(props: ConfirmWireDetailsBannerProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n confirmationAlert,\n onStartWireTransfer,\n}: ConfirmWireDetailsBannerProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsBanner', dictionary)\n useI18n('Payroll.ConfirmWireDetailsBanner')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsBanner')\n const { Alert, Banner, Button, UnorderedList, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const [isConfirmationAlertDismissed, setIsConfirmationAlertDismissed] = useState<boolean>(false)\n const currencyFormatter = useNumberFormatter('currency')\n\n useEffect(() => {\n if (confirmationAlert) {\n setIsConfirmationAlertDismissed(false)\n }\n }, [confirmationAlert])\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n request => request.status === 'awaiting_funds',\n )\n const wireInRequests = wireInId\n ? activeWireInRequests.filter(request => request.uuid === wireInId)\n : activeWireInRequests\n\n const payrolls = payrollsData.payrollList || []\n\n const wireInRequestsWithPayrolls = wireInRequests.map(wireInRequest => {\n const payroll = payrolls.find(p => p.payrollUuid === wireInRequest.paymentUuid)\n const payrollRange = payroll?.payPeriod\n ? dateFormatter.formatPayPeriodRange(payroll.payPeriod.startDate, payroll.payPeriod.endDate)\n : ''\n return {\n wireInRequest,\n payroll,\n payrollRange,\n paymentType: wireInRequest.paymentType,\n requestedAmount: wireInRequest.requestedAmount ?? '',\n }\n })\n\n const shouldShowBanner =\n wireInRequestsWithPayrolls.length > 0 &&\n (wireInRequestsWithPayrolls.length > 1 || wireInRequestsWithPayrolls[0]?.wireInRequest)\n\n const shouldShowConfirmationAlert = !isConfirmationAlertDismissed && confirmationAlert\n\n if (!shouldShowBanner && !shouldShowConfirmationAlert) {\n return null\n }\n\n const formatDeadline = (deadline: string) => {\n const date = new Date(deadline)\n\n const timeRaw = date.toLocaleTimeString('en-US', {\n hour: 'numeric',\n minute: date.getMinutes() === 0 ? undefined : '2-digit',\n hour12: true,\n timeZone: 'America/Los_Angeles',\n timeZoneName: 'short',\n })\n\n const time = timeRaw.replace(/\\s?(AM|PM)/i, match => match.trim().toLowerCase())\n\n const dateString = date.toLocaleDateString('en-US', {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n timeZone: 'America/Los_Angeles',\n })\n\n return { time, date: dateString }\n }\n\n const getBannerTitle = () => {\n const isSingleWireInRequest = wireInRequestsWithPayrolls.length === 1\n const { wireInRequest, payrollRange } = wireInRequestsWithPayrolls[0] || {}\n\n if (isSingleWireInRequest) {\n if (wireInId && wireInRequest?.wireInDeadline) {\n const { time, date } = formatDeadline(wireInRequest.wireInDeadline)\n return t('banner.title', { time, date })\n }\n return t('banner.titleWithPayroll', { payrollRange })\n }\n return t('banner.titleMultiple', { count: wireInRequestsWithPayrolls.length })\n }\n\n const getBannerContent = () => {\n if (wireInRequestsWithPayrolls.length > 1) {\n return (\n <UnorderedList\n items={wireInRequestsWithPayrolls.map(\n ({ paymentType, payrollRange, requestedAmount }, index) =>\n paymentType === 'Payroll' ? (\n <Text key={index}>{t('banner.requestLabelPayroll', { payrollRange })}</Text>\n ) : (\n <Text key={index}>\n {t('banner.requestLabelContractorPaymentGroup', {\n requestedAmount: currencyFormatter(Number(requestedAmount)),\n })}\n </Text>\n ),\n )}\n />\n )\n }\n }\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {shouldShowConfirmationAlert && (\n <Alert\n status=\"success\"\n label={confirmationAlert.title}\n onDismiss={() => {\n setIsConfirmationAlertDismissed(true)\n }}\n >\n {confirmationAlert.content}\n </Alert>\n )}\n {shouldShowBanner && (\n <Banner status=\"warning\" title={getBannerTitle()}>\n <Flex flexDirection=\"column\" gap={16} alignItems=\"flex-start\">\n <div>{t('banner.description')}</div>\n {getBannerContent()}\n <Button variant=\"secondary\" onClick={onStartWireTransfer}>\n {t('cta.startWireTransfer')}\n </Button>\n </Flex>\n </Banner>\n )}\n </Flex>\n )\n}\n"],"names":["ConfirmWireDetailsBanner","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","confirmationAlert","onStartWireTransfer","useComponentDictionary","useI18n","t","useTranslation","Alert","Banner","Button","UnorderedList","Text","useComponentContext","dateFormatter","useDateFormatter","isConfirmationAlertDismissed","setIsConfirmationAlertDismissed","useState","currencyFormatter","useNumberFormatter","useEffect","wireInRequestsData","useWireInRequestsListSuspense","payrollsData","usePayrollsListSuspense","activeWireInRequests","request","wireInRequests","payrolls","wireInRequestsWithPayrolls","wireInRequest","payroll","p","payrollRange","shouldShowBanner","shouldShowConfirmationAlert","formatDeadline","deadline","date","time","match","dateString","getBannerTitle","isSingleWireInRequest","getBannerContent","paymentType","requestedAmount","index","jsxs","Flex"],"mappings":";;;;;;;;;;;;AAmBO,SAASA,GAAyBC,GAAsC;AAC7E,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEA,MAAMG,IAAO,CAAC;AAAA,EACZ,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,qBAAAC;AACF,MAAqC;AACnC,EAAAC,EAAuB,oCAAoCH,CAAU,GACrEI,EAAQ,kCAAkC;AAC1C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kCAAkC,GACzD,EAAE,OAAAC,GAAO,QAAAC,GAAQ,QAAAC,GAAQ,eAAAC,GAAe,MAAAC,EAAA,IAASC,EAAA,GACjDC,IAAgBC,EAAA,GAChB,CAACC,G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A;AAAA,EAIR;AAEA,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAd,KACC,gBAAAxC;AAAA,MAACY;AAAA,MAAA;AAAA,QACC,QAAO;AAAA,QACP,OAAON,EAAkB;AAAA,QACzB,WAAW,MAAM;AACf,UAAAe,EAAgC,EAAI;AAAA,QACtC;AAAA,QAEC,UAAAf,EAAkB;AAAA,MAAA;AAAA,IAAA;AAAA,IAGtBiC,KACC,gBAAAvC,EAACa,GAAA,EAAO,QAAO,WAAU,OAAOkC,EAAA,GAC9B,UAAA,gBAAAM,EAACC,KAAK,eAAc,UAAS,KAAK,IAAI,YAAW,cAC/C,UAAA;AAAA,MAAA,gBAAAtD,EAAC,OAAA,EAAK,UAAAU,EAAE,oBAAoB,EAAA,CAAE;AAAA,MAC7BuC,EAAA;AAAA,MACD,gBAAAjD,EAACc,KAAO,SAAQ,aAAY,SAASP,GAClC,UAAAG,EAAE,uBAAuB,EAAA,CAC5B;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -15,7 +15,6 @@ import { useComponentContext as S } from "../../../../contexts/ComponentAdapter/
15
15
  import { useComponentDictionary as z, useI18n as g } from "../../../../i18n/I18n.js";
16
16
  import { Flex as p, FlexItem as f } from "../../../Common/Flex/Flex.js";
17
17
  import { payrollWireEvents as N } from "../../../../shared/constants.js";
18
- import "classnames";
19
18
  import "react";
20
19
  import { TextAreaField as V } from "../../../Common/Fields/TextAreaField/TextAreaField.js";
21
20
  import { useDateFormatter as J } from "../../../../hooks/useDateFormatter.js";
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmWireDetailsForm.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport z from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useWireInRequestsSubmitMutation,\n mutationKeyWireInRequestsSubmit,\n} from '@gusto/embedded-api/react-query/wireInRequestsSubmit'\nimport { useWireInRequestsGetSuspense } from '@gusto/embedded-api/react-query/wireInRequestsGet'\nimport type { PutWireInRequestsWireInRequestUuidRequest } from '@gusto/embedded-api/models/operations/putwireinrequestswireinrequestuuid'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport styles from './ConfirmWireDetailsForm.module.scss'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { DatePickerField, NumberInputField, TextInputField } from '@/components/Common'\nimport { TextAreaField } from '@/components/Common/Fields/TextAreaField'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ConfirmWireDetailsFormProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsForm'> {\n wireInId: string\n companyId: string\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\nexport const ConfirmWireDetailsFormSchema = z.object({\n amountSent: z.number().positive(),\n dateSent: z.date(),\n bankName: z.string().nonempty(),\n additionalNotes: z.string().optional(),\n})\n\nexport type ConfirmWireDetailsFormValues = z.infer<typeof ConfirmWireDetailsFormSchema>\n\nconst CONFIRM_WIRE_FORM_ID = 'confirm-wire-details-form'\n\nconst transformFormDataToPayload = (\n data: ConfirmWireDetailsFormValues,\n): PutWireInRequestsWireInRequestUuidRequest['requestBody'] => {\n return {\n amountSent: String(data.amountSent),\n dateSent: data.dateSent.toISOString().split('T')[0] || '',\n bankName: data.bankName,\n additionalNotes: data.additionalNotes || undefined,\n }\n}\n\nexport function ConfirmWireDetailsForm(props: ConfirmWireDetailsFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n modalContainerRef,\n}: ConfirmWireDetailsFormProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsForm', dictionary)\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Heading, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const { data } = useWireInRequestsGetSuspense({\n wireInRequestUuid: wireInId,\n })\n const wireInRequest = data.wireInRequest\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const payrollData = payrollsData.payrollList?.find(\n payroll => payroll.payrollUuid === wireInRequest?.paymentUuid,\n )\n const payPeriod = payrollData?.payPeriod\n const payPeriodRange =\n payPeriod?.startDate && payPeriod.endDate\n ? dateFormatter.formatPayPeriodRange(payPeriod.startDate, payPeriod.endDate)\n : undefined\n\n const checkDate = payrollData\n ? dateFormatter.formatShortWithYear(payrollData.checkDate)\n : undefined\n\n const formHandlers = useForm<ConfirmWireDetailsFormValues>({\n resolver: zodResolver(ConfirmWireDetailsFormSchema),\n defaultValues: {\n bankName: '',\n },\n })\n\n const { mutateAsync: submitWireInRequest } = useWireInRequestsSubmitMutation()\n\n const onSubmit = async (data: ConfirmWireDetailsFormValues) => {\n await baseSubmitHandler(data, async innerData => {\n const payload = transformFormDataToPayload(innerData)\n const response = await submitWireInRequest({\n request: {\n wireInRequestUuid: wireInId,\n requestBody: payload,\n },\n })\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_DONE, {\n wireInRequest: response.wireInRequest,\n confirmationAlert: {\n title: payPeriodRange\n ? t('confirmationAlert.title', { payrollRange: payPeriodRange })\n : t('confirmationAlert.emptyTitle'),\n content: checkDate ? (\n <Text>{t('confirmationAlert.content', { checkDate })}</Text>\n ) : undefined,\n },\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <FlexItem>\n <Heading as=\"h2\">\n <Trans i18nKey=\"title\" t={t} values={{ payrollRange: payPeriodRange }} />\n </Heading>\n <Text>{t('description')}</Text>\n </FlexItem>\n\n <FormProvider {...formHandlers}>\n <HtmlForm\n id={CONFIRM_WIRE_FORM_ID}\n onSubmit={formHandlers.handleSubmit(onSubmit)}\n className={styles.form}\n >\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"amountSent\"\n label={t('amountLabel')}\n isRequired\n format=\"currency\"\n errorMessage={t('validations.amount')}\n />\n <DatePickerField\n name=\"dateSent\"\n label={t('dateLabel')}\n isRequired\n errorMessage={t('validations.date')}\n portalContainer={modalContainerRef?.current || undefined}\n />\n <TextInputField\n name=\"bankName\"\n label={t('bankNameLabel')}\n isRequired\n description={t('bankNameDescription')}\n placeholder={t('bankNamePlaceholder')}\n errorMessage={t('validations.bankName')}\n />\n <TextAreaField name=\"additionalNotes\" label={t('notesLabel')} rows={3} />\n </Flex>\n </HtmlForm>\n </FormProvider>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Button } = useComponentContext()\n const isMutating = useIsMutating({\n mutationKey: mutationKeyWireInRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n return (\n <Flex gap={12} justifyContent=\"space-evenly\">\n <FlexItem flexGrow={1}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL)\n }}\n isDisabled={isPending}\n className={styles.button}\n >\n {t('cancelCta')}\n </Button>\n </FlexItem>\n <FlexItem flexGrow={1}>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={CONFIRM_WIRE_FORM_ID}\n isLoading={isPending}\n className={styles.button}\n >\n {t('submitCta')}\n </Button>\n </FlexItem>\n </Flex>\n )\n}\nConfirmWireDetailsForm.Footer = Footer\n"],"names":["ConfirmWireDetailsFormSchema","z","CONFIRM_WIRE_FORM_ID","transformFormDataToPayload","data","ConfirmWireDetailsForm","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","modalContainerRef","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","useTranslation","Heading","Text","useComponentContext","dateFormatter","useDateFormatter","useWireInRequestsGetSuspense","wireInRequest","payrollsData","usePayrollsListSuspense","payrollData","payroll","payPeriod","payPeriodRange","checkDate","formHandlers","useForm","zodResolver","submitWireInRequest","useWireInRequestsSubmitMutation","onSubmit","innerData","payload","response","payrollWireEvents","jsxs","Flex","FlexItem","Trans","FormProvider","HtmlForm","styles","NumberInputField","DatePickerField","TextInputField","TextAreaField","Footer","t","Button","isPending","useIsMutating","mutationKeyWireInRequestsSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAMA,IAA+BC,EAAE,OAAO;AAAA,EACnD,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,UAAUA,EAAE,KAAA;AAAA,EACZ,UAAUA,EAAE,OAAA,EAAS,SAAA;AAAA,EACrB,iBAAiBA,EAAE,OAAA,EAAS,SAAA;AAC9B,CAAC,GAIKC,IAAuB,6BAEvBC,KAA6B,CACjCC,OAEO;AAAA,EACL,YAAY,OAAOA,EAAK,UAAU;AAAA,EAClC,UAAUA,EAAK,SAAS,YAAA,EAAc,MAAM,GAAG,EAAE,CAAC,KAAK;AAAA,EACvD,UAAUA,EAAK;AAAA,EACf,iBAAiBA,EAAK,mBAAmB;AAAA;AAItC,SAASC,GAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAE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ACX,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,EAChB,CACF;AAAA,EAAA,GACF;AAEJ;AACA7C,GAAuB,SAASkD;"}
1
+ {"version":3,"file":"ConfirmWireDetailsForm.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.tsx"],"sourcesContent":["import { Trans, useTranslation } from 'react-i18next'\nimport z from 'zod'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport {\n useWireInRequestsSubmitMutation,\n mutationKeyWireInRequestsSubmit,\n} from '@gusto/embedded-api/react-query/wireInRequestsSubmit'\nimport { useWireInRequestsGetSuspense } from '@gusto/embedded-api/react-query/wireInRequestsGet'\nimport type { PutWireInRequestsWireInRequestUuidRequest } from '@gusto/embedded-api/models/operations/putwireinrequestswireinrequestuuid'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport styles from './ConfirmWireDetailsForm.module.scss'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { Flex, FlexItem } from '@/components/Common/Flex/Flex'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { DatePickerField, NumberInputField, TextInputField } from '@/components/Common'\nimport { TextAreaField } from '@/components/Common/Fields/TextAreaField'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\n\ninterface ConfirmWireDetailsFormProps extends BaseComponentInterface<'Payroll.ConfirmWireDetailsForm'> {\n wireInId: string\n companyId: string\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\nexport const ConfirmWireDetailsFormSchema = z.object({\n amountSent: z.number().positive(),\n dateSent: z.date(),\n bankName: z.string().nonempty(),\n additionalNotes: z.string().optional(),\n})\n\nexport type ConfirmWireDetailsFormValues = z.infer<typeof ConfirmWireDetailsFormSchema>\n\nconst CONFIRM_WIRE_FORM_ID = 'confirm-wire-details-form'\n\nconst transformFormDataToPayload = (\n data: ConfirmWireDetailsFormValues,\n): PutWireInRequestsWireInRequestUuidRequest['requestBody'] => {\n return {\n amountSent: String(data.amountSent),\n dateSent: data.dateSent.toISOString().split('T')[0] || '',\n bankName: data.bankName,\n additionalNotes: data.additionalNotes || undefined,\n }\n}\n\nexport function ConfirmWireDetailsForm(props: ConfirmWireDetailsFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst Root = ({\n wireInId,\n companyId,\n dictionary,\n modalContainerRef,\n}: ConfirmWireDetailsFormProps) => {\n useComponentDictionary('Payroll.ConfirmWireDetailsForm', dictionary)\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { onEvent, baseSubmitHandler } = useBase()\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Heading, Text } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const { data } = useWireInRequestsGetSuspense({\n wireInRequestUuid: wireInId,\n })\n const wireInRequest = data.wireInRequest\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const payrollData = payrollsData.payrollList?.find(\n payroll => payroll.payrollUuid === wireInRequest?.paymentUuid,\n )\n const payPeriod = payrollData?.payPeriod\n const payPeriodRange =\n payPeriod?.startDate && payPeriod.endDate\n ? dateFormatter.formatPayPeriodRange(payPeriod.startDate, payPeriod.endDate)\n : undefined\n\n const checkDate = payrollData\n ? dateFormatter.formatShortWithYear(payrollData.checkDate)\n : undefined\n\n const formHandlers = useForm<ConfirmWireDetailsFormValues>({\n resolver: zodResolver(ConfirmWireDetailsFormSchema),\n defaultValues: {\n bankName: '',\n },\n })\n\n const { mutateAsync: submitWireInRequest } = useWireInRequestsSubmitMutation()\n\n const onSubmit = async (data: ConfirmWireDetailsFormValues) => {\n await baseSubmitHandler(data, async innerData => {\n const payload = transformFormDataToPayload(innerData)\n const response = await submitWireInRequest({\n request: {\n wireInRequestUuid: wireInId,\n requestBody: payload,\n },\n })\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_DONE, {\n wireInRequest: response.wireInRequest,\n confirmationAlert: {\n title: payPeriodRange\n ? t('confirmationAlert.title', { payrollRange: payPeriodRange })\n : t('confirmationAlert.emptyTitle'),\n content: checkDate ? (\n <Text>{t('confirmationAlert.content', { checkDate })}</Text>\n ) : undefined,\n },\n })\n })\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <FlexItem>\n <Heading as=\"h2\">\n <Trans i18nKey=\"title\" t={t} values={{ payrollRange: payPeriodRange }} />\n </Heading>\n <Text>{t('description')}</Text>\n </FlexItem>\n\n <FormProvider {...formHandlers}>\n <HtmlForm\n id={CONFIRM_WIRE_FORM_ID}\n onSubmit={formHandlers.handleSubmit(onSubmit)}\n className={styles.form}\n >\n <Flex flexDirection=\"column\" gap={20}>\n <NumberInputField\n name=\"amountSent\"\n label={t('amountLabel')}\n isRequired\n format=\"currency\"\n errorMessage={t('validations.amount')}\n />\n <DatePickerField\n name=\"dateSent\"\n label={t('dateLabel')}\n isRequired\n errorMessage={t('validations.date')}\n portalContainer={modalContainerRef?.current || undefined}\n />\n <TextInputField\n name=\"bankName\"\n label={t('bankNameLabel')}\n isRequired\n description={t('bankNameDescription')}\n placeholder={t('bankNamePlaceholder')}\n errorMessage={t('validations.bankName')}\n />\n <TextAreaField name=\"additionalNotes\" label={t('notesLabel')} rows={3} />\n </Flex>\n </HtmlForm>\n </FormProvider>\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.ConfirmWireDetailsForm')\n const { t } = useTranslation('Payroll.ConfirmWireDetailsForm')\n const { Button } = useComponentContext()\n const isMutating = useIsMutating({\n mutationKey: mutationKeyWireInRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n return (\n <Flex gap={12} justifyContent=\"space-evenly\">\n <FlexItem flexGrow={1}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL)\n }}\n isDisabled={isPending}\n className={styles.button}\n >\n {t('cancelCta')}\n </Button>\n </FlexItem>\n <FlexItem flexGrow={1}>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={CONFIRM_WIRE_FORM_ID}\n isLoading={isPending}\n className={styles.button}\n >\n {t('submitCta')}\n </Button>\n </FlexItem>\n </Flex>\n )\n}\nConfirmWireDetailsForm.Footer = Footer\n"],"names":["ConfirmWireDetailsFormSchema","z","CONFIRM_WIRE_FORM_ID","transformFormDataToPayload","data","ConfirmWireDetailsForm","props","jsx","BaseComponent","Root","wireInId","companyId","dictionary","modalContainerRef","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","useTranslation","Heading","Text","useComponentContext","dateFormatter","useDateFormatter","useWireInRequestsGetSuspense","wireInRequest","payrollsData","usePayrollsListSuspense","payrollData","payroll","payPeriod","payPeriodRange","checkDate","formHandlers","useForm","zodResolver","submitWireInRequest","useWireInRequestsSubmitMutation","onSubmit","innerData","payload","response","payrollWireEvents","jsxs","Flex","FlexItem","Trans","FormProvider","HtmlForm","styles","NumberInputField","DatePickerField","TextInputField","TextAreaField","Footer","t","Button","isPending","useIsMutating","mutationKeyWireInRequestsSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA8BO,MAAMA,IAA+BC,EAAE,OAAO;AAAA,EACnD,YAAYA,EAAE,OAAA,EAAS,SAAA;AAAA,EACvB,UAAUA,EAAE,KAAA;AAAA,EACZ,UAAUA,EAAE,OAAA,EAAS,SAAA;AAAA,EACrB,iBAAiBA,EAAE,OAAA,EAAS,SAAA;AAC9B,CAAC,GAIKC,IAAuB,6BAEvBC,KAA6B,CACjCC,OAEO;AAAA,EAC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SAAS,MAAM;AACb,UAAAzC,EAAQ2B,EAAkB,wBAAwB;AAAA,QACpD;AAAA,QACA,YAAYe;AAAA,QACZ,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,GAElB;AAAA,IACA,gBAAA3C,EAACuC,GAAA,EAAS,UAAU,GAClB,UAAA,gBAAAvC;AAAA,MAACkD;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,MAAMvD;AAAA,QACN,WAAWwD;AAAA,QACX,WAAWR,EAAO;AAAA,QAEjB,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA,EAChB,CACF;AAAA,EAAA,GACF;AAEJ;AACA7C,GAAuB,SAASkD;"}
@@ -1,38 +1,40 @@
1
1
  import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
- import { useMemo as W } from "react";
2
+ import { useMemo as k } from "react";
3
3
  import { useTranslation as v } from "react-i18next";
4
- import { useWireInRequestsListSuspense as T } from "@gusto/embedded-api/react-query/wireInRequestsList";
5
- import { usePayrollsListSuspense as x } from "@gusto/embedded-api/react-query/payrollsList";
4
+ import { useWireInRequestsListSuspense as _ } from "@gusto/embedded-api/react-query/wireInRequestsList";
5
+ import { usePayrollsListSuspense as E } from "@gusto/embedded-api/react-query/payrollsList";
6
6
  import u from "./WireInstructions.module.scss.js";
7
- import { BaseComponent as F } from "../../../Base/Base.js";
7
+ import { BaseComponent as O } from "../../../Base/Base.js";
8
8
  import "../../../Base/useBase.js";
9
9
  import { Flex as p } from "../../../Common/Flex/Flex.js";
10
10
  import { useComponentContext as g } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
11
- import { useComponentDictionary as _, useI18n as A } from "../../../../i18n/I18n.js";
11
+ import { useComponentDictionary as U, useI18n as L } from "../../../../i18n/I18n.js";
12
12
  import { payrollWireEvents as C } from "../../../../shared/constants.js";
13
13
  import { useDateFormatter as w } from "../../../../hooks/useDateFormatter.js";
14
- import E from "../../../../hooks/useNumberFormatter.js";
15
- import { useFlow as O } from "../../../Flow/useFlow.js";
16
- function k(n, a) {
17
- const { data: i } = T({
14
+ import B from "../../../../hooks/useNumberFormatter.js";
15
+ import { useFlow as Y } from "../../../Flow/useFlow.js";
16
+ function q(n, a) {
17
+ const { data: o } = _({
18
18
  companyUuid: n
19
- }), { data: d } = x({
19
+ }), { data: d } = E({
20
20
  companyId: n,
21
21
  processed: !0
22
- }), l = (i.wireInRequestList || []).filter(
23
- (o) => o.status === "awaiting_funds"
24
- ), r = l.find((o) => o.uuid === a), t = d.payrollList || [], f = W(
25
- () => l.map((o) => {
26
- const h = t.find((b) => b.payrollUuid === o.paymentUuid);
22
+ }), l = (o.wireInRequestList || []).filter(
23
+ (i) => i.status === "awaiting_funds"
24
+ ), r = l.find((i) => i.uuid === a), t = d.payrollList || [], f = k(
25
+ () => l.map((i) => {
26
+ const h = t.find((b) => b.payrollUuid === i.paymentUuid);
27
27
  return {
28
- wireInRequest: o,
29
- payroll: h
28
+ wireInRequest: i,
29
+ payroll: h,
30
+ paymentType: i.paymentType,
31
+ requestedAmount: i.requestedAmount ?? ""
30
32
  };
31
33
  }),
32
34
  [l, t]
33
35
  );
34
36
  return {
35
- selectedInstruction: W(() => r ? {
37
+ selectedInstruction: k(() => r ? {
36
38
  id: r.uuid || "",
37
39
  trackingCode: r.uniqueTrackingCode || "",
38
40
  amount: parseFloat(r.requestedAmount || "0"),
@@ -47,55 +49,62 @@ function k(n, a) {
47
49
  };
48
50
  }
49
51
  function c({ label: n, value: a }) {
50
- const { Text: i } = g();
52
+ const { Text: o } = g();
51
53
  return /* @__PURE__ */ m(p, { flexDirection: "column", gap: 8, children: [
52
- /* @__PURE__ */ e(i, { className: u.fieldLabel, children: n }),
53
- /* @__PURE__ */ e(i, { className: u.fieldValue, children: a })
54
+ /* @__PURE__ */ e(o, { className: u.fieldLabel, children: n }),
55
+ /* @__PURE__ */ e(o, { className: u.fieldValue, children: a })
54
56
  ] });
55
57
  }
56
- function U(n) {
57
- return /* @__PURE__ */ e(F, { ...n, children: /* @__PURE__ */ e(B, { ...n, children: n.children }) });
58
+ function j(n) {
59
+ return /* @__PURE__ */ e(O, { ...n, children: /* @__PURE__ */ e(G, { ...n, children: n.children }) });
58
60
  }
59
- const B = ({
61
+ const G = ({
60
62
  companyId: n,
61
63
  wireInId: a,
62
- selectedWireInId: i,
64
+ selectedWireInId: o,
63
65
  dictionary: d,
64
66
  onEvent: l,
65
67
  modalContainerRef: r
66
68
  }) => {
67
- _("Payroll.WireInstructions", d), A("Payroll.WireInstructions");
68
- const { t } = v("Payroll.WireInstructions"), { Select: f, Card: R, Text: o, UnorderedList: h, Heading: b, Alert: L } = g(), P = w(), q = E("currency"), { selectedInstruction: s, activeWireInRequestsWithPayrolls: I } = k(
69
+ U("Payroll.WireInstructions", d), L("Payroll.WireInstructions");
70
+ const { t } = v("Payroll.WireInstructions"), { Select: f, Card: A, Text: i, UnorderedList: h, Heading: b, Alert: S } = g(), D = w(), P = B("currency"), { selectedInstruction: s, activeWireInRequestsWithPayrolls: y } = q(
69
71
  n,
70
- i
71
- ), S = !a && I.length > 1, D = (N) => {
72
+ o
73
+ ), T = !a && y.length > 1, x = (N) => {
72
74
  l(C.PAYROLL_WIRE_INSTRUCTIONS_SELECT, {
73
75
  selectedWireInId: N
74
76
  });
75
77
  };
76
- return I.length === 0 || i && !s ? /* @__PURE__ */ e(p, { flexDirection: "column", gap: 24, children: /* @__PURE__ */ e(o, { children: t("messages.noInstructions") }) }) : /* @__PURE__ */ m(p, { flexDirection: "column", gap: 24, children: [
78
+ return y.length === 0 || o && !s ? /* @__PURE__ */ e(p, { flexDirection: "column", gap: 24, children: /* @__PURE__ */ e(i, { children: t("messages.noInstructions") }) }) : /* @__PURE__ */ m(p, { flexDirection: "column", gap: 24, children: [
77
79
  /* @__PURE__ */ m("div", { children: [
78
80
  /* @__PURE__ */ e(b, { as: "h2", styledAs: "h3", children: t("title") }),
79
- /* @__PURE__ */ e(o, { className: u.subtitle, children: t("subtitle") })
81
+ /* @__PURE__ */ e(i, { className: u.subtitle, children: t("subtitle") })
80
82
  ] }),
81
- S && /* @__PURE__ */ e(
83
+ T && /* @__PURE__ */ e(
82
84
  f,
83
85
  {
84
86
  isRequired: !0,
85
87
  portalContainer: r?.current || void 0,
86
88
  label: t("selectLabel"),
87
- value: i || "",
88
- options: I.map(({ wireInRequest: N, payroll: y }) => ({
89
- label: y?.payPeriod ? P.formatPayPeriodRange(
90
- y.payPeriod.startDate,
91
- y.payPeriod.endDate
92
- ) : t("selectFallback"),
93
- value: N.uuid || ""
94
- })),
95
- onChange: D
89
+ value: o || "",
90
+ options: y.map(
91
+ ({ wireInRequest: N, payroll: I, paymentType: R, requestedAmount: F }) => {
92
+ const W = I?.payPeriod ? D.formatPayPeriodRange(
93
+ I.payPeriod.startDate,
94
+ I.payPeriod.endDate
95
+ ) : "";
96
+ return {
97
+ label: R === "Payroll" ? W ? t("selectLabelPayroll", { payrollRange: W }) : t("selectFallback") : R === "ContractorPaymentGroup" ? t("selectLabelContractorPaymentGroup", {
98
+ requestedAmount: P(Number(F))
99
+ }) : t("selectFallback"),
100
+ value: N.uuid || ""
101
+ };
102
+ }
103
+ ),
104
+ onChange: x
96
105
  }
97
106
  ),
98
- /* @__PURE__ */ e(L, { label: t("requirementsTitle"), disableScrollIntoView: !0, children: /* @__PURE__ */ e(
107
+ /* @__PURE__ */ e(S, { label: t("requirementsTitle"), disableScrollIntoView: !0, children: /* @__PURE__ */ e(
99
108
  h,
100
109
  {
101
110
  className: u.requirementsList,
@@ -107,7 +116,7 @@ const B = ({
107
116
  ]
108
117
  }
109
118
  ) }),
110
- s && /* @__PURE__ */ e(p, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ m(R, { className: u.requirementsCard, children: [
119
+ s && /* @__PURE__ */ e(p, { flexDirection: "column", gap: 16, children: /* @__PURE__ */ m(A, { className: u.requirementsCard, children: [
111
120
  /* @__PURE__ */ e(
112
121
  c,
113
122
  {
@@ -120,7 +129,7 @@ const B = ({
120
129
  c,
121
130
  {
122
131
  label: t("fields.amount"),
123
- value: q(s.amount)
132
+ value: P(s.amount)
124
133
  }
125
134
  ),
126
135
  /* @__PURE__ */ e("hr", {}),
@@ -173,16 +182,16 @@ const B = ({
173
182
  )
174
183
  ] }) })
175
184
  ] });
176
- }, Y = ({ onEvent: n }) => {
177
- A("Payroll.WireInstructions");
178
- const { t: a } = v("Payroll.WireInstructions"), { Button: i } = g(), { companyId: d, selectedWireInId: l } = O(), { selectedInstruction: r } = k(d, l), t = () => {
185
+ }, M = ({ onEvent: n }) => {
186
+ L("Payroll.WireInstructions");
187
+ const { t: a } = v("Payroll.WireInstructions"), { Button: o } = g(), { companyId: d, selectedWireInId: l } = Y(), { selectedInstruction: r } = q(d, l), t = () => {
179
188
  n(C.PAYROLL_WIRE_INSTRUCTIONS_DONE, {
180
189
  selectedWireInId: l
181
190
  });
182
191
  };
183
192
  return /* @__PURE__ */ m("div", { className: u.footer, children: [
184
193
  /* @__PURE__ */ e(
185
- i,
194
+ o,
186
195
  {
187
196
  variant: "secondary",
188
197
  onClick: () => {
@@ -191,12 +200,12 @@ const B = ({
191
200
  children: a("cta.close")
192
201
  }
193
202
  ),
194
- /* @__PURE__ */ e(i, { variant: "primary", onClick: t, isDisabled: !r, children: a("cta.confirm") })
203
+ /* @__PURE__ */ e(o, { variant: "primary", onClick: t, isDisabled: !r, children: a("cta.confirm") })
195
204
  ] });
196
205
  };
197
- U.Footer = Y;
206
+ j.Footer = M;
198
207
  export {
199
- B as Root,
200
- U as WireInstructions
208
+ G as Root,
209
+ j as WireInstructions
201
210
  };
202
211
  //# sourceMappingURL=WireInstructions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WireInstructions.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport type { ConfirmWireDetailsContextInterface } from '../ConfirmWireDetailsComponents'\nimport styles from './WireInstructions.module.scss'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ninterface WireInstructionsProps extends BaseComponentInterface<'Payroll.WireInstructions'> {\n companyId: string\n wireInId?: string\n selectedWireInId?: string\n onEvent: OnEventType<EventType, unknown>\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\ninterface WireInstructionFieldProps {\n label: string\n value: string\n onCopy?: () => void\n copyAriaLabel?: string\n showCopiedMessage?: boolean\n copiedMessage?: string\n}\n\nfunction useWireInstructionsState(companyId: string, selectedWireInId?: string) {\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const wireInInformation = activeWireInRequests.find(r => r.uuid === selectedWireInId)\n\n const payrolls = payrollsData.payrollList || []\n\n const activeWireInRequestsWithPayrolls = useMemo(\n () =>\n activeWireInRequests.map(wireInRequest => {\n const payroll = payrolls.find(p => p.payrollUuid === wireInRequest.paymentUuid)\n return {\n wireInRequest,\n payroll,\n }\n }),\n [activeWireInRequests, payrolls],\n )\n\n const selectedInstruction = useMemo(() => {\n if (!wireInInformation) return null\n\n const instruction = {\n id: wireInInformation.uuid || '',\n trackingCode: wireInInformation.uniqueTrackingCode || '',\n amount: parseFloat(wireInInformation.requestedAmount || '0'),\n bankName: wireInInformation.originationBank || '',\n bankAddress: wireInInformation.originationBankAddress || '',\n recipientName: wireInInformation.recipientName || '',\n recipientAddress: wireInInformation.recipientAddress || '',\n recipientAccountNumber: wireInInformation.recipientAccountNumber || '',\n recipientRoutingNumber: wireInInformation.recipientRoutingNumber || '',\n }\n return instruction\n }, [wireInInformation])\n\n return {\n selectedInstruction,\n activeWireInRequestsWithPayrolls,\n }\n}\n\nfunction WireInstructionField({ label, value }: WireInstructionFieldProps) {\n const { Text } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n <Text className={styles.fieldLabel}>{label}</Text>\n <Text className={styles.fieldValue}>{value}</Text>\n </Flex>\n )\n}\n\nexport function WireInstructions(props: WireInstructionsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n companyId,\n wireInId,\n selectedWireInId,\n dictionary,\n onEvent,\n modalContainerRef,\n}: WireInstructionsProps) => {\n useComponentDictionary('Payroll.WireInstructions', dictionary)\n useI18n('Payroll.WireInstructions')\n const { t } = useTranslation('Payroll.WireInstructions')\n const { Select, Card, Text, UnorderedList, Heading, Alert } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const formatCurrency = useNumberFormatter('currency')\n\n const { selectedInstruction, activeWireInRequestsWithPayrolls } = useWireInstructionsState(\n companyId,\n selectedWireInId,\n )\n\n const shouldShowDropdown = !wireInId && activeWireInRequestsWithPayrolls.length > 1\n\n const handleWireInSelection = (updatedSelectedWireInId: string) => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT, {\n selectedWireInId: updatedSelectedWireInId,\n })\n }\n\n if (activeWireInRequestsWithPayrolls.length === 0 || (selectedWireInId && !selectedInstruction)) {\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Text>{t('messages.noInstructions')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <div>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text className={styles.subtitle}>{t('subtitle')}</Text>\n </div>\n\n {shouldShowDropdown && (\n <Select\n isRequired\n portalContainer={modalContainerRef?.current || undefined}\n label={t('selectLabel')}\n value={selectedWireInId || ''}\n options={activeWireInRequestsWithPayrolls.map(({ wireInRequest, payroll }) => ({\n label: payroll?.payPeriod\n ? dateFormatter.formatPayPeriodRange(\n payroll.payPeriod.startDate,\n payroll.payPeriod.endDate,\n )\n : t('selectFallback'),\n value: wireInRequest.uuid || '',\n }))}\n onChange={handleWireInSelection}\n />\n )}\n\n <Alert label={t('requirementsTitle')} disableScrollIntoView>\n <UnorderedList\n className={styles.requirementsList}\n items={[\n t('requirements.trackingCode'),\n t('requirements.amountMatch'),\n t('requirements.usBank'),\n t('requirements.authorized'),\n ]}\n />\n </Alert>\n\n {selectedInstruction && (\n <Flex flexDirection=\"column\" gap={16}>\n <Card className={styles.requirementsCard}>\n <WireInstructionField\n label={t('fields.trackingCode')}\n value={selectedInstruction.trackingCode}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.amount')}\n value={formatCurrency(selectedInstruction.amount)}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.bankName')}\n value={selectedInstruction.bankName}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.bankAddress')}\n value={selectedInstruction.bankAddress}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.recipientName')}\n value={selectedInstruction.recipientName}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.recipientAddress')}\n value={selectedInstruction.recipientAddress}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.accountNumber')}\n value={selectedInstruction.recipientAccountNumber}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.routingNumber')}\n value={selectedInstruction.recipientRoutingNumber}\n />\n </Card>\n </Flex>\n )}\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.WireInstructions')\n const { t } = useTranslation('Payroll.WireInstructions')\n const { Button } = useComponentContext()\n const { companyId, selectedWireInId } = useFlow<ConfirmWireDetailsContextInterface>()\n const { selectedInstruction } = useWireInstructionsState(companyId, selectedWireInId)\n\n const handleConfirm = () => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE, {\n selectedWireInId,\n })\n }\n\n return (\n <div className={styles.footer}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL)\n }}\n >\n {t('cta.close')}\n </Button>\n <Button variant=\"primary\" onClick={handleConfirm} isDisabled={!selectedInstruction}>\n {t('cta.confirm')}\n </Button>\n </div>\n )\n}\n\nWireInstructions.Footer = Footer\n"],"names":["useWireInstructionsState","companyId","selectedWireInId","wireInRequestsData","useWireInRequestsListSuspense","payrollsData","usePayrollsListSuspense","activeWireInRequests","r","wireInInformation","payrolls","activeWireInRequestsWithPayrolls","useMemo","wireInRequest","payroll","p","WireInstructionField","label","value","Text","useComponentContext","jsxs","Flex","jsx","styles","WireInstructions","props","BaseComponent","Root","wireInId","dictionary","onEvent","modalContainerRef","useComponentDictionary","useI18n","useTranslation","Select","Card","UnorderedList","Heading","Alert","dateFormatter","useDateFormatter","formatCurrency","useNumberFormatter","selectedInstruction","shouldShowDropdown","handleWireInSelection","updatedSelectedWireInId","payrollWireEvents","Footer","t","Button","useFlow","handleConfirm"],"mappings":";;;;;;;;;;;;;;;AAiCA,SAASA,EAAyBC,GAAmBC,GAA2B;AAC9E,QAAM,EAAE,MAAMC,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAaH;AAAA,EAAA,CACd,GAEK,EAAE,MAAMI,EAAA,IAAiBC,EAAwB;AAAA,IACrD,WAAAL;AAAA,IACA,WAAW;AAAA,EAAA,CACZ,GAEKM,KAAwBJ,EAAmB,qBAAq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W,kBAAAC,EAAA,IAAqBmD,EAAA,GAClC,EAAE,qBAAAR,EAAA,IAAwB7C,EAAyBC,GAAWC,CAAgB,GAE9EoD,IAAgB,MAAM;AAC1B,IAAAvB,EAAQkB,EAAkB,gCAAgC;AAAA,MACxD,kBAAA/C;AAAA,IAAA,CACD;AAAA,EACH;AAEA,SACE,gBAAAmB,EAAC,OAAA,EAAI,WAAWG,EAAO,QACrB,UAAA;AAAA,IAAA,gBAAAD;AAAA,MAAC6B;AAAA,MAAA;AAAA,QACC,SAAQ;AAAA,QACR,SAAS,MAAM;AACb,UAAArB,EAAQkB,EAAkB,gCAAgC;AAAA,QAC5D;AAAA,QAEC,YAAE,WAAW;AAAA,MAAA;AAAA,IAAA;AAAA,IAEhB,gBAAA1B,EAAC6B,GAAA,EAAO,SAAQ,WAAU,SAASE,GAAe,YAAY,CAACT,GAC5D,UAAAM,EAAE,aAAa,EAAA,CAClB;AAAA,EAAA,GACF;AAEJ;AAEA1B,EAAiB,SAASyB;"}
1
+ {"version":3,"file":"WireInstructions.js","sources":["../../../../../src/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { usePayrollsListSuspense } from '@gusto/embedded-api/react-query/payrollsList'\nimport type { ConfirmWireDetailsContextInterface } from '../ConfirmWireDetailsComponents'\nimport styles from './WireInstructions.module.scss'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common/Flex/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport useNumberFormatter from '@/hooks/useNumberFormatter'\nimport { useFlow } from '@/components/Flow/useFlow'\n\ninterface WireInstructionsProps extends BaseComponentInterface<'Payroll.WireInstructions'> {\n companyId: string\n wireInId?: string\n selectedWireInId?: string\n onEvent: OnEventType<EventType, unknown>\n modalContainerRef?: React.RefObject<HTMLDivElement | null>\n}\n\ninterface WireInstructionFieldProps {\n label: string\n value: string\n onCopy?: () => void\n copyAriaLabel?: string\n showCopiedMessage?: boolean\n copiedMessage?: string\n}\n\nfunction useWireInstructionsState(companyId: string, selectedWireInId?: string) {\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const { data: payrollsData } = usePayrollsListSuspense({\n companyId,\n processed: true,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const wireInInformation = activeWireInRequests.find(r => r.uuid === selectedWireInId)\n\n const payrolls = payrollsData.payrollList || []\n\n const activeWireInRequestsWithPayrolls = useMemo(\n () =>\n activeWireInRequests.map(wireInRequest => {\n const payroll = payrolls.find(p => p.payrollUuid === wireInRequest.paymentUuid)\n return {\n wireInRequest,\n payroll,\n paymentType: wireInRequest.paymentType,\n requestedAmount: wireInRequest.requestedAmount ?? '',\n }\n }),\n [activeWireInRequests, payrolls],\n )\n\n const selectedInstruction = useMemo(() => {\n if (!wireInInformation) return null\n\n const instruction = {\n id: wireInInformation.uuid || '',\n trackingCode: wireInInformation.uniqueTrackingCode || '',\n amount: parseFloat(wireInInformation.requestedAmount || '0'),\n bankName: wireInInformation.originationBank || '',\n bankAddress: wireInInformation.originationBankAddress || '',\n recipientName: wireInInformation.recipientName || '',\n recipientAddress: wireInInformation.recipientAddress || '',\n recipientAccountNumber: wireInInformation.recipientAccountNumber || '',\n recipientRoutingNumber: wireInInformation.recipientRoutingNumber || '',\n }\n return instruction\n }, [wireInInformation])\n\n return {\n selectedInstruction,\n activeWireInRequestsWithPayrolls,\n }\n}\n\nfunction WireInstructionField({ label, value }: WireInstructionFieldProps) {\n const { Text } = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={8}>\n <Text className={styles.fieldLabel}>{label}</Text>\n <Text className={styles.fieldValue}>{value}</Text>\n </Flex>\n )\n}\n\nexport function WireInstructions(props: WireInstructionsProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n companyId,\n wireInId,\n selectedWireInId,\n dictionary,\n onEvent,\n modalContainerRef,\n}: WireInstructionsProps) => {\n useComponentDictionary('Payroll.WireInstructions', dictionary)\n useI18n('Payroll.WireInstructions')\n const { t } = useTranslation('Payroll.WireInstructions')\n const { Select, Card, Text, UnorderedList, Heading, Alert } = useComponentContext()\n const dateFormatter = useDateFormatter()\n const formatCurrency = useNumberFormatter('currency')\n\n const { selectedInstruction, activeWireInRequestsWithPayrolls } = useWireInstructionsState(\n companyId,\n selectedWireInId,\n )\n\n const shouldShowDropdown = !wireInId && activeWireInRequestsWithPayrolls.length > 1\n\n const handleWireInSelection = (updatedSelectedWireInId: string) => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_SELECT, {\n selectedWireInId: updatedSelectedWireInId,\n })\n }\n\n if (activeWireInRequestsWithPayrolls.length === 0 || (selectedWireInId && !selectedInstruction)) {\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <Text>{t('messages.noInstructions')}</Text>\n </Flex>\n )\n }\n\n return (\n <Flex flexDirection=\"column\" gap={24}>\n <div>\n <Heading as=\"h2\" styledAs=\"h3\">\n {t('title')}\n </Heading>\n <Text className={styles.subtitle}>{t('subtitle')}</Text>\n </div>\n\n {shouldShowDropdown && (\n <Select\n isRequired\n portalContainer={modalContainerRef?.current || undefined}\n label={t('selectLabel')}\n value={selectedWireInId || ''}\n options={activeWireInRequestsWithPayrolls.map(\n ({ wireInRequest, payroll, paymentType, requestedAmount }) => {\n const payrollRange = payroll?.payPeriod\n ? dateFormatter.formatPayPeriodRange(\n payroll.payPeriod.startDate,\n payroll.payPeriod.endDate,\n )\n : ''\n\n return {\n label:\n paymentType === 'Payroll'\n ? payrollRange\n ? t('selectLabelPayroll', { payrollRange })\n : t('selectFallback')\n : paymentType === 'ContractorPaymentGroup'\n ? t('selectLabelContractorPaymentGroup', {\n requestedAmount: formatCurrency(Number(requestedAmount)),\n })\n : t('selectFallback'),\n value: wireInRequest.uuid || '',\n }\n },\n )}\n onChange={handleWireInSelection}\n />\n )}\n <Alert label={t('requirementsTitle')} disableScrollIntoView>\n <UnorderedList\n className={styles.requirementsList}\n items={[\n t('requirements.trackingCode'),\n t('requirements.amountMatch'),\n t('requirements.usBank'),\n t('requirements.authorized'),\n ]}\n />\n </Alert>\n {selectedInstruction && (\n <Flex flexDirection=\"column\" gap={16}>\n <Card className={styles.requirementsCard}>\n <WireInstructionField\n label={t('fields.trackingCode')}\n value={selectedInstruction.trackingCode}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.amount')}\n value={formatCurrency(selectedInstruction.amount)}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.bankName')}\n value={selectedInstruction.bankName}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.bankAddress')}\n value={selectedInstruction.bankAddress}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.recipientName')}\n value={selectedInstruction.recipientName}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.recipientAddress')}\n value={selectedInstruction.recipientAddress}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.accountNumber')}\n value={selectedInstruction.recipientAccountNumber}\n />\n\n <hr />\n\n <WireInstructionField\n label={t('fields.routingNumber')}\n value={selectedInstruction.recipientRoutingNumber}\n />\n </Card>\n </Flex>\n )}\n </Flex>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('Payroll.WireInstructions')\n const { t } = useTranslation('Payroll.WireInstructions')\n const { Button } = useComponentContext()\n const { companyId, selectedWireInId } = useFlow<ConfirmWireDetailsContextInterface>()\n const { selectedInstruction } = useWireInstructionsState(companyId, selectedWireInId)\n\n const handleConfirm = () => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_DONE, {\n selectedWireInId,\n })\n }\n\n return (\n <div className={styles.footer}>\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL)\n }}\n >\n {t('cta.close')}\n </Button>\n <Button variant=\"primary\" onClick={handleConfirm} isDisabled={!selectedInstruction}>\n {t('cta.confirm')}\n </Button>\n </div>\n )\n}\n\nWireInstructions.Footer = Footer\n"],"names":["useWireInstructionsState","companyId","selectedWireInId","wireInRequestsData","useWireInRequestsListSuspense","payrollsData","usePayrollsListSuspense","activeWireInRequests","r","wireInInformation","payrolls","activeWireInRequestsWithPayrolls","useMemo","wireInRequest","payroll","p","WireInstructionField","label","value","Text","useComponentContext","jsxs","Flex","jsx","styles","WireInstructions","props","BaseComponent","Root","wireInId","dictionary","onEvent","modalContainerRef","useComponentDictionary","useI18n","useTranslation","Select","Card","UnorderedList","Heading","Alert","dateFormatter","useDateFormatter","formatCurrency","useNumberFormatter","selectedInstruction","shouldShowDropdown","handleWireInSelection","updatedSelectedWireInId","payrollWireEvents","paymentType","requestedAmount","payrollRange","Footer","t","Button","useFlow","handleConfirm"],"mappings":";;;;;;;;;;;;;;;AAiCA,SAASA,EAAyBC,GAAmBC,GAA2B;AAC9E,QAAM,EAAE,MAAMC,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAaH;AAAA,EAAA,CACd,GAEK,EAAE,MAAMI,EAAA,IAAiBC,EAAwB;AAAA,IACrD,WAAAL;AAAA,IACA,WAAW;AAAA,EAAA,CACZ,GAEKM,KAAwBJ,EAAmB,qBAAqB,CAAA,GAAI;AAAA,IACxE,CAAAK,MAAKA,EAAE,WAAW;AAAA,EAAA,GAGdC,IAAoBF,EAAqB,KAAK,CAAAC,MAAKA,EAAE,SAASN,CAAgB,GAE9EQ,IAAWL,E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