@remoteoss/remote-flows 1.17.0 → 1.18.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 (302) hide show
  1. package/dist/CountryFieldDefault-KSVYDH5T.js +2 -0
  2. package/dist/DatePickerFieldDefault-TZEI446Y.js +2 -0
  3. package/dist/RadioGroupFieldDefault-U44JTO4O.js +2 -0
  4. package/dist/chunk-2IA5ZHU4.js +6 -0
  5. package/dist/chunk-2IA5ZHU4.js.map +1 -0
  6. package/dist/{chunk-WEAO46EO.js → chunk-36MJ5ORQ.js} +2 -2
  7. package/dist/{chunk-LJIJ6UKB.js → chunk-3GYINB3B.js} +2 -2
  8. package/dist/{chunk-MLVB5MYU.js → chunk-545OW3ET.js} +2 -2
  9. package/dist/{chunk-6MAQMAY5.js → chunk-5BBQUGAN.js} +2 -2
  10. package/dist/{chunk-UMVMNUPH.js → chunk-5D4AKL3N.js} +2 -2
  11. package/dist/{chunk-EDLQ3JNY.js → chunk-5L2ELV4L.js} +2 -2
  12. package/dist/{chunk-R7BHA5RA.js → chunk-6P53J6DA.js} +2 -2
  13. package/dist/{chunk-A232PIG7.js → chunk-AK4FXJFO.js} +2 -2
  14. package/dist/{chunk-NAH5PAUK.js → chunk-BCO3C476.js} +2 -2
  15. package/dist/{chunk-VBQVXR4U.js → chunk-C6ND527K.js} +2 -2
  16. package/dist/{chunk-XHAJ544L.js → chunk-CPXEQRNG.js} +2 -2
  17. package/dist/{chunk-B7EJ2OAA.js → chunk-CUANSH3E.js} +2 -2
  18. package/dist/chunk-DAXHNASW.js +2 -0
  19. package/dist/{chunk-3NB2BN46.js.map → chunk-DAXHNASW.js.map} +1 -1
  20. package/dist/{chunk-AJIDQALB.js → chunk-DM5RRWPM.js} +2 -2
  21. package/dist/{chunk-PHPCCABU.js → chunk-EKJK34DS.js} +2 -2
  22. package/dist/{chunk-4HPV2VMI.js → chunk-EQVUP5ZR.js} +2 -2
  23. package/dist/{chunk-OB2J5WSO.js → chunk-FBWPGUBC.js} +2 -2
  24. package/dist/chunk-FHYOWPXB.js +2 -0
  25. package/dist/chunk-FHYOWPXB.js.map +1 -0
  26. package/dist/{chunk-UB6PYKNX.js → chunk-FJ6WBG3H.js} +2 -2
  27. package/dist/{chunk-BG66XH5L.js → chunk-FQHFTFUZ.js} +2 -2
  28. package/dist/chunk-GCBEPX4V.js +2 -0
  29. package/dist/chunk-GCBEPX4V.js.map +1 -0
  30. package/dist/{chunk-O6IBNOQU.js → chunk-GCVM3FO4.js} +2 -2
  31. package/dist/{chunk-B2CNIT3P.js → chunk-GDJP7TMP.js} +2 -2
  32. package/dist/{chunk-W4ECFBIA.js → chunk-I2NE5CCG.js} +2 -2
  33. package/dist/{chunk-ERSP6CZ3.js → chunk-J6HS3UVY.js} +2 -2
  34. package/dist/{chunk-IMVVZZFZ.js → chunk-JPA3IMPE.js} +2 -2
  35. package/dist/{chunk-3474OEAS.js → chunk-K5S6JRYY.js} +2 -2
  36. package/dist/{chunk-HFI3LXZ2.js → chunk-L4P7572F.js} +2 -2
  37. package/dist/{chunk-RYQQDPI7.js → chunk-M53HKCJ5.js} +2 -2
  38. package/dist/{chunk-DFAY4TWC.js → chunk-MCWXQT7A.js} +2 -2
  39. package/dist/{chunk-4UO7KLRK.js → chunk-N3Q636ZK.js} +2 -2
  40. package/dist/{chunk-62O3CKKH.js → chunk-NAGIFFJS.js} +2 -2
  41. package/dist/{chunk-6SSDV2GX.js → chunk-NNW7S5AY.js} +2 -2
  42. package/dist/{chunk-YPUP5LNV.js → chunk-OHCA7HXR.js} +2 -2
  43. package/dist/{chunk-4N4MQECC.js → chunk-OXAEJWEQ.js} +2 -2
  44. package/dist/{chunk-TPGN6QTL.js → chunk-OZKZKV5C.js} +2 -2
  45. package/dist/{chunk-JI4CYPLW.js → chunk-PGVAOMQU.js} +2 -2
  46. package/dist/{chunk-LVXV3GHT.js → chunk-QGGPXNVY.js} +2 -2
  47. package/dist/{chunk-MHAY555P.js → chunk-QI6E2NJU.js} +2 -2
  48. package/dist/{chunk-3B6XXK5H.js → chunk-QNWTCGRD.js} +2 -2
  49. package/dist/{chunk-HOR3KPOZ.js → chunk-SAKDBD4P.js} +2 -2
  50. package/dist/chunk-SD3LBJUH.js +2 -0
  51. package/dist/{chunk-246D2A55.js.map → chunk-SD3LBJUH.js.map} +1 -1
  52. package/dist/{chunk-TAHMDXUS.js → chunk-SJ5IZCJP.js} +2 -2
  53. package/dist/{chunk-SLLDKJ7K.js → chunk-SNRZPCZ7.js} +2 -2
  54. package/dist/{chunk-HYYILYKU.js → chunk-T3GSGHZJ.js} +2 -2
  55. package/dist/{chunk-TPGM3OIU.js → chunk-TMWN4PEK.js} +2 -2
  56. package/dist/{chunk-NMLBGBK2.js → chunk-UPJDLAKU.js} +2 -2
  57. package/dist/{chunk-YOIXPHGR.js → chunk-URJI6IZB.js} +2 -2
  58. package/dist/{chunk-BVFQ6LFD.js → chunk-V6LOIP27.js} +2 -2
  59. package/dist/{chunk-7WGZGAQY.js → chunk-V74BLD3D.js} +2 -2
  60. package/dist/{chunk-FERWQW33.js → chunk-VKE3F6V7.js} +2 -2
  61. package/dist/{chunk-YWZHBXEI.js → chunk-WH6BDFVD.js} +2 -2
  62. package/dist/{chunk-37RMY44V.js → chunk-WOH5UQMK.js} +2 -2
  63. package/dist/chunk-WUFJP4GG.js +2 -0
  64. package/dist/chunk-WUFJP4GG.js.map +1 -0
  65. package/dist/{chunk-BGRX3DBF.js → chunk-X6ZOK7H5.js} +2 -2
  66. package/dist/{chunk-CARPUKT7.js → chunk-XFDNQDDA.js} +2 -2
  67. package/dist/{chunk-G6QGYKPO.js → chunk-XFGSO4WQ.js} +2 -2
  68. package/dist/chunk-XOK42FJS.js +2 -0
  69. package/dist/chunk-XOK42FJS.js.map +1 -0
  70. package/dist/{chunk-NEKE5PRJ.js → chunk-YRC6EEM3.js} +2 -2
  71. package/dist/{chunk-4EMAROPQ.js → chunk-ZTKZWB7I.js} +2 -2
  72. package/dist/chunk-ZVUQDK2E.js +2 -0
  73. package/dist/default-components.d.ts +2 -2
  74. package/dist/default-components.js +1 -1
  75. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  76. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  77. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  78. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  79. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  80. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  81. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  82. package/dist/flows/ContractAmendment/hooks.js +1 -1
  83. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  84. package/dist/flows/ContractAmendment/index.js +1 -1
  85. package/dist/flows/ContractAmendment/types.d.ts +2 -2
  86. package/dist/flows/ContractAmendment/utils.d.ts +2 -2
  87. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
  88. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  89. package/dist/flows/ContractorOnboarding/api.d.ts +3 -2
  90. package/dist/flows/ContractorOnboarding/api.js +1 -1
  91. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
  92. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  93. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
  94. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  95. package/dist/flows/ContractorOnboarding/components/ContractPreviewHeader.d.ts +2 -2
  96. package/dist/flows/ContractorOnboarding/components/ContractPreviewStatement.d.ts +2 -2
  97. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
  98. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  99. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
  100. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  101. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.d.ts +5 -5
  102. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.js +1 -1
  103. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  104. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  105. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
  106. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  107. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
  108. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  109. package/dist/flows/ContractorOnboarding/context.d.ts +6 -5
  110. package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
  111. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  112. package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
  113. package/dist/flows/ContractorOnboarding/index.js +1 -1
  114. package/dist/flows/ContractorOnboarding/jsfModify.d.ts +5 -5
  115. package/dist/flows/ContractorOnboarding/jsfModify.js +1 -1
  116. package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
  117. package/dist/flows/ContractorOnboarding/utils.d.ts +4 -4
  118. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  119. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  120. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  121. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  122. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +2 -2
  123. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  124. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +2 -2
  125. package/dist/flows/CostCalculator/api.d.ts +2 -2
  126. package/dist/flows/CostCalculator/api.js +1 -1
  127. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  128. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  129. package/dist/flows/CostCalculator/context.d.ts +3 -3
  130. package/dist/flows/CostCalculator/hooks.d.ts +3 -3
  131. package/dist/flows/CostCalculator/hooks.js +1 -1
  132. package/dist/flows/CostCalculator/index.d.ts +3 -3
  133. package/dist/flows/CostCalculator/index.js +1 -1
  134. package/dist/flows/CostCalculator/types.d.ts +2 -2
  135. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  136. package/dist/flows/CostCalculator/utils.js +1 -1
  137. package/dist/flows/CreateCompany/CreateCompany.d.ts +4 -4
  138. package/dist/flows/CreateCompany/CreateCompany.js +1 -1
  139. package/dist/flows/CreateCompany/api.d.ts +2 -2
  140. package/dist/flows/CreateCompany/api.js +1 -1
  141. package/dist/flows/CreateCompany/components/AddressDetailsStep.d.ts +4 -4
  142. package/dist/flows/CreateCompany/components/AddressDetailsStep.js +1 -1
  143. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.d.ts +4 -4
  144. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.js +1 -1
  145. package/dist/flows/CreateCompany/components/CreateCompanyForm.d.ts +2 -2
  146. package/dist/flows/CreateCompany/components/CreateCompanyForm.js +1 -1
  147. package/dist/flows/CreateCompany/context.d.ts +4 -4
  148. package/dist/flows/CreateCompany/hooks.d.ts +4 -4
  149. package/dist/flows/CreateCompany/hooks.js +1 -1
  150. package/dist/flows/CreateCompany/index.d.ts +4 -4
  151. package/dist/flows/CreateCompany/index.js +1 -1
  152. package/dist/flows/CreateCompany/types.d.ts +4 -4
  153. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
  154. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  155. package/dist/flows/Onboarding/api.d.ts +13 -5
  156. package/dist/flows/Onboarding/api.js +1 -1
  157. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  158. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  159. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
  160. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  161. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
  162. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  163. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
  164. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  165. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
  166. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  167. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  168. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  169. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
  170. package/dist/flows/Onboarding/components/ReviewStep.js +1 -1
  171. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  172. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
  173. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  174. package/dist/flows/Onboarding/context.d.ts +5 -4
  175. package/dist/flows/Onboarding/hooks.d.ts +4 -4
  176. package/dist/flows/Onboarding/hooks.js +1 -1
  177. package/dist/flows/Onboarding/index.d.ts +4 -4
  178. package/dist/flows/Onboarding/index.js +1 -1
  179. package/dist/flows/Onboarding/types.d.ts +4 -4
  180. package/dist/flows/Onboarding/utils.d.ts +4 -4
  181. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
  182. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  183. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
  184. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  185. package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
  186. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  187. package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
  188. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  189. package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
  190. package/dist/flows/Termination/TerminationFlow.js +1 -1
  191. package/dist/flows/Termination/TerminationForm.d.ts +4 -4
  192. package/dist/flows/Termination/TerminationForm.js +1 -1
  193. package/dist/flows/Termination/api.d.ts +5 -5
  194. package/dist/flows/Termination/api.js +1 -1
  195. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
  196. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +6 -6
  197. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +6 -6
  198. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
  199. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +6 -6
  200. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  201. package/dist/flows/Termination/context.d.ts +4 -4
  202. package/dist/flows/Termination/hooks.d.ts +4 -4
  203. package/dist/flows/Termination/hooks.js +1 -1
  204. package/dist/flows/Termination/index.d.ts +6 -6
  205. package/dist/flows/Termination/index.js +1 -1
  206. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  207. package/dist/flows/Termination/json-schemas/schema.d.ts +4 -4
  208. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  209. package/dist/flows/Termination/types.d.ts +4 -4
  210. package/dist/flows/Termination/utils.d.ts +4 -4
  211. package/dist/flows/types.d.ts +2 -2
  212. package/dist/index.css +1 -1
  213. package/dist/index.css.map +1 -1
  214. package/dist/index.d.ts +11 -11
  215. package/dist/index.js +2 -2
  216. package/dist/internals.d.ts +3 -3
  217. package/dist/{mutations-Cqu0sBct.d.ts → mutations-C70g1hf2.d.ts} +1 -1
  218. package/dist/{remoteFlows-Dq_HhlrK.d.ts → remoteFlows-S2ZmIMR3.d.ts} +1 -1
  219. package/dist/styles.css +1 -1
  220. package/dist/styles.css.map +1 -1
  221. package/dist/{types-Cspu8sBY.d.ts → types-Bt3Nvzma.d.ts} +1 -1
  222. package/dist/{types-C4ZurZsm.d.ts → types-DAJZFuKz.d.ts} +5 -4
  223. package/dist/{types-CpquG01D.d.ts → types-DP9U0M1b.d.ts} +3 -3
  224. package/dist/{types-BxDv4R-M.d.ts → types-DXC7D8qf.d.ts} +8 -3
  225. package/dist/{types-6I1B0MOG.d.ts → types-Dq-2OENN.d.ts} +2 -2
  226. package/dist/{types.gen-DOfO2pGp.d.ts → types.gen-BSxAhJ_V.d.ts} +5 -1
  227. package/dist/{utils-DOln70Os.d.ts → utils-BaHnOWNw.d.ts} +1 -1
  228. package/package.json +1 -4
  229. package/dist/CountryFieldDefault-JZDE75HS.js +0 -2
  230. package/dist/DatePickerFieldDefault-LJV4QSEP.js +0 -2
  231. package/dist/RadioGroupFieldDefault-CXY33ONT.js +0 -2
  232. package/dist/chunk-246D2A55.js +0 -2
  233. package/dist/chunk-3NB2BN46.js +0 -2
  234. package/dist/chunk-5FTC6HMG.js +0 -2
  235. package/dist/chunk-5FTC6HMG.js.map +0 -1
  236. package/dist/chunk-7ENB7H4E.js +0 -6
  237. package/dist/chunk-7ENB7H4E.js.map +0 -1
  238. package/dist/chunk-MTYN4AM3.js +0 -2
  239. package/dist/chunk-OENTT2KT.js +0 -2
  240. package/dist/chunk-OENTT2KT.js.map +0 -1
  241. package/dist/chunk-SLD227LM.js +0 -2
  242. package/dist/chunk-SLD227LM.js.map +0 -1
  243. package/dist/chunk-Z7WBY27D.js +0 -2
  244. package/dist/chunk-Z7WBY27D.js.map +0 -1
  245. /package/dist/{CountryFieldDefault-JZDE75HS.js.map → CountryFieldDefault-KSVYDH5T.js.map} +0 -0
  246. /package/dist/{DatePickerFieldDefault-LJV4QSEP.js.map → DatePickerFieldDefault-TZEI446Y.js.map} +0 -0
  247. /package/dist/{RadioGroupFieldDefault-CXY33ONT.js.map → RadioGroupFieldDefault-U44JTO4O.js.map} +0 -0
  248. /package/dist/{chunk-WEAO46EO.js.map → chunk-36MJ5ORQ.js.map} +0 -0
  249. /package/dist/{chunk-LJIJ6UKB.js.map → chunk-3GYINB3B.js.map} +0 -0
  250. /package/dist/{chunk-MLVB5MYU.js.map → chunk-545OW3ET.js.map} +0 -0
  251. /package/dist/{chunk-6MAQMAY5.js.map → chunk-5BBQUGAN.js.map} +0 -0
  252. /package/dist/{chunk-UMVMNUPH.js.map → chunk-5D4AKL3N.js.map} +0 -0
  253. /package/dist/{chunk-EDLQ3JNY.js.map → chunk-5L2ELV4L.js.map} +0 -0
  254. /package/dist/{chunk-R7BHA5RA.js.map → chunk-6P53J6DA.js.map} +0 -0
  255. /package/dist/{chunk-A232PIG7.js.map → chunk-AK4FXJFO.js.map} +0 -0
  256. /package/dist/{chunk-NAH5PAUK.js.map → chunk-BCO3C476.js.map} +0 -0
  257. /package/dist/{chunk-VBQVXR4U.js.map → chunk-C6ND527K.js.map} +0 -0
  258. /package/dist/{chunk-XHAJ544L.js.map → chunk-CPXEQRNG.js.map} +0 -0
  259. /package/dist/{chunk-B7EJ2OAA.js.map → chunk-CUANSH3E.js.map} +0 -0
  260. /package/dist/{chunk-AJIDQALB.js.map → chunk-DM5RRWPM.js.map} +0 -0
  261. /package/dist/{chunk-PHPCCABU.js.map → chunk-EKJK34DS.js.map} +0 -0
  262. /package/dist/{chunk-4HPV2VMI.js.map → chunk-EQVUP5ZR.js.map} +0 -0
  263. /package/dist/{chunk-OB2J5WSO.js.map → chunk-FBWPGUBC.js.map} +0 -0
  264. /package/dist/{chunk-UB6PYKNX.js.map → chunk-FJ6WBG3H.js.map} +0 -0
  265. /package/dist/{chunk-BG66XH5L.js.map → chunk-FQHFTFUZ.js.map} +0 -0
  266. /package/dist/{chunk-O6IBNOQU.js.map → chunk-GCVM3FO4.js.map} +0 -0
  267. /package/dist/{chunk-B2CNIT3P.js.map → chunk-GDJP7TMP.js.map} +0 -0
  268. /package/dist/{chunk-W4ECFBIA.js.map → chunk-I2NE5CCG.js.map} +0 -0
  269. /package/dist/{chunk-ERSP6CZ3.js.map → chunk-J6HS3UVY.js.map} +0 -0
  270. /package/dist/{chunk-IMVVZZFZ.js.map → chunk-JPA3IMPE.js.map} +0 -0
  271. /package/dist/{chunk-3474OEAS.js.map → chunk-K5S6JRYY.js.map} +0 -0
  272. /package/dist/{chunk-HFI3LXZ2.js.map → chunk-L4P7572F.js.map} +0 -0
  273. /package/dist/{chunk-RYQQDPI7.js.map → chunk-M53HKCJ5.js.map} +0 -0
  274. /package/dist/{chunk-DFAY4TWC.js.map → chunk-MCWXQT7A.js.map} +0 -0
  275. /package/dist/{chunk-4UO7KLRK.js.map → chunk-N3Q636ZK.js.map} +0 -0
  276. /package/dist/{chunk-62O3CKKH.js.map → chunk-NAGIFFJS.js.map} +0 -0
  277. /package/dist/{chunk-6SSDV2GX.js.map → chunk-NNW7S5AY.js.map} +0 -0
  278. /package/dist/{chunk-YPUP5LNV.js.map → chunk-OHCA7HXR.js.map} +0 -0
  279. /package/dist/{chunk-4N4MQECC.js.map → chunk-OXAEJWEQ.js.map} +0 -0
  280. /package/dist/{chunk-TPGN6QTL.js.map → chunk-OZKZKV5C.js.map} +0 -0
  281. /package/dist/{chunk-JI4CYPLW.js.map → chunk-PGVAOMQU.js.map} +0 -0
  282. /package/dist/{chunk-LVXV3GHT.js.map → chunk-QGGPXNVY.js.map} +0 -0
  283. /package/dist/{chunk-MHAY555P.js.map → chunk-QI6E2NJU.js.map} +0 -0
  284. /package/dist/{chunk-3B6XXK5H.js.map → chunk-QNWTCGRD.js.map} +0 -0
  285. /package/dist/{chunk-HOR3KPOZ.js.map → chunk-SAKDBD4P.js.map} +0 -0
  286. /package/dist/{chunk-TAHMDXUS.js.map → chunk-SJ5IZCJP.js.map} +0 -0
  287. /package/dist/{chunk-SLLDKJ7K.js.map → chunk-SNRZPCZ7.js.map} +0 -0
  288. /package/dist/{chunk-HYYILYKU.js.map → chunk-T3GSGHZJ.js.map} +0 -0
  289. /package/dist/{chunk-TPGM3OIU.js.map → chunk-TMWN4PEK.js.map} +0 -0
  290. /package/dist/{chunk-NMLBGBK2.js.map → chunk-UPJDLAKU.js.map} +0 -0
  291. /package/dist/{chunk-YOIXPHGR.js.map → chunk-URJI6IZB.js.map} +0 -0
  292. /package/dist/{chunk-BVFQ6LFD.js.map → chunk-V6LOIP27.js.map} +0 -0
  293. /package/dist/{chunk-7WGZGAQY.js.map → chunk-V74BLD3D.js.map} +0 -0
  294. /package/dist/{chunk-FERWQW33.js.map → chunk-VKE3F6V7.js.map} +0 -0
  295. /package/dist/{chunk-YWZHBXEI.js.map → chunk-WH6BDFVD.js.map} +0 -0
  296. /package/dist/{chunk-37RMY44V.js.map → chunk-WOH5UQMK.js.map} +0 -0
  297. /package/dist/{chunk-BGRX3DBF.js.map → chunk-X6ZOK7H5.js.map} +0 -0
  298. /package/dist/{chunk-CARPUKT7.js.map → chunk-XFDNQDDA.js.map} +0 -0
  299. /package/dist/{chunk-G6QGYKPO.js.map → chunk-XFGSO4WQ.js.map} +0 -0
  300. /package/dist/{chunk-NEKE5PRJ.js.map → chunk-YRC6EEM3.js.map} +0 -0
  301. /package/dist/{chunk-4EMAROPQ.js.map → chunk-ZTKZWB7I.js.map} +0 -0
  302. /package/dist/{chunk-MTYN4AM3.js.map → chunk-ZVUQDK2E.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as f}from"./chunk-DFAY4TWC.js";import{i as a,j as c,k as l,l as m,m as _}from"./chunk-H2JFQGQJ.js";import{a as u,b as R}from"./chunk-SNBAM7SA.js";import{a as F}from"./chunk-VIGKOVHP.js";import{a as p}from"./chunk-P37U34EQ.js";import{Fragment as g}from"react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var w=p(({field:s,fieldData:i,fieldState:C})=>{let{name:r,label:d,description:n,options:b}=i;return e("fieldset",{className:F("space-y-3",`RemoteFlows__RadioGroupField__Item__${r}`),"data-field":r,children:t(a,{children:[e("legend",{children:d}),n&&e(m,{helpCenter:e(f,{helpCenter:i.meta?.helpCenter}),children:n}),e(l,{children:e(u,{"aria-label":d||r,onValueChange:o=>{s.onChange(o)},value:s.value,className:"flex flex-col space-y-3",children:b?.map(o=>e(g,{children:t(a,{"data-field":r,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[e(l,{children:e(R,{value:o.value,className:"RemoteFlows__RadioField__Input",disabled:o.disabled})}),t("div",{children:[e(c,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:o.label}),o.description&&e(m,{className:"mt-2",children:o.description})]})]})},o.value))})}),C.error&&e(_,{})]})})},"RadioGroupFieldDefault");export{w as a};
2
- //# sourceMappingURL=chunk-ERSP6CZ3.js.map
1
+ import{a as f}from"./chunk-MCWXQT7A.js";import{i as a,j as c,k as l,l as m,m as _}from"./chunk-H2JFQGQJ.js";import{a as u,b as R}from"./chunk-SNBAM7SA.js";import{a as F}from"./chunk-VIGKOVHP.js";import{a as p}from"./chunk-P37U34EQ.js";import{Fragment as g}from"react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var w=p(({field:s,fieldData:i,fieldState:C})=>{let{name:r,label:d,description:n,options:b}=i;return e("fieldset",{className:F("space-y-3",`RemoteFlows__RadioGroupField__Item__${r}`),"data-field":r,children:t(a,{children:[e("legend",{children:d}),n&&e(m,{helpCenter:e(f,{helpCenter:i.meta?.helpCenter}),children:n}),e(l,{children:e(u,{"aria-label":d||r,onValueChange:o=>{s.onChange(o)},value:s.value,className:"flex flex-col space-y-3",children:b?.map(o=>e(g,{children:t(a,{"data-field":r,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[e(l,{children:e(R,{value:o.value,className:"RemoteFlows__RadioField__Input",disabled:o.disabled})}),t("div",{children:[e(c,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:o.label}),o.description&&e(m,{className:"mt-2",children:o.description})]})]})},o.value))})}),C.error&&e(_,{})]})})},"RadioGroupFieldDefault");export{w as a};
2
+ //# sourceMappingURL=chunk-J6HS3UVY.js.map
@@ -1,2 +1,2 @@
1
- import{c as d,d as S}from"./chunk-4N4MQECC.js";import{a as f}from"./chunk-KSHK3ZPX.js";import{a as u}from"./chunk-HN5HLFTB.js";import{b as C}from"./chunk-LNV36S6D.js";import{f as y}from"./chunk-H2JFQGQJ.js";import{a as o}from"./chunk-P37U34EQ.js";import{useEffect as T,useId as U,useState as I}from"react";import{jsx as k}from"react/jsx-runtime";var l=o((n,e,r)=>r&&r[e]?r[e]:n[e]?n[e]/100:0,"getDefaultManagementFee"),A=o((n,e,r,g)=>!e&&!r?.management_fee&&n?l(u,n,g):e&&!r?.management_fee?"":r?.management_fee,"getManagementFee"),W=o(({estimationOptions:n=d,defaultValues:e={countryRegionSlug:"",regionSlug:"",currencySlug:"",salary:"",benefits:{},management:{management_fee:""}},options:r,render:g,version:_="standard"})=>{let p=U(),[R,m]=I("USD"),F=o(s=>{m(s);let a=l(u,s,n.managementFees);a&&c.setValue("management.management_fee",a.toString())},"onCurrencyChange"),t=S({defaultRegion:e.countryRegionSlug,defaultCurrency:e.currencySlug,defaultSalary:e.salary,estimationOptions:n,version:_,options:{...r,onCurrencyChange:F}}),K=C(t.handleValidation),b=A(R,e.currencySlug,e.management,n.managementFees),{countryRegionSlug:v,currencySlug:h,salary:D,benefits:P,hiringBudget:B,age:E,contractDurationType:M,regionSlug:w,...x}=e,c=y({resolver:K,defaultValues:{country:v,currency:h,region:w,salary:D,salary_conversion:"",salary_converted:void 0,hiring_budget:B||"employee_annual_salary",age:E,contract_duration_type:M,management:{management_fee:b?.toString()||""},benefits:P,estimation_title:n.title,...x},shouldUnregister:!1,mode:"onBlur"});return T(()=>{if(e.currencySlug&&t.currencies&&n.includeManagementFee&&!e.management?.management_fee){let a=t.currencies.find(i=>i.value===e.currencySlug)?.label;if(a){m(a);let i=l(u,a,n.managementFees);c.setValue("management.management_fee",i?.toString()||"")}}},[e.currencySlug,t.currencies,n.includeManagementFee,n.managementFees,e.management?.management_fee,c]),k(f.Provider,{value:{form:c,formId:p,costCalculatorBag:t},children:g(t)})},"CostCalculatorFlow");export{W as a};
2
- //# sourceMappingURL=chunk-IMVVZZFZ.js.map
1
+ import{c as d,d as S}from"./chunk-OXAEJWEQ.js";import{a as f}from"./chunk-KSHK3ZPX.js";import{a as u}from"./chunk-HN5HLFTB.js";import{b as C}from"./chunk-LNV36S6D.js";import{f as y}from"./chunk-H2JFQGQJ.js";import{a as o}from"./chunk-P37U34EQ.js";import{useEffect as T,useId as U,useState as I}from"react";import{jsx as k}from"react/jsx-runtime";var l=o((n,e,r)=>r&&r[e]?r[e]:n[e]?n[e]/100:0,"getDefaultManagementFee"),A=o((n,e,r,g)=>!e&&!r?.management_fee&&n?l(u,n,g):e&&!r?.management_fee?"":r?.management_fee,"getManagementFee"),W=o(({estimationOptions:n=d,defaultValues:e={countryRegionSlug:"",regionSlug:"",currencySlug:"",salary:"",benefits:{},management:{management_fee:""}},options:r,render:g,version:_="standard"})=>{let p=U(),[R,m]=I("USD"),F=o(s=>{m(s);let a=l(u,s,n.managementFees);a&&c.setValue("management.management_fee",a.toString())},"onCurrencyChange"),t=S({defaultRegion:e.countryRegionSlug,defaultCurrency:e.currencySlug,defaultSalary:e.salary,estimationOptions:n,version:_,options:{...r,onCurrencyChange:F}}),K=C(t.handleValidation),b=A(R,e.currencySlug,e.management,n.managementFees),{countryRegionSlug:v,currencySlug:h,salary:D,benefits:P,hiringBudget:B,age:E,contractDurationType:M,regionSlug:w,...x}=e,c=y({resolver:K,defaultValues:{country:v,currency:h,region:w,salary:D,salary_conversion:"",salary_converted:void 0,hiring_budget:B||"employee_annual_salary",age:E,contract_duration_type:M,management:{management_fee:b?.toString()||""},benefits:P,estimation_title:n.title,...x},shouldUnregister:!1,mode:"onBlur"});return T(()=>{if(e.currencySlug&&t.currencies&&n.includeManagementFee&&!e.management?.management_fee){let a=t.currencies.find(i=>i.value===e.currencySlug)?.label;if(a){m(a);let i=l(u,a,n.managementFees);c.setValue("management.management_fee",i?.toString()||"")}}},[e.currencySlug,t.currencies,n.includeManagementFee,n.managementFees,e.management?.management_fee,c]),k(f.Provider,{value:{form:c,formId:p,costCalculatorBag:t},children:g(t)})},"CostCalculatorFlow");export{W as a};
2
+ //# sourceMappingURL=chunk-JPA3IMPE.js.map
@@ -1,2 +1,2 @@
1
- import{f as jt,h as Qt,i as Jt}from"./chunk-SLD227LM.js";import{a as Ut,b as Ht,c as zt,d as Xt,e as Yt,f as Zt,h as te,i as ee,j as ie,k as ne,l as oe,m as re,n as ae,o as se,p as ce,q as le,r as ue,s as de,t as me}from"./chunk-3NB2BN46.js";import{a as pe,b as fe,c as ye}from"./chunk-FERWQW33.js";import{a as Kt,b as Gt,f as $t,g as Wt}from"./chunk-IZGJP7OI.js";import{a as G,b as it,c as b,d as Nt}from"./chunk-LHEF2FN7.js";import{a as kt}from"./chunk-JI4CYPLW.js";import{a as Bt,e as p,f as M}from"./chunk-T7O3YYOG.js";import{K as Rt}from"./chunk-7ENB7H4E.js";import{h as P,i as V}from"./chunk-VIGKOVHP.js";import{a as g}from"./chunk-X6ZAR7ZL.js";import{a as xt}from"./chunk-TSPDJUGG.js";import{d as At}from"./chunk-KQPDXXG3.js";import{a as d}from"./chunk-P37U34EQ.js";import{useEffect as q,useMemo as o,useRef as pi,useState as O}from"react";import ge from"lodash.omit";import{useQuery as di}from"@tanstack/react-query";var mi=d(()=>{let{client:L}=At(),{data:I}=Ht(),a=zt(I)?I?.company?.id??"":"";return di({queryKey:["legal-entities",a],queryFn:d(()=>Rt({client:L,path:{company_id:a}}),"queryFn"),select:d($=>$.data?.data?.legal_entities,"select"),enabled:!!a})},"useLegalEntities"),_e=d(()=>{let{data:L}=mi();return L?.find(I=>I.is_default)},"useDefaultLegalEntity");var fi={select_country:null,basic_information:"employment_basic_information",contract_details:null,eligibility_questionnaire:null,pricing_plan:null,contract_preview:null,review:null},yi={employment_basic_information:"basic_information"},Ji=d(({countryCode:L,externalId:I,employmentId:a,skipSteps:$,options:_,initialValues:u})=>{let be=_?.excludeProducts||[],[c,mt]=O(L||null),[s,Se]=O(a),[h,pt]=O(void 0),W=pi({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{},eligibility_questionnaire:{}}),[H,Ce]=O(void 0),[ft,z]=O(!1),[yt,we]=O(!0),[nt,_t]=O(null),{steps:Pe,stepsArray:he}=o(()=>Kt({includeSelectCountry:!$?.includes("select_country"),includeEligibilityQuestionnaire:ft,includeContractPreview:yt}),[ft,yt,$]),{fieldValues:l,stepState:e,setFieldValues:Fe,previousStep:Ee,nextStep:ve,goToStep:R,setStepValues:gt}=xt(Pe);q(()=>{nt&&(R(nt),_t(null))},[nt,R]);let{data:r,isLoading:Ve,refetch:bt}=kt({employmentId:s,queryParams:{exclude_files:!0}}),Me=_e(),{status:D}=r||{},S=D&&$t.includes(D),Oe=D&&!Wt.includes(D),Ie=o(()=>D==="invited"?"invited":"not_invited",[D]),St=Qt(),Ct=Jt(c,_),ot=ee(),wt=Ut(),{mutateAsync:Pt}=oe(ot,wt,l),ht=ce(),Ft=le(),{mutateAsyncOrThrow:De}=g(Ct),Et=Yt(),vt=te(),Vt=ue(),{mutateAsyncOrThrow:Te}=g(St),{mutateAsyncOrThrow:qe}=g(ot),{mutateAsyncOrThrow:Le}=g(Et),{mutateAsyncOrThrow:Mt}=g(vt),{mutateAsyncOrThrow:Re}=g(ht),{mutateAsyncOrThrow:Ae}=g(Ft),{mutateAsyncOrThrow:Be}=g(Vt);a&&r?.country?.code&&!c&&mt(r.country.code);let{selectCountryForm:X,isLoading:je,countries:Ot}=de({jsfModify:_?.jsfModify?.select_country}),rt=o(()=>Ot?.find(t=>t.value===c),[Ot,c]),Qe=o(()=>rt?.label,[rt]),Je=e.currentStep.name==="pricing_plan"||!!a&&S,{form:F,isLoading:ke,contractorSubscriptions:Y,refetch:at,isEligibilityQuestionnaireBlocked:A}=ne(s,rt,{jsonSchemaVersion:_?.jsonSchemaVersion,queryOptions:{enabled:Je},excludeProducts:be,jsfModify:_?.jsfModify?.pricing_plan}),T=o(()=>!!Y?.find(t=>t.product.short_name==="COR")?.eligibility_questionnaire?.submitted_at,[Y]);q(()=>{if(T){z(!1);return}else z(H===b)},[T,H]),q(()=>{let t=r?.contractor_type==="cor";we(!t)},[r?.contractor_type]);let Z=o(()=>Y?.find(t=>t.product.short_name==="COR")?.eligibility_questionnaire?.responses,[Y]),xe=fi[e.currentStep.name]||"contractor_basic_information",Ne=yi[xe],Ue=r?.[Ne]||{},Ke=d(({form:t,options:n={},query:m={}})=>{let y=Object.keys(l).length>0?{...u,...e.values?.[e.currentStep.name],...l}:{...u,...Ue};return jt({countryCode:c,form:t,fieldValues:y,query:m,options:{...n,queryOptions:{enabled:n.queryOptions?.enabled??!0}}})},"useJSONSchema"),Ge=!!(c&&(e.currentStep.name==="basic_information"||a)),$e=!!(c==="GBR"&&a&&e.currentStep.name==="basic_information"),{data:B,isLoading:We}=re(a,{enabled:$e}),{data:tt,isLoading:He}=ae(a,{enabled:!!a});q(()=>{tt&&tt.length>0&&!h&&pt(tt[0].id)},[tt,h]);let{data:C,isLoading:ze}=Ke({form:"contractor_basic_information",options:{jsfModify:fe(c,Qe,_),queryOptions:{enabled:Ge}}}),Xe=o(()=>Gt(r?.basic_information?.provisional_start_date,l?.service_duration?.provisional_start_date),[r?.basic_information?.provisional_start_date,l?.service_duration?.provisional_start_date]),f=o(()=>{let t={standard:G,plus:it,cor:b};if(l.subscription)return l.subscription;let n=e.values?.pricing_plan?.subscription;return n&&!A?n:T&&!A?b:A&&T?G:t[r?.contractor_type]||G},[l,e.values,T,r?.contractor_type,A]);q(()=>{f&&f!==H&&Ce(f)},[f,H]);let Ye=o(()=>({...Z,...u,...e.values?.eligibility_questionnaire,...l}),[Z,u,e.values?.eligibility_questionnaire,l]),Ze=o(()=>f===b&&e.currentStep.name==="eligibility_questionnaire"||!!a&&S&&f===b,[f,e.currentStep.name,a,S]),{data:E,isLoading:ti}=se({options:{queryOptions:{enabled:Ze},jsfModify:_?.jsfModify?.eligibility_questionnaire},fieldValues:Ye}),ei=!!(c&&e.currentStep.name==="contract_details"||S),{data:w,isLoading:ii}=me({countryCode:c,fieldValues:l,employmentId:s,options:{queryOptions:{enabled:ei},jsfModify:pe(_?.jsfModify?.contract_details,Xe,f,l)}}),ni=o(()=>e.currentStep.name==="contract_preview"||!!a&&S,[e.currentStep.name,a,S]),{data:v}=Xt({fieldValues:l,options:{queryOptions:{enabled:ni},jsfModify:ye(_,l)}}),{data:st,isLoading:oi}=Zt({employmentId:s,contractDocumentId:h,options:{queryOptions:{enabled:!!h}}}),i=o(()=>({select_country:X?.fields||[],basic_information:C?.fields||[],pricing_plan:F?.fields||[],eligibility_questionnaire:E?.fields||[],contract_details:w?.fields||[],contract_preview:v?.fields||[],review:[]}),[X?.fields,C?.fields,F?.fields,w?.fields,v?.fields,E?.fields]),ri={select_country:null,basic_information:C?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:w?.meta["x-jsf-fieldsets"],eligibility_questionnaire:null,contract_preview:null,review:null},{country:ai,basic_information:et={},contract_details:It={}}=r||{},Dt=ai?.code,j=o(()=>M(i.select_country,{country:c||Dt||""}),[i.select_country,c,Dt]),ct=o(()=>B?.content?Bt(B.content,B.name):null,[B?.content,B?.name]),Q=o(()=>{let t={...u,...et,ir35:r?.contract_details?.ir_35,nationality_status:r?.contract_details?.nationality,...ct&&{ir35_sds_file:[ct]}};return M(i.basic_information,t)},[u,et,r?.contract_details?.ir_35,r?.contract_details?.nationality,ct,i.basic_information]),J=o(()=>{let n={...{service_duration:{provisional_start_date:et.provisional_start_date}},...u,...It};return M(i.contract_details,n)},[i.contract_details,It,u,et]),k=o(()=>{let t=st?.contract_document?.signatories?.find(m=>m.type==="company"),n={...u,signature:t?.signature};return M(i.contract_preview,n)},[i.contract_preview,u,st]),x=o(()=>{let n={...{subscription:f},...u};return M(i.pricing_plan,n)},[i.pricing_plan,u,f]),N=o(()=>{let t={...u,...Z};return M(i.eligibility_questionnaire,t)},[i.eligibility_questionnaire,u,Z]),si=o(()=>({select_country:j,basic_information:Q,contract_details:J,contract_preview:k,pricing_plan:x,eligibility_questionnaire:N}),[j,Q,J,k,x,N]),lt=!!(a&&S&&e.currentStep.name!=="review"),ut=je||ze||Ve||ii||ke||oi||We||He||ti,Tt=o(()=>{let n=r?.contractor_type==="cor"||i.contract_preview.length>0;return!!(lt&&!ut&&h&&i.basic_information.length>0&&i.contract_details.length>0&&n)},[lt,ut,h,i.basic_information.length,i.contract_details.length,i.contract_preview.length,r?.contractor_type]);q(()=>{Tt&&(W.current={select_country:P(j,i.select_country),basic_information:P(Q,i.basic_information),contract_details:P(J,i.contract_details),contract_preview:P(k,i.contract_preview),pricing_plan:P(x,i.pricing_plan),eligibility_questionnaire:P(N,i.eligibility_questionnaire)},gt({select_country:j,basic_information:Q,contract_details:J,contract_preview:k,pricing_plan:x,eligibility_questionnaire:N,review:{}}),R("review"))},[Tt,R,j,Q,J,gt,i.select_country,i.basic_information,i.contract_details,i.pricing_plan,x,i.contract_preview,k,i.eligibility_questionnaire,N]);let ci=d(t=>{R(t)},"goTo"),qt=d(async t=>X&&e.currentStep.name==="select_country"?t:C&&e.currentStep.name==="basic_information"?await p(t,C?.fields,{isPartialValidation:!1}):w&&e.currentStep.name==="contract_details"?await p(t,w?.fields,{isPartialValidation:!1}):v&&e.currentStep.name==="contract_preview"?await p(t,v?.fields,{isPartialValidation:!1}):F&&e.currentStep.name==="pricing_plan"?await p(t,F?.fields,{isPartialValidation:!1}):E&&e.currentStep.name==="eligibility_questionnaire"?await p(t,E?.fields,{isPartialValidation:!1}):{},"parseFormValues");async function li(t){let n=e.currentStep.name;n in W.current&&(W.current[n]=P(t,i[n]));let m=await qt(t);switch(e.currentStep.name){case"select_country":return mt(m.country),Promise.resolve({data:{countryCode:m.country}});case"basic_information":{let U=!s&&c,y=s&&c&&r?.country&&r?.country.code!==c;if(U||y){let ui={basic_information:ge(m,"nationality_status","ir35","ir35_sds_file"),type:"contractor",country_code:c,external_id:I},Lt=await Te(ui),dt=Lt?.data?.employment?.id;if(!dt)throw V("Employment ID not found");return await Pt({employmentId:dt}),Se(dt),Lt}else if(s){let K=ge(m,"nationality_status","ir35","ir35_sds_file");return await Pt({employmentId:s}),De({employmentId:s,basic_information:K})}return}case"contract_details":{let y=await qe({employmentId:s,payload:{contract_document:m}}),K=y?.data?.contract_document?.id;if(!K)throw V("Contract document ID not found");return pt(K),await bt(),y}case"contract_preview":return Le({employmentId:s,contractDocumentId:h,payload:{signature:m.signature}});case"pricing_plan":{if(A&&[b,it].includes(t.subscription))throw V(`This individual is not eligible for ${ie[t.subscription]}.`);if(t.subscription===Nt)return Promise.resolve({data:{subscription:t.subscription}});if(T&&t.subscription!==b)try{await Be({employmentId:s}),await at()}catch(y){if(y?.response?.status!==404)throw y;await at()}if(t.subscription==G)return Mt({employmentId:s,payload:{operation:"downgrade"}});if(t.subscription==it)return Mt({employmentId:s,payload:{operation:"upgrade"}});if(t.subscription==b)return Promise.resolve({data:{subscription:t.subscription}});throw V("invalid selection")}case"eligibility_questionnaire":try{if((await Re({employmentId:s,payload:m}))?.data?.is_blocking)throw z(!1),_t("pricing_plan"),V("This individual is not eligible for Contractor of Record.");return await Ae({employmentId:s})}finally{await at()}default:throw V("Invalid step state")}}return d(li,"onSubmit"),{isLoading:ut||lt,fieldValues:l,stepState:e,checkFieldUpdates:Fe,back:Ee,next:ve,goTo:ci,onSubmit:li,fields:i[e.currentStep.name],meta:{fields:W.current,fieldsets:ri[e.currentStep.name]},parseFormValues:qt,handleValidation:d(async t=>{if(e.currentStep.name==="select_country")return X.handleValidation(t);if(C&&e.currentStep.name==="basic_information"){let n=await p(t,C?.fields,{isPartialValidation:!1});return C?.handleValidation(n)}if(w&&e.currentStep.name==="contract_details"){let n=await p(t,w?.fields,{isPartialValidation:!1});return w?.handleValidation(n)}if(v&&e.currentStep.name==="contract_preview"){let n=await p(t,v?.fields,{isPartialValidation:!0});return v?.handleValidation(n)}if(F&&e.currentStep.name==="pricing_plan"){let n=await p(t,F?.fields,{isPartialValidation:!1});return F?.handleValidation(n)}if(E&&e.currentStep.name==="eligibility_questionnaire"){let n=await p(t,E?.fields,{isPartialValidation:!1});return E?.handleValidation(n)}return null},"handleValidation"),initialValues:si,employmentId:s,refetchEmployment:bt,isSubmitting:St.isPending||Ct.isPending||ot.isPending||Et.isPending||vt.isPending||wt.isPending||ht.isPending||Ft.isPending||Vt.isPending,documentPreviewPdf:st,canInvite:Oe,isEmploymentReadOnly:S,invitedStatus:Ie,employment:r,defaultLegalEntity:Me,steps:he}},"useContractorOnboarding");export{Ji as a};
2
- //# sourceMappingURL=chunk-3474OEAS.js.map
1
+ import{f as jt,h as Qt,i as Jt}from"./chunk-WUFJP4GG.js";import{a as Ut,b as Ht,c as zt,d as Xt,e as Yt,f as Zt,h as te,i as ee,j as ie,k as ne,l as oe,m as re,n as ae,o as se,p as ce,q as le,r as ue,s as de,t as me}from"./chunk-DAXHNASW.js";import{a as pe,b as fe,c as ye}from"./chunk-VKE3F6V7.js";import{a as Kt,b as Gt,f as $t,g as Wt}from"./chunk-IZGJP7OI.js";import{a as G,b as it,c as b,d as Nt}from"./chunk-LHEF2FN7.js";import{a as kt}from"./chunk-PGVAOMQU.js";import{a as Bt,e as p,f as M}from"./chunk-T7O3YYOG.js";import{L as Rt}from"./chunk-2IA5ZHU4.js";import{h as P,i as V}from"./chunk-VIGKOVHP.js";import{a as g}from"./chunk-X6ZAR7ZL.js";import{a as xt}from"./chunk-TSPDJUGG.js";import{d as At}from"./chunk-KQPDXXG3.js";import{a as d}from"./chunk-P37U34EQ.js";import{useEffect as q,useMemo as o,useRef as pi,useState as O}from"react";import ge from"lodash.omit";import{useQuery as di}from"@tanstack/react-query";var mi=d(()=>{let{client:L}=At(),{data:I}=Ht(),a=zt(I)?I?.company?.id??"":"";return di({queryKey:["legal-entities",a],queryFn:d(()=>Rt({client:L,path:{company_id:a}}),"queryFn"),select:d($=>$.data?.data?.legal_entities,"select"),enabled:!!a})},"useLegalEntities"),_e=d(()=>{let{data:L}=mi();return L?.find(I=>I.is_default)},"useDefaultLegalEntity");var fi={select_country:null,basic_information:"employment_basic_information",contract_details:null,eligibility_questionnaire:null,pricing_plan:null,contract_preview:null,review:null},yi={employment_basic_information:"basic_information"},Ji=d(({countryCode:L,externalId:I,employmentId:a,skipSteps:$,options:_,initialValues:u})=>{let be=_?.excludeProducts||[],[c,mt]=O(L||null),[s,Se]=O(a),[h,pt]=O(void 0),W=pi({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{},eligibility_questionnaire:{}}),[H,Ce]=O(void 0),[ft,z]=O(!1),[yt,we]=O(!0),[nt,_t]=O(null),{steps:Pe,stepsArray:he}=o(()=>Kt({includeSelectCountry:!$?.includes("select_country"),includeEligibilityQuestionnaire:ft,includeContractPreview:yt}),[ft,yt,$]),{fieldValues:l,stepState:e,setFieldValues:Fe,previousStep:Ee,nextStep:ve,goToStep:R,setStepValues:gt}=xt(Pe);q(()=>{nt&&(R(nt),_t(null))},[nt,R]);let{data:r,isLoading:Ve,refetch:bt}=kt({employmentId:s,queryParams:{exclude_files:!0}}),Me=_e(),{status:D}=r||{},S=D&&$t.includes(D),Oe=D&&!Wt.includes(D),Ie=o(()=>D==="invited"?"invited":"not_invited",[D]),St=Qt(),Ct=Jt(c,_),ot=ee(),wt=Ut(),{mutateAsync:Pt}=oe(ot,wt,l),ht=ce(),Ft=le(),{mutateAsyncOrThrow:De}=g(Ct),Et=Yt(),vt=te(),Vt=ue(),{mutateAsyncOrThrow:Te}=g(St),{mutateAsyncOrThrow:qe}=g(ot),{mutateAsyncOrThrow:Le}=g(Et),{mutateAsyncOrThrow:Mt}=g(vt),{mutateAsyncOrThrow:Re}=g(ht),{mutateAsyncOrThrow:Ae}=g(Ft),{mutateAsyncOrThrow:Be}=g(Vt);a&&r?.country?.code&&!c&&mt(r.country.code);let{selectCountryForm:X,isLoading:je,countries:Ot}=de({jsfModify:_?.jsfModify?.select_country}),rt=o(()=>Ot?.find(t=>t.value===c),[Ot,c]),Qe=o(()=>rt?.label,[rt]),Je=e.currentStep.name==="pricing_plan"||!!a&&S,{form:F,isLoading:ke,contractorSubscriptions:Y,refetch:at,isEligibilityQuestionnaireBlocked:A}=ne(s,rt,{jsonSchemaVersion:_?.jsonSchemaVersion,queryOptions:{enabled:Je},excludeProducts:be,jsfModify:_?.jsfModify?.pricing_plan}),T=o(()=>!!Y?.find(t=>t.product.short_name==="COR")?.eligibility_questionnaire?.submitted_at,[Y]);q(()=>{if(T){z(!1);return}else z(H===b)},[T,H]),q(()=>{let t=r?.contractor_type==="cor";we(!t)},[r?.contractor_type]);let Z=o(()=>Y?.find(t=>t.product.short_name==="COR")?.eligibility_questionnaire?.responses,[Y]),xe=fi[e.currentStep.name]||"contractor_basic_information",Ne=yi[xe],Ue=r?.[Ne]||{},Ke=d(({form:t,options:n={},query:m={}})=>{let y=Object.keys(l).length>0?{...u,...e.values?.[e.currentStep.name],...l}:{...u,...Ue};return jt({countryCode:c,form:t,fieldValues:y,query:m,options:{...n,queryOptions:{enabled:n.queryOptions?.enabled??!0}}})},"useJSONSchema"),Ge=!!(c&&(e.currentStep.name==="basic_information"||a)),$e=!!(c==="GBR"&&a&&e.currentStep.name==="basic_information"),{data:B,isLoading:We}=re(a,{enabled:$e}),{data:tt,isLoading:He}=ae(a,{enabled:!!a});q(()=>{tt&&tt.length>0&&!h&&pt(tt[0].id)},[tt,h]);let{data:C,isLoading:ze}=Ke({form:"contractor_basic_information",options:{jsfModify:fe(c,Qe,_),queryOptions:{enabled:Ge}}}),Xe=o(()=>Gt(r?.basic_information?.provisional_start_date,l?.service_duration?.provisional_start_date),[r?.basic_information?.provisional_start_date,l?.service_duration?.provisional_start_date]),f=o(()=>{let t={standard:G,plus:it,cor:b};if(l.subscription)return l.subscription;let n=e.values?.pricing_plan?.subscription;return n&&!A?n:T&&!A?b:A&&T?G:t[r?.contractor_type]||G},[l,e.values,T,r?.contractor_type,A]);q(()=>{f&&f!==H&&Ce(f)},[f,H]);let Ye=o(()=>({...Z,...u,...e.values?.eligibility_questionnaire,...l}),[Z,u,e.values?.eligibility_questionnaire,l]),Ze=o(()=>f===b&&e.currentStep.name==="eligibility_questionnaire"||!!a&&S&&f===b,[f,e.currentStep.name,a,S]),{data:E,isLoading:ti}=se({options:{queryOptions:{enabled:Ze},jsfModify:_?.jsfModify?.eligibility_questionnaire},fieldValues:Ye}),ei=!!(c&&e.currentStep.name==="contract_details"||S),{data:w,isLoading:ii}=me({countryCode:c,fieldValues:l,employmentId:s,options:{queryOptions:{enabled:ei},jsfModify:pe(_?.jsfModify?.contract_details,Xe,f,l)}}),ni=o(()=>e.currentStep.name==="contract_preview"||!!a&&S,[e.currentStep.name,a,S]),{data:v}=Xt({fieldValues:l,options:{queryOptions:{enabled:ni},jsfModify:ye(_,l)}}),{data:st,isLoading:oi}=Zt({employmentId:s,contractDocumentId:h,options:{queryOptions:{enabled:!!h}}}),i=o(()=>({select_country:X?.fields||[],basic_information:C?.fields||[],pricing_plan:F?.fields||[],eligibility_questionnaire:E?.fields||[],contract_details:w?.fields||[],contract_preview:v?.fields||[],review:[]}),[X?.fields,C?.fields,F?.fields,w?.fields,v?.fields,E?.fields]),ri={select_country:null,basic_information:C?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:w?.meta["x-jsf-fieldsets"],eligibility_questionnaire:null,contract_preview:null,review:null},{country:ai,basic_information:et={},contract_details:It={}}=r||{},Dt=ai?.code,j=o(()=>M(i.select_country,{country:c||Dt||""}),[i.select_country,c,Dt]),ct=o(()=>B?.content?Bt(B.content,B.name):null,[B?.content,B?.name]),Q=o(()=>{let t={...u,...et,ir35:r?.contract_details?.ir_35,nationality_status:r?.contract_details?.nationality,...ct&&{ir35_sds_file:[ct]}};return M(i.basic_information,t)},[u,et,r?.contract_details?.ir_35,r?.contract_details?.nationality,ct,i.basic_information]),J=o(()=>{let n={...{service_duration:{provisional_start_date:et.provisional_start_date}},...u,...It};return M(i.contract_details,n)},[i.contract_details,It,u,et]),k=o(()=>{let t=st?.contract_document?.signatories?.find(m=>m.type==="company"),n={...u,signature:t?.signature};return M(i.contract_preview,n)},[i.contract_preview,u,st]),x=o(()=>{let n={...{subscription:f},...u};return M(i.pricing_plan,n)},[i.pricing_plan,u,f]),N=o(()=>{let t={...u,...Z};return M(i.eligibility_questionnaire,t)},[i.eligibility_questionnaire,u,Z]),si=o(()=>({select_country:j,basic_information:Q,contract_details:J,contract_preview:k,pricing_plan:x,eligibility_questionnaire:N}),[j,Q,J,k,x,N]),lt=!!(a&&S&&e.currentStep.name!=="review"),ut=je||ze||Ve||ii||ke||oi||We||He||ti,Tt=o(()=>{let n=r?.contractor_type==="cor"||i.contract_preview.length>0;return!!(lt&&!ut&&h&&i.basic_information.length>0&&i.contract_details.length>0&&n)},[lt,ut,h,i.basic_information.length,i.contract_details.length,i.contract_preview.length,r?.contractor_type]);q(()=>{Tt&&(W.current={select_country:P(j,i.select_country),basic_information:P(Q,i.basic_information),contract_details:P(J,i.contract_details),contract_preview:P(k,i.contract_preview),pricing_plan:P(x,i.pricing_plan),eligibility_questionnaire:P(N,i.eligibility_questionnaire)},gt({select_country:j,basic_information:Q,contract_details:J,contract_preview:k,pricing_plan:x,eligibility_questionnaire:N,review:{}}),R("review"))},[Tt,R,j,Q,J,gt,i.select_country,i.basic_information,i.contract_details,i.pricing_plan,x,i.contract_preview,k,i.eligibility_questionnaire,N]);let ci=d(t=>{R(t)},"goTo"),qt=d(async t=>X&&e.currentStep.name==="select_country"?t:C&&e.currentStep.name==="basic_information"?await p(t,C?.fields,{isPartialValidation:!1}):w&&e.currentStep.name==="contract_details"?await p(t,w?.fields,{isPartialValidation:!1}):v&&e.currentStep.name==="contract_preview"?await p(t,v?.fields,{isPartialValidation:!1}):F&&e.currentStep.name==="pricing_plan"?await p(t,F?.fields,{isPartialValidation:!1}):E&&e.currentStep.name==="eligibility_questionnaire"?await p(t,E?.fields,{isPartialValidation:!1}):{},"parseFormValues");async function li(t){let n=e.currentStep.name;n in W.current&&(W.current[n]=P(t,i[n]));let m=await qt(t);switch(e.currentStep.name){case"select_country":return mt(m.country),Promise.resolve({data:{countryCode:m.country}});case"basic_information":{let U=!s&&c,y=s&&c&&r?.country&&r?.country.code!==c;if(U||y){let ui={basic_information:ge(m,"nationality_status","ir35","ir35_sds_file"),type:"contractor",country_code:c,external_id:I},Lt=await Te(ui),dt=Lt?.data?.employment?.id;if(!dt)throw V("Employment ID not found");return await Pt({employmentId:dt}),Se(dt),Lt}else if(s){let K=ge(m,"nationality_status","ir35","ir35_sds_file");return await Pt({employmentId:s}),De({employmentId:s,basic_information:K})}return}case"contract_details":{let y=await qe({employmentId:s,payload:{contract_document:m}}),K=y?.data?.contract_document?.id;if(!K)throw V("Contract document ID not found");return pt(K),await bt(),y}case"contract_preview":return Le({employmentId:s,contractDocumentId:h,payload:{signature:m.signature}});case"pricing_plan":{if(A&&[b,it].includes(t.subscription))throw V(`This individual is not eligible for ${ie[t.subscription]}.`);if(t.subscription===Nt)return Promise.resolve({data:{subscription:t.subscription}});if(T&&t.subscription!==b)try{await Be({employmentId:s}),await at()}catch(y){if(y?.response?.status!==404)throw y;await at()}if(t.subscription==G)return Mt({employmentId:s,payload:{operation:"downgrade"}});if(t.subscription==it)return Mt({employmentId:s,payload:{operation:"upgrade"}});if(t.subscription==b)return Promise.resolve({data:{subscription:t.subscription}});throw V("invalid selection")}case"eligibility_questionnaire":try{if((await Re({employmentId:s,payload:m}))?.data?.is_blocking)throw z(!1),_t("pricing_plan"),V("This individual is not eligible for Contractor of Record.");return await Ae({employmentId:s})}finally{await at()}default:throw V("Invalid step state")}}return d(li,"onSubmit"),{isLoading:ut||lt,fieldValues:l,stepState:e,checkFieldUpdates:Fe,back:Ee,next:ve,goTo:ci,onSubmit:li,fields:i[e.currentStep.name],meta:{fields:W.current,fieldsets:ri[e.currentStep.name]},parseFormValues:qt,handleValidation:d(async t=>{if(e.currentStep.name==="select_country")return X.handleValidation(t);if(C&&e.currentStep.name==="basic_information"){let n=await p(t,C?.fields,{isPartialValidation:!1});return C?.handleValidation(n)}if(w&&e.currentStep.name==="contract_details"){let n=await p(t,w?.fields,{isPartialValidation:!1});return w?.handleValidation(n)}if(v&&e.currentStep.name==="contract_preview"){let n=await p(t,v?.fields,{isPartialValidation:!0});return v?.handleValidation(n)}if(F&&e.currentStep.name==="pricing_plan"){let n=await p(t,F?.fields,{isPartialValidation:!1});return F?.handleValidation(n)}if(E&&e.currentStep.name==="eligibility_questionnaire"){let n=await p(t,E?.fields,{isPartialValidation:!1});return E?.handleValidation(n)}return null},"handleValidation"),initialValues:si,employmentId:s,refetchEmployment:bt,isSubmitting:St.isPending||Ct.isPending||ot.isPending||Et.isPending||vt.isPending||wt.isPending||ht.isPending||Ft.isPending||Vt.isPending,documentPreviewPdf:st,canInvite:Oe,isEmploymentReadOnly:S,invitedStatus:Ie,employment:r,defaultLegalEntity:Me,steps:he}},"useContractorOnboarding");export{Ji as a};
2
+ //# sourceMappingURL=chunk-K5S6JRYY.js.map
@@ -1,2 +1,2 @@
1
- import{a as Y}from"./chunk-CARPUKT7.js";import{a as Q}from"./chunk-AJCKNHZB.js";import{a as J}from"./chunk-6SSDV2GX.js";import{a as H}from"./chunk-NEKE5PRJ.js";import{a as U}from"./chunk-6DHV4GT6.js";import{a as W}from"./chunk-TRBEYNRN.js";import{a as q,b as B,c as L,d as z}from"./chunk-L5DII4MV.js";import{f as Z,g as K}from"./chunk-4HPV2VMI.js";import{a as R}from"./chunk-ZXGAFQXW.js";import{a as S}from"./chunk-RAH453TV.js";import{a as N}from"./chunk-JI4CYPLW.js";import{a as E}from"./chunk-EUSCQL4H.js";import{e as _}from"./chunk-T7O3YYOG.js";import{a as u,b as v}from"./chunk-A232PIG7.js";import{p as $}from"./chunk-7ENB7H4E.js";import{a as D}from"./chunk-VIGKOVHP.js";import{a as w}from"./chunk-X6ZAR7ZL.js";import{a as A}from"./chunk-TSPDJUGG.js";import{a as I}from"./chunk-Z5WMKCRJ.js";import{d as O}from"./chunk-KQPDXXG3.js";import{a as o}from"./chunk-P37U34EQ.js";import xe from"lodash.omitby";import je from"lodash.isnull";import{format as x,isFuture as Ve,parseISO as j,subDays as Pe}from"date-fns";import{useMemo as V}from"react";import be from"lodash.omit";import{useQuery as Fe}from"@tanstack/react-query";var G=o(({query:t,options:e})=>{let{client:y}=O();return Fe({queryKey:["payroll-calendars"],queryFn:o(()=>$({client:y,query:{year:t?.year,country_code:t?.countryCode}}),"queryFn"),enabled:e?.enabled,select:o(c=>c.data?.data?.payroll_calendars?.[0],"select")})},"usePayrollCalendars");import{isFuture as Me,isToday as ge,parseISO as Se}from"date-fns";var X=o(t=>{if(!t)return!1;let e=Se(t);return Me(e)||ge(e)},"isInProbationPeriod");import{Fragment as ke,jsx as m,jsxs as Ce}from"react/jsx-runtime";var lo=o(({employmentId:t,options:e,initialValues:y})=>{let{fieldValues:c,setFieldValues:ee,stepState:l,previousStep:oe,nextStep:ie}=A(q),{data:n,isLoading:te}=N({employmentId:t,queryParams:{exclude_files:!0}}),{data:ne}=G({query:{year:new Date().getFullYear().toString(),countryCode:n?.country?.code},options:{enabled:!!n?.country?.code}}),T=X(n?.probation_period_end_date),F=B(ne),P=V(()=>T?x(new Date,"yyyy-MM-dd"):x(F,"yyyy-MM-dd"),[T,F]),M=!!(n?.provisional_start_date&&Ve(j(n.provisional_start_date))),ae={personal_email:n?.basic_information?.email},g=z({...ae,...y,...l.values?.employee_communication,...l.values?.termination_details,...l.values?.paid_time_off,...l.values?.additional_information},M),d=V(()=>({...g,...c}),[c,g]),b=L({minTerminationDate:F,isEmployeeInProbationPeriod:T,selectedDate:j(d.proposed_termination_date)}),re=V(()=>{let s=R.data.schema.properties.termination_reason.oneOf,a=M?s.filter(i=>i.const==="cancellation_before_start_date"):s.filter(i=>i.const!=="cancellation_before_start_date");return{fields:{risk_assesment_info:S("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}),termination_reason:{...e?.jsfModify?.fields?.termination_reason,oneOf:a},proposed_termination_date_info:S("Proposed termination date",Ce(ke,{children:["In most cases, Remote 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.",m(v,{external:!0,zendeskId:u.terminationNoticePeriods,className:D("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}),proposed_termination_date:{...e?.jsfModify?.fields?.proposed_termination_date,"x-jsf-presentation":{...e?.jsfModify?.fields?.proposed_termination_date?.["x-jsf-presentation"],minDate:P,...d.termination_reason==="cancellation_before_start_date"&&n?.provisional_start_date?{maxDate:x(Pe(j(n.provisional_start_date),1),"yyyy-MM-dd")}:{},...b},...d.termination_reason==="cancellation_before_start_date"?{"x-jsf-errorMessage":{maximum:"The proposed termination date must be before the employee's start date."}}:{}},paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return m(J,{employeeName:n?.basic_information?.name,proposedTerminationDate:d.proposed_termination_date,employmentId:t,employment:n,render:r=>i?m(i,{...r}):m(Q,{...r})})},"Component")}},acknowledge_termination_procedure_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"]?.Component;return m(U,{render:r=>i?m(i,{...r}):m(W,{...r})})},"Component")}},acknowledge_termination_procedure_fees_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"],Component:o(()=>{let i={involuntaryOffboardingServiceChargeZendeskId:u.involuntaryOffboardingServiceCharge,reconciliationInvoiceZendeskId:u.reconciliationInvoice},r=e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"]?.Component;return r?m(r,{...i}):m(Y,{...i})},"Component")}}}}},[n,t,d.proposed_termination_date,d.termination_reason,M,P,e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_info,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.proposed_termination_date,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.risk_assesment_info,e?.jsfModify?.fields?.termination_reason,b]),{data:f,isLoading:se}=K({formValues:d,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...re?.fields}},step:l.currentStep.name}),me=E(H.data.schema),k=Z(),{mutateAsync:de}=w(k);async function fe(s){if(!t)throw new Error("Employment id is missing");if(f){let a=await C(s,!0),{customer_informed_employee:i}=a,r=i==="yes"?{employee_awareness:{date:a.customer_informed_employee_date,note:a.customer_informed_employee_description}}:void 0,ue=await I(a,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),_e=be(ue,"customer_informed_employee_date","customer_informed_employee_description"),ye=xe({..._e,...r},je),p=a.timesheet_file??[],h=Array.isArray(p)&&p.length>0?{content:p[0].content,name:p[0].name}:void 0,Te={employment_id:t,termination_details:{...ye,timesheet_file:h||void 0},type:"termination"};return de(Te)}}o(fe,"onSubmit");function le(){oe()}o(le,"back");function ce(){ie()}o(ce,"next");let pe=Object.keys(c).length>0,C=o(async(s,a=!1)=>a?await _(s,me.fields,{isPartialValidation:!0}):f?await _(s,f?.fields,{isPartialValidation:!0}):{},"parseFormValues");return{employmentId:t,employment:n,fieldValues:d,isDirty:pe,stepState:l,fields:f?.fields||[],isLoading:se||te,isSubmitting:k.isPending,initialValues:g,handleValidation:o(async s=>{if(f){let a=await _(s,f?.fields);return f?.handleValidation(a)}return null},"handleValidation"),checkFieldUpdates:ee,parseFormValues:C,onSubmit:fe,back:le,next:ce}},"useTermination");export{lo as a};
2
- //# sourceMappingURL=chunk-HFI3LXZ2.js.map
1
+ import{a as Y}from"./chunk-XFDNQDDA.js";import{a as Q}from"./chunk-AJCKNHZB.js";import{a as J}from"./chunk-NNW7S5AY.js";import{a as U}from"./chunk-6DHV4GT6.js";import{a as W}from"./chunk-TRBEYNRN.js";import{a as H}from"./chunk-YRC6EEM3.js";import{a as q,b as B,c as L,d as z}from"./chunk-L5DII4MV.js";import{f as Z,g as K}from"./chunk-EQVUP5ZR.js";import{a as R}from"./chunk-ZXGAFQXW.js";import{a as S}from"./chunk-RAH453TV.js";import{a as N}from"./chunk-PGVAOMQU.js";import{a as E}from"./chunk-EUSCQL4H.js";import{e as _}from"./chunk-T7O3YYOG.js";import{a as u,b as v}from"./chunk-AK4FXJFO.js";import{q as $}from"./chunk-2IA5ZHU4.js";import{a as D}from"./chunk-VIGKOVHP.js";import{a as w}from"./chunk-X6ZAR7ZL.js";import{a as A}from"./chunk-TSPDJUGG.js";import{a as I}from"./chunk-Z5WMKCRJ.js";import{d as O}from"./chunk-KQPDXXG3.js";import{a as o}from"./chunk-P37U34EQ.js";import xe from"lodash.omitby";import je from"lodash.isnull";import{format as x,isFuture as Ve,parseISO as j,subDays as Pe}from"date-fns";import{useMemo as V}from"react";import be from"lodash.omit";import{useQuery as Fe}from"@tanstack/react-query";var G=o(({query:t,options:e})=>{let{client:y}=O();return Fe({queryKey:["payroll-calendars"],queryFn:o(()=>$({client:y,query:{year:t?.year,country_code:t?.countryCode}}),"queryFn"),enabled:e?.enabled,select:o(c=>c.data?.data?.payroll_calendars?.[0],"select")})},"usePayrollCalendars");import{isFuture as Me,isToday as ge,parseISO as Se}from"date-fns";var X=o(t=>{if(!t)return!1;let e=Se(t);return Me(e)||ge(e)},"isInProbationPeriod");import{Fragment as ke,jsx as m,jsxs as Ce}from"react/jsx-runtime";var lo=o(({employmentId:t,options:e,initialValues:y})=>{let{fieldValues:c,setFieldValues:ee,stepState:l,previousStep:oe,nextStep:ie}=A(q),{data:n,isLoading:te}=N({employmentId:t,queryParams:{exclude_files:!0}}),{data:ne}=G({query:{year:new Date().getFullYear().toString(),countryCode:n?.country?.code},options:{enabled:!!n?.country?.code}}),T=X(n?.probation_period_end_date),F=B(ne),P=V(()=>T?x(new Date,"yyyy-MM-dd"):x(F,"yyyy-MM-dd"),[T,F]),M=!!(n?.provisional_start_date&&Ve(j(n.provisional_start_date))),ae={personal_email:n?.basic_information?.email},g=z({...ae,...y,...l.values?.employee_communication,...l.values?.termination_details,...l.values?.paid_time_off,...l.values?.additional_information},M),d=V(()=>({...g,...c}),[c,g]),b=L({minTerminationDate:F,isEmployeeInProbationPeriod:T,selectedDate:j(d.proposed_termination_date)}),re=V(()=>{let s=R.data.schema.properties.termination_reason.oneOf,a=M?s.filter(i=>i.const==="cancellation_before_start_date"):s.filter(i=>i.const!=="cancellation_before_start_date");return{fields:{risk_assesment_info:S("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}),termination_reason:{...e?.jsfModify?.fields?.termination_reason,oneOf:a},proposed_termination_date_info:S("Proposed termination date",Ce(ke,{children:["In most cases, Remote 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.",m(v,{external:!0,zendeskId:u.terminationNoticePeriods,className:D("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}),proposed_termination_date:{...e?.jsfModify?.fields?.proposed_termination_date,"x-jsf-presentation":{...e?.jsfModify?.fields?.proposed_termination_date?.["x-jsf-presentation"],minDate:P,...d.termination_reason==="cancellation_before_start_date"&&n?.provisional_start_date?{maxDate:x(Pe(j(n.provisional_start_date),1),"yyyy-MM-dd")}:{},...b},...d.termination_reason==="cancellation_before_start_date"?{"x-jsf-errorMessage":{maximum:"The proposed termination date must be before the employee's start date."}}:{}},paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return m(J,{employeeName:n?.basic_information?.name,proposedTerminationDate:d.proposed_termination_date,employmentId:t,employment:n,render:r=>i?m(i,{...r}):m(Q,{...r})})},"Component")}},acknowledge_termination_procedure_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"]?.Component;return m(U,{render:r=>i?m(i,{...r}):m(W,{...r})})},"Component")}},acknowledge_termination_procedure_fees_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"],Component:o(()=>{let i={involuntaryOffboardingServiceChargeZendeskId:u.involuntaryOffboardingServiceCharge,reconciliationInvoiceZendeskId:u.reconciliationInvoice},r=e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"]?.Component;return r?m(r,{...i}):m(Y,{...i})},"Component")}}}}},[n,t,d.proposed_termination_date,d.termination_reason,M,P,e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_info,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.proposed_termination_date,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.risk_assesment_info,e?.jsfModify?.fields?.termination_reason,b]),{data:f,isLoading:se}=K({formValues:d,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...re?.fields}},step:l.currentStep.name}),me=E(H.data.schema),k=Z(),{mutateAsync:de}=w(k);async function fe(s){if(!t)throw new Error("Employment id is missing");if(f){let a=await C(s,!0),{customer_informed_employee:i}=a,r=i==="yes"?{employee_awareness:{date:a.customer_informed_employee_date,note:a.customer_informed_employee_description}}:void 0,ue=await I(a,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),_e=be(ue,"customer_informed_employee_date","customer_informed_employee_description"),ye=xe({..._e,...r},je),p=a.timesheet_file??[],h=Array.isArray(p)&&p.length>0?{content:p[0].content,name:p[0].name}:void 0,Te={employment_id:t,termination_details:{...ye,timesheet_file:h||void 0},type:"termination"};return de(Te)}}o(fe,"onSubmit");function le(){oe()}o(le,"back");function ce(){ie()}o(ce,"next");let pe=Object.keys(c).length>0,C=o(async(s,a=!1)=>a?await _(s,me.fields,{isPartialValidation:!0}):f?await _(s,f?.fields,{isPartialValidation:!0}):{},"parseFormValues");return{employmentId:t,employment:n,fieldValues:d,isDirty:pe,stepState:l,fields:f?.fields||[],isLoading:se||te,isSubmitting:k.isPending,initialValues:g,handleValidation:o(async s=>{if(f){let a=await _(s,f?.fields);return f?.handleValidation(a)}return null},"handleValidation"),checkFieldUpdates:ee,parseFormValues:C,onSubmit:fe,back:le,next:ce}},"useTermination");export{lo as a};
2
+ //# sourceMappingURL=chunk-L4P7572F.js.map
@@ -1,2 +1,2 @@
1
- import{a as p}from"./chunk-QPN6X6UA.js";import{a}from"./chunk-NAH5PAUK.js";import{a as m}from"./chunk-62O3CKKH.js";import{a as e}from"./chunk-76ZDXC2T.js";import{a as r}from"./chunk-37RMY44V.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as y}from"react";import{jsx as d}from"react/jsx-runtime";var P=t(({render:n,countryCode:C,options:i,initialValues:s})=>{let o=r({options:i,countryCode:C,initialValues:s}),f=y();return d(e.Provider,{value:{createCompanyBag:o,formId:f},children:n({createCompanyBag:o,components:{CompanyBasicInformationStep:m,AddressDetailsStep:a,SubmitButton:p}})})},"CreateCompanyFlow");export{P as a};
2
- //# sourceMappingURL=chunk-RYQQDPI7.js.map
1
+ import{a as p}from"./chunk-QPN6X6UA.js";import{a}from"./chunk-BCO3C476.js";import{a as m}from"./chunk-NAGIFFJS.js";import{a as e}from"./chunk-76ZDXC2T.js";import{a as r}from"./chunk-WOH5UQMK.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as y}from"react";import{jsx as d}from"react/jsx-runtime";var P=t(({render:n,countryCode:C,options:i,initialValues:s})=>{let o=r({options:i,countryCode:C,initialValues:s}),f=y();return d(e.Provider,{value:{createCompanyBag:o,formId:f},children:n({createCompanyBag:o,components:{CompanyBasicInformationStep:m,AddressDetailsStep:a,SubmitButton:p}})})},"CreateCompanyFlow");export{P as a};
2
+ //# sourceMappingURL=chunk-M53HKCJ5.js.map
@@ -1,2 +1,2 @@
1
- import{b as t}from"./chunk-A232PIG7.js";import{a as r}from"./chunk-P37U34EQ.js";import{jsx as n}from"react/jsx-runtime";function p({helpCenter:e}){return e?n(t,{zendeskId:e.id,children:e.callToAction}):null}r(p,"HelpCenter");export{p as a};
2
- //# sourceMappingURL=chunk-DFAY4TWC.js.map
1
+ import{b as t}from"./chunk-AK4FXJFO.js";import{a as r}from"./chunk-P37U34EQ.js";import{jsx as n}from"react/jsx-runtime";function p({helpCenter:e}){return e?n(t,{zendeskId:e.id,children:e.callToAction}):null}r(p,"HelpCenter");export{p as a};
2
+ //# sourceMappingURL=chunk-MCWXQT7A.js.map
@@ -1,2 +1,2 @@
1
- import{a as n}from"./chunk-BVFQ6LFD.js";import{b as e}from"./chunk-MRYRNB7Y.js";import{a as r}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function F({onSubmit:t,onSuccess:s,onError:m}){let{terminationBag:o}=e(),d=r(async a=>{let l=await o?.parseFormValues(a,!0);await t?.(l);let i=await o?.onSubmit(a);i?.error?m?.(i.rawError):i?.data&&await s?.(i.data)},"handleSubmit");return u(n,{defaultValues:o.fieldValues,fields:o?.fields,onSubmit:d})}r(F,"AdditionalDetailsForm");export{F as a};
2
- //# sourceMappingURL=chunk-4UO7KLRK.js.map
1
+ import{a as n}from"./chunk-V6LOIP27.js";import{b as e}from"./chunk-MRYRNB7Y.js";import{a as r}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function F({onSubmit:t,onSuccess:s,onError:m}){let{terminationBag:o}=e(),d=r(async a=>{let l=await o?.parseFormValues(a,!0);await t?.(l);let i=await o?.onSubmit(a);i?.error?m?.(i.rawError):i?.data&&await s?.(i.data)},"handleSubmit");return u(n,{defaultValues:o.fieldValues,fields:o?.fields,onSubmit:d})}r(F,"AdditionalDetailsForm");export{F as a};
2
+ //# sourceMappingURL=chunk-N3Q636ZK.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-PHPCCABU.js";import{b as m}from"./chunk-76ZDXC2T.js";import{k as i}from"./chunk-VIGKOVHP.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function l({onSubmit:c,onSuccess:p,onError:t}){let{createCompanyBag:o}=m(),u=a(async r=>{try{await c?.({countryCode:r.country_code,companyOwnerEmail:r.company_owner_email,companyOwnerName:r.company_owner_name,desiredCurrency:r.desired_currency,name:r.name,phoneNumber:r.phone_number,taxNumber:r.tax_number});let n=await o.onSubmit(r);if(n?.data){await p?.(n?.data),o?.next();return}if(n?.error){let e=i(n,o.meta?.fields?.company_basic_information);t?.(e)}}catch(n){let e=i(n,o.meta?.fields?.company_basic_information);t?.(e)}},"handleSubmit"),f=o.stepState.values?.company_basic_information||o.initialValues.company_basic_information;return d(s,{defaultValues:f,onSubmit:u})}a(l,"CompanyBasicInformationStep");export{l as a};
2
- //# sourceMappingURL=chunk-62O3CKKH.js.map
1
+ import{a as s}from"./chunk-EKJK34DS.js";import{b as m}from"./chunk-76ZDXC2T.js";import{k as i}from"./chunk-VIGKOVHP.js";import{a}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function l({onSubmit:c,onSuccess:p,onError:t}){let{createCompanyBag:o}=m(),u=a(async r=>{try{await c?.({countryCode:r.country_code,companyOwnerEmail:r.company_owner_email,companyOwnerName:r.company_owner_name,desiredCurrency:r.desired_currency,name:r.name,phoneNumber:r.phone_number,taxNumber:r.tax_number});let n=await o.onSubmit(r);if(n?.data){await p?.(n?.data),o?.next();return}if(n?.error){let e=i(n,o.meta?.fields?.company_basic_information);t?.(e)}}catch(n){let e=i(n,o.meta?.fields?.company_basic_information);t?.(e)}},"handleSubmit"),f=o.stepState.values?.company_basic_information||o.initialValues.company_basic_information;return d(s,{defaultValues:f,onSubmit:u})}a(l,"CompanyBasicInformationStep");export{l as a};
2
+ //# sourceMappingURL=chunk-NAGIFFJS.js.map
@@ -1,2 +1,2 @@
1
- import{b as i,c as m,d as s,e as f}from"./chunk-4HPV2VMI.js";import{a as n}from"./chunk-TXSUZLOI.js";import{a}from"./chunk-P37U34EQ.js";import{useState as O}from"react";var B=a(({proposedTerminationDate:e,employeeName:y,employmentId:o,employment:r,render:d})=>{let[t,u]=O(!1),l=m({employmentId:o}),p=n(e).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),c=i({employmentId:o,options:{enabled:t}}),D=s({employmentId:o,date:e}),P=f({employmentId:o,proposedTerminationDate:e,employment:r});return d({leavePoliciesSummaryQuery:l,timeoffQuery:c||{data:{bookedDays:0,timeoffs:[]}},bookedTimeBeforeAndAfterTerminationQuery:D,formattedProposedTerminationDate:p,employeeName:y,proposedTerminationDate:e,summaryData:P??{data:{entitledDays:"0 days",bookedDays:"0 days",usedDays:"0 days",approvedDaysBeforeTermination:"0 days",approvedDaysAfterTermination:"0 days",remainingDays:"0 days",isUnlimitedPto:!1},isLoading:!1,isError:!1,error:null},employment:r,open:t,onOpenChange:a(()=>{u(T=>!T)},"onOpenChange")})},"PaidTimeOffContainer");export{B as a};
2
- //# sourceMappingURL=chunk-6SSDV2GX.js.map
1
+ import{b as i,c as m,d as s,e as f}from"./chunk-EQVUP5ZR.js";import{a as n}from"./chunk-TXSUZLOI.js";import{a}from"./chunk-P37U34EQ.js";import{useState as O}from"react";var B=a(({proposedTerminationDate:e,employeeName:y,employmentId:o,employment:r,render:d})=>{let[t,u]=O(!1),l=m({employmentId:o}),p=n(e).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),c=i({employmentId:o,options:{enabled:t}}),D=s({employmentId:o,date:e}),P=f({employmentId:o,proposedTerminationDate:e,employment:r});return d({leavePoliciesSummaryQuery:l,timeoffQuery:c||{data:{bookedDays:0,timeoffs:[]}},bookedTimeBeforeAndAfterTerminationQuery:D,formattedProposedTerminationDate:p,employeeName:y,proposedTerminationDate:e,summaryData:P??{data:{entitledDays:"0 days",bookedDays:"0 days",usedDays:"0 days",approvedDaysBeforeTermination:"0 days",approvedDaysAfterTermination:"0 days",remainingDays:"0 days",isUnlimitedPto:!1},isLoading:!1,isError:!1,error:null},employment:r,open:t,onOpenChange:a(()=>{u(T=>!T)},"onOpenChange")})},"PaidTimeOffContainer");export{B as a};
2
+ //# sourceMappingURL=chunk-NNW7S5AY.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-BVFQ6LFD.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function p({onSubmit:t}){let{terminationBag:o}=a(),n=i(async r=>{let m=await o?.parseFormValues(r);await t?.(m),o?.next()},"handleSubmit");return s(e,{defaultValues:o.fieldValues,onSubmit:n})}i(p,"TerminationDetailsForm");export{p as a};
2
- //# sourceMappingURL=chunk-YPUP5LNV.js.map
1
+ import{a as e}from"./chunk-V6LOIP27.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function p({onSubmit:t}){let{terminationBag:o}=a(),n=i(async r=>{let m=await o?.parseFormValues(r);await t?.(m),o?.next()},"handleSubmit");return s(e,{defaultValues:o.fieldValues,onSubmit:n})}i(p,"TerminationDetailsForm");export{p as a};
2
+ //# sourceMappingURL=chunk-OHCA7HXR.js.map
@@ -1,2 +1,2 @@
1
- import{a as Z}from"./chunk-XHAJ544L.js";import{a as I}from"./chunk-VFRHMNLJ.js";import{a as Q,b as W,c as X,f as Y}from"./chunk-246D2A55.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as G}from"./chunk-LNV36S6D.js";import{b as ee}from"./chunk-HOR3KPOZ.js";import{a as z}from"./chunk-EUSCQL4H.js";import{e as M}from"./chunk-T7O3YYOG.js";import{a as K}from"./chunk-X6ZAR7ZL.js";import{a as o}from"./chunk-P37U34EQ.js";import{number as Be,object as se}from"yup";import{useCallback as je,useEffect as te,useMemo as we,useRef as Re,useState as j}from"react";import{string as ne,ValidationError as re}from"yup";import{jsx as ie}from"react/jsx-runtime";var O={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},Pe=o(t=>z(I.data.schema,void 0,t),"useStaticSchema");function xe(t,i){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return i==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}o(xe,"getSalaryTitle");var ze=o(({defaultRegion:t,defaultCurrency:i,defaultSalary:l,estimationOptions:s,options:n,version:a}={estimationOptions:O})=>{let u=Re({fields:{}}),[k,h]=j(t),[w,R]=j(),[m,q]=j(),[H,le]=j(),{data:_,isLoading:ue}=Q({includePremiumBenefits:s.includePremiumBenefits}),{data:d,isLoading:ce}=W(),me=k||w?.value,{data:P,isLoading:de}=Y(me,{includePremiumBenefits:s.includePremiumBenefits,options:n}),U=X(),{mutateAsync:fe}=K(U),b=w?.currency,p=n?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=je(()=>{let e=b&&m?b!==m:!1;return b!==m?{from:m,to:b,shouldSwapOrder:e}:{from:b,to:m,shouldSwapOrder:e}},[b,m]),J=s.showManagementFee,$=s.includeEstimationTitle,ge=we(()=>{let{from:e,to:r,shouldSwapOrder:c}=L(),g=xe(p,H);return{fields:{salary:{...p,title:g,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:r},Component:o(y=>ie(Z,{...y,shouldSwapOrder:c,conversionType:a==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{...n?.jsfModify?.fields?.hiring_budget,presentation:{hidden:a=="marketing"}},management:{...n?.jsfModify?.fields?.management,properties:{...n?.jsfModify?.fields?.management?.properties,management_fee:{...n?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:m||"USD"}}}},presentation:{...typeof n?.jsfModify?.fields?.management=="object"?(n?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:o(y=>ie(ee,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...n?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[L,p,H,F?.salary_conversion_properties?.label,F?.salary_conversion_properties?.description,n?.jsfModify?.fields?.hiring_budget,n?.jsfModify?.fields?.management,n?.jsfModify?.fields?.estimation_title,a,m,J,$,l]),f=Pe({jsfModify:{fields:{...n?.jsfModify?.fields,...ge?.fields}}});te(()=>{if(t&&_){let e=_.find(({value:r})=>r===t);e&&R(e)}},[t,_]),te(()=>{if(i&&d){let e=d.find(({value:r})=>r===i);e&&q(e.label)}},[i,d]);async function ye(e){return fe(oe(e,s,a))}o(ye,"onSubmit");function pe(e){let r=_?.find(({value:c})=>c===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?h(r.regionSlug):h(void 0),R(r)}o(pe,"onCountryChange");function Ce(e){h(e)}o(Ce,"onRegionChange");function _e(e){le(e.target.value)}o(_e,"onHiringBudgetChange");function be(e){let r=d?.find(c=>c.value===e)?.label;q(r),n?.onCurrencyChange?.(r||"")}o(be,"onChangeCurrency");let E=f.fields.find(e=>e.name==="region");if(E){let e=w?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];E.options=e,E.isVisible=e.length>0,E.required=e.length>0,E.onChange=Ce,E.schema=e.length>0?ne().transform(r=>typeof r=="string"?r:"").required("Region is required"):ne()}if(d){let e=f.fields.find(r=>r.name==="currency");e&&(e.options=d,e.onChange=be)}let v=f.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=_e),_){let e=f.fields.find(r=>r.name==="country");e&&(e.options=_,e.onChange=pe)}let Ee=o(()=>{R(void 0),h(t)},"resetForm"),D=[...f.fields.filter(e=>e.name!=="management"),...P?.fields||[],...f.fields.filter(e=>e.name==="management")],N=ae(f.fields,m||"USD",s.includeEstimationTitle);async function Se(e){let r=null;n?.onValidation?.(e);let c=await M(e,D);try{await N.validate(c,{abortEarly:!1}),r={formErrors:{},yupError:new re([],e)}}catch(S){let B=G(S);r={formErrors:Object.entries(B).reduce((T,[A,V])=>({...T,[A]:V.message}),{}),yupError:S}}let g=P?.handleValidation(c),y=[...r?.yupError.inner||[],...g?.yupError?.inner||[]],x={...r?.yupError?.value||{},...g?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...g?.formErrors||{}},yupError:new re(y,x)}}return o(Se,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:N,parseFormValues:o(async e=>{let{country:r,region:c,currency:g,salary_converted:y,hiring_budget:x,salary_conversion:S,management:B,estimation_title:T,...A}=e,V=e.salary;y==="salary_conversion"&&(V=S);let he=await M({country:r,region:c,salary:V,salary_converted:y,salary_conversion:S,hiring_budget:x,currency:g,management:B,estimation_title:T},f.fields),Fe=await M(A,P?.fields||[]),Ve={currency_code:d?.find(Me=>Me.value===g)?.label};return{...he,...Fe,...Ve}},"parseFormValues"),handleValidation:Se,isSubmitting:U.isPending,isLoading:ue&&ce&&de,onSubmit:ye,resetForm:Ee,currencies:d,meta:{fields:u.current?.fields}}},"useCostCalculator");function ae(t,i,l){let s=t.reduce((n,a)=>(a.name==="salary"||a.name==="salary_conversion"?n[a.name]=a.schema.when("salary_converted",{is:o(u=>u===a.name,"is"),then:o(u=>u.required("Required field"),"then"),otherwise:o(u=>u.optional(),"otherwise")}):a.name==="management"?n[a.name]=se({management_fee:Be().transform(u=>isNaN(u)?void 0:u).min(0,"Management fee must be greater than or equal to 0").max(i?C[i]:C.USD,()=>`Management fee cannot exceed ${(i?C[i]:C.USD)/100} ${i}`)}):a.name==="estimation_title"&&l?n[a.name]=a.schema.required("Required field"):n[a.name]=a.schema,n),{});return se(s)}o(ae,"buildValidationSchema");function Te(t){let i="benefit-";return Object.keys(t).reduce((l,s)=>{let n=t[s];if(n==="none")return l;let u={benefit_group_slug:s.replace(i,""),benefit_tier_slug:n};return[...l,u]},[])}o(Te,"formatBenefits");function Ae(t,i,l){let s=Number(t.management?.management_fee),n=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||i.title,age:t.age??void 0,...t.benefits&&{benefits:Te(t.benefits)},...i.includeManagementFee&&s&&{discount:{quoted_amount:i.showManagementFee?s:C[n]||C.USD,text:""}}},...Oe(t,l)}}o(Ae,"mapValueToEmployment");function Oe(t,i){let l=i==="marketing"||t.salary_converted==="salary_conversion",s=i==="standard"&&t.salary_converted==="salary",n=t.hiring_budget==="my_hiring_budget";if(l){let a=t.salary_converted==="salary_conversion";return n?{annual_total_cost_in_employer_currency:t.salary}:{[a?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?n?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}o(Oe,"getSalaryFields");function oe(t,i=O,l="standard"){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("At least one employment value is required");return s.length>1&&new Set(s.map(a=>a.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:i.includeBenefits,include_cost_breakdowns:i.includeCostBreakdowns,include_premium_benefits:i.includePremiumBenefits,include_management_fee:i.includeManagementFee,employments:s.map(n=>Ae(n,i,l))}}o(oe,"buildPayload");export{ae as a,oe as b,O as c,ze as d};
2
- //# sourceMappingURL=chunk-4N4MQECC.js.map
1
+ import{a as Z}from"./chunk-CPXEQRNG.js";import{a as I}from"./chunk-VFRHMNLJ.js";import{a as Q,b as W,c as X,f as Y}from"./chunk-SD3LBJUH.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as G}from"./chunk-LNV36S6D.js";import{b as ee}from"./chunk-SAKDBD4P.js";import{a as z}from"./chunk-EUSCQL4H.js";import{e as M}from"./chunk-T7O3YYOG.js";import{a as K}from"./chunk-X6ZAR7ZL.js";import{a as o}from"./chunk-P37U34EQ.js";import{number as Be,object as se}from"yup";import{useCallback as je,useEffect as te,useMemo as we,useRef as Re,useState as j}from"react";import{string as ne,ValidationError as re}from"yup";import{jsx as ie}from"react/jsx-runtime";var O={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},Pe=o(t=>z(I.data.schema,void 0,t),"useStaticSchema");function xe(t,i){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return i==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}o(xe,"getSalaryTitle");var ze=o(({defaultRegion:t,defaultCurrency:i,defaultSalary:l,estimationOptions:s,options:n,version:a}={estimationOptions:O})=>{let u=Re({fields:{}}),[k,h]=j(t),[w,R]=j(),[m,q]=j(),[H,le]=j(),{data:_,isLoading:ue}=Q({includePremiumBenefits:s.includePremiumBenefits}),{data:d,isLoading:ce}=W(),me=k||w?.value,{data:P,isLoading:de}=Y(me,{includePremiumBenefits:s.includePremiumBenefits,options:n}),U=X(),{mutateAsync:fe}=K(U),b=w?.currency,p=n?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=je(()=>{let e=b&&m?b!==m:!1;return b!==m?{from:m,to:b,shouldSwapOrder:e}:{from:b,to:m,shouldSwapOrder:e}},[b,m]),J=s.showManagementFee,$=s.includeEstimationTitle,ge=we(()=>{let{from:e,to:r,shouldSwapOrder:c}=L(),g=xe(p,H);return{fields:{salary:{...p,title:g,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:r},Component:o(y=>ie(Z,{...y,shouldSwapOrder:c,conversionType:a==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{...n?.jsfModify?.fields?.hiring_budget,presentation:{hidden:a=="marketing"}},management:{...n?.jsfModify?.fields?.management,properties:{...n?.jsfModify?.fields?.management?.properties,management_fee:{...n?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:m||"USD"}}}},presentation:{...typeof n?.jsfModify?.fields?.management=="object"?(n?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:o(y=>ie(ee,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...n?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[L,p,H,F?.salary_conversion_properties?.label,F?.salary_conversion_properties?.description,n?.jsfModify?.fields?.hiring_budget,n?.jsfModify?.fields?.management,n?.jsfModify?.fields?.estimation_title,a,m,J,$,l]),f=Pe({jsfModify:{fields:{...n?.jsfModify?.fields,...ge?.fields}}});te(()=>{if(t&&_){let e=_.find(({value:r})=>r===t);e&&R(e)}},[t,_]),te(()=>{if(i&&d){let e=d.find(({value:r})=>r===i);e&&q(e.label)}},[i,d]);async function ye(e){return fe(oe(e,s,a))}o(ye,"onSubmit");function pe(e){let r=_?.find(({value:c})=>c===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?h(r.regionSlug):h(void 0),R(r)}o(pe,"onCountryChange");function Ce(e){h(e)}o(Ce,"onRegionChange");function _e(e){le(e.target.value)}o(_e,"onHiringBudgetChange");function be(e){let r=d?.find(c=>c.value===e)?.label;q(r),n?.onCurrencyChange?.(r||"")}o(be,"onChangeCurrency");let E=f.fields.find(e=>e.name==="region");if(E){let e=w?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];E.options=e,E.isVisible=e.length>0,E.required=e.length>0,E.onChange=Ce,E.schema=e.length>0?ne().transform(r=>typeof r=="string"?r:"").required("Region is required"):ne()}if(d){let e=f.fields.find(r=>r.name==="currency");e&&(e.options=d,e.onChange=be)}let v=f.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=_e),_){let e=f.fields.find(r=>r.name==="country");e&&(e.options=_,e.onChange=pe)}let Ee=o(()=>{R(void 0),h(t)},"resetForm"),D=[...f.fields.filter(e=>e.name!=="management"),...P?.fields||[],...f.fields.filter(e=>e.name==="management")],N=ae(f.fields,m||"USD",s.includeEstimationTitle);async function Se(e){let r=null;n?.onValidation?.(e);let c=await M(e,D);try{await N.validate(c,{abortEarly:!1}),r={formErrors:{},yupError:new re([],e)}}catch(S){let B=G(S);r={formErrors:Object.entries(B).reduce((T,[A,V])=>({...T,[A]:V.message}),{}),yupError:S}}let g=P?.handleValidation(c),y=[...r?.yupError.inner||[],...g?.yupError?.inner||[]],x={...r?.yupError?.value||{},...g?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...g?.formErrors||{}},yupError:new re(y,x)}}return o(Se,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:N,parseFormValues:o(async e=>{let{country:r,region:c,currency:g,salary_converted:y,hiring_budget:x,salary_conversion:S,management:B,estimation_title:T,...A}=e,V=e.salary;y==="salary_conversion"&&(V=S);let he=await M({country:r,region:c,salary:V,salary_converted:y,salary_conversion:S,hiring_budget:x,currency:g,management:B,estimation_title:T},f.fields),Fe=await M(A,P?.fields||[]),Ve={currency_code:d?.find(Me=>Me.value===g)?.label};return{...he,...Fe,...Ve}},"parseFormValues"),handleValidation:Se,isSubmitting:U.isPending,isLoading:ue&&ce&&de,onSubmit:ye,resetForm:Ee,currencies:d,meta:{fields:u.current?.fields}}},"useCostCalculator");function ae(t,i,l){let s=t.reduce((n,a)=>(a.name==="salary"||a.name==="salary_conversion"?n[a.name]=a.schema.when("salary_converted",{is:o(u=>u===a.name,"is"),then:o(u=>u.required("Required field"),"then"),otherwise:o(u=>u.optional(),"otherwise")}):a.name==="management"?n[a.name]=se({management_fee:Be().transform(u=>isNaN(u)?void 0:u).min(0,"Management fee must be greater than or equal to 0").max(i?C[i]:C.USD,()=>`Management fee cannot exceed ${(i?C[i]:C.USD)/100} ${i}`)}):a.name==="estimation_title"&&l?n[a.name]=a.schema.required("Required field"):n[a.name]=a.schema,n),{});return se(s)}o(ae,"buildValidationSchema");function Te(t){let i="benefit-";return Object.keys(t).reduce((l,s)=>{let n=t[s];if(n==="none")return l;let u={benefit_group_slug:s.replace(i,""),benefit_tier_slug:n};return[...l,u]},[])}o(Te,"formatBenefits");function Ae(t,i,l){let s=Number(t.management?.management_fee),n=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||i.title,age:t.age??void 0,...t.benefits&&{benefits:Te(t.benefits)},...i.includeManagementFee&&s&&{discount:{quoted_amount:i.showManagementFee?s:C[n]||C.USD,text:""}}},...Oe(t,l)}}o(Ae,"mapValueToEmployment");function Oe(t,i){let l=i==="marketing"||t.salary_converted==="salary_conversion",s=i==="standard"&&t.salary_converted==="salary",n=t.hiring_budget==="my_hiring_budget";if(l){let a=t.salary_converted==="salary_conversion";return n?{annual_total_cost_in_employer_currency:t.salary}:{[a?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?n?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}o(Oe,"getSalaryFields");function oe(t,i=O,l="standard"){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("At least one employment value is required");return s.length>1&&new Set(s.map(a=>a.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:i.includeBenefits,include_cost_breakdowns:i.includeCostBreakdowns,include_premium_benefits:i.includePremiumBenefits,include_management_fee:i.includeManagementFee,employments:s.map(n=>Ae(n,i,l))}}o(oe,"buildPayload");export{ae as a,oe as b,O as c,ze as d};
2
+ //# sourceMappingURL=chunk-OXAEJWEQ.js.map
@@ -1,2 +1,2 @@
1
- import{a as l}from"./chunk-WEAO46EO.js";import{b as s}from"./chunk-PGWKJ6FK.js";import{b as n}from"./chunk-X6ZAR7ZL.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function S({onSubmit:d,onError:a,onSuccess:m}){let{onboardingBag:r}=s(),c=t(async i=>{try{let e=await r.parseFormValues(i);await d?.(e);let o=await r.onSubmit(i);if(o?.data){await m?.(o.data),r?.next();return}if(o?.error){let p=n(o?.fieldErrors||[],r.meta?.fields?.contract_details);a?.({error:o.error,rawError:o.rawError,fieldErrors:p})}}catch(e){a?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit");return E(l,{defaultValues:r.stepState.values?.contract_details||r.initialValues.contract_details,onSubmit:c})}t(S,"ContractDetailsStep");export{S as a};
2
- //# sourceMappingURL=chunk-TPGN6QTL.js.map
1
+ import{a as l}from"./chunk-36MJ5ORQ.js";import{b as s}from"./chunk-PGWKJ6FK.js";import{b as n}from"./chunk-X6ZAR7ZL.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function S({onSubmit:d,onError:a,onSuccess:m}){let{onboardingBag:r}=s(),c=t(async i=>{try{let e=await r.parseFormValues(i);await d?.(e);let o=await r.onSubmit(i);if(o?.data){await m?.(o.data),r?.next();return}if(o?.error){let p=n(o?.fieldErrors||[],r.meta?.fields?.contract_details);a?.({error:o.error,rawError:o.rawError,fieldErrors:p})}}catch(e){a?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit");return E(l,{defaultValues:r.stepState.values?.contract_details||r.initialValues.contract_details,onSubmit:c})}t(S,"ContractDetailsStep");export{S as a};
2
+ //# sourceMappingURL=chunk-OZKZKV5C.js.map
@@ -1,2 +1,2 @@
1
- import{F as m,d as r}from"./chunk-7ENB7H4E.js";import{d as o}from"./chunk-KQPDXXG3.js";import{a as e}from"./chunk-P37U34EQ.js";import{useMutation as u,useQuery as l}from"@tanstack/react-query";var h=e(({employmentId:t,queryParams:n})=>{let{client:i}=o();return l({queryKey:["employment",t],retry:!1,queryFn:e(()=>m({client:i,headers:{Authorization:""},path:{employment_id:t},query:n}),"queryFn"),enabled:!!t,select:e(({data:s})=>s?.data?.employment,"select")})},"useEmploymentQuery"),f=e(()=>{let{client:t}=o();return u({mutationFn:e(({employmentId:n})=>r({client:t,headers:{Authorization:""},path:{employment_id:n}}),"mutationFn")})},"useDiscardEmploymentMutation");export{h as a,f as b};
2
- //# sourceMappingURL=chunk-JI4CYPLW.js.map
1
+ import{G as m,d as r}from"./chunk-2IA5ZHU4.js";import{d as o}from"./chunk-KQPDXXG3.js";import{a as e}from"./chunk-P37U34EQ.js";import{useMutation as u,useQuery as l}from"@tanstack/react-query";var h=e(({employmentId:t,queryParams:n})=>{let{client:i}=o();return l({queryKey:["employment",t],retry:!1,queryFn:e(()=>m({client:i,headers:{Authorization:""},path:{employment_id:t},query:n}),"queryFn"),enabled:!!t,select:e(({data:s})=>s?.data?.employment,"select")})},"useEmploymentQuery"),f=e(()=>{let{client:t}=o();return u({mutationFn:e(({employmentId:n})=>r({client:t,headers:{Authorization:""},path:{employment_id:n}}),"mutationFn")})},"useDiscardEmploymentMutation");export{h as a,f as b};
2
+ //# sourceMappingURL=chunk-PGVAOMQU.js.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-WEAO46EO.js";import{b as a}from"./chunk-PGWKJ6FK.js";import{f as t}from"./chunk-T7O3YYOG.js";import{b as s}from"./chunk-X6ZAR7ZL.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=t(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=s(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-LVXV3GHT.js.map
1
+ import{a as m}from"./chunk-36MJ5ORQ.js";import{b as a}from"./chunk-PGWKJ6FK.js";import{f as t}from"./chunk-T7O3YYOG.js";import{b as s}from"./chunk-X6ZAR7ZL.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=t(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=s(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-QGGPXNVY.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-R7BHA5RA.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-MHAY555P.js.map
1
+ import{a as s}from"./chunk-6P53J6DA.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-QI6E2NJU.js.map
@@ -1,2 +1,2 @@
1
- import{a as R,b as x,c as N,d as A}from"./chunk-KRSUSMJK.js";import{a as w,b as f}from"./chunk-A232PIG7.js";import{a as C}from"./chunk-TFSRZOMP.js";import{b as B}from"./chunk-RJY6AEJB.js";import{a as i,b as t,e as F}from"./chunk-VIGKOVHP.js";import{a as m}from"./chunk-P37U34EQ.js";import{MoreHorizontal as P}from"lucide-react";import{useState as U}from"react";import{Fragment as $,jsx as g,jsxs as T}from"react/jsx-runtime";function E({actions:e=[],className:n,label:a,"data-testid":l}){let[_,d]=U(!1);return T("div",{className:i("relative",n),children:[g(B,{"data-testid":l,variant:"ghost","aria-label":a,className:"h-8 w-8 p-0",onClick:()=>d(!_),children:g(P,{className:"h-4 w-4"})}),_&&T($,{children:[g("div",{className:"fixed inset-0 z-40",onClick:()=>d(!1)}),g("div",{className:"absolute right-0 top-1/2 mt-1 bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[120px]",children:e.map((c,u)=>g("button",{"data-testid":`${l}-${c.label.toLowerCase().replace(" ","-")}`,className:i("w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100",c.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>{c.onClick(),d(!1)},disabled:c.disabled,children:c.label},u))})]})]})}m(E,"ActionsDropdown");import{ChevronDown as O,Info as Z}from"lucide-react";import K from"react-flagpack";import{useState as z}from"react";import{jsx as j,jsxs as L}from"react/jsx-runtime";var I=m(({children:e,content:n})=>L("div",{className:"relative inline-block group",children:[e,L("div",{className:"absolute bottom-full right-0 mb-2 px-3 py-2 bg-gray-900 text-white text-xs rounded-md opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 w-64 whitespace-normal break-words",children:[n,j("div",{className:"absolute top-full right-3 border-4 border-transparent border-t-gray-900"})]})]}),"BasicTooltip");import{Fragment as b,jsx as o,jsxs as r}from"react/jsx-runtime";var V={GB:"GB-UKM"},Y=m(({title:e,country:n,region:a,annualGrossSalary:l,onDelete:_,onExportPdf:d,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:d},{label:"Delete",onClick:_}];return r("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[r("div",{className:"flex flex-row items-center gap-6",children:[o("div",{className:"RemoteFlows__EstimationResultsHeader__FlagContainer flex h-16 w-16 items-center justify-center rounded-lg bg-[#F4F4F5]",children:o(K,{code:V[n.alpha_2_code]||n.alpha_2_code})}),r("div",{className:"space-y-1",children:[o("h2",{"data-testid":"estimation-results-header-title",className:"RemoteFlows__EstimationResultsHeader__Title text-lg font-medium leading-none text-[#181818]",children:e}),r("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[n.name," ",a?` (${a.name})`:""]}),r("p",{"data-testid":"estimation-results-header-annual-gross-salary",className:"RemoteFlows__EstimationResultsHeader__AnnualGrossSalary text-xs text-[#71717A]",children:[o("span",{className:"text-[#181818]",children:"Employee annual gross salary:"})," ",l]})]})]}),o(E,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),q=m(()=>({steps:[{id:"add-employment-details",title:"Add employment details",description:"You add employee employments details."},{id:"invite-employee",title:"Invite employee",description:"Hire receives an email invitation from Remote to start the self-enrollment process."},{id:"verify-information",title:"Verify information",description:"Remote prepares the Employment Agreement and verifies all the information."},{id:"sign-contract",title:"Sign contract",description:"All parties sign the Employment Agreement and are ready to start. \u{1F389}"}],helpText:"For customers who accept Remote's Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrollment.",zendeskArticleId:w.employeeOnboardingTimeline}),"getOnboardingTimelineData");function J({minimumOnboardingDays:e,data:n,className:a}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",a),children:r(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:r("div",{className:"flex items-center justify-between w-full",children:[o("span",{className:"RemoteFlows__OnboardingTimeline__Title text-base font-medium text-[#0F172A]",children:"Onboarding timeline"}),e!=null&&r("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),r(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:n.steps.map(l=>r("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:l.title})," ","- ",l.description]},l.id))}),r("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[n.helpText,n.zendeskArticleId&&o(f,{zendeskId:n.zendeskArticleId,children:"Learn more"})]})]})]})})}m(J,"OnboardingTimeline");function Q({className:e,countryBenefitsUrl:n,countryGuideUrl:a,country:l}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:r(x,{value:"timeline",className:"RemoteFlows__HiringSection__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__HiringSection__AccordionTrigger hover:no-underline px-0 py-4",children:o("div",{className:"flex items-center justify-between w-full",children:r("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",l.name]})})}),o(A,{children:r("div",{className:"flex flex-col gap-1",children:[a&&o("a",{href:a,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),n&&o("a",{href:n,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}m(Q,"HiringSection");function W({isMultipleCurrency:e,className:n}){return r("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",n),children:[o("span",{"aria-hidden":!0}),e?r(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):r(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}m(W,"EstimationHeaders");function S({label:e,amounts:n,className:a,children:l}){let[_,d]=z(!0);return r("div",{className:i("RemoteFlows__EstimationResults__Row",a),children:[r("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[r("div",{className:"RemoteFlows__EstimationRow__LabelContainer flex items-center gap-2",children:[o("span",{className:i("RemoteFlows__EstimationRow__Title min-w-[140px] font-medium text-[#09090B]"),children:e}),o("button",{onClick:()=>d(!_),className:"RemoteFlows__EstimationRow__CollapseButton p-1 hover:bg-gray-100 rounded",children:o(O,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(n)?n.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):r(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:n})]})]}),_&&l&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:l})]})}m(S,"EstimationRow");function X({item:e,isMultipleCurrency:n,level:a=0}){let[l,_]=z(!1),d=e.children&&e.children.length>0,c=a>0,u=e.isCollapsible||d;return r("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[r("div",{className:i(n?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[r("div",{className:i("RemoteFlows__BreakdownList__LabelContainer flex items-center gap-2",c&&"pl-3"),children:[!c&&o("span",{className:"RemoteFlows__BreakdownList__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0","aria-hidden":"true"}),u?r("button",{onClick:()=>_(!l),className:"RemoteFlows__BreakdownList__CollapseButton flex items-center gap-2 hover:bg-gray-100 rounded p-1",children:[o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B]"),children:e.label}),o(O,{className:`RemoteFlows__BreakdownList__ChevronDown h-3 w-3 text-muted-foreground transition-transform ${l?"rotate-180":""}`})]}):o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B] p-1"),children:e.label}),e.tooltip&&o(I,{content:r(b,{children:[o("span",{dangerouslySetInnerHTML:{__html:F(e.tooltip)}})," ",e.zendeskId&&o(f,{zendeskId:Number(e.zendeskId),children:"Learn more"})]}),children:o("button",{className:"RemoteFlows__BreakdownList__InfoButton p-1 hover:bg-gray-100 rounded",children:o(Z,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),n?r(b,{children:[o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employee-amount",className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"}),o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employer-amount",className:i("RemoteFlows__BreakdownList__EmployerAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__EmployerAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__EmployerAmountText--NotNested text-[#09090B]"),children:e.employerAmount||"\u2014"})]}):o("span",{"data-testid":e.dataSelector,className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"})]}),d&&l&&o("div",{className:"mt-1",children:o(h,{items:e.children,isMultipleCurrency:n,level:a+1})})]})}m(X,"BreakdownListItem");function h({items:e,isMultipleCurrency:n,className:a,level:l}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",a),children:e.map((_,d)=>o(X,{item:_,isMultipleCurrency:n,level:l},d))})}m(h,"BreakdownList");var Re=m(({estimation:e,title:n,components:a,onDelete:l,onExportPdf:_,onEdit:d})=>{let c=a?.HiringSection||Q,u=a?.OnboardingTimeline||J,H=a?.Header||Y,v=a?.Footer,D=q(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,k=e.employer_currency_costs.monthly_management_fee,M=e.region.code!==e.country.code,G=t(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code);return r(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(H,{title:n,annualGrossSalary:G,region:M?e.region:void 0,country:e.country,onDelete:l,onExportPdf:_,onEdit:d})}),r("div",{className:"RemoteFlows__Separator",children:[o(W,{isMultipleCurrency:p,className:"mb-3"}),o(S,{label:"Monthly total cost",amounts:p?[t(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),t(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.code)]:t(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),children:o(h,{items:[{label:"Gross monthly salary",regionalAmount:t(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.monthly_gross_salary,e.employer_currency_costs.currency.code),zendeskId:w.extraPayments.toString(),tooltip:"This country respects extra payments on top of the gross salary."},{label:"Mandatory employer costs",regionalAmount:t(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.monthly_contributions_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.monthly_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:t(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:t(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.monthly_benefits_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.monthly_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:t(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...k?[{label:"Monthly fee",regionalAmount:t(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.monthly_management_fee,e.employer_currency_costs.currency.code),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})]}),o("div",{className:"RemoteFlows__Separator",children:o(S,{label:"Annual total cost",amounts:p?[t(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),t(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.code)]:t(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),children:o(h,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:t(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.code)},{label:"Mandatory employer costs",regionalAmount:t(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.annual_contributions_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.annual_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:t(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:t(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.annual_benefits_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.annual_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:t(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Extra statutory payments",regionalAmount:t(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.extra_statutory_payments_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.extra_statutory_payments_breakdown?.map((s,y)=>({label:s.name,regionalAmount:t(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...k?[{label:"Annual fee",regionalAmount:t(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.annual_management_fee,e.employer_currency_costs.currency.code),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})}),o("div",{className:"RemoteFlows__Separator",children:o(u,{minimumOnboardingDays:e.minimum_onboarding_time,data:D})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),v&&o(v,{})]})},"EstimationResults");export{Re as a};
2
- //# sourceMappingURL=chunk-3B6XXK5H.js.map
1
+ import{a as R,b as x,c as N,d as A}from"./chunk-KRSUSMJK.js";import{a as w,b as f}from"./chunk-AK4FXJFO.js";import{a as C}from"./chunk-TFSRZOMP.js";import{b as B}from"./chunk-RJY6AEJB.js";import{a as i,b as t,e as F}from"./chunk-VIGKOVHP.js";import{a as m}from"./chunk-P37U34EQ.js";import{MoreHorizontal as P}from"lucide-react";import{useState as U}from"react";import{Fragment as $,jsx as g,jsxs as T}from"react/jsx-runtime";function E({actions:e=[],className:n,label:a,"data-testid":l}){let[_,d]=U(!1);return T("div",{className:i("relative",n),children:[g(B,{"data-testid":l,variant:"ghost","aria-label":a,className:"h-8 w-8 p-0",onClick:()=>d(!_),children:g(P,{className:"h-4 w-4"})}),_&&T($,{children:[g("div",{className:"fixed inset-0 z-40",onClick:()=>d(!1)}),g("div",{className:"absolute right-0 top-1/2 mt-1 bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[120px]",children:e.map((c,u)=>g("button",{"data-testid":`${l}-${c.label.toLowerCase().replace(" ","-")}`,className:i("w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100",c.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>{c.onClick(),d(!1)},disabled:c.disabled,children:c.label},u))})]})]})}m(E,"ActionsDropdown");import{ChevronDown as O,Info as Z}from"lucide-react";import K from"react-flagpack";import{useState as z}from"react";import{jsx as j,jsxs as L}from"react/jsx-runtime";var I=m(({children:e,content:n})=>L("div",{className:"relative inline-block group",children:[e,L("div",{className:"absolute bottom-full right-0 mb-2 px-3 py-2 bg-gray-900 text-white text-xs rounded-md opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50 w-64 whitespace-normal break-words",children:[n,j("div",{className:"absolute top-full right-3 border-4 border-transparent border-t-gray-900"})]})]}),"BasicTooltip");import{Fragment as b,jsx as o,jsxs as r}from"react/jsx-runtime";var V={GB:"GB-UKM"},Y=m(({title:e,country:n,region:a,annualGrossSalary:l,onDelete:_,onExportPdf:d,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:d},{label:"Delete",onClick:_}];return r("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[r("div",{className:"flex flex-row items-center gap-6",children:[o("div",{className:"RemoteFlows__EstimationResultsHeader__FlagContainer flex h-16 w-16 items-center justify-center rounded-lg bg-[#F4F4F5]",children:o(K,{code:V[n.alpha_2_code]||n.alpha_2_code})}),r("div",{className:"space-y-1",children:[o("h2",{"data-testid":"estimation-results-header-title",className:"RemoteFlows__EstimationResultsHeader__Title text-lg font-medium leading-none text-[#181818]",children:e}),r("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[n.name," ",a?` (${a.name})`:""]}),r("p",{"data-testid":"estimation-results-header-annual-gross-salary",className:"RemoteFlows__EstimationResultsHeader__AnnualGrossSalary text-xs text-[#71717A]",children:[o("span",{className:"text-[#181818]",children:"Employee annual gross salary:"})," ",l]})]})]}),o(E,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),q=m(()=>({steps:[{id:"add-employment-details",title:"Add employment details",description:"You add employee employments details."},{id:"invite-employee",title:"Invite employee",description:"Hire receives an email invitation from Remote to start the self-enrollment process."},{id:"verify-information",title:"Verify information",description:"Remote prepares the Employment Agreement and verifies all the information."},{id:"sign-contract",title:"Sign contract",description:"All parties sign the Employment Agreement and are ready to start. \u{1F389}"}],helpText:"For customers who accept Remote's Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrollment.",zendeskArticleId:w.employeeOnboardingTimeline}),"getOnboardingTimelineData");function J({minimumOnboardingDays:e,data:n,className:a}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",a),children:r(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:r("div",{className:"flex items-center justify-between w-full",children:[o("span",{className:"RemoteFlows__OnboardingTimeline__Title text-base font-medium text-[#0F172A]",children:"Onboarding timeline"}),e!=null&&r("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),r(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:n.steps.map(l=>r("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:l.title})," ","- ",l.description]},l.id))}),r("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[n.helpText,n.zendeskArticleId&&o(f,{zendeskId:n.zendeskArticleId,children:"Learn more"})]})]})]})})}m(J,"OnboardingTimeline");function Q({className:e,countryBenefitsUrl:n,countryGuideUrl:a,country:l}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:r(x,{value:"timeline",className:"RemoteFlows__HiringSection__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__HiringSection__AccordionTrigger hover:no-underline px-0 py-4",children:o("div",{className:"flex items-center justify-between w-full",children:r("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",l.name]})})}),o(A,{children:r("div",{className:"flex flex-col gap-1",children:[a&&o("a",{href:a,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),n&&o("a",{href:n,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}m(Q,"HiringSection");function W({isMultipleCurrency:e,className:n}){return r("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",n),children:[o("span",{"aria-hidden":!0}),e?r(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):r(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}m(W,"EstimationHeaders");function S({label:e,amounts:n,className:a,children:l}){let[_,d]=z(!0);return r("div",{className:i("RemoteFlows__EstimationResults__Row",a),children:[r("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[r("div",{className:"RemoteFlows__EstimationRow__LabelContainer flex items-center gap-2",children:[o("span",{className:i("RemoteFlows__EstimationRow__Title min-w-[140px] font-medium text-[#09090B]"),children:e}),o("button",{onClick:()=>d(!_),className:"RemoteFlows__EstimationRow__CollapseButton p-1 hover:bg-gray-100 rounded",children:o(O,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(n)?n.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):r(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:n})]})]}),_&&l&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:l})]})}m(S,"EstimationRow");function X({item:e,isMultipleCurrency:n,level:a=0}){let[l,_]=z(!1),d=e.children&&e.children.length>0,c=a>0,u=e.isCollapsible||d;return r("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[r("div",{className:i(n?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[r("div",{className:i("RemoteFlows__BreakdownList__LabelContainer flex items-center gap-2",c&&"pl-3"),children:[!c&&o("span",{className:"RemoteFlows__BreakdownList__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0","aria-hidden":"true"}),u?r("button",{onClick:()=>_(!l),className:"RemoteFlows__BreakdownList__CollapseButton flex items-center gap-2 hover:bg-gray-100 rounded p-1",children:[o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B]"),children:e.label}),o(O,{className:`RemoteFlows__BreakdownList__ChevronDown h-3 w-3 text-muted-foreground transition-transform ${l?"rotate-180":""}`})]}):o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B] p-1"),children:e.label}),e.tooltip&&o(I,{content:r(b,{children:[o("span",{dangerouslySetInnerHTML:{__html:F(e.tooltip)}})," ",e.zendeskId&&o(f,{zendeskId:Number(e.zendeskId),children:"Learn more"})]}),children:o("button",{className:"RemoteFlows__BreakdownList__InfoButton p-1 hover:bg-gray-100 rounded",children:o(Z,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),n?r(b,{children:[o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employee-amount",className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"}),o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employer-amount",className:i("RemoteFlows__BreakdownList__EmployerAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__EmployerAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__EmployerAmountText--NotNested text-[#09090B]"),children:e.employerAmount||"\u2014"})]}):o("span",{"data-testid":e.dataSelector,className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"})]}),d&&l&&o("div",{className:"mt-1",children:o(h,{items:e.children,isMultipleCurrency:n,level:a+1})})]})}m(X,"BreakdownListItem");function h({items:e,isMultipleCurrency:n,className:a,level:l}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",a),children:e.map((_,d)=>o(X,{item:_,isMultipleCurrency:n,level:l},d))})}m(h,"BreakdownList");var Re=m(({estimation:e,title:n,components:a,onDelete:l,onExportPdf:_,onEdit:d})=>{let c=a?.HiringSection||Q,u=a?.OnboardingTimeline||J,H=a?.Header||Y,v=a?.Footer,D=q(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,k=e.employer_currency_costs.monthly_management_fee,M=e.region.code!==e.country.code,G=t(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code);return r(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(H,{title:n,annualGrossSalary:G,region:M?e.region:void 0,country:e.country,onDelete:l,onExportPdf:_,onEdit:d})}),r("div",{className:"RemoteFlows__Separator",children:[o(W,{isMultipleCurrency:p,className:"mb-3"}),o(S,{label:"Monthly total cost",amounts:p?[t(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),t(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.code)]:t(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.code),children:o(h,{items:[{label:"Gross monthly salary",regionalAmount:t(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.monthly_gross_salary,e.employer_currency_costs.currency.code),zendeskId:w.extraPayments.toString(),tooltip:"This country respects extra payments on top of the gross salary."},{label:"Mandatory employer costs",regionalAmount:t(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.monthly_contributions_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.monthly_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:t(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:t(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.monthly_benefits_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.monthly_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:t(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...k?[{label:"Monthly fee",regionalAmount:t(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.monthly_management_fee,e.employer_currency_costs.currency.code),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})]}),o("div",{className:"RemoteFlows__Separator",children:o(S,{label:"Annual total cost",amounts:p?[t(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),t(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.code)]:t(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.code),children:o(h,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:t(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.code)},{label:"Mandatory employer costs",regionalAmount:t(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.annual_contributions_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.annual_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:t(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:t(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.annual_benefits_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.annual_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:t(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Extra statutory payments",regionalAmount:t(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.extra_statutory_payments_total,e.employer_currency_costs.currency.code),children:e.employer_currency_costs.extra_statutory_payments_breakdown?.map((s,y)=>({label:s.name,regionalAmount:t(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.code),employerAmount:t(s.amount,e.employer_currency_costs.currency.code),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...k?[{label:"Annual fee",regionalAmount:t(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.code),employerAmount:t(e.employer_currency_costs.annual_management_fee,e.employer_currency_costs.currency.code),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})}),o("div",{className:"RemoteFlows__Separator",children:o(u,{minimumOnboardingDays:e.minimum_onboarding_time,data:D})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),v&&o(v,{})]})},"EstimationResults");export{Re as a};
2
+ //# sourceMappingURL=chunk-QNWTCGRD.js.map
@@ -1,2 +1,2 @@
1
- import{a as v}from"./chunk-SNECOPBD.js";import{i as U}from"./chunk-T7O3YYOG.js";import{b as L,c as O,f as G}from"./chunk-EHD2YB5F.js";import{a as I}from"./chunk-SS2FAFUZ.js";import{a as z}from"./chunk-TOQPDTGG.js";import{b as J}from"./chunk-A232PIG7.js";import{c as d,h as g}from"./chunk-H2JFQGQJ.js";import{a as R,e as H}from"./chunk-VIGKOVHP.js";import{b as C}from"./chunk-KQPDXXG3.js";import{a as n}from"./chunk-P37U34EQ.js";import{Fragment as fe,useEffect as Pe,useRef as ge}from"react";import{jsx as Z}from"react/jsx-runtime";function q({description:e,label:t,name:i,minDate:l,maxDate:s,onChange:p,component:r,...c}){let{components:h}=C(),{control:u}=d(),F;c.meta?.mot&&typeof c.meta.mot=="number"?F=U(c.meta.mot):typeof l=="string"&&(F=new Date(`${l}T00:00:00`));let a;return s&&(a=new Date(`${s}T23:59:59`)),Z(g,{control:u,name:i,render:({field:f,fieldState:S})=>{let m=r||h?.date;if(!m)throw new Error(`Date picker component not found for field ${i}`);let y={description:e,label:t,name:i,onChange:p,...F&&{minDate:F.toISOString()},...a&&{maxDate:a.toISOString()},...c};return Z(m,{field:{...f,onChange:n(x=>{f.onChange(x),p?.(x)},"onChange")},fieldState:S,fieldData:y})}})}n(q,"DatePickerField");import{jsx as K}from"react/jsx-runtime";var xe=n((e,t)=>{if(!t)return null;for(let i of e)if(i.size>t){let l=Math.round(t/1048576),s=Math.round(i.size/(1024*1024));return`File "${i.name}" exceeds maximum size of ${l}MB (file is ${s}MB)`}return null},"validateFileSize");function Q({name:e,description:t,label:i,multiple:l,onChange:s,component:p,accept:r,maxSize:c,...h}){let{components:u}=C(),{control:F,setError:a,clearErrors:f}=d(),S=n(async(m,y)=>{let x=xe(m,c);if(x){a(e,{message:x});return}f(e),y.onChange(m),s?.(m)},"handleOnChange");return K(g,{control:F,name:e,render:({field:m,fieldState:y})=>{let x=p||u.file;if(!x)throw new Error(`File upload component not found for field ${e}`);let P={name:e,description:t,label:i,multiple:l,accept:r,maxFileSize:c,...h};return K(x,{field:{...m,value:m.value,onChange:n(async T=>S(T,m),"onChange")},fieldState:y,fieldData:P})}})}n(Q,"FileUploadField");import{jsx as X}from"react/jsx-runtime";function N(e){let{components:t}=C(),{control:i}=d(),l=e.component||t.number;if(!l)throw new Error(`Number component not found for field ${e.name}`);return X(g,{control:i,name:e.name,render:({field:s,fieldState:p})=>X(l,{field:{...s,onChange:n(r=>{s.onChange(r),e.onChange?.(r)},"onChange")},fieldState:p,fieldData:e})})}n(N,"NumberField");import{jsx as Y}from"react/jsx-runtime";function j({name:e,defaultValue:t,description:i,label:l,options:s,onChange:p,component:r,...c}){let{components:h}=C(),{control:u}=d();return Y(g,{control:u,name:e,defaultValue:t,render:({field:F,fieldState:a})=>{let f=r||h?.radio;if(!f)throw new Error(`Radio group component not found for field ${e}`);let S={name:e,defaultValue:t,description:i,label:l,options:s,...c};return Y(f,{field:{...F,onChange:n(m=>{F.onChange(m),p?.(m)},"onChange")},fieldState:a,fieldData:S})}})}n(j,"RadioGroupField");import{jsx as ee}from"react/jsx-runtime";function oe({label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,component:r,...c}){let{control:h}=d(),{components:u}=C();return ee(g,{defaultValue:l,control:h,name:t,render:({field:F,fieldState:a})=>{let f=r||u?.select;if(!f)throw new Error(`Select component not found for field ${t}`);let S={label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,...c};return ee(f,{field:{...F,onChange:n(m=>{let y=c.jsonType==="number"?Number(m):m;F.onChange(y),p?.(y)},"onChange")},fieldState:a,fieldData:S})}})}n(oe,"SelectField");import{jsx as te}from"react/jsx-runtime";function ne({label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,$meta:r,component:c,...h}){let{control:u}=d(),{components:F}=C();return te(g,{defaultValue:l,control:u,name:t,render:({field:a,fieldState:f})=>{let S=c||F.countries;if(!S)throw new Error(`Country component not found for field ${t}`);let m={label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,$meta:r,...h};return te(S,{field:{...a,onChange:n(y=>{a.onChange(y),p?.(y)},"onChange")},fieldState:f,fieldData:m})}})}n(ne,"CountryField");import{jsx as re}from"react/jsx-runtime";function ie({name:e,description:t,label:i,onChange:l,maxLength:s,component:p,...r}){let{components:c}=C(),{control:h}=d();return re(g,{control:h,name:e,render:({field:u,fieldState:F})=>{let a=p||c.textarea;if(!a)throw new Error(`Text area component not found for field ${e}`);let f={name:e,description:t,label:i,maxLength:s,...r};return re(a,{field:{...u,onChange:n(S=>{u.onChange(S),l?.(S)},"onChange")},fieldState:F,fieldData:f})}})}n(ie,"TextAreaField");import{jsx as le}from"react/jsx-runtime";function me(e){let{components:t}=C(),{control:i}=d(),l=e.component||t.email;if(!l)throw new Error(`Email component not found for field ${e.name}`);return le(g,{control:i,name:e.name,render:({field:s,fieldState:p})=>le(l,{field:{...s,onChange:n(r=>{s.onChange(r),e.onChange?.(r)},"onChange")},fieldState:p,fieldData:e})})}n(me,"EmailField");import{jsx as se}from"react/jsx-runtime";function ae(e){let{control:t}=d();return se(g,{control:t,name:e.name,render:({field:i})=>se("input",{...i,type:"hidden"})})}n(ae,"HiddenField");import{useEffect as be,useState as Te}from"react";import{jsx as pe}from"react/jsx-runtime";function de(e){let{components:t}=C(),{setValue:i,control:l,watch:s}=d(),p=s(e.name),[r,c]=Te(p),{workHoursSummary:h,breakSummary:u}=O(r),F=L(r);be(()=>{i(e.name,r)},[r,e.name,i]);function a(m){c(m)}n(a,"onSubmit");let f=e.component||t["work-schedule"];if(!f)throw new Error(`Work schedule component not found for field ${e.name}`);let S={...e,onSubmit:a,currentSchedule:r,defaultFormattedValue:{workHoursSummary:h,breakSummary:u,totalWorkHours:F}};return pe(g,{control:l,name:e.name,render:({field:m,fieldState:y})=>pe(f,{field:{...m,onChange:n(x=>{m.onChange(x),e.onChange?.(x)},"onChange")},fieldState:y,fieldData:S})})}n(de,"WorkScheduleField");import{jsx as ce}from"react/jsx-runtime";function ue({label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,component:r,...c}){let{control:h}=d(),{components:u}=C();return ce(g,{defaultValue:l,control:h,name:t,render:({field:F,fieldState:a})=>{let f=r||u?.["multi-select"];if(!f)throw new Error(`Multi select component not found for field ${t}`);let S={label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,...c};return ce(f,{field:{...F,onChange:n(m=>{F.onChange(m),p?.(m)},"onChange")},fieldState:a,fieldData:S})}})}n(ue,"MultiSelectField");import{jsx as $e}from"react/jsx-runtime";var Fe=n(e=>$e(N,{maxLength:15,...e}),"MoneyField");var A={checkbox:G,text:z,email:me,money:Fe,select:oe,"multi-select":ue,radio:j,number:N,file:Q,date:q,textarea:ie,countries:ne,hidden:ae,"work-schedule":de};import{Fragment as we,jsx as b,jsxs as $}from"react/jsx-runtime";function Ce({label:e,name:t,fields:i,description:l,components:s,statement:p,isFlatFieldset:r,extra:c,variant:h="outset",features:u,meta:F}){let{helpCenter:a}=F||{},{watch:f,setValue:S,trigger:m,formState:y}=d(),{components:x}=C(),P=u?.toggle?.stateField,T=P?f(P):u?.toggle?.defaultExpanded??!0,Se=i.map(({name:o})=>`${t}.${o}`),_=f(Se),B=ge(_),w=ge(null),he=n(()=>{P&&S(P,!T)},"toggleExpanded");Pe(()=>{let o=_,D=B.current,M=y.isSubmitted||y.submitCount>0,E=!1;for(let k=0;k<o.length;k++)if(o[k]!==void 0&&D[k]!==o[k]){E=!0;break}return E&&M&&(w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{m()},50)),B.current=[...o],()=>{w.current&&clearTimeout(w.current)}},[_,m,y.isSubmitted,y.submitCount]);let ye=x?.fieldsetToggle||I,V=`${t}-content`,W=`${t}-header`;return $("fieldset",{className:R("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[b("legend",{className:R("text-sm font-semibold px-2",h==="inset"&&"hidden"),children:e}),a?.callToAction&&a?.id&&h==="outset"&&b(J,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:a.id,children:a.callToAction}),h==="inset"&&$(we,{children:[$("div",{className:"RemoteFlows__FieldSetField__Header",id:W,"data-state":T?"expanded":"collapsed","aria-expanded":T,children:[b("h3",{className:R("RemoteFlows__FieldSetField__Title"),children:e}),u?.toggle?.enabled&&b(ye,{isExpanded:T,onToggle:he,"aria-expanded":T,"aria-controls":V,"aria-label":`${T?"Hide":"Show"} ${e}`,className:R("RemoteFlows__FieldSetField__Toggle",u.toggle?.className),children:T?u.toggle.labels?.collapse??"Remove":u.toggle.labels?.expand??"Define"})]}),a?.callToAction&&a?.id&&b(J,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:a.id,children:a.callToAction})]}),T&&$("div",{id:V,"aria-labelledby":W,role:"region",children:[l?b("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:H(l)}}):null,$("div",{className:"grid gap-4",children:[i.map(o=>{if(o.calculateDynamicProperties&&(o={...o,...o.calculateDynamicProperties(_,o)||{}}),o.isVisible===!1||o.deprecated)return null;if(o.inputType==="fieldset")return b(Ce,{...o,name:`${r?o.name:`${t}.${o.name}`}`,components:s},`${r?o.name:`${t}.${o.name}`}`);if(o.inputType==="fieldset-flat")return b(Ce,{...o,name:`${r?o.name:`${t}.${o.name}`}`,components:s,isFlatFieldset:!0},`${r?o.name:`${t}.${o.name}`}`);let D=A[o.inputType];if(o.Component){let{Component:M}=o;return $(fe,{children:[b(M,{setValue:E=>S(r?o.name:`${t}.${o.name}`,E),...o}),o.statement?b(v,{...o.statement}):null,o.extra?o.extra:null]},`${r?o.name:`${t}.${o.name}`}`)}return D?(o.inputType==="select"&&o.multiple&&(D=A["multi-select"]),$(fe,{children:[b(D,{...o,name:`${r?o.name:`${t}.${o.name}`}`,component:s?.[o.inputType]}),o.statement?b(v,{...o.statement}):null,o.extra?o.extra:null]},`${r?o.name:`${t}.${o.name}`}`)):$("p",{className:"error",children:["Field type ",o.inputType," not supported"]})}),c||null,p?b(v,{...p}):null]})]})]})}n(Ce,"FieldSetField");export{A as a,Ce as b};
2
- //# sourceMappingURL=chunk-HOR3KPOZ.js.map
1
+ import{a as v}from"./chunk-SNECOPBD.js";import{i as U}from"./chunk-T7O3YYOG.js";import{b as L,c as O,f as G}from"./chunk-EHD2YB5F.js";import{a as I}from"./chunk-SS2FAFUZ.js";import{a as z}from"./chunk-TOQPDTGG.js";import{b as J}from"./chunk-AK4FXJFO.js";import{c as d,h as g}from"./chunk-H2JFQGQJ.js";import{a as R,e as H}from"./chunk-VIGKOVHP.js";import{b as C}from"./chunk-KQPDXXG3.js";import{a as n}from"./chunk-P37U34EQ.js";import{Fragment as fe,useEffect as Pe,useRef as ge}from"react";import{jsx as Z}from"react/jsx-runtime";function q({description:e,label:t,name:i,minDate:l,maxDate:s,onChange:p,component:r,...c}){let{components:h}=C(),{control:u}=d(),F;c.meta?.mot&&typeof c.meta.mot=="number"?F=U(c.meta.mot):typeof l=="string"&&(F=new Date(`${l}T00:00:00`));let a;return s&&(a=new Date(`${s}T23:59:59`)),Z(g,{control:u,name:i,render:({field:f,fieldState:S})=>{let m=r||h?.date;if(!m)throw new Error(`Date picker component not found for field ${i}`);let y={description:e,label:t,name:i,onChange:p,...F&&{minDate:F.toISOString()},...a&&{maxDate:a.toISOString()},...c};return Z(m,{field:{...f,onChange:n(x=>{f.onChange(x),p?.(x)},"onChange")},fieldState:S,fieldData:y})}})}n(q,"DatePickerField");import{jsx as K}from"react/jsx-runtime";var xe=n((e,t)=>{if(!t)return null;for(let i of e)if(i.size>t){let l=Math.round(t/1048576),s=Math.round(i.size/(1024*1024));return`File "${i.name}" exceeds maximum size of ${l}MB (file is ${s}MB)`}return null},"validateFileSize");function Q({name:e,description:t,label:i,multiple:l,onChange:s,component:p,accept:r,maxSize:c,...h}){let{components:u}=C(),{control:F,setError:a,clearErrors:f}=d(),S=n(async(m,y)=>{let x=xe(m,c);if(x){a(e,{message:x});return}f(e),y.onChange(m),s?.(m)},"handleOnChange");return K(g,{control:F,name:e,render:({field:m,fieldState:y})=>{let x=p||u.file;if(!x)throw new Error(`File upload component not found for field ${e}`);let P={name:e,description:t,label:i,multiple:l,accept:r,maxFileSize:c,...h};return K(x,{field:{...m,value:m.value,onChange:n(async T=>S(T,m),"onChange")},fieldState:y,fieldData:P})}})}n(Q,"FileUploadField");import{jsx as X}from"react/jsx-runtime";function N(e){let{components:t}=C(),{control:i}=d(),l=e.component||t.number;if(!l)throw new Error(`Number component not found for field ${e.name}`);return X(g,{control:i,name:e.name,render:({field:s,fieldState:p})=>X(l,{field:{...s,onChange:n(r=>{s.onChange(r),e.onChange?.(r)},"onChange")},fieldState:p,fieldData:e})})}n(N,"NumberField");import{jsx as Y}from"react/jsx-runtime";function j({name:e,defaultValue:t,description:i,label:l,options:s,onChange:p,component:r,...c}){let{components:h}=C(),{control:u}=d();return Y(g,{control:u,name:e,defaultValue:t,render:({field:F,fieldState:a})=>{let f=r||h?.radio;if(!f)throw new Error(`Radio group component not found for field ${e}`);let S={name:e,defaultValue:t,description:i,label:l,options:s,...c};return Y(f,{field:{...F,onChange:n(m=>{F.onChange(m),p?.(m)},"onChange")},fieldState:a,fieldData:S})}})}n(j,"RadioGroupField");import{jsx as ee}from"react/jsx-runtime";function oe({label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,component:r,...c}){let{control:h}=d(),{components:u}=C();return ee(g,{defaultValue:l,control:h,name:t,render:({field:F,fieldState:a})=>{let f=r||u?.select;if(!f)throw new Error(`Select component not found for field ${t}`);let S={label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,...c};return ee(f,{field:{...F,onChange:n(m=>{let y=c.jsonType==="number"?Number(m):m;F.onChange(y),p?.(y)},"onChange")},fieldState:a,fieldData:S})}})}n(oe,"SelectField");import{jsx as te}from"react/jsx-runtime";function ne({label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,$meta:r,component:c,...h}){let{control:u}=d(),{components:F}=C();return te(g,{defaultValue:l,control:u,name:t,render:({field:a,fieldState:f})=>{let S=c||F.countries;if(!S)throw new Error(`Country component not found for field ${t}`);let m={label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,$meta:r,...h};return te(S,{field:{...a,onChange:n(y=>{a.onChange(y),p?.(y)},"onChange")},fieldState:f,fieldData:m})}})}n(ne,"CountryField");import{jsx as re}from"react/jsx-runtime";function ie({name:e,description:t,label:i,onChange:l,maxLength:s,component:p,...r}){let{components:c}=C(),{control:h}=d();return re(g,{control:h,name:e,render:({field:u,fieldState:F})=>{let a=p||c.textarea;if(!a)throw new Error(`Text area component not found for field ${e}`);let f={name:e,description:t,label:i,maxLength:s,...r};return re(a,{field:{...u,onChange:n(S=>{u.onChange(S),l?.(S)},"onChange")},fieldState:F,fieldData:f})}})}n(ie,"TextAreaField");import{jsx as le}from"react/jsx-runtime";function me(e){let{components:t}=C(),{control:i}=d(),l=e.component||t.email;if(!l)throw new Error(`Email component not found for field ${e.name}`);return le(g,{control:i,name:e.name,render:({field:s,fieldState:p})=>le(l,{field:{...s,onChange:n(r=>{s.onChange(r),e.onChange?.(r)},"onChange")},fieldState:p,fieldData:e})})}n(me,"EmailField");import{jsx as se}from"react/jsx-runtime";function ae(e){let{control:t}=d();return se(g,{control:t,name:e.name,render:({field:i})=>se("input",{...i,type:"hidden"})})}n(ae,"HiddenField");import{useEffect as be,useState as Te}from"react";import{jsx as pe}from"react/jsx-runtime";function de(e){let{components:t}=C(),{setValue:i,control:l,watch:s}=d(),p=s(e.name),[r,c]=Te(p),{workHoursSummary:h,breakSummary:u}=O(r),F=L(r);be(()=>{i(e.name,r)},[r,e.name,i]);function a(m){c(m)}n(a,"onSubmit");let f=e.component||t["work-schedule"];if(!f)throw new Error(`Work schedule component not found for field ${e.name}`);let S={...e,onSubmit:a,currentSchedule:r,defaultFormattedValue:{workHoursSummary:h,breakSummary:u,totalWorkHours:F}};return pe(g,{control:l,name:e.name,render:({field:m,fieldState:y})=>pe(f,{field:{...m,onChange:n(x=>{m.onChange(x),e.onChange?.(x)},"onChange")},fieldState:y,fieldData:S})})}n(de,"WorkScheduleField");import{jsx as ce}from"react/jsx-runtime";function ue({label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,component:r,...c}){let{control:h}=d(),{components:u}=C();return ce(g,{defaultValue:l,control:h,name:t,render:({field:F,fieldState:a})=>{let f=r||u?.["multi-select"];if(!f)throw new Error(`Multi select component not found for field ${t}`);let S={label:e,name:t,options:i,defaultValue:l,description:s,onChange:p,...c};return ce(f,{field:{...F,onChange:n(m=>{F.onChange(m),p?.(m)},"onChange")},fieldState:a,fieldData:S})}})}n(ue,"MultiSelectField");import{jsx as $e}from"react/jsx-runtime";var Fe=n(e=>$e(N,{maxLength:15,...e}),"MoneyField");var A={checkbox:G,text:z,email:me,money:Fe,select:oe,"multi-select":ue,radio:j,number:N,file:Q,date:q,textarea:ie,countries:ne,hidden:ae,"work-schedule":de};import{Fragment as we,jsx as b,jsxs as $}from"react/jsx-runtime";function Ce({label:e,name:t,fields:i,description:l,components:s,statement:p,isFlatFieldset:r,extra:c,variant:h="outset",features:u,meta:F}){let{helpCenter:a}=F||{},{watch:f,setValue:S,trigger:m,formState:y}=d(),{components:x}=C(),P=u?.toggle?.stateField,T=P?f(P):u?.toggle?.defaultExpanded??!0,Se=i.map(({name:o})=>`${t}.${o}`),_=f(Se),B=ge(_),w=ge(null),he=n(()=>{P&&S(P,!T)},"toggleExpanded");Pe(()=>{let o=_,D=B.current,M=y.isSubmitted||y.submitCount>0,E=!1;for(let k=0;k<o.length;k++)if(o[k]!==void 0&&D[k]!==o[k]){E=!0;break}return E&&M&&(w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{m()},50)),B.current=[...o],()=>{w.current&&clearTimeout(w.current)}},[_,m,y.isSubmitted,y.submitCount]);let ye=x?.fieldsetToggle||I,V=`${t}-content`,W=`${t}-header`;return $("fieldset",{className:R("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[b("legend",{className:R("text-sm font-semibold px-2",h==="inset"&&"hidden"),children:e}),a?.callToAction&&a?.id&&h==="outset"&&b(J,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:a.id,children:a.callToAction}),h==="inset"&&$(we,{children:[$("div",{className:"RemoteFlows__FieldSetField__Header",id:W,"data-state":T?"expanded":"collapsed","aria-expanded":T,children:[b("h3",{className:R("RemoteFlows__FieldSetField__Title"),children:e}),u?.toggle?.enabled&&b(ye,{isExpanded:T,onToggle:he,"aria-expanded":T,"aria-controls":V,"aria-label":`${T?"Hide":"Show"} ${e}`,className:R("RemoteFlows__FieldSetField__Toggle",u.toggle?.className),children:T?u.toggle.labels?.collapse??"Remove":u.toggle.labels?.expand??"Define"})]}),a?.callToAction&&a?.id&&b(J,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:a.id,children:a.callToAction})]}),T&&$("div",{id:V,"aria-labelledby":W,role:"region",children:[l?b("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:H(l)}}):null,$("div",{className:"grid gap-4",children:[i.map(o=>{if(o.calculateDynamicProperties&&(o={...o,...o.calculateDynamicProperties(_,o)||{}}),o.isVisible===!1||o.deprecated)return null;if(o.inputType==="fieldset")return b(Ce,{...o,name:`${r?o.name:`${t}.${o.name}`}`,components:s},`${r?o.name:`${t}.${o.name}`}`);if(o.inputType==="fieldset-flat")return b(Ce,{...o,name:`${r?o.name:`${t}.${o.name}`}`,components:s,isFlatFieldset:!0},`${r?o.name:`${t}.${o.name}`}`);let D=A[o.inputType];if(o.Component){let{Component:M}=o;return $(fe,{children:[b(M,{setValue:E=>S(r?o.name:`${t}.${o.name}`,E),...o}),o.statement?b(v,{...o.statement}):null,o.extra?o.extra:null]},`${r?o.name:`${t}.${o.name}`}`)}return D?(o.inputType==="select"&&o.multiple&&(D=A["multi-select"]),$(fe,{children:[b(D,{...o,name:`${r?o.name:`${t}.${o.name}`}`,component:s?.[o.inputType]}),o.statement?b(v,{...o.statement}):null,o.extra?o.extra:null]},`${r?o.name:`${t}.${o.name}`}`)):$("p",{className:"error",children:["Field type ",o.inputType," not supported"]})}),c||null,p?b(v,{...p}):null]})]})]})}n(Ce,"FieldSetField");export{A as a,Ce as b};
2
+ //# sourceMappingURL=chunk-SAKDBD4P.js.map
@@ -0,0 +1,2 @@
1
+ import{a as p}from"./chunk-EUSCQL4H.js";import{C as c,I as m,M as C,R as d,m as l,v as u}from"./chunk-2IA5ZHU4.js";import{d as o}from"./chunk-KQPDXXG3.js";import{a as t}from"./chunk-P37U34EQ.js";import{useMutation as a,useQuery as r}from"@tanstack/react-query";var h=t(({includePremiumBenefits:e})=>{let{client:i}=o();return r({queryKey:["cost-calculator-countries",e],queryFn:t(()=>c({client:i,query:{include_premium_benefits:e}}),"queryFn"),select:t(s=>s.data?.data.filter(n=>n.availability==="active").map(n=>({value:n.region_slug,label:n.name,childRegions:n.child_regions,hasAdditionalFields:n.has_additional_fields,regionSlug:n.region_slug,currency:n.currency.code})),"select")})},"useCostCalculatorCountries"),q=t(()=>{let{client:e}=o();return r({queryKey:["company-currencies"],queryFn:t(()=>d({client:e}),"queryFn"),select:t(i=>i.data?.data?.company_currencies.map(s=>({value:s.slug,label:s.code})),"select")})},"useCompanyCurrencies"),x=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>l({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimation"),P=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>u({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationPdf"),v=t(()=>{let{client:e}=o();return a({mutationFn:t(i=>C({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationCsv"),S=t((e,{includePremiumBenefits:i,options:s})=>{let{client:n}=o();return r({queryKey:["cost-calculator-region-fields",e,i],queryFn:t(()=>m({client:n,path:{slug:e},query:{include_premium_benefits:i}}),"queryFn"),enabled:!!e,select:t(({data:f})=>{let y=f?.data?.schema||{};return p(y,void 0,s)},"select")})},"useRegionFields");export{h as a,q as b,x as c,P as d,v as e,S as f};
2
+ //# sourceMappingURL=chunk-SD3LBJUH.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flows/CostCalculator/api.ts"],"sourcesContent":["import { createHeadlessForm } from '@/src/common/createHeadlessForm';\nimport {\n CostCalculatorEstimateParams,\n getIndexCompanyCurrency,\n getIndexCountry,\n getShowRegionField,\n postCreateEstimation,\n postCreateEstimationCsv,\n postCreateEstimationPdf,\n} from '@/src/client';\nimport { Client } from '@/src/client/client';\nimport { useClient } from '@/src/context';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { CostCalculatorEstimationOptions } from '@/src/flows/CostCalculator/types';\nimport { JSFModify } from '@/src/flows/types';\n\n/**\n * Hook to fetch the countries for the cost calculator.\n * @returns\n */\nexport const useCostCalculatorCountries = ({\n includePremiumBenefits,\n}: {\n includePremiumBenefits: CostCalculatorEstimationOptions['includePremiumBenefits'];\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['cost-calculator-countries', includePremiumBenefits],\n queryFn: () => {\n return getIndexCountry({\n client: client as Client,\n query: {\n include_premium_benefits: includePremiumBenefits,\n },\n });\n },\n select: (data) =>\n data.data?.data\n .filter((country) => country.availability === 'active')\n .map((country) => ({\n value: country.region_slug,\n label: country.name,\n childRegions: country.child_regions,\n hasAdditionalFields: country.has_additional_fields,\n regionSlug: country.region_slug,\n currency: country.currency.code,\n })),\n });\n};\n\n/**\n * Hook to fetch the company currencies.\n * @returns\n */\nexport const useCompanyCurrencies = () => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['company-currencies'],\n queryFn: () => {\n return getIndexCompanyCurrency({\n client: client as Client,\n });\n },\n select: (data) =>\n data.data?.data?.company_currencies.map((currency) => ({\n value: currency.slug,\n label: currency.code,\n })),\n });\n};\n\n/**\n * Hook to create an estimation.\n * @returns\n */\nexport const useCostCalculatorEstimation = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: CostCalculatorEstimateParams) => {\n return postCreateEstimation({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Custom hook to create a PDF estimation.\n *\n * @returns\n */\nexport const useCostCalculatorEstimationPdf = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: CostCalculatorEstimateParams) => {\n return postCreateEstimationPdf({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Custom hook to create a CSV estimation.\n *\n * @returns\n */\nexport const useCostCalculatorEstimationCsv = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: CostCalculatorEstimateParams) => {\n return postCreateEstimationCsv({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Hook to fetch the region fields.\n * @param region\n * @returns\n */\nexport const useRegionFields = (\n region: string | undefined,\n {\n includePremiumBenefits,\n options,\n }: {\n includePremiumBenefits: CostCalculatorEstimationOptions['includePremiumBenefits'];\n options?: {\n jsfModify?: JSFModify;\n };\n },\n) => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['cost-calculator-region-fields', region, includePremiumBenefits],\n queryFn: () => {\n return getShowRegionField({\n client: client as Client,\n path: { slug: region as string },\n query: {\n include_premium_benefits: includePremiumBenefits,\n },\n });\n },\n enabled: !!region,\n select: ({ data }) => {\n const jsfSchema = data?.data?.schema || {};\n return createHeadlessForm(jsfSchema, undefined, options);\n },\n });\n};\n"],"mappings":"yLAYA,OAAS,eAAAA,EAAa,YAAAC,MAAgB,wBAQ/B,IAAMC,EAA6BC,EAAA,CAAC,CACzC,uBAAAC,CACF,IAEM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,4BAA6BH,CAAsB,EAC9D,QAASD,EAAA,IACAK,EAAgB,CACrB,OAAQH,EACR,MAAO,CACL,yBAA0BD,CAC5B,CACF,CAAC,EANM,WAQT,OAAQD,EAACM,GACPA,EAAK,MAAM,KACR,OAAQC,GAAYA,EAAQ,eAAiB,QAAQ,EACrD,IAAKA,IAAa,CACjB,MAAOA,EAAQ,YACf,MAAOA,EAAQ,KACf,aAAcA,EAAQ,cACtB,oBAAqBA,EAAQ,sBAC7B,WAAYA,EAAQ,YACpB,SAAUA,EAAQ,SAAS,IAC7B,EAAE,EAVE,SAWV,CAAC,CACH,EA5B0C,8BAkC7BC,EAAuBR,EAAA,IAAM,CACxC,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOC,EAAS,CACd,SAAU,CAAC,oBAAoB,EAC/B,QAASJ,EAAA,IACAS,EAAwB,CAC7B,OAAQP,CACV,CAAC,EAHM,WAKT,OAAQF,EAACM,GACPA,EAAK,MAAM,MAAM,mBAAmB,IAAKI,IAAc,CACrD,MAAOA,EAAS,KAChB,MAAOA,EAAS,IAClB,EAAE,EAJI,SAKV,CAAC,CACH,EAhBoC,wBAsBvBC,EAA8BX,EAAA,IAAM,CAC/C,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOS,EAAY,CACjB,WAAYZ,EAACa,GACJC,EAAqB,CAC1B,OAAQZ,EACR,KAAMW,CACR,CAAC,EAJS,aAMd,CAAC,CACH,EAX2C,+BAkB9BE,EAAiCf,EAAA,IAAM,CAClD,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOS,EAAY,CACjB,WAAYZ,EAACa,GACJG,EAAwB,CAC7B,OAAQd,EACR,KAAMW,CACR,CAAC,EAJS,aAMd,CAAC,CACH,EAX8C,kCAkBjCI,EAAiCjB,EAAA,IAAM,CAClD,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAC7B,OAAOS,EAAY,CACjB,WAAYZ,EAACa,GACJK,EAAwB,CAC7B,OAAQhB,EACR,KAAMW,CACR,CAAC,EAJS,aAMd,CAAC,CACH,EAV8C,kCAiBjCM,EAAkBnB,EAAA,CAC7BoB,EACA,CACE,uBAAAnB,EACA,QAAAoB,CACF,IAMG,CACH,GAAM,CAAE,OAAAnB,CAAO,EAAIC,EAAU,EAE7B,OAAOC,EAAS,CACd,SAAU,CAAC,gCAAiCgB,EAAQnB,CAAsB,EAC1E,QAASD,EAAA,IACAsB,EAAmB,CACxB,OAAQpB,EACR,KAAM,CAAE,KAAMkB,CAAiB,EAC/B,MAAO,CACL,yBAA0BnB,CAC5B,CACF,CAAC,EAPM,WAST,QAAS,CAAC,CAACmB,EACX,OAAQpB,EAAA,CAAC,CAAE,KAAAM,CAAK,IAAM,CACpB,IAAMiB,EAAYjB,GAAM,MAAM,QAAU,CAAC,EACzC,OAAOkB,EAAmBD,EAAW,OAAWF,CAAO,CACzD,EAHQ,SAIV,CAAC,CACH,EA/B+B","names":["useMutation","useQuery","useCostCalculatorCountries","__name","includePremiumBenefits","client","useClient","useQuery","getIndexCountry","data","country","useCompanyCurrencies","getIndexCompanyCurrency","currency","useCostCalculatorEstimation","useMutation","payload","postCreateEstimation","useCostCalculatorEstimationPdf","postCreateEstimationPdf","useCostCalculatorEstimationCsv","postCreateEstimationCsv","useRegionFields","region","options","getShowRegionField","jsfSchema","createHeadlessForm"]}
1
+ {"version":3,"sources":["../src/flows/CostCalculator/api.ts"],"sourcesContent":["import { createHeadlessForm } from '@/src/common/createHeadlessForm';\nimport {\n CostCalculatorEstimateParams,\n getIndexCompanyCurrency,\n getIndexCountry,\n getShowRegionField,\n postCreateEstimation,\n postCreateEstimationCsv,\n postCreateEstimationPdf,\n} from '@/src/client';\nimport { Client } from '@/src/client/client';\nimport { useClient } from '@/src/context';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { CostCalculatorEstimationOptions } from '@/src/flows/CostCalculator/types';\nimport { JSFModify } from '@/src/flows/types';\n\n/**\n * Hook to fetch the countries for the cost calculator.\n * @returns\n */\nexport const useCostCalculatorCountries = ({\n includePremiumBenefits,\n}: {\n includePremiumBenefits: CostCalculatorEstimationOptions['includePremiumBenefits'];\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['cost-calculator-countries', includePremiumBenefits],\n queryFn: () => {\n return getIndexCountry({\n client: client as Client,\n query: {\n include_premium_benefits: includePremiumBenefits,\n },\n });\n },\n select: (data) =>\n data.data?.data\n .filter((country) => country.availability === 'active')\n .map((country) => ({\n value: country.region_slug,\n label: country.name,\n childRegions: country.child_regions,\n hasAdditionalFields: country.has_additional_fields,\n regionSlug: country.region_slug,\n currency: country.currency.code,\n })),\n });\n};\n\n/**\n * Hook to fetch the company currencies.\n * @returns\n */\nexport const useCompanyCurrencies = () => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['company-currencies'],\n queryFn: () => {\n return getIndexCompanyCurrency({\n client: client as Client,\n });\n },\n select: (data) =>\n data.data?.data?.company_currencies.map((currency) => ({\n value: currency.slug,\n label: currency.code,\n })),\n });\n};\n\n/**\n * Hook to create an estimation.\n * @returns\n */\nexport const useCostCalculatorEstimation = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: CostCalculatorEstimateParams) => {\n return postCreateEstimation({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Custom hook to create a PDF estimation.\n *\n * @returns\n */\nexport const useCostCalculatorEstimationPdf = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: CostCalculatorEstimateParams) => {\n return postCreateEstimationPdf({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Custom hook to create a CSV estimation.\n *\n * @returns\n */\nexport const useCostCalculatorEstimationCsv = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: CostCalculatorEstimateParams) => {\n return postCreateEstimationCsv({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Hook to fetch the region fields.\n * @param region\n * @returns\n */\nexport const useRegionFields = (\n region: string | undefined,\n {\n includePremiumBenefits,\n options,\n }: {\n includePremiumBenefits: CostCalculatorEstimationOptions['includePremiumBenefits'];\n options?: {\n jsfModify?: JSFModify;\n };\n },\n) => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['cost-calculator-region-fields', region, includePremiumBenefits],\n queryFn: () => {\n return getShowRegionField({\n client: client as Client,\n path: { slug: region as string },\n query: {\n include_premium_benefits: includePremiumBenefits,\n },\n });\n },\n enabled: !!region,\n select: ({ data }) => {\n const jsfSchema = data?.data?.schema || {};\n return createHeadlessForm(jsfSchema, undefined, options);\n },\n });\n};\n"],"mappings":"mMAYA,OAAS,eAAAA,EAAa,YAAAC,MAAgB,wBAQ/B,IAAMC,EAA6BC,EAAA,CAAC,CACzC,uBAAAC,CACF,IAEM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,4BAA6BH,CAAsB,EAC9D,QAASD,EAAA,IACAK,EAAgB,CACrB,OAAQH,EACR,MAAO,CACL,yBAA0BD,CAC5B,CACF,CAAC,EANM,WAQT,OAAQD,EAACM,GACPA,EAAK,MAAM,KACR,OAAQC,GAAYA,EAAQ,eAAiB,QAAQ,EACrD,IAAKA,IAAa,CACjB,MAAOA,EAAQ,YACf,MAAOA,EAAQ,KACf,aAAcA,EAAQ,cACtB,oBAAqBA,EAAQ,sBAC7B,WAAYA,EAAQ,YACpB,SAAUA,EAAQ,SAAS,IAC7B,EAAE,EAVE,SAWV,CAAC,CACH,EA5B0C,8BAkC7BC,EAAuBR,EAAA,IAAM,CACxC,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOC,EAAS,CACd,SAAU,CAAC,oBAAoB,EAC/B,QAASJ,EAAA,IACAS,EAAwB,CAC7B,OAAQP,CACV,CAAC,EAHM,WAKT,OAAQF,EAACM,GACPA,EAAK,MAAM,MAAM,mBAAmB,IAAKI,IAAc,CACrD,MAAOA,EAAS,KAChB,MAAOA,EAAS,IAClB,EAAE,EAJI,SAKV,CAAC,CACH,EAhBoC,wBAsBvBC,EAA8BX,EAAA,IAAM,CAC/C,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOS,EAAY,CACjB,WAAYZ,EAACa,GACJC,EAAqB,CAC1B,OAAQZ,EACR,KAAMW,CACR,CAAC,EAJS,aAMd,CAAC,CACH,EAX2C,+BAkB9BE,EAAiCf,EAAA,IAAM,CAClD,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAE7B,OAAOS,EAAY,CACjB,WAAYZ,EAACa,GACJG,EAAwB,CAC7B,OAAQd,EACR,KAAMW,CACR,CAAC,EAJS,aAMd,CAAC,CACH,EAX8C,kCAkBjCI,EAAiCjB,EAAA,IAAM,CAClD,GAAM,CAAE,OAAAE,CAAO,EAAIC,EAAU,EAC7B,OAAOS,EAAY,CACjB,WAAYZ,EAACa,GACJK,EAAwB,CAC7B,OAAQhB,EACR,KAAMW,CACR,CAAC,EAJS,aAMd,CAAC,CACH,EAV8C,kCAiBjCM,EAAkBnB,EAAA,CAC7BoB,EACA,CACE,uBAAAnB,EACA,QAAAoB,CACF,IAMG,CACH,GAAM,CAAE,OAAAnB,CAAO,EAAIC,EAAU,EAE7B,OAAOC,EAAS,CACd,SAAU,CAAC,gCAAiCgB,EAAQnB,CAAsB,EAC1E,QAASD,EAAA,IACAsB,EAAmB,CACxB,OAAQpB,EACR,KAAM,CAAE,KAAMkB,CAAiB,EAC/B,MAAO,CACL,yBAA0BnB,CAC5B,CACF,CAAC,EAPM,WAST,QAAS,CAAC,CAACmB,EACX,OAAQpB,EAAA,CAAC,CAAE,KAAAM,CAAK,IAAM,CACpB,IAAMiB,EAAYjB,GAAM,MAAM,QAAU,CAAC,EACzC,OAAOkB,EAAmBD,EAAW,OAAWF,CAAO,CACzD,EAHQ,SAIV,CAAC,CACH,EA/B+B","names":["useMutation","useQuery","useCostCalculatorCountries","__name","includePremiumBenefits","client","useClient","useQuery","getIndexCountry","data","country","useCompanyCurrencies","getIndexCompanyCurrency","currency","useCostCalculatorEstimation","useMutation","payload","postCreateEstimation","useCostCalculatorEstimationPdf","postCreateEstimationPdf","useCostCalculatorEstimationCsv","postCreateEstimationCsv","useRegionFields","region","options","getShowRegionField","jsfSchema","createHeadlessForm"]}
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-YOIXPHGR.js";import{b as a}from"./chunk-Q3ALCPJN.js";import{k as n}from"./chunk-VIGKOVHP.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as b}from"react/jsx-runtime";function g({onSubmit:l,onSuccess:u,onError:d}){let{contractorOnboardingBag:i}=a(),m=e(async t=>{try{let o=await i.parseFormValues(t);await l?.(o);let r=await i.onSubmit(t);if(r?.data){await u?.(r?.data),r?._skipNextStep||i?.next();return}}catch(o){let r=n(o,i.meta?.fields?.eligibility_questionnaire);d?.(r)}},"handleSubmit"),p=i.stepState.values?.eligibility_questionnaire||i.initialValues.eligibility_questionnaire;return b(s,{defaultValues:p,onSubmit:m})}e(g,"EligibilityQuestionnaireStep");export{g as a};
2
- //# sourceMappingURL=chunk-TAHMDXUS.js.map
1
+ import{a as s}from"./chunk-URJI6IZB.js";import{b as a}from"./chunk-Q3ALCPJN.js";import{k as n}from"./chunk-VIGKOVHP.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as b}from"react/jsx-runtime";function g({onSubmit:l,onSuccess:u,onError:d}){let{contractorOnboardingBag:i}=a(),m=e(async t=>{try{let o=await i.parseFormValues(t);await l?.(o);let r=await i.onSubmit(t);if(r?.data){await u?.(r?.data),r?._skipNextStep||i?.next();return}}catch(o){let r=n(o,i.meta?.fields?.eligibility_questionnaire);d?.(r)}},"handleSubmit"),p=i.stepState.values?.eligibility_questionnaire||i.initialValues.eligibility_questionnaire;return b(s,{defaultValues:p,onSubmit:m})}e(g,"EligibilityQuestionnaireStep");export{g as a};
2
+ //# sourceMappingURL=chunk-SJ5IZCJP.js.map
@@ -1,2 +1,2 @@
1
- import{a as _,b as g}from"./chunk-HOR3KPOZ.js";import{a as F}from"./chunk-SNECOPBD.js";import{g as S}from"./chunk-T7O3YYOG.js";import{b as T}from"./chunk-A232PIG7.js";import{c}from"./chunk-H2JFQGQJ.js";import{e as m}from"./chunk-VIGKOVHP.js";import{a as i}from"./chunk-P37U34EQ.js";import{Fragment as x}from"react";var d={..._,fieldset:g,"fieldset-flat":g};import{useEffect as P}from"react";import{Fragment as R,jsx as p,jsxs as h}from"react/jsx-runtime";var C=i(({name:e,description:a,helpCenter:n})=>h("span",{children:[p("span",{className:`text-xs RemoteFlows__ForcedValue__Description__${e}`,dangerouslySetInnerHTML:{__html:m(a)}}),n?.callToAction&&n?.id&&p(T,{className:"RemoteFlows__ForcedValue__HelpCenterLink",zendeskId:n.id,children:n.callToAction})]}),"Description");function k({name:e,value:a,description:n,statement:r,label:u,helpCenter:l}){let{setValue:t}=c(),s=m(r?.description||n);return P(()=>{t(e,a)},[]),p("div",{children:r?h(R,{children:[p("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${e}`,dangerouslySetInnerHTML:{__html:m(r?.title||u)}}),p(C,{name:e,description:m(r?.description||n),helpCenter:l})]}):p(C,{name:e,description:s,helpCenter:l})})}i(k,"ForcedValueField");import{Fragment as M,jsx as o,jsxs as y}from"react/jsx-runtime";function J(e){return e.const!==void 0&&e.const===e.default&&e.inputType!=="checkbox"&&e.inputType!=="hidden"}i(J,"checkFieldHasForcedValue");var G=i(({fields:e,fieldsets:a,fieldValues:n,components:r})=>{let{setValue:u}=c();if(!e||e.length===0)return null;let l=a&&n?S({fields:e,fieldsets:a,values:n}):e;return o(M,{children:l.map(t=>{if(t.calculateDynamicProperties&&(t={...t,...t.calculateDynamicProperties(n,t)||{}}),t.isVisible===!1||t.deprecated||t.hidden)return null;if(J(t))return o(k,{name:t.name,description:t.description,value:t.const,statement:t.statement,label:t.label,helpCenter:t.meta?.helpCenter},t.name);if(t.Component){let{Component:b}=t;return y(x,{children:[o(b,{setValue:V=>u(t.name,V),...t}),t.statement?o(F,{...t.statement}):null,t.extra?t.extra:null]},t.name)}let s=d[t.inputType];return s?t.inputType==="fieldset"?o(s,{...t,components:r},t.name):t.inputType==="fieldset-flat"?o(s,{...t,components:r,isFlatFieldset:!0},t.name):(t.inputType==="select"&&t.multiple&&(s=d["multi-select"]),y(x,{children:[o(s,{...t,component:r&&r[t.inputType]}),t.statement?o(F,{...t.statement}):null,t.extra?t.extra:null]},t.name)):y("p",{className:"error",children:["Field type ",t.inputType," not supported"]})})})},"JSONSchemaFormFields");export{G as a};
2
- //# sourceMappingURL=chunk-SLLDKJ7K.js.map
1
+ import{a as _,b as g}from"./chunk-SAKDBD4P.js";import{a as F}from"./chunk-SNECOPBD.js";import{g as S}from"./chunk-T7O3YYOG.js";import{b as T}from"./chunk-AK4FXJFO.js";import{c}from"./chunk-H2JFQGQJ.js";import{e as m}from"./chunk-VIGKOVHP.js";import{a as i}from"./chunk-P37U34EQ.js";import{Fragment as x}from"react";var d={..._,fieldset:g,"fieldset-flat":g};import{useEffect as P}from"react";import{Fragment as R,jsx as p,jsxs as h}from"react/jsx-runtime";var C=i(({name:e,description:a,helpCenter:n})=>h("span",{children:[p("span",{className:`text-xs RemoteFlows__ForcedValue__Description__${e}`,dangerouslySetInnerHTML:{__html:m(a)}}),n?.callToAction&&n?.id&&p(T,{className:"RemoteFlows__ForcedValue__HelpCenterLink",zendeskId:n.id,children:n.callToAction})]}),"Description");function k({name:e,value:a,description:n,statement:r,label:u,helpCenter:l}){let{setValue:t}=c(),s=m(r?.description||n);return P(()=>{t(e,a)},[]),p("div",{children:r?h(R,{children:[p("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${e}`,dangerouslySetInnerHTML:{__html:m(r?.title||u)}}),p(C,{name:e,description:m(r?.description||n),helpCenter:l})]}):p(C,{name:e,description:s,helpCenter:l})})}i(k,"ForcedValueField");import{Fragment as M,jsx as o,jsxs as y}from"react/jsx-runtime";function J(e){return e.const!==void 0&&e.const===e.default&&e.inputType!=="checkbox"&&e.inputType!=="hidden"}i(J,"checkFieldHasForcedValue");var G=i(({fields:e,fieldsets:a,fieldValues:n,components:r})=>{let{setValue:u}=c();if(!e||e.length===0)return null;let l=a&&n?S({fields:e,fieldsets:a,values:n}):e;return o(M,{children:l.map(t=>{if(t.calculateDynamicProperties&&(t={...t,...t.calculateDynamicProperties(n,t)||{}}),t.isVisible===!1||t.deprecated||t.hidden)return null;if(J(t))return o(k,{name:t.name,description:t.description,value:t.const,statement:t.statement,label:t.label,helpCenter:t.meta?.helpCenter},t.name);if(t.Component){let{Component:b}=t;return y(x,{children:[o(b,{setValue:V=>u(t.name,V),...t}),t.statement?o(F,{...t.statement}):null,t.extra?t.extra:null]},t.name)}let s=d[t.inputType];return s?t.inputType==="fieldset"?o(s,{...t,components:r},t.name):t.inputType==="fieldset-flat"?o(s,{...t,components:r,isFlatFieldset:!0},t.name):(t.inputType==="select"&&t.multiple&&(s=d["multi-select"]),y(x,{children:[o(s,{...t,component:r&&r[t.inputType]}),t.statement?o(F,{...t.statement}):null,t.extra?t.extra:null]},t.name)):y("p",{className:"error",children:["Field type ",t.inputType," not supported"]})})})},"JSONSchemaFormFields");export{G as a};
2
+ //# sourceMappingURL=chunk-SNRZPCZ7.js.map
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-Q3ALCPJN.js";import{d as u}from"./chunk-SLD227LM.js";import{j as a}from"./chunk-VIGKOVHP.js";import{a as m}from"./chunk-X6ZAR7ZL.js";import{b as d}from"./chunk-KQPDXXG3.js";import{a as n}from"./chunk-P37U34EQ.js";import w from"lodash.omit";import{jsx as b}from"react/jsx-runtime";function C({onSubmit:p,onSuccess:l,onError:e,render:f,...t}){let{components:y}=d(),{contractorOnboardingBag:r}=c(),i=u(),{mutateAsyncOrThrow:E}=m(i),v=n(async()=>{try{if(await p?.(),r.employmentId){let o=await E({employment_id:r.employmentId});await l?.({data:o,employmentStatus:"invited"}),r.refetchEmployment()}}catch(o){a(o)?e?.(w(o,"response")):e?.({error:o,rawError:o,fieldErrors:[]})}},"handleSubmit"),s=y?.button;if(!s)throw new Error("Button component not found");return b(s,{...t,disabled:i.isPending||t.disabled,onClick:o=>{v(),t.onClick?.(o)},children:f({employmentStatus:"invited"})})}n(C,"OnboardingInvite");export{C as a};
2
- //# sourceMappingURL=chunk-HYYILYKU.js.map
1
+ import{b as c}from"./chunk-Q3ALCPJN.js";import{d as u}from"./chunk-WUFJP4GG.js";import{j as a}from"./chunk-VIGKOVHP.js";import{a as m}from"./chunk-X6ZAR7ZL.js";import{b as d}from"./chunk-KQPDXXG3.js";import{a as n}from"./chunk-P37U34EQ.js";import w from"lodash.omit";import{jsx as b}from"react/jsx-runtime";function C({onSubmit:p,onSuccess:l,onError:e,render:f,...t}){let{components:y}=d(),{contractorOnboardingBag:r}=c(),i=u(),{mutateAsyncOrThrow:E}=m(i),v=n(async()=>{try{if(await p?.(),r.employmentId){let o=await E({employment_id:r.employmentId});await l?.({data:o,employmentStatus:"invited"}),r.refetchEmployment()}}catch(o){a(o)?e?.(w(o,"response")):e?.({error:o,rawError:o,fieldErrors:[]})}},"handleSubmit"),s=y?.button;if(!s)throw new Error("Button component not found");return b(s,{...t,disabled:i.isPending||t.disabled,onClick:o=>{v(),t.onClick?.(o)},children:f({employmentStatus:"invited"})})}n(C,"OnboardingInvite");export{C as a};
2
+ //# sourceMappingURL=chunk-T3GSGHZJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-TAHMDXUS.js";import{a as n}from"./chunk-VAWEOFUO.js";import{a as s}from"./chunk-HYYILYKU.js";import{a as m}from"./chunk-WD5DNUSS.js";import{a as p}from"./chunk-OB2J5WSO.js";import{a as e}from"./chunk-LJIJ6UKB.js";import{a}from"./chunk-NMLBGBK2.js";import{a as c}from"./chunk-G6QGYKPO.js";import{a as f}from"./chunk-O6IBNOQU.js";import{a as u}from"./chunk-P3QDMRCC.js";import{a as r}from"./chunk-Q3ALCPJN.js";import{a as i}from"./chunk-3474OEAS.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as I,useRef as R,useMemo as F}from"react";import{jsx as y}from"react/jsx-runtime";var H=t(({render:l,employmentId:S,externalId:g,countryCode:C,skipSteps:b,initialValues:O,options:P})=>{let o=i({options:P,employmentId:S,externalId:g,countryCode:C,skipSteps:b,initialValues:O}),v=I(),B=R(void 0),w=F(()=>({setValue:B}),[]);return y(r.Provider,{value:{contractorOnboardingBag:o,formId:v,formRef:w},children:l({contractorOnboardingBag:o,components:{BasicInformationStep:a,SelectCountryStep:e,BackButton:n,SubmitButton:m,PricingPlanStep:p,EligibilityQuestionnaireStep:d,ContractDetailsStep:c,ContractPreviewStep:f,OnboardingInvite:s,ContractReviewButton:u}})})},"ContractorOnboardingFlow");export{H as a};
2
- //# sourceMappingURL=chunk-TPGM3OIU.js.map
1
+ import{a as d}from"./chunk-SJ5IZCJP.js";import{a as n}from"./chunk-VAWEOFUO.js";import{a as s}from"./chunk-T3GSGHZJ.js";import{a as m}from"./chunk-WD5DNUSS.js";import{a as p}from"./chunk-FBWPGUBC.js";import{a as e}from"./chunk-3GYINB3B.js";import{a}from"./chunk-UPJDLAKU.js";import{a as c}from"./chunk-XFGSO4WQ.js";import{a as f}from"./chunk-GCVM3FO4.js";import{a as u}from"./chunk-P3QDMRCC.js";import{a as r}from"./chunk-Q3ALCPJN.js";import{a as i}from"./chunk-K5S6JRYY.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as I,useRef as R,useMemo as F}from"react";import{jsx as y}from"react/jsx-runtime";var H=t(({render:l,employmentId:S,externalId:g,countryCode:C,skipSteps:b,initialValues:O,options:P})=>{let o=i({options:P,employmentId:S,externalId:g,countryCode:C,skipSteps:b,initialValues:O}),v=I(),B=R(void 0),w=F(()=>({setValue:B}),[]);return y(r.Provider,{value:{contractorOnboardingBag:o,formId:v,formRef:w},children:l({contractorOnboardingBag:o,components:{BasicInformationStep:a,SelectCountryStep:e,BackButton:n,SubmitButton:m,PricingPlanStep:p,EligibilityQuestionnaireStep:d,ContractDetailsStep:c,ContractPreviewStep:f,OnboardingInvite:s,ContractReviewButton:u}})})},"ContractorOnboardingFlow");export{H as a};
2
+ //# sourceMappingURL=chunk-TMWN4PEK.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-YOIXPHGR.js";import{b as e}from"./chunk-Q3ALCPJN.js";import{k as n}from"./chunk-VIGKOVHP.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as f}from"react/jsx-runtime";function b({onSubmit:m,onSuccess:d,onError:c}){let{contractorOnboardingBag:o}=e(),p=t(async i=>{try{let a=await o.parseFormValues(i);await m?.(a);let r=await o.onSubmit(i);if(r?.data){await d?.(r?.data),o?.next();return}}catch(a){let r=n(a,o.meta?.fields?.basic_information);c?.(r)}},"handleSubmit"),l=o.stepState.values?.basic_information||o.initialValues.basic_information;return f(s,{defaultValues:l,onSubmit:p})}t(b,"BasicInformationStep");export{b as a};
2
- //# sourceMappingURL=chunk-NMLBGBK2.js.map
1
+ import{a as s}from"./chunk-URJI6IZB.js";import{b as e}from"./chunk-Q3ALCPJN.js";import{k as n}from"./chunk-VIGKOVHP.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as f}from"react/jsx-runtime";function b({onSubmit:m,onSuccess:d,onError:c}){let{contractorOnboardingBag:o}=e(),p=t(async i=>{try{let a=await o.parseFormValues(i);await m?.(a);let r=await o.onSubmit(i);if(r?.data){await d?.(r?.data),o?.next();return}}catch(a){let r=n(a,o.meta?.fields?.basic_information);c?.(r)}},"handleSubmit"),l=o.stepState.values?.basic_information||o.initialValues.basic_information;return f(s,{defaultValues:l,onSubmit:p})}t(b,"BasicInformationStep");export{b as a};
2
+ //# sourceMappingURL=chunk-UPJDLAKU.js.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-Q3ALCPJN.js";import{b as f}from"./chunk-LNV36S6D.js";import{a as u}from"./chunk-SLLDKJ7K.js";import{f as d,g as c}from"./chunk-H2JFQGQJ.js";import{a}from"./chunk-P37U34EQ.js";import{useEffect as i,useRef as C}from"react";import{jsx as F}from"react/jsx-runtime";import{createElement as S}from"react";function J({defaultValues:s,onSubmit:g,components:b}){let{formId:y,contractorOnboardingBag:o,formRef:n}=p(),m=C(s),P=f(o.handleValidation),r=d({resolver:P,defaultValues:s,shouldUnregister:!1,mode:"onBlur"});i(()=>{n?.setValue&&(n.setValue.current=r.setValue)},[r.setValue,n]),i(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),i(()=>{let t=r?.watch(e=>{Object.keys(e).some(l=>e[l]!==m.current[l])&&(o?.checkFieldUpdates(e),m.current={...e})});return()=>t?.unsubscribe()},[]);let h=a(async t=>{await g(t)},"handleSubmit");return S(c,{...r,key:`form-${o.stepState.currentStep.name}`},F("form",{id:y,onSubmit:r.handleSubmit(h),className:"space-y-4 RemoteFlows__OnboardingForm",children:F(u,{components:b,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}a(J,"ContractorOnboardingForm");export{J as a};
2
- //# sourceMappingURL=chunk-YOIXPHGR.js.map
1
+ import{b as p}from"./chunk-Q3ALCPJN.js";import{b as f}from"./chunk-LNV36S6D.js";import{a as u}from"./chunk-SNRZPCZ7.js";import{f as d,g as c}from"./chunk-H2JFQGQJ.js";import{a}from"./chunk-P37U34EQ.js";import{useEffect as i,useRef as C}from"react";import{jsx as F}from"react/jsx-runtime";import{createElement as S}from"react";function J({defaultValues:s,onSubmit:g,components:b}){let{formId:y,contractorOnboardingBag:o,formRef:n}=p(),m=C(s),P=f(o.handleValidation),r=d({resolver:P,defaultValues:s,shouldUnregister:!1,mode:"onBlur"});i(()=>{n?.setValue&&(n.setValue.current=r.setValue)},[r.setValue,n]),i(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),i(()=>{let t=r?.watch(e=>{Object.keys(e).some(l=>e[l]!==m.current[l])&&(o?.checkFieldUpdates(e),m.current={...e})});return()=>t?.unsubscribe()},[]);let h=a(async t=>{await g(t)},"handleSubmit");return S(c,{...r,key:`form-${o.stepState.currentStep.name}`},F("form",{id:y,onSubmit:r.handleSubmit(h),className:"space-y-4 RemoteFlows__OnboardingForm",children:F(u,{components:b,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}a(J,"ContractorOnboardingForm");export{J as a};
2
+ //# sourceMappingURL=chunk-URJI6IZB.js.map
@@ -1,2 +1,2 @@
1
- import{b as f}from"./chunk-MRYRNB7Y.js";import{b as l}from"./chunk-LNV36S6D.js";import{a as F}from"./chunk-SLLDKJ7K.js";import{f as s,g as a}from"./chunk-H2JFQGQJ.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as y}from"react";import{jsx as r}from"react/jsx-runtime";function A({defaultValues:u,fields:m,onSubmit:d}){let{formId:c,terminationBag:o}=f(),p=l(o.handleValidation),e=s({resolver:p,defaultValues:u,shouldUnregister:!1,mode:"onBlur"});y(()=>{let V=e?.watch(i=>{Object.keys(i).some(n=>i[n]!==o?.initialValues?.[n])&&o?.checkFieldUpdates(i)});return()=>V?.unsubscribe()},[]);let T=m||(o?.fields??[]);return r(a,{...e,children:r("form",{id:c,onSubmit:e.handleSubmit(d),className:"space-y-4 RemoteFlows__TerminationForm",children:r(F,{fields:T})})})}t(A,"TerminationForm");export{A as a};
2
- //# sourceMappingURL=chunk-BVFQ6LFD.js.map
1
+ import{b as f}from"./chunk-MRYRNB7Y.js";import{b as l}from"./chunk-LNV36S6D.js";import{a as F}from"./chunk-SNRZPCZ7.js";import{f as s,g as a}from"./chunk-H2JFQGQJ.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as y}from"react";import{jsx as r}from"react/jsx-runtime";function A({defaultValues:u,fields:m,onSubmit:d}){let{formId:c,terminationBag:o}=f(),p=l(o.handleValidation),e=s({resolver:p,defaultValues:u,shouldUnregister:!1,mode:"onBlur"});y(()=>{let V=e?.watch(i=>{Object.keys(i).some(n=>i[n]!==o?.initialValues?.[n])&&o?.checkFieldUpdates(i)});return()=>V?.unsubscribe()},[]);let T=m||(o?.fields??[]);return r(a,{...e,children:r("form",{id:c,onSubmit:e.handleSubmit(d),className:"space-y-4 RemoteFlows__TerminationForm",children:r(F,{fields:T})})})}t(A,"TerminationForm");export{A as a};
2
+ //# sourceMappingURL=chunk-V6LOIP27.js.map
@@ -1,2 +1,2 @@
1
- import{a as _}from"./chunk-5WIBTOCI.js";import{a as C}from"./chunk-UB6PYKNX.js";import{a as l}from"./chunk-EUSCQL4H.js";import{Q as f,Y as h,x as p,z as y}from"./chunk-7ENB7H4E.js";import{d as c}from"./chunk-KQPDXXG3.js";import{a as n}from"./chunk-P37U34EQ.js";import{useMutation as F}from"@tanstack/react-query";import{useQuery as u}from"@tanstack/react-query";var b=n(e=>{let{client:t}=c();return u({...e,queryKey:["company-currencies"],retry:!1,queryFn:n(async()=>{let r=await f({client:t});if(r.error||!r.data)throw new Error("Failed to fetch company currencies");return r},"queryFn"),select:n(({data:r})=>r?.data?.company_currencies.map(a=>({value:a.code,label:a.code}))||[],"select")})},"useCompanyCurrencies"),A=n(()=>{let{client:e}=c();return F({mutationFn:n(t=>h({client:e,headers:{Authorization:""},body:t,query:{action:"send_create_password_email"}}),"mutationFn")})},"useCreateCompanyRequest"),I=n(()=>{let{client:e}=c();return F({mutationFn:n(({companyId:t,payload:r,jsonSchemaVersion:a})=>p({client:e,headers:{Authorization:""},path:{company_id:t},body:r,query:{address_details_json_schema_version:a}}),"mutationFn")})},"useUpdateCompanyRequest"),P=n(e=>{let{client:t}=c(),{data:r,isLoading:a}=u({...C(t,"create-company-countries"),select:n(i=>i.data?.data?.filter(s=>s.eor_onboarding).map(s=>({label:s.name,value:s.code}))||[],"select"),enabled:e?.queryOptions?.enabled}),{data:o,isLoading:m}=b(e?.queryOptions),d=l(_.data.schema,{},e);if(r){let i=d.fields.find(s=>s.name==="country_code");i&&(i.options=r)}if(o){let i=d.fields.find(s=>s.name==="desired_currency");i&&(i.options=o)}return{isLoading:a||m,companyBasicInformationForm:d}},"useCountriesSchemaField"),U=n(({countryCode:e,fieldValues:t,options:r})=>{let{client:a}=c();return u({queryKey:["company-address-details-schema",e],retry:!1,queryFn:n(async()=>{if(!e)throw new Error("Country code is required");let o=await y({client:a,headers:{Authorization:""},path:{country_code:e,form:"address_details"},query:{json_schema_version:r?.jsonSchemaVersion?.form_schema?.address_details||"latest"}});if(o.error||!o.data)throw new Error("Failed to fetch address details schema");return o},"queryFn"),enabled:r?.queryOptions?.enabled&&!!e,select:n(({data:o})=>{let m=o?.data||{};return l(m,t,r)},"select")})},"useAddressDetailsSchema");export{A as a,I as b,P as c,U as d};
2
- //# sourceMappingURL=chunk-7WGZGAQY.js.map
1
+ import{a as _}from"./chunk-5WIBTOCI.js";import{a as C}from"./chunk-FJ6WBG3H.js";import{a as l}from"./chunk-EUSCQL4H.js";import{A as y,R as f,Z as h,y as p}from"./chunk-2IA5ZHU4.js";import{d as c}from"./chunk-KQPDXXG3.js";import{a as n}from"./chunk-P37U34EQ.js";import{useMutation as F}from"@tanstack/react-query";import{useQuery as u}from"@tanstack/react-query";var b=n(e=>{let{client:t}=c();return u({...e,queryKey:["company-currencies"],retry:!1,queryFn:n(async()=>{let r=await f({client:t});if(r.error||!r.data)throw new Error("Failed to fetch company currencies");return r},"queryFn"),select:n(({data:r})=>r?.data?.company_currencies.map(a=>({value:a.code,label:a.code}))||[],"select")})},"useCompanyCurrencies"),A=n(()=>{let{client:e}=c();return F({mutationFn:n(t=>h({client:e,headers:{Authorization:""},body:t,query:{action:"send_create_password_email"}}),"mutationFn")})},"useCreateCompanyRequest"),I=n(()=>{let{client:e}=c();return F({mutationFn:n(({companyId:t,payload:r,jsonSchemaVersion:a})=>p({client:e,headers:{Authorization:""},path:{company_id:t},body:r,query:{address_details_json_schema_version:a}}),"mutationFn")})},"useUpdateCompanyRequest"),P=n(e=>{let{client:t}=c(),{data:r,isLoading:a}=u({...C(t,"create-company-countries"),select:n(i=>i.data?.data?.filter(s=>s.eor_onboarding).map(s=>({label:s.name,value:s.code}))||[],"select"),enabled:e?.queryOptions?.enabled}),{data:o,isLoading:m}=b(e?.queryOptions),d=l(_.data.schema,{},e);if(r){let i=d.fields.find(s=>s.name==="country_code");i&&(i.options=r)}if(o){let i=d.fields.find(s=>s.name==="desired_currency");i&&(i.options=o)}return{isLoading:a||m,companyBasicInformationForm:d}},"useCountriesSchemaField"),U=n(({countryCode:e,fieldValues:t,options:r})=>{let{client:a}=c();return u({queryKey:["company-address-details-schema",e],retry:!1,queryFn:n(async()=>{if(!e)throw new Error("Country code is required");let o=await y({client:a,headers:{Authorization:""},path:{country_code:e,form:"address_details"},query:{json_schema_version:r?.jsonSchemaVersion?.form_schema?.address_details||"latest"}});if(o.error||!o.data)throw new Error("Failed to fetch address details schema");return o},"queryFn"),enabled:r?.queryOptions?.enabled&&!!e,select:n(({data:o})=>{let m=o?.data||{};return l(m,t,r)},"select")})},"useAddressDetailsSchema");export{A as a,I as b,P as c,U as d};
2
+ //# sourceMappingURL=chunk-V74BLD3D.js.map