@gusto/embedded-react-sdk 0.36.0 → 0.37.0-rc.1

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 (344) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/UNSTABLE_Hooks.d.ts +1 -1
  3. package/dist/UNSTABLE_Hooks.js +6 -6
  4. package/dist/components/Base/Base.d.ts +8 -10
  5. package/dist/components/Base/Base.js +121 -100
  6. package/dist/components/Base/Base.js.map +1 -1
  7. package/dist/components/Base/index.d.ts +1 -1
  8. package/dist/components/Base/useBase.d.ts +3 -7
  9. package/dist/components/Base/useBase.js.map +1 -1
  10. package/dist/components/Base/useBaseSubmit.d.ts +3 -5
  11. package/dist/components/Base/useBaseSubmit.js +27 -50
  12. package/dist/components/Base/useBaseSubmit.js.map +1 -1
  13. package/dist/components/Common/SignatureForm/SignatureFormActions.js +1 -1
  14. package/dist/components/Common/SignatureForm/SignatureFormFields.js +1 -1
  15. package/dist/components/Common/UI/Breadcrumbs/Breadcrumbs.js +1 -1
  16. package/dist/components/Common/UI/DescriptionList/DescriptionList.module.scss.js +2 -2
  17. package/dist/components/Common/UI/FileInput/FileInput.js +1 -1
  18. package/dist/components/Common/UI/ProgressBar/ProgressBar.js +4 -4
  19. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +6 -5
  20. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +6 -8
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +5 -4
  24. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +6 -8
  26. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  27. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +8 -10
  28. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  29. package/dist/components/Company/BankAccount/BankAccountForm/context.js +6 -8
  30. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  31. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +6 -8
  32. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  33. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +6 -8
  34. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  35. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +11 -13
  36. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  37. package/dist/components/Company/Industry/Context.js +9 -11
  38. package/dist/components/Company/Industry/Context.js.map +1 -1
  39. package/dist/components/Company/Locations/LocationForm/Form.js +5 -4
  40. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  41. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +6 -8
  42. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  43. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +6 -8
  44. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  45. package/dist/components/Company/OnboardingOverview/context.js +6 -8
  46. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  47. package/dist/components/Company/PaySchedule/PaySchedule.js +60 -60
  48. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  49. package/dist/components/Company/PaySchedule/_parts/Edit.js +10 -9
  50. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  51. package/dist/components/Company/PaySchedule/usePaySchedule.js +8 -10
  52. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  53. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +6 -8
  54. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  55. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +6 -8
  56. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  57. package/dist/components/Contractor/Address/Form.js +7 -6
  58. package/dist/components/Contractor/Address/Form.js.map +1 -1
  59. package/dist/components/Contractor/Address/useAddress.js +8 -10
  60. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  61. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +3 -2
  62. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  63. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  64. package/dist/components/Contractor/Profile/useContractorProfile.js +26 -28
  65. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  66. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +13 -15
  67. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  68. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +5 -7
  69. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  70. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +5 -7
  71. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  72. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +3 -2
  73. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  74. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +6 -8
  75. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  76. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +6 -8
  77. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  78. package/dist/components/Employee/EmployeeList/useEmployeeList.js +6 -8
  79. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  80. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +42 -42
  81. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  82. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +6 -8
  83. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  84. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +8 -10
  85. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  86. package/dist/components/Employee/Profile/HomeAddress.js +9 -8
  87. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  88. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +15 -14
  89. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  90. package/dist/components/Employee/Profile/Profile.js +30 -29
  91. package/dist/components/Employee/Profile/Profile.js.map +1 -1
  92. package/dist/components/Employee/Profile/useProfile.js +6 -8
  93. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  94. package/dist/components/Employee/StateTaxes/StateTaxes.js +50 -50
  95. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
  96. package/dist/components/Employee/StateTaxes/useStateTaxes.js +6 -8
  97. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  98. package/dist/components/Employee/Taxes/Taxes.js +53 -53
  99. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  100. package/dist/components/Employee/Taxes/useTaxes.js +6 -8
  101. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  102. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.d.ts +11 -0
  103. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js +123 -0
  104. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployee.js.map +1 -0
  105. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.d.ts +11 -0
  106. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +92 -0
  107. package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js.map +1 -0
  108. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.d.ts +2 -0
  109. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js +30 -0
  110. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlow.js.map +1 -0
  111. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.d.ts +23 -0
  112. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js +72 -0
  113. package/dist/components/Employee/Terminations/TerminationFlow/TerminationFlowComponents.js.map +1 -0
  114. package/dist/components/Employee/Terminations/TerminationFlow/index.d.ts +3 -0
  115. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.d.ts +7 -0
  116. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js +165 -0
  117. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.js.map +1 -0
  118. package/dist/components/Employee/Terminations/TerminationFlow/terminationStateMachine.test.d.ts +1 -0
  119. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.d.ts +9 -0
  120. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js +86 -0
  121. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummary.js.map +1 -0
  122. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.d.ts +20 -0
  123. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js +103 -0
  124. package/dist/components/Employee/Terminations/TerminationSummary/TerminationSummaryPresentation.js.map +1 -0
  125. package/dist/components/Employee/Terminations/TerminationsData.d.ts +6 -0
  126. package/dist/components/Employee/Terminations/index.d.ts +8 -0
  127. package/dist/components/Employee/Terminations/types.d.ts +1 -0
  128. package/dist/components/Employee/index.d.ts +7 -0
  129. package/dist/components/Employee/index.js +34 -28
  130. package/dist/components/Employee/index.js.map +1 -1
  131. package/dist/components/InformationRequests/InformationRequests.js +31 -31
  132. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  133. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +41 -41
  134. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  135. package/dist/components/Payroll/Dismissal/DismissalFlow.d.ts +2 -0
  136. package/dist/components/Payroll/Dismissal/DismissalFlow.js +32 -0
  137. package/dist/components/Payroll/Dismissal/DismissalFlow.js.map +1 -0
  138. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.d.ts +16 -0
  139. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js +52 -0
  140. package/dist/components/Payroll/Dismissal/DismissalFlowComponents.js.map +1 -0
  141. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.d.ts +6 -0
  142. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +69 -0
  143. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -0
  144. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.d.ts +9 -0
  145. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js +53 -0
  146. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelectionPresentation.js.map +1 -0
  147. package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/index.d.ts +3 -0
  148. package/dist/components/Payroll/Dismissal/dismissalStateMachine.d.ts +6 -0
  149. package/dist/components/Payroll/Dismissal/dismissalStateMachine.js +51 -0
  150. package/dist/components/Payroll/Dismissal/dismissalStateMachine.js.map +1 -0
  151. package/dist/components/Payroll/Dismissal/dismissalStateMachine.test.d.ts +1 -0
  152. package/dist/components/Payroll/Dismissal/index.d.ts +3 -0
  153. package/dist/components/Payroll/GrossUpModal/GrossUpModal.js +3 -3
  154. package/dist/components/Payroll/OffCycle/OffCycleFlow.d.ts +1 -1
  155. package/dist/components/Payroll/OffCycle/OffCycleFlow.js +19 -18
  156. package/dist/components/Payroll/OffCycle/OffCycleFlow.js.map +1 -1
  157. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.d.ts +3 -0
  158. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +32 -24
  159. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  160. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +45 -45
  161. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -1
  162. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +1 -1
  163. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +75 -66
  164. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -1
  165. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js +8 -0
  166. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.module.scss.js.map +1 -0
  167. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +0 -1
  168. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +4 -4
  169. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +2 -2
  170. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -1
  171. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.d.ts +1 -0
  172. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +1 -0
  173. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -1
  174. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +186 -159
  175. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  176. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +3 -3
  177. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +71 -70
  178. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  179. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.d.ts +3 -2
  180. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js +8 -8
  181. package/dist/components/Payroll/PayrollConfiguration/grossUpHelpers.js.map +1 -1
  182. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +5 -3
  183. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +76 -70
  184. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -1
  185. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +47 -42
  186. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  187. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +4 -2
  188. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +225 -194
  189. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  190. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.d.ts +1 -0
  191. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js +12 -0
  192. package/dist/components/Payroll/PayrollFlow/OffCycleFlowContextual.js.map +1 -0
  193. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +3 -0
  194. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  195. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.d.ts +1 -0
  196. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js +21 -0
  197. package/dist/components/Payroll/PayrollFlow/TransitionFlowContextual.js.map +1 -0
  198. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  199. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +95 -64
  200. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  201. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +53 -47
  202. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  203. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +8 -8
  204. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  205. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +25 -23
  206. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  207. package/dist/components/Payroll/PayrollList/PayrollList.js +40 -32
  208. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  209. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +2 -1
  210. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +110 -93
  211. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  212. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +12 -8
  213. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  214. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +3 -2
  215. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  216. package/dist/components/Payroll/Transition/TransitionFlow.d.ts +2 -0
  217. package/dist/components/Payroll/Transition/TransitionFlow.js +38 -0
  218. package/dist/components/Payroll/Transition/TransitionFlow.js.map +1 -0
  219. package/dist/components/Payroll/Transition/TransitionFlowComponents.d.ts +19 -0
  220. package/dist/components/Payroll/Transition/TransitionFlowComponents.js +54 -0
  221. package/dist/components/Payroll/Transition/TransitionFlowComponents.js.map +1 -0
  222. package/dist/components/Payroll/Transition/index.d.ts +3 -0
  223. package/dist/components/Payroll/Transition/transitionStateMachine.d.ts +6 -0
  224. package/dist/components/Payroll/Transition/transitionStateMachine.js +58 -0
  225. package/dist/components/Payroll/Transition/transitionStateMachine.js.map +1 -0
  226. package/dist/components/Payroll/Transition/transitionStateMachine.test.d.ts +1 -0
  227. package/dist/components/Payroll/TransitionCreation/TransitionCreation.d.ts +2 -0
  228. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js +92 -0
  229. package/dist/components/Payroll/TransitionCreation/TransitionCreation.js.map +1 -0
  230. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.d.ts +2 -0
  231. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +111 -0
  232. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js.map +1 -0
  233. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js +8 -0
  234. package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.module.scss.js.map +1 -0
  235. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.d.ts +28 -0
  236. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js +21 -0
  237. package/dist/components/Payroll/TransitionCreation/TransitionCreationTypes.js.map +1 -0
  238. package/dist/components/Payroll/TransitionCreation/index.d.ts +3 -0
  239. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.d.ts +8 -0
  240. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js +83 -0
  241. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlert.js.map +1 -0
  242. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.d.ts +16 -0
  243. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js +100 -0
  244. package/dist/components/Payroll/TransitionPayrollAlert/TransitionPayrollAlertPresentation.js.map +1 -0
  245. package/dist/components/Payroll/TransitionPayrollAlert/index.d.ts +2 -0
  246. package/dist/components/Payroll/helpers.d.ts +2 -1
  247. package/dist/components/Payroll/helpers.js +98 -87
  248. package/dist/components/Payroll/helpers.js.map +1 -1
  249. package/dist/components/Payroll/index.d.ts +6 -0
  250. package/dist/components/Payroll/index.js +32 -26
  251. package/dist/components/Payroll/index.js.map +1 -1
  252. package/dist/components/Payroll/payrollTypes.d.ts +21 -0
  253. package/dist/components/Payroll/payrollTypes.js +27 -0
  254. package/dist/components/Payroll/payrollTypes.js.map +1 -0
  255. package/dist/components/Payroll/usePreparedPayrollData.js +5 -7
  256. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  257. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.d.ts +8 -0
  258. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js +13 -0
  259. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataContext.js.map +1 -0
  260. package/dist/components/UNSTABLE_Hooks/form/FormFieldsMetadataProvider.d.ts +10 -0
  261. package/dist/components/UNSTABLE_Hooks/form/SDKFormProvider.d.ts +18 -0
  262. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.d.ts +3 -0
  263. package/dist/components/UNSTABLE_Hooks/form/deriveFieldsMetadata.test.d.ts +1 -0
  264. package/dist/components/UNSTABLE_Hooks/form/index.d.ts +9 -0
  265. package/dist/components/UNSTABLE_Hooks/form/types.d.ts +15 -0
  266. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.d.ts +1 -0
  267. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js +15 -0
  268. package/dist/components/UNSTABLE_Hooks/form/useFieldErrorMessage.js.map +1 -0
  269. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.d.ts +4 -0
  270. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js +9 -0
  271. package/dist/components/UNSTABLE_Hooks/form/useFieldsMetadata.js.map +1 -0
  272. package/dist/components/UNSTABLE_Hooks/form/withOptions.d.ts +5 -0
  273. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/index.d.ts +3 -0
  274. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.d.ts +16 -0
  275. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js +7 -0
  276. package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/useCompensationForm.js.map +1 -0
  277. package/dist/components/UNSTABLE_Hooks/index.d.ts +5 -0
  278. package/dist/components/UNSTABLE_Hooks/types.d.ts +46 -0
  279. package/dist/contexts/ApiProvider/ApiProvider.js +11 -11
  280. package/dist/contexts/ApiProvider/ApiProvider.js.map +1 -1
  281. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +43 -47
  282. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  283. package/dist/contexts/ObservabilityProvider/index.d.ts +1 -1
  284. package/dist/contexts/ObservabilityProvider/sanitization.d.ts +0 -14
  285. package/dist/contexts/ObservabilityProvider/sanitization.js +51 -51
  286. package/dist/contexts/ObservabilityProvider/sanitization.js.map +1 -1
  287. package/dist/contexts/ObservabilityProvider/useSanitizedObservability.d.ts +0 -3
  288. package/dist/contexts/ObservabilityProvider/useSanitizedObservability.js.map +1 -1
  289. package/dist/i18n/I18n.js +11 -11
  290. package/dist/i18n/I18n.js.map +1 -1
  291. package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js +18 -0
  292. package/dist/i18n/en/Employee.Terminations.TerminateEmployee.json.js.map +1 -0
  293. package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js +12 -0
  294. package/dist/i18n/en/Employee.Terminations.TerminationFlow.json.js.map +1 -0
  295. package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js +20 -0
  296. package/dist/i18n/en/Employee.Terminations.TerminationSummary.json.js.map +1 -0
  297. package/dist/i18n/en/Payroll.Dismissal.json.js +22 -0
  298. package/dist/i18n/en/Payroll.Dismissal.json.js.map +1 -0
  299. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +15 -11
  300. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -1
  301. package/dist/i18n/en/Payroll.OffCyclePayPeriodDateForm.json.js +1 -1
  302. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js +20 -18
  303. package/dist/i18n/en/Payroll.PayrollEditEmployee.json.js.map +1 -1
  304. package/dist/i18n/en/Payroll.PayrollList.json.js +20 -18
  305. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  306. package/dist/i18n/en/Payroll.Transition.json.js +8 -0
  307. package/dist/i18n/en/Payroll.Transition.json.js.map +1 -0
  308. package/dist/i18n/en/Payroll.TransitionCreation.json.js +26 -0
  309. package/dist/i18n/en/Payroll.TransitionCreation.json.js.map +1 -0
  310. package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js +18 -0
  311. package/dist/i18n/en/Payroll.TransitionPayrollAlert.json.js.map +1 -0
  312. package/dist/i18n/en/common.json.d.ts +2 -1
  313. package/dist/i18n/en/common.json.js +9 -9
  314. package/dist/index.d.ts +3 -2
  315. package/dist/index.js +14 -13
  316. package/dist/shared/constants.d.ts +32 -0
  317. package/dist/shared/constants.js +83 -65
  318. package/dist/shared/constants.js.map +1 -1
  319. package/dist/style.css +1 -1
  320. package/dist/types/i18next.d.ts +163 -1
  321. package/dist/types/observability.d.ts +31 -65
  322. package/dist/types/sdkError.d.ts +91 -0
  323. package/dist/types/sdkError.js +95 -0
  324. package/dist/types/sdkError.js.map +1 -0
  325. package/dist/types/sdkError.test.d.ts +1 -0
  326. package/docs/reference/endpoint-inventory.json +120 -14
  327. package/package.json +13 -13
  328. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +0 -6
  329. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +0 -70
  330. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +0 -1
  331. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +0 -7
  332. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +0 -6
  333. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +0 -1
  334. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +0 -9
  335. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +0 -40
  336. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +0 -1
  337. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +0 -5
  338. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +0 -2
  339. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +0 -12
  340. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +0 -1
  341. package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +0 -2
  342. package/dist/contexts/ObservabilityProvider/observabilityUtils.d.ts +0 -5
  343. package/dist/contexts/ObservabilityProvider/observabilityUtils.js +0 -45
  344. package/dist/contexts/ObservabilityProvider/observabilityUtils.js.map +0 -1
@@ -1,33 +1,39 @@
1
1
  import { EmployeeList as e } from "./EmployeeList/EmployeeList.js";
2
- import { OnboardingFlow as m } from "./OnboardingFlow/OnboardingFlow.js";
3
- import { SelfOnboardingFlow as x } from "./SelfOnboardingFlow/SelfOnboardingFlow.js";
4
- import { Compensation as n } from "./Compensation/Compensation.js";
5
- import { Deductions as a } from "./Deductions/Deductions.js";
6
- import { DocumentSigner as d } from "./DocumentSigner/DocumentSigner.js";
7
- import { EmployeeDocuments as g } from "./EmployeeDocuments/EmployeeDocuments.js";
8
- import { EmploymentEligibility as b } from "./DocumentSigner/EmploymentEligibility/EmploymentEligibility.js";
9
- import { FederalTaxes as E } from "./FederalTaxes/FederalTaxes.js";
10
- import { Landing as c } from "./Landing/Landing.js";
11
- import { OnboardingSummary as F } from "./OnboardingSummary/OnboardingSummary.js";
12
- import { PaymentMethod as T } from "./PaymentMethod/PaymentMethod.js";
13
- import { Profile as L } from "./Profile/Profile.js";
14
- import { StateTaxes as h } from "./StateTaxes/StateTaxes.js";
15
- import { Taxes as M } from "./Taxes/Taxes.js";
2
+ import { OnboardingFlow as t } from "./OnboardingFlow/OnboardingFlow.js";
3
+ import { SelfOnboardingFlow as n } from "./SelfOnboardingFlow/SelfOnboardingFlow.js";
4
+ import { TerminateEmployee as f } from "./Terminations/TerminateEmployee/TerminateEmployee.js";
5
+ import { TerminationSummary as a } from "./Terminations/TerminationSummary/TerminationSummary.js";
6
+ import { TerminationFlow as y } from "./Terminations/TerminationFlow/TerminationFlow.js";
7
+ import { Compensation as s } from "./Compensation/Compensation.js";
8
+ import { Deductions as T } from "./Deductions/Deductions.js";
9
+ import { DocumentSigner as E } from "./DocumentSigner/DocumentSigner.js";
10
+ import { EmployeeDocuments as b } from "./EmployeeDocuments/EmployeeDocuments.js";
11
+ import { EmploymentEligibility as c } from "./DocumentSigner/EmploymentEligibility/EmploymentEligibility.js";
12
+ import { FederalTaxes as D } from "./FederalTaxes/FederalTaxes.js";
13
+ import { Landing as L } from "./Landing/Landing.js";
14
+ import { OnboardingSummary as h } from "./OnboardingSummary/OnboardingSummary.js";
15
+ import { PaymentMethod as M } from "./PaymentMethod/PaymentMethod.js";
16
+ import { Profile as k } from "./Profile/Profile.js";
17
+ import { StateTaxes as v } from "./StateTaxes/StateTaxes.js";
18
+ import { Taxes as A } from "./Taxes/Taxes.js";
16
19
  export {
17
- n as Compensation,
18
- a as Deductions,
19
- d as DocumentSigner,
20
- g as EmployeeDocuments,
20
+ s as Compensation,
21
+ T as Deductions,
22
+ E as DocumentSigner,
23
+ b as EmployeeDocuments,
21
24
  e as EmployeeList,
22
- b as EmploymentEligibility,
23
- E as FederalTaxes,
24
- c as Landing,
25
- m as OnboardingFlow,
26
- F as OnboardingSummary,
27
- T as PaymentMethod,
28
- L as Profile,
29
- x as SelfOnboardingFlow,
30
- h as StateTaxes,
31
- M as Taxes
25
+ c as EmploymentEligibility,
26
+ D as FederalTaxes,
27
+ L as Landing,
28
+ t as OnboardingFlow,
29
+ h as OnboardingSummary,
30
+ M as PaymentMethod,
31
+ k as Profile,
32
+ n as SelfOnboardingFlow,
33
+ v as StateTaxes,
34
+ A as Taxes,
35
+ f as TerminateEmployee,
36
+ y as TerminationFlow,
37
+ a as TerminationSummary
32
38
  };
33
39
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -1,44 +1,44 @@
1
- import { jsx as t, jsxs as D } from "react/jsx-runtime";
2
- import { createMachine as v } from "robot3";
1
+ import { jsx as t, jsxs as v } from "react/jsx-runtime";
2
+ import { createMachine as b } from "robot3";
3
3
  import { useMachine as L } from "react-robot";
4
- import { useState as R, useCallback as p, useMemo as b, Suspense as Q } from "react";
4
+ import { useState as R, useCallback as p, useMemo as Q, Suspense as E } from "react";
5
5
  import { useTranslation as U } from "react-i18next";
6
- import { informationRequestsMachine as P } from "./informationRequestsStateMachine.js";
7
- import { BaseBoundaries as g } from "../Base/Base.js";
6
+ import { informationRequestsMachine as k } from "./informationRequestsStateMachine.js";
7
+ import { BaseBoundaries as P } from "../Base/Base.js";
8
8
  import "../Base/useBase.js";
9
- import { Flex as j } from "../Common/Flex/Flex.js";
9
+ import { Flex as g } from "../Common/Flex/Flex.js";
10
10
  import "classnames";
11
11
  import { informationRequestEvents as s } from "../../shared/constants.js";
12
- import { useComponentContext as k } from "../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import { useComponentContext as j } from "../../contexts/ComponentAdapter/useComponentContext.js";
13
13
  import { FlowContext as B } from "../Flow/useFlow.js";
14
14
  import { useComponentDictionary as $, useI18n as w } from "../../i18n/I18n.js";
15
15
  import { InformationRequestList as z } from "./InformationRequestList/InformationRequestList.js";
16
- const E = "informationRequestResponded";
16
+ const I = "informationRequestResponded";
17
17
  function re({
18
18
  companyId: r,
19
- dictionary: I,
19
+ dictionary: O,
20
20
  withAlert: a = !0,
21
- onEvent: O = () => {
21
+ onEvent: M = () => {
22
22
  }
23
23
  }) {
24
- $("InformationRequests", I), w("InformationRequests");
25
- const { t: m } = U("InformationRequests"), { Modal: M, LoadingSpinner: c, Alert: x, Text: h } = k(), [A, i] = R(!1), [C, f] = R({
24
+ $("InformationRequests", O), w("InformationRequests");
25
+ const { t: m } = U("InformationRequests"), { Modal: h, LoadingSpinner: c, Alert: x, Text: A } = j(), [F, i] = R(!1), [N, f] = R({
26
26
  nextAlertId: 0,
27
27
  alerts: []
28
- }), F = p((e) => {
28
+ }), T = p((e) => {
29
29
  f((o) => ({
30
30
  ...o,
31
- alerts: o.alerts.filter((q) => q.id !== e)
31
+ alerts: o.alerts.filter((D) => D.id !== e)
32
32
  }));
33
- }, []), N = p(() => {
33
+ }, []), _ = p(() => {
34
34
  f((e) => ({
35
35
  nextAlertId: e.nextAlertId + 1,
36
36
  alerts: [{ id: e.nextAlertId }, ...e.alerts]
37
37
  }));
38
- }, []), T = b(
39
- () => v(
38
+ }, []), C = Q(
39
+ () => b(
40
40
  "list",
41
- P,
41
+ k,
42
42
  () => ({
43
43
  component: null,
44
44
  companyId: r,
@@ -46,11 +46,11 @@ function re({
46
46
  })
47
47
  ),
48
48
  [r]
49
- ), [u, _] = L(T);
49
+ ), [u, S] = L(C);
50
50
  function n(e, o) {
51
- _({ type: e, payload: o }), e === s.INFORMATION_REQUEST_RESPOND && i(!0), (e === s.INFORMATION_REQUEST_FORM_CANCEL || e === s.INFORMATION_REQUEST_FORM_DONE) && i(!1), e === s.INFORMATION_REQUEST_FORM_DONE && a && N(), O(e, o);
51
+ S({ type: e, payload: o }), e === s.INFORMATION_REQUEST_RESPOND && i(!0), (e === s.INFORMATION_REQUEST_FORM_CANCEL || e === s.INFORMATION_REQUEST_FORM_DONE) && i(!1), e === s.INFORMATION_REQUEST_FORM_DONE && a && _(), M(e, o);
52
52
  }
53
- const S = () => {
53
+ const q = () => {
54
54
  i(!1);
55
55
  }, l = u.context.component, d = l?.Footer || void 0;
56
56
  return /* @__PURE__ */ t(
@@ -60,26 +60,26 @@ function re({
60
60
  ...u.context,
61
61
  onEvent: n
62
62
  },
63
- children: /* @__PURE__ */ D(j, { flexDirection: "column", gap: 32, children: [
64
- a && C.alerts.map((e) => /* @__PURE__ */ t(
63
+ children: /* @__PURE__ */ v(g, { flexDirection: "column", gap: 32, children: [
64
+ a && N.alerts.map((e) => /* @__PURE__ */ t(
65
65
  x,
66
66
  {
67
67
  status: "success",
68
- label: m(`alerts.${E}.title`),
68
+ label: m(`alerts.${I}.title`),
69
69
  onDismiss: () => {
70
- F(e.id);
70
+ T(e.id);
71
71
  },
72
- children: /* @__PURE__ */ t(h, { children: m(`alerts.${E}.description`) })
72
+ children: /* @__PURE__ */ t(A, { children: m(`alerts.${I}.description`) })
73
73
  },
74
74
  e.id
75
75
  )),
76
- /* @__PURE__ */ t(Q, { fallback: /* @__PURE__ */ t(c, {}), children: /* @__PURE__ */ t(z, { companyId: r, onEvent: n }) }),
76
+ /* @__PURE__ */ t(E, { fallback: /* @__PURE__ */ t(c, {}), children: /* @__PURE__ */ t(z, { companyId: r, onEvent: n }) }),
77
77
  /* @__PURE__ */ t(
78
- M,
78
+ h,
79
79
  {
80
- isOpen: A,
81
- onClose: S,
82
- footer: d && /* @__PURE__ */ t(g, { LoaderComponent: () => /* @__PURE__ */ t(c, { size: "sm" }), children: /* @__PURE__ */ t(d, { onEvent: n }) }),
80
+ isOpen: F,
81
+ onClose: q,
82
+ footer: d && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(E, { fallback: /* @__PURE__ */ t(c, { size: "sm" }), children: /* @__PURE__ */ t(d, { onEvent: n }) }) }),
83
83
  children: l && /* @__PURE__ */ t(l, {})
84
84
  }
85
85
  )
@@ -1 +1 @@
1
- {"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n companyId: string\n /**\n * When true (default), the submission success alert is rendered at the top of this component.\n * Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.\n */\n withAlert?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nconst ALERT_TYPE = 'informationRequestResponded' as const\n\nexport function InformationRequestsFlow({\n companyId,\n dictionary,\n withAlert = true,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n useComponentDictionary('InformationRequests', dictionary)\n useI18n('InformationRequests')\n const { t } = useTranslation('InformationRequests')\n const { Modal, LoadingSpinner, Alert, Text } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [alertState, setAlertState] = useState<SubmissionAlertState>({\n nextAlertId: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addSubmissionAlert = useCallback(() => {\n setAlertState(prev => ({\n nextAlertId: prev.nextAlertId + 1,\n alerts: [{ id: prev.nextAlertId }, ...prev.alerts],\n }))\n }, [])\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE && withAlert) {\n addSubmissionAlert()\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {withAlert &&\n alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${ALERT_TYPE}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${ALERT_TYPE}.description`)}</Text>\n </Alert>\n ))}\n\n <Suspense fallback={<LoadingSpinner />}>\n <InformationRequestList companyId={companyId} onEvent={handleEvent} />\n </Suspense>\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries LoaderComponent={() => <LoadingSpinner size=\"sm\" />}>\n <Footer onEvent={handleEvent} />\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </Flex>\n </FlowContext.Provider>\n )\n}\n"],"names":["ALERT_TYPE","InformationRequestsFlow","companyId","dictionary","withAlert","onEvent","useComponentDictionary","useI18n","t","useTranslation","Modal","LoadingSpinner","Alert","Text","useComponentContext","isModalOpen","setIsModalOpen","useState","alertState","setAlertState","handleDismissAlert","useCallback","alertId","prev","alert","addSubmissionAlert","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsx","FlowContext","jsxs","Flex","Suspense","InformationRequestList","BaseBoundaries"],"mappings":";;;;;;;;;;;;;;;AAoCA,MAAMA,IAAa;AAEZ,SAASC,GAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,MAAM;AAAA,EAAC;AACnB,GAAiC;AAC/B,EAAAC,EAAuB,uBAAuBH,CAAU,GACxDI,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,OAAAC,GAAO,gBAAAC,GAAgB,OAAAC,GAAO,MAAAC,EAAA,IAASC,EAAA,GACzC,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAYC,CAAa,IAAIF,EAA+B;AAAA,IACjE,aAAa;AAAA,IACb,QAAQ,CAAA;AAAA,EAAC,CACV,GAEKG,IAAqBC,EAAY,CAACC,MAAoB;AAC1D,IAAAH,EAAc,CAAAI,OAAS;AAAA,MACrB,GAAGA;AAAA,MACH,QAAQA,EAAK,OAAO,OAAO,CAAAC,MAASA,EAAM,OAAOF,CAAO;AAAA,IAAA,EACxD;AAAA,EACJ,GAAG,CAAA,CAAE,GAECG,IAAqBJ,EAAY,MAAM;AAC3C,IAAAF,EAAc,CAAAI,OAAS;AAAA,MACrB,aAAaA,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AA,EAAM,UAAAL,EAAE,UAAUR,CAAU,cAAc,EAAA,CAAE;AAAA,UAAA;AAAA,UAPxCwB,EAAM;AAAA,QAAA,CASd;AAAA,QAEH,gBAAAgB,EAACI,GAAA,EAAS,UAAU,gBAAAJ,EAAC7B,GAAA,CAAA,CAAe,GAClC,UAAA,gBAAA6B,EAACK,GAAA,EAAuB,WAAA3C,GAAsB,SAAS4B,EAAA,CAAa,GACtE;AAAA,QACA,gBAAAU;AAAA,UAAC9B;AAAA,UAAA;AAAA,YACC,QAAQK;AAAA,YACR,SAASsB;AAAA,YACT,QACEE,KACE,gBAAAC,EAACM,GAAA,EAAe,iBAAiB,MAAM,gBAAAN,EAAC7B,GAAA,EAAe,MAAK,MAAK,GAC/D,UAAA,gBAAA6B,EAACD,GAAA,EAAO,SAAST,GAAa,GAChC;AAAA,YAIH,UAAAQ,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC,EAAA,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useCallback, useMemo, useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { Flex } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\ninterface SubmissionAlert {\n id: number\n}\n\ninterface SubmissionAlertState {\n nextAlertId: number\n alerts: SubmissionAlert[]\n}\n\nexport interface InformationRequestsFlowProps extends Omit<\n BaseComponentInterface<'InformationRequests'>,\n 'onEvent'\n> {\n companyId: string\n /**\n * When true (default), the submission success alert is rendered at the top of this component.\n * Set to false when embedding in a parent (e.g. PayrollBlockerList) that renders the alert elsewhere.\n */\n withAlert?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nconst ALERT_TYPE = 'informationRequestResponded' as const\n\nexport function InformationRequestsFlow({\n companyId,\n dictionary,\n withAlert = true,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n useComponentDictionary('InformationRequests', dictionary)\n useI18n('InformationRequests')\n const { t } = useTranslation('InformationRequests')\n const { Modal, LoadingSpinner, Alert, Text } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const [alertState, setAlertState] = useState<SubmissionAlertState>({\n nextAlertId: 0,\n alerts: [],\n })\n\n const handleDismissAlert = useCallback((alertId: number) => {\n setAlertState(prev => ({\n ...prev,\n alerts: prev.alerts.filter(alert => alert.id !== alertId),\n }))\n }, [])\n\n const addSubmissionAlert = useCallback(() => {\n setAlertState(prev => ({\n nextAlertId: prev.nextAlertId + 1,\n alerts: [{ id: prev.nextAlertId }, ...prev.alerts],\n }))\n }, [])\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE && withAlert) {\n addSubmissionAlert()\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {withAlert &&\n alertState.alerts.map(alert => (\n <Alert\n key={alert.id}\n status=\"success\"\n label={t(`alerts.${ALERT_TYPE}.title`)}\n onDismiss={() => {\n handleDismissAlert(alert.id)\n }}\n >\n <Text>{t(`alerts.${ALERT_TYPE}.description`)}</Text>\n </Alert>\n ))}\n\n <Suspense fallback={<LoadingSpinner />}>\n <InformationRequestList companyId={companyId} onEvent={handleEvent} />\n </Suspense>\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries>\n <Suspense fallback={<LoadingSpinner size=\"sm\" />}>\n <Footer onEvent={handleEvent} />\n </Suspense>\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </Flex>\n </FlowContext.Provider>\n )\n}\n"],"names":["ALERT_TYPE","InformationRequestsFlow","companyId","dictionary","withAlert","onEvent","useComponentDictionary","useI18n","t","useTranslation","Modal","LoadingSpinner","Alert","Text","useComponentContext","isModalOpen","setIsModalOpen","useState","alertState","setAlertState","handleDismissAlert","useCallback","alertId","prev","alert","addSubmissionAlert","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsx","FlowContext","jsxs","Flex","Suspense","InformationRequestList","BaseBoundaries"],"mappings":";;;;;;;;;;;;;;;AAoCA,MAAMA,IAAa;AAEZ,SAASC,GAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC,IAAU,MAAM;AAAA,EAAC;AACnB,GAAiC;AAC/B,EAAAC,EAAuB,uBAAuBH,CAAU,GACxDI,EAAQ,qBAA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}
@@ -1,84 +1,84 @@
1
- import { jsx as o, jsxs as M } from "react/jsx-runtime";
2
- import { createMachine as S } from "robot3";
1
+ import { jsx as e, jsxs as S } from "react/jsx-runtime";
2
+ import { createMachine as M } from "robot3";
3
3
  import { useMachine as T } from "react-robot";
4
- import { useState as v, useRef as x, useMemo as d } from "react";
5
- import { useWireInRequestsListSuspense as N } from "@gusto/embedded-api/react-query/wireInRequestsList";
6
- import { confirmWireDetailsMachine as F } from "./confirmWireDetailsStateMachine.js";
7
- import D from "./ConfirmWireDetails.module.scss.js";
8
- import { BaseComponent as P, BaseBoundaries as Y } from "../../Base/Base.js";
4
+ import { useState as v, useRef as x, useMemo as d, Suspense as N } from "react";
5
+ import { useWireInRequestsListSuspense as F } from "@gusto/embedded-api/react-query/wireInRequestsList";
6
+ import { confirmWireDetailsMachine as D } from "./confirmWireDetailsStateMachine.js";
7
+ import P from "./ConfirmWireDetails.module.scss.js";
8
+ import { BaseComponent as Y, BaseBoundaries as q } from "../../Base/Base.js";
9
9
  import "../../Base/useBase.js";
10
- import { useComponentContext as q } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
- import { FlowContext as B } from "../../Flow/useFlow.js";
10
+ import { useComponentContext as B } from "../../../contexts/ComponentAdapter/useComponentContext.js";
11
+ import { FlowContext as b } from "../../Flow/useFlow.js";
12
12
  import { payrollWireEvents as r } from "../../../shared/constants.js";
13
13
  import { ConfirmWireDetailsBanner as g } from "./ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js";
14
- function $({
14
+ function w({
15
15
  onEvent: t = () => {
16
16
  },
17
- ...e
17
+ ...o
18
18
  }) {
19
- return /* @__PURE__ */ o(P, { ...e, onEvent: t, children: /* @__PURE__ */ o(j, { ...e, onEvent: t }) });
19
+ return /* @__PURE__ */ e(Y, { ...o, onEvent: t, children: /* @__PURE__ */ e(j, { ...o, onEvent: t }) });
20
20
  }
21
- function j({ companyId: t, wireInId: e, onEvent: c = () => {
21
+ function j({ companyId: t, wireInId: o, onEvent: l = () => {
22
22
  } }) {
23
- const { Modal: p, LoadingSpinner: C } = q(), [L, s] = v(!1), l = x(null), { data: _ } = N({
23
+ const { Modal: p, LoadingSpinner: C } = B(), [_, s] = v(!1), m = x(null), { data: L } = F({
24
24
  companyUuid: t
25
- }), f = (_.wireInRequestList || []).filter(
25
+ }), f = (L.wireInRequestList || []).filter(
26
26
  (n) => n.status === "awaiting_funds"
27
- ), W = d(() => e || f[0]?.uuid, [e, f[0]?.uuid]), A = d(
28
- () => S(
27
+ ), W = d(() => o || f[0]?.uuid, [o, f[0]?.uuid]), h = d(
28
+ () => M(
29
29
  "banner",
30
- F,
30
+ D,
31
31
  () => ({
32
32
  component: null,
33
33
  companyId: t,
34
- wireInId: e,
34
+ wireInId: o,
35
35
  selectedWireInId: W,
36
36
  onEvent: i,
37
- modalContainerRef: l
37
+ modalContainerRef: m
38
38
  })
39
39
  ),
40
- [t, e]
41
- ), [a, E] = T(A);
40
+ [t, o]
41
+ ), [a, A] = T(h);
42
42
  function i(n, R) {
43
- E({ type: n, payload: R }), n === r.PAYROLL_WIRE_START_TRANSFER && s(!0), (n === r.PAYROLL_WIRE_INSTRUCTIONS_CANCEL || n === r.PAYROLL_WIRE_FORM_CANCEL || n === r.PAYROLL_WIRE_FORM_DONE) && s(!1), c(n, R);
43
+ A({ type: n, payload: R }), n === r.PAYROLL_WIRE_START_TRANSFER && s(!0), (n === r.PAYROLL_WIRE_INSTRUCTIONS_CANCEL || n === r.PAYROLL_WIRE_FORM_CANCEL || n === r.PAYROLL_WIRE_FORM_DONE) && s(!1), l(n, R);
44
44
  }
45
- const h = () => {
45
+ const E = () => {
46
46
  i(r.PAYROLL_WIRE_START_TRANSFER);
47
47
  }, O = () => {
48
48
  s(!1);
49
- }, m = a.context.component, u = m?.Footer || void 0;
50
- return /* @__PURE__ */ M(
51
- B.Provider,
49
+ }, c = a.context.component, u = c?.Footer || void 0;
50
+ return /* @__PURE__ */ S(
51
+ b.Provider,
52
52
  {
53
53
  value: {
54
54
  ...a.context,
55
55
  onEvent: i
56
56
  },
57
57
  children: [
58
- /* @__PURE__ */ o(
58
+ /* @__PURE__ */ e(
59
59
  g,
60
60
  {
61
61
  companyId: t,
62
- wireInId: e,
63
- onStartWireTransfer: h,
64
- onEvent: c,
62
+ wireInId: o,
63
+ onStartWireTransfer: E,
64
+ onEvent: l,
65
65
  confirmationAlert: a.context.confirmationAlert
66
66
  }
67
67
  ),
68
- /* @__PURE__ */ o(
68
+ /* @__PURE__ */ e(
69
69
  p,
70
70
  {
71
- isOpen: L,
71
+ isOpen: _,
72
72
  onClose: O,
73
- containerRef: l,
74
- footer: u && /* @__PURE__ */ o(
75
- Y,
73
+ containerRef: m,
74
+ footer: u && /* @__PURE__ */ e(q, { children: /* @__PURE__ */ e(
75
+ N,
76
76
  {
77
- LoaderComponent: () => /* @__PURE__ */ o("div", { className: D.footer, children: /* @__PURE__ */ o(C, { size: "sm" }) }),
78
- children: /* @__PURE__ */ o(u, { onEvent: i })
77
+ fallback: /* @__PURE__ */ e("div", { className: P.footer, children: /* @__PURE__ */ e(C, { size: "sm" }) }),
78
+ children: /* @__PURE__ */ e(u, { onEvent: i })
79
79
  }
80
- ),
81
- children: m && /* @__PURE__ */ o(m, {})
80
+ ) }),
81
+ children: c && /* @__PURE__ */ e(c, {})
82
82
  }
83
83
  )
84
84
  ]
@@ -86,6 +86,6 @@ function j({ companyId: t, wireInId: e, onEvent: c = () => {
86
86
  );
87
87
  }
88
88
  export {
89
- $ as ConfirmWireDetails
89
+ w as ConfirmWireDetails
90
90
  };
91
91
  //# sourceMappingURL=ConfirmWireDetails.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmWireDetails.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useRef, useState } from 'react'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { ConfirmWireDetailsBanner } from './ConfirmWireDetailsBanner'\nimport { confirmWireDetailsMachine } from './confirmWireDetailsStateMachine'\nimport { type ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport type { ConfirmWireDetailsProps } from './types'\nexport type { ConfirmWireDetailsComponentType } from './types'\nimport styles from './ConfirmWireDetails.module.scss'\nimport { BaseComponent, BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\n\ninterface ConfirmWireDetailsInternalProps\n extends Omit<BaseComponentInterface, 'onEvent'>, ConfirmWireDetailsProps {}\n\nexport function ConfirmWireDetails({\n onEvent = () => {},\n ...props\n}: ConfirmWireDetailsInternalProps) {\n return (\n <BaseComponent {...props} onEvent={onEvent}>\n <Root {...props} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, wireInId, onEvent = () => {} }: ConfirmWireDetailsInternalProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const selectedWireInId = useMemo(() => {\n if (wireInId) {\n return wireInId\n }\n\n return activeWireInRequests[0]?.uuid\n }, [wireInId, activeWireInRequests[0]?.uuid])\n\n const confirmWireDetailsMachineInstance = useMemo(\n () =>\n createMachine(\n 'banner',\n confirmWireDetailsMachine,\n (): ConfirmWireDetailsContextInterface => ({\n component: null,\n companyId,\n wireInId,\n selectedWireInId,\n onEvent: handleEvent,\n modalContainerRef,\n }),\n ),\n [companyId, wireInId],\n )\n const [current, send] = useMachine(confirmWireDetailsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === payrollWireEvents.PAYROLL_WIRE_START_TRANSFER) {\n setIsModalOpen(true)\n }\n\n if (\n type === payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleStartWireTransfer = () => {\n handleEvent(payrollWireEvents.PAYROLL_WIRE_START_TRANSFER)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <ConfirmWireDetailsBanner\n companyId={companyId}\n wireInId={wireInId}\n onStartWireTransfer={handleStartWireTransfer}\n onEvent={onEvent}\n confirmationAlert={current.context.confirmationAlert}\n />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n containerRef={modalContainerRef}\n footer={\n Footer && (\n <BaseBoundaries\n LoaderComponent={() => (\n <div className={styles.footer}>\n <LoadingSpinner size=\"sm\" />\n </div>\n )}\n >\n <Footer onEvent={handleEvent} />\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["ConfirmWireDetails","onEvent","props","jsx","BaseComponent","Root","companyId","wireInId","Modal","LoadingSpinner","useComponentContext","isModalOpen","setIsModalOpen","useState","modalContainerRef","useRef","wireInRequestsData","useWireInRequestsListSuspense","activeWireInRequests","r","selectedWireInId","useMemo","confirmWireDetailsMachineInstance","createMachine","confirmWireDetailsMachine","handleEvent","current","send","useMachine","type","data","payrollWireEvents","handleStartWireTransfer","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","ConfirmWireDetailsBanner","BaseBoundaries","styles"],"mappings":";;;;;;;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F,MAASE,EAAkB,2BAE3BnB,EAAe,EAAK,GAGtBX,EAAQ4B,GAAMC,CAAI;AAAA,EACpB;AAEA,QAAME,IAA0B,MAAM;AACpC,IAAAP,EAAYM,EAAkB,2BAA2B;AAAA,EAC3D,GAEME,IAAmB,MAAM;AAC7B,IAAArB,EAAe,EAAK;AAAA,EACtB,GAEMsB,IAAmBR,EAAQ,QAAQ,WACnCS,IAASD,GAAkB,UAAU;AAE3C,SACE,gBAAAE;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAGX,EAAQ;AAAA,QACX,SAASD;AAAA,MAAA;AAAA,MAGX,UAAA;AAAA,QAAA,gBAAAtB;AAAA,UAACmC;AAAA,UAAA;AAAA,YACC,WAAAhC;AAAA,YACA,UAAAC;AAAA,YACA,qBAAqByB;AAAA,YACrB,SAAA/B;AAAA,YACA,mBAAmByB,EAAQ,QAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,QAErC,gBAAAvB;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,QAAQG;AAAA,YACR,SAASsB;AAAA,YACT,cAAcnB;AAAA,YACd,QACEqB,KACE,gBAAAhC;AAAA,cAACoC;AAAA,cAAA;AAAA,gBACC,iBAAiB,MACf,gBAAApC,EAAC,OAAA,EAAI,WAAWqC,EAAO,QACrB,UAAA,gBAAArC,EAACM,GAAA,EAAe,MAAK,KAAA,CAAK,EAAA,CAC5B;AAAA,gBAGF,UAAA,gBAAAN,EAACgC,GAAA,EAAO,SAASV,EAAA,CAAa;AAAA,cAAA;AAAA,YAAA;AAAA,YAKnC,UAAAS,uBAAqBA,GAAA,CAAA,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"ConfirmWireDetails.js","sources":["../../../../src/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { Suspense, useMemo, useRef, useState } from 'react'\nimport { useWireInRequestsListSuspense } from '@gusto/embedded-api/react-query/wireInRequestsList'\nimport { ConfirmWireDetailsBanner } from './ConfirmWireDetailsBanner'\nimport { confirmWireDetailsMachine } from './confirmWireDetailsStateMachine'\nimport { type ConfirmWireDetailsContextInterface } from './ConfirmWireDetailsComponents'\nimport type { ConfirmWireDetailsProps } from './types'\nexport type { ConfirmWireDetailsComponentType } from './types'\nimport styles from './ConfirmWireDetails.module.scss'\nimport { BaseComponent, BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { payrollWireEvents, type EventType } from '@/shared/constants'\n\ninterface ConfirmWireDetailsInternalProps\n extends Omit<BaseComponentInterface, 'onEvent'>, ConfirmWireDetailsProps {}\n\nexport function ConfirmWireDetails({\n onEvent = () => {},\n ...props\n}: ConfirmWireDetailsInternalProps) {\n return (\n <BaseComponent {...props} onEvent={onEvent}>\n <Root {...props} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, wireInId, onEvent = () => {} }: ConfirmWireDetailsInternalProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n const modalContainerRef = useRef<HTMLDivElement>(null)\n\n const { data: wireInRequestsData } = useWireInRequestsListSuspense({\n companyUuid: companyId,\n })\n\n const activeWireInRequests = (wireInRequestsData.wireInRequestList || []).filter(\n r => r.status === 'awaiting_funds',\n )\n\n const selectedWireInId = useMemo(() => {\n if (wireInId) {\n return wireInId\n }\n\n return activeWireInRequests[0]?.uuid\n }, [wireInId, activeWireInRequests[0]?.uuid])\n\n const confirmWireDetailsMachineInstance = useMemo(\n () =>\n createMachine(\n 'banner',\n confirmWireDetailsMachine,\n (): ConfirmWireDetailsContextInterface => ({\n component: null,\n companyId,\n wireInId,\n selectedWireInId,\n onEvent: handleEvent,\n modalContainerRef,\n }),\n ),\n [companyId, wireInId],\n )\n const [current, send] = useMachine(confirmWireDetailsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === payrollWireEvents.PAYROLL_WIRE_START_TRANSFER) {\n setIsModalOpen(true)\n }\n\n if (\n type === payrollWireEvents.PAYROLL_WIRE_INSTRUCTIONS_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_CANCEL ||\n type === payrollWireEvents.PAYROLL_WIRE_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleStartWireTransfer = () => {\n handleEvent(payrollWireEvents.PAYROLL_WIRE_START_TRANSFER)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <ConfirmWireDetailsBanner\n companyId={companyId}\n wireInId={wireInId}\n onStartWireTransfer={handleStartWireTransfer}\n onEvent={onEvent}\n confirmationAlert={current.context.confirmationAlert}\n />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n containerRef={modalContainerRef}\n footer={\n Footer && (\n <BaseBoundaries>\n <Suspense\n fallback={\n <div className={styles.footer}>\n <LoadingSpinner size=\"sm\" />\n </div>\n }\n >\n <Footer onEvent={handleEvent} />\n </Suspense>\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["ConfirmWireDetails","onEvent","props","jsx","BaseComponent","Root","companyId","wireInId","Modal","LoadingSpinner","useComponentContext","isModalOpen","setIsModalOpen","useState","modalContainerRef","useRef","wireInRequestsData","useWireInRequestsListSuspense","activeWireInRequests","r","selectedWireInId","useMemo","confirmWireDetailsMachineInstance","createMachine","confirmWireDetailsMachine","handleEvent","current","send","useMachine","type","data","payrollWireEvents","handleStartWireTransfer","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","ConfirmWireDetailsBanner","BaseBoundaries","Suspense","styles"],"mappings":";;;;;;;;;;;;;AAkBO,SAASA,EAAmB;AAAA,EACjC,SAAAC,IAAU,MAAM;AAAA,EAAC;AAAA,EACjB,GAAGC;AACL,GAAoC;AAClC,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GAAO,SAAAD,GACxB,4BAACI,GAAA,EAAM,GAAGH,GAAO,SAAAD,EAAA,CAAkB,EAAA,CACrC;AAEJ;AAEA,SAASI,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,SAAAN,IAAU,MAAM;AAAC,KAAsC;AAC1F,QAAM,EAAE,OAAAO,GAAO,gBAAAC,EAAA,IAAmBC,EAAA,GAC5B,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9CC,IAAoBC,EAAuB,IAAI,GAE/C,EAAE,MAAMC,EAAA,IAAuBC,EAA8B;AAAA,IACjE,aAAaX;AAAA,EAAA,CACd,GAEKY,KAAwBF,EAAmB,qBAAqB,CAAA,GAAI;AAAA,IACxE,CAAAG,MAAKA,EAAE,WAAW;AAAA,EAAA,GAGdC,IAAmBC,EAAQ,MAC3Bd,KAIGW,EAAqB,CAAC,GAAG,MAC/B,CAACX,GAAUW,EAAqB,CAAC,GAAG,IAAI,CAAC,GAEtCI,IAAoCD;AAAA,IACxC,MACEE;AAAA,MACE;AAAA,MACAC;AAAA,MACA,OAA2C;AAAA,QACzC,WAAW;AAAA,QACX,WAAAlB;AAAA,QACA,UAAAC;AAAA,QACA,kBAAAa;AAAA,QACA,SAASK;AAAA,QACT,mBAAAX;AAAA,MAAA;AAAA,IACF;AAAA,IAEJ,CAACR,GAAWC,CAAQ;AAAA,EAAA,GAEhB,CAACmB,GAASC,CAAI,IAAIC,EAAWN,CAAiC;AAEpE,WAASG,EAAYI,GAAiBC,GAAgB;AACpD,IAAAH,EAAK,EAAE,MAAAE,GAAM,SAASC,EA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}
@@ -0,0 +1,2 @@
1
+ import { DismissalFlowProps } from './DismissalFlowComponents';
2
+ export declare function DismissalFlow({ companyId, employeeId, onEvent, payrollId }: DismissalFlowProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useMemo as l } from "react";
3
+ import { createMachine as u } from "robot3";
4
+ import { dismissalMachine as d, dismissalBreadcrumbsNodes as p } from "./dismissalStateMachine.js";
5
+ import { DismissalExecutionContextual as f, DismissalPayPeriodSelectionContextual as b } from "./DismissalFlowComponents.js";
6
+ import { Flow as h } from "../../Flow/Flow.js";
7
+ import { BaseComponent as x } from "../../Base/Base.js";
8
+ import { buildBreadcrumbs as B } from "../../../helpers/breadcrumbHelpers.js";
9
+ function g({ companyId: r, employeeId: e, onEvent: s, payrollId: i }) {
10
+ const m = l(() => {
11
+ const o = !!i, n = o ? "execution" : "payPeriodSelection", a = o ? f : b;
12
+ return u(
13
+ n,
14
+ d,
15
+ (c) => ({
16
+ ...c,
17
+ component: a,
18
+ companyId: r,
19
+ employeeId: e,
20
+ payrollUuid: i,
21
+ breadcrumbs: B(p),
22
+ currentBreadcrumbId: o ? void 0 : "payPeriodSelection",
23
+ progressBarType: o ? null : "breadcrumbs"
24
+ })
25
+ );
26
+ }, [r, e, i]);
27
+ return /* @__PURE__ */ t(x, { onEvent: s, children: /* @__PURE__ */ t(h, { machine: m, onEvent: s }) });
28
+ }
29
+ export {
30
+ g as DismissalFlow
31
+ };
32
+ //# sourceMappingURL=DismissalFlow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DismissalFlow.js","sources":["../../../../src/components/Payroll/Dismissal/DismissalFlow.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { createMachine } from 'robot3'\nimport { dismissalMachine, dismissalBreadcrumbsNodes } from './dismissalStateMachine'\nimport {\n DismissalPayPeriodSelectionContextual,\n DismissalExecutionContextual,\n type DismissalFlowContextInterface,\n type DismissalFlowProps,\n} from './DismissalFlowComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { buildBreadcrumbs } from '@/helpers/breadcrumbHelpers'\n\nexport function DismissalFlow({ companyId, employeeId, onEvent, payrollId }: DismissalFlowProps) {\n const dismissalFlowMachine = useMemo(() => {\n const hasPayroll = Boolean(payrollId)\n const initialState = hasPayroll ? 'execution' : 'payPeriodSelection'\n const initialComponent = hasPayroll\n ? DismissalExecutionContextual\n : DismissalPayPeriodSelectionContextual\n\n return createMachine(\n initialState,\n dismissalMachine,\n (initialContext: DismissalFlowContextInterface) => ({\n ...initialContext,\n component: initialComponent,\n companyId,\n employeeId,\n payrollUuid: payrollId,\n breadcrumbs: buildBreadcrumbs(dismissalBreadcrumbsNodes),\n currentBreadcrumbId: hasPayroll ? undefined : 'payPeriodSelection',\n progressBarType: hasPayroll ? null : ('breadcrumbs' as const),\n }),\n )\n }, [companyId, employeeId, payrollId])\n\n return (\n <BaseComponent onEvent={onEvent}>\n <Flow machine={dismissalFlowMachine} onEvent={onEvent} />\n </BaseComponent>\n )\n}\n"],"names":["DismissalFlow","companyId","employeeId","onEvent","payrollId","dismissalFlowMachine","useMemo","hasPayroll","initialState","initialComponent","DismissalExecutionContextual","DismissalPayPeriodSelectionContextual","createMachine","dismissalMachine","initialContext","buildBreadcrumbs","dismissalBreadcrumbsNodes","jsx","BaseComponent","Flow"],"mappings":";;;;;;;;AAaO,SAASA,EAAc,EAAE,WAAAC,GAAW,YAAAC,GAAY,SAAAC,GAAS,WAAAC,KAAiC;AAC/F,QAAMC,IAAuBC,EAAQ,MAAM;AACzC,UAAMC,IAAa,EAAQH,GACrBI,IAAeD,IAAa,cAAc,sBAC1CE,IAAmBF,IACrBG,IACAC;AAEJ,WAAOC;AAAA,MACLJ;AAAA,MACAK;AAAA,MACA,CAACC,OAAmD;AAAA,QAClD,GAAGA;AAAA,QACH,WAAWL;AAAA,QACX,WAAAR;AAAA,QACA,YAAAC;AAAA,QACA,aAAaE;AAAA,QACb,aAAaW,EAAiBC,CAAyB;AAAA,QACvD,qBAAqBT,IAAa,SAAY;AAAA,QAC9C,iBAAiBA,IAAa,OAAQ;AAAA,MAAA;AAAA,IACxC;AAAA,EAEJ,GAAG,CAACN,GAAWC,GAAYE,CAAS,CAAC;AAErC,SACE,gBAAAa,EAACC,KAAc,SAAAf,GACb,UAAA,gBAAAc,EAACE,KAAK,SAASd,GAAsB,SAAAF,GAAkB,EAAA,CACzD;AAEJ;"}
@@ -0,0 +1,16 @@
1
+ import { FlowContextInterface } from '../../Flow/useFlow';
2
+ import { OnEventType } from '../../Base/useBase';
3
+ import { EventType } from '../../../shared/constants';
4
+ export interface DismissalFlowContextInterface extends FlowContextInterface {
5
+ companyId: string;
6
+ employeeId: string;
7
+ payrollUuid?: string;
8
+ }
9
+ export interface DismissalFlowProps {
10
+ companyId: string;
11
+ employeeId: string;
12
+ onEvent: OnEventType<EventType, unknown>;
13
+ payrollId?: string;
14
+ }
15
+ export declare function DismissalPayPeriodSelectionContextual(): import("react/jsx-runtime").JSX.Element;
16
+ export declare function DismissalExecutionContextual(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,52 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { useMemo as d } from "react";
3
+ import { usePayrollsGetSuspense as p } from "@gusto/embedded-api/react-query/payrollsGet";
4
+ import { PayrollExecutionFlow as u } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
5
+ import { DismissalPayPeriodSelection as y } from "./DismissalPayPeriodSelection/DismissalPayPeriodSelection.js";
6
+ import { useFlow as m } from "../../Flow/useFlow.js";
7
+ import { ensureRequired as n } from "../../../helpers/ensureRequired.js";
8
+ import { BaseComponent as f } from "../../Base/Base.js";
9
+ function h() {
10
+ const { companyId: o, employeeId: e, onEvent: r } = m();
11
+ return /* @__PURE__ */ i(
12
+ y,
13
+ {
14
+ companyId: n(o),
15
+ employeeId: n(e),
16
+ onEvent: r
17
+ }
18
+ );
19
+ }
20
+ function w() {
21
+ const { companyId: o, payrollUuid: e, onEvent: r, breadcrumbs: s } = m(), t = s?.payPeriodSelection?.[0], a = d(() => t ? [t] : void 0, [t]), l = n(o), c = n(e);
22
+ return /* @__PURE__ */ i(f, { onEvent: r, children: /* @__PURE__ */ i(
23
+ P,
24
+ {
25
+ companyId: l,
26
+ payrollId: c,
27
+ onEvent: r,
28
+ prefixBreadcrumbs: a
29
+ }
30
+ ) });
31
+ }
32
+ function P({
33
+ companyId: o,
34
+ payrollId: e,
35
+ ...r
36
+ }) {
37
+ const { data: s } = p({ companyId: o, payrollId: e }), t = s.payrollShow?.payPeriod;
38
+ return /* @__PURE__ */ i(
39
+ u,
40
+ {
41
+ companyId: o,
42
+ payrollId: e,
43
+ initialPayPeriod: t,
44
+ ...r
45
+ }
46
+ );
47
+ }
48
+ export {
49
+ w as DismissalExecutionContextual,
50
+ h as DismissalPayPeriodSelectionContextual
51
+ };
52
+ //# sourceMappingURL=DismissalFlowComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DismissalFlowComponents.js","sources":["../../../../src/components/Payroll/Dismissal/DismissalFlowComponents.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport { DismissalPayPeriodSelection } from './DismissalPayPeriodSelection/DismissalPayPeriodSelection'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { BaseComponent } from '@/components/Base/Base'\n\nexport interface DismissalFlowContextInterface extends FlowContextInterface {\n companyId: string\n employeeId: string\n payrollUuid?: string\n}\n\nexport interface DismissalFlowProps {\n companyId: string\n employeeId: string\n onEvent: OnEventType<EventType, unknown>\n payrollId?: string\n}\n\nexport function DismissalPayPeriodSelectionContextual() {\n const { companyId, employeeId, onEvent } = useFlow<DismissalFlowContextInterface>()\n return (\n <DismissalPayPeriodSelection\n companyId={ensureRequired(companyId)}\n employeeId={ensureRequired(employeeId)}\n onEvent={onEvent}\n />\n )\n}\n\nexport function DismissalExecutionContextual() {\n const { companyId, payrollUuid, onEvent, breadcrumbs } = useFlow<DismissalFlowContextInterface>()\n\n const payPeriodSelectionBreadcrumb = breadcrumbs?.['payPeriodSelection']?.[0]\n const prefixBreadcrumbs = useMemo(() => {\n return payPeriodSelectionBreadcrumb ? [payPeriodSelectionBreadcrumb] : undefined\n }, [payPeriodSelectionBreadcrumb])\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <BaseComponent onEvent={onEvent}>\n <DismissalExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </BaseComponent>\n )\n}\n\ntype DismissalExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs'\n>\n\nfunction DismissalExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: DismissalExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n {...rest}\n />\n )\n}\n"],"names":["DismissalPayPeriodSelectionContextual","companyId","employeeId","onEvent","useFlow","jsx","DismissalPayPeriodSelection","ensureRequired","DismissalExecutionContextual","payrollUuid","breadcrumbs","payPeriodSelectionBreadcrumb","prefixBreadcrumbs","useMemo","resolvedCompanyId","resolvedPayrollId","BaseComponent","DismissalExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow"],"mappings":";;;;;;;;AA0BO,SAASA,IAAwC;AACtD,QAAM,EAAE,WAAAC,GAAW,YAAAC,GAAY,SAAAC,EAAA,IAAYC,EAAA;AAC3C,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeN,CAAS;AAAA,MACnC,YAAYM,EAAeL,CAAU;AAAA,MACrC,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEO,SAASK,IAA+B;AAC7C,QAAM,EAAE,WAAAP,GAAW,aAAAQ,GAAa,SAAAN,GAAS,aAAAO,EAAA,IAAgBN,EAAA,GAEnDO,IAA+BD,GAAc,qBAAwB,CAAC,GACtEE,IAAoBC,EAAQ,MACzBF,IAA+B,CAACA,CAA4B,IAAI,QACtE,CAACA,CAA4B,CAAC,GAE3BG,IAAoBP,EAAeN,CAAS,GAC5Cc,IAAoBR,EAAeE,CAAW;AAEpD,SACE,gBAAAJ,EAACW,KAAc,SAAAb,GACb,UAAA,gBAAAE;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,MACX,WAAWC;AAAA,MACX,SAAAZ;AAAA,MACA,mBAAAS;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASK,EAA2B;AAAA,EAClC,WAAAhB;AAAA,EACA,WAAAiB;AAAA,EACA,GAAGC;AACL,GAAoC;AAClC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAApB,GAAW,WAAAiB,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAf;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,WAAAtB;AAAA,MACA,WAAAiB;AAAA,MACA,kBAAAI;AAAA,MACC,GAAGH;AAAA,IAAA;AAAA,EAAA;AAGV;"}
@@ -0,0 +1,6 @@
1
+ import { BaseComponentInterface } from '../../../Base/Base';
2
+ export interface DismissalPayPeriodSelectionProps extends BaseComponentInterface<'Payroll.Dismissal'> {
3
+ companyId: string;
4
+ employeeId: string;
5
+ }
6
+ export declare function DismissalPayPeriodSelection(props: DismissalPayPeriodSelectionProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,69 @@
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { useMemo as f, useState as _ } from "react";
3
+ import { usePaySchedulesGetUnprocessedTerminationPeriodsSuspense as B } from "@gusto/embedded-api/react-query/paySchedulesGetUnprocessedTerminationPeriods";
4
+ import { usePayrollsCreateOffCycleMutation as v } from "@gusto/embedded-api/react-query/payrollsCreateOffCycle";
5
+ import { OffCycleReason as R } from "@gusto/embedded-api/models/operations/postv1companiescompanyidpayrolls";
6
+ import { RFCDate as s } from "@gusto/embedded-api/types/rfcdate";
7
+ import { useTranslation as b } from "react-i18next";
8
+ import { DismissalPayPeriodSelectionPresentation as A } from "./DismissalPayPeriodSelectionPresentation.js";
9
+ import { BaseComponent as g } from "../../../Base/Base.js";
10
+ import { useBase as I } from "../../../Base/useBase.js";
11
+ import { componentEvents as O } from "../../../../shared/constants.js";
12
+ import { SDKInternalError as c } from "../../../../types/sdkError.js";
13
+ import { useComponentDictionary as T, useI18n as K } from "../../../../i18n/I18n.js";
14
+ import { formatPayPeriodRange as L, addBusinessDays as M } from "../../../../helpers/dateFormatting.js";
15
+ import { ACH_LEAD_TIME_BUSINESS_DAYS as $ } from "../../OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js";
16
+ function oe(t) {
17
+ return /* @__PURE__ */ d(g, { ...t, children: /* @__PURE__ */ d(k, { ...t }) });
18
+ }
19
+ const P = (t) => `${t.startDate}__${t.endDate}`;
20
+ function k({ companyId: t, employeeId: a, dictionary: p }) {
21
+ T("Payroll.Dismissal", p), K("Payroll.Dismissal");
22
+ const { t: i } = b("Payroll.Dismissal"), { onEvent: D, baseSubmitHandler: S } = I(), { data: y } = B({ companyId: t }), { mutateAsync: w, isPending: h } = v(), l = f(() => (y.unprocessedTerminationPayPeriodList ?? []).filter((o) => o.employeeUuid === a).filter(
23
+ (o) => !!o.startDate && !!o.endDate && !!o.employeeUuid
24
+ ), [y, a]), m = f(() => l.map((e) => {
25
+ const o = L(e.startDate, e.endDate), n = e.employeeName ? `${o} (${e.employeeName})` : o;
26
+ return {
27
+ value: P(e),
28
+ label: n
29
+ };
30
+ }), [l]), C = m.length === 1 ? m[0].value : void 0, [r, E] = _(C);
31
+ return /* @__PURE__ */ d(
32
+ A,
33
+ {
34
+ payPeriodOptions: m,
35
+ selectedPeriodKey: r,
36
+ onSelectPeriod: E,
37
+ onSubmit: async () => {
38
+ await S({ selectedPeriodKey: r }, async () => {
39
+ if (r === void 0)
40
+ throw new c(i("errors.noPayPeriodSelected"));
41
+ const e = l.find((U) => P(U) === r);
42
+ if (!e)
43
+ throw new c(i("errors.invalidPayPeriod"));
44
+ const o = e.checkDate ? new s(e.checkDate) : new s(M(/* @__PURE__ */ new Date(), $)), n = await w({
45
+ request: {
46
+ companyId: t,
47
+ requestBody: {
48
+ offCycle: !0,
49
+ offCycleReason: R.DismissedEmployee,
50
+ startDate: new s(e.startDate),
51
+ endDate: new s(e.endDate),
52
+ employeeUuids: [a],
53
+ checkDate: o
54
+ }
55
+ }
56
+ }), u = n.payrollUnprocessed?.payrollUuid ?? n.payrollUnprocessed?.uuid;
57
+ if (!u)
58
+ throw new c(i("errors.missingPayrollId"));
59
+ D(O.DISMISSAL_PAY_PERIOD_SELECTED, { payrollUuid: u });
60
+ });
61
+ },
62
+ isPending: h
63
+ }
64
+ );
65
+ }
66
+ export {
67
+ oe as DismissalPayPeriodSelection
68
+ };
69
+ //# sourceMappingURL=DismissalPayPeriodSelection.js.map