@remoteoss/remote-flows 0.22.0 → 0.23.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 (298) hide show
  1. package/README.md +1 -1
  2. package/dist/{utils-CjDMg_Yr.d.ts → ZendeskTriggerButton-FSCvhzTG.d.ts} +10 -1
  3. package/dist/{chunk-X5DMQNEM.js → chunk-2DSNHYHZ.js} +2 -2
  4. package/dist/{chunk-5QP2BAUT.js → chunk-2T2N5226.js} +2 -2
  5. package/dist/chunk-2UAG6WDW.js +2 -0
  6. package/dist/{chunk-WEYUB6DC.js → chunk-3W7RKLJX.js} +2 -2
  7. package/dist/{chunk-KJSZIASL.js → chunk-3XDJ2LRT.js} +2 -2
  8. package/dist/{chunk-K4NAASBM.js → chunk-4HT7RNFP.js} +2 -2
  9. package/dist/{chunk-2WDEVWIE.js → chunk-4NAVUB7D.js} +2 -2
  10. package/dist/{chunk-QU3NSFU5.js → chunk-4SIGN3ZP.js} +2 -2
  11. package/dist/chunk-4T6PRR6R.js +2 -0
  12. package/dist/{chunk-DKA2EUPQ.js.map → chunk-4T6PRR6R.js.map} +1 -1
  13. package/dist/{chunk-QP36XXCQ.js → chunk-5A54AHAT.js} +2 -2
  14. package/dist/{chunk-22JS3T6G.js → chunk-5H5INKOY.js} +2 -2
  15. package/dist/{chunk-C4AVUIG2.js → chunk-5ZR7EFPY.js} +2 -2
  16. package/dist/{chunk-JG7FV7OZ.js → chunk-64NSBY5G.js} +2 -2
  17. package/dist/{chunk-5N4L2G7Q.js → chunk-6VRUYYUV.js} +2 -2
  18. package/dist/{chunk-3I6ONATN.js → chunk-7IZGKQII.js} +2 -2
  19. package/dist/{chunk-EIVHHLR5.js → chunk-A7T27JCJ.js} +2 -2
  20. package/dist/{chunk-CELNQ7KS.js → chunk-AHBACWMD.js} +2 -2
  21. package/dist/{chunk-C4SMHWP4.js → chunk-ANGJCT4I.js} +2 -2
  22. package/dist/{chunk-XICA45G2.js → chunk-B7I7YVNK.js} +2 -2
  23. package/dist/{chunk-DHJZVBVD.js → chunk-BNHN4CEM.js} +2 -2
  24. package/dist/chunk-CGUTMSAU.js +2 -0
  25. package/dist/chunk-CGUTMSAU.js.map +1 -0
  26. package/dist/{chunk-5SKMAYLG.js → chunk-CRHH6IPF.js} +2 -2
  27. package/dist/{chunk-QIAZQLSG.js → chunk-DPY77ASH.js} +2 -2
  28. package/dist/{chunk-J26AI33Z.js → chunk-DUD7B2IY.js} +2 -2
  29. package/dist/{chunk-BPJHPGTL.js → chunk-EKKRQI6B.js} +2 -2
  30. package/dist/chunk-FBJCDOO7.js +2 -0
  31. package/dist/{chunk-VXPJXQP3.js.map → chunk-FBJCDOO7.js.map} +1 -1
  32. package/dist/{chunk-A6X6N2G7.js → chunk-FMBYJANY.js} +2 -2
  33. package/dist/chunk-G34OX26W.js +2 -0
  34. package/dist/chunk-G34OX26W.js.map +1 -0
  35. package/dist/{chunk-6L7JELHX.js → chunk-G4QOEPDP.js} +2 -2
  36. package/dist/{chunk-2U4VW5TT.js → chunk-GKS3W6KT.js} +2 -2
  37. package/dist/{chunk-2VWU5VNU.js → chunk-HEQLPSHZ.js} +2 -2
  38. package/dist/{chunk-TWD2IDAS.js → chunk-HPBT677J.js} +2 -2
  39. package/dist/chunk-HYIC33YR.js +2 -0
  40. package/dist/chunk-HYIC33YR.js.map +1 -0
  41. package/dist/{chunk-MRVBOQLW.js → chunk-ILPYR7RQ.js} +2 -2
  42. package/dist/{chunk-CHQK23RH.js → chunk-IM525UMG.js} +2 -2
  43. package/dist/{chunk-CHQK23RH.js.map → chunk-IM525UMG.js.map} +1 -1
  44. package/dist/{chunk-MISHDUB2.js → chunk-IXAWEBRI.js} +2 -2
  45. package/dist/{chunk-MISHDUB2.js.map → chunk-IXAWEBRI.js.map} +1 -1
  46. package/dist/{chunk-VE36I6G6.js → chunk-IYGJ5QJB.js} +2 -2
  47. package/dist/{chunk-PJUC5WAJ.js → chunk-JF3KJ6PA.js} +2 -2
  48. package/dist/{chunk-5EP45OQV.js → chunk-JVSD4JOU.js} +2 -2
  49. package/dist/{chunk-ULHGAKFT.js → chunk-L2IKFFQX.js} +2 -2
  50. package/dist/{chunk-XHOQSIXZ.js → chunk-LEXD5FVL.js} +2 -2
  51. package/dist/{chunk-MFKGLMRJ.js → chunk-LUDRB7LC.js} +2 -2
  52. package/dist/chunk-LUDRB7LC.js.map +1 -0
  53. package/dist/{chunk-NHYBFEXA.js → chunk-N6KOPITR.js} +2 -2
  54. package/dist/{chunk-OOUYQLIE.js → chunk-NGTESOKF.js} +2 -2
  55. package/dist/{chunk-GLUERRJ2.js → chunk-NIH7XLAK.js} +2 -2
  56. package/dist/{chunk-XTLLWD7O.js → chunk-O4DIUKVP.js} +2 -2
  57. package/dist/{chunk-IUU4MOLL.js → chunk-OIN3HGOQ.js} +2 -2
  58. package/dist/{chunk-D52VU4UO.js → chunk-OW5QGJD4.js} +2 -2
  59. package/dist/{chunk-BVCBX72U.js → chunk-P5WUODPR.js} +2 -2
  60. package/dist/{chunk-2GCMLKO2.js → chunk-PAT3EA43.js} +2 -2
  61. package/dist/{chunk-GECFDGI7.js → chunk-PKRI35YC.js} +2 -2
  62. package/dist/{chunk-GUHBW4V3.js → chunk-PWPFCC6I.js} +2 -2
  63. package/dist/{chunk-XKSAKI3P.js → chunk-Q4BKFSTW.js} +2 -2
  64. package/dist/{chunk-2NGJN5IE.js → chunk-Q5ZRKZMK.js} +2 -2
  65. package/dist/{chunk-GOB6DUFS.js → chunk-QIQTM4HB.js} +1 -1
  66. package/dist/chunk-QIQTM4HB.js.map +1 -0
  67. package/dist/{chunk-TGUF5Q7J.js → chunk-RDCWARSM.js} +2 -2
  68. package/dist/{chunk-T6BYBXQA.js → chunk-RF5SLMJF.js} +2 -2
  69. package/dist/{chunk-D5KITGC6.js → chunk-S2XKE7EA.js} +2 -2
  70. package/dist/{chunk-V6I3EMYX.js → chunk-SA3D5OH4.js} +2 -2
  71. package/dist/{chunk-B25LAMRX.js → chunk-SGJSMTYG.js} +2 -2
  72. package/dist/{chunk-FVFXPT3Y.js → chunk-TB75BHYW.js} +2 -2
  73. package/dist/{chunk-JX3OQNNM.js → chunk-U2LOBJFU.js} +2 -2
  74. package/dist/{chunk-RJGWAZBE.js → chunk-UPXJJBXZ.js} +2 -2
  75. package/dist/{chunk-IK6IRESD.js → chunk-VT4GSXMI.js} +2 -2
  76. package/dist/chunk-WVDTHFGS.js +2 -0
  77. package/dist/chunk-WVDTHFGS.js.map +1 -0
  78. package/dist/{chunk-V2PJW577.js → chunk-XMAQ4NRR.js} +2 -2
  79. package/dist/{chunk-7EDGHYMX.js → chunk-ZQ6MG635.js} +2 -2
  80. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  81. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  82. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  83. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  84. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  85. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  86. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  87. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  88. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  89. package/dist/flows/ContractAmendment/hooks.js +1 -1
  90. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  91. package/dist/flows/ContractAmendment/index.js +1 -1
  92. package/dist/flows/ContractAmendment/utils.d.ts +1 -1
  93. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
  94. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  95. package/dist/flows/ContractorOnboarding/api.d.ts +2 -2
  96. package/dist/flows/ContractorOnboarding/api.js +1 -1
  97. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
  98. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  99. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
  100. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  101. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
  102. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  103. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
  104. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  105. package/dist/flows/ContractorOnboarding/components/OnboardingBack.js +1 -1
  106. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  107. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  108. package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.js +1 -1
  109. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
  110. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  111. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
  112. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  113. package/dist/flows/ContractorOnboarding/context.d.ts +5 -5
  114. package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
  115. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  116. package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
  117. package/dist/flows/ContractorOnboarding/index.js +1 -1
  118. package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
  119. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +1 -1
  120. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  121. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  122. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  123. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  124. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  125. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  126. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
  127. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  128. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  129. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  130. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
  131. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  132. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
  133. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  134. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
  135. package/dist/flows/CostCalculator/api.d.ts +1 -1
  136. package/dist/flows/CostCalculator/api.js +1 -1
  137. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  138. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  139. package/dist/flows/CostCalculator/context.d.ts +3 -3
  140. package/dist/flows/CostCalculator/hooks.d.ts +3 -3
  141. package/dist/flows/CostCalculator/hooks.js +1 -1
  142. package/dist/flows/CostCalculator/index.d.ts +3 -3
  143. package/dist/flows/CostCalculator/index.js +1 -1
  144. package/dist/flows/CostCalculator/types.d.ts +1 -1
  145. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  146. package/dist/flows/CostCalculator/utils.js +1 -1
  147. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
  148. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  149. package/dist/flows/Onboarding/api.d.ts +4 -4
  150. package/dist/flows/Onboarding/api.js +1 -1
  151. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  152. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  153. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
  154. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  155. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
  156. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  157. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
  158. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  159. package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
  160. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
  161. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  162. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  163. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  164. package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
  165. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
  166. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  167. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
  168. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  169. package/dist/flows/Onboarding/context.d.ts +4 -4
  170. package/dist/flows/Onboarding/hooks.d.ts +4 -4
  171. package/dist/flows/Onboarding/hooks.js +1 -1
  172. package/dist/flows/Onboarding/index.d.ts +4 -4
  173. package/dist/flows/Onboarding/index.js +1 -1
  174. package/dist/flows/Onboarding/types.d.ts +4 -4
  175. package/dist/flows/Onboarding/utils.d.ts +4 -4
  176. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
  177. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  178. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
  179. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  180. package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
  181. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  182. package/dist/flows/Termination/TerminationBack.js +1 -1
  183. package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
  184. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  185. package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
  186. package/dist/flows/Termination/TerminationFlow.js +1 -1
  187. package/dist/flows/Termination/TerminationForm.d.ts +4 -4
  188. package/dist/flows/Termination/TerminationForm.js +1 -1
  189. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  190. package/dist/flows/Termination/TimeOff.d.ts +1 -1
  191. package/dist/flows/Termination/TimeOff.js +1 -1
  192. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +8 -0
  193. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +2 -0
  194. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +2 -0
  195. package/dist/flows/Termination/components/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js +2 -0
  196. package/dist/flows/Termination/components/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js.map +1 -0
  197. package/dist/flows/Termination/context.d.ts +4 -4
  198. package/dist/flows/Termination/hooks.d.ts +4 -4
  199. package/dist/flows/Termination/hooks.js +1 -1
  200. package/dist/flows/Termination/index.d.ts +6 -6
  201. package/dist/flows/Termination/index.js +1 -1
  202. package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +10 -0
  203. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  204. package/dist/flows/Termination/json-schemas/paidTimeOff.d.ts +10 -0
  205. package/dist/flows/Termination/json-schemas/paidTimeOff.js +1 -1
  206. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  207. package/dist/flows/Termination/types.d.ts +4 -4
  208. package/dist/flows/api.d.ts +4 -4
  209. package/dist/flows/api.js +1 -1
  210. package/dist/flows/types.d.ts +1 -1
  211. package/dist/index.css +1 -1
  212. package/dist/index.css.map +1 -1
  213. package/dist/index.d.ts +53 -14
  214. package/dist/index.js +1 -1
  215. package/dist/index.js.map +1 -1
  216. package/dist/internals.d.ts +45 -53
  217. package/dist/internals.js +1 -1
  218. package/dist/{mutations-BxS-iGnr.d.ts → mutations-juOpbR-A.d.ts} +1 -1
  219. package/dist/{remoteFlows-DnbCoINb.d.ts → remoteFlows-D1VLPcdi.d.ts} +1 -1
  220. package/dist/{types-pEe84X2Z.d.ts → types-CBySMyLF.d.ts} +4 -4
  221. package/dist/{types-BnLDzD9Z.d.ts → types-CCzA9vuJ.d.ts} +3 -3
  222. package/dist/{types-D31aAyFm.d.ts → types-Cl_jsVYv.d.ts} +2 -2
  223. package/dist/{types.gen-DOXoUj5J.d.ts → types.gen-CxiSXabT.d.ts} +94 -1
  224. package/package.json +1 -1
  225. package/dist/chunk-DKA2EUPQ.js +0 -2
  226. package/dist/chunk-E773NPNL.js +0 -2
  227. package/dist/chunk-E773NPNL.js.map +0 -1
  228. package/dist/chunk-GOB6DUFS.js.map +0 -1
  229. package/dist/chunk-HTCONTKZ.js +0 -2
  230. package/dist/chunk-HTCONTKZ.js.map +0 -1
  231. package/dist/chunk-MFKGLMRJ.js.map +0 -1
  232. package/dist/chunk-PSEOAELN.js +0 -2
  233. package/dist/chunk-PSEOAELN.js.map +0 -1
  234. package/dist/chunk-VXPJXQP3.js +0 -2
  235. package/dist/chunk-Z442TFR6.js +0 -2
  236. package/dist/flows/Termination/TerminationDialogInfoContent/TerminationDialogInfoContent.js +0 -2
  237. package/dist/flows/Termination/TerminationReasonsDetailContent/TerminationReasonsDetailContent.js +0 -2
  238. /package/dist/{chunk-X5DMQNEM.js.map → chunk-2DSNHYHZ.js.map} +0 -0
  239. /package/dist/{chunk-5QP2BAUT.js.map → chunk-2T2N5226.js.map} +0 -0
  240. /package/dist/{chunk-Z442TFR6.js.map → chunk-2UAG6WDW.js.map} +0 -0
  241. /package/dist/{chunk-WEYUB6DC.js.map → chunk-3W7RKLJX.js.map} +0 -0
  242. /package/dist/{chunk-KJSZIASL.js.map → chunk-3XDJ2LRT.js.map} +0 -0
  243. /package/dist/{chunk-K4NAASBM.js.map → chunk-4HT7RNFP.js.map} +0 -0
  244. /package/dist/{chunk-2WDEVWIE.js.map → chunk-4NAVUB7D.js.map} +0 -0
  245. /package/dist/{chunk-QU3NSFU5.js.map → chunk-4SIGN3ZP.js.map} +0 -0
  246. /package/dist/{chunk-QP36XXCQ.js.map → chunk-5A54AHAT.js.map} +0 -0
  247. /package/dist/{chunk-22JS3T6G.js.map → chunk-5H5INKOY.js.map} +0 -0
  248. /package/dist/{chunk-C4AVUIG2.js.map → chunk-5ZR7EFPY.js.map} +0 -0
  249. /package/dist/{chunk-JG7FV7OZ.js.map → chunk-64NSBY5G.js.map} +0 -0
  250. /package/dist/{chunk-5N4L2G7Q.js.map → chunk-6VRUYYUV.js.map} +0 -0
  251. /package/dist/{chunk-3I6ONATN.js.map → chunk-7IZGKQII.js.map} +0 -0
  252. /package/dist/{chunk-EIVHHLR5.js.map → chunk-A7T27JCJ.js.map} +0 -0
  253. /package/dist/{chunk-CELNQ7KS.js.map → chunk-AHBACWMD.js.map} +0 -0
  254. /package/dist/{chunk-C4SMHWP4.js.map → chunk-ANGJCT4I.js.map} +0 -0
  255. /package/dist/{chunk-XICA45G2.js.map → chunk-B7I7YVNK.js.map} +0 -0
  256. /package/dist/{chunk-DHJZVBVD.js.map → chunk-BNHN4CEM.js.map} +0 -0
  257. /package/dist/{chunk-5SKMAYLG.js.map → chunk-CRHH6IPF.js.map} +0 -0
  258. /package/dist/{chunk-QIAZQLSG.js.map → chunk-DPY77ASH.js.map} +0 -0
  259. /package/dist/{chunk-J26AI33Z.js.map → chunk-DUD7B2IY.js.map} +0 -0
  260. /package/dist/{chunk-BPJHPGTL.js.map → chunk-EKKRQI6B.js.map} +0 -0
  261. /package/dist/{chunk-A6X6N2G7.js.map → chunk-FMBYJANY.js.map} +0 -0
  262. /package/dist/{chunk-6L7JELHX.js.map → chunk-G4QOEPDP.js.map} +0 -0
  263. /package/dist/{chunk-2U4VW5TT.js.map → chunk-GKS3W6KT.js.map} +0 -0
  264. /package/dist/{chunk-2VWU5VNU.js.map → chunk-HEQLPSHZ.js.map} +0 -0
  265. /package/dist/{chunk-TWD2IDAS.js.map → chunk-HPBT677J.js.map} +0 -0
  266. /package/dist/{chunk-MRVBOQLW.js.map → chunk-ILPYR7RQ.js.map} +0 -0
  267. /package/dist/{chunk-VE36I6G6.js.map → chunk-IYGJ5QJB.js.map} +0 -0
  268. /package/dist/{chunk-PJUC5WAJ.js.map → chunk-JF3KJ6PA.js.map} +0 -0
  269. /package/dist/{chunk-5EP45OQV.js.map → chunk-JVSD4JOU.js.map} +0 -0
  270. /package/dist/{chunk-ULHGAKFT.js.map → chunk-L2IKFFQX.js.map} +0 -0
  271. /package/dist/{chunk-XHOQSIXZ.js.map → chunk-LEXD5FVL.js.map} +0 -0
  272. /package/dist/{chunk-NHYBFEXA.js.map → chunk-N6KOPITR.js.map} +0 -0
  273. /package/dist/{chunk-OOUYQLIE.js.map → chunk-NGTESOKF.js.map} +0 -0
  274. /package/dist/{chunk-GLUERRJ2.js.map → chunk-NIH7XLAK.js.map} +0 -0
  275. /package/dist/{chunk-XTLLWD7O.js.map → chunk-O4DIUKVP.js.map} +0 -0
  276. /package/dist/{chunk-IUU4MOLL.js.map → chunk-OIN3HGOQ.js.map} +0 -0
  277. /package/dist/{chunk-D52VU4UO.js.map → chunk-OW5QGJD4.js.map} +0 -0
  278. /package/dist/{chunk-BVCBX72U.js.map → chunk-P5WUODPR.js.map} +0 -0
  279. /package/dist/{chunk-2GCMLKO2.js.map → chunk-PAT3EA43.js.map} +0 -0
  280. /package/dist/{chunk-GECFDGI7.js.map → chunk-PKRI35YC.js.map} +0 -0
  281. /package/dist/{chunk-GUHBW4V3.js.map → chunk-PWPFCC6I.js.map} +0 -0
  282. /package/dist/{chunk-XKSAKI3P.js.map → chunk-Q4BKFSTW.js.map} +0 -0
  283. /package/dist/{chunk-2NGJN5IE.js.map → chunk-Q5ZRKZMK.js.map} +0 -0
  284. /package/dist/{chunk-TGUF5Q7J.js.map → chunk-RDCWARSM.js.map} +0 -0
  285. /package/dist/{chunk-T6BYBXQA.js.map → chunk-RF5SLMJF.js.map} +0 -0
  286. /package/dist/{chunk-D5KITGC6.js.map → chunk-S2XKE7EA.js.map} +0 -0
  287. /package/dist/{chunk-V6I3EMYX.js.map → chunk-SA3D5OH4.js.map} +0 -0
  288. /package/dist/{chunk-B25LAMRX.js.map → chunk-SGJSMTYG.js.map} +0 -0
  289. /package/dist/{chunk-FVFXPT3Y.js.map → chunk-TB75BHYW.js.map} +0 -0
  290. /package/dist/{chunk-JX3OQNNM.js.map → chunk-U2LOBJFU.js.map} +0 -0
  291. /package/dist/{chunk-RJGWAZBE.js.map → chunk-UPXJJBXZ.js.map} +0 -0
  292. /package/dist/{chunk-IK6IRESD.js.map → chunk-VT4GSXMI.js.map} +0 -0
  293. /package/dist/{chunk-V2PJW577.js.map → chunk-XMAQ4NRR.js.map} +0 -0
  294. /package/dist/{chunk-7EDGHYMX.js.map → chunk-ZQ6MG635.js.map} +0 -0
  295. /package/dist/flows/Termination/{TerminationDialogInfoContent/TerminationDialogInfoContent.js.map → components/PaidTimeOff/PaidTimeOff.js.map} +0 -0
  296. /package/dist/flows/Termination/{TerminationDialogInfoContent → components/TerminationDialogInfoContent}/TerminationDialogInfoContent.d.ts +0 -0
  297. /package/dist/flows/Termination/{TerminationReasonsDetailContent/TerminationReasonsDetailContent.js.map → components/TerminationDialogInfoContent/TerminationDialogInfoContent.js.map} +0 -0
  298. /package/dist/flows/Termination/{TerminationReasonsDetailContent → components/TerminationReasonsDetailContent}/TerminationReasonsDetailContent.d.ts +0 -0
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- Welcome to the `@remoteoss/remote-flows` package, a React library that provides components for Remote's embbeded solution.
5
+ Welcome to the `@remoteoss/remote-flows` package, a React library that provides components for Remote's embedded solution.
6
6
 
7
7
  ## Table of Contents
8
8
 
@@ -1,5 +1,6 @@
1
1
  import { ClassValue } from 'clsx';
2
2
  import { ValidationError } from 'yup';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
4
 
4
5
  declare function cn(...inputs: ClassValue[]): string;
5
6
  type YupError = Pick<ValidationError, 'type' | 'errors'> & {
@@ -19,4 +20,12 @@ type YupError = Pick<ValidationError, 'type' | 'errors'> & {
19
20
  */
20
21
  declare const transformYupErrorsIntoObject: (errors: ValidationError) => Record<string, YupError>;
21
22
 
22
- export { cn as c, transformYupErrorsIntoObject as t };
23
+ interface ZendeskTriggerButtonProps {
24
+ zendeskId: number;
25
+ className?: string;
26
+ onClick?: (zendeskId: number) => void;
27
+ children?: React.ReactNode;
28
+ }
29
+ declare function ZendeskTriggerButton({ zendeskId, className, onClick, children, }: ZendeskTriggerButtonProps): react_jsx_runtime.JSX.Element;
30
+
31
+ export { ZendeskTriggerButton as Z, cn as c, transformYupErrorsIntoObject as t };
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-NHYBFEXA.js";import{b as e}from"./chunk-TOA3JILU.js";import{b as t}from"./chunk-7XRPOR7L.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";function S({onSubmit:m,onSuccess:d,onError:a}){let{contractorOnboardingBag:o}=e(),l=i(async n=>{try{await m?.(o.parseFormValues(n));let r=await o.onSubmit(n);if(r?.data){await d?.(r?.data),o?.next();return}if(r?.error){let f=t(r?.fieldErrors||[],o.meta?.fields?.basic_information);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:f})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),c=o.stepState.values?.basic_information||o.initialValues.basic_information;return p(s,{defaultValues:c,onSubmit:l})}i(S,"BasicInformationStep");export{S as a};
2
- //# sourceMappingURL=chunk-X5DMQNEM.js.map
1
+ import{a as s}from"./chunk-N6KOPITR.js";import{b as e}from"./chunk-TOA3JILU.js";import{b as t}from"./chunk-7XRPOR7L.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";function S({onSubmit:m,onSuccess:d,onError:a}){let{contractorOnboardingBag:o}=e(),l=i(async n=>{try{await m?.(o.parseFormValues(n));let r=await o.onSubmit(n);if(r?.data){await d?.(r?.data),o?.next();return}if(r?.error){let f=t(r?.fieldErrors||[],o.meta?.fields?.basic_information);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:f})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),c=o.stepState.values?.basic_information||o.initialValues.basic_information;return p(s,{defaultValues:c,onSubmit:l})}i(S,"BasicInformationStep");export{S as a};
2
+ //# sourceMappingURL=chunk-2DSNHYHZ.js.map
@@ -1,2 +1,2 @@
1
- import{a as Le}from"./chunk-VAIBLWOY.js";import{a as Te}from"./chunk-K4NAASBM.js";import{a as Ce,b as Oe,c as Pe,d as Me}from"./chunk-FB2QGVI2.js";import{a as ue,b as ye,c as pe,f as _e,g as Se,h as be,i as ge,j as Fe,l as Ee,n as he}from"./chunk-VXPJXQP3.js";import{a as R}from"./chunk-7XRPOR7L.js";import{a as Ve}from"./chunk-PJBAQZ6G.js";import{c as h,d as L,f as W}from"./chunk-PAQW5BFW.js";import{g as V}from"./chunk-43WMZDDH.js";import{a as l}from"./chunk-P37U34EQ.js";import{useEffect as ot,useMemo as d,useRef as it,useState as je}from"react";import st from"lodash.mergewith";import{jsx as ke}from"react/jsx-runtime";var at={employment_basic_information:"basic_information",contract_details:"contract_details"},rt={select_country:null,basic_information:"employment_basic_information",contract_details:"contract_details",benefits:null,review:null},ct=l(({isLoadingBasicInformationForm:f,isLoadingContractDetailsForm:I,isLoadingEmployment:J,isLoadingBenefitsOffersSchema:N,isLoadingBenefitOffers:o,isLoadingCompany:A,isLoadingCountries:C,employmentStatus:s,employmentId:_,currentStepName:a,basicInformationFields:D,contractDetailsFields:c})=>{let O=f||I||J||N||o||A||C,r=s&&Pe.includes(s),j=s&&!Me.includes(s),k=!!(_&&r&&a!=="review"),w=O||k,B=!!(k&&!O&&D.length>0&&c.length>0);return{isLoading:w,isNavigatingToReview:B,isEmploymentReadOnly:r,canInvite:j}},"getLoadingStates"),Ft=l(({employmentId:f,companyId:I,countryCode:J,type:N,options:o,skipSteps:A,externalId:C,initialValues:s})=>{let _=it({select_country:{},basic_information:{},contract_details:{},benefits:{}}),[a,D]=je(f),[c,O]=je(J||null),{data:r,isLoading:j,refetch:k}=ue(a);f&&r?.country?.code&&!c&&O(r.country.code);let{data:w,isLoading:B}=pe(a),{data:q,isLoading:G,refetch:we}=ye(I),Be=A?.includes("select_country")?Oe:Ce,{fieldValues:S,stepState:n,setFieldValues:qe,previousStep:ve,nextStep:Re,goToStep:U,setStepValues:$}=Ve(Be),{selectCountryForm:v,isLoading:z}=Ee({jsfModify:o?.jsfModify?.select_country,jsonSchemaVersion:o?.jsonSchemaVersion,queryOptions:{enabled:n.currentStep.name==="select_country"}}),K=be(o),Y=ge(o),Q=Fe(o),Ie=he(),{mutateAsync:Je}=R(K),{mutateAsync:X}=R(Y),{mutateAsync:Ne}=R(Q),Ae=rt[n.currentStep.name]||"employment_basic_information",De=at[Ae],Ue=r?.[De]||{},Z=l(({form:e,options:i={},query:m={}})=>{let H=Object.keys(S).length>0?{...s,...n.values?.[n.currentStep.name],...S}:{...s,...Ue};return _e({countryCode:c,form:e,fieldValues:H,query:m,options:{...i,queryOptions:{enabled:i.queryOptions?.enabled??!0},jsonSchemaVersion:i.jsonSchemaVersion}})},"useJSONSchema"),xe=!!(c&&(n.currentStep.name==="basic_information"||f)),He=!!(c&&(n.currentStep.name==="contract_details"||f)),{data:u,isLoading:ee}=Z({form:"employment_basic_information",options:{jsfModify:o?.jsfModify?.basic_information,jsonSchemaVersion:o?.jsonSchemaVersion,queryOptions:{enabled:xe}}}),b=o?.jsfModify?.contract_details?.fields?.annual_gross_salary,x=b&&typeof b=="object"&&"presentation"in b?b.presentation:void 0,te=o?.jsfModify?.contract_details?.fields?.equity_compensation,We=d(()=>({fields:{annual_gross_salary:{...b,presentation:{annual_gross_salary_conversion_properties:{label:x?.annual_gross_salary_conversion_properties?.label,description:x?.annual_gross_salary_conversion_properties?.description},desiredCurrency:q?.desired_currency,Component:l(e=>ke(Te,{desiredCurrency:q?.desired_currency||"",...e}),"Component")}},equity_compensation:{...te,presentation:{calculateDynamicProperties:l((e,i)=>{let m=e.equity_compensation?.offer_equity_compensation,M=i?.meta?.cost;return{extra:ke(Le,{offerEquity:m,equityCost:M})}},"calculateDynamicProperties")}}}}),[b,x,q?.desired_currency,te]),{data:y,isLoading:ne}=Z({form:"contract_details",query:{employment_id:a},options:{jsfModify:{...o?.jsfModify?.contract_details,fields:{...o?.jsfModify?.contract_details?.fields,...We.fields}},queryOptions:{enabled:He},jsonSchemaVersion:o?.jsonSchemaVersion}}),{data:P,isLoading:oe}=Se(a,S,o),ie=d(()=>{if(n.currentStep.name==="benefits"){let e={...n.values?.[n.currentStep.name],...S};return st({},w,e)}return{}},[n.currentStep.name,w,n.values,S]),t=d(()=>({select_country:v?.fields||[],basic_information:u?.fields||[],contract_details:y?.fields||[],benefits:P?.fields||[],review:[]}),[v?.fields,u?.fields,y?.fields,P?.fields]),Ge={select_country:null,basic_information:u?.meta["x-jsf-fieldsets"],contract_details:y?.meta["x-jsf-fieldsets"],benefits:null,review:null},{country:$e,basic_information:se={},contract_details:ae={},status:re}=r||{},ce=$e?.code,le=n.currentStep.name,g=d(()=>L(t.select_country,{country:c||ce||""}),[t.select_country,c,ce]),F=d(()=>{let e={...s,...se};return L(t.basic_information,e)},[t.basic_information,se,s]),p=d(()=>{let e={...s,...ae};return L(t.contract_details,e)},[t.contract_details,ae,s]),E=d(()=>{let e={...s,...ie};return L(t.benefits,e)},[t.benefits,ie,s]),ze=d(()=>r?{select_country:g,basic_information:W(t.basic_information,F),contract_details:r?.contract_details!==null?W(t.contract_details,p):p,benefits:E}:{select_country:g,basic_information:F,contract_details:p,benefits:E},[g,F,p,E,r,t]),{isLoading:Ke,isNavigatingToReview:me,isEmploymentReadOnly:Ye,canInvite:Qe}=d(()=>ct({isLoadingBasicInformationForm:ee,isLoadingContractDetailsForm:ne,isLoadingEmployment:j,isLoadingBenefitsOffersSchema:oe,isLoadingBenefitOffers:B,isLoadingCompany:G,isLoadingCountries:z,employmentId:f,employmentStatus:re,basicInformationFields:t.basic_information,contractDetailsFields:t.contract_details,currentStepName:le}),[ee,ne,j,oe,B,G,z,f,re,t.basic_information,t.contract_details,le]);ot(()=>{me&&(_.current={select_country:V(g,t.select_country),basic_information:V(F,t.basic_information),contract_details:V(p,t.contract_details),benefits:V(E,t.benefits)},$({select_country:g,basic_information:F,contract_details:p,benefits:E,review:{}}),U("review"))},[F,E,p,U,me,g,$,t.basic_information,t.benefits,t.contract_details,t.select_country]);let de=l(e=>v&&n.currentStep.name==="select_country"?e:u&&n.currentStep.name==="basic_information"?h(e,u?.fields,{isPartialValidation:!1}):y&&n.currentStep.name==="contract_details"?h(e,y?.fields,{isPartialValidation:!1}):{},"parseFormValues");async function Xe(e){let i=n.currentStep.name;i in _.current&&(_.current[i]=V(e,t[i]));let m=de(e);switch(we(),n.currentStep.name){case"select_country":return O(m.country),Promise.resolve({data:{countryCode:m.country}});case"basic_information":{let M=!a&&c,H=a&&c&&r?.country&&r?.country.code!==c;if(M||H){let nt={basic_information:m,type:N,country_code:c,external_id:C};try{let T=await Je(nt),fe=T.data?.data?.employment?.id;return D(fe),await Ie.mutateAsync({employmentId:fe,eligible_to_work_in_residing_country:"citizen",employer_or_work_restrictions:!1}),T}catch(T){throw console.error("Error creating onboarding:",T),T}}else if(a)return X({employmentId:a,basic_information:m,pricing_plan_details:{frequency:"monthly"},external_id:C});return}case"contract_details":return X({employmentId:a,external_id:C,...{contract_details:m,pricing_plan_details:{frequency:"monthly"}}});case"benefits":return Ne({employmentId:a,...e})}}l(Xe,"onSubmit");function Ze(){ve()}l(Ze,"back");function et(){Re()}l(et,"next");function tt(e){U(e)}return l(tt,"goTo"),{employmentId:a,creditRiskStatus:q?.default_legal_entity_credit_risk_status,fieldValues:S,stepState:n,fields:t[n.currentStep.name],isLoading:Ke,isSubmitting:K.isPending||Y.isPending||Q.isPending,initialValues:ze,handleValidation:l(e=>{if(n.currentStep.name==="select_country")return v.handleValidation(e);if(n.currentStep.name==="benefits"&&P){let i=h(e,P?.fields,{isPartialValidation:!1});return P?.handleValidation(i)}if(u&&n.currentStep.name==="basic_information"){let i=h(e,u?.fields,{isPartialValidation:!1});return u?.handleValidation(i)}if(y&&n.currentStep.name==="contract_details"){let i=h(e,y?.fields,{isPartialValidation:!1});return y?.handleValidation(i)}return null},"handleValidation"),checkFieldUpdates:qe,parseFormValues:de,onSubmit:Xe,back:Ze,next:et,goTo:tt,meta:{fields:_.current,fieldsets:Ge[n.currentStep.name]},refetchEmployment:k,employment:r,isEmploymentReadOnly:Ye,canInvite:Qe}},"useOnboarding");export{Ft as a};
2
- //# sourceMappingURL=chunk-5QP2BAUT.js.map
1
+ import{a as Le}from"./chunk-VAIBLWOY.js";import{a as Te}from"./chunk-4HT7RNFP.js";import{a as Ce,b as Oe,c as Pe,d as Me}from"./chunk-FB2QGVI2.js";import{a as ue,b as ye,c as pe,f as _e,g as Se,h as be,i as ge,j as Fe,l as Ee,n as he}from"./chunk-FBJCDOO7.js";import{a as R}from"./chunk-7XRPOR7L.js";import{a as Ve}from"./chunk-PJBAQZ6G.js";import{c as h,d as L,f as W}from"./chunk-PAQW5BFW.js";import{g as V}from"./chunk-43WMZDDH.js";import{a as l}from"./chunk-P37U34EQ.js";import{useEffect as ot,useMemo as d,useRef as it,useState as je}from"react";import st from"lodash.mergewith";import{jsx as ke}from"react/jsx-runtime";var at={employment_basic_information:"basic_information",contract_details:"contract_details"},rt={select_country:null,basic_information:"employment_basic_information",contract_details:"contract_details",benefits:null,review:null},ct=l(({isLoadingBasicInformationForm:f,isLoadingContractDetailsForm:I,isLoadingEmployment:J,isLoadingBenefitsOffersSchema:N,isLoadingBenefitOffers:o,isLoadingCompany:A,isLoadingCountries:C,employmentStatus:s,employmentId:_,currentStepName:a,basicInformationFields:D,contractDetailsFields:c})=>{let O=f||I||J||N||o||A||C,r=s&&Pe.includes(s),j=s&&!Me.includes(s),k=!!(_&&r&&a!=="review"),w=O||k,B=!!(k&&!O&&D.length>0&&c.length>0);return{isLoading:w,isNavigatingToReview:B,isEmploymentReadOnly:r,canInvite:j}},"getLoadingStates"),Ft=l(({employmentId:f,companyId:I,countryCode:J,type:N,options:o,skipSteps:A,externalId:C,initialValues:s})=>{let _=it({select_country:{},basic_information:{},contract_details:{},benefits:{}}),[a,D]=je(f),[c,O]=je(J||null),{data:r,isLoading:j,refetch:k}=ue(a);f&&r?.country?.code&&!c&&O(r.country.code);let{data:w,isLoading:B}=pe(a),{data:q,isLoading:G,refetch:we}=ye(I),Be=A?.includes("select_country")?Oe:Ce,{fieldValues:S,stepState:n,setFieldValues:qe,previousStep:ve,nextStep:Re,goToStep:U,setStepValues:$}=Ve(Be),{selectCountryForm:v,isLoading:z}=Ee({jsfModify:o?.jsfModify?.select_country,jsonSchemaVersion:o?.jsonSchemaVersion,queryOptions:{enabled:n.currentStep.name==="select_country"}}),K=be(o),Y=ge(o),Q=Fe(o),Ie=he(),{mutateAsync:Je}=R(K),{mutateAsync:X}=R(Y),{mutateAsync:Ne}=R(Q),Ae=rt[n.currentStep.name]||"employment_basic_information",De=at[Ae],Ue=r?.[De]||{},Z=l(({form:e,options:i={},query:m={}})=>{let H=Object.keys(S).length>0?{...s,...n.values?.[n.currentStep.name],...S}:{...s,...Ue};return _e({countryCode:c,form:e,fieldValues:H,query:m,options:{...i,queryOptions:{enabled:i.queryOptions?.enabled??!0},jsonSchemaVersion:i.jsonSchemaVersion}})},"useJSONSchema"),xe=!!(c&&(n.currentStep.name==="basic_information"||f)),He=!!(c&&(n.currentStep.name==="contract_details"||f)),{data:u,isLoading:ee}=Z({form:"employment_basic_information",options:{jsfModify:o?.jsfModify?.basic_information,jsonSchemaVersion:o?.jsonSchemaVersion,queryOptions:{enabled:xe}}}),b=o?.jsfModify?.contract_details?.fields?.annual_gross_salary,x=b&&typeof b=="object"&&"presentation"in b?b.presentation:void 0,te=o?.jsfModify?.contract_details?.fields?.equity_compensation,We=d(()=>({fields:{annual_gross_salary:{...b,presentation:{annual_gross_salary_conversion_properties:{label:x?.annual_gross_salary_conversion_properties?.label,description:x?.annual_gross_salary_conversion_properties?.description},desiredCurrency:q?.desired_currency,Component:l(e=>ke(Te,{desiredCurrency:q?.desired_currency||"",...e}),"Component")}},equity_compensation:{...te,presentation:{calculateDynamicProperties:l((e,i)=>{let m=e.equity_compensation?.offer_equity_compensation,M=i?.meta?.cost;return{extra:ke(Le,{offerEquity:m,equityCost:M})}},"calculateDynamicProperties")}}}}),[b,x,q?.desired_currency,te]),{data:y,isLoading:ne}=Z({form:"contract_details",query:{employment_id:a},options:{jsfModify:{...o?.jsfModify?.contract_details,fields:{...o?.jsfModify?.contract_details?.fields,...We.fields}},queryOptions:{enabled:He},jsonSchemaVersion:o?.jsonSchemaVersion}}),{data:P,isLoading:oe}=Se(a,S,o),ie=d(()=>{if(n.currentStep.name==="benefits"){let e={...n.values?.[n.currentStep.name],...S};return st({},w,e)}return{}},[n.currentStep.name,w,n.values,S]),t=d(()=>({select_country:v?.fields||[],basic_information:u?.fields||[],contract_details:y?.fields||[],benefits:P?.fields||[],review:[]}),[v?.fields,u?.fields,y?.fields,P?.fields]),Ge={select_country:null,basic_information:u?.meta["x-jsf-fieldsets"],contract_details:y?.meta["x-jsf-fieldsets"],benefits:null,review:null},{country:$e,basic_information:se={},contract_details:ae={},status:re}=r||{},ce=$e?.code,le=n.currentStep.name,g=d(()=>L(t.select_country,{country:c||ce||""}),[t.select_country,c,ce]),F=d(()=>{let e={...s,...se};return L(t.basic_information,e)},[t.basic_information,se,s]),p=d(()=>{let e={...s,...ae};return L(t.contract_details,e)},[t.contract_details,ae,s]),E=d(()=>{let e={...s,...ie};return L(t.benefits,e)},[t.benefits,ie,s]),ze=d(()=>r?{select_country:g,basic_information:W(t.basic_information,F),contract_details:r?.contract_details!==null?W(t.contract_details,p):p,benefits:E}:{select_country:g,basic_information:F,contract_details:p,benefits:E},[g,F,p,E,r,t]),{isLoading:Ke,isNavigatingToReview:me,isEmploymentReadOnly:Ye,canInvite:Qe}=d(()=>ct({isLoadingBasicInformationForm:ee,isLoadingContractDetailsForm:ne,isLoadingEmployment:j,isLoadingBenefitsOffersSchema:oe,isLoadingBenefitOffers:B,isLoadingCompany:G,isLoadingCountries:z,employmentId:f,employmentStatus:re,basicInformationFields:t.basic_information,contractDetailsFields:t.contract_details,currentStepName:le}),[ee,ne,j,oe,B,G,z,f,re,t.basic_information,t.contract_details,le]);ot(()=>{me&&(_.current={select_country:V(g,t.select_country),basic_information:V(F,t.basic_information),contract_details:V(p,t.contract_details),benefits:V(E,t.benefits)},$({select_country:g,basic_information:F,contract_details:p,benefits:E,review:{}}),U("review"))},[F,E,p,U,me,g,$,t.basic_information,t.benefits,t.contract_details,t.select_country]);let de=l(e=>v&&n.currentStep.name==="select_country"?e:u&&n.currentStep.name==="basic_information"?h(e,u?.fields,{isPartialValidation:!1}):y&&n.currentStep.name==="contract_details"?h(e,y?.fields,{isPartialValidation:!1}):{},"parseFormValues");async function Xe(e){let i=n.currentStep.name;i in _.current&&(_.current[i]=V(e,t[i]));let m=de(e);switch(we(),n.currentStep.name){case"select_country":return O(m.country),Promise.resolve({data:{countryCode:m.country}});case"basic_information":{let M=!a&&c,H=a&&c&&r?.country&&r?.country.code!==c;if(M||H){let nt={basic_information:m,type:N,country_code:c,external_id:C};try{let T=await Je(nt),fe=T.data?.data?.employment?.id;return D(fe),await Ie.mutateAsync({employmentId:fe,eligible_to_work_in_residing_country:"citizen",employer_or_work_restrictions:!1}),T}catch(T){throw console.error("Error creating onboarding:",T),T}}else if(a)return X({employmentId:a,basic_information:m,pricing_plan_details:{frequency:"monthly"},external_id:C});return}case"contract_details":return X({employmentId:a,external_id:C,...{contract_details:m,pricing_plan_details:{frequency:"monthly"}}});case"benefits":return Ne({employmentId:a,...e})}}l(Xe,"onSubmit");function Ze(){ve()}l(Ze,"back");function et(){Re()}l(et,"next");function tt(e){U(e)}return l(tt,"goTo"),{employmentId:a,creditRiskStatus:q?.default_legal_entity_credit_risk_status,fieldValues:S,stepState:n,fields:t[n.currentStep.name],isLoading:Ke,isSubmitting:K.isPending||Y.isPending||Q.isPending,initialValues:ze,handleValidation:l(e=>{if(n.currentStep.name==="select_country")return v.handleValidation(e);if(n.currentStep.name==="benefits"&&P){let i=h(e,P?.fields,{isPartialValidation:!1});return P?.handleValidation(i)}if(u&&n.currentStep.name==="basic_information"){let i=h(e,u?.fields,{isPartialValidation:!1});return u?.handleValidation(i)}if(y&&n.currentStep.name==="contract_details"){let i=h(e,y?.fields,{isPartialValidation:!1});return y?.handleValidation(i)}return null},"handleValidation"),checkFieldUpdates:qe,parseFormValues:de,onSubmit:Xe,back:Ze,next:et,goTo:tt,meta:{fields:_.current,fieldsets:Ge[n.currentStep.name]},refetchEmployment:k,employment:r,isEmploymentReadOnly:Ye,canInvite:Qe}},"useOnboarding");export{Ft as a};
2
+ //# sourceMappingURL=chunk-2T2N5226.js.map
@@ -0,0 +1,2 @@
1
+ import{a as m}from"./chunk-4T6PRR6R.js";import{a as e}from"./chunk-GC23RRCI.js";import{a as i}from"./chunk-XSHHMBMT.js";import{a as o}from"./chunk-N6G4VZXF.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
2
+ //# sourceMappingURL=chunk-2UAG6WDW.js.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-XHOQSIXZ.js";import{b as a}from"./chunk-PGWKJ6FK.js";import{b as t}from"./chunk-7XRPOR7L.js";import{d as s}from"./chunk-PAQW5BFW.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function P({components:d,onSubmit:l,onError:i,onSuccess:f}){let{onboardingBag:o}=a(),p=o.fields??[],c=s(p,o.initialValues.benefits);return E(m,{defaultValues:c,components:d,onSubmit:e(async n=>{try{await l?.(n);let r=await o.onSubmit(n);if(r?.data){await f?.(r.data),o?.next();return}if(r?.error){let u=t(r?.fieldErrors||[],o.meta?.fields?.benefits);i?.({error:r.error,rawError:r.rawError,fieldErrors:u})}}catch(r){i?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit")})}e(P,"BenefitsStep");export{P as a};
2
- //# sourceMappingURL=chunk-WEYUB6DC.js.map
1
+ import{a as m}from"./chunk-LEXD5FVL.js";import{b as a}from"./chunk-PGWKJ6FK.js";import{b as t}from"./chunk-7XRPOR7L.js";import{d as s}from"./chunk-PAQW5BFW.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function P({components:d,onSubmit:l,onError:i,onSuccess:f}){let{onboardingBag:o}=a(),p=o.fields??[],c=s(p,o.initialValues.benefits);return E(m,{defaultValues:c,components:d,onSubmit:e(async n=>{try{await l?.(n);let r=await o.onSubmit(n);if(r?.data){await f?.(r.data),o?.next();return}if(r?.error){let u=t(r?.fieldErrors||[],o.meta?.fields?.benefits);i?.({error:r.error,rawError:r.rawError,fieldErrors:u})}}catch(r){i?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit")})}e(P,"BenefitsStep");export{P as a};
2
+ //# sourceMappingURL=chunk-3W7RKLJX.js.map
@@ -1,2 +1,2 @@
1
- import{b as f}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-EIVHHLR5.js";import{b as p}from"./chunk-7XRPOR7L.js";import{g as C}from"./chunk-CNDSIADP.js";import{g as E}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as u}from"react/jsx-runtime";function T({onSubmit:S,onError:w,onSuccess:y,onErrorWithFields:c,shouldResetForm:d,resetFields:a}){let{form:e,formId:V,costCalculatorBag:o}=f(),{formState:{isSubmitSuccessful:s}}=e;R(()=>{if(s&&d){o?.resetForm(),e.reset();return}if(s&&a){let t={...e.getValues()};a.forEach(r=>{t[r]=""}),o?.resetForm(),e.reset(t)}},[s,e,d,o,a]);let b=n(async i=>{try{let t=o?.parseFormValues(i);o?.meta?.fields&&(o.meta.fields=E(i,o.fields),o.meta.fields.employer_currency_slug=o.meta.fields.currency);let r=await o?.onSubmit(t);if(await S?.(t),r?.data&&!r.error){let l={data:{...r.data.data,employments:r.data.data.employments?.map(m=>({...m,title:t.estimation_title}))}};await y?.(l)}else throw{data:null,error:r?.error,fieldErrors:r?.fieldErrors,rawError:r?.rawError}}catch(t){let r=t,l=r.fieldErrors;if(c){let m=o?.meta?.fields,h=p(l,m);c({error:r.error,rawError:r.rawError,fieldErrors:h})}else w?.(r.error)}},"handleSubmit");return u(C,{...e,children:u("form",{id:V,onSubmit:e.handleSubmit(b),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:u(F,{fields:o?.fields??[]})})})}n(T,"CostCalculatorForm");export{T as a};
2
- //# sourceMappingURL=chunk-KJSZIASL.js.map
1
+ import{b as f}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-A7T27JCJ.js";import{b as p}from"./chunk-7XRPOR7L.js";import{g as C}from"./chunk-CNDSIADP.js";import{g as E}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as u}from"react/jsx-runtime";function T({onSubmit:S,onError:w,onSuccess:y,onErrorWithFields:c,shouldResetForm:d,resetFields:a}){let{form:e,formId:V,costCalculatorBag:o}=f(),{formState:{isSubmitSuccessful:s}}=e;R(()=>{if(s&&d){o?.resetForm(),e.reset();return}if(s&&a){let t={...e.getValues()};a.forEach(r=>{t[r]=""}),o?.resetForm(),e.reset(t)}},[s,e,d,o,a]);let b=n(async i=>{try{let t=o?.parseFormValues(i);o?.meta?.fields&&(o.meta.fields=E(i,o.fields),o.meta.fields.employer_currency_slug=o.meta.fields.currency);let r=await o?.onSubmit(t);if(await S?.(t),r?.data&&!r.error){let l={data:{...r.data.data,employments:r.data.data.employments?.map(m=>({...m,title:t.estimation_title}))}};await y?.(l)}else throw{data:null,error:r?.error,fieldErrors:r?.fieldErrors,rawError:r?.rawError}}catch(t){let r=t,l=r.fieldErrors;if(c){let m=o?.meta?.fields,h=p(l,m);c({error:r.error,rawError:r.rawError,fieldErrors:h})}else w?.(r.error)}},"handleSubmit");return u(C,{...e,children:u("form",{id:V,onSubmit:e.handleSubmit(b),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:u(F,{fields:o?.fields??[]})})})}n(T,"CostCalculatorForm");export{T as a};
2
+ //# sourceMappingURL=chunk-3XDJ2LRT.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-OOUYQLIE.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as i}from"react/jsx-runtime";var l=e(({currency:n,desiredCurrency:o,annual_gross_salary_conversion_properties:r,...a})=>i(s,{...a,sourceCurrency:n,targetCurrency:o,conversionFieldName:"annual_gross_salary_conversion",conversionProperties:{...r,description:r?.description||"Estimated amount. This is an estimation. We calculate conversions based on spot rates that are subject to fluctuation over time."},classNamePrefix:"RemoteFlows-AnnualGrossSalary",conversionType:"no_spread"}),"AnnualGrossSalary");export{l as a};
2
- //# sourceMappingURL=chunk-K4NAASBM.js.map
1
+ import{a as s}from"./chunk-NGTESOKF.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as i}from"react/jsx-runtime";var l=e(({currency:n,desiredCurrency:o,annual_gross_salary_conversion_properties:r,...a})=>i(s,{...a,sourceCurrency:n,targetCurrency:o,conversionFieldName:"annual_gross_salary_conversion",conversionProperties:{...r,description:r?.description||"Estimated amount. This is an estimation. We calculate conversions based on spot rates that are subject to fluctuation over time."},classNamePrefix:"RemoteFlows-AnnualGrossSalary",conversionType:"no_spread"}),"AnnualGrossSalary");export{l as a};
2
+ //# sourceMappingURL=chunk-4HT7RNFP.js.map
@@ -1,2 +1,2 @@
1
- import{b as g}from"./chunk-PGWKJ6FK.js";import{d as f,e as w}from"./chunk-VXPJXQP3.js";import{a as m}from"./chunk-7XRPOR7L.js";import{b as E}from"./chunk-E773NPNL.js";import{b as y}from"./chunk-3ZWDIEEM.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as R}from"react/jsx-runtime";function A({onSubmit:S,onSuccess:d,onError:o,render:u,...r}){let{components:I}=y(),{onboardingBag:t,setCreditScore:c}=g(),n=f(),i=w(),{mutateAsync:b}=m(n),{mutateAsync:_}=m(i),l=a(async()=>{try{if(await S?.(),t.creditRiskStatus==="deposit_required"&&t.employmentId&&t.employment?.status&&!t.isEmploymentReadOnly){let e=await _({employment_slug:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),c?.(s=>({...s,showReserveInvoice:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(t.employmentId){let e=await b({employment_id:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"invited"}),c?.(s=>({...s,showInviteSuccessful:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){o?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),p=t.creditRiskStatus==="deposit_required"&&t.employment?.status&&!t.isEmploymentReadOnly,v=I?.button;return v?R(v,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:e=>{l(),r.onClick?.(e)},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})}):R(E,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:()=>{l()},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})})}a(A,"OnboardingInvite");export{A as a};
2
- //# sourceMappingURL=chunk-2WDEVWIE.js.map
1
+ import{b as g}from"./chunk-PGWKJ6FK.js";import{d as f,e as w}from"./chunk-FBJCDOO7.js";import{a as m}from"./chunk-7XRPOR7L.js";import{b as E}from"./chunk-WVDTHFGS.js";import{b as y}from"./chunk-3ZWDIEEM.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as R}from"react/jsx-runtime";function A({onSubmit:S,onSuccess:d,onError:o,render:u,...r}){let{components:I}=y(),{onboardingBag:t,setCreditScore:c}=g(),n=f(),i=w(),{mutateAsync:b}=m(n),{mutateAsync:_}=m(i),l=a(async()=>{try{if(await S?.(),t.creditRiskStatus==="deposit_required"&&t.employmentId&&t.employment?.status&&!t.isEmploymentReadOnly){let e=await _({employment_slug:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),c?.(s=>({...s,showReserveInvoice:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(t.employmentId){let e=await b({employment_id:t.employmentId});if(e.data){await d?.({data:e.data,employmentStatus:"invited"}),c?.(s=>({...s,showInviteSuccessful:!0})),t.refetchEmployment();return}e.error&&o?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){o?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),p=t.creditRiskStatus==="deposit_required"&&t.employment?.status&&!t.isEmploymentReadOnly,v=I?.button;return v?R(v,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:e=>{l(),r.onClick?.(e)},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})}):R(E,{...r,disabled:n.isPending||i.isPending||r.disabled,onClick:()=>{l()},children:u({employmentStatus:p?"created_awaiting_reserve":"invited"})})}a(A,"OnboardingInvite");export{A as a};
2
+ //# sourceMappingURL=chunk-4NAVUB7D.js.map
@@ -1,2 +1,2 @@
1
- import{a as B}from"./chunk-BV3PGYSH.js";import{a as he,b as Ue,c as Ve,d as ze,e as Ge,f as Je,g as qe,h as Ke,i as Ye,j as ye,k as Xe,l as ve,m as Ce,o as xe,q as Qe,r as Ze,s as et}from"./chunk-D6X2WCEG.js";import{b as je}from"./chunk-HPHWQU34.js";import{a as _e,b as $}from"./chunk-E773NPNL.js";import{b}from"./chunk-3ZWDIEEM.js";import{a as re,b as ae,c as x,d as Le,e as He,f as Be,g as Ae,h as k,i as w,j as N,k as P,l as R,m as D}from"./chunk-CNDSIADP.js";import{g as Oe}from"./chunk-PAQW5BFW.js";import{a as _,e as ee}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Fragment as Ht,jsx as O,jsxs as ne}from"react/jsx-runtime";function se({name:e,defaultValue:t,description:a,label:o,onChange:l,multiple:d,options:c,component:F,...f}){let{components:i}=b(),{control:n}=x(),u=r((m,s,g)=>{let p=g.value?[...g.value]:[];s?p.includes(m)||g.onChange([...p,m]):g.onChange(p.filter(h=>h!==m))},"handleCheckboxChange");return O(k,{control:n,name:e,defaultValue:t,render:({field:m,fieldState:s})=>{let g=F||i?.checkbox;if(g){let p={name:e,description:a,label:o,defaultValue:t,multiple:d,options:c,...f};return O(g,{field:{...m,onChange:r(h=>{if(d){let{checked:S,value:C}=h.target;u(C,S,m),l?.(S);return}m.onChange(h),l?.(h)},"onChange")},fieldState:s,fieldData:p})}return ne(w,{"data-field":e,className:_(`RemoteFlows__CheckBoxField__Item__${e}`),children:[O(P,{children:ne(Ht,{children:[c&&d?O(N,{children:o}):null,c&&d?c.map(p=>ne("div",{className:"flex space-x-2",children:[O(he,{id:p.value,onCheckedChange:h=>{u(p.value,h===!0,m),l?.(h,p.value)},checked:m.value?.includes(p.value),className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:p.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:p.label})]},p.value)):ne("div",{className:"flex space-x-2",children:[O(he,{id:e,onCheckedChange:p=>{m.onChange(p),l?.(p)},checked:m.value,className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:o})]})]})}),a&&O(R,{children:a}),s.error&&O(D,{})]})}})}r(se,"CheckBoxField");import{CalendarIcon as Ut}from"lucide-react";import{PopoverClose as Vt}from"@radix-ui/react-popover";import{ChevronLeft as Bt,ChevronRight as Ot}from"lucide-react";import{DayPicker as At}from"react-day-picker";import{jsx as be}from"react/jsx-runtime";function tt({className:e,classNames:t,showOutsideDays:a=!0,...o}){return be(At,{showOutsideDays:a,className:_("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:_(_e({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:_("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:_(_e({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:r(({className:l,...d})=>be(Bt,{className:_("size-4",l),...d}),"IconLeft"),IconRight:r(({className:l,...d})=>be(Ot,{className:_("size-4",l),...d}),"IconRight")},...o})}r(tt,"Calendar");import*as A from"@radix-ui/react-popover";import{jsx as le}from"react/jsx-runtime";function ie({...e}){return le(A.Root,{"data-slot":"popover",...e})}r(ie,"Popover");function me({...e}){return le(A.Trigger,{"data-slot":"popover-trigger",...e})}r(me,"PopoverTrigger");function de({className:e,align:t="center",sideOffset:a=4,...o}){return le(A.Portal,{children:le(A.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:_("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o})})}r(de,"PopoverContent");import{format as ot}from"date-fns";import{Fragment as zt,jsx as E,jsxs as Se}from"react/jsx-runtime";function rt({description:e,label:t,name:a,minDate:o,onChange:l,component:d,...c}){let{components:F}=b(),{control:f}=x(),i;return c.meta?.mot&&typeof c.meta.mot=="number"?i=Oe(c.meta.mot):o&&(i=new Date(o)),E(k,{control:f,name:a,render:({field:n,fieldState:u})=>{let m=d||F?.date;if(m){let s={description:e,label:t,name:a,onChange:l,...i&&{minDate:i.toISOString()},...c};return E(m,{field:{...n,onChange:r(g=>{n.onChange(g),l?.(g)},"onChange")},fieldState:u,fieldData:s})}return Se(w,{"data-field":a,className:`flex flex-col RemoteFlows__DatePickerField__Item__${a}`,children:[E(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),Se(ie,{children:[E(me,{asChild:!0,children:E(P,{children:E("div",{children:Se($,{type:"button",variant:"outline",className:_("w-full pl-3 text-left font-normal",!n.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${a}`,children:[n.value&&E(zt,{children:ot(n.value,"yyyy-MM-dd")}),E(Ut,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),E(de,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:E(tt,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:n.value?new Date(n.value):void 0,onSelect:s=>{n.onChange(s?ot(s,"yyyy-MM-dd"):null),l?.(s)},defaultMonth:i,components:{DayContent:r(s=>E(Vt,{children:s.date.getDate()}),"DayContent")},...i&&{disabled:r(s=>s<i,"disabled")}})})]}),e?E(R,{children:e}):null,u.error&&E(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}r(rt,"DatePickerField");import{useState as Gt,useRef as Jt}from"react";import{Upload as qt,X as Kt}from"lucide-react";import{jsx as U,jsxs as ke}from"react/jsx-runtime";function at({onChange:e,className:t,multiple:a}){let[o,l]=Gt([]),d=Jt(null),c=r(i=>{i.preventDefault(),d.current?.click()},"handleClick"),F=r(i=>{if(i.target.files&&i.target.files.length>0){let n=Array.from(i.target.files);l(n),e(i)}},"handleChange"),f=r(i=>{l(n=>n.filter(u=>u!==i))},"onRemoveFile");return ke("div",{className:_("flex flex-col items-start gap-4",t),children:[U("input",{type:"file",ref:d,onChange:F,className:"hidden","aria-label":"File upload",multiple:a}),ke($,{type:"button",onClick:c,className:"gap-2",children:[U(qt,{className:"h-4 w-4"}),"Choose File"]}),o.length===0&&U("div",{className:"text-sm",children:a?U("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):U("span",{className:"font-medium",children:"No file selected."})}),o.length>0&&o.map((i,n)=>ke("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",U("span",{className:"font-medium",children:i.name})," (",Math.round(i.size/1024)," KB)",U($,{variant:"ghost",onClick:()=>f(i),children:U(Kt,{})})]},n))]})}r(at,"FileUploader");import{jsx as V,jsxs as jt}from"react/jsx-runtime";var Yt=r(e=>new Promise((t,a)=>{let o=new FileReader;o.readAsDataURL(e),o.onload=()=>t(o.result),o.onerror=l=>a(l)}),"toBase64"),nt=r(async e=>{let t=e.target.files?Array.from(e.target.files):[];return await Promise.all(t.map(async o=>{let l=await Yt(o);return{name:o.name,content:l.split(",")[1]}}))},"convertFilesToBase64");function st({name:e,description:t,label:a,multiple:o,onChange:l,component:d,...c}){let{components:F}=b(),{control:f}=x();return V(k,{control:f,name:e,render:({field:i,fieldState:n})=>{let u=d||F?.file;if(u){let m={name:e,description:t,label:a,multiple:o,...c};return V(u,{field:{...i,value:null,onChange:r(async s=>{let g=await nt(s);i.onChange(g),l?.(g)},"onChange")},fieldState:n,fieldData:m})}return jt(w,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[V(N,{className:"RemoteFlows__FileUpload__Label",children:a}),V(P,{children:V(at,{onChange:async m=>{let s=await nt(m);i.onChange(s),l?.(s)},multiple:o,className:_("RemoteFlows__FileUpload__Input")})}),t&&V("div",{className:"flex items-center justify-between",children:V(R,{className:"RemoteFlows__FileUpload__Description",children:t})}),n.error&&V(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}r(st,"FileUploadField");import{jsx as Ne}from"react/jsx-runtime";function ce(e){let{components:t}=b(),{control:a}=x(),o=e.component||t?.number;return o?Ne(k,{control:a,name:e.name,render:({field:l,fieldState:d})=>Ne(o,{field:{...l,onChange:r(c=>{l.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):Ne(B,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}r(ce,"NumberField");import{Fragment as Xt}from"react";import{jsx as W,jsxs as we}from"react/jsx-runtime";function lt({name:e,defaultValue:t,description:a,label:o,options:l,onChange:d,component:c,...F}){let{components:f}=b(),{control:i}=x();return W(k,{control:i,name:e,defaultValue:t,render:({field:n,fieldState:u})=>{let m=c||f?.radio;if(m){let s={name:e,defaultValue:t,description:a,label:o,options:l,...F};return W(m,{field:{...n,onChange:r(g=>{n.onChange(g),d?.(g)},"onChange")},fieldState:u,fieldData:s})}return we(w,{className:_("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[W(N,{children:o}),W(P,{children:W(Ue,{"aria-label":o||e,onValueChange:s=>{n.onChange(s),d?.(s)},value:n.value,className:"flex flex-col space-y-3",children:l?.map(s=>W(Xt,{children:we(w,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[W(P,{children:W(Ve,{value:s.value,className:"RemoteFlows__RadioField__Input",disabled:s.disabled})}),we("div",{children:[W(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:s.label}),s.description&&W(R,{className:"mt-2",children:s.description})]})]})},s.value))})}),a&&W(R,{children:a}),u.error&&W(D,{})]})}})}r(lt,"RadioGroupField");import{jsx as M,jsxs as it}from"react/jsx-runtime";function mt({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,component:c,...F}){let{control:f}=x(),{components:i}=b();return M(k,{defaultValue:o,control:f,name:t,render:({field:n,fieldState:u})=>{let m=c||i?.select;if(m){let s={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,...F};return M(m,{field:{...n,onChange:r(g=>{let p=F.jsonType==="number"?Number(g):g;n.onChange(p),d?.(p)},"onChange")},fieldState:u,fieldData:s})}return it(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[M(N,{className:"RemoteFlows__SelectField__Label",children:e}),M(P,{children:M("div",{className:"relative",children:it(ze,{value:n.value||"",onValueChange:s=>{let g=F.jsonType==="number"?Number(s):s;n.onChange(g),d?.(g)},children:[M(qe,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!u.error,"aria-label":e,children:M("span",{className:"absolute",children:M(Je,{placeholder:e})})}),M(Ke,{className:"RemoteFlows__SelectField__Content",children:M(Ge,{className:"RemoteFlows__SelectField__Group",children:a.map(s=>M(Ye,{value:s.value,className:"RemoteFlows__SelectField__SelectItem",disabled:s.disabled,children:s.label},s.value))})})]})})}),l&&M(R,{children:l}),u.error&&M(D,{})]})}})}r(mt,"SelectField");import{useState as ro}from"react";import{Fragment as Qt,useState as Zt}from"react";import{Check as eo,ChevronDownIcon as to,X as oo}from"lucide-react";import{Command as Y}from"cmdk";import{SearchIcon as jr}from"lucide-react";import{jsx as j,jsxs as ea}from"react/jsx-runtime";function dt({className:e,...t}){return j(Y,{"data-slot":"command",className:_("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}r(dt,"Command");function ct({className:e,...t}){return j(Y.List,{"data-slot":"command-list",className:_("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}r(ct,"CommandList");function ut({...e}){return j(Y.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}r(ut,"CommandEmpty");function pt({className:e,...t}){return j(Y.Group,{"data-slot":"command-group",className:_("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}r(pt,"CommandGroup");function ft({className:e,...t}){return j(Y.Separator,{"data-slot":"command-separator",className:_("bg-border -mx-1 h-px",e),...t})}r(ft,"CommandSeparator");function Ft({className:e,...t}){return j(Y.Item,{"data-slot":"command-item",className:_("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}r(Ft,"CommandItem");import{jsx as L,jsxs as X}from"react/jsx-runtime";function ue({options:e,selected:t,onChange:a,placeholder:o,...l}){let[d,c]=Zt(!1),F=r(n=>{a(t.filter(u=>u.value!==n.value))},"handleUnselect"),f=e.some(n=>n.category),i=e.reduce((n,u)=>{let m=u.category||"Uncategorized";return n[m]||(n[m]=[]),n[m].push(u),n},{});return X(ie,{open:d,onOpenChange:c,...l,children:[L(me,{children:X($,{variant:"outline",role:"combobox","aria-expanded":d,className:"w-full justify-between font-normal",type:"button",children:[L("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(n=>X(je,{variant:"secondary",className:"mr-1 mb-1",children:[n.label,L("div",{role:"button",tabIndex:0,"aria-label":`remove ${n.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:u=>{u.key==="Enter"&&F(n)},onMouseDown:u=>{u.preventDefault(),u.stopPropagation()},onClick:()=>F(n),children:L(oo,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},n.label)):L("span",{className:"text-foreground",children:o})}),L(to,{className:"size-4"})]})}),L(de,{align:"start",className:"w-full p-0",children:L(dt,{children:X(ct,{children:[L(ut,{children:"No item found."}),Object.entries(i).map(([n,u],m)=>X(Qt,{children:[m>0&&L(ft,{}),L(pt,{heading:f?n:void 0,children:u.map(s=>{let g=t.some(p=>p.value===s.value);return X(Ft,{onSelect:()=>{a(g?t.filter(p=>p.value!==s.value):[...t,s])},children:[L(eo,{className:_("mr-2 h-4 w-4",g?"opacity-100":"opacity-0")}),s.label]},s.label)})})]},n))]})})})]})}r(ue,"MultiSelect");import{jsx as J,jsxs as ao}from"react/jsx-runtime";function gt({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,$meta:c,component:F,...f}){let{control:i}=x(),{components:n}=b(),[u,m]=ro([]);return J(k,{defaultValue:o,control:i,name:t,render:({field:s,fieldState:g})=>{let p=F||n?.countries;if(p){let C={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,$meta:c,...f};return J(p,{field:{...s,onChange:r(T=>{s.onChange(T),d?.(T)},"onChange")},fieldState:g,fieldData:C})}let h=[...Object.entries(c?.regions||{}).map(([C,T])=>({value:T,label:C,category:"Regions"})),...Object.entries(c?.subregions||{}).map(([C,T])=>({value:T,label:C,category:"Subregions"})),...a.map(C=>({...C,value:C.value,label:C.label,category:"Countries"}))],S=r(C=>{let T=C.map(({value:G})=>G);s.onChange(T),d?.(T),m(C)},"handleChange");return ao(w,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[J(N,{className:"RemoteFlows__CountryField__Label",children:e}),J(P,{children:J(ue,{options:h,selected:u,onChange:S,...f})}),l&&J(R,{children:l}),g.error&&J(D,{})]})}})}r(gt,"CountryField");import*as ht from"react";import{jsx as no}from"react/jsx-runtime";var Pe=ht.forwardRef(({className:e,...t},a)=>no("textarea",{className:_("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...t}));Pe.displayName="Textarea";import{jsx as q,jsxs as Re}from"react/jsx-runtime";function _t({name:e,description:t,label:a,onChange:o,maxLength:l,component:d,...c}){let{components:F}=b(),{control:f}=x();return q(k,{control:f,name:e,render:({field:i,fieldState:n})=>{let u=d||F?.textarea;if(u){let s={name:e,description:t,label:a,maxLength:l,...c};return q(u,{field:{...i,onChange:r(g=>{i.onChange(g),o?.(g)},"onChange")},fieldState:n,fieldData:s})}let m=i.value?.length??0;return Re(w,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[q(N,{className:"RemoteFlows__TextArea__Label",children:a}),q(P,{children:q(Pe,{...i,value:i.value??"",onChange:s=>{i.onChange(s),o?.(s)},className:_(n.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:a})}),(t||l)&&Re("div",{className:"flex items-center justify-between",children:[t&&q(R,{className:"RemoteFlows__TextArea__Description",children:t}),l&&Re("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[m,"/",l]})]}),n.error&&q(D,{className:"RemoteFlows__TextArea__Error"})]})}})}r(_t,"TextAreaField");import{jsx as De}from"react/jsx-runtime";function yt(e){let{components:t}=b(),{control:a}=x(),o=e.component||t?.email;return o?De(k,{control:a,name:e.name,render:({field:l,fieldState:d})=>De(o,{field:{...l,onChange:r(c=>{l.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):De(B,{...e,type:"email"})}r(yt,"EmailField");import{jsx as vt}from"react/jsx-runtime";function Ct(e){let{control:t}=x();return vt(k,{control:t,name:e.name,render:({field:a})=>vt("input",{...a,type:"hidden"})})}r(Ct,"HiddenField");import po,{useEffect as fo,useState as Dt}from"react";var xt=r((e,t,a)=>{if(e&&"reportValidity"in e){let o=re(a,t);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},"r"),Te=r((e,t)=>{for(let a in t.fields){let o=t.fields[a];o&&o.ref&&"reportValidity"in o.ref?xt(o.ref,a,e):o&&o.refs&&o.refs.forEach(l=>xt(l,a,e))}},"o"),St=r((e,t)=>{t.shouldUseNativeValidation&&Te(e,t);let a={};for(let o in e){let l=re(t.fields,o),d=Object.assign(e[o]||{},{ref:l&&l.ref});if(so(t.names||Object.keys(e),o)){let c=Object.assign({},re(a,o));ae(c,"root",d),ae(a,o,c)}else ae(a,o,d)}return a},"s"),so=r((e,t)=>{let a=bt(t);return e.some(o=>bt(o).match(`^${a}\\.\\d+`))},"i");function bt(e){return e.replace(/\]|\[/g,"")}r(bt,"n");function kt(e,t,a){return t===void 0&&(t={}),a===void 0&&(a={}),function(o,l,d){try{return Promise.resolve(function(c,F){try{var f=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[a.mode==="sync"?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:l}))).then(function(i){return d.shouldUseNativeValidation&&Te({},d),{values:a.raw?Object.assign({},o):i,errors:{}}}))}catch(i){return F(i)}return f&&f.then?f.then(void 0,F):f}(0,function(c){if(!c.inner)throw c;return{values:{},errors:St((F=c,f=!d.shouldUseNativeValidation&&d.criteriaMode==="all",(F.inner||[]).reduce(function(i,n){if(i[n.path]||(i[n.path]={message:n.message,type:n.type}),f){var u=i[n.path].types,m=u&&u[n.type];i[n.path]=Le(n.path,f,i,n.type,m?[].concat(m,n.message):n.message)}return i},{})),d)};var F,f}))}catch(c){return Promise.reject(c)}}}r(kt,"o");import*as I from"yup";import Nt from"lodash.groupby";import Q from"lodash.capitalize";var wt=60,pe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function lo(e){if(e<60)return`${e}m`;let t=Math.floor(e/wt),a=e%wt;return a>0?`${t}h${a}m`:`${t}h`}r(lo,"convertBreakDurationToHours");function Pt(e){let t=e.reduce((a,o)=>o.hours+a,0);return Number(t.toFixed(2))}r(Pt,"calculateTotalWorkHours");function io(e,t){let a=t.map(({day:d})=>d.toLowerCase()),o=a.indexOf(e),l=null;for(;o<a.length&&!l;){let d=a[o],c=a[o+1],F=pe.indexOf(d)+1;pe[F]===c||(l=d),o+=1}return l}r(io,"findLastConsecutiveDay");function mo(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}r(mo,"shouldSummarizeSchedule");function co(e){return Number.parseInt(e.break_duration_minutes)>0}r(co,"shouldSummarizeBreaks");function Rt(e){let t=e.filter(mo),a=Nt(t,F=>`${F.start_time}|${F.end_time}`),o=e.filter(co),l=Nt(o,"break_duration_minutes"),d=Object.keys(a).map(F=>{let f=a[F],i=f[0].day,[n,u]=F.split("|"),m=`from <span>${n.replace(":","h")}</span> to <span>${u.replace(":","h")}</span>`,s=io(i,f),p=(s?f.findIndex(h=>h.day===s):-1)===f.length-1;return f.length===1?`${Q(i)}, ${m}`:!p||!s?f.reduce((h,S,C)=>{let T=Q(S.day);return C===f.length-1?`${h}and ${T}, ${m}`:`${h}<span>${T}</span>, `},""):`<span>${Q(i)}</span> to <span>${Q(s)}</span>, ${m}`}),c=Object.keys(l).reverse().map((F,f)=>{let i=f===0,n=l[F],u=lo(parseInt(F,10));if(Object.keys(l).length===1)return`With ${u} daily breaks`;if(n.length===1){let m=`${u} break on ${Q(n[0].day)}.`;return i?`With ${m}`:m}return n.reduce((m,s,g)=>{let p=Q(s.day);return g===0?`${m} ${p}`:g===n.length-1?`${m}, and ${p}.`:`${m}, ${p}`},i?`With ${u} break on`:`${u} break on`)});return{workHoursSummary:d,breakSummary:c}}r(Rt,"buildWorkScheduleSummary");function Ie(e){let{checked:t,start_time:a,end_time:o,break_duration_minutes:l}=e;if(!t)return 0;let[d,c]=a.split(":").map(Number),[F,f]=o.split(":").map(Number),i=d*60+c,m=(F*60+f-i-Number.parseInt(l||"0"))/60;return m===Math.floor(m)?m:Number(m.toFixed(2))}r(Ie,"calculateHours");var uo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function fe(e){return uo[e]}r(fe,"getShortWeekday");import{jsx as y,jsxs as H}from"react/jsx-runtime";var Fo=I.object({day:I.string().required(),checked:I.boolean().required(),start_time:I.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),end_time:I.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),hours:I.number().default(0),break_duration_minutes:I.string().default("0")}),go=I.object({schedule:I.array(Fo)});function ho({defaultSchedule:e,onSubmit:t}){let[a,o]=Dt(!1),l=pe.map(p=>{let h=e.find(S=>S.day.toLowerCase()===fe(p).toLowerCase()||S.day.toLowerCase()===p.toLowerCase());return h?{...h,day:fe(p),checked:!0}:{...e[0],checked:!1,day:fe(p)}}),d=Be({defaultValues:{schedule:l},resolver:kt(go)}),{handleSubmit:c,watch:F,reset:f,control:i,formState:n}=d,{fields:u}=He({name:"schedule",control:i}),m=F("schedule");function s(p){let h=p.schedule.filter(({checked:S})=>S).map(S=>({...S,hours:Ie(S)}));t(h),o(!1)}r(s,"handleSubmitWorkingHours");function g(){f(),o(!1)}return r(g,"handleCancel"),y("div",{className:"flex items-center justify-between",children:H(ye,{open:a,onOpenChange:o,children:[y(Xe,{asChild:!0,children:y($,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),H(ve,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[y(Ce,{children:y(xe,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),y(Ae,{...d,children:H("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[H("div",{className:"rounded-lg",children:[y("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),H("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[y("div",{className:"col-span-2"}),y("div",{className:"col-span-3 text-center",children:"START"}),y("div",{className:"col-span-1 text-center"}),y("div",{className:"col-span-3 text-center",children:"END"}),y("div",{className:"col-span-2 text-center",children:"HOURS"})]}),y("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:u.map((p,h)=>{let S=m[h],C=Ie(S);return H(po.Fragment,{children:[H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[y("div",{className:"col-span-2 flex items-center gap-3",children:y(se,{label:p.day,name:`schedule.${h}.checked`})}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${h}.start_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${h}.end_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(C)?"-":`${C} hours`})]}),H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[y("div",{className:"col-span-2 text-gray-500",children:"Break"}),y("div",{className:"col-span-2",children:y(B,{name:`schedule.${h}.break_duration_minutes`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-gray-500",children:"minutes"}),y("div",{className:"col-span-4"})]})]},p.id)})})]}),Object.keys(n.errors).length>0&&y("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),H("div",{className:"flex gap-4 pt-4",children:[y($,{type:"button",className:"reset-button",variant:"outline",onClick:g,children:"Cancel"}),y($,{type:"button",className:"submit-button",onClick:c(s),children:"Save Schedule"})]})]})})]})]})})}r(ho,"WorkScheduleSelectionForm");function Tt(e){let{components:t}=b(),{setValue:a,control:o,watch:l}=x(),d=l(e.name),[c,F]=Dt(d),{workHoursSummary:f,breakSummary:i}=Rt(c),n=Pt(c);fo(()=>{a(e.name,c)},[c,e.name,a]);function u(s){F(s)}r(u,"onSubmit");let m=e.component||t?.["work-schedule"];return m?y(k,{control:o,name:e.name,render:({field:s,fieldState:g})=>y(m,{field:{...s,onChange:r(p=>{s.onChange(p),e.onChange?.(p)},"onChange")},fieldState:g,fieldData:{...e,defaultFormattedValue:{workHoursSummary:f,breakSummary:i,totalWorkHours:n}}})}):H("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[y("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),H("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:f.join(", ")}}),y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:i.join()}),H("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",y("span",{children:n})," hours per week"]}),y(ho,{defaultSchedule:c,onSubmit:u})]})]})}r(Tt,"WorkScheduleField");import{useState as _o}from"react";import{jsx as K,jsxs as yo}from"react/jsx-runtime";function It({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,component:c,...F}){let{control:f}=x(),{components:i}=b(),[n,u]=_o();return K(k,{defaultValue:o,control:f,name:t,render:({field:m,fieldState:s})=>{let g=c||i?.["multi-select"];if(g){let h={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,...F};return K(g,{field:{...m,onChange:r(S=>{m.onChange(S),d?.(S)},"onChange")},fieldState:s,fieldData:h})}let p=n||a.filter(h=>m.value.includes(h.value));return yo(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[K(N,{className:"RemoteFlows__SelectField__Label",children:e}),K(P,{children:K(ue,{options:a,selected:p,onChange:h=>{let S=h.map(({value:C})=>C);m.onChange(S),d?.(S),u(h)},...F})}),l&&K(R,{children:l}),s.error&&K(D,{})]})}})}r(It,"MultiSelectField");import{jsx as vo}from"react/jsx-runtime";var $t=r(e=>vo(ce,{maxLength:15,...e}),"MoneyField");var $e={checkbox:se,text:B,email:yt,money:$t,select:mt,"multi-select":It,radio:lt,number:ce,file:st,date:rt,textarea:_t,countries:gt,hidden:Ct,"work-schedule":Tt};import{AlertCircle as Co}from"lucide-react";import{jsx as Fe,jsxs as xo}from"react/jsx-runtime";function Et({title:e,description:t,severity:a}){let{components:o}=b();if(o?.statement){let l=o?.statement;return Fe(l,{data:{title:e,description:ee(t),severity:a}})}return xo(Qe,{variant:"warning",children:[Fe(Co,{className:"h-4 w-4"}),e&&Fe(Ze,{children:e}),t&&Fe(et,{dangerouslySetInnerHTML:{__html:ee(t)}})]})}r(Et,"Statement");import{Fragment as bo,useEffect as So,useRef as Mt}from"react";import{jsx as z,jsxs as te}from"react/jsx-runtime";var ko=r(({isExpanded:e,onToggle:t,className:a,...o})=>z($,{type:"button",className:_("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",a),variant:"default",onClick:t,...o,children:e?"Remove":"Define"}),"DefaultToggleButton");function ss({label:e,name:t,fields:a,description:o,components:l,statement:d,isFlatFieldset:c,extra:F,variant:f="outset",features:i}){let{watch:n,setValue:u,trigger:m,formState:s}=x(),{components:g}=b(),p=i?.toggle?.stateField,h=p?n(p):i?.toggle?.defaultExpanded??!0,S=a.map(({name:v})=>`${t}.${v}`),C=n(S),T=Mt(C),G=Mt(null),Wt=r(()=>{p&&u(p,!h)},"toggleExpanded");So(()=>{let v=C,oe=T.current,ge=s.isSubmitted||s.submitCount>0,We=!1;for(let Z=0;Z<v.length;Z++)if(v[Z]!==void 0&&oe[Z]!==v[Z]){We=!0;break}return We&&ge&&(G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{m()},50)),T.current=[...v],()=>{G.current&&clearTimeout(G.current)}},[C,m,s.isSubmitted,s.submitCount]);let Lt=g?.fieldsetToggle||ko,Ee=`${t}-content`,Me=`${t}-header`;return te("fieldset",{className:_("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[z("legend",{className:_("text-sm font-semibold px-2",f==="inset"&&"hidden"),children:e}),f==="inset"&&te("div",{className:"RemoteFlows__FieldSetField__Header",id:Me,"data-state":h?"expanded":"collapsed","aria-expanded":h,children:[z("h3",{className:_("RemoteFlows__FieldSetField__Title"),children:e}),i?.toggle?.enabled&&z(Lt,{isExpanded:h,onToggle:Wt,"aria-expanded":h,"aria-controls":Ee,"aria-label":`${h?"Hide":"Show"} ${e}`,className:_("RemoteFlows__FieldSetField__Toggle",i.toggle?.className),children:h?i.toggle.labels?.collapse??"Remove":i.toggle.labels?.expand??"Define"})]}),h&&te("div",{id:Ee,"aria-labelledby":Me,role:"region",children:[o?z("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:ee(o)}}):null,te("div",{className:"grid gap-4",children:[a.map(v=>{v.calculateDynamicProperties&&(v={...v,...v.calculateDynamicProperties(C,v)||{}});let oe=$e[v.type];if(v.isVisible===!1||v.deprecated)return null;if(v.Component){let{Component:ge}=v;return z(ge,{...v},v.name)}return v.type==="select"&&v.multiple&&(oe=$e["multi-select"]),te(bo,{children:[z(oe,{...v,name:`${c?v.name:`${t}.${v.name}`}`,component:l?.[v.type]}),v.extra?v.extra:null]},`${c?v.name:`${t}.${v.name}`}`)}),F||null,d?z(Et,{...d}):null]})]})]})}r(ss,"FieldSetField");export{$e as a,Et as b,ss as c};
2
- //# sourceMappingURL=chunk-QU3NSFU5.js.map
1
+ import{a as B}from"./chunk-BV3PGYSH.js";import{a as he,b as Ue,c as Ve,d as ze,e as Ge,f as Je,g as qe,h as Ke,i as Ye,j as ye,k as Xe,l as ve,m as Ce,o as xe,q as Qe,r as Ze,s as et}from"./chunk-D6X2WCEG.js";import{b as je}from"./chunk-HPHWQU34.js";import{a as _e,b as $}from"./chunk-WVDTHFGS.js";import{b}from"./chunk-3ZWDIEEM.js";import{a as re,b as ae,c as x,d as Le,e as He,f as Be,g as Ae,h as k,i as w,j as N,k as P,l as R,m as D}from"./chunk-CNDSIADP.js";import{g as Oe}from"./chunk-PAQW5BFW.js";import{a as _,e as ee}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Fragment as Ht,jsx as O,jsxs as ne}from"react/jsx-runtime";function se({name:e,defaultValue:t,description:a,label:o,onChange:l,multiple:d,options:c,component:F,...f}){let{components:i}=b(),{control:n}=x(),u=r((m,s,g)=>{let p=g.value?[...g.value]:[];s?p.includes(m)||g.onChange([...p,m]):g.onChange(p.filter(h=>h!==m))},"handleCheckboxChange");return O(k,{control:n,name:e,defaultValue:t,render:({field:m,fieldState:s})=>{let g=F||i?.checkbox;if(g){let p={name:e,description:a,label:o,defaultValue:t,multiple:d,options:c,...f};return O(g,{field:{...m,onChange:r(h=>{if(d){let{checked:S,value:C}=h.target;u(C,S,m),l?.(S);return}m.onChange(h),l?.(h)},"onChange")},fieldState:s,fieldData:p})}return ne(w,{"data-field":e,className:_(`RemoteFlows__CheckBoxField__Item__${e}`),children:[O(P,{children:ne(Ht,{children:[c&&d?O(N,{children:o}):null,c&&d?c.map(p=>ne("div",{className:"flex space-x-2",children:[O(he,{id:p.value,onCheckedChange:h=>{u(p.value,h===!0,m),l?.(h,p.value)},checked:m.value?.includes(p.value),className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:p.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:p.label})]},p.value)):ne("div",{className:"flex space-x-2",children:[O(he,{id:e,onCheckedChange:p=>{m.onChange(p),l?.(p)},checked:m.value,className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:o})]})]})}),a&&O(R,{children:a}),s.error&&O(D,{})]})}})}r(se,"CheckBoxField");import{CalendarIcon as Ut}from"lucide-react";import{PopoverClose as Vt}from"@radix-ui/react-popover";import{ChevronLeft as Bt,ChevronRight as Ot}from"lucide-react";import{DayPicker as At}from"react-day-picker";import{jsx as be}from"react/jsx-runtime";function tt({className:e,classNames:t,showOutsideDays:a=!0,...o}){return be(At,{showOutsideDays:a,className:_("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:_(_e({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:_("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",o.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:_(_e({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:r(({className:l,...d})=>be(Bt,{className:_("size-4",l),...d}),"IconLeft"),IconRight:r(({className:l,...d})=>be(Ot,{className:_("size-4",l),...d}),"IconRight")},...o})}r(tt,"Calendar");import*as A from"@radix-ui/react-popover";import{jsx as le}from"react/jsx-runtime";function ie({...e}){return le(A.Root,{"data-slot":"popover",...e})}r(ie,"Popover");function me({...e}){return le(A.Trigger,{"data-slot":"popover-trigger",...e})}r(me,"PopoverTrigger");function de({className:e,align:t="center",sideOffset:a=4,...o}){return le(A.Portal,{children:le(A.Content,{"data-slot":"popover-content",align:t,sideOffset:a,className:_("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o})})}r(de,"PopoverContent");import{format as ot}from"date-fns";import{Fragment as zt,jsx as E,jsxs as Se}from"react/jsx-runtime";function rt({description:e,label:t,name:a,minDate:o,onChange:l,component:d,...c}){let{components:F}=b(),{control:f}=x(),i;return c.meta?.mot&&typeof c.meta.mot=="number"?i=Oe(c.meta.mot):o&&(i=new Date(o)),E(k,{control:f,name:a,render:({field:n,fieldState:u})=>{let m=d||F?.date;if(m){let s={description:e,label:t,name:a,onChange:l,...i&&{minDate:i.toISOString()},...c};return E(m,{field:{...n,onChange:r(g=>{n.onChange(g),l?.(g)},"onChange")},fieldState:u,fieldData:s})}return Se(w,{"data-field":a,className:`flex flex-col RemoteFlows__DatePickerField__Item__${a}`,children:[E(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),Se(ie,{children:[E(me,{asChild:!0,children:E(P,{children:E("div",{children:Se($,{type:"button",variant:"outline",className:_("w-full pl-3 text-left font-normal",!n.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${a}`,children:[n.value&&E(zt,{children:ot(n.value,"yyyy-MM-dd")}),E(Ut,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),E(de,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:E(tt,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:n.value?new Date(n.value):void 0,onSelect:s=>{n.onChange(s?ot(s,"yyyy-MM-dd"):null),l?.(s)},defaultMonth:i,components:{DayContent:r(s=>E(Vt,{children:s.date.getDate()}),"DayContent")},...i&&{disabled:r(s=>s<i,"disabled")}})})]}),e?E(R,{children:e}):null,u.error&&E(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}r(rt,"DatePickerField");import{useState as Gt,useRef as Jt}from"react";import{Upload as qt,X as Kt}from"lucide-react";import{jsx as U,jsxs as ke}from"react/jsx-runtime";function at({onChange:e,className:t,multiple:a}){let[o,l]=Gt([]),d=Jt(null),c=r(i=>{i.preventDefault(),d.current?.click()},"handleClick"),F=r(i=>{if(i.target.files&&i.target.files.length>0){let n=Array.from(i.target.files);l(n),e(i)}},"handleChange"),f=r(i=>{l(n=>n.filter(u=>u!==i))},"onRemoveFile");return ke("div",{className:_("flex flex-col items-start gap-4",t),children:[U("input",{type:"file",ref:d,onChange:F,className:"hidden","aria-label":"File upload",multiple:a}),ke($,{type:"button",onClick:c,className:"gap-2",children:[U(qt,{className:"h-4 w-4"}),"Choose File"]}),o.length===0&&U("div",{className:"text-sm",children:a?U("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):U("span",{className:"font-medium",children:"No file selected."})}),o.length>0&&o.map((i,n)=>ke("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",U("span",{className:"font-medium",children:i.name})," (",Math.round(i.size/1024)," KB)",U($,{variant:"ghost",onClick:()=>f(i),children:U(Kt,{})})]},n))]})}r(at,"FileUploader");import{jsx as V,jsxs as jt}from"react/jsx-runtime";var Yt=r(e=>new Promise((t,a)=>{let o=new FileReader;o.readAsDataURL(e),o.onload=()=>t(o.result),o.onerror=l=>a(l)}),"toBase64"),nt=r(async e=>{let t=e.target.files?Array.from(e.target.files):[];return await Promise.all(t.map(async o=>{let l=await Yt(o);return{name:o.name,content:l.split(",")[1]}}))},"convertFilesToBase64");function st({name:e,description:t,label:a,multiple:o,onChange:l,component:d,...c}){let{components:F}=b(),{control:f}=x();return V(k,{control:f,name:e,render:({field:i,fieldState:n})=>{let u=d||F?.file;if(u){let m={name:e,description:t,label:a,multiple:o,...c};return V(u,{field:{...i,value:null,onChange:r(async s=>{let g=await nt(s);i.onChange(g),l?.(g)},"onChange")},fieldState:n,fieldData:m})}return jt(w,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[V(N,{className:"RemoteFlows__FileUpload__Label",children:a}),V(P,{children:V(at,{onChange:async m=>{let s=await nt(m);i.onChange(s),l?.(s)},multiple:o,className:_("RemoteFlows__FileUpload__Input")})}),t&&V("div",{className:"flex items-center justify-between",children:V(R,{className:"RemoteFlows__FileUpload__Description",children:t})}),n.error&&V(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}r(st,"FileUploadField");import{jsx as Ne}from"react/jsx-runtime";function ce(e){let{components:t}=b(),{control:a}=x(),o=e.component||t?.number;return o?Ne(k,{control:a,name:e.name,render:({field:l,fieldState:d})=>Ne(o,{field:{...l,onChange:r(c=>{l.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):Ne(B,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}r(ce,"NumberField");import{Fragment as Xt}from"react";import{jsx as W,jsxs as we}from"react/jsx-runtime";function lt({name:e,defaultValue:t,description:a,label:o,options:l,onChange:d,component:c,...F}){let{components:f}=b(),{control:i}=x();return W(k,{control:i,name:e,defaultValue:t,render:({field:n,fieldState:u})=>{let m=c||f?.radio;if(m){let s={name:e,defaultValue:t,description:a,label:o,options:l,...F};return W(m,{field:{...n,onChange:r(g=>{n.onChange(g),d?.(g)},"onChange")},fieldState:u,fieldData:s})}return we(w,{className:_("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[W(N,{children:o}),W(P,{children:W(Ue,{"aria-label":o||e,onValueChange:s=>{n.onChange(s),d?.(s)},value:n.value,className:"flex flex-col space-y-3",children:l?.map(s=>W(Xt,{children:we(w,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[W(P,{children:W(Ve,{value:s.value,className:"RemoteFlows__RadioField__Input",disabled:s.disabled})}),we("div",{children:[W(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:s.label}),s.description&&W(R,{className:"mt-2",children:s.description})]})]})},s.value))})}),a&&W(R,{children:a}),u.error&&W(D,{})]})}})}r(lt,"RadioGroupField");import{jsx as M,jsxs as it}from"react/jsx-runtime";function mt({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,component:c,...F}){let{control:f}=x(),{components:i}=b();return M(k,{defaultValue:o,control:f,name:t,render:({field:n,fieldState:u})=>{let m=c||i?.select;if(m){let s={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,...F};return M(m,{field:{...n,onChange:r(g=>{let p=F.jsonType==="number"?Number(g):g;n.onChange(p),d?.(p)},"onChange")},fieldState:u,fieldData:s})}return it(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[M(N,{className:"RemoteFlows__SelectField__Label",children:e}),M(P,{children:M("div",{className:"relative",children:it(ze,{value:n.value||"",onValueChange:s=>{let g=F.jsonType==="number"?Number(s):s;n.onChange(g),d?.(g)},children:[M(qe,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!u.error,"aria-label":e,children:M("span",{className:"absolute",children:M(Je,{placeholder:e})})}),M(Ke,{className:"RemoteFlows__SelectField__Content",children:M(Ge,{className:"RemoteFlows__SelectField__Group",children:a.map(s=>M(Ye,{value:s.value,className:"RemoteFlows__SelectField__SelectItem",disabled:s.disabled,children:s.label},s.value))})})]})})}),l&&M(R,{children:l}),u.error&&M(D,{})]})}})}r(mt,"SelectField");import{useState as ro}from"react";import{Fragment as Qt,useState as Zt}from"react";import{Check as eo,ChevronDownIcon as to,X as oo}from"lucide-react";import{Command as Y}from"cmdk";import{SearchIcon as jr}from"lucide-react";import{jsx as j,jsxs as ea}from"react/jsx-runtime";function dt({className:e,...t}){return j(Y,{"data-slot":"command",className:_("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}r(dt,"Command");function ct({className:e,...t}){return j(Y.List,{"data-slot":"command-list",className:_("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}r(ct,"CommandList");function ut({...e}){return j(Y.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}r(ut,"CommandEmpty");function pt({className:e,...t}){return j(Y.Group,{"data-slot":"command-group",className:_("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}r(pt,"CommandGroup");function ft({className:e,...t}){return j(Y.Separator,{"data-slot":"command-separator",className:_("bg-border -mx-1 h-px",e),...t})}r(ft,"CommandSeparator");function Ft({className:e,...t}){return j(Y.Item,{"data-slot":"command-item",className:_("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}r(Ft,"CommandItem");import{jsx as L,jsxs as X}from"react/jsx-runtime";function ue({options:e,selected:t,onChange:a,placeholder:o,...l}){let[d,c]=Zt(!1),F=r(n=>{a(t.filter(u=>u.value!==n.value))},"handleUnselect"),f=e.some(n=>n.category),i=e.reduce((n,u)=>{let m=u.category||"Uncategorized";return n[m]||(n[m]=[]),n[m].push(u),n},{});return X(ie,{open:d,onOpenChange:c,...l,children:[L(me,{children:X($,{variant:"outline",role:"combobox","aria-expanded":d,className:"w-full justify-between font-normal",type:"button",children:[L("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(n=>X(je,{variant:"secondary",className:"mr-1 mb-1",children:[n.label,L("div",{role:"button",tabIndex:0,"aria-label":`remove ${n.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:u=>{u.key==="Enter"&&F(n)},onMouseDown:u=>{u.preventDefault(),u.stopPropagation()},onClick:()=>F(n),children:L(oo,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},n.label)):L("span",{className:"text-foreground",children:o})}),L(to,{className:"size-4"})]})}),L(de,{align:"start",className:"w-full p-0",children:L(dt,{children:X(ct,{children:[L(ut,{children:"No item found."}),Object.entries(i).map(([n,u],m)=>X(Qt,{children:[m>0&&L(ft,{}),L(pt,{heading:f?n:void 0,children:u.map(s=>{let g=t.some(p=>p.value===s.value);return X(Ft,{onSelect:()=>{a(g?t.filter(p=>p.value!==s.value):[...t,s])},children:[L(eo,{className:_("mr-2 h-4 w-4",g?"opacity-100":"opacity-0")}),s.label]},s.label)})})]},n))]})})})]})}r(ue,"MultiSelect");import{jsx as J,jsxs as ao}from"react/jsx-runtime";function gt({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,$meta:c,component:F,...f}){let{control:i}=x(),{components:n}=b(),[u,m]=ro([]);return J(k,{defaultValue:o,control:i,name:t,render:({field:s,fieldState:g})=>{let p=F||n?.countries;if(p){let C={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,$meta:c,...f};return J(p,{field:{...s,onChange:r(T=>{s.onChange(T),d?.(T)},"onChange")},fieldState:g,fieldData:C})}let h=[...Object.entries(c?.regions||{}).map(([C,T])=>({value:T,label:C,category:"Regions"})),...Object.entries(c?.subregions||{}).map(([C,T])=>({value:T,label:C,category:"Subregions"})),...a.map(C=>({...C,value:C.value,label:C.label,category:"Countries"}))],S=r(C=>{let T=C.map(({value:G})=>G);s.onChange(T),d?.(T),m(C)},"handleChange");return ao(w,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[J(N,{className:"RemoteFlows__CountryField__Label",children:e}),J(P,{children:J(ue,{options:h,selected:u,onChange:S,...f})}),l&&J(R,{children:l}),g.error&&J(D,{})]})}})}r(gt,"CountryField");import*as ht from"react";import{jsx as no}from"react/jsx-runtime";var Pe=ht.forwardRef(({className:e,...t},a)=>no("textarea",{className:_("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...t}));Pe.displayName="Textarea";import{jsx as q,jsxs as Re}from"react/jsx-runtime";function _t({name:e,description:t,label:a,onChange:o,maxLength:l,component:d,...c}){let{components:F}=b(),{control:f}=x();return q(k,{control:f,name:e,render:({field:i,fieldState:n})=>{let u=d||F?.textarea;if(u){let s={name:e,description:t,label:a,maxLength:l,...c};return q(u,{field:{...i,onChange:r(g=>{i.onChange(g),o?.(g)},"onChange")},fieldState:n,fieldData:s})}let m=i.value?.length??0;return Re(w,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[q(N,{className:"RemoteFlows__TextArea__Label",children:a}),q(P,{children:q(Pe,{...i,value:i.value??"",onChange:s=>{i.onChange(s),o?.(s)},className:_(n.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:a})}),(t||l)&&Re("div",{className:"flex items-center justify-between",children:[t&&q(R,{className:"RemoteFlows__TextArea__Description",children:t}),l&&Re("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[m,"/",l]})]}),n.error&&q(D,{className:"RemoteFlows__TextArea__Error"})]})}})}r(_t,"TextAreaField");import{jsx as De}from"react/jsx-runtime";function yt(e){let{components:t}=b(),{control:a}=x(),o=e.component||t?.email;return o?De(k,{control:a,name:e.name,render:({field:l,fieldState:d})=>De(o,{field:{...l,onChange:r(c=>{l.onChange(c),e.onChange?.(c)},"onChange")},fieldState:d,fieldData:e})}):De(B,{...e,type:"email"})}r(yt,"EmailField");import{jsx as vt}from"react/jsx-runtime";function Ct(e){let{control:t}=x();return vt(k,{control:t,name:e.name,render:({field:a})=>vt("input",{...a,type:"hidden"})})}r(Ct,"HiddenField");import po,{useEffect as fo,useState as Dt}from"react";var xt=r((e,t,a)=>{if(e&&"reportValidity"in e){let o=re(a,t);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},"r"),Te=r((e,t)=>{for(let a in t.fields){let o=t.fields[a];o&&o.ref&&"reportValidity"in o.ref?xt(o.ref,a,e):o&&o.refs&&o.refs.forEach(l=>xt(l,a,e))}},"o"),St=r((e,t)=>{t.shouldUseNativeValidation&&Te(e,t);let a={};for(let o in e){let l=re(t.fields,o),d=Object.assign(e[o]||{},{ref:l&&l.ref});if(so(t.names||Object.keys(e),o)){let c=Object.assign({},re(a,o));ae(c,"root",d),ae(a,o,c)}else ae(a,o,d)}return a},"s"),so=r((e,t)=>{let a=bt(t);return e.some(o=>bt(o).match(`^${a}\\.\\d+`))},"i");function bt(e){return e.replace(/\]|\[/g,"")}r(bt,"n");function kt(e,t,a){return t===void 0&&(t={}),a===void 0&&(a={}),function(o,l,d){try{return Promise.resolve(function(c,F){try{var f=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[a.mode==="sync"?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:l}))).then(function(i){return d.shouldUseNativeValidation&&Te({},d),{values:a.raw?Object.assign({},o):i,errors:{}}}))}catch(i){return F(i)}return f&&f.then?f.then(void 0,F):f}(0,function(c){if(!c.inner)throw c;return{values:{},errors:St((F=c,f=!d.shouldUseNativeValidation&&d.criteriaMode==="all",(F.inner||[]).reduce(function(i,n){if(i[n.path]||(i[n.path]={message:n.message,type:n.type}),f){var u=i[n.path].types,m=u&&u[n.type];i[n.path]=Le(n.path,f,i,n.type,m?[].concat(m,n.message):n.message)}return i},{})),d)};var F,f}))}catch(c){return Promise.reject(c)}}}r(kt,"o");import*as I from"yup";import Nt from"lodash.groupby";import Q from"lodash.capitalize";var wt=60,pe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function lo(e){if(e<60)return`${e}m`;let t=Math.floor(e/wt),a=e%wt;return a>0?`${t}h${a}m`:`${t}h`}r(lo,"convertBreakDurationToHours");function Pt(e){let t=e.reduce((a,o)=>o.hours+a,0);return Number(t.toFixed(2))}r(Pt,"calculateTotalWorkHours");function io(e,t){let a=t.map(({day:d})=>d.toLowerCase()),o=a.indexOf(e),l=null;for(;o<a.length&&!l;){let d=a[o],c=a[o+1],F=pe.indexOf(d)+1;pe[F]===c||(l=d),o+=1}return l}r(io,"findLastConsecutiveDay");function mo(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}r(mo,"shouldSummarizeSchedule");function co(e){return Number.parseInt(e.break_duration_minutes)>0}r(co,"shouldSummarizeBreaks");function Rt(e){let t=e.filter(mo),a=Nt(t,F=>`${F.start_time}|${F.end_time}`),o=e.filter(co),l=Nt(o,"break_duration_minutes"),d=Object.keys(a).map(F=>{let f=a[F],i=f[0].day,[n,u]=F.split("|"),m=`from <span>${n.replace(":","h")}</span> to <span>${u.replace(":","h")}</span>`,s=io(i,f),p=(s?f.findIndex(h=>h.day===s):-1)===f.length-1;return f.length===1?`${Q(i)}, ${m}`:!p||!s?f.reduce((h,S,C)=>{let T=Q(S.day);return C===f.length-1?`${h}and ${T}, ${m}`:`${h}<span>${T}</span>, `},""):`<span>${Q(i)}</span> to <span>${Q(s)}</span>, ${m}`}),c=Object.keys(l).reverse().map((F,f)=>{let i=f===0,n=l[F],u=lo(parseInt(F,10));if(Object.keys(l).length===1)return`With ${u} daily breaks`;if(n.length===1){let m=`${u} break on ${Q(n[0].day)}.`;return i?`With ${m}`:m}return n.reduce((m,s,g)=>{let p=Q(s.day);return g===0?`${m} ${p}`:g===n.length-1?`${m}, and ${p}.`:`${m}, ${p}`},i?`With ${u} break on`:`${u} break on`)});return{workHoursSummary:d,breakSummary:c}}r(Rt,"buildWorkScheduleSummary");function Ie(e){let{checked:t,start_time:a,end_time:o,break_duration_minutes:l}=e;if(!t)return 0;let[d,c]=a.split(":").map(Number),[F,f]=o.split(":").map(Number),i=d*60+c,m=(F*60+f-i-Number.parseInt(l||"0"))/60;return m===Math.floor(m)?m:Number(m.toFixed(2))}r(Ie,"calculateHours");var uo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function fe(e){return uo[e]}r(fe,"getShortWeekday");import{jsx as y,jsxs as H}from"react/jsx-runtime";var Fo=I.object({day:I.string().required(),checked:I.boolean().required(),start_time:I.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),end_time:I.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),hours:I.number().default(0),break_duration_minutes:I.string().default("0")}),go=I.object({schedule:I.array(Fo)});function ho({defaultSchedule:e,onSubmit:t}){let[a,o]=Dt(!1),l=pe.map(p=>{let h=e.find(S=>S.day.toLowerCase()===fe(p).toLowerCase()||S.day.toLowerCase()===p.toLowerCase());return h?{...h,day:fe(p),checked:!0}:{...e[0],checked:!1,day:fe(p)}}),d=Be({defaultValues:{schedule:l},resolver:kt(go)}),{handleSubmit:c,watch:F,reset:f,control:i,formState:n}=d,{fields:u}=He({name:"schedule",control:i}),m=F("schedule");function s(p){let h=p.schedule.filter(({checked:S})=>S).map(S=>({...S,hours:Ie(S)}));t(h),o(!1)}r(s,"handleSubmitWorkingHours");function g(){f(),o(!1)}return r(g,"handleCancel"),y("div",{className:"flex items-center justify-between",children:H(ye,{open:a,onOpenChange:o,children:[y(Xe,{asChild:!0,children:y($,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),H(ve,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[y(Ce,{children:y(xe,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),y(Ae,{...d,children:H("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[H("div",{className:"rounded-lg",children:[y("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),H("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[y("div",{className:"col-span-2"}),y("div",{className:"col-span-3 text-center",children:"START"}),y("div",{className:"col-span-1 text-center"}),y("div",{className:"col-span-3 text-center",children:"END"}),y("div",{className:"col-span-2 text-center",children:"HOURS"})]}),y("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:u.map((p,h)=>{let S=m[h],C=Ie(S);return H(po.Fragment,{children:[H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[y("div",{className:"col-span-2 flex items-center gap-3",children:y(se,{label:p.day,name:`schedule.${h}.checked`})}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${h}.start_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),y("div",{className:"col-span-3",children:y(B,{name:`schedule.${h}.end_time`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(C)?"-":`${C} hours`})]}),H("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[y("div",{className:"col-span-2 text-gray-500",children:"Break"}),y("div",{className:"col-span-2",children:y(B,{name:`schedule.${h}.break_duration_minutes`,includeErrorMessage:!1})}),y("div",{className:"col-span-2 text-gray-500",children:"minutes"}),y("div",{className:"col-span-4"})]})]},p.id)})})]}),Object.keys(n.errors).length>0&&y("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),H("div",{className:"flex gap-4 pt-4",children:[y($,{type:"button",className:"reset-button",variant:"outline",onClick:g,children:"Cancel"}),y($,{type:"button",className:"submit-button",onClick:c(s),children:"Save Schedule"})]})]})})]})]})})}r(ho,"WorkScheduleSelectionForm");function Tt(e){let{components:t}=b(),{setValue:a,control:o,watch:l}=x(),d=l(e.name),[c,F]=Dt(d),{workHoursSummary:f,breakSummary:i}=Rt(c),n=Pt(c);fo(()=>{a(e.name,c)},[c,e.name,a]);function u(s){F(s)}r(u,"onSubmit");let m=e.component||t?.["work-schedule"];return m?y(k,{control:o,name:e.name,render:({field:s,fieldState:g})=>y(m,{field:{...s,onChange:r(p=>{s.onChange(p),e.onChange?.(p)},"onChange")},fieldState:g,fieldData:{...e,defaultFormattedValue:{workHoursSummary:f,breakSummary:i,totalWorkHours:n}}})}):H("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[y("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),H("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:f.join(", ")}}),y("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:i.join()}),H("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",y("span",{children:n})," hours per week"]}),y(ho,{defaultSchedule:c,onSubmit:u})]})]})}r(Tt,"WorkScheduleField");import{useState as _o}from"react";import{jsx as K,jsxs as yo}from"react/jsx-runtime";function It({label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,component:c,...F}){let{control:f}=x(),{components:i}=b(),[n,u]=_o();return K(k,{defaultValue:o,control:f,name:t,render:({field:m,fieldState:s})=>{let g=c||i?.["multi-select"];if(g){let h={label:e,name:t,options:a,defaultValue:o,description:l,onChange:d,...F};return K(g,{field:{...m,onChange:r(S=>{m.onChange(S),d?.(S)},"onChange")},fieldState:s,fieldData:h})}let p=n||a.filter(h=>m.value.includes(h.value));return yo(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[K(N,{className:"RemoteFlows__SelectField__Label",children:e}),K(P,{children:K(ue,{options:a,selected:p,onChange:h=>{let S=h.map(({value:C})=>C);m.onChange(S),d?.(S),u(h)},...F})}),l&&K(R,{children:l}),s.error&&K(D,{})]})}})}r(It,"MultiSelectField");import{jsx as vo}from"react/jsx-runtime";var $t=r(e=>vo(ce,{maxLength:15,...e}),"MoneyField");var $e={checkbox:se,text:B,email:yt,money:$t,select:mt,"multi-select":It,radio:lt,number:ce,file:st,date:rt,textarea:_t,countries:gt,hidden:Ct,"work-schedule":Tt};import{AlertCircle as Co}from"lucide-react";import{jsx as Fe,jsxs as xo}from"react/jsx-runtime";function Et({title:e,description:t,severity:a}){let{components:o}=b();if(o?.statement){let l=o?.statement;return Fe(l,{data:{title:e,description:ee(t),severity:a}})}return xo(Qe,{variant:"warning",children:[Fe(Co,{className:"h-4 w-4"}),e&&Fe(Ze,{children:e}),t&&Fe(et,{dangerouslySetInnerHTML:{__html:ee(t)}})]})}r(Et,"Statement");import{Fragment as bo,useEffect as So,useRef as Mt}from"react";import{jsx as z,jsxs as te}from"react/jsx-runtime";var ko=r(({isExpanded:e,onToggle:t,className:a,...o})=>z($,{type:"button",className:_("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",a),variant:"default",onClick:t,...o,children:e?"Remove":"Define"}),"DefaultToggleButton");function ss({label:e,name:t,fields:a,description:o,components:l,statement:d,isFlatFieldset:c,extra:F,variant:f="outset",features:i}){let{watch:n,setValue:u,trigger:m,formState:s}=x(),{components:g}=b(),p=i?.toggle?.stateField,h=p?n(p):i?.toggle?.defaultExpanded??!0,S=a.map(({name:v})=>`${t}.${v}`),C=n(S),T=Mt(C),G=Mt(null),Wt=r(()=>{p&&u(p,!h)},"toggleExpanded");So(()=>{let v=C,oe=T.current,ge=s.isSubmitted||s.submitCount>0,We=!1;for(let Z=0;Z<v.length;Z++)if(v[Z]!==void 0&&oe[Z]!==v[Z]){We=!0;break}return We&&ge&&(G.current&&clearTimeout(G.current),G.current=setTimeout(()=>{m()},50)),T.current=[...v],()=>{G.current&&clearTimeout(G.current)}},[C,m,s.isSubmitted,s.submitCount]);let Lt=g?.fieldsetToggle||ko,Ee=`${t}-content`,Me=`${t}-header`;return te("fieldset",{className:_("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[z("legend",{className:_("text-sm font-semibold px-2",f==="inset"&&"hidden"),children:e}),f==="inset"&&te("div",{className:"RemoteFlows__FieldSetField__Header",id:Me,"data-state":h?"expanded":"collapsed","aria-expanded":h,children:[z("h3",{className:_("RemoteFlows__FieldSetField__Title"),children:e}),i?.toggle?.enabled&&z(Lt,{isExpanded:h,onToggle:Wt,"aria-expanded":h,"aria-controls":Ee,"aria-label":`${h?"Hide":"Show"} ${e}`,className:_("RemoteFlows__FieldSetField__Toggle",i.toggle?.className),children:h?i.toggle.labels?.collapse??"Remove":i.toggle.labels?.expand??"Define"})]}),h&&te("div",{id:Ee,"aria-labelledby":Me,role:"region",children:[o?z("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:ee(o)}}):null,te("div",{className:"grid gap-4",children:[a.map(v=>{v.calculateDynamicProperties&&(v={...v,...v.calculateDynamicProperties(C,v)||{}});let oe=$e[v.type];if(v.isVisible===!1||v.deprecated)return null;if(v.Component){let{Component:ge}=v;return z(ge,{...v},v.name)}return v.type==="select"&&v.multiple&&(oe=$e["multi-select"]),te(bo,{children:[z(oe,{...v,name:`${c?v.name:`${t}.${v.name}`}`,component:l?.[v.type]}),v.extra?v.extra:null]},`${c?v.name:`${t}.${v.name}`}`)}),F||null,d?z(Et,{...d}):null]})]})]})}r(ss,"FieldSetField");export{$e as a,Et as b,ss as c};
2
+ //# sourceMappingURL=chunk-4SIGN3ZP.js.map
@@ -0,0 +1,2 @@
1
+ var e={data:{version:7,schema:{additionalProperties:!1,allOf:[{if:{properties:{agrees_to_pto_amount:{const:"no"}},required:["agrees_to_pto_amount"]},then:{properties:{agrees_to_pto_amount_notes:{type:"string"}},required:["agrees_to_pto_amount_notes"]},else:{properties:{agrees_to_pto_amount_notes:!1,timesheet_file:!1}}}],properties:{timeoff_statement:{type:"null",title:"Timeoff statement","x-jsf-presentation":{inputType:"hidden",statement:{title:"Make sure these paid time off records are correct",description:"You must pay the employee for any unused accrued paid time off, so please check these records carefully.",inputType:"statement",severity:"warning"},meta:{ignoreValue:!0}}},paid_time_off_info:{type:"null",title:"Paid time off info","x-jsf-presentation":{inputType:"hidden"},meta:{ignoreValue:!0}},agrees_to_pto_amount:{description:"",oneOf:[{const:"yes",description:"",title:"Yes"},{const:"no",description:"",title:"No"}],title:"Are these paid time off records correct?",type:"string","x-jsf-presentation":{direction:"column",inputType:"radio"}},agrees_to_pto_amount_notes:{description:"Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.",maxLength:1e3,title:"Provide time off details",type:["string","null"],"x-jsf-presentation":{inputType:"textarea"}},timesheet_file:{description:"Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.",title:"Timesheet document",type:["string","null"],"x-jsf-presentation":{inputType:"file",accept:".pdf"}}},required:["agrees_to_pto_amount"],type:"object","x-jsf-order":["timeoff_statement","paid_time_off_info","agrees_to_pto_amount","agrees_to_pto_amount_notes","timesheet_file"]}}};export{e as a};
2
+ //# sourceMappingURL=chunk-4T6PRR6R.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flows/Termination/json-schemas/paidTimeOff.ts"],"sourcesContent":["export const paidTimeOffSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [\n {\n if: {\n properties: {\n agrees_to_pto_amount: {\n const: 'no',\n },\n },\n required: ['agrees_to_pto_amount'],\n },\n then: {\n properties: {\n agrees_to_pto_amount_notes: {\n type: 'string',\n },\n },\n required: ['agrees_to_pto_amount_notes'],\n },\n else: {\n properties: {\n agrees_to_pto_amount_notes: false,\n timesheet_file: false,\n },\n },\n },\n ],\n properties: {\n timeoff_statement: {\n type: 'null',\n title: 'Timeoff statement',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n statement: {\n title: 'Make sure these paid time off records are correct',\n description:\n 'You must pay the employee for any unused accrued paid time off, so please check these records carefully.',\n inputType: 'statement',\n severity: 'warning',\n },\n meta: {\n ignoreValue: true,\n },\n },\n },\n agrees_to_pto_amount: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title: 'Are these paid time off records correct?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n agrees_to_pto_amount_notes: {\n description:\n 'Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.',\n maxLength: 1000,\n title: 'Provide time off details',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n timesheet_file: {\n description:\n 'Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.',\n title: 'Timesheet document',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'file',\n accept: '.pdf',\n },\n },\n },\n required: ['agrees_to_pto_amount'],\n type: 'object',\n 'x-jsf-order': [\n 'timeoff_statement',\n 'agrees_to_pto_amount',\n 'agrees_to_pto_amount_notes',\n 'timesheet_file',\n ],\n },\n },\n};\n"],"mappings":"AAAO,IAAMA,EAAoB,CAC/B,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CACL,CACE,GAAI,CACF,WAAY,CACV,qBAAsB,CACpB,MAAO,IACT,CACF,EACA,SAAU,CAAC,sBAAsB,CACnC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,CAC1B,KAAM,QACR,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,GAC5B,eAAgB,EAClB,CACF,CACF,CACF,EACA,WAAY,CACV,kBAAmB,CACjB,KAAM,OACN,MAAO,oBACP,qBAAsB,CACpB,UAAW,SACX,UAAW,CACT,MAAO,oDACP,YACE,2GACF,UAAW,YACX,SAAU,SACZ,EACA,KAAM,CACJ,YAAa,EACf,CACF,CACF,EACA,qBAAsB,CACpB,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MAAO,2CACP,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,2BAA4B,CAC1B,YACE,sIACF,UAAW,IACX,MAAO,2BACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,eAAgB,CACd,YACE,4HACF,MAAO,qBACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,OACX,OAAQ,MACV,CACF,CACF,EACA,SAAU,CAAC,sBAAsB,EACjC,KAAM,SACN,cAAe,CACb,oBACA,uBACA,6BACA,gBACF,CACF,CACF,CACF","names":["paidTimeOffSchema"]}
1
+ {"version":3,"sources":["../src/flows/Termination/json-schemas/paidTimeOff.ts"],"sourcesContent":["export const paidTimeOffSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [\n {\n if: {\n properties: {\n agrees_to_pto_amount: {\n const: 'no',\n },\n },\n required: ['agrees_to_pto_amount'],\n },\n then: {\n properties: {\n agrees_to_pto_amount_notes: {\n type: 'string',\n },\n },\n required: ['agrees_to_pto_amount_notes'],\n },\n else: {\n properties: {\n agrees_to_pto_amount_notes: false,\n timesheet_file: false,\n },\n },\n },\n ],\n properties: {\n timeoff_statement: {\n type: 'null',\n title: 'Timeoff statement',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n statement: {\n title: 'Make sure these paid time off records are correct',\n description:\n 'You must pay the employee for any unused accrued paid time off, so please check these records carefully.',\n inputType: 'statement',\n severity: 'warning',\n },\n meta: {\n ignoreValue: true,\n },\n },\n },\n paid_time_off_info: {\n type: 'null',\n title: 'Paid time off info',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n },\n meta: {\n ignoreValue: true,\n },\n },\n agrees_to_pto_amount: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title: 'Are these paid time off records correct?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n agrees_to_pto_amount_notes: {\n description:\n 'Please provide details regarding any additional days taken, including specific dates, or any other inaccuracy in the time off data.',\n maxLength: 1000,\n title: 'Provide time off details',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n timesheet_file: {\n description:\n 'Upload a timesheet exported from your HR software. This way we can compare and confirm the total number of Paid time off.',\n title: 'Timesheet document',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'file',\n accept: '.pdf',\n },\n },\n },\n required: ['agrees_to_pto_amount'],\n type: 'object',\n 'x-jsf-order': [\n 'timeoff_statement',\n 'paid_time_off_info',\n 'agrees_to_pto_amount',\n 'agrees_to_pto_amount_notes',\n 'timesheet_file',\n ],\n },\n },\n};\n"],"mappings":"AAAO,IAAMA,EAAoB,CAC/B,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CACL,CACE,GAAI,CACF,WAAY,CACV,qBAAsB,CACpB,MAAO,IACT,CACF,EACA,SAAU,CAAC,sBAAsB,CACnC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,CAC1B,KAAM,QACR,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,2BAA4B,GAC5B,eAAgB,EAClB,CACF,CACF,CACF,EACA,WAAY,CACV,kBAAmB,CACjB,KAAM,OACN,MAAO,oBACP,qBAAsB,CACpB,UAAW,SACX,UAAW,CACT,MAAO,oDACP,YACE,2GACF,UAAW,YACX,SAAU,SACZ,EACA,KAAM,CACJ,YAAa,EACf,CACF,CACF,EACA,mBAAoB,CAClB,KAAM,OACN,MAAO,qBACP,qBAAsB,CACpB,UAAW,QACb,EACA,KAAM,CACJ,YAAa,EACf,CACF,EACA,qBAAsB,CACpB,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MAAO,2CACP,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,2BAA4B,CAC1B,YACE,sIACF,UAAW,IACX,MAAO,2BACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,eAAgB,CACd,YACE,4HACF,MAAO,qBACP,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,OACX,OAAQ,MACV,CACF,CACF,EACA,SAAU,CAAC,sBAAsB,EACjC,KAAM,SACN,cAAe,CACb,oBACA,qBACA,uBACA,6BACA,gBACF,CACF,CACF,CACF","names":["paidTimeOffSchema"]}
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-R2MHAPWD.js";import{E as C,e as d,k as y,z as p}from"./chunk-MISHDUB2.js";import{b as f}from"./chunk-Z5WMKCRJ.js";import{d as s}from"./chunk-3ZWDIEEM.js";import{a as l}from"./chunk-PAQW5BFW.js";import{a as e}from"./chunk-P37U34EQ.js";import{createHeadlessForm as g,modify as D}from"@remoteoss/json-schema-form";import{useMutation as F,useQuery as m}from"@tanstack/react-query";var G=e(({fieldValues:n,options:o})=>m({queryKey:["contract-document-signature"],queryFn:e(async()=>g(h,{initialValues:n}),"queryFn"),enabled:o?.queryOptions?.enabled}),"useGetContractDocumentSignatureSchema"),J=e(()=>{let{client:n}=s();return F({mutationFn:e(async({employmentId:o,contractDocumentId:t,payload:r})=>C({client:n,body:r,path:{employment_id:o,contract_document_id:t}}),"mutationFn")})},"useSignContractDocument"),Q=e(({employmentId:n,contractDocumentId:o,options:t})=>{let{client:r}=s();return m({queryKey:["contract-document",n,o],queryFn:e(async()=>y({client:r,path:{employment_id:n,id:o}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:i})=>i?.data,"select")})},"useGetShowContractDocument"),R=e(()=>{let{client:n}=s();return F({mutationFn:e(async({employmentId:o,payload:t})=>p({client:n,body:t,path:{employment_id:o}}),"mutationFn")})},"useCreateContractorContractDocument"),T=e(({countryCode:n,fieldValues:o,options:t})=>{let r=t?.jsonSchemaVersion?.contractor_contract_details_form_schema?{json_schema_version:t.jsonSchemaVersion.contractor_contract_details_form_schema}:{},{client:i}=s();return m({queryKey:["contractor-onboarding-details-schema",n],retry:!1,queryFn:e(async()=>d({client:i,path:{country_code:n},query:{...r}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:b})=>{let a=b?.data?.schema||{};if(t&&t.jsfModify){let{schema:c}=D(a,t.jsfModify);a=c}let S=f(a.properties||{},"money").reduce((c,u)=>(c[u]=l(o[u]),c),{}),_={...o,...S};return{meta:{"x-jsf-fieldsets":a["x-jsf-fieldsets"]},...g(a,{initialValues:_})}},"select")})},"useContractorOnboardingDetailsSchema");export{G as a,J as b,Q as c,R as d,T as e};
2
- //# sourceMappingURL=chunk-QP36XXCQ.js.map
1
+ import{a as h}from"./chunk-R2MHAPWD.js";import{A as p,F as C,e as d,k as y}from"./chunk-IXAWEBRI.js";import{b as f}from"./chunk-Z5WMKCRJ.js";import{d as s}from"./chunk-3ZWDIEEM.js";import{a as l}from"./chunk-PAQW5BFW.js";import{a as e}from"./chunk-P37U34EQ.js";import{createHeadlessForm as g,modify as D}from"@remoteoss/json-schema-form";import{useMutation as F,useQuery as m}from"@tanstack/react-query";var G=e(({fieldValues:n,options:o})=>m({queryKey:["contract-document-signature"],queryFn:e(async()=>g(h,{initialValues:n}),"queryFn"),enabled:o?.queryOptions?.enabled}),"useGetContractDocumentSignatureSchema"),J=e(()=>{let{client:n}=s();return F({mutationFn:e(async({employmentId:o,contractDocumentId:t,payload:r})=>C({client:n,body:r,path:{employment_id:o,contract_document_id:t}}),"mutationFn")})},"useSignContractDocument"),Q=e(({employmentId:n,contractDocumentId:o,options:t})=>{let{client:r}=s();return m({queryKey:["contract-document",n,o],queryFn:e(async()=>y({client:r,path:{employment_id:n,id:o}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:i})=>i?.data,"select")})},"useGetShowContractDocument"),R=e(()=>{let{client:n}=s();return F({mutationFn:e(async({employmentId:o,payload:t})=>p({client:n,body:t,path:{employment_id:o}}),"mutationFn")})},"useCreateContractorContractDocument"),T=e(({countryCode:n,fieldValues:o,options:t})=>{let r=t?.jsonSchemaVersion?.contractor_contract_details_form_schema?{json_schema_version:t.jsonSchemaVersion.contractor_contract_details_form_schema}:{},{client:i}=s();return m({queryKey:["contractor-onboarding-details-schema",n],retry:!1,queryFn:e(async()=>d({client:i,path:{country_code:n},query:{...r}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:b})=>{let a=b?.data?.schema||{};if(t&&t.jsfModify){let{schema:c}=D(a,t.jsfModify);a=c}let S=f(a.properties||{},"money").reduce((c,u)=>(c[u]=l(o[u]),c),{}),_={...o,...S};return{meta:{"x-jsf-fieldsets":a["x-jsf-fieldsets"]},...g(a,{initialValues:_})}},"select")})},"useContractorOnboardingDetailsSchema");export{G as a,J as b,Q as c,R as d,T as e};
2
+ //# sourceMappingURL=chunk-5A54AHAT.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-XHOQSIXZ.js";import{b as i}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function y({onSubmit:s,onSuccess:c,onError:t}){let{onboardingBag:o}=i(),u=e(async n=>{try{await s?.({countryCode:n.country});let r=await o.onSubmit(n);if(r?.data){await c?.(r?.data),o?.next();return}r?.error&&t?.({error:r.error,rawError:r.rawError,fieldErrors:[]})}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),l=o.stepState.values?.select_country||o.initialValues.select_country;return d(a,{defaultValues:l,onSubmit:u})}e(y,"SelectCountryStep");export{y as a};
2
- //# sourceMappingURL=chunk-22JS3T6G.js.map
1
+ import{a}from"./chunk-LEXD5FVL.js";import{b as i}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function y({onSubmit:s,onSuccess:c,onError:t}){let{onboardingBag:o}=i(),u=e(async n=>{try{await s?.({countryCode:n.country});let r=await o.onSubmit(n);if(r?.data){await c?.(r?.data),o?.next();return}r?.error&&t?.({error:r.error,rawError:r.rawError,fieldErrors:[]})}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),l=o.stepState.values?.select_country||o.initialValues.select_country;return d(a,{defaultValues:l,onSubmit:u})}e(y,"SelectCountryStep");export{y as a};
2
+ //# sourceMappingURL=chunk-5H5INKOY.js.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-TOA3JILU.js";import{b as u}from"./chunk-E773NPNL.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function C({children:o,onClick:a,...n}){let{contractorOnboardingBag:{back:m,isEmploymentReadOnly:B}}=s(),{components:d}=i(),r=t(p=>{B||m(),a?.(p)},"onBackHandler"),e=d?.button;return e?c(e,{...n,onClick:r,children:o}):c(u,{...n,onClick:r,children:o})}t(C,"OnboardingBack");export{C as a};
2
- //# sourceMappingURL=chunk-C4AVUIG2.js.map
1
+ import{b as s}from"./chunk-TOA3JILU.js";import{b as u}from"./chunk-WVDTHFGS.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function C({children:o,onClick:a,...n}){let{contractorOnboardingBag:{back:m,isEmploymentReadOnly:B}}=s(),{components:d}=i(),r=t(p=>{B||m(),a?.(p)},"onBackHandler"),e=d?.button;return e?c(e,{...n,onClick:r,children:o}):c(u,{...n,onClick:r,children:o})}t(C,"OnboardingBack");export{C as a};
2
+ //# sourceMappingURL=chunk-5ZR7EFPY.js.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-5SKMAYLG.js";import{b as m}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as r}from"react/jsx-runtime";function p({onSubmit:e}){let{terminationBag:i}=m();return r(n,{onSubmit:o(async t=>{await e?.(i?.parseFormValues(t)),i?.next()},"handleSubmit")})}o(p,"EmployeeCommunicationForm");export{p as a};
2
- //# sourceMappingURL=chunk-JG7FV7OZ.js.map
1
+ import{a as n}from"./chunk-CRHH6IPF.js";import{b as m}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as r}from"react/jsx-runtime";function p({onSubmit:e}){let{terminationBag:i}=m();return r(n,{onSubmit:o(async t=>{await e?.(i?.parseFormValues(t)),i?.next()},"handleSubmit")})}o(p,"EmployeeCommunicationForm");export{p as a};
2
+ //# sourceMappingURL=chunk-64NSBY5G.js.map
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-MRYRNB7Y.js";import{b as m}from"./chunk-E773NPNL.js";import{b as e}from"./chunk-3ZWDIEEM.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function f({children:n,...t}){let{terminationBag:{back:i}}=c(),{components:B}=e(),r=B?.button;return r?s(r,{...t,onClick:o=>{i(),t.onClick?.(o)},children:n}):s(m,{...t,onClick:o=>{i(),t.onClick?.(o)},children:n})}u(f,"TerminationBack");export{f as a};
2
- //# sourceMappingURL=chunk-5N4L2G7Q.js.map
1
+ import{b as c}from"./chunk-MRYRNB7Y.js";import{b as m}from"./chunk-WVDTHFGS.js";import{b as e}from"./chunk-3ZWDIEEM.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function f({children:n,...t}){let{terminationBag:{back:i}}=c(),{components:B}=e(),r=B?.button;return r?s(r,{...t,onClick:o=>{i(),t.onClick?.(o)},children:n}):s(m,{...t,onClick:o=>{i(),t.onClick?.(o)},children:n})}u(f,"TerminationBack");export{f as a};
2
+ //# sourceMappingURL=chunk-6VRUYYUV.js.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-5SKMAYLG.js";import{b as n}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function u({onSubmit:m}){let{terminationBag:i}=n();return a(r,{onSubmit:o(async t=>{await m?.(i?.parseFormValues(t)),i?.next()},"handleSubmit")})}o(u,"TerminationDetailsForm");export{u as a};
2
- //# sourceMappingURL=chunk-3I6ONATN.js.map
1
+ import{a as r}from"./chunk-CRHH6IPF.js";import{b as n}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function u({onSubmit:m}){let{terminationBag:i}=n();return a(r,{onSubmit:o(async t=>{await m?.(i?.parseFormValues(t)),i?.next()},"handleSubmit")})}o(u,"TerminationDetailsForm");export{u as a};
2
+ //# sourceMappingURL=chunk-7IZGKQII.js.map
@@ -1,2 +1,2 @@
1
- import{a as d,b as _,c}from"./chunk-QU3NSFU5.js";import{c as F}from"./chunk-CNDSIADP.js";import{e as y}from"./chunk-PAQW5BFW.js";import{e as m}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{Fragment as V}from"react";var u={...d,fieldset:c,"fieldset-flat":c};import{useEffect as h}from"react";import{Fragment as x,jsx as i,jsxs as C}from"react/jsx-runtime";function g({name:t,value:a,description:s,statement:r,label:l}){let{setValue:e}=F();return h(()=>{e(t,a)},[]),i("div",{children:r?C(x,{children:[i("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${t}`,dangerouslySetInnerHTML:{__html:m(r?.title||l)}}),i("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${t}`,dangerouslySetInnerHTML:{__html:m(r?.description||s)}})]}):i("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${t}`,dangerouslySetInnerHTML:{__html:m(s)}})})}p(g,"ForcedValueField");import{Fragment as P,jsx as o,jsxs as S}from"react/jsx-runtime";function k(t){return t.const!==void 0&&t.const===t.default&&t.inputType!=="checkbox"&&t.inputType!=="hidden"}p(k,"checkFieldHasForcedValue");var q=p(({fields:t,fieldsets:a,fieldValues:s,components:r})=>{if(!t||t.length===0)return null;let l=a&&s?y({fields:t,fieldsets:a,values:s}):t;return o(P,{children:l.map(e=>{if(e.calculateDynamicProperties&&(e={...e,...e.calculateDynamicProperties(s,e)||{}}),e.isVisible===!1||e.deprecated||e.hidden)return null;if(k(e))return o(g,{name:e.name,description:e.description,value:e.const,statement:e.statement,label:e.label},e.name);if(e.Component){let{Component:T}=e;return o(T,{...e},e.name)}let n=u[e.type];return e.type==="select"&&e.multiple&&(n=u["multi-select"]),e.type==="fieldset"?o(n,{...e,components:r},e.name):e.type==="fieldset-flat"?o(n,{...e,components:r,isFlatFieldset:!0},e.name):n?S(V,{children:[o(n,{...e,component:r&&r[e.type]}),e.statement?o(_,{...e.statement}):null,e.extra?e.extra:null]},e.name):S("p",{className:"error",children:["Field type ",e.type," not supported"]})})})},"JSONSchemaFormFields");export{q as a};
2
- //# sourceMappingURL=chunk-EIVHHLR5.js.map
1
+ import{a as d,b as _,c}from"./chunk-4SIGN3ZP.js";import{c as F}from"./chunk-CNDSIADP.js";import{e as y}from"./chunk-PAQW5BFW.js";import{e as m}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{Fragment as V}from"react";var u={...d,fieldset:c,"fieldset-flat":c};import{useEffect as h}from"react";import{Fragment as x,jsx as i,jsxs as C}from"react/jsx-runtime";function g({name:t,value:a,description:s,statement:r,label:l}){let{setValue:e}=F();return h(()=>{e(t,a)},[]),i("div",{children:r?C(x,{children:[i("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${t}`,dangerouslySetInnerHTML:{__html:m(r?.title||l)}}),i("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${t}`,dangerouslySetInnerHTML:{__html:m(r?.description||s)}})]}):i("p",{className:`text-xs RemoteFlows__ForcedValue__Description__${t}`,dangerouslySetInnerHTML:{__html:m(s)}})})}p(g,"ForcedValueField");import{Fragment as P,jsx as o,jsxs as S}from"react/jsx-runtime";function k(t){return t.const!==void 0&&t.const===t.default&&t.inputType!=="checkbox"&&t.inputType!=="hidden"}p(k,"checkFieldHasForcedValue");var q=p(({fields:t,fieldsets:a,fieldValues:s,components:r})=>{if(!t||t.length===0)return null;let l=a&&s?y({fields:t,fieldsets:a,values:s}):t;return o(P,{children:l.map(e=>{if(e.calculateDynamicProperties&&(e={...e,...e.calculateDynamicProperties(s,e)||{}}),e.isVisible===!1||e.deprecated||e.hidden)return null;if(k(e))return o(g,{name:e.name,description:e.description,value:e.const,statement:e.statement,label:e.label},e.name);if(e.Component){let{Component:T}=e;return o(T,{...e},e.name)}let n=u[e.type];return e.type==="select"&&e.multiple&&(n=u["multi-select"]),e.type==="fieldset"?o(n,{...e,components:r},e.name):e.type==="fieldset-flat"?o(n,{...e,components:r,isFlatFieldset:!0},e.name):n?S(V,{children:[o(n,{...e,component:r&&r[e.type]}),e.statement?o(_,{...e.statement}):null,e.extra?e.extra:null]},e.name):S("p",{className:"error",children:["Field type ",e.type," not supported"]})})})},"JSONSchemaFormFields");export{q as a};
2
+ //# sourceMappingURL=chunk-A7T27JCJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as f}from"./chunk-3I6ONATN.js";import{a as r}from"./chunk-BVCBX72U.js";import{a as n}from"./chunk-B25LAMRX.js";import{a as t}from"./chunk-PSEOAELN.js";import{a as T}from"./chunk-V6I3EMYX.js";import{a}from"./chunk-JG7FV7OZ.js";import{a as p}from"./chunk-JX3OQNNM.js";import{a as e}from"./chunk-5N4L2G7Q.js";import{a as m}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{useId as F}from"react";import{jsx as P}from"react/jsx-runtime";var x=i(({employmentId:l,render:d,options:s,initialValues:u})=>{let c=F(),o=t({employmentId:l,options:s,initialValues:u});return P(m.Provider,{value:{formId:c,terminationBag:o},children:d({terminationBag:o,components:{SubmitButton:r,TimeOff:n,Back:e,EmployeeComunicationStep:a,TerminationDetailsStep:f,PaidTimeOffStep:p,AdditionalDetailsStep:T}})})},"TerminationFlow");export{x as a};
2
- //# sourceMappingURL=chunk-CELNQ7KS.js.map
1
+ import{a as f}from"./chunk-7IZGKQII.js";import{a as r}from"./chunk-P5WUODPR.js";import{a as n}from"./chunk-SGJSMTYG.js";import{a as t}from"./chunk-CGUTMSAU.js";import{a as T}from"./chunk-SA3D5OH4.js";import{a}from"./chunk-64NSBY5G.js";import{a as p}from"./chunk-U2LOBJFU.js";import{a as e}from"./chunk-6VRUYYUV.js";import{a as m}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{useId as F}from"react";import{jsx as P}from"react/jsx-runtime";var x=i(({employmentId:l,render:d,options:s,initialValues:u})=>{let c=F(),o=t({employmentId:l,options:s,initialValues:u});return P(m.Provider,{value:{formId:c,terminationBag:o},children:d({terminationBag:o,components:{SubmitButton:r,TimeOff:n,Back:e,EmployeeComunicationStep:a,TerminationDetailsStep:f,PaidTimeOffStep:p,AdditionalDetailsStep:T}})})},"TerminationFlow");export{x as a};
2
+ //# sourceMappingURL=chunk-AHBACWMD.js.map
@@ -1,2 +1,2 @@
1
- import{b as l}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-E773NPNL.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as c}from"./chunk-43WMZDDH.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function R({children:e,...t}){let{form:r,formId:n,costCalculatorBag:s}=l(),{components:f}=i(),m=f?.button;return m?a(m,{...t,type:"reset",form:n,onClick:o=>{s?.resetForm(),r.reset(),t.onClick?.(o)},children:e}):a(C,{...t,type:"reset",className:c("RemoteFlows__CostCalculatorForm__ResetButton",t.className),form:n,onClick:o=>{s?.resetForm(),r.reset(),t.onClick?.(o)},children:e})}u(R,"CostCalculatorResetButton");export{R as a};
2
- //# sourceMappingURL=chunk-C4SMHWP4.js.map
1
+ import{b as l}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-WVDTHFGS.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as c}from"./chunk-43WMZDDH.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function R({children:e,...t}){let{form:r,formId:n,costCalculatorBag:s}=l(),{components:f}=i(),m=f?.button;return m?a(m,{...t,type:"reset",form:n,onClick:o=>{s?.resetForm(),r.reset(),t.onClick?.(o)},children:e}):a(C,{...t,type:"reset",className:c("RemoteFlows__CostCalculatorForm__ResetButton",t.className),form:n,onClick:o=>{s?.resetForm(),r.reset(),t.onClick?.(o)},children:e})}u(R,"CostCalculatorResetButton");export{R as a};
2
+ //# sourceMappingURL=chunk-ANGJCT4I.js.map
@@ -1,2 +1,2 @@
1
- import{a as b,b as h,d as C,e as Z,f as v,g as y}from"./chunk-TWIUL2P3.js";import{g}from"./chunk-MISHDUB2.js";import{b as w,d as f}from"./chunk-3ZWDIEEM.js";import{a as k,f as D}from"./chunk-43WMZDDH.js";import{a as e}from"./chunk-P37U34EQ.js";import{useQuery as F}from"@tanstack/react-query";var x=e((r,a)=>{let{client:s}=f();return F({queryKey:["zendesk-article",r],queryFn:e(async()=>{let t=await g({client:s,path:{id:Number(r)}});if(t.error)throw new Error(t.error.message||"Failed to fetch article");return t},"queryFn"),select:e(t=>{let o=t.data?.data.help_center_article;return o&&{...o,body:D(o.body||"")}},"select"),retry:!1,...a})},"useZendeskArticle");import{jsx as n,jsxs as l}from"react/jsx-runtime";var N=e(r=>`https://support.remote.com/hc/en-us/articles/${r}`,"buildZendeskURL"),T=e(({Trigger:r,zendeskId:a,open:s,onClose:t})=>{let{components:o}=w(),i=N(a),d=e(()=>{t?.()},"handleClose"),{data:c,isLoading:m,error:p}=x(a,{enabled:s}),u=o?.zendeskDrawer;return u?n(u,{open:s,onClose:d,data:c,isLoading:m,error:p,zendeskURL:i,Trigger:r}):l(b,{open:s,onOpenChange:R=>!R&&d(),direction:"right",children:[n(h,{asChild:!0,children:r}),n(C,{className:"h-full w-[540px] mt-0 ml-auto RemoteFlows_ZendeskDrawer",children:l("div",{className:"h-full flex flex-col",children:[l(Z,{children:[n(v,{children:c?.title}),l(y,{children:["For more details see our"," ",n("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:"help article"})," "]})]}),m&&n("div",{children:"Loading..."}),p&&n("div",{className:"text-sm p-4 text-red-500",children:"Error loading article"}),n("div",{className:"flex-1 overflow-y-auto p-4 RemoteFlows_ZendeskDrawer__Content",dangerouslySetInnerHTML:{__html:c?.body||""}})]})})]})},"ZendeskDrawer");import{useState as L}from"react";import{jsx as _}from"react/jsx-runtime";function $({zendeskId:r,className:a,onClick:s,children:t}){let[o,i]=L(!1);return _(T,{zendeskId:r,open:o,onClose:()=>i(!1),Trigger:_("button",{onClick:e(()=>{i(!0),s?.(r)},"handleClick"),className:k("RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block mt-1 text-xs bg-transparent border-none cursor-pointer p-0",a),children:t})})}e($,"ZendeskTriggerButton");export{$ as a};
2
- //# sourceMappingURL=chunk-XICA45G2.js.map
1
+ import{a as b,b as h,d as C,e as Z,f as v,g as y}from"./chunk-TWIUL2P3.js";import{g}from"./chunk-IXAWEBRI.js";import{b as w,d as f}from"./chunk-3ZWDIEEM.js";import{a as k,f as D}from"./chunk-43WMZDDH.js";import{a as e}from"./chunk-P37U34EQ.js";import{useQuery as F}from"@tanstack/react-query";var x=e((r,a)=>{let{client:s}=f();return F({queryKey:["zendesk-article",r],queryFn:e(async()=>{let t=await g({client:s,path:{id:Number(r)}});if(t.error)throw new Error(t.error.message||"Failed to fetch article");return t},"queryFn"),select:e(t=>{let o=t.data?.data.help_center_article;return o&&{...o,body:D(o.body||"")}},"select"),retry:!1,...a})},"useZendeskArticle");import{jsx as n,jsxs as l}from"react/jsx-runtime";var N=e(r=>`https://support.remote.com/hc/en-us/articles/${r}`,"buildZendeskURL"),T=e(({Trigger:r,zendeskId:a,open:s,onClose:t})=>{let{components:o}=w(),i=N(a),d=e(()=>{t?.()},"handleClose"),{data:c,isLoading:m,error:p}=x(a,{enabled:s}),u=o?.zendeskDrawer;return u?n(u,{open:s,onClose:d,data:c,isLoading:m,error:p,zendeskURL:i,Trigger:r}):l(b,{open:s,onOpenChange:R=>!R&&d(),direction:"right",children:[n(h,{asChild:!0,children:r}),n(C,{className:"h-full w-[540px] mt-0 ml-auto RemoteFlows_ZendeskDrawer",children:l("div",{className:"h-full flex flex-col",children:[l(Z,{children:[n(v,{children:c?.title}),l(y,{children:["For more details see our"," ",n("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:"help article"})," "]})]}),m&&n("div",{children:"Loading..."}),p&&n("div",{className:"text-sm p-4 text-red-500",children:"Error loading article"}),n("div",{className:"flex-1 overflow-y-auto p-4 RemoteFlows_ZendeskDrawer__Content",dangerouslySetInnerHTML:{__html:c?.body||""}})]})})]})},"ZendeskDrawer");import{useState as L}from"react";import{jsx as _}from"react/jsx-runtime";function $({zendeskId:r,className:a,onClick:s,children:t}){let[o,i]=L(!1);return _(T,{zendeskId:r,open:o,onClose:()=>i(!1),Trigger:_("button",{onClick:e(()=>{i(!0),s?.(r)},"handleClick"),className:k("RemoteFlows__ZendeskTriggerButton text-blue-500 hover:underline inline-block mt-1 text-xs bg-transparent border-none cursor-pointer p-0",a),children:t})})}e($,"ZendeskTriggerButton");export{$ as a};
2
+ //# sourceMappingURL=chunk-B7I7YVNK.js.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-TOA3JILU.js";import{d as u}from"./chunk-VXPJXQP3.js";import{a as l}from"./chunk-7XRPOR7L.js";import{b as c}from"./chunk-E773NPNL.js";import{b as d}from"./chunk-3ZWDIEEM.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as y}from"react/jsx-runtime";function k({onSubmit:f,onSuccess:E,onError:i,render:s,...o}){let{components:v}=d(),{contractorOnboardingBag:r}=p(),n=u(),{mutateAsync:b}=l(n),m=e(async()=>{try{if(await f?.(),r.employmentId){let t=await b({employment_id:r.employmentId});if(t.data){await E?.({data:t.data,employmentStatus:"invited"}),r.refetchEmployment();return}t.error&&i?.({error:t.error,rawError:t.rawError,fieldErrors:[]})}}catch(t){i?.({error:t,rawError:t,fieldErrors:[]})}},"handleSubmit"),a=v?.button;return a?y(a,{...o,disabled:n.isPending||o.disabled,onClick:t=>{m(),o.onClick?.(t)},children:s({employmentStatus:"invited"})}):y(c,{...o,disabled:n.isPending||o.disabled,onClick:()=>{m()},children:s({employmentStatus:"invited"})})}e(k,"OnboardingInvite");export{k as a};
2
- //# sourceMappingURL=chunk-DHJZVBVD.js.map
1
+ import{b as p}from"./chunk-TOA3JILU.js";import{d as u}from"./chunk-FBJCDOO7.js";import{a as l}from"./chunk-7XRPOR7L.js";import{b as c}from"./chunk-WVDTHFGS.js";import{b as d}from"./chunk-3ZWDIEEM.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as y}from"react/jsx-runtime";function k({onSubmit:f,onSuccess:E,onError:i,render:s,...o}){let{components:v}=d(),{contractorOnboardingBag:r}=p(),n=u(),{mutateAsync:b}=l(n),m=e(async()=>{try{if(await f?.(),r.employmentId){let t=await b({employment_id:r.employmentId});if(t.data){await E?.({data:t.data,employmentStatus:"invited"}),r.refetchEmployment();return}t.error&&i?.({error:t.error,rawError:t.rawError,fieldErrors:[]})}}catch(t){i?.({error:t,rawError:t,fieldErrors:[]})}},"handleSubmit"),a=v?.button;return a?y(a,{...o,disabled:n.isPending||o.disabled,onClick:t=>{m(),o.onClick?.(t)},children:s({employmentStatus:"invited"})}):y(c,{...o,disabled:n.isPending||o.disabled,onClick:()=>{m()},children:s({employmentStatus:"invited"})})}e(k,"OnboardingInvite");export{k as a};
2
+ //# sourceMappingURL=chunk-BNHN4CEM.js.map
@@ -0,0 +1,2 @@
1
+ import{a as x}from"./chunk-G34OX26W.js";import{a as k}from"./chunk-JF3KJ6PA.js";import{a as P}from"./chunk-S4XU4SE7.js";import{a as g}from"./chunk-32GSS4UM.js";import{a as F}from"./chunk-FBJCDOO7.js";import{a as V}from"./chunk-7XRPOR7L.js";import{a as S}from"./chunk-B7I7YVNK.js";import{a as M,b as w}from"./chunk-Q5ZRKZMK.js";import{a as h}from"./chunk-PJBAQZ6G.js";import{a as T}from"./chunk-Z5WMKCRJ.js";import{c as m}from"./chunk-PAQW5BFW.js";import{a as r}from"./chunk-43WMZDDH.js";import{a as i}from"./chunk-P37U34EQ.js";import{createHeadlessForm as K}from"@remoteoss/json-schema-form";import Z from"lodash.omitby";import U from"lodash.isnull";import W from"lodash.omit";import{useMemo as j}from"react";import{jsx as N,jsxs as q}from"react/jsx-runtime";function _(t,e,d){return{presentation:{inputType:"hidden",Component:i(()=>q("div",{className:r("RemoteFlows__InformationStatement",d?.className),children:[N("h3",{className:r("RemoteFlows__InformationStatement__Title"),children:t}),N("p",{className:r("RemoteFlows__InformationStatement__Description"),children:e})]}),"Component")}}}i(_,"createInformationField");import{Fragment as Q,jsx as b,jsxs as X}from"react/jsx-runtime";function G(t){return{confidential:"",customer_informed_employee:"",customer_informed_employee_date:"",customer_informed_employee_description:"",personal_email:"",termination_reason:void 0,reason_description:"",termination_reason_files:[],will_challenge_termination:"",will_challenge_termination_description:null,agrees_to_pto_amount:"",agrees_to_pto_amount_notes:null,acknowledge_termination_procedure:!1,additional_comments:"",proposed_termination_date:"",risk_assessment_reasons:[],timesheet_file:void 0,...t}}i(G,"buildInitialValues");var Pe=i(({employmentId:t,options:e,initialValues:d})=>{let{fieldValues:c,setFieldValues:C,stepState:o,previousStep:v,nextStep:R}=h(P),{data:u}=F(t),f=G({...o.values?.employee_communication,...o.values?.termination_details,...o.values?.paid_time_off,...o.values?.additional_information,...d}),p=j(()=>({...o.values?.[o.currentStep.name],...f,...c}),[o.values,o.currentStep.name,c,f]),E=j(()=>({fields:{risk_assesment_info:_("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),proposed_termination_date_info:_("Proposed termination date",X(Q,{children:["In most cases, we must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",b(S,{zendeskId:g.terminationNoticePeriods,className:r("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,presentation:{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:i(()=>b(x,{employeeName:u?.basic_information?.name,proposedTerminationDate:p.proposed_termination_date}),"Component")}}}}),[u?.basic_information?.name,p.proposed_termination_date,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.risk_assesment_info]),{data:s,isLoading:$}=w({formValues:p,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...E?.fields}},step:o.currentStep.name}),l=K(k.data.schema),y=M(),{mutateAsync:D}=V(y);async function I(a){if(!t)throw new Error("Employment id is missing");if(s){let n=m(a,l.fields,{isPartialValidation:!0}),{customer_informed_employee:z}=n,B=z==="yes"?{employee_awareness:{date:n.customer_informed_employee_date,note:n.customer_informed_employee_description}}:void 0,H=T(n,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),L=W(H,"customer_informed_employee_date","customer_informed_employee_description"),A=Z({...L,...B},U);return D({employment_id:t,termination_details:A,type:"termination"})}}i(I,"onSubmit");function J(){v()}i(J,"back");function O(){R()}return i(O,"next"),{employmentId:t,stepState:o,fields:s?.fields||[],isLoading:$,isSubmitting:y.isPending,initialValues:f,handleValidation:i(a=>{if(s){let n=m(a,s?.fields);return s?.handleValidation(n)}return null},"handleValidation"),checkFieldUpdates:i(a=>{if(l){let n=m(a,l?.fields,{isPartialValidation:!0});C(n)}},"checkFieldUpdates"),parseFormValues:i(a=>m(a,l.fields,{isPartialValidation:!0}),"parseFormValues"),onSubmit:I,back:J,next:O}},"useTermination");export{Pe as a};
2
+ //# sourceMappingURL=chunk-CGUTMSAU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/hooks.tsx","../src/components/form/jsf-utils/createFields.tsx"],"sourcesContent":["import {\n CreateOffboardingParams,\n TerminationDetailsParams,\n} from '@/src/client';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { $TSFixMe, createHeadlessForm } from '@remoteoss/json-schema-form';\nimport omitBy from 'lodash.omitby';\nimport isNull from 'lodash.isnull';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport {\n TerminationFlowProps,\n TerminationFormValues,\n} from '@/src/flows/Termination/types';\nimport omit from 'lodash.omit';\nimport { parseFormRadioValues } from '@/src/flows/utils';\nimport { useStepState } from '@/src/flows/useStepState';\nimport { STEPS } from '@/src/flows/Termination/utils';\nimport { jsonSchema } from '@/src/flows/Termination/json-schemas/jsonSchema';\nimport { useCreateTermination, useTerminationSchema } from '@/src/flows/api';\nimport { useMemo } from 'react';\nimport { createInformationField } from '@/src/components/form/jsf-utils/createFields';\nimport { cn, ZendeskTriggerButton } from '@/src/internals';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { PaidTimeOff } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOff';\nimport { useEmployment } from '@/src/flows/Onboarding/api';\n\nfunction buildInitialValues(\n stepsInitialValues: Partial<TerminationFormValues>,\n): TerminationFormValues {\n const initialValues: TerminationFormValues = {\n confidential: '',\n customer_informed_employee: '',\n customer_informed_employee_date: '',\n customer_informed_employee_description: '',\n personal_email: '',\n termination_reason: undefined,\n reason_description: '',\n termination_reason_files: [],\n will_challenge_termination: '',\n will_challenge_termination_description: null,\n agrees_to_pto_amount: '',\n agrees_to_pto_amount_notes: null,\n acknowledge_termination_procedure: false,\n additional_comments: '',\n proposed_termination_date: '',\n risk_assessment_reasons: [],\n timesheet_file: undefined,\n ...stepsInitialValues,\n };\n\n return initialValues;\n}\n\ntype TerminationHookProps = Omit<TerminationFlowProps, 'render'>;\n\nexport const useTermination = ({\n employmentId,\n options,\n initialValues: terminationInitialValues,\n}: TerminationHookProps) => {\n const { fieldValues, setFieldValues, stepState, previousStep, nextStep } =\n useStepState<keyof typeof STEPS, TerminationFormValues>(STEPS);\n\n const { data: employment } = useEmployment(employmentId);\n\n const initialValues = buildInitialValues({\n ...stepState.values?.employee_communication,\n ...stepState.values?.termination_details,\n ...stepState.values?.paid_time_off,\n ...stepState.values?.additional_information,\n ...terminationInitialValues,\n });\n\n const formValues = useMemo(\n () => ({\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...initialValues,\n ...fieldValues,\n }),\n [stepState.values, stepState.currentStep.name, fieldValues, initialValues],\n );\n\n const customFields = useMemo(() => {\n return {\n fields: {\n risk_assesment_info: createInformationField(\n 'Offboarding risk assessment',\n 'Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.',\n {\n className: (\n options?.jsfModify?.fields?.risk_assesment_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date_info: createInformationField(\n 'Proposed termination date',\n <>\n In most cases, we must provide notice to the employee before\n termination. The required notice period depends on local labor laws,\n the employment agreement, and other factors. We'll use those factors\n to determine the required notice period.\n <ZendeskTriggerButton\n zendeskId={zendeskArticles.terminationNoticePeriods}\n className={cn(\n 'text-sm',\n (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.zendeskTriggerButtonClassName,\n )}\n >\n Learn about notice periods\n </ZendeskTriggerButton>\n </>,\n {\n className: (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n paid_time_off_info: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe),\n presentation: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe)?.[\n 'x-jsf-presentation'\n ],\n Component: () => {\n return (\n <PaidTimeOff\n employeeName={employment?.basic_information?.name as string}\n proposedTerminationDate={formValues.proposed_termination_date}\n />\n );\n },\n },\n },\n },\n };\n }, [\n employment?.basic_information?.name,\n formValues.proposed_termination_date,\n options?.jsfModify?.fields?.paid_time_off_info,\n options?.jsfModify?.fields?.proposed_termination_date_info,\n options?.jsfModify?.fields?.risk_assesment_info,\n ]);\n\n const { data: terminationHeadlessForm, isLoading: isLoadingTermination } =\n useTerminationSchema({\n formValues: formValues,\n jsfModify: {\n ...options?.jsfModify,\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n step: stepState.currentStep.name,\n });\n\n const entireTerminationSchema = createHeadlessForm(jsonSchema.data.schema);\n\n const createTermination = useCreateTermination();\n const { mutateAsync } = mutationToPromise(createTermination);\n\n async function onSubmit(values: TerminationFormValues) {\n if (!employmentId) {\n throw new Error('Employment id is missing');\n }\n\n if (terminationHeadlessForm) {\n // this is a hack because I need to validate all form values with the entire schema\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema.fields,\n { isPartialValidation: true },\n );\n\n const { customer_informed_employee: customerInformedEmployee } =\n parsedValues;\n\n const employeeAwareness =\n customerInformedEmployee === 'yes'\n ? {\n employee_awareness: {\n date: parsedValues.customer_informed_employee_date,\n note: parsedValues.customer_informed_employee_description,\n },\n }\n : undefined;\n\n const radioFieldKeys = [\n 'agrees_to_pto_amount',\n 'confidential',\n 'customer_informed_employee',\n 'will_challenge_termination',\n ];\n\n const parsedRadioValues = parseFormRadioValues(\n parsedValues,\n radioFieldKeys,\n );\n\n const normalizedValues = omit(\n parsedRadioValues,\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n );\n\n const terminationDetails: TerminationDetailsParams = omitBy(\n {\n ...normalizedValues,\n ...employeeAwareness,\n },\n isNull,\n ) as unknown as TerminationDetailsParams;\n\n const terminationPayload: CreateOffboardingParams = {\n employment_id: employmentId,\n termination_details: terminationDetails,\n type: 'termination',\n };\n\n return mutateAsync(terminationPayload);\n }\n\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: terminationHeadlessForm?.fields || [],\n /**\n * Loading state indicating if the termination schema is being fetched\n */\n isLoading: isLoadingTermination,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting: createTermination.isPending,\n /**\n * Initial form values\n */\n initialValues: initialValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: TerminationFormValues) => {\n if (terminationHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n return terminationHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: (values: Partial<TerminationFormValues>) => {\n if (entireTerminationSchema) {\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema?.fields,\n { isPartialValidation: true },\n );\n setFieldValues(parsedValues as TerminationFormValues);\n }\n },\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues: (values: TerminationFormValues) => {\n return parseJSFToValidate(values, entireTerminationSchema.fields, {\n isPartialValidation: true,\n });\n },\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n };\n};\n","import { cn } from '@/src/lib/utils';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\n\ntype JSFPresentationConfig = {\n inputType?: string;\n Component?: React.ComponentType<$TSFixMe>;\n hidden?: boolean;\n [key: string]: unknown;\n};\n\ntype JSFFieldConfig = {\n 'x-jsf-presentation'?: JSFPresentationConfig;\n [key: string]: unknown;\n};\n\n/**\n * Creates an information field with standard styling\n */\nexport function createInformationField(\n title: React.ReactNode,\n description: React.ReactNode,\n options?: {\n className?: string;\n },\n): JSFFieldConfig {\n return {\n presentation: {\n inputType: 'hidden',\n Component: () => (\n <div\n className={cn(\n 'RemoteFlows__InformationStatement',\n options?.className,\n )}\n >\n <h3 className={cn('RemoteFlows__InformationStatement__Title')}>\n {title}\n </h3>\n <p className={cn('RemoteFlows__InformationStatement__Description')}>\n {description}\n </p>\n </div>\n ),\n },\n };\n}\n"],"mappings":"+gBAKA,OAAmB,sBAAAA,MAA0B,8BAC7C,OAAOC,MAAY,gBACnB,OAAOC,MAAY,gBAMnB,OAAOC,MAAU,cAMjB,OAAS,WAAAC,MAAe,QCUhB,OAME,OAAAC,EANF,QAAAC,MAAA,oBAXD,SAASC,EACdC,EACAC,EACAC,EAGgB,CAChB,MAAO,CACL,aAAc,CACZ,UAAW,SACX,UAAWC,EAAA,IACTL,EAAC,OACC,UAAWM,EACT,oCACAF,GAAS,SACX,EAEA,UAAAL,EAAC,MAAG,UAAWO,EAAG,0CAA0C,EACzD,SAAAJ,EACH,EACAH,EAAC,KAAE,UAAWO,EAAG,gDAAgD,EAC9D,SAAAH,EACH,GACF,EAbS,YAeb,CACF,CACF,CA3BgBE,EAAAJ,EAAA,0BD8EN,mBAAAM,EAKE,OAAAC,EALF,QAAAC,MAAA,oBAtEV,SAASC,EACPC,EACuB,CAsBvB,MArB6C,CAC3C,aAAc,GACd,2BAA4B,GAC5B,gCAAiC,GACjC,uCAAwC,GACxC,eAAgB,GAChB,mBAAoB,OACpB,mBAAoB,GACpB,yBAA0B,CAAC,EAC3B,2BAA4B,GAC5B,uCAAwC,KACxC,qBAAsB,GACtB,2BAA4B,KAC5B,kCAAmC,GACnC,oBAAqB,GACrB,0BAA2B,GAC3B,wBAAyB,CAAC,EAC1B,eAAgB,OAChB,GAAGA,CACL,CAGF,CAzBSC,EAAAF,EAAA,sBA6BF,IAAMG,GAAiBD,EAAA,CAAC,CAC7B,aAAAE,EACA,QAAAC,EACA,cAAeC,CACjB,IAA4B,CAC1B,GAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,UAAAC,EAAW,aAAAC,EAAc,SAAAC,CAAS,EACrEC,EAAwDC,CAAK,EAEzD,CAAE,KAAMC,CAAW,EAAIC,EAAcX,CAAY,EAEjDY,EAAgBhB,EAAmB,CACvC,GAAGS,EAAU,QAAQ,uBACrB,GAAGA,EAAU,QAAQ,oBACrB,GAAGA,EAAU,QAAQ,cACrB,GAAGA,EAAU,QAAQ,uBACrB,GAAGH,CACL,CAAC,EAEKW,EAAaC,EACjB,KAAO,CACL,GAAGT,EAAU,SAASA,EAAU,YAAY,IAA0B,EACtE,GAAGO,EACH,GAAGT,CACL,GACA,CAACE,EAAU,OAAQA,EAAU,YAAY,KAAMF,EAAaS,CAAa,CAC3E,EAEMG,EAAeD,EAAQ,KACpB,CACL,OAAQ,CACN,oBAAqBE,EACnB,8BACA,wNACA,CACE,UACEf,GAAS,WAAW,QAAQ,sBAC1B,oBAAoB,GAAG,SAC7B,CACF,EACA,+BAAgCe,EAC9B,4BACArB,EAAAF,EAAA,CAAE,4PAKAC,EAACuB,EAAA,CACC,UAAWC,EAAgB,yBAC3B,UAAWC,EACT,UAEElB,GAAS,WAAW,QAChB,iCACF,oBAAoB,GAAG,6BAC7B,EACD,sCAED,GACF,EACA,CACE,UACEA,GAAS,WAAW,QAChB,iCACF,oBAAoB,GAAG,SAC7B,CACF,EACA,mBAAoB,CAClB,GAAIA,GAAS,WAAW,QAAQ,mBAChC,aAAc,CACZ,GAAIA,GAAS,WAAW,QAAQ,qBAC9B,oBACF,EACA,UAAWH,EAAA,IAEPJ,EAAC0B,EAAA,CACC,aAAcV,GAAY,mBAAmB,KAC7C,wBAAyBG,EAAW,0BACtC,EALO,YAQb,CACF,CACF,CACF,GACC,CACDH,GAAY,mBAAmB,KAC/BG,EAAW,0BACXZ,GAAS,WAAW,QAAQ,mBAC5BA,GAAS,WAAW,QAAQ,+BAC5BA,GAAS,WAAW,QAAQ,mBAC9B,CAAC,EAEK,CAAE,KAAMoB,EAAyB,UAAWC,CAAqB,EACrEC,EAAqB,CACnB,WAAYV,EACZ,UAAW,CACT,GAAGZ,GAAS,UACZ,OAAQ,CACN,GAAGA,GAAS,WAAW,OACvB,GAAGc,GAAc,MACnB,CACF,EACA,KAAMV,EAAU,YAAY,IAC9B,CAAC,EAEGmB,EAA0BC,EAAmBC,EAAW,KAAK,MAAM,EAEnEC,EAAoBC,EAAqB,EACzC,CAAE,YAAAC,CAAY,EAAIC,EAAkBH,CAAiB,EAE3D,eAAeI,EAASC,EAA+B,CACrD,GAAI,CAAChC,EACH,MAAM,IAAI,MAAM,0BAA0B,EAG5C,GAAIqB,EAAyB,CAE3B,IAAMY,EAAeC,EACnBF,EACAR,EAAwB,OACxB,CAAE,oBAAqB,EAAK,CAC9B,EAEM,CAAE,2BAA4BW,CAAyB,EAC3DF,EAEIG,EACJD,IAA6B,MACzB,CACE,mBAAoB,CAClB,KAAMF,EAAa,gCACnB,KAAMA,EAAa,sCACrB,CACF,EACA,OASAI,EAAoBC,EACxBL,EARqB,CACrB,uBACA,eACA,6BACA,4BACF,CAKA,EAEMM,EAAmBC,EACvBH,EACA,kCACA,wCACF,EAEMI,EAA+CC,EACnD,CACE,GAAGH,EACH,GAAGH,CACL,EACAO,CACF,EAQA,OAAOd,EAN6C,CAClD,cAAe7B,EACf,oBAAqByC,EACrB,KAAM,aACR,CAEqC,CACvC,CAGF,CA9De3C,EAAAiC,EAAA,YAgEf,SAASa,GAAO,CACdtC,EAAa,CACf,CAFSR,EAAA8C,EAAA,QAIT,SAASC,GAAO,CACdtC,EAAS,CACX,CAFS,OAAAT,EAAA+C,EAAA,QAIF,CAIL,aAAA7C,EAIA,UAAAK,EAIA,OAAQgB,GAAyB,QAAU,CAAC,EAI5C,UAAWC,EAIX,aAAcK,EAAkB,UAIhC,cAAef,EAMf,iBAAkBd,EAACkC,GAAkC,CACnD,GAAIX,EAAyB,CAC3B,IAAMY,EAAeC,EACnBF,EACAX,GAAyB,MAC3B,EACA,OAAOA,GAAyB,iBAAiBY,CAAY,CAC/D,CACA,OAAO,IACT,EATkB,oBAclB,kBAAmBnC,EAACkC,GAA2C,CAC7D,GAAIR,EAAyB,CAC3B,IAAMS,EAAeC,EACnBF,EACAR,GAAyB,OACzB,CAAE,oBAAqB,EAAK,CAC9B,EACApB,EAAe6B,CAAqC,CACtD,CACF,EATmB,qBAenB,gBAAiBnC,EAACkC,GACTE,EAAmBF,EAAQR,EAAwB,OAAQ,CAChE,oBAAqB,EACvB,CAAC,EAHc,mBAUjB,SAAAO,EAMA,KAAAa,EAMA,KAAAC,CACF,CACF,EAzQ8B","names":["createHeadlessForm","omitBy","isNull","omit","useMemo","jsx","jsxs","createInformationField","title","description","options","__name","cn","Fragment","jsx","jsxs","buildInitialValues","stepsInitialValues","__name","useTermination","employmentId","options","terminationInitialValues","fieldValues","setFieldValues","stepState","previousStep","nextStep","useStepState","STEPS","employment","useEmployment","initialValues","formValues","useMemo","customFields","createInformationField","ZendeskTriggerButton","zendeskArticles","cn","PaidTimeOff","terminationHeadlessForm","isLoadingTermination","useTerminationSchema","entireTerminationSchema","createHeadlessForm","jsonSchema","createTermination","useCreateTermination","mutateAsync","mutationToPromise","onSubmit","values","parsedValues","parseJSFToValidate","customerInformedEmployee","employeeAwareness","parsedRadioValues","parseFormRadioValues","normalizedValues","omit","terminationDetails","omitBy","isNull","back","next"]}
@@ -1,2 +1,2 @@
1
- import{b as d}from"./chunk-MRYRNB7Y.js";import{b as a}from"./chunk-CFIJKJXD.js";import{a as f}from"./chunk-EIVHHLR5.js";import{f as s,g as l}from"./chunk-CNDSIADP.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as T}from"react";import{jsx as e}from"react/jsx-runtime";function A({fields:m,onSubmit:F}){let{formId:u,terminationBag:o}=d(),c=a(o.handleValidation),i=s({resolver:c,defaultValues:o?.initialValues,shouldUnregister:!1,mode:"onBlur"});T(()=>{let y=i?.watch(r=>{Object.keys(r).some(t=>r[t]!==o?.initialValues?.[t])&&o?.checkFieldUpdates(r)});return()=>y?.unsubscribe()},[]);let p=m||(o?.fields??[]);return e(l,{...i,children:e("form",{id:u,onSubmit:i.handleSubmit(F),className:"space-y-4 RemoteFlows__TerminationForm",children:e(f,{fields:p})})})}n(A,"TerminationForm");export{A as a};
2
- //# sourceMappingURL=chunk-5SKMAYLG.js.map
1
+ import{b as d}from"./chunk-MRYRNB7Y.js";import{b as a}from"./chunk-CFIJKJXD.js";import{a as f}from"./chunk-A7T27JCJ.js";import{f as s,g as l}from"./chunk-CNDSIADP.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as T}from"react";import{jsx as e}from"react/jsx-runtime";function A({fields:m,onSubmit:F}){let{formId:u,terminationBag:o}=d(),c=a(o.handleValidation),i=s({resolver:c,defaultValues:o?.initialValues,shouldUnregister:!1,mode:"onBlur"});T(()=>{let y=i?.watch(r=>{Object.keys(r).some(t=>r[t]!==o?.initialValues?.[t])&&o?.checkFieldUpdates(r)});return()=>y?.unsubscribe()},[]);let p=m||(o?.fields??[]);return e(l,{...i,children:e("form",{id:u,onSubmit:i.handleSubmit(F),className:"space-y-4 RemoteFlows__TerminationForm",children:e(f,{fields:p})})})}n(A,"TerminationForm");export{A as a};
2
+ //# sourceMappingURL=chunk-CRHH6IPF.js.map
@@ -1,2 +1,2 @@
1
- import{b as e}from"./chunk-TOA3JILU.js";import{b as i}from"./chunk-E773NPNL.js";import{b as m}from"./chunk-3ZWDIEEM.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function p({children:t,...o}){let{formId:n}=e(),{components:f}=m(),r=f?.button;return r?s(r,{...o,form:n,children:t}):s(i,{...o,form:n,children:t})}u(p,"OnboardingSubmit");export{p as a};
2
- //# sourceMappingURL=chunk-QIAZQLSG.js.map
1
+ import{b as e}from"./chunk-TOA3JILU.js";import{b as i}from"./chunk-WVDTHFGS.js";import{b as m}from"./chunk-3ZWDIEEM.js";import{a as u}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function p({children:t,...o}){let{formId:n}=e(),{components:f}=m(),r=f?.button;return r?s(r,{...o,form:n,children:t}):s(i,{...o,form:n,children:t})}u(p,"OnboardingSubmit");export{p as a};
2
+ //# sourceMappingURL=chunk-DPY77ASH.js.map
@@ -1,2 +1,2 @@
1
- import{a as b}from"./chunk-NHYBFEXA.js";import{b as P}from"./chunk-TOA3JILU.js";import{b as g}from"./chunk-7XRPOR7L.js";import{b as m}from"./chunk-E773NPNL.js";import{a}from"./chunk-P37U34EQ.js";import{useState as f,useMemo as S}from"react";import{Document as k,Page as C,pdfjs as x}from"react-pdf";import{jsx as r,jsxs as i}from"react/jsx-runtime";x.GlobalWorkerOptions.workerSrc=`//unpkg.com/pdfjs-dist@${x.version}/build/pdf.worker.min.mjs`;function N({base64Data:c,fileName:l="document.pdf"}){let[n,t]=f(0),[s,u]=f(1),[p,o]=f(!0),[d,w]=f(""),v=S(()=>{if(!c)return"";let e=c.trim();return e.startsWith("data:application/pdf;base64,")||e.startsWith("data:")?e:`data:application/pdf;base64,${e}`},[c]),h=a(({numPages:e})=>{t(e),o(!1),w("")},"onDocumentLoadSuccess"),y=a(e=>{console.error("Error loading PDF:",e),w("Failed to load PDF document"),o(!1)},"onDocumentLoadError"),E=a(()=>{u(e=>Math.max(1,e-1))},"goToPrevPage"),D=a(()=>{u(e=>Math.min(n,e+1))},"goToNextPage");return v?i("div",{className:"w-full space-y-4",children:[i("div",{children:[i("div",{className:"flex justify-center items-center min-h-[600px] p-4 bg-gray-50",children:[p&&i("div",{className:"text-center",children:[r("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-gray-900 mx-auto mb-4"}),r("p",{className:"text-gray-600",children:"Loading PDF..."})]}),d&&i("div",{className:"text-center space-y-4",children:[r("p",{className:"text-red-600",children:d}),r(m,{asChild:!0,children:r("a",{href:v,download:l,children:"Download PDF Instead"})})]}),!d&&r(k,{file:v,onLoadSuccess:h,onLoadError:y,loading:"",className:"flex flex-col items-center",children:r(C,{pageNumber:s,renderTextLayer:!0,renderAnnotationLayer:!0,className:"shadow-lg",width:Math.min(window.innerWidth-100,800)})})]}),n>0&&!d&&r("div",{className:"border-t bg-white px-4 py-3",children:i("div",{className:"flex items-center justify-between",children:[r(m,{onClick:E,disabled:s<=1,variant:"outline",size:"sm",children:"\u2190 Previous"}),i("div",{className:"text-sm text-gray-600",children:["Page ",s," of ",n]}),r(m,{onClick:D,disabled:s>=n,variant:"outline",size:"sm",children:"Next \u2192"})]})})]}),i("div",{className:"flex justify-between items-center text-sm",children:[r("p",{className:"text-gray-600",children:l}),r(m,{variant:"link",size:"link",asChild:!0,children:i("a",{href:v,download:l,className:"flex items-center gap-1",children:[r("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download PDF"]})})]})]}):r("div",{className:"w-full border rounded p-8 text-center bg-gray-50",children:r("p",{className:"text-gray-500",children:"No PDF data available"})})}a(N,"PDFPreview");import{jsx as F,jsxs as L}from"react/jsx-runtime";function I({onSubmit:c,onSuccess:l,onError:n}){let{contractorOnboardingBag:t}=P(),s=a(async p=>{try{await c?.(t.parseFormValues(p));let o=await t.onSubmit(p);if(o?.data){await l?.(o?.data),t?.next();return}if(o?.error){let d=g(o?.fieldErrors||[],t.meta?.fields?.contract_preview);n?.({error:o?.error,rawError:o?.rawError,fieldErrors:d})}}catch(o){n?.({error:o,rawError:o,fieldErrors:[]})}},"handleSubmit"),u=t.stepState.values?.contract_preview||t.initialValues.contract_preview;return L("div",{className:"space-y-4",children:[F(N,{base64Data:t.documentPreviewPdf?.contract_document.content}),F(b,{defaultValues:u,onSubmit:s})]})}a(I,"ContractPreviewStep");export{I as a};
2
- //# sourceMappingURL=chunk-J26AI33Z.js.map
1
+ import{a as b}from"./chunk-N6KOPITR.js";import{b as P}from"./chunk-TOA3JILU.js";import{b as g}from"./chunk-7XRPOR7L.js";import{b as m}from"./chunk-WVDTHFGS.js";import{a}from"./chunk-P37U34EQ.js";import{useState as f,useMemo as S}from"react";import{Document as k,Page as C,pdfjs as x}from"react-pdf";import{jsx as r,jsxs as i}from"react/jsx-runtime";x.GlobalWorkerOptions.workerSrc=`//unpkg.com/pdfjs-dist@${x.version}/build/pdf.worker.min.mjs`;function N({base64Data:c,fileName:l="document.pdf"}){let[n,t]=f(0),[s,u]=f(1),[p,o]=f(!0),[d,w]=f(""),v=S(()=>{if(!c)return"";let e=c.trim();return e.startsWith("data:application/pdf;base64,")||e.startsWith("data:")?e:`data:application/pdf;base64,${e}`},[c]),h=a(({numPages:e})=>{t(e),o(!1),w("")},"onDocumentLoadSuccess"),y=a(e=>{console.error("Error loading PDF:",e),w("Failed to load PDF document"),o(!1)},"onDocumentLoadError"),E=a(()=>{u(e=>Math.max(1,e-1))},"goToPrevPage"),D=a(()=>{u(e=>Math.min(n,e+1))},"goToNextPage");return v?i("div",{className:"w-full space-y-4",children:[i("div",{children:[i("div",{className:"flex justify-center items-center min-h-[600px] p-4 bg-gray-50",children:[p&&i("div",{className:"text-center",children:[r("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-gray-900 mx-auto mb-4"}),r("p",{className:"text-gray-600",children:"Loading PDF..."})]}),d&&i("div",{className:"text-center space-y-4",children:[r("p",{className:"text-red-600",children:d}),r(m,{asChild:!0,children:r("a",{href:v,download:l,children:"Download PDF Instead"})})]}),!d&&r(k,{file:v,onLoadSuccess:h,onLoadError:y,loading:"",className:"flex flex-col items-center",children:r(C,{pageNumber:s,renderTextLayer:!0,renderAnnotationLayer:!0,className:"shadow-lg",width:Math.min(window.innerWidth-100,800)})})]}),n>0&&!d&&r("div",{className:"border-t bg-white px-4 py-3",children:i("div",{className:"flex items-center justify-between",children:[r(m,{onClick:E,disabled:s<=1,variant:"outline",size:"sm",children:"\u2190 Previous"}),i("div",{className:"text-sm text-gray-600",children:["Page ",s," of ",n]}),r(m,{onClick:D,disabled:s>=n,variant:"outline",size:"sm",children:"Next \u2192"})]})})]}),i("div",{className:"flex justify-between items-center text-sm",children:[r("p",{className:"text-gray-600",children:l}),r(m,{variant:"link",size:"link",asChild:!0,children:i("a",{href:v,download:l,className:"flex items-center gap-1",children:[r("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download PDF"]})})]})]}):r("div",{className:"w-full border rounded p-8 text-center bg-gray-50",children:r("p",{className:"text-gray-500",children:"No PDF data available"})})}a(N,"PDFPreview");import{jsx as F,jsxs as L}from"react/jsx-runtime";function I({onSubmit:c,onSuccess:l,onError:n}){let{contractorOnboardingBag:t}=P(),s=a(async p=>{try{await c?.(t.parseFormValues(p));let o=await t.onSubmit(p);if(o?.data){await l?.(o?.data),t?.next();return}if(o?.error){let d=g(o?.fieldErrors||[],t.meta?.fields?.contract_preview);n?.({error:o?.error,rawError:o?.rawError,fieldErrors:d})}}catch(o){n?.({error:o,rawError:o,fieldErrors:[]})}},"handleSubmit"),u=t.stepState.values?.contract_preview||t.initialValues.contract_preview;return L("div",{className:"space-y-4",children:[F(N,{base64Data:t.documentPreviewPdf?.contract_document.content}),F(b,{defaultValues:u,onSubmit:s})]})}a(I,"ContractPreviewStep");export{I as a};
2
+ //# sourceMappingURL=chunk-DUD7B2IY.js.map