@remoteoss/remote-flows 0.12.0 → 0.13.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 (235) hide show
  1. package/README.md +3 -3
  2. package/dist/{chunk-GAOBYAJE.js → chunk-3BREUYLG.js} +2 -2
  3. package/dist/{chunk-GAOBYAJE.js.map → chunk-3BREUYLG.js.map} +1 -1
  4. package/dist/{chunk-LT4ALDRM.js → chunk-4OKR4SU7.js} +2 -2
  5. package/dist/chunk-4OKR4SU7.js.map +1 -0
  6. package/dist/{chunk-T3L72MV6.js → chunk-4RULC3AZ.js} +1 -1
  7. package/dist/chunk-4RULC3AZ.js.map +1 -0
  8. package/dist/chunk-4XFRZVAL.js +2 -0
  9. package/dist/{chunk-DVQO5MHI.js.map → chunk-4XFRZVAL.js.map} +1 -1
  10. package/dist/{chunk-7TIIT23F.js → chunk-56JXUCOX.js} +2 -2
  11. package/dist/chunk-56JXUCOX.js.map +1 -0
  12. package/dist/{chunk-SEAC3H45.js → chunk-5EDFVFNU.js} +2 -2
  13. package/dist/chunk-5EDFVFNU.js.map +1 -0
  14. package/dist/chunk-5JT5MWOK.js +2 -0
  15. package/dist/chunk-5JT5MWOK.js.map +1 -0
  16. package/dist/{chunk-7TOZZQQJ.js → chunk-5KHLOGTR.js} +1 -1
  17. package/dist/{chunk-7TOZZQQJ.js.map → chunk-5KHLOGTR.js.map} +1 -1
  18. package/dist/{chunk-EE54SK65.js → chunk-63HVO7J5.js} +2 -2
  19. package/dist/{chunk-NPZ5QJSG.js → chunk-6YKL7EOK.js} +2 -2
  20. package/dist/chunk-6YKL7EOK.js.map +1 -0
  21. package/dist/{chunk-2AUKMWRF.js → chunk-6YN2XQWR.js} +2 -2
  22. package/dist/{chunk-LIGRV2J5.js → chunk-7JQPHRUK.js} +2 -2
  23. package/dist/{chunk-GBD3OCAW.js → chunk-7P5B6XHM.js} +2 -2
  24. package/dist/{chunk-CSK44J23.js → chunk-7VUILYZ3.js} +1 -1
  25. package/dist/{chunk-CSK44J23.js.map → chunk-7VUILYZ3.js.map} +1 -1
  26. package/dist/{chunk-52NPLMW3.js → chunk-A3OEOVEH.js} +2 -2
  27. package/dist/chunk-A3OEOVEH.js.map +1 -0
  28. package/dist/{chunk-SQICIS7B.js → chunk-A4KEKMEQ.js} +2 -2
  29. package/dist/{chunk-SQICIS7B.js.map → chunk-A4KEKMEQ.js.map} +1 -1
  30. package/dist/{chunk-77AF2QOD.js → chunk-ANXYPRBG.js} +1 -1
  31. package/dist/chunk-ANXYPRBG.js.map +1 -0
  32. package/dist/{chunk-BY5S6EQJ.js → chunk-ARKAW4ZP.js} +2 -2
  33. package/dist/{chunk-EW24LQRE.js → chunk-BI6U55BD.js} +1 -1
  34. package/dist/chunk-BI6U55BD.js.map +1 -0
  35. package/dist/{chunk-GCVZ4AY2.js → chunk-CRXPRR3R.js} +1 -1
  36. package/dist/chunk-CRXPRR3R.js.map +1 -0
  37. package/dist/{chunk-ZSBWDLBS.js → chunk-DCRLPAJL.js} +2 -2
  38. package/dist/{chunk-VD65AUOI.js → chunk-DL5PZWF7.js} +2 -2
  39. package/dist/chunk-DL5PZWF7.js.map +1 -0
  40. package/dist/{chunk-EOJJ4IWJ.js → chunk-DXABU6DZ.js} +2 -2
  41. package/dist/{chunk-BDZEPXIS.js → chunk-E5YN6OT3.js} +1 -1
  42. package/dist/chunk-E5YN6OT3.js.map +1 -0
  43. package/dist/{chunk-LLY7VPXS.js → chunk-F3BSJIHU.js} +2 -2
  44. package/dist/{chunk-ZHL2SULA.js → chunk-FH3NC6AK.js} +2 -2
  45. package/dist/chunk-FH3NC6AK.js.map +1 -0
  46. package/dist/chunk-GKT5UHG4.js +2 -0
  47. package/dist/chunk-GKT5UHG4.js.map +1 -0
  48. package/dist/{chunk-G7WJUXZU.js → chunk-GP237GUO.js} +1 -1
  49. package/dist/{chunk-G7WJUXZU.js.map → chunk-GP237GUO.js.map} +1 -1
  50. package/dist/{chunk-N7PSO5ZD.js → chunk-HEKQK6TK.js} +2 -2
  51. package/dist/{chunk-N7PSO5ZD.js.map → chunk-HEKQK6TK.js.map} +1 -1
  52. package/dist/{chunk-QI6LLU2N.js → chunk-HH6GIAMX.js} +2 -2
  53. package/dist/chunk-HH6GIAMX.js.map +1 -0
  54. package/dist/chunk-HN5HLFTB.js +2 -0
  55. package/dist/chunk-HN5HLFTB.js.map +1 -0
  56. package/dist/chunk-HSW5HMHH.js +2 -0
  57. package/dist/{chunk-R7L6CI5J.js → chunk-ITSQE6EW.js} +2 -2
  58. package/dist/{chunk-VUQOVQ5L.js → chunk-J4GIUQ4E.js} +2 -2
  59. package/dist/chunk-J4GIUQ4E.js.map +1 -0
  60. package/dist/{chunk-DOILOCWU.js → chunk-JI5BE2MZ.js} +2 -2
  61. package/dist/{chunk-DOILOCWU.js.map → chunk-JI5BE2MZ.js.map} +1 -1
  62. package/dist/{chunk-JUM2HAIK.js → chunk-JJHGVDPO.js} +2 -2
  63. package/dist/{chunk-XI3AQ3RM.js → chunk-KHNAQRGE.js} +1 -1
  64. package/dist/chunk-KHNAQRGE.js.map +1 -0
  65. package/dist/chunk-LK4XMOCE.js +2 -0
  66. package/dist/chunk-LK4XMOCE.js.map +1 -0
  67. package/dist/chunk-LUG32IOD.js +2 -0
  68. package/dist/chunk-LUG32IOD.js.map +1 -0
  69. package/dist/{chunk-2JWANM25.js → chunk-MYB6Y5FC.js} +2 -2
  70. package/dist/{chunk-SFZSHBWM.js → chunk-N7QHEESE.js} +2 -2
  71. package/dist/{chunk-SJHGFMVF.js → chunk-NH4EITYM.js} +2 -2
  72. package/dist/{chunk-CS3U6LJU.js → chunk-NQCSU6FR.js} +2 -2
  73. package/dist/{chunk-WYXN7WW6.js → chunk-NVMZDPMF.js} +2 -2
  74. package/dist/chunk-NVMZDPMF.js.map +1 -0
  75. package/dist/{chunk-ZMENI53L.js → chunk-NVQBJCNL.js} +2 -2
  76. package/dist/{chunk-ZMENI53L.js.map → chunk-NVQBJCNL.js.map} +1 -1
  77. package/dist/{chunk-Y22Q3UYU.js → chunk-OPCY3UYH.js} +2 -2
  78. package/dist/{chunk-GK3OO5SX.js → chunk-OZ63OC3N.js} +2 -2
  79. package/dist/chunk-OZ63OC3N.js.map +1 -0
  80. package/dist/{chunk-J2SFMADD.js → chunk-QDYQEQ3C.js} +2 -2
  81. package/dist/{chunk-JKYTL5QY.js → chunk-RJRLHA3V.js} +2 -2
  82. package/dist/chunk-RJRLHA3V.js.map +1 -0
  83. package/dist/{chunk-3F7QLHMP.js → chunk-RXVVLN7R.js} +2 -2
  84. package/dist/{chunk-CHSULXMN.js → chunk-TXSJL3HC.js} +1 -1
  85. package/dist/chunk-TXSJL3HC.js.map +1 -0
  86. package/dist/{chunk-Y4VNFI7K.js → chunk-U4YEXSAO.js} +2 -2
  87. package/dist/chunk-U4YEXSAO.js.map +1 -0
  88. package/dist/{chunk-5I6VWJSC.js → chunk-UHS3QRA3.js} +1 -1
  89. package/dist/chunk-UHS3QRA3.js.map +1 -0
  90. package/dist/{chunk-GJQ33XQ4.js → chunk-UPE5ZMB5.js} +2 -2
  91. package/dist/chunk-UPE5ZMB5.js.map +1 -0
  92. package/dist/{chunk-2A5R3YN2.js → chunk-VAIBLWOY.js} +1 -1
  93. package/dist/chunk-VAIBLWOY.js.map +1 -0
  94. package/dist/{chunk-R2SDR47E.js → chunk-XCZYKOZU.js} +2 -2
  95. package/dist/{chunk-4OEBYZLZ.js → chunk-XGEKV3FC.js} +2 -2
  96. package/dist/{chunk-MDSGLUUB.js → chunk-XJVYASHX.js} +1 -1
  97. package/dist/chunk-XJVYASHX.js.map +1 -0
  98. package/dist/chunk-XZRGLKXU.js +2 -0
  99. package/dist/{chunk-CSLZUVU4.js.map → chunk-XZRGLKXU.js.map} +1 -1
  100. package/dist/{chunk-AXU5ZCUE.js → chunk-ZCYSBG7R.js} +2 -2
  101. package/dist/{chunk-ILMVHOL2.js → chunk-ZE3YT3Q6.js} +1 -1
  102. package/dist/chunk-ZE3YT3Q6.js.map +1 -0
  103. package/dist/chunk-ZTDKPUB5.js +2 -0
  104. package/dist/chunk-ZTDKPUB5.js.map +1 -0
  105. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  106. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  107. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  108. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  109. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  110. package/dist/flows/ContractAmendment/context.d.ts +1 -1
  111. package/dist/flows/ContractAmendment/index.js +1 -1
  112. package/dist/flows/CostCalculator/CostCalculatorDisclaimer.js +1 -1
  113. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +2 -1
  114. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  115. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +1 -0
  116. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  117. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  118. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  119. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  120. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  121. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  122. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
  123. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  124. package/dist/flows/CostCalculator/Results/CostCalculatorIndirectTax.js +1 -1
  125. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  126. package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js +1 -1
  127. package/dist/flows/CostCalculator/Results/CostCalculatorResultsChart.js.map +1 -1
  128. package/dist/flows/CostCalculator/Results/CostCalculatorTotalCost.js +1 -1
  129. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.js +1 -1
  130. package/dist/flows/CostCalculator/api.d.ts +1 -0
  131. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  132. package/dist/flows/CostCalculator/constants.d.ts +16 -0
  133. package/dist/flows/CostCalculator/constants.js +2 -0
  134. package/dist/flows/CostCalculator/constants.js.map +1 -0
  135. package/dist/flows/CostCalculator/context.d.ts +6 -1
  136. package/dist/flows/CostCalculator/hooks.d.ts +39 -0
  137. package/dist/flows/CostCalculator/hooks.js +1 -1
  138. package/dist/flows/CostCalculator/index.d.ts +1 -0
  139. package/dist/flows/CostCalculator/index.js +1 -1
  140. package/dist/flows/CostCalculator/jsonSchema.d.ts +17 -0
  141. package/dist/flows/CostCalculator/jsonSchema.js +1 -1
  142. package/dist/flows/CostCalculator/types.d.ts +14 -1
  143. package/dist/flows/CostCalculator/utils.d.ts +2 -1
  144. package/dist/flows/CostCalculator/utils.js +1 -1
  145. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  146. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  147. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  148. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  149. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  150. package/dist/flows/Onboarding/components/EquityPriceDetails.js +1 -1
  151. package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
  152. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  153. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  154. package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
  155. package/dist/flows/Onboarding/components/SaveDraftButton.js +1 -1
  156. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  157. package/dist/flows/Onboarding/context.d.ts +1 -1
  158. package/dist/flows/Onboarding/hooks.js +1 -1
  159. package/dist/flows/Onboarding/index.js +1 -1
  160. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  161. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  162. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  163. package/dist/flows/Termination/TerminationBack.js +1 -1
  164. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  165. package/dist/flows/Termination/TerminationFlow.js +1 -1
  166. package/dist/flows/Termination/TerminationForm.js +1 -1
  167. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  168. package/dist/flows/Termination/context.d.ts +1 -1
  169. package/dist/flows/Termination/hooks.js +1 -1
  170. package/dist/flows/Termination/index.js +1 -1
  171. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  172. package/dist/index.d.ts +2 -1
  173. package/dist/index.js +1 -1
  174. package/dist/index.js.map +1 -1
  175. package/dist/internals.js +1 -1
  176. package/package.json +1 -1
  177. package/dist/chunk-2A5R3YN2.js.map +0 -1
  178. package/dist/chunk-52NPLMW3.js.map +0 -1
  179. package/dist/chunk-5CUF63YR.js +0 -2
  180. package/dist/chunk-5CUF63YR.js.map +0 -1
  181. package/dist/chunk-5I6VWJSC.js.map +0 -1
  182. package/dist/chunk-77AF2QOD.js.map +0 -1
  183. package/dist/chunk-7TIIT23F.js.map +0 -1
  184. package/dist/chunk-BDZEPXIS.js.map +0 -1
  185. package/dist/chunk-CHSULXMN.js.map +0 -1
  186. package/dist/chunk-CSLZUVU4.js +0 -2
  187. package/dist/chunk-DR7VGNO2.js +0 -2
  188. package/dist/chunk-DVQO5MHI.js +0 -2
  189. package/dist/chunk-EW24LQRE.js.map +0 -1
  190. package/dist/chunk-GCVZ4AY2.js.map +0 -1
  191. package/dist/chunk-GJQ33XQ4.js.map +0 -1
  192. package/dist/chunk-GK3OO5SX.js.map +0 -1
  193. package/dist/chunk-ILMVHOL2.js.map +0 -1
  194. package/dist/chunk-JKYTL5QY.js.map +0 -1
  195. package/dist/chunk-LT4ALDRM.js.map +0 -1
  196. package/dist/chunk-MCPVKP6Q.js +0 -2
  197. package/dist/chunk-MCPVKP6Q.js.map +0 -1
  198. package/dist/chunk-MDSGLUUB.js.map +0 -1
  199. package/dist/chunk-NPZ5QJSG.js.map +0 -1
  200. package/dist/chunk-NVJYAX22.js +0 -2
  201. package/dist/chunk-NVJYAX22.js.map +0 -1
  202. package/dist/chunk-P4C2MI7X.js +0 -2
  203. package/dist/chunk-P4C2MI7X.js.map +0 -1
  204. package/dist/chunk-QI6LLU2N.js.map +0 -1
  205. package/dist/chunk-SEAC3H45.js.map +0 -1
  206. package/dist/chunk-SUQURI2J.js +0 -2
  207. package/dist/chunk-SUQURI2J.js.map +0 -1
  208. package/dist/chunk-T3L72MV6.js.map +0 -1
  209. package/dist/chunk-VD65AUOI.js.map +0 -1
  210. package/dist/chunk-VUQOVQ5L.js.map +0 -1
  211. package/dist/chunk-WYXN7WW6.js.map +0 -1
  212. package/dist/chunk-XI3AQ3RM.js.map +0 -1
  213. package/dist/chunk-Y4VNFI7K.js.map +0 -1
  214. package/dist/chunk-ZHL2SULA.js.map +0 -1
  215. /package/dist/{chunk-EE54SK65.js.map → chunk-63HVO7J5.js.map} +0 -0
  216. /package/dist/{chunk-2AUKMWRF.js.map → chunk-6YN2XQWR.js.map} +0 -0
  217. /package/dist/{chunk-LIGRV2J5.js.map → chunk-7JQPHRUK.js.map} +0 -0
  218. /package/dist/{chunk-GBD3OCAW.js.map → chunk-7P5B6XHM.js.map} +0 -0
  219. /package/dist/{chunk-BY5S6EQJ.js.map → chunk-ARKAW4ZP.js.map} +0 -0
  220. /package/dist/{chunk-ZSBWDLBS.js.map → chunk-DCRLPAJL.js.map} +0 -0
  221. /package/dist/{chunk-EOJJ4IWJ.js.map → chunk-DXABU6DZ.js.map} +0 -0
  222. /package/dist/{chunk-LLY7VPXS.js.map → chunk-F3BSJIHU.js.map} +0 -0
  223. /package/dist/{chunk-DR7VGNO2.js.map → chunk-HSW5HMHH.js.map} +0 -0
  224. /package/dist/{chunk-R7L6CI5J.js.map → chunk-ITSQE6EW.js.map} +0 -0
  225. /package/dist/{chunk-JUM2HAIK.js.map → chunk-JJHGVDPO.js.map} +0 -0
  226. /package/dist/{chunk-2JWANM25.js.map → chunk-MYB6Y5FC.js.map} +0 -0
  227. /package/dist/{chunk-SFZSHBWM.js.map → chunk-N7QHEESE.js.map} +0 -0
  228. /package/dist/{chunk-SJHGFMVF.js.map → chunk-NH4EITYM.js.map} +0 -0
  229. /package/dist/{chunk-CS3U6LJU.js.map → chunk-NQCSU6FR.js.map} +0 -0
  230. /package/dist/{chunk-Y22Q3UYU.js.map → chunk-OPCY3UYH.js.map} +0 -0
  231. /package/dist/{chunk-J2SFMADD.js.map → chunk-QDYQEQ3C.js.map} +0 -0
  232. /package/dist/{chunk-3F7QLHMP.js.map → chunk-RXVVLN7R.js.map} +0 -0
  233. /package/dist/{chunk-R2SDR47E.js.map → chunk-XCZYKOZU.js.map} +0 -0
  234. /package/dist/{chunk-4OEBYZLZ.js.map → chunk-XGEKV3FC.js.map} +0 -0
  235. /package/dist/{chunk-AXU5ZCUE.js.map → chunk-ZCYSBG7R.js.map} +0 -0
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import"./chunk-M22FKNEY.js";import{a as sr}from"./chunk-2JWANM25.js";import"./chunk-ZSBWDLBS.js";import"./chunk-QQ7KPOLK.js";import"./chunk-R2SDR47E.js";import"./chunk-XFD3ULUF.js";import"./chunk-WWANHPT7.js";import"./chunk-DR7VGNO2.js";import"./chunk-XSHHMBMT.js";import"./chunk-JODJFARP.js";import"./chunk-W5DG5WWJ.js";import"./chunk-VX2UC3HG.js";import"./chunk-S4XU4SE7.js";import"./chunk-GULCZWSK.js";import"./chunk-JUM2HAIK.js";import"./chunk-2AUKMWRF.js";import"./chunk-SFZSHBWM.js";import"./chunk-4OEBYZLZ.js";import"./chunk-LLY7VPXS.js";import"./chunk-DOILOCWU.js";import"./chunk-MRYRNB7Y.js";import"./chunk-Z3BMF4BO.js";import{a as j}from"./chunk-52NPLMW3.js";import{a as A}from"./chunk-MCPVKP6Q.js";import"./chunk-T3L72MV6.js";import{a as D}from"./chunk-GJQ33XQ4.js";import"./chunk-BDZEPXIS.js";import"./chunk-QI6LLU2N.js";import"./chunk-7TIIT23F.js";import"./chunk-ZHL2SULA.js";import"./chunk-LT4ALDRM.js";import"./chunk-ILMVHOL2.js";import"./chunk-WYXN7WW6.js";import"./chunk-MDSGLUUB.js";import{a as lr}from"./chunk-Y22Q3UYU.js";import"./chunk-EE54SK65.js";import"./chunk-BY5S6EQJ.js";import"./chunk-LIGRV2J5.js";import"./chunk-Z7WBY27D.js";import"./chunk-7TOZZQQJ.js";import"./chunk-3F7QLHMP.js";import"./chunk-CS3U6LJU.js";import"./chunk-SJHGFMVF.js";import"./chunk-EOJJ4IWJ.js";import"./chunk-DVQO5MHI.js";import"./chunk-PGWKJ6FK.js";import"./chunk-J2SFMADD.js";import"./chunk-2A5R3YN2.js";import"./chunk-VUQOVQ5L.js";import"./chunk-F66G33YT.js";import{a as T}from"./chunk-P4C2MI7X.js";import{a as _}from"./chunk-ZMENI53L.js";import{a as E}from"./chunk-GK3OO5SX.js";import{a as B}from"./chunk-SQICIS7B.js";import"./chunk-KSHK3ZPX.js";import{b as C,d as z}from"./chunk-5CUF63YR.js";import"./chunk-JKYTL5QY.js";import{a as P}from"./chunk-NBCZF2FO.js";import"./chunk-NPZ5QJSG.js";import"./chunk-SEAC3H45.js";import"./chunk-47VYBPE2.js";import"./chunk-WVJDCDGZ.js";import{d as F}from"./chunk-5E44DBDD.js";import"./chunk-A7ZJQCNU.js";import{a as I}from"./chunk-VD65AUOI.js";import{a as S}from"./chunk-DYB3RWP7.js";import"./chunk-GCVZ4AY2.js";import"./chunk-5I6VWJSC.js";import"./chunk-Y4VNFI7K.js";import"./chunk-77AF2QOD.js";import"./chunk-Z5WMKCRJ.js";import{a as cr}from"./chunk-AXU5ZCUE.js";import{a as tr}from"./chunk-CSLZUVU4.js";import"./chunk-SUQURI2J.js";import"./chunk-CFIJKJXD.js";import"./chunk-NVJYAX22.js";import{a as er}from"./chunk-R7L6CI5J.js";import{a as nr}from"./chunk-DHT7HDHC.js";import{a as or,b as ir}from"./chunk-GGBEM452.js";import"./chunk-QW4JPW6J.js";import"./chunk-AYJ63EZH.js";import"./chunk-XI3AQ3RM.js";import"./chunk-G7WJUXZU.js";import"./chunk-CHSULXMN.js";import{a as v}from"./chunk-EGQJ7UBR.js";import"./chunk-PJBAQZ6G.js";import"./chunk-GBD3OCAW.js";import{a as u,c as h}from"./chunk-3ZWDIEEM.js";import"./chunk-CSK44J23.js";import{a as ar}from"./chunk-N7PSO5ZD.js";import"./chunk-GAOBYAJE.js";import"./chunk-MXFDOIUA.js";import"./chunk-EW24LQRE.js";import"./chunk-TVZAFTPT.js";import{c as R,d as m}from"./chunk-3LOVCTCN.js";import{a as t}from"./chunk-P37U34EQ.js";import{QueryClient as $,QueryClientProvider as G}from"@tanstack/react-query";function d(r){let a=document.documentElement;Object.keys(r).forEach(e=>{let o=r[e];o&&a.style.setProperty(e,o)})}t(d,"setCssProperties");function N(r){let a={};return Object.keys(r).forEach(e=>{a[`--${e}`]=r[e]}),a}t(N,"mapThemeColors");function O(r){return{"--spacing":r}}t(O,"mapThemeSpacing");function K(r){return{"--radius":r}}t(K,"mapThemeBorderRadius");function V(r){return{"--fontSizeBase":r.fontSizeBase}}t(V,"mapThemeFont");function w(r){r?.colors&&d(N(r.colors)),r?.spacing&&d(O(r.spacing)),r?.borderRadius&&d(K(r.borderRadius)),r?.font&&d(V(r.font))}t(w,"applyTheme");import{createContext as U,useEffect as W,useMemo as M}from"react";import{jsx as q}from"react/jsx-runtime";var L=U({theme:{}});function f(r){W(()=>{r.theme&&Object.keys(r.theme).length>0&&w(r.theme)},[r.theme]);let a=M(()=>({theme:r.theme}),[r.theme]);return q(L.Provider,{value:a,children:r.children})}t(f,"ThemeProvider");var x={partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com",sandbox:"https://gateway.remote-sandbox.com",staging:"https://gateway.niceremote.com"};import{createClient as Q}from"@hey-api/client-fetch";import{useQuery as X}from"@tanstack/react-query";import{useRef as b}from"react";function Y(r){try{return new URL(r),!0}catch{return!1}}t(Y,"isValidUrl");var y=t(({auth:r,options:a,authId:e="default"})=>{let o=b(null),{refetch:c}=X({queryKey:["auth",e],queryFn:r,enabled:!1}),s=a?.environment?x[a?.environment]:"https://gateway.remote.com",l=v.getConfig(),g="0.12.0";a?.environment&&a?.environment!=="production"&&m(g);let p=!!a?.proxy&&Y(a.proxy.url);return a?.proxy&&!p&&console.error("Invalid proxy URL provided. Using default base URL."),b(Q({...l,headers:{...l.headers,...p?a?.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":g},baseUrl:p?a.proxy?.url:s,auth:t(async()=>{function k(i){return!i||Date.now()+6e4>i}if(t(k,"hasTokenExpired"),!o.current||k(o.current.expiresAt)){let{data:i}=await c();i&&(o.current={accessToken:i.accessToken,expiresAt:Date.now()+i.expiresIn*1e3})}return o.current?.accessToken},"auth")}))},"useAuth");import{jsx as n}from"react/jsx-runtime";var H=new $;function Z({children:r,auth:a,authId:e,proxy:o,environment:c}){let s=y({auth:a,authId:e,options:{proxy:o,environment:c}});return n(h.Provider,{value:{client:s.current},children:r})}t(Z,"RemoteFlowContextWrapper");function J({children:r,components:a}){return n(u.Provider,{value:a?{components:a}:{components:{}},children:r})}t(J,"FormFieldsProvider");function rr({auth:r,authId:a,children:e,components:o,theme:c,proxy:s,environment:l}){return n(G,{client:H,children:n(J,{components:o,children:n(Z,{auth:r,authId:a,proxy:s,environment:l,children:n(f,{theme:c,children:e})})})})}t(rr,"RemoteFlows");export{ar as ContractAmendmentConfirmationForm,cr as ContractAmendmentFlow,tr as ContractAmendmentForm,er as ContractAmendmentSubmit,I as CostCalculatorDisclaimer,T as CostCalculatorFlow,_ as CostCalculatorForm,E as CostCalculatorResetButton,D as CostCalculatorResults,B as CostCalculatorSubmitButton,A as EstimationResults,lr as OnboardingFlow,rr as RemoteFlows,j as SummaryResults,sr as TerminationFlow,C as buildCostCalculatorEstimationPayload,S as disclaimerData,R as transformYupErrorsIntoObject,nr as useContractAmendment,z as useCostCalculator,F as useCostCalculatorEstimationPdf,or as useEmploymentQuery,ir as useTimeOffQuery,P as zendeskArticles};
1
+ import"./chunk-M22FKNEY.js";import{a as sr}from"./chunk-MYB6Y5FC.js";import"./chunk-F3BSJIHU.js";import"./chunk-DCRLPAJL.js";import"./chunk-QQ7KPOLK.js";import"./chunk-XCZYKOZU.js";import"./chunk-XFD3ULUF.js";import"./chunk-WWANHPT7.js";import"./chunk-HSW5HMHH.js";import"./chunk-VX2UC3HG.js";import"./chunk-XSHHMBMT.js";import"./chunk-JODJFARP.js";import"./chunk-W5DG5WWJ.js";import"./chunk-S4XU4SE7.js";import"./chunk-GULCZWSK.js";import"./chunk-JJHGVDPO.js";import"./chunk-6YN2XQWR.js";import"./chunk-N7QHEESE.js";import"./chunk-JI5BE2MZ.js";import"./chunk-XGEKV3FC.js";import"./chunk-MRYRNB7Y.js";import"./chunk-Z3BMF4BO.js";import{a as D}from"./chunk-UPE5ZMB5.js";import"./chunk-E5YN6OT3.js";import{a as j}from"./chunk-A3OEOVEH.js";import{a as A}from"./chunk-GKT5UHG4.js";import"./chunk-4RULC3AZ.js";import"./chunk-HH6GIAMX.js";import"./chunk-56JXUCOX.js";import"./chunk-FH3NC6AK.js";import"./chunk-4OKR4SU7.js";import"./chunk-ZE3YT3Q6.js";import"./chunk-NVMZDPMF.js";import"./chunk-XJVYASHX.js";import{a as lr}from"./chunk-OPCY3UYH.js";import"./chunk-RXVVLN7R.js";import"./chunk-DXABU6DZ.js";import"./chunk-63HVO7J5.js";import"./chunk-ARKAW4ZP.js";import"./chunk-7JQPHRUK.js";import"./chunk-Z7WBY27D.js";import"./chunk-5KHLOGTR.js";import"./chunk-NQCSU6FR.js";import"./chunk-NH4EITYM.js";import"./chunk-4XFRZVAL.js";import"./chunk-QDYQEQ3C.js";import"./chunk-VAIBLWOY.js";import"./chunk-J4GIUQ4E.js";import"./chunk-F66G33YT.js";import"./chunk-PGWKJ6FK.js";import{a as T}from"./chunk-5JT5MWOK.js";import{b as C,d as z}from"./chunk-LUG32IOD.js";import"./chunk-RJRLHA3V.js";import{a as P}from"./chunk-NBCZF2FO.js";import"./chunk-6YKL7EOK.js";import"./chunk-5EDFVFNU.js";import"./chunk-47VYBPE2.js";import"./chunk-WVJDCDGZ.js";import{a as _}from"./chunk-NVQBJCNL.js";import{a as E}from"./chunk-OZ63OC3N.js";import{a as B}from"./chunk-A4KEKMEQ.js";import{d as F}from"./chunk-5E44DBDD.js";import"./chunk-HN5HLFTB.js";import"./chunk-KSHK3ZPX.js";import"./chunk-A7ZJQCNU.js";import{a as I}from"./chunk-DL5PZWF7.js";import{a as S}from"./chunk-DYB3RWP7.js";import"./chunk-CRXPRR3R.js";import"./chunk-UHS3QRA3.js";import"./chunk-U4YEXSAO.js";import"./chunk-ANXYPRBG.js";import"./chunk-Z5WMKCRJ.js";import{a as cr}from"./chunk-ZCYSBG7R.js";import{a as tr}from"./chunk-XZRGLKXU.js";import"./chunk-CFIJKJXD.js";import"./chunk-LK4XMOCE.js";import"./chunk-ZTDKPUB5.js";import{a as er}from"./chunk-ITSQE6EW.js";import{a as nr}from"./chunk-DHT7HDHC.js";import{a as or,b as ir}from"./chunk-GGBEM452.js";import"./chunk-QW4JPW6J.js";import"./chunk-AYJ63EZH.js";import"./chunk-KHNAQRGE.js";import"./chunk-GP237GUO.js";import"./chunk-TXSJL3HC.js";import{a as v}from"./chunk-EGQJ7UBR.js";import"./chunk-PJBAQZ6G.js";import"./chunk-7P5B6XHM.js";import{a as u,c as h}from"./chunk-3ZWDIEEM.js";import"./chunk-7VUILYZ3.js";import{a as ar}from"./chunk-HEKQK6TK.js";import"./chunk-3BREUYLG.js";import"./chunk-MXFDOIUA.js";import"./chunk-BI6U55BD.js";import"./chunk-TVZAFTPT.js";import{c as R,d as m}from"./chunk-3LOVCTCN.js";import{a as t}from"./chunk-P37U34EQ.js";import{QueryClient as $,QueryClientProvider as G}from"@tanstack/react-query";function d(r){let a=document.documentElement;Object.keys(r).forEach(e=>{let o=r[e];o&&a.style.setProperty(e,o)})}t(d,"setCssProperties");function N(r){let a={};return Object.keys(r).forEach(e=>{a[`--${e}`]=r[e]}),a}t(N,"mapThemeColors");function O(r){return{"--spacing":r}}t(O,"mapThemeSpacing");function K(r){return{"--radius":r}}t(K,"mapThemeBorderRadius");function V(r){return{"--fontSizeBase":r.fontSizeBase}}t(V,"mapThemeFont");function w(r){r?.colors&&d(N(r.colors)),r?.spacing&&d(O(r.spacing)),r?.borderRadius&&d(K(r.borderRadius)),r?.font&&d(V(r.font))}t(w,"applyTheme");import{createContext as U,useEffect as W,useMemo as M}from"react";import{jsx as q}from"react/jsx-runtime";var L=U({theme:{}});function f(r){W(()=>{r.theme&&Object.keys(r.theme).length>0&&w(r.theme)},[r.theme]);let a=M(()=>({theme:r.theme}),[r.theme]);return q(L.Provider,{value:a,children:r.children})}t(f,"ThemeProvider");var x={partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com",sandbox:"https://gateway.remote-sandbox.com",staging:"https://gateway.niceremote.com"};import{createClient as Q}from"@hey-api/client-fetch";import{useQuery as X}from"@tanstack/react-query";import{useRef as b}from"react";function Y(r){try{return new URL(r),!0}catch{return!1}}t(Y,"isValidUrl");var y=t(({auth:r,options:a,authId:e="default"})=>{let o=b(null),{refetch:c}=X({queryKey:["auth",e],queryFn:r,enabled:!1}),s=a?.environment?x[a?.environment]:"https://gateway.remote.com",l=v.getConfig(),g="0.13.0";a?.environment&&a?.environment!=="production"&&m(g);let p=!!a?.proxy&&Y(a.proxy.url);return a?.proxy&&!p&&console.error("Invalid proxy URL provided. Using default base URL."),b(Q({...l,headers:{...l.headers,...p?a?.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":g},baseUrl:p?a.proxy?.url:s,auth:t(async()=>{function k(i){return!i||Date.now()+6e4>i}if(t(k,"hasTokenExpired"),!o.current||k(o.current.expiresAt)){let{data:i}=await c();i&&(o.current={accessToken:i.accessToken,expiresAt:Date.now()+i.expiresIn*1e3})}return o.current?.accessToken},"auth")}))},"useAuth");import{jsx as n}from"react/jsx-runtime";var H=new $;function Z({children:r,auth:a,authId:e,proxy:o,environment:c}){let s=y({auth:a,authId:e,options:{proxy:o,environment:c}});return n(h.Provider,{value:{client:s.current},children:r})}t(Z,"RemoteFlowContextWrapper");function J({children:r,components:a}){return n(u.Provider,{value:a?{components:a}:{components:{}},children:r})}t(J,"FormFieldsProvider");function rr({auth:r,authId:a,children:e,components:o,theme:c,proxy:s,environment:l}){return n(G,{client:H,children:n(J,{components:o,children:n(Z,{auth:r,authId:a,proxy:s,environment:l,children:n(f,{theme:c,children:e})})})})}t(rr,"RemoteFlows");export{ar as ContractAmendmentConfirmationForm,cr as ContractAmendmentFlow,tr as ContractAmendmentForm,er as ContractAmendmentSubmit,I as CostCalculatorDisclaimer,T as CostCalculatorFlow,_ as CostCalculatorForm,E as CostCalculatorResetButton,D as CostCalculatorResults,B as CostCalculatorSubmitButton,A as EstimationResults,lr as OnboardingFlow,rr as RemoteFlows,j as SummaryResults,sr as TerminationFlow,C as buildCostCalculatorEstimationPayload,S as disclaimerData,R as transformYupErrorsIntoObject,nr as useContractAmendment,z as useCostCalculator,F as useCostCalculatorEstimationPdf,or as useEmploymentQuery,ir as useTimeOffQuery,P as zendeskArticles};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n authId?: RemoteFlowsSDKProps['authId'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n authId,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n authId,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n authId,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n authId={authId}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n authId = 'default',\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n authId?: 'default' | 'client';\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth', authId],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"q8FAAA,OAAS,eAAAA,EAAa,uBAAAC,MAA2B,wBCUjD,SAASC,EAAiBC,EAAmC,CAC3D,IAAMC,EAAO,SAAS,gBACtB,OAAO,KAAKD,CAAS,EAAE,QAASE,GAAM,CACpC,IAAMC,EAAcH,EAAUE,CAAC,EAC3BC,GACFF,EAAK,MAAM,YAAYC,EAAGC,CAAW,CAEzC,CAAC,CACH,C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AAMZ,EAAQ,EAC3BY,IACFd,EAAQ,QAAU,CAChB,YAAac,EAAK,YAClB,UAAW,KAAK,IAAI,EAAIA,EAAK,UAAY,GAC3C,EAEJ,CACA,OAAOd,EAAQ,SAAS,WAC1B,EAdM,OAeR,CAAC,CACH,CACF,EA9DuB,WJQnB,cAAAe,MAAA,oBA1BJ,IAAMC,EAAc,IAAIC,EAUxB,SAASC,EAAyB,CAChC,SAAAC,EACA,KAAAC,EACA,OAAAC,EACA,MAAAC,EACA,YAAAC,CACF,EAAkC,CAChC,IAAMC,EAAkBC,EAAQ,CAC9B,KAAAL,EACA,OAAAC,EACA,QAAS,CACP,MAAAC,EACA,YAAAC,CACF,CACF,CAAC,EACD,OACER,EAACW,EAAkB,SAAlB,CAA2B,MAAO,CAAE,OAAQF,EAAgB,OAAQ,EAClE,SAAAL,EACH,CAEJ,CApBSQ,EAAAT,EAAA,4BAsBF,SAASU,EAAmB,CACjC,SAAAT,EACA,WAAAU,CACF,EAEI,CACF,OACEd,EAACe,EAAkB,SAAlB,CACC,MAAOD,EAAa,CAAE,WAAAA,CAAW,EAAI,CAAE,WAAY,CAAC,CAAE,EAErD,SAAAV,EACH,CAEJ,CAbgBQ,EAAAC,EAAA,sBAeT,SAASG,GAAY,CAC1B,KAAAX,EACA,OAAAC,EACA,SAAAF,EACA,WAAAU,EACA,MAAAG,EACA,MAAAV,EACA,YAAAC,CACF,EAA2C,CACzC,OACER,EAACkB,EAAA,CAAoB,OAAQjB,EAC3B,SAAAD,EAACa,EAAA,CAAmB,WAAYC,EAC9B,SAAAd,EAACG,EAAA,CACC,KAAME,EACN,OAAQC,EACR,MAAOC,EACP,YAAaC,EAEb,SAAAR,EAACmB,EAAA,CAAc,MAAOF,EAAQ,SAAAb,EAAS,EACzC,EACF,EACF,CAEJ,CAvBgBQ,EAAAI,GAAA","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","authId","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","authId","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
1
+ {"version":3,"sources":["../src/RemoteFlowsProvider.tsx","../src/lib/applyTheme.ts","../src/theme.tsx","../src/environments.ts","../src/useAuth.ts"],"sourcesContent":["import { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\nimport { ThemeProvider } from '@/src/theme';\nimport { FormFieldsContext, RemoteFlowContext } from './context';\nimport { Components, RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { useAuth } from './useAuth';\n\nconst queryClient = new QueryClient();\n\ntype RemoteFlowContextWrapperProps = {\n auth: RemoteFlowsSDKProps['auth'];\n children: React.ReactNode;\n environment?: RemoteFlowsSDKProps['environment'];\n proxy?: RemoteFlowsSDKProps['proxy'];\n authId?: RemoteFlowsSDKProps['authId'];\n};\n\nfunction RemoteFlowContextWrapper({\n children,\n auth,\n authId,\n proxy,\n environment,\n}: RemoteFlowContextWrapperProps) {\n const remoteApiClient = useAuth({\n auth,\n authId,\n options: {\n proxy,\n environment,\n },\n });\n return (\n <RemoteFlowContext.Provider value={{ client: remoteApiClient.current }}>\n {children}\n </RemoteFlowContext.Provider>\n );\n}\n\nexport function FormFieldsProvider({\n children,\n components,\n}: PropsWithChildren<{\n components?: Components;\n}>) {\n return (\n <FormFieldsContext.Provider\n value={components ? { components } : { components: {} }}\n >\n {children}\n </FormFieldsContext.Provider>\n );\n}\n\nexport function RemoteFlows({\n auth,\n authId,\n children,\n components,\n theme,\n proxy,\n environment,\n}: PropsWithChildren<RemoteFlowsSDKProps>) {\n return (\n <QueryClientProvider client={queryClient}>\n <FormFieldsProvider components={components}>\n <RemoteFlowContextWrapper\n auth={auth}\n authId={authId}\n proxy={proxy}\n environment={environment}\n >\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </RemoteFlowContextWrapper>\n </FormFieldsProvider>\n </QueryClientProvider>\n );\n}\n","import {\n CssThemeBorder,\n CssThemeColors,\n CssThemeFont,\n CssThemeSpacing,\n ThemeColors,\n ThemeFont,\n ThemeProviderProps,\n} from '@/src/types/theme';\n\nfunction setCssProperties(variables: Record<string, string>) {\n const root = document.documentElement;\n Object.keys(variables).forEach((v) => {\n const propertyVal = variables[v];\n if (propertyVal) {\n root.style.setProperty(v, propertyVal);\n }\n });\n}\n\nfunction mapThemeColors(colors: ThemeColors): CssThemeColors {\n const result: CssThemeColors = {};\n Object.keys(colors).forEach((key) => {\n result[`--${key}` as keyof CssThemeColors] =\n colors[key as keyof ThemeColors];\n });\n return result;\n}\n\nfunction mapThemeSpacing(spacing: string): CssThemeSpacing {\n return {\n '--spacing': spacing,\n };\n}\n\nfunction mapThemeBorderRadius(borderRadius: string): CssThemeBorder {\n return {\n '--radius': borderRadius,\n };\n}\n\nfunction mapThemeFont(font: ThemeFont): CssThemeFont {\n return {\n '--fontSizeBase': font.fontSizeBase,\n };\n}\n\nexport function applyTheme(theme: ThemeProviderProps['theme']) {\n if (theme?.colors) {\n setCssProperties(mapThemeColors(theme.colors));\n }\n\n if (theme?.spacing) {\n setCssProperties(mapThemeSpacing(theme.spacing));\n }\n\n if (theme?.borderRadius) {\n setCssProperties(mapThemeBorderRadius(theme.borderRadius));\n }\n\n if (theme?.font) {\n setCssProperties(mapThemeFont(theme.font));\n }\n}\n","import { applyTheme } from '@/src/lib/applyTheme';\nimport { createContext, useEffect, useMemo } from 'react';\nimport { ThemeProviderProps } from './types/theme';\n\nconst ThemeContext = createContext<Omit<ThemeProviderProps, 'children'>>({\n theme: {},\n});\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n useEffect(() => {\n if (props.theme && Object.keys(props.theme).length > 0) {\n applyTheme(props.theme);\n }\n }, [props.theme]);\n\n const value = useMemo(() => {\n return { theme: props.theme };\n }, [props.theme]);\n\n return (\n <ThemeContext.Provider value={value}>\n {props.children}\n </ThemeContext.Provider>\n );\n}\n","export const ENVIRONMENTS = {\n partners: 'https://gateway.partners.remote-sandbox.com',\n production: 'https://gateway.remote.com',\n sandbox: 'https://gateway.remote-sandbox.com',\n staging: 'https://gateway.niceremote.com',\n};\n","import { client } from '@/src/client/client.gen';\nimport { ENVIRONMENTS } from '@/src/environments';\nimport { createClient } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\nimport { useRef } from 'react';\nimport { RemoteFlowsSDKProps } from './types/remoteFlows';\nimport { debug } from './lib/utils';\n\ntype AuthResponse = {\n accessToken: string;\n expiresIn: number;\n};\n\ntype Options = Partial<{\n environment: keyof typeof ENVIRONMENTS;\n proxy: RemoteFlowsSDKProps['proxy'];\n}>;\n\nfunction isValidUrl(url: string) {\n try {\n new URL(url);\n return true;\n } catch {\n return false;\n }\n}\n\nexport const useAuth = ({\n auth,\n options,\n authId = 'default',\n}: {\n auth: () => Promise<AuthResponse>;\n options?: Options;\n authId?: 'default' | 'client';\n}) => {\n const session = useRef<{ accessToken: string; expiresAt: number } | null>(\n null,\n );\n const { refetch } = useQuery({\n queryKey: ['auth', authId],\n queryFn: auth,\n enabled: false,\n });\n\n const baseUrl = options?.environment\n ? ENVIRONMENTS[options?.environment]\n : process.env.REMOTE_GATEWAY_URL;\n\n const clientConfig = client.getConfig();\n const npmPackageVersion = process.env.VERSION || 'unknown';\n\n if (options?.environment && options?.environment !== 'production') {\n debug(npmPackageVersion);\n }\n\n const isValidProxy = !!options?.proxy && isValidUrl(options.proxy.url);\n\n if (options?.proxy && !isValidProxy) {\n console.error('Invalid proxy URL provided. Using default base URL.');\n }\n\n return useRef(\n createClient({\n ...clientConfig,\n headers: {\n ...clientConfig.headers,\n ...(isValidProxy ? options?.proxy?.headers : {}),\n 'X-Client-Name': 'remote-flows-sdk',\n 'X-Client-Version': npmPackageVersion,\n },\n baseUrl: isValidProxy ? options.proxy?.url : baseUrl,\n auth: async () => {\n function hasTokenExpired(expiresAt: number | undefined) {\n return !expiresAt || Date.now() + 60000 > expiresAt;\n }\n if (!session.current || hasTokenExpired(session.current.expiresAt)) {\n const { data } = await refetch();\n if (data) {\n session.current = {\n accessToken: data.accessToken,\n expiresAt: Date.now() + data.expiresIn * 1000,\n };\n }\n }\n return session.current?.accessToken;\n },\n }),\n );\n};\n"],"mappings":"i+FAAA,OAAS,eAAAA,EAAa,uBAAAC,MAA2B,wBCUjD,SAASC,EAAiBC,EAAmC,CAC3D,IAAMC,EAAO,SAAS,gBACtB,OAAO,KAAKD,CAAS,EAAE,QAASE,GAAM,CACpC,IAAMC,EAAcH,EAAUE,CAAC,EAC3BC,GACFF,EAAK,MAAM,YAAYC,EAAGC,CAAW,CAEzC,CAAC,CACH,CARSC,EAAAL,EAAA,oBAUT,SAASM,EAAeC,EAAqC,CAC3D,IAAMC,EAAyB,CAAC,EAChC,cAAO,KAAKD,CAAM,EAAE,QAASE,GAAQ,CACnCD,EAAO,KAAKC,CAAG,EAA0B,EACvCF,EAAOE,CAAwB,CACnC,CAAC,EACMD,CACT,CAPSH,EAAAC,EAAA,kBAST,SAASI,EAAgBC,EAAkC,CACzD,MAAO,CACL,YAAaA,CACf,CACF,CAJSN,EAAAK,EAAA,mBAMT,SAASE,EAAqBC,EAAsC,CAClE,MAAO,CACL,WAAYA,CACd,CACF,CAJSR,EAAAO,EAAA,wBAMT,SAASE,EAAaC,EAA+B,CACnD,MAAO,CACL,iBAAkBA,EAAK,YACzB,CACF,CAJSV,EAAAS,EAAA,gBAMF,SAASE,EAAWC,EAAoC,CACzDA,GAAO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,SAAAL,EACH,CAEJ,CApBSQ,EAAAT,EAAA,4BAsBF,SAASU,EAAmB,CACjC,SAAAT,EACA,WAAAU,CACF,EAEI,CACF,OACEd,EAACe,EAAkB,SAAlB,CACC,MAAOD,EAAa,CAAE,WAAAA,CAAW,EAAI,CAAE,WAAY,CAAC,CAAE,EAErD,SAAAV,EACH,CAEJ,CAbgBQ,EAAAC,EAAA,sBAeT,SAASG,GAAY,CAC1B,KAAAX,EACA,OAAAC,EACA,SAAAF,EACA,WAAAU,EACA,MAAAG,EACA,MAAAV,EACA,YAAAC,CACF,EAA2C,CACzC,OACER,EAACkB,EAAA,CAAoB,OAAQjB,EAC3B,SAAAD,EAACa,EAAA,CAAmB,WAAYC,EAC9B,SAAAd,EAACG,EAAA,CACC,KAAME,EACN,OAAQC,EACR,MAAOC,EACP,YAAaC,EAEb,SAAAR,EAACmB,EAAA,CAAc,MAAOF,EAAQ,SAAAb,EAAS,EACzC,EACF,EACF,CAEJ,CAvBgBQ,EAAAI,GAAA","names":["QueryClient","QueryClientProvider","setCssProperties","variables","root","v","propertyVal","__name","mapThemeColors","colors","result","key","mapThemeSpacing","spacing","mapThemeBorderRadius","borderRadius","mapThemeFont","font","applyTheme","theme","createContext","useEffect","useMemo","jsx","ThemeContext","createContext","ThemeProvider","props","useEffect","applyTheme","value","useMemo","__name","ENVIRONMENTS","createClient","useQuery","useRef","isValidUrl","url","__name","useAuth","auth","options","authId","session","useRef","refetch","useQuery","baseUrl","ENVIRONMENTS","clientConfig","client","npmPackageVersion","debug","isValidProxy","createClient","hasTokenExpired","expiresAt","data","jsx","queryClient","QueryClient","RemoteFlowContextWrapper","children","auth","authId","proxy","environment","remoteApiClient","useAuth","RemoteFlowContext","__name","FormFieldsProvider","components","FormFieldsContext","RemoteFlows","theme","QueryClientProvider","ThemeProvider"]}
package/dist/internals.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as q,b as y,c as z,d as E}from"./chunk-GCVZ4AY2.js";import{a as F,b as G,c as L,d as h,e as k,f as j}from"./chunk-5I6VWJSC.js";import{a as N}from"./chunk-Y4VNFI7K.js";import{a as l,b as i,d as a,e as p,f as n}from"./chunk-77AF2QOD.js";import{a as C,b as m,c as b,d as x,e as f,f as D,g as T,i as c,j as d,k as u,l as w,m as P,n as A,o as H,p as I,q as R,r as V,s as B}from"./chunk-XI3AQ3RM.js";import{a as S,b as v}from"./chunk-G7WJUXZU.js";import{a as t}from"./chunk-CHSULXMN.js";import"./chunk-EGQJ7UBR.js";import"./chunk-3ZWDIEEM.js";import{a as s,b as g}from"./chunk-CSK44J23.js";import{a as o}from"./chunk-EW24LQRE.js";import{a as r}from"./chunk-3LOVCTCN.js";import"./chunk-P37U34EQ.js";import*as e from"@radix-ui/react-collapsible";var J=e.Root,K=e.CollapsibleTrigger,M=e.CollapsibleContent;export{m as Alert,x as AlertDescription,b as AlertTitle,v as Badge,g as Button,F as Card,k as CardContent,h as CardDescription,j as CardFooter,G as CardHeader,L as CardTitle,C as Checkbox,J as Collapsible,M as CollapsibleContent,K as CollapsibleTrigger,P as Dialog,H as DialogContent,B as DialogDescription,R as DialogFooter,I as DialogHeader,V as DialogTitle,A as DialogTrigger,l as Drawer,a as DrawerContent,p as DrawerHeader,n as DrawerTitle,i as DrawerTrigger,t as Input,o as Label,f as RadioGroup,D as RadioGroupItem,T as Select,u as SelectContent,w as SelectItem,d as SelectTrigger,c as SelectValue,q as Tabs,E as TabsContent,y as TabsList,z as TabsTrigger,N as ZendeskTriggerButton,S as badgeVariants,s as buttonVariants,r as cn};
1
+ import{a as q,b as y,c as z,d as E}from"./chunk-CRXPRR3R.js";import{a as F,b as G,c as L,d as h,e as k,f as j}from"./chunk-UHS3QRA3.js";import{a as N}from"./chunk-U4YEXSAO.js";import{a as l,b as i,d as a,e as p,f as n}from"./chunk-ANXYPRBG.js";import{a as C,b as m,c as b,d as x,e as f,f as D,g as T,i as c,j as d,k as u,l as w,m as P,n as A,o as H,p as I,q as R,r as V,s as B}from"./chunk-KHNAQRGE.js";import{a as S,b as v}from"./chunk-GP237GUO.js";import{a as t}from"./chunk-TXSJL3HC.js";import"./chunk-EGQJ7UBR.js";import"./chunk-3ZWDIEEM.js";import{a as s,b as g}from"./chunk-7VUILYZ3.js";import{a as o}from"./chunk-BI6U55BD.js";import{a as r}from"./chunk-3LOVCTCN.js";import"./chunk-P37U34EQ.js";import*as e from"@radix-ui/react-collapsible";var J=e.Root,K=e.CollapsibleTrigger,M=e.CollapsibleContent;export{m as Alert,x as AlertDescription,b as AlertTitle,v as Badge,g as Button,F as Card,k as CardContent,h as CardDescription,j as CardFooter,G as CardHeader,L as CardTitle,C as Checkbox,J as Collapsible,M as CollapsibleContent,K as CollapsibleTrigger,P as Dialog,H as DialogContent,B as DialogDescription,R as DialogFooter,I as DialogHeader,V as DialogTitle,A as DialogTrigger,l as Drawer,a as DrawerContent,p as DrawerHeader,n as DrawerTitle,i as DrawerTrigger,t as Input,o as Label,f as RadioGroup,D as RadioGroupItem,T as Select,u as SelectContent,w as SelectItem,d as SelectTrigger,c as SelectValue,q as Tabs,E as TabsContent,y as TabsList,z as TabsTrigger,N as ZendeskTriggerButton,S as badgeVariants,s as buttonVariants,r as cn};
2
2
  //# sourceMappingURL=internals.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remoteoss/remote-flows",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "scripts": {
5
5
  "build": "NODE_ENV=production tsup",
6
6
  "ci": "npm run build && npm run check-format && npm run check-exports && npm run lint && npm run test",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/Onboarding/components/EquityPriceDetails.tsx"],"sourcesContent":["const formatMoney = (amount: number, currency: string) => {\n return `${amount} ${currency}`;\n};\n\ntype Cost = {\n currency: string;\n amount: number;\n};\n\ntype EquityPriceDetailsProps = {\n offerEquity: 'yes' | 'no' | null;\n equityCost?: {\n original: Cost;\n discount?: Cost;\n\n calculated?: Cost;\n };\n};\n\nexport const EquityPriceDetails = ({\n offerEquity,\n equityCost,\n}: EquityPriceDetailsProps) => {\n const offersEquity = offerEquity === 'yes';\n const isFeeWaived = !!equityCost?.discount;\n const formattedWaivedPrice =\n equityCost && equityCost.original\n ? formatMoney(equityCost.original.amount, equityCost.original.currency)\n : null;\n const formattedPrice =\n equityCost && equityCost.calculated\n ? formatMoney(\n equityCost.calculated.amount,\n equityCost.calculated.currency,\n )\n : null;\n\n if (!offersEquity || !equityCost) {\n return null;\n }\n\n return (\n <div className=\"RemoteFlows__EquityPriceDetails\">\n <span className=\"RemoteFlows__Equity__Price\">\n A monthly fee of{' '}\n <strong>\n {isFeeWaived ? (\n <>\n <s>{formattedWaivedPrice}</s> {formattedPrice}\n </>\n ) : (\n formattedPrice\n )}{' '}\n will apply.\n </strong>\n </span>\n <span className=\"RemoteFlows__Equity__Fee\">\n This is a fee for managing equity through Remote.\n </span>\n <span className=\"RemoteFlows__Equity__Reporting\">\n To fulfill local reporting obligations, Remote must note any equity\n grants made and any related taxable events, such as exercising stock\n options and RSU vesting.\n </span>\n </div>\n );\n};\n"],"mappings":"wCA+CY,mBAAAA,EACE,OAAAC,EADF,QAAAC,MAAA,oBA/CZ,IAAMC,EAAcC,EAAA,CAACC,EAAgBC,IAC5B,GAAGD,CAAM,IAAIC,CAAQ,GADV,eAmBPC,EAAqBH,EAAA,CAAC,CACjC,YAAAI,EACA,WAAAC,CACF,IAA+B,CAC7B,IAAMC,EAAeF,IAAgB,MAC/BG,EAAc,CAAC,CAACF,GAAY,SAC5BG,EACJH,GAAcA,EAAW,SACrBN,EAAYM,EAAW,SAAS,OAAQA,EAAW,SAAS,QAAQ,EACpE,KACAI,EACJJ,GAAcA,EAAW,WACrBN,EACEM,EAAW,WAAW,OACtBA,EAAW,WAAW,QACxB,EACA,KAEN,MAAI,CAACC,GAAgB,CAACD,EACb,KAIPP,EAAC,OAAI,UAAU,kCACb,UAAAA,EAAC,QAAK,UAAU,6BAA6B,6BAC1B,IACjBA,EAAC,UACE,UAAAS,EACCT,EAAAF,EAAA,CACE,UAAAC,EAAC,KAAG,SAAAW,EAAqB,EAAI,IAAEC,GACjC,EAEAA,EACC,IAAI,eAET,GACF,EACAZ,EAAC,QAAK,UAAU,2BAA2B,6DAE3C,EACAA,EAAC,QAAK,UAAU,iCAAiC,6KAIjD,GACF,CAEJ,EA/CkC","names":["Fragment","jsx","jsxs","formatMoney","__name","amount","currency","EquityPriceDetails","offerEquity","equityCost","offersEquity","isFeeWaived","formattedWaivedPrice","formattedPrice"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/CostCalculator/SummaryResults/SummaryResults.tsx"],"sourcesContent":["import { CostCalculatorEmployment, Currency } from '@/src/client';\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from '@/src/components/ui/accordion';\nimport { Card } from '@/src/components/ui/card';\nimport { cn, formatCurrency } from '@/src/lib/utils';\nimport { ChevronDown, Globe } from 'lucide-react';\nimport { useState } from 'react';\n\nconst useSummaryResults = (estimations: CostCalculatorEmployment[]) => {\n if (estimations.length < 2) {\n return {\n currency: null,\n costsPerCountry: [],\n employeesCost: null,\n };\n }\n const currency = estimations[0]?.employer_currency_costs.currency;\n const costsPerCountry = estimations.reduce(\n (acc, estimation) => {\n const countryName = estimation.country.name;\n\n acc[countryName] = {\n country: estimation.country,\n monthlyTotal:\n (acc[countryName]?.monthlyTotal || 0) +\n estimation.employer_currency_costs.monthly_total,\n annualTotal:\n (acc[countryName]?.annualTotal || 0) +\n estimation.employer_currency_costs.annual_total,\n };\n\n return acc;\n },\n {} as Record<\n string,\n {\n country: (typeof estimations)[0]['country'];\n monthlyTotal: number;\n annualTotal: number;\n }\n >,\n );\n\n const groupedCostsPerCountry = Object.values(costsPerCountry).map(\n ({ country, monthlyTotal, annualTotal }) => ({\n country,\n monthlyCost: formatCurrency(monthlyTotal, currency.symbol),\n annualCost: formatCurrency(annualTotal, currency.symbol),\n }),\n );\n\n const employeesCost = {\n monthlyTotal: formatCurrency(\n estimations.reduce((acc, estimation) => {\n return acc + estimation.employer_currency_costs.monthly_total;\n }, 0),\n currency.symbol,\n ),\n annualTotal: formatCurrency(\n estimations.reduce((acc, estimation) => {\n return acc + estimation.employer_currency_costs.annual_total;\n }, 0),\n currency.symbol,\n ),\n };\n return { currency, costsPerCountry: groupedCostsPerCountry, employeesCost };\n};\n\nconst SummaryHeader = ({\n currency,\n title,\n}: {\n currency: Currency;\n title: string;\n}) => {\n return (\n <div className=\"flex items-center justify-between w-full\">\n <div className=\"flex flex-row items-center gap-6\">\n <div className=\"flex h-12 w-12 items-center justify-center rounded-lg bg-[#F4F4F5]\">\n <Globe className=\"h-6 w-6 text-[#000000]\" />\n </div>\n <div className=\"space-y-1\">\n <h2 className=\"text-lg font-medium leading-none text-[#181818]\">\n {title}\n </h2>\n <p className=\"text-xs text-[#71717A]\">\n Employer billing currency: {currency.code}\n </p>\n </div>\n </div>\n </div>\n );\n};\n\nconst MultiColumnAccordion = ({\n label,\n columns,\n rows,\n defaultValue = 'accordion',\n className,\n}: {\n label: React.ReactNode;\n columns: string[];\n rows: Array<{\n label: React.ReactNode;\n values: string[];\n }>;\n defaultValue?: string;\n className?: string;\n}) => {\n const gridCols = columns.length === 1 ? 'grid-cols-2' : 'grid-cols-3';\n\n return (\n <Accordion\n type=\"single\"\n collapsible\n defaultValue={defaultValue}\n className={cn('w-full', className)}\n >\n <AccordionItem value={defaultValue} className=\"border-none\">\n <AccordionTrigger className=\"hover:no-underline px-0 py-3 [&>svg]:hidden group\">\n <div className={cn('grid items-center w-full', gridCols)}>\n <div className=\"flex items-center gap-2\">\n {label}\n <ChevronDown className=\"h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180\" />\n </div>\n {columns.length === 1 ? (\n <span className=\"text-xs text-[#27272A] text-right\">\n {columns[0]}\n </span>\n ) : (\n columns.map((column, index) => (\n <span key={index} className=\"text-xs text-[#27272A] text-right\">\n {column}\n </span>\n ))\n )}\n </div>\n </AccordionTrigger>\n\n <AccordionContent className=\"px-0 pb-4\">\n <div className=\"space-y-3\">\n {rows.map((row, index) => (\n <div key={index} className={cn('grid items-center', gridCols)}>\n <div className=\"flex items-center gap-2\">{row.label}</div>\n {columns.length === 1 ? (\n <span className=\"text-sm text-[#09090B] text-right\">\n {row.values[0]}\n </span>\n ) : (\n row.values.map((value, valueIndex) => (\n <span\n key={valueIndex}\n className=\"text-sm text-[#09090B] text-right\"\n >\n {value}\n </span>\n ))\n )}\n </div>\n ))}\n </div>\n </AccordionContent>\n </AccordionItem>\n </Accordion>\n );\n};\n\nconst CostForAllEmployees = ({\n employeesCost,\n}: {\n employeesCost: { monthlyTotal: string; annualTotal: string };\n}) => {\n return (\n <MultiColumnAccordion\n label={\n <span className=\"text-sm font-medium text-[#0F172A]\">\n Cost for all employees\n </span>\n }\n columns={['Total cost']}\n rows={[\n {\n label: (\n <>\n <span className=\"w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0\" />\n <span className=\"text-sm text-[#09090B]\">Monthly cost</span>\n </>\n ),\n values: [employeesCost.monthlyTotal],\n },\n {\n label: (\n <>\n <span className=\"w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0\" />\n <span className=\"text-sm text-[#09090B]\">Annual cost</span>\n </>\n ),\n values: [employeesCost.annualTotal],\n },\n ]}\n defaultValue=\"cost-breakdown\"\n />\n );\n};\n\nconst CostsPerCountry = ({\n costsPerCountry,\n}: {\n costsPerCountry: Array<{\n country: { name: string };\n monthlyCost: string;\n annualCost: string;\n }>;\n}) => {\n return (\n <MultiColumnAccordion\n label={\n <span className=\"text-sm font-medium text-[#0F172A]\">\n Cost per country\n </span>\n }\n columns={['Monthly cost', 'Annual cost']}\n rows={costsPerCountry.map((cost) => ({\n label: (\n <>\n <span className=\"w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0\" />\n <span className=\"text-sm text-[#09090B]\">{cost.country.name}</span>\n </>\n ),\n values: [cost.monthlyCost, cost.annualCost],\n }))}\n defaultValue=\"country-breakdown\"\n />\n );\n};\n\ntype SummaryResultsProps = {\n /**\n * Array of employments to compare costs for.\n * 2 estimations required for the component to render\n */\n estimations: CostCalculatorEmployment[];\n};\n\n/**\n * Displays a summary comparison of costs across multiple estimations.\n * The component will return null if you pass less than 2 estimations.\n */\nexport const SummaryResults = ({ estimations }: SummaryResultsProps) => {\n const { currency, costsPerCountry, employeesCost } =\n useSummaryResults(estimations);\n\n const [accordionValue, setAccordionValue] = useState('summary');\n\n if (\n !currency ||\n costsPerCountry.length === 0 ||\n Object.keys(employeesCost).length === 0\n ) {\n return null;\n }\n\n return (\n <Card className=\"RemoteFlows__SummaryResults__Card p-10\">\n <Accordion\n type=\"single\"\n collapsible\n defaultValue={accordionValue}\n onValueChange={setAccordionValue}\n className=\"RemoteFlows__SummaryResults__Accordion w-full\"\n >\n <AccordionItem value=\"summary\" className=\"border-border\">\n <div\n className={cn({\n RemoteFlows__Separator: accordionValue === 'summary',\n })}\n >\n <AccordionTrigger\n iconClassName=\"size-6\"\n className=\"hover:no-underline px-0 py-4\"\n >\n <SummaryHeader currency={currency} title=\"Summary Overview\" />\n </AccordionTrigger>\n </div>\n <AccordionContent className=\"px-0 pb-4 mt-6\">\n <div className=\"RemoteFlows__Separator\">\n <CostForAllEmployees employeesCost={employeesCost} />\n </div>\n <div className=\"mt-6\">\n <CostsPerCountry costsPerCountry={costsPerCountry} />\n </div>\n </AccordionContent>\n </AccordionItem>\n </Accordion>\n </Card>\n );\n};\n"],"mappings":"4LASA,OAAS,eAAAA,EAAa,SAAAC,MAAa,eACnC,OAAS,YAAAC,MAAgB,QAyEf,OAyGE,YAAAC,EAzGF,OAAAC,EAMA,QAAAC,MANA,oBAvEV,IAAMC,EAAoBC,EAACC,GAA4C,CACrE,GAAIA,EAAY,OAAS,EACvB,MAAO,CACL,SAAU,KACV,gBAAiB,CAAC,EAClB,cAAe,IACjB,EAEF,IAAMC,EAAWD,EAAY,CAAC,GAAG,wBAAwB,SACnDE,EAAkBF,EAAY,OA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,SAAAzC,EAAC6B,EAAA,CACC,cAAc,SACd,UAAU,+BAEV,SAAA7B,EAACgB,EAAA,CAAc,SAAUX,EAAU,MAAM,mBAAmB,EAC9D,EACF,EACAJ,EAACgC,EAAA,CAAiB,UAAU,iBAC1B,UAAAjC,EAAC,OAAI,UAAU,yBACb,SAAAA,EAACqC,EAAA,CAAoB,cAAetB,EAAe,EACrD,EACAf,EAAC,OAAI,UAAU,OACb,SAAAA,EAACsC,EAAA,CAAgB,gBAAiBhC,EAAiB,EACrD,GACF,GACF,EACF,EACF,CAEJ,EAhD8B","names":["ChevronDown","Globe","useState","Fragment","jsx","jsxs","useSummaryResults","__name","estimations","currency","costsPerCountry","acc","estimation","countryName","groupedCostsPerCountry","country","monthlyTotal","annualTotal","formatCurrency","employeesCost","SummaryHeader","title","Globe","MultiColumnAccordion","label","columns","rows","defaultValue","className","gridCols","Accordion","cn","AccordionItem","AccordionTrigger","ChevronDown","column","index","AccordionContent","row","value","valueIndex","CostForAllEmployees","CostsPerCountry","cost","SummaryResults","accordionValue","setAccordionValue","useState","Card"]}
@@ -1,2 +0,0 @@
1
- import{a as H}from"./chunk-JKYTL5QY.js";import{a as T}from"./chunk-NPZ5QJSG.js";import{a as U,b as G,c as $,e as z}from"./chunk-5E44DBDD.js";import{a as q}from"./chunk-CFIJKJXD.js";import{c as F}from"./chunk-MXFDOIUA.js";import{a as n}from"./chunk-P37U34EQ.js";import{object as ye}from"yup";import{createHeadlessForm as le,modify as ce}from"@remoteoss/json-schema-form";import{useCallback as ue,useEffect as I,useMemo as me,useState as v}from"react";import{string as N,ValidationError as D}from"yup";import{jsx as fe}from"react/jsx-runtime";var A={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeManagementFee:!1},de=n(t=>{let{schema:s}=ce(T.data.schema,t?.jsfModify||{});return le(s)},"useStaticSchema"),je=n(({defaultRegion:t,defaultCurrency:s,defaultSalary:a,estimationOptions:o,options:i,version:g}={estimationOptions:A})=>{let[w,E]=v(t),[j,R]=v(),[u,J]=v(),{data:d,isLoading:W}=U({includePremiumBenefits:o.includePremiumBenefits}),{data:f,isLoading:X}=G(),Y=w||j?.value,{data:P,isLoading:Z}=z(Y,{includePremiumBenefits:o.includePremiumBenefits,options:i}),L=$(),m=j?.currency,y=i?.jsfModify?.fields?.salary,S=y&&typeof y=="object"&&"presentation"in y?y.presentation:void 0,ee=ue(()=>{let e=m&&u?m!==u:!1;return m!==u?{from:u,to:m,shouldSwapOrder:e}:{from:m,to:u,shouldSwapOrder:e}},[m,u]),re=me(()=>{let{from:e,to:r,shouldSwapOrder:l}=ee();return{fields:{salary:{...y,presentation:{salary_conversion_properties:{label:S?.salary_conversion_properties?.label,description:S?.salary_conversion_properties?.description},currencies:{from:e,to:r},Component:n(c=>fe(H,{...c,shouldSwapOrder:l,conversionType:g==="marketing"?"no_spread":"spread",defaultValue:a}),"Component")}}}}},[m,u,y,S?.salary_conversion_properties?.description,S?.salary_conversion_properties?.label]),p=de({jsfModify:{fields:{...i?.jsfModify?.fields,...re?.fields}}});I(()=>{if(t&&d){let e=d.find(({value:r})=>r===t);e&&R(e)}},[t,d]),I(()=>{if(s&&f){let e=f.find(({value:r})=>r===s);e&&J(e.label)}},[s,f]);async function te(e){try{await O.validate(e,{abortEarly:!1})}catch(r){return{data:null,error:r}}return new Promise((r,l)=>{L.mutate(Q(e,o,g),{onSuccess:n(c=>{c.data?r({data:c.data,error:null}):r({data:null,error:new Error("Something went wrong. Please try again later.")})},"onSuccess"),onError:n(c=>{l({data:null,error:c})},"onError")})})}n(te,"onSubmit");function ne(e){let r=d?.find(({value:l})=>l===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?E(r.regionSlug):E(void 0),R(r)}n(ne,"onCountryChange");function oe(e){E(e)}n(oe,"onRegionChange");function se(e){let r=f?.find(l=>l.value===e)?.label;J(r)}n(se,"onChangeCurrency");let C=p.fields.find(e=>e.name==="region");if(C){let e=j?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];C.options=e,C.isVisible=e.length>0,C.required=e.length>0,C.onChange=oe,C.schema=e.length>0?N().transform(r=>typeof r=="string"?r:"").required("Region is required"):N()}if(f){let e=p.fields.find(r=>r.name==="currency");e&&(e.options=f,e.onChange=se)}if(d){let e=p.fields.find(r=>r.name==="country");e&&(e.options=d,e.onChange=ne)}let ie=n(()=>{R(void 0),E(t)},"resetForm"),k=[...p.fields,...P?.fields||[]],O=K(p.fields);async function ae(e){let r=null,l=F(e,k);try{await O.validate(l,{abortEarly:!1}),r={formErrors:{},yupError:new D([],e)}}catch(_){let V=q(_);r={formErrors:Object.entries(V).reduce((x,[M,B])=>({...x,[M]:B.message}),{}),yupError:_}}let c=P?.handleValidation(l),b=[...r?.yupError.inner||[],...c?.yupError?.inner||[]],h={...r?.yupError?.value||{},...c?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...c?.formErrors||{}},yupError:new D(b,h)}}return n(ae,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:k,validationSchema:O,parseFormValues:n(e=>{let{country:r,region:l,currency:c,salary_converted:b,salary_conversion:h,..._}=e,V=e.salary;b==="salary_conversion"&&(V=h);let M=F({country:r,region:l,salary:V,salary_converted:b,salary_conversion:h,currency:c},p.fields),B=F(_,P?.fields||[]);return{...M,...B}},"parseFormValues"),handleValidation:ae,isSubmitting:L.isPending,isLoading:W&&X&&Z,onSubmit:te,resetForm:ie}},"useCostCalculator");function K(t){let s=t.reduce((a,o)=>{return o.name==="salary"||o.name==="salary_conversion"?a[o.name]=o.schema.when("salary_converted",{is:n(i=>i===o.name,"is"),then:n(i=>i.required("Salary is required"),"then"),otherwise:n(i=>i.optional(),"otherwise")}):a[o.name]=o.schema,a;return a},{});return ye(s)}n(K,"buildValidationSchema");function pe(t){let s="benefit-";return Object.keys(t).reduce((a,o)=>{let i=t[o];if(i==="none")return a;let w={benefit_group_slug:o.replace(s,""),benefit_tier_slug:i};return[...a,w]},[])}n(pe,"formatBenefits");function Ce(t,s,a){return{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:s.title,age:t.age??void 0,...t.benefits&&{benefits:pe(t.benefits)},...(a=="marketing"||t.salary_converted==="salary_conversion")&&{annual_gross_salary_in_employer_currency:t.salary},...a==="standard"&&t.salary_converted==="salary"&&{annual_gross_salary:t.salary}}}n(Ce,"mapValueToEmployment");function Q(t,s=A,a="standard"){let o=Array.isArray(t)?t:[t];if(o.length===0)throw new Error("At least one employment value is required");return o.length>1&&new Set(o.map(g=>g.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:o[0].currency,include_benefits:s.includeBenefits,include_cost_breakdowns:s.includeCostBreakdowns,include_premium_benefits:s.includePremiumBenefits,include_management_fee:s.includeManagementFee,employments:o.map(i=>Ce(i,s,a))}}n(Q,"buildPayload");export{K as a,Q as b,A as c,je as d};
2
- //# sourceMappingURL=chunk-5CUF63YR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/CostCalculator/utils.ts","../src/flows/CostCalculator/hooks.tsx"],"sourcesContent":["import type { CostCalculatorEstimateParams } from '@/src/client';\n\nimport { $TSFixMe } from '@/src/types/remoteFlows';\nimport { AnyObjectSchema, object } from 'yup';\nimport { CostCalculatorVersion, defaultEstimationOptions } from './hooks';\nimport type {\n CostCalculatorEstimationOptions,\n CostCalculatorEstimationSubmitValues,\n} from './types';\n\n/**\n * Build the validation schema for the form.\n * @returns\n */\nexport function buildValidationSchema(fields: $TSFixMe[]) {\n const fieldsSchema = fields.reduce<Record<string, AnyObjectSchema>>(\n (fieldsSchemaAcc, field) => {\n // Special handling for salary fields\n if (field.name === 'salary' || field.name === 'salary_conversion') {\n fieldsSchemaAcc[field.name] = (field.schema as AnyObjectSchema).when(\n 'salary_converted',\n {\n is: (val: string | null) => val === field.name,\n then: (schema) => schema.required('Salary is required'),\n otherwise: (schema) => schema.optional(),\n },\n );\n } else {\n fieldsSchemaAcc[field.name] = field.schema as AnyObjectSchema;\n }\n return fieldsSchemaAcc;\n return fieldsSchemaAcc;\n },\n {},\n );\n return object(fieldsSchema) as AnyObjectSchema;\n}\n\n/**\n * Format the benefits to the expected format by the API.\n * @param benefits\n * @returns\n */\nfunction formatBenefits(benefits: Record<string, string>) {\n const needle = 'benefit-';\n return Object.keys(benefits).reduce<\n Array<{ benefit_group_slug: string; benefit_tier_slug: string }>\n >((acc, key) => {\n const benefitTierSlug = benefits[key];\n if (benefitTierSlug === 'none') {\n return acc;\n }\n const benefitGroupSlug = key.replace(needle, '');\n const benefitEntry = {\n benefit_group_slug: benefitGroupSlug,\n benefit_tier_slug: benefitTierSlug,\n };\n return [...acc, benefitEntry];\n }, []);\n}\n\nfunction mapValueToEmployment(\n value: CostCalculatorEstimationSubmitValues,\n estimationOptions: CostCalculatorEstimationOptions,\n version: CostCalculatorVersion,\n) {\n return {\n region_slug: value.region || value.country,\n employment_term: value.contract_duration_type ?? 'fixed',\n title: estimationOptions.title,\n age: value.age ?? undefined,\n ...(value.benefits && { benefits: formatBenefits(value.benefits) }),\n ...((version == 'marketing' ||\n value.salary_converted === 'salary_conversion') && {\n annual_gross_salary_in_employer_currency: value.salary,\n }),\n ...(version === 'standard' &&\n value.salary_converted === 'salary' && {\n annual_gross_salary: value.salary,\n }),\n };\n}\n\n/**\n * Build the payload for the cost calculator estimation.\n * @param values\n * @param estimationOptions\n * @returns\n */\nexport function buildPayload(\n values:\n | CostCalculatorEstimationSubmitValues\n | CostCalculatorEstimationSubmitValues[],\n estimationOptions: CostCalculatorEstimationOptions = defaultEstimationOptions,\n version: CostCalculatorVersion = 'standard',\n): CostCalculatorEstimateParams {\n const employments = Array.isArray(values) ? values : [values];\n\n if (employments.length === 0) {\n throw new Error('At least one employment value is required');\n }\n\n if (employments.length > 1) {\n const currencies = new Set(employments.map((v) => v.currency));\n if (currencies.size > 1) {\n console.warn(\n 'Multiple currencies detected in array. Using currency from first employment.',\n );\n }\n }\n\n return {\n employer_currency_slug: employments[0].currency,\n include_benefits: estimationOptions.includeBenefits,\n include_cost_breakdowns: estimationOptions.includeCostBreakdowns,\n include_premium_benefits: estimationOptions.includePremiumBenefits,\n include_management_fee: estimationOptions.includeManagementFee,\n employments: employments.map((value) =>\n mapValueToEmployment(value, estimationOptions, version),\n ),\n };\n}\n","import {\n CostCalculatorEstimateResponse,\n MinimalRegion,\n PostCreateEstimationError,\n} from '@/src/client';\nimport { jsonSchema } from '@/src/flows/CostCalculator/jsonSchema';\nimport type {\n CostCalculatorEstimationFormValues,\n CostCalculatorEstimationOptions,\n CostCalculatorEstimationSubmitValues,\n EstimationError,\n UseCostCalculatorOptions,\n} from '@/src/flows/CostCalculator/types';\nimport type { JSFModify, Result } from '@/src/flows/types';\n\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport { iterateErrors } from '@/src/components/form/yupValidationResolver';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { string, ValidationError } from 'yup';\nimport { buildPayload, buildValidationSchema } from './utils';\nimport {\n useCompanyCurrencies,\n useCostCalculatorCountries,\n useCostCalculatorEstimation,\n useRegionFields,\n} from '@/src/flows/CostCalculator/api';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { SalaryField } from '@/src/flows/CostCalculator/components/SalaryField';\n\nexport type CostCalculatorVersion = 'standard' | 'marketing';\n\ntype CostCalculatorCountry = {\n value: string;\n label: string;\n childRegions: MinimalRegion[];\n hasAdditionalFields: boolean | undefined;\n regionSlug: string;\n currency: string;\n};\n\ntype JSFValidationError = {\n formErrors: Record<\n string,\n {\n type: string;\n message: string;\n }\n >;\n yupError: ValidationError;\n};\n\nexport const defaultEstimationOptions: CostCalculatorEstimationOptions = {\n title: 'Estimation',\n includeBenefits: false,\n includeCostBreakdowns: false,\n includePremiumBenefits: false,\n enableCurrencyConversion: false,\n includeManagementFee: false,\n};\n\ntype UseCostCalculatorParams = {\n /**\n * The default region slug to preselect a country and a region.\n */\n defaultRegion?: string;\n /**\n * The default currency slug to preselect a currency.\n */\n defaultCurrency?: string;\n\n /**\n * The default salary to preselect a salary.\n */\n defaultSalary?: string;\n /**\n * The estimation options.\n */\n estimationOptions: CostCalculatorEstimationOptions;\n options?: UseCostCalculatorOptions;\n version?: CostCalculatorVersion;\n};\n\nconst useStaticSchema = (options?: { jsfModify?: JSFModify }) => {\n const { schema: jsonSchemaModified } = modify(\n jsonSchema.data.schema,\n options?.jsfModify || {},\n );\n\n return createHeadlessForm(jsonSchemaModified);\n};\n\n/**\n * Hook to use the cost calculator.\n */\nexport const useCostCalculator = (\n {\n defaultRegion,\n defaultCurrency,\n defaultSalary,\n estimationOptions,\n options,\n version,\n }: UseCostCalculatorParams = {\n estimationOptions: defaultEstimationOptions,\n },\n) => {\n const [selectedRegion, setSelectedRegion] = useState<string | undefined>(\n defaultRegion,\n );\n const [selectedCountry, setSelectedCountry] =\n useState<CostCalculatorCountry>();\n const [employerBillingCurrency, setEmployerBillingCurrency] = useState<\n string | undefined\n >();\n const { data: countries, isLoading: isLoadingCountries } =\n useCostCalculatorCountries({\n includePremiumBenefits: estimationOptions.includePremiumBenefits,\n });\n const { data: currencies, isLoading: isLoadingCurrencies } =\n useCompanyCurrencies();\n\n const jsonSchemaRegionSlug = selectedRegion || selectedCountry?.value;\n\n const { data: jsonSchemaRegionFields, isLoading: isLoadingRegionFields } =\n useRegionFields(jsonSchemaRegionSlug, {\n includePremiumBenefits: estimationOptions.includePremiumBenefits,\n options,\n });\n const costCalculatorEstimationMutation = useCostCalculatorEstimation();\n const employeeBillingCurrency = selectedCountry?.currency;\n\n const salaryField = options?.jsfModify?.fields?.salary;\n const salaryFieldPresentation =\n salaryField &&\n typeof salaryField === 'object' &&\n 'presentation' in salaryField\n ? (\n salaryField as {\n presentation?: {\n salary_conversion_properties?: {\n label?: string;\n description?: string;\n };\n };\n }\n ).presentation\n : undefined;\n\n const getCurrencies = useCallback(() => {\n const shouldSwapOrder =\n employeeBillingCurrency && employerBillingCurrency\n ? employeeBillingCurrency !== employerBillingCurrency\n : false;\n\n if (employeeBillingCurrency !== employerBillingCurrency) {\n return {\n from: employerBillingCurrency,\n to: employeeBillingCurrency,\n shouldSwapOrder,\n };\n }\n\n return {\n from: employeeBillingCurrency,\n to: employerBillingCurrency,\n shouldSwapOrder,\n };\n }, [employeeBillingCurrency, employerBillingCurrency]);\n\n const customFields = useMemo(() => {\n const { from, to, shouldSwapOrder } = getCurrencies();\n\n return {\n fields: {\n salary: {\n ...salaryField,\n presentation: {\n salary_conversion_properties: {\n label:\n salaryFieldPresentation?.salary_conversion_properties?.label,\n description:\n salaryFieldPresentation?.salary_conversion_properties\n ?.description,\n },\n currencies: { from, to },\n Component: (\n props: JSFField & { currencies: { from: string; to: string } },\n ) => {\n return (\n <SalaryField\n {...props}\n shouldSwapOrder={shouldSwapOrder}\n conversionType={\n version === 'marketing' ? 'no_spread' : 'spread'\n }\n defaultValue={defaultSalary}\n />\n );\n },\n },\n },\n },\n };\n }, [\n employeeBillingCurrency,\n employerBillingCurrency,\n salaryField,\n salaryFieldPresentation?.salary_conversion_properties?.description,\n salaryFieldPresentation?.salary_conversion_properties?.label,\n ]);\n\n const fieldsJSONSchema = useStaticSchema({\n jsfModify: {\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n });\n\n useEffect(() => {\n // Initialize selectedCountry from defaultRegion\n if (defaultRegion && countries) {\n const defaultCountry = countries.find(\n ({ value }) => value === defaultRegion,\n );\n if (defaultCountry) {\n setSelectedCountry(defaultCountry);\n }\n }\n }, [defaultRegion, countries]);\n\n useEffect(() => {\n // Initialize selectedCurrency from defaultCurrency\n if (defaultCurrency && currencies) {\n const defaultCurrencyObj = currencies.find(\n ({ value }) => value === defaultCurrency,\n );\n if (defaultCurrencyObj) {\n setEmployerBillingCurrency(defaultCurrencyObj.label);\n }\n }\n }, [defaultCurrency, currencies]);\n\n /**\n * Submit the estimation form with the given values.\n * @param values\n */\n async function onSubmit(\n values: CostCalculatorEstimationSubmitValues,\n ): Promise<Result<CostCalculatorEstimateResponse, EstimationError>> {\n try {\n await validationSchema.validate(values, { abortEarly: false });\n } catch (err) {\n return {\n data: null,\n error: err as ValidationError,\n };\n }\n\n return new Promise((resolve, reject) => {\n costCalculatorEstimationMutation.mutate(\n buildPayload(values, estimationOptions, version),\n {\n onSuccess: (response) => {\n if (response.data) {\n resolve({\n data: response.data,\n error: null,\n });\n } else {\n resolve({\n data: null,\n error: new Error(\n 'Something went wrong. Please try again later.',\n ),\n });\n }\n },\n onError: (error) => {\n reject({\n data: null,\n error: error as PostCreateEstimationError,\n });\n },\n },\n );\n });\n }\n\n /**\n * If the selected country has no child regions and has additional fields,\n * set the current region to the country's region slug and fetch the region fields.\n * @param country\n */\n function onCountryChange(country: string) {\n const currentCountry = countries?.find(({ value }) => value === country);\n\n if (\n currentCountry &&\n currentCountry.childRegions.length === 0 &&\n currentCountry.hasAdditionalFields\n ) {\n setSelectedRegion(currentCountry.regionSlug);\n } else {\n setSelectedRegion(undefined);\n }\n setSelectedCountry(currentCountry);\n }\n\n /**\n * Update the selected region and fetch the region fields.\n * @param region\n */\n function onRegionChange(region: string) {\n setSelectedRegion(region);\n }\n\n function onChangeCurrency(currency: string) {\n const selectedCurrency = currencies?.find(\n (c) => c.value === currency,\n )?.label;\n setEmployerBillingCurrency(selectedCurrency);\n }\n\n const regionField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'region',\n );\n\n if (regionField) {\n const regions =\n selectedCountry?.childRegions.map((region) => ({\n value: region.slug,\n label: region.name,\n })) ?? [];\n regionField.options = regions;\n regionField.isVisible = regions.length > 0;\n regionField.required = regions.length > 0;\n regionField.onChange = onRegionChange;\n regionField.schema =\n regions.length > 0\n ? string()\n .transform((value) => (typeof value === 'string' ? value : ''))\n .required('Region is required')\n : string();\n }\n\n if (currencies) {\n const currencyField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'currency',\n );\n if (currencyField) {\n currencyField.options = currencies;\n currencyField.onChange = onChangeCurrency;\n }\n }\n\n if (countries) {\n const countryField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'country',\n );\n if (countryField) {\n countryField.options = countries;\n countryField.onChange = onCountryChange;\n }\n }\n\n const resetForm = () => {\n setSelectedCountry(undefined);\n setSelectedRegion(defaultRegion);\n };\n\n const allFields = [\n ...fieldsJSONSchema.fields,\n ...(jsonSchemaRegionFields?.fields || []),\n ];\n\n const validationSchema = buildValidationSchema(fieldsJSONSchema.fields);\n\n async function handleValidation(values: CostCalculatorEstimationFormValues) {\n let errors: JSFValidationError | null = null;\n const parsedValues = parseJSFToValidate(values, allFields);\n\n // 1. validate static fields first using Yup validate function\n try {\n await validationSchema.validate(parsedValues, {\n abortEarly: false,\n });\n errors = {\n formErrors: {},\n yupError: new ValidationError([], values),\n };\n } catch (error) {\n const iterateResult = iterateErrors(error as ValidationError);\n\n errors = {\n // convert the errors to a format that can be used in the form\n formErrors: Object.entries(iterateResult).reduce(\n (acc, [key, value]) => ({ ...acc, [key]: value.message }),\n {},\n ),\n yupError: error as ValidationError,\n };\n }\n\n // 2. validate json schema fields using the handleValidation (from json-schema-form)\n const handleValidationResult =\n jsonSchemaRegionFields?.handleValidation(parsedValues);\n\n // 3. combine the errors from both validations\n const combinedInnerErrors = [\n ...(errors?.yupError.inner || []),\n ...(handleValidationResult?.yupError?.inner || []),\n ];\n const combinedValues = {\n ...(errors?.yupError?.value || {}),\n ...(handleValidationResult?.yupError?.value || {}),\n };\n\n return {\n formErrors: {\n ...(errors?.formErrors || {}),\n ...(handleValidationResult?.formErrors || {}),\n },\n yupError: new ValidationError(combinedInnerErrors, combinedValues),\n };\n }\n\n return {\n stepState: {\n current: 0,\n total: 1,\n isLastStep: true,\n },\n fields: allFields,\n validationSchema,\n parseFormValues: (\n values: CostCalculatorEstimationFormValues,\n ): CostCalculatorEstimationSubmitValues => {\n const {\n country,\n region,\n currency,\n salary_converted,\n salary_conversion,\n ...rest\n } = values;\n\n // If the salary has been converted, we take the one the user has inputted\n let salary = values.salary;\n if (salary_converted === 'salary_conversion') {\n salary = salary_conversion;\n }\n\n const jsonSchemaStaticFieldValues = {\n country,\n region,\n salary,\n salary_converted,\n salary_conversion,\n currency,\n };\n\n const parsedStaticFields = parseJSFToValidate(\n jsonSchemaStaticFieldValues,\n fieldsJSONSchema.fields,\n );\n\n const parsedRegionFields = parseJSFToValidate(\n rest,\n jsonSchemaRegionFields?.fields || [],\n );\n\n return {\n ...parsedStaticFields,\n ...parsedRegionFields,\n } as CostCalculatorEstimationSubmitValues;\n },\n handleValidation,\n isSubmitting: costCalculatorEstimationMutation.isPending,\n isLoading:\n isLoadingCountries && isLoadingCurrencies && isLoadingRegionFields,\n onSubmit,\n resetForm,\n };\n};\n"],"mappings":"qQAGA,OAA0B,UAAAA,OAAc,MCcxC,OAAS,sBAAAC,GAAoB,UAAAC,OAAc,8BAC3C,OAAS,eAAAC,GAAa,aAAAC,EAAW,WAAAC,GAAS,YAAAC,MAAgB,QAC1D,OAAS,UAAAC,EAAQ,mBAAAC,MAAuB,MA2KxB,cAAAC,OAAA,oBA1IT,IAAMC,EAA4D,CACvE,MAAO,aACP,gBAAiB,GACjB,sBAAuB,GACvB,uBAAwB,GACxB,yBAA0B,GAC1B,qBAAsB,EACxB,EAwBMC,GAAkBC,EAACC,GAAwC,CAC/D,GAAM,CAAE,OAAQC,CAAmB,EAAIC,GACrCC,EAAW,KAAK,OAChBH,GAAS,WAAa,CAAC,CACzB,EAEA,OAAOI,GAAmBH,CAAkB,CAC9C,EAPwB,mBAYXI,GAAoBN,EAAA,CAC/B,CACE,cAAAO,EACA,gBAAAC,EACA,cAAAC,EACA,kBAAAC,EACA,QAAAT,EACA,QAAAU,CACF,EAA6B,CAC3B,kBAAmBb,CACrB,IACG,CACH,GAAM,CAACc,EAAgBC,CAAiB,EAAIC,EAC1CP,CACF,EACM,CAACQ,EAAiBC,CAAkB,EACxCF,EAAgC,EAC5B,CAACG,EAAyBC,CAA0B,EAAIJ,EAE5D,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EACAC,EACAC,EACA,CACA,MAAO,CACL,YAAaF,EAAM,QAAUA,EAAM,QACnC,gBAAiBA,EAAM,wBAA0B,QACjD,MAAOC,EAAkB,MACzB,IAAKD,EAAM,KAAO,OAClB,GAAIA,EAAM,UAAY,CAAE,SAAUR,GAAeQ,EAAM,QAAQ,CAAE,EACjE,IAAKE,GAAW,aACdF,EAAM,mBAAqB,sBAAwB,CACnD,yCAA0CA,EAAM,MAClD,EACA,GAAIE,IAAY,YACdF,EAAM,mBAAqB,UAAY,CACrC,oBAAqBA,EAAM,MAC7B,CACJ,CACF,CApBSZ,EAAAW,GAAA,wBA4BF,SAASI,EACdC,EAGAH,EAAqDI,EACrDH,EAAiC,WACH,CAC9B,IAAMI,EAAc,MAAM,QAAQF,CAAM,EAAIA,EAAS,CAACA,CAAM,EAE5D,GAAIE,EAAY,SAAW,EACzB,MAAM,IAAI,MAAM,2CAA2C,EAG7D,OAAIA,EAAY,OAAS,GACJ,IAAI,IAAIA,EAAY,IAAKC,GAAMA,EAAE,QAAQ,CAAC,EAC9C,KAAO,GACpB,QAAQ,KACN,8EACF,EAIG,CACL,uBAAwBD,EAAY,CAAC,EAAE,SACvC,iBAAkBL,EAAkB,gBACpC,wBAAyBA,EAAkB,sBAC3C,yBAA0BA,EAAkB,uBAC5C,uBAAwBA,EAAkB,qBAC1C,YAAaK,EAAY,IAAKN,GAC5BD,GAAqBC,EAAOC,EAAmBC,CAAO,CACxD,CACF,CACF,CAhCgBd,EAAAe,EAAA","names":["object","createHeadlessForm","modify","useCallback","useEffect","useMemo","useState","string","ValidationError","jsx","defaultEstimationOptions","useStaticSchema","__name","options","jsonSchemaModified","modify","jsonSchema","createHeadlessForm","useCostCalculator","defaultRegion","defaultCurrency","defaultSalary","estimationOptions","version","selectedRegion","setSelectedRegion","useState","selectedCountry","setSelectedCountry","employerBillingCurrency","setEmployerBillingCurrency","countries","isLoadingCountries","useCostCalculatorCountries","currencies","isLoadingCurrencies","useCompanyCurrencies","jsonSchemaRegionSlug","jsonSchemaRegionFields","isLoadingRegionFields","useRegionFields","costCalculatorEstimationMutation","useCostCalculatorEstimation","employeeBillingCurrency","salaryField","salaryFieldPresentation","getCurrencies","useCallback","shouldSwapOrder","customFields","useMemo","from","to","props","SalaryField","fieldsJSONSchema","useEffect","defaultCountry","value","defaultCurrencyObj","onSubmit","values","validationSchema","err","resolve","reject","buildPayload","response","error","onCountryChange","country","currentCountry","onRegionChange","region","onChangeCurrency","currency","selectedCurrency","c","regionField","field","regions","string","currencyField","countryField","resetForm","allFields","buildValidationSchema","handleValidation","errors","parsedValues","parseJSFToValidate","ValidationError","iterateResult","iterateErrors","acc","key","handleValidationResult","combinedInnerErrors","combinedValues","salary_converted","salary_conversion","rest","salary","parsedStaticFields","parsedRegionFields","buildValidationSchema","fields","fieldsSchema","fieldsSchemaAcc","field","__name","val","schema","object","formatBenefits","benefits","needle","acc","key","benefitTierSlug","benefitEntry","mapValueToEmployment","value","estimationOptions","version","buildPayload","values","defaultEstimationOptions","employments","v"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ui/card.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\ninterface CardProps extends React.ComponentProps<'div'> {\n direction?: 'row' | 'col';\n}\n\nfunction Card({ className, direction = 'col', ...props }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n 'RemoteFlows__Card bg-white text-card-foreground rounded-[10px] gap-4 border border-gray-200 px-10 py-14',\n direction === 'row' ? 'flex flex-row' : 'flex flex-col',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn('flex flex-col gap-1.5 px-6', className)}\n {...props}\n />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('leading-none font-semibold', className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn('text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn('px-6', className)}\n {...props}\n />\n );\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('flex items-center px-6', className)}\n {...props}\n />\n );\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardDescription,\n CardContent,\n};\n"],"mappings":"gFAUI,cAAAA,MAAA,oBAFJ,SAASC,EAAK,CAAE,UAAAC,EAAW,UAAAC,EAAY,MAAO,GAAGC,CAAM,EAAc,CACnE,OACEJ,EAAC,OACC,YAAU,OACV,UAAWK,EACT,0GACAF,IAAc,MAAQ,gBAAkB,gBACxCD,CACF,EACC,GAAGE,EACN,CAEJ,CAZSE,EAAAL,EAAA,QAcT,SAASM,EAAW,CAAE,UAAAL,EAAW,GAAGE,CAAM,EAAgC,CACxE,OACEJ,EAAC,OACC,YAAU,cACV,UAAWK,EAAG,6BAA8BH,CAAS,EACpD,GAAGE,EACN,CAEJ,CARSE,EAAAC,EAAA,cAUT,SAASC,EAAU,CAAE,UAAAN,EAAW,GAAGE,CAAM,EAAgC,CACvE,OACEJ,EAAC,OACC,YAAU,aACV,UAAWK,EAAG,6BAA8BH,CAAS,EACpD,GAAGE,EACN,CAEJ,CARSE,EAAAE,EAAA,aAUT,SAASC,EAAgB,CAAE,UAAAP,EAAW,GAAGE,CAAM,EAAgC,CAC7E,OACEJ,EAAC,OACC,YAAU,mBACV,UAAWK,EAAG,UAAWH,CAAS,EACjC,GAAGE,EACN,CAEJ,CARSE,EAAAG,EAAA,mBAUT,SAASC,EAAY,CAAE,UAAAR,EAAW,GAAGE,CAAM,EAAgC,CACzE,OACEJ,EAAC,OACC,YAAU,eACV,UAAWK,EAAG,OAAQH,CAAS,EAC9B,GAAGE,EACN,CAEJ,CARSE,EAAAI,EAAA,eAUT,SAASC,EAAW,CAAE,UAAAT,EAAW,GAAGE,CAAM,EAAgC,CACxE,OACEJ,EAAC,OACC,YAAU,cACV,UAAWK,EAAG,yBAA0BH,CAAS,EAChD,GAAGE,EACN,CAEJ,CARSE,EAAAK,EAAA","names":["jsx","Card","className","direction","props","cn","__name","CardHeader","CardTitle","CardDescription","CardContent","CardFooter"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ui/drawer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Drawer as DrawerPrimitive } from 'vaul';\n\nimport { cn } from '@/src/lib/utils';\n\nconst Drawer = ({\n shouldScaleBackground = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) => (\n <DrawerPrimitive.Root\n shouldScaleBackground={shouldScaleBackground}\n {...props}\n />\n);\nDrawer.displayName = 'Drawer';\n\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\nconst DrawerPortal = DrawerPrimitive.Portal;\n\nconst DrawerClose = DrawerPrimitive.Close;\n\nconst DrawerOverlay = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-black/80', className)}\n {...props}\n />\n));\nDrawerOverlay.displayName = DrawerPrimitive.Overlay.displayName;\n\nconst DrawerContent = React.forwardRef<\n HTMLDivElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content> & {\n showHandle?: boolean;\n }\n>(({ className, children, showHandle = true, ...props }, ref) => (\n <DrawerPortal>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background',\n className,\n )}\n {...props}\n >\n {showHandle && (\n <div className=\"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted\" />\n )}\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n));\nDrawerContent.displayName = 'DrawerContent';\n\nconst DrawerHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('grid gap-1.5 p-4 text-center sm:text-left', className)}\n {...props}\n />\n);\nDrawerHeader.displayName = 'DrawerHeader';\n\nconst DrawerFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('mt-auto flex flex-col gap-2 p-4', className)}\n {...props}\n />\n);\nDrawerFooter.displayName = 'DrawerFooter';\n\nconst DrawerTitle = React.forwardRef<\n HTMLHeadingElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\n 'text-lg font-semibold leading-none tracking-tight',\n className,\n )}\n {...props}\n />\n));\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\nconst DrawerDescription = React.forwardRef<\n HTMLParagraphElement,\n React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n"],"mappings":"gFAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,OAQxC,cAAAC,EAiCE,QAAAC,MAjCF,oBAJF,IAAMC,EAASC,EAAA,CAAC,CACd,sBAAAC,EAAwB,GACxB,GAAGC,CACL,IACEL,EAACM,EAAgB,KAAhB,CACC,sBAAuBF,EACtB,GAAGC,EACN,EAPa,UASfH,EAAO,YAAc,SAErB,IAAMK,EAAgB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iCF,CAAS,EACvD,GAAGN,EACN,CACD,EACDe,EAAkB,YAAcd,EAAgB,YAAY","names":["React","DrawerPrimitive","jsx","jsxs","Drawer","__name","shouldScaleBackground","props","DrawerPrimitive","DrawerTrigger","DrawerPortal","DrawerClose","DrawerOverlay","className","ref","cn","DrawerContent","children","showHandle","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.tsx"],"sourcesContent":["import { Info } from 'lucide-react';\n\nimport { BasicTooltip } from '@/src/components/ui/basic-tooltip';\n\nimport { Button } from '@/src/components/ui/button';\nimport { Separator } from '@/src/components/ui/separator';\nimport { formatCurrency } from '@/src/lib/utils';\nimport { ZendeskTriggerButton } from '@/src/components/shared/zendesk-drawer/ZendeskTriggerButton';\n\ntype CostCalculatorContributionsBreakdownProps = {\n contributionsTotal: number;\n currency: string;\n contributionsBreakdown:\n | {\n name: string;\n description: string | null;\n amount: number;\n zendesk_article_url: string | null;\n zendesk_article_id: string | null;\n }[]\n | undefined;\n};\n\nexport function CostCalculatorContributionsBreakdown({\n contributionsTotal,\n currency,\n contributionsBreakdown,\n}: CostCalculatorContributionsBreakdownProps) {\n return (\n <div>\n <div className=\"flex justify-between items-center mb-2\">\n <h3 className=\"font-medium text-primary-foreground\">\n Employer Contributions\n </h3>\n <span className=\"font-semibold text-lg\">\n {formatCurrency(contributionsTotal, currency)}\n </span>\n </div>\n {contributionsBreakdown ? (\n <>\n <Separator className=\"mb-3\" />\n <div className=\"space-y-3 pl-2\">\n {contributionsBreakdown.map((contribution, index) => (\n <div\n key={index}\n className=\"flex justify-between items-start text-sm\"\n >\n <div className=\"flex items-start gap-2\">\n <span>{contribution.name}</span>\n {contribution.description && (\n <BasicTooltip\n content={\n <>\n <span>{contribution.description}</span>{' '}\n {contribution.zendesk_article_url && (\n <ZendeskTriggerButton\n zendeskId={Number(\n contribution.zendesk_article_id,\n )}\n >\n Learn more\n </ZendeskTriggerButton>\n )}\n </>\n }\n >\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"h-4 w-4 p-0\"\n >\n <Info className=\"h-3 w-3 text-gray-400\" />\n <span className=\"sr-only\">Info</span>\n </Button>\n </BasicTooltip>\n )}\n </div>\n <span>{formatCurrency(contribution.amount, currency)}</span>\n </div>\n ))}\n </div>\n </>\n ) : null}\n </div>\n );\n}\n"],"mappings":"gPAAA,OAAS,QAAAA,MAAY,eA8Bf,OAsBkB,YAAAC,EArBhB,OAAAC,EADF,QAAAC,MAAA,oBAPC,SAASC,EAAqC,CACnD,mBAAAC,EACA,SAAAC,EACA,uBAAAC,CACF,EAA8C,CAC5C,OACEJ,EAAC,OACC,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAD,EAAC,MAAG,UAAU,sCAAsC,kCAEpD,EACAA,EAAC,QAAK,UAAU,wBACb,SAAAM,EAAeH,EAAoBC,CAAQ,EAC9C,GACF,EACCC,EACCJ,EAAAF,EAAA,CACE,UAAAC,EAACO,EAAA,CAAU,UAAU,OAAO,EAC5BP,EAAC,OAAI,UAAU,iBACZ,SAAAK,EAAuB,IAAI,CAACG,EAAcC,IACzCR,EAAC,OAEC,UAAU,2CAEV,UAAAA,EAAC,OAAI,UAAU,yBACb,UAAAD,EAAC,QAAM,SAAAQ,EAAa,KAAK,EACxBA,EAAa,aACZR,EAACU,EAAA,CACC,QACET,EAAAF,EAAA,CACE,UAAAC,EAAC,QAAM,SAAAQ,EAAa,YAAY,EAAQ,IACvCA,EAAa,qBACZR,EAACW,EAAA,CACC,UAAW,OACTH,EAAa,kBACf,EACD,sBAED,GAEJ,EAGF,SAAAP,EAACW,EAAA,CACC,QAAQ,QACR,KAAK,OACL,UAAU,cAEV,UAAAZ,EAACa,EAAA,CAAK,UAAU,wBAAwB,EACxCb,EAAC,QAAK,UAAU,UAAU,gBAAI,GAChC,EACF,GAEJ,EACAA,EAAC,QAAM,SAAAM,EAAeE,EAAa,OAAQJ,CAAQ,EAAE,IAjChDK,CAkCP,CACD,EACH,GACF,EACE,MACN,CAEJ,CA9DgBK,EAAAZ,EAAA","names":["Info","Fragment","jsx","jsxs","CostCalculatorContributionsBreakdown","contributionsTotal","currency","contributionsBreakdown","formatCurrency","Separator","contribution","index","BasicTooltip","ZendeskTriggerButton","Button","Info","__name"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorTotalCost.tsx"],"sourcesContent":["import { formatCurrency } from '@/src/lib/utils';\n\ntype CostCalculatorTotalCostProps = {\n totalCost: number;\n currency: string;\n};\n\nexport function CostCalculatorTotalCost({\n totalCost,\n currency,\n}: CostCalculatorTotalCostProps) {\n return (\n <div className=\"pt-2 mt-4 border-t-2 border-gray-200\">\n <div className=\"flex justify-between items-center\">\n <h3 className=\"font-bold text-primary-foreground-800\">Total Cost</h3>\n <span className=\"font-bold text-xl\">\n {formatCurrency(totalCost, currency)}\n </span>\n </div>\n </div>\n );\n}\n"],"mappings":"gFAaM,OACE,OAAAA,EADF,QAAAC,MAAA,oBANC,SAASC,EAAwB,CACtC,UAAAC,EACA,SAAAC,CACF,EAAiC,CAC/B,OACEJ,EAAC,OAAI,UAAU,uCACb,SAAAC,EAAC,OAAI,UAAU,oCACb,UAAAD,EAAC,MAAG,UAAU,wCAAwC,sBAAU,EAChEA,EAAC,QAAK,UAAU,oBACb,SAAAK,EAAeF,EAAWC,CAAQ,EACrC,GACF,EACF,CAEJ,CAdgBE,EAAAJ,EAAA","names":["jsx","jsxs","CostCalculatorTotalCost","totalCost","currency","formatCurrency","__name"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ui/input.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Input({ className, type, ...props }: React.ComponentProps<'input'>) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n 'shadow-xs border-input file:text-foreground placeholder:text-muted-foreground flex h-9 w-full min-w-0 rounded-xl border bg-transparent px-4 py-7 text-sm transition-[color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n 'focus-visible:border-focused',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n"],"mappings":"gFAMI,cAAAA,MAAA,oBAFJ,SAASC,EAAM,CAAE,UAAAC,EAAW,KAAAC,EAAM,GAAGC,CAAM,EAAkC,CAC3E,OACEJ,EAAC,SACC,KAAMG,EACN,YAAU,QACV,UAAWE,EACT,6WACA,+BACA,yGACAH,CACF,EACC,GAAGE,EACN,CAEJ,CAdSE,EAAAL,EAAA","names":["jsx","Input","className","type","props","cn","__name"]}
@@ -1,2 +0,0 @@
1
- import{a as F}from"./chunk-SUQURI2J.js";import{b as l}from"./chunk-CFIJKJXD.js";import{f,g as p}from"./chunk-GAOBYAJE.js";import{c as u}from"./chunk-MXFDOIUA.js";import{b as _}from"./chunk-TVZAFTPT.js";import{a as r}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as a}from"react/jsx-runtime";var w=["effective_date","reason_for_change","reason_for_change_description","additional_comments","additional_comments_toggle"];function x({onSubmit:b,onError:m,onSuccess:A}){let{formId:C,contractAmendment:{checkFieldUpdates:h,fields:s,onSubmit:S,stepState:g,initialValues:i,handleValidation:y}}=_(),V=l(y),e=f({resolver:V,defaultValues:g.values?.form||i,shouldUnregister:!0,mode:"onBlur"});R(()=>{let t=e?.watch(o=>{(Object.keys(e.formState.dirtyFields).length>0||e.formState.isDirty)&&h(o)});return()=>t?.unsubscribe()},[]);let v=r(async t=>{let o=!1;for(let[c,P]of Object.entries(t))if(!w.includes(c)&&i[c]!==P){o=!0;break}if(!o)return m?.({message:"no_changes_detected_contract_details"});let d=u(t,s,{isPartialValidation:!1});await b?.(d);let n=await S(t);n.error?m?.(n.error):await A?.(n.data)},"handleSubmit");return a(p,{...e,children:a("form",{id:C,"data-testid":"contract-amendment-form",onSubmit:e.handleSubmit(v),className:"space-y-4 RemoteFlows__ContractAmendmentForm",children:a(F,{fields:s})})})}r(x,"ContractAmendmentForm");export{x as a};
2
- //# sourceMappingURL=chunk-CSLZUVU4.js.map
@@ -1,2 +0,0 @@
1
- import{a as i}from"./chunk-XSHHMBMT.js";import{a as o}from"./chunk-JODJFARP.js";import{a as m}from"./chunk-W5DG5WWJ.js";import{a as e}from"./chunk-VX2UC3HG.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
2
- //# sourceMappingURL=chunk-DR7VGNO2.js.map
@@ -1,2 +0,0 @@
1
- import{b}from"./chunk-PGWKJ6FK.js";import{a as u}from"./chunk-SUQURI2J.js";import{b as f}from"./chunk-CFIJKJXD.js";import{b as y}from"./chunk-QW4JPW6J.js";import{f as p,g as F}from"./chunk-GAOBYAJE.js";import{a as m}from"./chunk-P37U34EQ.js";import{useEffect as S}from"react";import{jsx as d}from"react/jsx-runtime";function N({defaultValues:l,onSubmit:g,components:E}){let{formId:w,onboardingBag:o}=b(),h=f(o.handleValidation),r=p({resolver:h,defaultValues:l,shouldUnregister:!1,mode:"onBlur"});S(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),S(()=>{let t=r?.watch(e=>{Object.keys(e).some(i=>e[i]!==l[i])&&o?.checkFieldUpdates(e)});return()=>t?.unsubscribe()},[]);let k=m(async(t,e)=>{let s=e?.nativeEvent;if(s?.isDraftSubmission){let{onSuccess:i,onError:c}=s.draftCallbacks;try{if(!await r.trigger())return;let n=await o.onSubmit(t);if(n?.data)i?.();else if(n?.error){let B=o.stepState.currentStep.name,P=o.meta?.fields?.[B],O=y(n?.fieldErrors||[],P);c?.({error:n.error,rawError:n.rawError,fieldErrors:O})}}catch(a){c?.({error:a,rawError:a,fieldErrors:[]})}}else g(t)},"handleSubmit");return d(F,{...r,children:d("form",{id:w,onSubmit:r.handleSubmit(k),className:"space-y-4 RemoteFlows__OnboardingForm",children:d(u,{components:E,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})})})}m(N,"OnboardingForm");export{N as a};
2
- //# sourceMappingURL=chunk-DVQO5MHI.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ui/label.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as LabelPrimitive from '@radix-ui/react-label';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'flex items-center gap-2 text-sm leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n"],"mappings":"gFAGA,UAAYA,MAAoB,wBAS5B,cAAAC,MAAA,oBALJ,SAASC,EAAM,CACb,UAAAC,EACA,GAAGC,CACL,EAAqD,CACnD,OACEH,EAAgB,OAAf,CACC,YAAU,QACV,UAAWI,EACT,gJACAF,CACF,EACC,GAAGC,EACN,CAEJ,CAdSE,EAAAJ,EAAA","names":["LabelPrimitive","jsx","Label","className","props","cn","__name"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ui/tabs.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Tabs({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn('flex flex-col gap-2', className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n 'bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-1',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n \"data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex flex-1 items-center justify-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn('flex-1 outline-none', className)}\n {...props}\n />\n );\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n"],"mappings":"gFACA,UAAYA,MAAmB,uBAS3B,cAAAC,MAAA,oBALJ,SAASC,EAAK,CACZ,UAAAC,EACA,GAAGC,CACL,EAAoD,CAClD,OACEH,EAAe,OAAd,CACC,YAAU,OACV,UAAWI,EAAG,sBAAuBF,CAAS,EAC7C,GAAGC,EACN,CAEJ,CAXSE,EAAAJ,EAAA,QAaT,SAASK,EAAS,CAChB,UAAAJ,EACA,GAAGC,CACL,EAAoD,CAClD,OACEH,EAAe,OAAd,CACC,YAAU,YACV,UAAWI,EACT,kGACAF,CACF,EACC,GAAGC,EACN,CAEJ,CAdSE,EAAAC,EAAA,YAgBT,SAASC,EAAY,CACnB,UAAAL,EACA,GAAGC,CACL,EAAuD,CACrD,OACEH,EAAe,UAAd,CACC,YAAU,eACV,UAAWI,EACT,0fACAF,CACF,EACC,GAAGC,EACN,CAEJ,CAdSE,EAAAE,EAAA,eAgBT,SAASC,EAAY,CACnB,UAAAN,EACA,GAAGC,CACL,EAAuD,CACrD,OACEH,EAAe,UAAd,CACC,YAAU,eACV,UAAWI,EAAG,sBAAuBF,CAAS,EAC7C,GAAGC,EACN,CAEJ,CAXSE,EAAAG,EAAA","names":["TabsPrimitive","jsx","Tabs","className","props","cn","__name","TabsList","TabsTrigger","TabsContent"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorResults.tsx"],"sourcesContent":["import { lazy, useState } from 'react';\n\nimport { CostCalculatorEstimateResponse } from '@/src/client';\nimport { Badge } from '@/src/components/ui/badge';\nimport {\n Card,\n CardContent,\n CardDescription,\n CardHeader,\n CardTitle,\n} from '@/src/components/ui/card';\nimport { Tabs, TabsList, TabsTrigger } from '@/src/components/ui/tabs';\nimport { cn } from '@/src/lib/utils';\nimport { CostCalculatorBenefitsBreakdown } from './CostCalculatorBenefitsBreakdown';\nimport { CostCalculatorContributionsBreakdown } from './CostCalculatorContributionsBreakdown';\nimport { CostCalculatorGrossSalary } from './CostCalculatorGrossSalary';\nimport { CostCalculatorTotalCost } from './CostCalculatorTotalCost';\nimport { CostCalculatorExtraStatutoryPaymentsBreakdown } from '@/src/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown';\nimport { CostCalculatorIndirectTax } from '@/src/flows/CostCalculator/Results/CostCalculatorIndirectTax';\n\nconst CostCalculatorResultsChart = lazy(\n () => import('./CostCalculatorResultsChart'),\n);\n\ninterface CostCalculatorResultProps {\n employmentData: CostCalculatorEstimateResponse['data'];\n options?: Partial<{\n title: string;\n description: string;\n showChart: boolean;\n chartColors: {\n grossSalary: string;\n contributions: string;\n benefits: string;\n };\n }>;\n}\n\nexport function CostCalculatorResults({\n employmentData,\n options,\n}: CostCalculatorResultProps) {\n const [view, setView] = useState<'monthly' | 'annual'>('monthly');\n const employment = employmentData.employments?.[0];\n\n if (!employment) {\n return null;\n }\n\n const costs =\n view === 'monthly'\n ? employment.employer_currency_costs\n : employment.employer_currency_costs;\n\n const currency = costs.currency.symbol;\n const grossSalary =\n view === 'monthly' ? costs.monthly_gross_salary : costs.annual_gross_salary;\n const benefitsTotal =\n view === 'monthly'\n ? costs.monthly_benefits_total\n : costs.annual_benefits_total;\n const contributionsTotal =\n view === 'monthly'\n ? costs.monthly_contributions_total\n : costs.annual_contributions_total;\n const totalCost =\n view === 'monthly' ? costs.monthly_total : costs.annual_total;\n\n const extraStatutoryPaymentsBreakdown =\n view === 'monthly' ? null : costs.extra_statutory_payments_breakdown;\n\n const extraStatutoryPaymentsTotal =\n view === 'monthly' ? null : costs.extra_statutory_payments_total;\n\n const indirectTax =\n view === 'monthly' ? costs.monthly_indirect_tax : costs.annual_indirect_tax;\n\n const benefitsBreakdown =\n view === 'monthly'\n ? costs.monthly_benefits_breakdown\n : costs.annual_benefits_breakdown;\n const contributionsBreakdown =\n view === 'monthly'\n ? costs.monthly_contributions_breakdown\n : costs.annual_contributions_breakdown;\n\n const chartData = [\n {\n name: 'Gross Salary',\n value: grossSalary,\n color: options?.chartColors?.grossSalary ?? '#3b82f6',\n },\n {\n name: 'Contributions',\n value: contributionsTotal,\n color: options?.chartColors?.contributions ?? '#f59e0b',\n },\n ];\n\n if (benefitsBreakdown) {\n chartData.push({\n name: 'Benefits',\n value: benefitsTotal ?? 0,\n color: options?.chartColors?.benefits ?? '#10b981',\n });\n }\n\n return (\n <>\n <div className=\"flex flex-col md:flex-row gap-4 md:items-center justify-between mb-6 RemoteFlows__CostCalculatorResults\">\n <div className=\"RemoteFlows__CostCalculatorResults__Header\">\n <h2 className=\"text-xl font-semibold flex items-center gap-2\">\n <span className=\"flex items-center gap-1\">\n {options?.title ?? 'Cost Calculator'}\n </span>\n <Badge className=\"ml-2\">{employment.country.name}</Badge>\n </h2>\n <p className=\"text-primary-foreground font-medium mt-1\">\n {options?.description ??\n `Total cost of employment in ${employment.country.name}`}\n </p>\n </div>\n\n <Tabs\n value={view}\n onValueChange={(v) => setView(v as 'monthly' | 'annual')}\n className=\"w-full md:w-auto RemoteFlows__CostCalculatorResults__Tabs\"\n >\n <TabsList className=\"grid w-full md:w-[200px] grid-cols-2\">\n <TabsTrigger value=\"monthly\">Monthly</TabsTrigger>\n <TabsTrigger value=\"annual\">Annual</TabsTrigger>\n </TabsList>\n </Tabs>\n </div>\n\n <div\n className={cn(\n 'grid grid-cols-1 gap-6',\n options?.showChart ? 'md:grid-cols-3' : '',\n 'RemoteFlows__CostCalculatorResults_CostBreakdown',\n )}\n >\n <Card className=\"md:col-span-2 rounded-lg\">\n <CardHeader className=\"pb-2\">\n <CardTitle>Cost Breakdown</CardTitle>\n <CardDescription>\n Detailed breakdown of all employer costs\n </CardDescription>\n </CardHeader>\n <CardContent>\n <div className=\"space-y-6\">\n {/* Salary Section */}\n <CostCalculatorGrossSalary\n grossSalary={grossSalary}\n currency={currency}\n hasExtraStatutoryPayment={\n employment.has_extra_statutory_payment\n }\n />\n {/* Benefits Section */}\n {benefitsBreakdown ? (\n <CostCalculatorBenefitsBreakdown\n benefitsBreakdown={benefitsBreakdown}\n benefitsTotal={benefitsTotal}\n currency={currency}\n />\n ) : null}\n {/* Contributions Section */}\n <CostCalculatorContributionsBreakdown\n contributionsBreakdown={contributionsBreakdown}\n contributionsTotal={contributionsTotal}\n currency={currency}\n />\n {/* Extra Statutory Payments Section */}\n {Array.isArray(extraStatutoryPaymentsBreakdown) &&\n extraStatutoryPaymentsBreakdown.length > 0 ? (\n <CostCalculatorExtraStatutoryPaymentsBreakdown\n extraStatutoryPaymentsBreakdown={\n extraStatutoryPaymentsBreakdown\n }\n extraStatutoryPaymentsTotal={extraStatutoryPaymentsTotal}\n currency={currency}\n />\n ) : null}\n {/* Indirect Tax Section */}\n {indirectTax ? (\n <CostCalculatorIndirectTax\n indirectTax={indirectTax}\n currency={currency}\n />\n ) : null}\n {/* Total */}\n <CostCalculatorTotalCost\n totalCost={totalCost}\n currency={currency}\n />\n </div>\n </CardContent>\n </Card>\n\n {options?.showChart && (\n <CostCalculatorResultsChart\n chartData={chartData}\n currency={currency}\n />\n )}\n </div>\n </>\n );\n}\n"],"mappings":"keAAA,OAAS,QAAAA,EAAM,YAAAC,MAAgB,QA4G3B,mBAAAC,EAIQ,OAAAC,EADF,QAAAC,MAHN,oBAxFJ,IAAMC,EAA6BC,EACjC,IAAM,OAAO,8DAA8B,CAC7C,EAgBO,SAASC,EAAsB,CACpC,eAAAC,EACA,QAAAC,CACF,EAA8B,CAC5B,GAAM,CAACC,EAAMC,CAAO,EAAIC,EAA+B,SAAS,EAC1DC,EAAaL,EAAe,cAAc,CAAC,EAEjD,GAAI,CAACK,EACH,OAAO,KAGT,IAAMC,EAEAD,EAAW,wBAGXE,EAAWD,EAAM,SAAS,OAC1BE,EACJN,IAAS,UAAYI,EAAM,qBAAuBA,EAAM,oBACpDG,EACJP,IAAS,UACLI,EAAM,uBACNA,EAAM,sBACNI,EACJR,IAAS,UACLI,EAAM,4BACNA,EAAM,2BACNK,EACJT,IAAS,UAAYI,EAAM,cAAgBA,EAAM,aAE7CM,EACJV,IAAS,UAAY,KAAOI,EAAM,mCAE9BO,EACJX,IAAS,UAAY,KAAOI,EAAM,+BAE9BQ,EACJZ,IAAS,UAAYI,EAAM,qBAAuBA,EAAM,oBAEpDS,EACJb,IAAS,UACLI,EAAM,2BACNA,EAAM,0BACNU,EACJd,IAAS,UACLI,EAAM,gCACNA,EAAM,+BAENW,EAAY,CAChB,CACE,KAAM,eACN,MAAOT,EACP,MAAOP,GAAS,aAAa,aAAe,SAC9C,EACA,CACE,KAAM,gBACN,MAAOS,EACP,MAAOT,GAAS,aAAa,eAAiB,SAChD,CACF,EAEA,OAAIc,GACFE,EAAU,KAAK,CACb,KAAM,WACN,MAAOR,GAAiB,EACxB,MAAOR,GAAS,aAAa,UAAY,SAC3C,CAAC,EAIDL,EAAAF,EAAA,CACE,UAAAE,EAAC,OAAI,UAAU,0GACb,UAAAA,EAAC,OAAI,UAAU,6CACb,UAAAA,EAAC,MAAG,UAAU,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,GACF,EAECN,GAAS,WACRN,EAACE,EAAA,CACC,UAAWoB,EACX,SAAUV,EACZ,GAEJ,GACF,CAEJ,CA3KgB4B,EAAApC,EAAA","names":["lazy","useState","Fragment","jsx","jsxs","CostCalculatorResultsChart","lazy","CostCalculatorResults","employmentData","options","view","setView","useState","employment","costs","currency","grossSalary","benefitsTotal","contributionsTotal","totalCost","extraStatutoryPaymentsBreakdown","extraStatutoryPaymentsTotal","indirectTax","benefitsBreakdown","contributionsBreakdown","chartData","Badge","Tabs","v","TabsList","TabsTrigger","cn","Card","CardHeader","CardTitle","CardDescription","CardContent","CostCalculatorGrossSalary","CostCalculatorBenefitsBreakdown","CostCalculatorContributionsBreakdown","CostCalculatorExtraStatutoryPaymentsBreakdown","CostCalculatorIndirectTax","CostCalculatorTotalCost","__name"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/CostCalculator/CostCalculatorResetButton.tsx"],"sourcesContent":["import { Button } from '@/src/components/ui/button';\nimport { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useCostCalculatorContext } from './context';\nimport { cn } from '@/src/lib/utils';\nimport { useFormFields } from '@/src/context';\n\nexport function CostCalculatorResetButton({\n children,\n ...props\n}: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> &\n Record<string, unknown>) {\n const { form, formId, costCalculatorBag } = useCostCalculatorContext();\n const { components } = useFormFields();\n\n const CustomButton = components?.button;\n if (CustomButton) {\n return (\n <CustomButton\n {...props}\n type=\"reset\"\n form={formId}\n onClick={(evt) => {\n costCalculatorBag?.resetForm();\n form.reset();\n props.onClick?.(evt);\n }}\n >\n {children}\n </CustomButton>\n );\n }\n\n return (\n <Button\n {...props}\n type=\"reset\"\n className={cn(\n 'RemoteFlows__CostCalculatorForm__ResetButton',\n props.className,\n )}\n form={formId}\n onClick={(evt) => {\n costCalculatorBag?.resetForm();\n form.reset();\n props.onClick?.(evt);\n }}\n >\n {children}\n </Button>\n );\n}\n"],"mappings":"wMAiBM,cAAAA,MAAA,oBAXC,SAASC,EAA0B,CACxC,SAAAC,EACA,GAAGC,CACL,EAC2B,CACzB,GAAM,CAAE,KAAAC,EAAM,OAAAC,EAAQ,kBAAAC,CAAkB,EAAIC,EAAyB,EAC/D,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAeF,GAAY,OACjC,OAAIE,EAEAV,EAACU,EAAA,CACE,GAAGP,EACJ,KAAK,QACL,KAAME,EACN,QAAUM,GAAQ,CAChBL,GAAmB,UAAU,EAC7BF,EAAK,MAAM,EACXD,EAAM,UAAUQ,CAAG,CACrB,EAEC,SAAAT,EACH,EAKFF,EAACY,EAAA,CACE,GAAGT,EACJ,KAAK,QACL,UAAWU,EACT,+CACAV,EAAM,SACR,EACA,KAAME,EACN,QAAUM,GAAQ,CAChBL,GAAmB,UAAU,EAC7BF,EAAK,MAAM,EACXD,EAAM,UAAUQ,CAAG,CACrB,EAEC,SAAAT,EACH,CAEJ,CA5CgBY,EAAAb,EAAA","names":["jsx","CostCalculatorResetButton","children","props","form","formId","costCalculatorBag","useCostCalculatorContext","components","useFormFields","CustomButton","evt","Button","cn","__name"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ui/basic-tooltip.tsx"],"sourcesContent":["export const BasicTooltip = ({\n children,\n content,\n}: {\n children: React.ReactNode;\n content: React.ReactNode;\n}) => {\n return (\n <div className=\"relative inline-block group\">\n {children}\n <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\">\n {content}\n <div className=\"absolute top-full right-3 border-4 border-transparent border-t-gray-900\"></div>\n </div>\n </div>\n );\n};\n"],"mappings":"wCAUM,OAEE,OAAAA,EAFF,QAAAC,MAAA,oBAVC,IAAMC,EAAeC,EAAA,CAAC,CAC3B,SAAAC,EACA,QAAAC,CACF,IAKIJ,EAAC,OAAI,UAAU,8BACZ,UAAAG,EACDH,EAAC,OAAI,UAAU,4NACZ,UAAAI,EACDL,EAAC,OAAI,UAAU,0EAA0E,GAC3F,GACF,EAdwB","names":["jsx","jsxs","BasicTooltip","__name","children","content"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/CostCalculator/components/SalaryField.tsx"],"sourcesContent":["import { CurrencyConversionField } from '@/src/components/form/fields/CurrencyConversionField';\nimport { ZendeskTriggerButton } from '@/src/components/shared/zendesk-drawer/ZendeskTriggerButton';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { useEffect } from 'react';\nimport { useFormContext } from 'react-hook-form';\n\ntype SalaryFieldProps = JSFField & {\n currencies: {\n from: string;\n to: string;\n };\n salary_conversion_properties?: {\n label?: string;\n description?: string;\n };\n conversionType?: 'spread' | 'no_spread';\n shouldSwapOrder: boolean;\n defaultValue?: string;\n};\n\nexport const SalaryField = ({\n currencies: { from, to },\n shouldSwapOrder,\n salary_conversion_properties,\n conversionType = 'no_spread',\n defaultValue,\n ...props\n}: SalaryFieldProps) => {\n const { setValue, getValues } = useFormContext();\n\n const conversionProperties = {\n label: salary_conversion_properties?.label || 'Salary conversion',\n description: salary_conversion_properties?.description || (\n <>\n The conversion is based on the Remote FX rate.{' '}\n <ZendeskTriggerButton\n className=\"text-sm\"\n zendeskId={zendeskArticles.remoteFxRate}\n >\n Learn more ↗\n </ZendeskTriggerButton>\n </>\n ),\n };\n\n const mainFieldName = shouldSwapOrder ? 'salary_conversion' : props.name;\n const conversionFieldName = shouldSwapOrder\n ? props.name\n : 'salary_conversion';\n\n useEffect(() => {\n if (shouldSwapOrder && defaultValue) {\n setValue('salary_conversion', defaultValue);\n setValue('salary_converted', 'salary_conversion');\n }\n }, [shouldSwapOrder, defaultValue, setValue, getValues]);\n\n return (\n <CurrencyConversionField\n {...props}\n sourceCurrency={from}\n targetCurrency={to}\n mainFieldName={mainFieldName}\n conversionFieldName={conversionFieldName}\n conversionProperties={conversionProperties}\n classNamePrefix=\"RemoteFlows-Salary\"\n conversionType={conversionType}\n />\n );\n};\n"],"mappings":"mMAIA,OAAS,aAAAA,MAAiB,QA8BpB,mBAAAC,EAEE,OAAAC,EAFF,QAAAC,MAAA,oBAbC,IAAMC,EAAcC,EAAA,CAAC,CAC1B,WAAY,CAAE,KAAAC,EAAM,GAAAC,CAAG,EACvB,gBAAAC,EACA,6BAAAC,EACA,eAAAC,EAAiB,YACjB,aAAAC,EACA,GAAGC,CACL,IAAwB,CACtB,GAAM,CAAE,SAAAC,EAAU,UAAAC,CAAU,EAAIC,EAAe,EAEzCC,EAAuB,CAC3B,MAAOP,GAA8B,OAAS,oBAC9C,YAAaA,GAA8B,aACzCN,EAAAF,EAAA,CAAE,2DAC+C,IAC/CC,EAACe,EAAA,CACC,UAAU,UACV,UAAWC,EAAgB,aAC5B,6BAED,GACF,CAEJ,EAEMC,EAAgBX,EAAkB,oBAAsBI,EAAM,KAC9DQ,EAAsBZ,EACxBI,EAAM,KACN,oBAEJ,OAAAS,EAAU,IAAM,CACVb,GAAmBG,IACrBE,EAAS,oBAAqBF,CAAY,EAC1CE,EAAS,mBAAoB,mBAAmB,EAEpD,EAAG,CAACL,EAAiBG,EAAcE,EAAUC,CAAS,CAAC,EAGrDZ,EAACoB,EAAA,CACE,GAAGV,EACJ,eAAgBN,EAChB,eAAgBC,EAChB,cAAeY,EACf,oBAAqBC,EACrB,qBAAsBJ,EACtB,gBAAgB,qBAChB,eAAgBN,EAClB,CAEJ,EAjD2B","names":["useEffect","Fragment","jsx","jsxs","SalaryField","__name","from","to","shouldSwapOrder","salary_conversion_properties","conversionType","defaultValue","props","setValue","getValues","useFormContext","conversionProperties","ZendeskTriggerButton","zendeskArticles","mainFieldName","conversionFieldName","useEffect","CurrencyConversionField"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/CostCalculator/Results/CostCalculatorGrossSalary.tsx"],"sourcesContent":["import { Separator } from '@/src/components/ui/separator';\nimport { formatCurrency } from '@/src/lib/utils';\nimport { BasicTooltip } from '@/src/components/ui/basic-tooltip';\nimport { Button } from '@/src/components/ui/button';\nimport { Info } from 'lucide-react';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { ZendeskTriggerButton } from '@/src/components/shared/zendesk-drawer/ZendeskTriggerButton';\n\ntype CostCalculatorGrossSalaryProps = {\n grossSalary: number;\n currency: string;\n hasExtraStatutoryPayment?: boolean;\n};\n\nexport function CostCalculatorGrossSalary({\n grossSalary,\n currency,\n hasExtraStatutoryPayment = false,\n}: CostCalculatorGrossSalaryProps) {\n return (\n <div>\n <div className=\"flex justify-between items-center mb-2\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-medium text-primary-foreground\">Gross Salary</h3>\n {hasExtraStatutoryPayment && (\n <BasicTooltip\n content={\n <>\n <span>\n This country respects extra payments on top of the gross\n salary.\n </span>{' '}\n <ZendeskTriggerButton\n zendeskId={zendeskArticles.extraPayments}\n >\n Learn more\n </ZendeskTriggerButton>\n </>\n }\n >\n <Button variant=\"ghost\" size=\"icon\" className=\"h-4 w-4 p-0 mt-2\">\n <Info className=\"h-3 w-3 text-gray-400\" />\n <span className=\"sr-only\">Info</span>\n </Button>\n </BasicTooltip>\n )}\n </div>\n <span className=\"font-semibold text-lg\">\n {formatCurrency(grossSalary, currency)}\n </span>\n </div>\n <Separator />\n </div>\n );\n}\n"],"mappings":"mRAIA,OAAS,QAAAA,MAAY,eAmBX,OAIM,YAAAC,EAJN,OAAAC,EAIM,QAAAC,MAJN,oBATH,SAASC,EAA0B,CACxC,YAAAC,EACA,SAAAC,EACA,yBAAAC,EAA2B,EAC7B,EAAmC,CACjC,OACEJ,EAAC,OACC,UAAAA,EAAC,OAAI,UAAU,yCACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAAC,MAAG,UAAU,sCAAsC,wBAAY,EAC/DK,GACCL,EAACM,EAAA,CACC,QACEL,EAAAF,EAAA,CACE,UAAAC,EAAC,QAAK,4EAGN,EAAQ,IACRA,EAACO,EAAA,CACC,UAAWC,EAAgB,cAC5B,sBAED,GACF,EAGF,SAAAP,EAACQ,EAAA,CAAO,QAAQ,QAAQ,KAAK,OAAO,UAAU,mBAC5C,UAAAT,EAACU,EAAA,CAAK,UAAU,wBAAwB,EACxCV,EAAC,QAAK,UAAU,UAAU,gBAAI,GAChC,EACF,GAEJ,EACAA,EAAC,QAAK,UAAU,wBACb,SAAAW,EAAeR,EAAaC,CAAQ,EACvC,GACF,EACAJ,EAACY,EAAA,EAAU,GACb,CAEJ,CAxCgBC,EAAAX,EAAA","names":["Info","Fragment","jsx","jsxs","CostCalculatorGrossSalary","grossSalary","currency","hasExtraStatutoryPayment","BasicTooltip","ZendeskTriggerButton","zendeskArticles","Button","Info","formatCurrency","Separator","__name"]}
@@ -1,2 +0,0 @@
1
- import{a as N,b as v,c as A,d as w}from"./chunk-T3L72MV6.js";import{a as T}from"./chunk-ILMVHOL2.js";import{a as h}from"./chunk-NBCZF2FO.js";import{a as E}from"./chunk-5I6VWJSC.js";import{a as x}from"./chunk-Y4VNFI7K.js";import{b as C}from"./chunk-CSK44J23.js";import{a as c,b as r}from"./chunk-3LOVCTCN.js";import{a as d}from"./chunk-P37U34EQ.js";import{MoreHorizontal as M}from"lucide-react";import{useState as H}from"react";import{Fragment as S,jsx as _,jsxs as I}from"react/jsx-runtime";function B({actions:e=[],className:s}){let[a,l]=H(!1);return I("div",{className:c("relative",s),children:[_(C,{variant:"ghost",className:"h-8 w-8 p-0",onClick:()=>l(!a),children:_(M,{className:"h-4 w-4"})}),a&&I(S,{children:[_("div",{className:"fixed inset-0 z-40",onClick:()=>l(!1)}),_("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((i,u)=>_("button",{className:c("w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100",i.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>{i.onClick(),l(!1)},disabled:i.disabled,children:i.label},u))})]})]})}d(B,"ActionsDropdown");import{ChevronDown as z,Info as L}from"lucide-react";import P from"react-flagpack";import{useState as D}from"react";import{Fragment as p,jsx as n,jsxs as t}from"react/jsx-runtime";var U=d(({title:e,country:s,region:a,onDelete:l,onExportPdf:i})=>{let u=[{label:"Edit",onClick:d(()=>{},"onClick"),disabled:!0},{label:"Export",onClick:i},{label:"Delete",onClick:l}];return t("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[t("div",{className:"flex flex-row items-center gap-6",children:[n("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-[#F4F4F5]",children:n(P,{code:s.alpha_2_code})}),t("div",{className:"space-y-1",children:[n("h2",{className:"text-lg font-medium leading-none text-[#181818]",children:e}),t("p",{className:"text-xs text-[#71717A]",children:[s.name," ",a?` (${a.name})`:""]})]})]}),n(B,{className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),j=d(()=>({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 our Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrolment.",zendeskArticleId:h.employeeOnboardingTimeline}),"getOnboardingTimelineData");function G({minimumOnboardingDays:e,data:s,className:a}){return n(N,{type:"single",collapsible:!0,className:c("RemoteFlows__EstimationResults__OnboardingTimeline w-full",a),children:t(v,{value:"timeline",className:"border-border",children:[n(A,{className:"hover:no-underline px-0 py-4",children:t("div",{className:"flex items-center justify-between w-full",children:[n("span",{className:"text-base font-medium text-[#0F172A]",children:"Onboarding timeline"}),t("span",{className:"text-base text-muted-foreground mr-4",children:[e," days"]})]})}),t(w,{className:"px-0 pb-4",children:[n("ul",{className:"list-disc list-inside space-y-2",children:s.steps.map(l=>t("li",{children:[n("strong",{className:"font-medium text-[#09090B]",children:l.title})," ","- ",l.description]},l.id))}),t("p",{className:"text-xs text-muted-foreground mt-4",children:[s.helpText,s.zendeskArticleId&&n(x,{zendeskId:s.zendeskArticleId,children:"Learn more"})]})]})]})})}d(G,"OnboardingTimeline");function Z({className:e,countryBenefitsUrl:s,countryGuideUrl:a,country:l}){return n(N,{type:"single",collapsible:!0,className:c("RemoteFlows__EstimationResults__HiringSection w-full",e),children:t(v,{value:"timeline",className:"border-border",children:[n(A,{className:"hover:no-underline px-0 py-4",children:n("div",{className:"flex items-center justify-between w-full",children:t("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",l.name]})})}),n(w,{children:t("div",{className:"flex flex-col gap-1",children:[n("a",{href:a,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),n("a",{href:s,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}d(Z,"HiringSection");function $({isMultipleCurrency:e,className:s}){return t("div",{className:c("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",s),children:[n("span",{"aria-hidden":!0}),e?t(p,{children:[n("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),n("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):t(p,{children:[n("span",{}),n("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}d($,"EstimationHeaders");function F({label:e,amounts:s,className:a,isHeader:l=!1,isCollapsible:i=!1,children:u}){let[m,b]=D(!0);return t("div",{className:c("RemoteFlows__EstimationResults__Row",a),children:[t("div",{className:"grid grid-cols-3 items-center",children:[t("div",{className:"flex items-center gap-2",children:[n("span",{className:c("min-w-[140px]",l?"font-medium text-[#09090B]":""),children:e}),i&&n("button",{onClick:()=>b(!m),className:"p-1 hover:bg-gray-100 rounded",children:n(z,{className:`h-4 w-4 text-muted-foreground transition-transform ${m?"rotate-180":""}`})})]}),Array.isArray(s)?s.map((g,f)=>n("span",{className:c("text-right",l?"font-medium text-[#09090B]":""),children:g},f)):t(p,{children:[n("span",{}),n("span",{className:c("text-right",l?"font-medium text-[#09090B]":""),children:s})]})]}),i&&m&&u&&n("div",{className:"mt-4",children:u})]})}d(F,"EstimationRow");function V({item:e,isMultipleCurrency:s,level:a=0}){let[l,i]=D(!1),u=e.children&&e.children.length>0,m=a>0;return t("li",{className:c("pb-3",m&&"pb-1"),children:[t("div",{className:c(s?"grid grid-cols-3 items-center justify-between":"grid grid-cols-2 items-center justify-between"),children:[t("div",{className:c("flex items-center gap-2",m&&"pl-3"),children:[!m&&n("span",{className:"w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0","aria-hidden":"true"}),n("span",{className:c(m?"text-xs text-[#71717A]":"text-sm text-[#09090B]"),children:e.label}),e.tooltip&&n(T,{content:t(p,{children:[n("span",{children:e.tooltip})," ",e.zendeskId&&n(x,{zendeskId:Number(e.zendeskId),children:"Learn more"})]}),children:n("button",{className:"p-1 hover:bg-gray-100 rounded",children:n(L,{className:c("text-muted-foreground",m?"h-3 w-3":"h-4 w-4")})})}),(e.isCollapsible||u)&&n("button",{onClick:()=>i(!l),className:"p-1 hover:bg-gray-100 rounded",children:n(z,{className:`h-3 w-3 text-muted-foreground transition-transform ${l?"rotate-180":""}`})})]}),s?t(p,{children:[n("span",{className:c("text-sm text-right",m?"text-[#71717A]":"text-[#09090B]"),children:e.regionalAmount||"\u2014"}),n("span",{className:c("text-sm text-right",m?"text-[#71717A]":"text-[#09090B]"),children:e.employerAmount||"\u2014"})]}):n("span",{className:c("text-sm text-right",m?"text-[#71717A]":"text-[#09090B]"),children:e.regionalAmount||"\u2014"})]}),u&&l&&n("div",{className:"mt-1",children:n(k,{items:e.children,isMultipleCurrency:s,level:a+1})})]})}d(V,"BreakdownListItem");function k({items:e,isMultipleCurrency:s,className:a,level:l}){return n("ul",{className:c("list-none",a),children:e.map((i,u)=>n(V,{item:i,isMultipleCurrency:s,level:l},u))})}d(k,"BreakdownList");var me=d(({estimation:e,title:s,components:a,onDelete:l,onExportPdf:i})=>{let u=a?.HiringSection||Z,m=a?.OnboardingTimeline||G,b=a?.Header||U,g=a?.Footer,f=j(),y=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,R=e.employer_currency_costs.monthly_management_fee,O=e.region.code!==e.country.code;return t(E,{className:"RemoteFlows__EstimationResults__Card p-10",children:[n("div",{className:"RemoteFlows__Separator",children:n(b,{title:s,region:O?e.region:void 0,country:e.country,onDelete:l,onExportPdf:i})}),t("div",{className:"RemoteFlows__Separator",children:[n($,{isMultipleCurrency:y,className:"mb-3"}),n(F,{label:"Monthly total cost",amounts:y?[r(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),r(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.symbol)]:r(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),isHeader:!0,isCollapsible:!0,children:n(k,{items:[{label:"Gross monthly salary",regionalAmount:r(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:r(e.employer_currency_costs.monthly_gross_salary,e.employer_currency_costs.currency.symbol),zendeskId:h.extraPayments.toString(),tooltip:"This country respects extra payments on top of the gross salary."},{label:"Mandatory employer costs",regionalAmount:r(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:r(e.employer_currency_costs.monthly_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_contributions_breakdown?.map(o=>({label:o.name,regionalAmount:r(o.amount,e.regional_currency_costs.currency.symbol),employerAmount:r(o.amount,e.employer_currency_costs.currency.symbol),zendeskId:o.zendesk_article_id||void 0,tooltip:o.description||void 0}))||[]},{label:"Core benefits",regionalAmount:r(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:r(e.employer_currency_costs.monthly_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_benefits_breakdown?.map(o=>({label:o.name,regionalAmount:r(o.amount,e.regional_currency_costs.currency.symbol),employerAmount:r(o.amount,e.employer_currency_costs.currency.symbol),zendeskId:o.zendesk_article_id||void 0,tooltip:o.description||void 0}))||[]},...R?[{label:"Management fee",regionalAmount:r(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:r(e.employer_currency_costs.monthly_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:y})})]}),n("div",{className:"RemoteFlows__Separator",children:n(F,{label:"Annual total cost",amounts:y?[r(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),r(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.symbol)]:r(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),isHeader:!0,isCollapsible:!0,children:n(k,{items:[{label:"Annual gross salary",regionalAmount:r(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:r(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.symbol)},{label:"Mandatory employer costs",regionalAmount:r(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:r(e.employer_currency_costs.annual_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_contributions_breakdown?.map(o=>({label:o.name,regionalAmount:r(o.amount,e.regional_currency_costs.currency.symbol),employerAmount:r(o.amount,e.employer_currency_costs.currency.symbol),zendeskId:o.zendesk_article_id||void 0,tooltip:o.description||void 0}))||[]},{label:"Core benefits",regionalAmount:r(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:r(e.employer_currency_costs.annual_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_benefits_breakdown?.map(o=>({label:o.name,regionalAmount:r(o.amount,e.regional_currency_costs.currency.symbol),employerAmount:r(o.amount,e.employer_currency_costs.currency.symbol),zendeskId:o.zendesk_article_id||void 0,tooltip:o.description||void 0}))||[]},{label:"Extra statutory payments",regionalAmount:r(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.symbol),employerAmount:r(e.employer_currency_costs.extra_statutory_payments_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.extra_statutory_payments_breakdown?.map(o=>({label:o.name,regionalAmount:r(o.amount,e.regional_currency_costs.currency.symbol),employerAmount:r(o.amount,e.employer_currency_costs.currency.symbol),zendeskId:o.zendesk_article_id||void 0,tooltip:o.description||void 0}))||[]},...R?[{label:"Management fee",regionalAmount:r(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:r(e.employer_currency_costs.annual_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:y})})}),n("div",{className:"RemoteFlows__Separator",children:n(m,{minimumOnboardingDays:e.minimum_onboarding_time,data:f})}),n(u,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),g&&n(g,{})]})},"EstimationResults");export{me as a};
2
- //# sourceMappingURL=chunk-MCPVKP6Q.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/shared/actions-dropdown/ActionsDropdown.tsx","../src/flows/CostCalculator/EstimationResults/EstimationResults.tsx"],"sourcesContent":["import { Button } from '@/src/components/ui/button';\nimport { cn } from '@/src/lib/utils';\nimport { MoreHorizontal } from 'lucide-react';\nimport { useState, type ReactNode } from 'react';\n\nexport interface DropdownAction {\n label: string;\n icon?: ReactNode;\n onClick: () => void;\n separator?: boolean;\n disabled?: boolean;\n}\n\ninterface ActionsDropdownProps {\n actions?: DropdownAction[];\n className?: string;\n}\n\nexport function ActionsDropdown({\n actions = [],\n className,\n}: ActionsDropdownProps) {\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n <div className={cn('relative', className)}>\n <Button\n variant=\"ghost\"\n className=\"h-8 w-8 p-0\"\n onClick={() => setIsOpen(!isOpen)}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n </Button>\n\n {isOpen && (\n <>\n <div\n className=\"fixed inset-0 z-40\"\n onClick={() => setIsOpen(false)}\n />\n <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]\">\n {actions.map((action, index) => (\n <button\n key={index}\n className={cn(\n 'w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100',\n action.disabled && 'opacity-50 cursor-not-allowed',\n )}\n onClick={() => {\n action.onClick();\n setIsOpen(false);\n }}\n disabled={action.disabled}\n >\n {action.label}\n </button>\n ))}\n </div>\n </>\n )}\n </div>\n );\n}\n","import {\n CostCalculatorEmployment,\n MinimalCountry,\n MinimalRegion,\n} from '@/src/client';\nimport { ActionsDropdown } from '@/src/components/shared/actions-dropdown/ActionsDropdown';\nimport { Card } from '@/src/components/ui/card';\nimport { ChevronDown, Info } from 'lucide-react';\nimport Flag from 'react-flagpack';\nimport { useState } from 'react';\nimport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from '@/src/components/ui/accordion';\nimport { cn, formatCurrency } from '@/src/lib/utils';\nimport { ZendeskTriggerButton } from '@/src/components/shared/zendesk-drawer/ZendeskTriggerButton';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { BasicTooltip } from '@/src/components/ui/basic-tooltip';\n\nconst EstimationResultsHeader = ({\n title,\n country,\n region,\n onDelete,\n onExportPdf,\n}: {\n title: string;\n country: MinimalCountry;\n region?: MinimalRegion;\n onDelete: () => void;\n onExportPdf: () => void;\n}) => {\n const actions = [\n {\n label: 'Edit',\n onClick: () => {},\n disabled: true,\n },\n {\n label: 'Export',\n onClick: onExportPdf,\n },\n {\n label: 'Delete',\n onClick: onDelete,\n },\n ];\n return (\n <div className=\"RemoteFlows__EstimationResults__Header flex justify-between\">\n <div className=\"flex flex-row items-center gap-6\">\n <div className=\"flex h-12 w-12 items-center justify-center rounded-lg bg-[#F4F4F5]\">\n <Flag code={country.alpha_2_code} />\n </div>\n <div className=\"space-y-1\">\n <h2 className=\"text-lg font-medium leading-none text-[#181818]\">\n {title}\n </h2>\n <p className=\"text-xs text-[#71717A]\">\n {country.name} {region ? ` (${region.name})` : ''}\n </p>\n </div>\n </div>\n <ActionsDropdown\n className=\"RemoteFlows__EstimationResults__ActionsDropdown\"\n actions={actions}\n />\n </div>\n );\n};\n\ninterface OnboardingTimelineStep {\n title: string;\n description: string;\n id: string;\n}\n\ninterface OnboardingTimelineData {\n steps: OnboardingTimelineStep[];\n helpText: string;\n zendeskArticleId?: number;\n}\n\nconst getOnboardingTimelineData = (): OnboardingTimelineData => {\n return {\n steps: [\n {\n id: 'add-employment-details',\n title: 'Add employment details',\n description: 'You add employee employments details.',\n },\n {\n id: 'invite-employee',\n title: 'Invite employee',\n description:\n 'Hire receives an email invitation from Remote to start the self-enrollment process.',\n },\n {\n id: 'verify-information',\n title: 'Verify information',\n description:\n 'Remote prepares the Employment Agreement and verifies all the information.',\n },\n {\n id: 'sign-contract',\n title: 'Sign contract',\n description:\n 'All parties sign the Employment Agreement and are ready to start. 🎉',\n },\n ],\n helpText:\n 'For customers who accept our Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrolment.',\n zendeskArticleId: zendeskArticles.employeeOnboardingTimeline,\n };\n};\n\nfunction OnboardingTimeline({\n minimumOnboardingDays,\n data,\n className,\n}: {\n minimumOnboardingDays: number | null;\n data: OnboardingTimelineData;\n className?: string;\n}) {\n return (\n <Accordion\n type=\"single\"\n collapsible\n className={cn(\n 'RemoteFlows__EstimationResults__OnboardingTimeline w-full',\n className,\n )}\n >\n <AccordionItem value=\"timeline\" className=\"border-border\">\n <AccordionTrigger className=\"hover:no-underline px-0 py-4\">\n <div className=\"flex items-center justify-between w-full\">\n <span className=\"text-base font-medium text-[#0F172A]\">\n Onboarding timeline\n </span>\n <span className=\"text-base text-muted-foreground mr-4\">\n {minimumOnboardingDays} days\n </span>\n </div>\n </AccordionTrigger>\n <AccordionContent className=\"px-0 pb-4\">\n <ul className=\"list-disc list-inside space-y-2\">\n {data.steps.map((step) => (\n <li key={step.id}>\n <strong className=\"font-medium text-[#09090B]\">\n {step.title}\n </strong>{' '}\n - {step.description}\n </li>\n ))}\n </ul>\n <p className=\"text-xs text-muted-foreground mt-4\">\n {data.helpText}\n {data.zendeskArticleId && (\n <ZendeskTriggerButton zendeskId={data.zendeskArticleId}>\n Learn more\n </ZendeskTriggerButton>\n )}\n </p>\n </AccordionContent>\n </AccordionItem>\n </Accordion>\n );\n}\n\nfunction HiringSection({\n className,\n countryBenefitsUrl,\n countryGuideUrl,\n country,\n}: {\n className?: string;\n countryBenefitsUrl: string;\n countryGuideUrl: string;\n country: MinimalCountry;\n}) {\n return (\n <Accordion\n type=\"single\"\n collapsible\n className={cn(\n 'RemoteFlows__EstimationResults__HiringSection w-full',\n className,\n )}\n >\n <AccordionItem value=\"timeline\" className=\"border-border\">\n <AccordionTrigger className=\"hover:no-underline px-0 py-4\">\n <div className=\"flex items-center justify-between w-full\">\n <span className=\"text-base font-medium text-[#0F172A]\">\n Hiring in {country.name}\n </span>\n </div>\n </AccordionTrigger>\n <AccordionContent>\n <div className=\"flex flex-col gap-1\">\n <a\n href={countryGuideUrl}\n target=\"_blank\"\n className=\"RemoteFlows__Link\"\n >\n Explore our complete guide ↗\n </a>\n <a\n href={countryBenefitsUrl}\n target=\"_blank\"\n className=\"RemoteFlows__Link\"\n >\n Explore our available benefits ↗\n </a>\n </div>\n </AccordionContent>\n </AccordionItem>\n </Accordion>\n );\n}\n\nfunction EstimationHeaders({\n isMultipleCurrency,\n className,\n}: {\n isMultipleCurrency: boolean;\n className?: string;\n}) {\n return (\n <div\n className={cn(\n 'RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center',\n className,\n )}\n >\n <span aria-hidden />\n {isMultipleCurrency ? (\n <>\n <span className=\"RemoteFlows__EstimationResults__Headers__Label\">\n Employee currency\n </span>\n <span className=\"RemoteFlows__EstimationResults__Headers__Label\">\n Employer currency\n </span>\n </>\n ) : (\n <>\n <span></span>\n <span className=\"RemoteFlows__EstimationResults__Headers__Label\">\n Amount\n </span>\n </>\n )}\n </div>\n );\n}\n\nfunction EstimationRow({\n label,\n amounts,\n className,\n isHeader = false,\n isCollapsible = false,\n children,\n}: {\n label: string | React.ReactNode;\n amounts: string | string[];\n className?: string;\n isHeader?: boolean;\n isCollapsible?: boolean;\n children?: React.ReactNode;\n}) {\n const [isOpen, setIsOpen] = useState(true);\n\n return (\n <div className={cn('RemoteFlows__EstimationResults__Row', className)}>\n <div className=\"grid grid-cols-3 items-center\">\n <div className=\"flex items-center gap-2\">\n <span\n className={cn(\n 'min-w-[140px]',\n isHeader ? 'font-medium text-[#09090B]' : '',\n )}\n >\n {label}\n </span>\n {isCollapsible && (\n <button\n onClick={() => setIsOpen(!isOpen)}\n className=\"p-1 hover:bg-gray-100 rounded\"\n >\n <ChevronDown\n className={`h-4 w-4 text-muted-foreground transition-transform ${\n isOpen ? 'rotate-180' : ''\n }`}\n />\n </button>\n )}\n </div>\n\n {Array.isArray(amounts) ? (\n amounts.map((amount, index) => (\n <span\n key={index}\n className={cn(\n 'text-right',\n isHeader ? 'font-medium text-[#09090B]' : '',\n )}\n >\n {amount}\n </span>\n ))\n ) : (\n <>\n <span></span>\n <span\n className={cn(\n 'text-right',\n isHeader ? 'font-medium text-[#09090B]' : '',\n )}\n >\n {amounts}\n </span>\n </>\n )}\n </div>\n\n {/* Collapsible content */}\n {isCollapsible && isOpen && children && (\n <div className=\"mt-4\">{children}</div>\n )}\n </div>\n );\n}\n\ninterface BreakdownItem {\n label: string;\n tooltip?: string;\n regionalAmount?: string;\n employerAmount?: string;\n description?: string;\n zendeskId?: string;\n isCollapsible?: boolean;\n children?: BreakdownItem[];\n}\n\nfunction BreakdownListItem({\n item,\n isMultipleCurrency,\n level = 0,\n}: {\n item: BreakdownItem;\n isMultipleCurrency: boolean;\n level?: number;\n}) {\n const [isOpen, setIsOpen] = useState(false);\n const hasChildren = item.children && item.children.length > 0;\n const isNested = level > 0;\n\n return (\n <li className={cn('pb-3', isNested && 'pb-1')}>\n <div\n className={cn(\n isMultipleCurrency\n ? 'grid grid-cols-3 items-center justify-between'\n : 'grid grid-cols-2 items-center justify-between',\n )}\n >\n <div className={cn('flex items-center gap-2', isNested && 'pl-3')}>\n {!isNested && (\n <span\n className=\"w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0\"\n aria-hidden=\"true\"\n />\n )}\n\n <span\n className={cn(\n isNested ? 'text-xs text-[#71717A]' : 'text-sm text-[#09090B]', // Different colors\n )}\n >\n {item.label}\n </span>\n\n {item.tooltip && (\n <BasicTooltip\n content={\n <>\n <span>{item.tooltip}</span>{' '}\n {item.zendeskId && (\n <ZendeskTriggerButton zendeskId={Number(item.zendeskId)}>\n Learn more\n </ZendeskTriggerButton>\n )}\n </>\n }\n >\n <button className=\"p-1 hover:bg-gray-100 rounded\">\n <Info\n className={cn(\n 'text-muted-foreground',\n isNested ? 'h-3 w-3' : 'h-4 w-4',\n )}\n />\n </button>\n </BasicTooltip>\n )}\n\n {(item.isCollapsible || hasChildren) && (\n <button\n onClick={() => setIsOpen(!isOpen)}\n className=\"p-1 hover:bg-gray-100 rounded\"\n >\n <ChevronDown\n className={`h-3 w-3 text-muted-foreground transition-transform ${\n isOpen ? 'rotate-180' : ''\n }`}\n />\n </button>\n )}\n </div>\n\n {isMultipleCurrency ? (\n <>\n <span\n className={cn(\n 'text-sm text-right',\n isNested ? 'text-[#71717A]' : 'text-[#09090B]',\n )}\n >\n {item.regionalAmount || '—'}\n </span>\n <span\n className={cn(\n 'text-sm text-right',\n isNested ? 'text-[#71717A]' : 'text-[#09090B]',\n )}\n >\n {item.employerAmount || '—'}\n </span>\n </>\n ) : (\n <span\n className={cn(\n 'text-sm text-right',\n isNested ? 'text-[#71717A]' : 'text-[#09090B]',\n )}\n >\n {item.regionalAmount || '—'}\n </span>\n )}\n </div>\n\n {hasChildren && isOpen && (\n <div className=\"mt-1\">\n <BreakdownList\n items={item.children!}\n isMultipleCurrency={isMultipleCurrency}\n level={level + 1}\n />\n </div>\n )}\n </li>\n );\n}\n\ninterface BreakdownListProps {\n items: BreakdownItem[];\n isMultipleCurrency: boolean;\n className?: string;\n level?: number;\n}\n\nfunction BreakdownList({\n items,\n isMultipleCurrency,\n className,\n level,\n}: BreakdownListProps) {\n return (\n <ul className={cn('list-none', className)}>\n {items.map((item, index) => (\n <BreakdownListItem\n key={index}\n item={item}\n isMultipleCurrency={isMultipleCurrency}\n level={level}\n />\n ))}\n </ul>\n );\n}\n\ntype EstimationResultsComponents = {\n HiringSection?: React.ComponentType<{\n country: MinimalCountry;\n countryBenefitsUrl: string;\n countryGuideUrl: string;\n }>;\n OnboardingTimeline?: React.ComponentType<{\n minimumOnboardingDays: number | null;\n data: OnboardingTimelineData;\n }>;\n Header?: React.ComponentType<{\n title: string;\n region?: MinimalRegion;\n country: MinimalCountry;\n onDelete: () => void;\n onExportPdf: () => void;\n }>;\n Footer?: React.ComponentType;\n};\n\ntype EstimationResultsProps = {\n estimation: CostCalculatorEmployment;\n title: string;\n components?: EstimationResultsComponents;\n onDelete: () => void;\n onExportPdf: () => void;\n};\n\nexport const EstimationResults = ({\n estimation,\n title,\n components,\n onDelete,\n onExportPdf,\n}: EstimationResultsProps) => {\n const CustomHiringSection = components?.HiringSection || HiringSection;\n const CustomOnboardingTimeline =\n components?.OnboardingTimeline || OnboardingTimeline;\n const CustomHeader = components?.Header || EstimationResultsHeader;\n const CustomFooter = components?.Footer;\n\n const onboardingTimelineData = getOnboardingTimelineData();\n\n const isMultipleCurrency =\n estimation.employer_currency_costs.currency.code !==\n estimation.regional_currency_costs.currency.code;\n\n const hasManagementFee =\n estimation.employer_currency_costs.monthly_management_fee;\n\n const hasRegion = estimation.region.code !== estimation.country.code;\n\n return (\n <Card className=\"RemoteFlows__EstimationResults__Card p-10\">\n <div className=\"RemoteFlows__Separator\">\n <CustomHeader\n title={title}\n region={hasRegion ? estimation.region : undefined}\n country={estimation.country}\n onDelete={onDelete}\n onExportPdf={onExportPdf}\n />\n </div>\n <div className=\"RemoteFlows__Separator\">\n <EstimationHeaders\n isMultipleCurrency={isMultipleCurrency}\n className=\"mb-3\"\n />\n <EstimationRow\n label=\"Monthly total cost\"\n amounts={\n isMultipleCurrency\n ? [\n formatCurrency(\n estimation.regional_currency_costs.monthly_total,\n estimation.regional_currency_costs.currency.symbol,\n ),\n formatCurrency(\n estimation.employer_currency_costs.monthly_total,\n estimation.employer_currency_costs.currency.symbol,\n ),\n ]\n : formatCurrency(\n estimation.regional_currency_costs.monthly_total,\n estimation.regional_currency_costs.currency.symbol,\n )\n }\n isHeader\n isCollapsible\n >\n <BreakdownList\n items={[\n {\n label: 'Gross monthly salary',\n regionalAmount: formatCurrency(\n estimation.regional_currency_costs.monthly_gross_salary,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n estimation.employer_currency_costs.monthly_gross_salary,\n estimation.employer_currency_costs.currency.symbol,\n ),\n zendeskId: zendeskArticles.extraPayments.toString(),\n tooltip:\n 'This country respects extra payments on top of the gross salary.',\n },\n {\n label: 'Mandatory employer costs',\n regionalAmount: formatCurrency(\n estimation.regional_currency_costs\n .monthly_contributions_total,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n estimation.employer_currency_costs\n .monthly_contributions_total,\n estimation.employer_currency_costs.currency.symbol,\n ),\n children:\n estimation.employer_currency_costs.monthly_contributions_breakdown?.map(\n (item) => ({\n label: item.name,\n regionalAmount: formatCurrency(\n item.amount,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n item.amount,\n estimation.employer_currency_costs.currency.symbol,\n ),\n zendeskId: item.zendesk_article_id || undefined,\n tooltip: item.description || undefined,\n }),\n ) || [],\n },\n {\n label: 'Core benefits',\n regionalAmount: formatCurrency(\n estimation.regional_currency_costs.monthly_benefits_total,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n estimation.employer_currency_costs.monthly_benefits_total,\n estimation.employer_currency_costs.currency.symbol,\n ),\n children:\n estimation.employer_currency_costs.monthly_benefits_breakdown?.map(\n (item) => ({\n label: item.name,\n regionalAmount: formatCurrency(\n item.amount,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n item.amount,\n estimation.employer_currency_costs.currency.symbol,\n ),\n zendeskId: item.zendesk_article_id || undefined,\n tooltip: item.description || undefined,\n }),\n ) || [],\n },\n ...(hasManagementFee\n ? [\n {\n label: 'Management fee',\n regionalAmount: formatCurrency(\n estimation.regional_currency_costs\n .monthly_management_fee,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n estimation.employer_currency_costs\n .monthly_management_fee,\n estimation.employer_currency_costs.currency.symbol,\n ),\n tooltip:\n 'Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more.',\n },\n ]\n : []),\n ]}\n isMultipleCurrency={isMultipleCurrency}\n />\n </EstimationRow>\n </div>\n <div className=\"RemoteFlows__Separator\">\n <EstimationRow\n label=\"Annual total cost\"\n amounts={\n isMultipleCurrency\n ? [\n formatCurrency(\n estimation.regional_currency_costs.annual_total,\n estimation.regional_currency_costs.currency.symbol,\n ),\n formatCurrency(\n estimation.employer_currency_costs.annual_total,\n estimation.employer_currency_costs.currency.symbol,\n ),\n ]\n : formatCurrency(\n estimation.regional_currency_costs.annual_total,\n estimation.regional_currency_costs.currency.symbol,\n )\n }\n isHeader\n isCollapsible\n >\n <BreakdownList\n items={[\n {\n label: 'Annual gross salary',\n regionalAmount: formatCurrency(\n estimation.regional_currency_costs.annual_gross_salary,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n estimation.employer_currency_costs.annual_gross_salary,\n estimation.employer_currency_costs.currency.symbol,\n ),\n },\n {\n label: 'Mandatory employer costs',\n regionalAmount: formatCurrency(\n estimation.regional_currency_costs.annual_contributions_total,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n estimation.employer_currency_costs.annual_contributions_total,\n estimation.employer_currency_costs.currency.symbol,\n ),\n children:\n estimation.employer_currency_costs.annual_contributions_breakdown?.map(\n (item) => ({\n label: item.name,\n regionalAmount: formatCurrency(\n item.amount,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n item.amount,\n estimation.employer_currency_costs.currency.symbol,\n ),\n zendeskId: item.zendesk_article_id || undefined,\n tooltip: item.description || undefined,\n }),\n ) || [],\n },\n {\n label: 'Core benefits',\n regionalAmount: formatCurrency(\n estimation.regional_currency_costs.annual_benefits_total,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n estimation.employer_currency_costs.annual_benefits_total,\n estimation.employer_currency_costs.currency.symbol,\n ),\n children:\n estimation.employer_currency_costs.annual_benefits_breakdown?.map(\n (item) => ({\n label: item.name,\n regionalAmount: formatCurrency(\n item.amount,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n item.amount,\n estimation.employer_currency_costs.currency.symbol,\n ),\n zendeskId: item.zendesk_article_id || undefined,\n tooltip: item.description || undefined,\n }),\n ) || [],\n },\n {\n label: 'Extra statutory payments',\n regionalAmount: formatCurrency(\n estimation.regional_currency_costs\n .extra_statutory_payments_total,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n estimation.employer_currency_costs\n .extra_statutory_payments_total,\n estimation.employer_currency_costs.currency.symbol,\n ),\n children:\n estimation.employer_currency_costs.extra_statutory_payments_breakdown?.map(\n (item) => ({\n label: item.name,\n regionalAmount: formatCurrency(\n item.amount,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n item.amount,\n estimation.employer_currency_costs.currency.symbol,\n ),\n zendeskId: item.zendesk_article_id || undefined,\n tooltip: item.description || undefined,\n }),\n ) || [],\n },\n ...(hasManagementFee\n ? [\n {\n label: 'Management fee',\n regionalAmount: formatCurrency(\n estimation.regional_currency_costs\n .annual_management_fee,\n estimation.regional_currency_costs.currency.symbol,\n ),\n employerAmount: formatCurrency(\n estimation.employer_currency_costs\n .annual_management_fee,\n estimation.employer_currency_costs.currency.symbol,\n ),\n tooltip:\n 'Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more.',\n },\n ]\n : []),\n ]}\n isMultipleCurrency={isMultipleCurrency}\n />\n </EstimationRow>\n </div>\n <div className=\"RemoteFlows__Separator\">\n <CustomOnboardingTimeline\n minimumOnboardingDays={estimation.minimum_onboarding_time}\n data={onboardingTimelineData}\n />\n </div>\n\n <CustomHiringSection\n countryBenefitsUrl={estimation.country_benefits_details_url as string}\n countryGuideUrl={estimation.country_guide_url as string}\n country={estimation.country}\n />\n\n {CustomFooter && <CustomFooter />}\n </Card>\n );\n};\n"],"mappings":"4VAEA,OAAS,kBAAAA,MAAsB,eAC/B,OAAS,YAAAC,MAAgC,QA4BjC,OAIA,YAAAC,EAJA,OAAAC,EAIA,QAAAC,MAJA,oBAbD,SAASC,EAAgB,CAC9B,QAAAC,EAAU,CAAC,EACX,UAAAC,CACF,EAAyB,CACvB,GAAM,CAACC,EAAQC,CAAS,EAAIC,EAAS,EAAK,EAE1C,OACEN,EAAC,OAAI,UAAWO,EAAG,WAAYJ,CAAS,EACtC,UAAAJ,EAACS,EAAA,CACC,QAAQ,QACR,UAAU,cACV,QAAS,IAAMH,EAAU,CAACD,CAAM,EAEhC,SAAAL,EAACU,EAAA,CAAe,UAAU,UAAU,EACtC,EAECL,GACCJ,EAAAF,EAAA,CACE,UAAAC,EAAC,OACC,UAAU,qBACV,QAAS,IAAMM,EAAU,EAAK,EAChC,EACAN,EAAC,OAAI,UAAU,wGACZ,SAAAG,EAAQ,IAAI,CAACQ,EAAQC,IACpBZ,EAAC,UAEC,U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,wBAAwB,SAAS,MAC9C,EACA,eAAgBU,EACdV,EAAW,wBACR,sBACHA,EAAW,wBAAwB,SAAS,MAC9C,EACA,QACE,qIACJ,CACF,EACA,CAAC,CACP,EACA,mBAAoBvB,EACtB,EACF,EACF,EACA7B,EAAC,OAAI,UAAU,yBACb,SAAAA,EAACuD,EAAA,CACC,sBAAuBH,EAAW,wBAClC,KAAMM,EACR,EACF,EAEA1D,EAACsD,EAAA,CACC,mBAAoBF,EAAW,6BAC/B,gBAAiBA,EAAW,kBAC5B,QAASA,EAAW,QACtB,EAECK,GAAgBzD,EAACyD,EAAA,EAAa,GACjC,CAEJ,EA7TiC","names":["MoreHorizontal","useState","Fragment","jsx","jsxs","ActionsDropdown","actions","className","isOpen","setIsOpen","useState","cn","Button","MoreHorizontal","action","index","__name","ChevronDown","Info","Flag","useState","Fragment","jsx","jsxs","EstimationResultsHeader","__name","title","country","region","onDelete","onExportPdf","actions","Flag","ActionsDropdown","getOnboardingTimelineData","zendeskArticles","OnboardingTimeline","minimumOnboardingDays","data","className","Accordion","cn","AccordionItem","AccordionTrigger","AccordionContent","step","ZendeskTriggerButton","HiringSection","countryBenefitsUrl","countryGuideUrl","EstimationHeaders","isMultipleCurrency","EstimationRow","label","amounts","isHeader","isCollapsible","children","isOpen","setIsOpen","useState","ChevronDown","amount","index","BreakdownListItem","item","level","hasChildren","isNested","BasicTooltip","Info","BreakdownList","items","EstimationResults","estimation","components","CustomHiringSection","CustomOnboardingTimeline","CustomHeader","CustomFooter","onboardingTimelineData","hasManagementFee","hasRegion","Card","formatCurrency"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ui/separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\n\nimport { cn } from '@/src/lib/utils';\n\nfunction Separator({\n className,\n orientation = 'horizontal',\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator-root\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Separator };\n"],"mappings":"gFACA,UAAYA,MAAwB,4BAWhC,cAAAC,MAAA,oBAPJ,SAASC,EAAU,CACjB,UAAAC,EACA,YAAAC,EAAc,aACd,WAAAC,EAAa,GACb,GAAGC,CACL,EAAyD,CACvD,OACEL,EAAoB,OAAnB,CACC,YAAU,iBACV,WAAYI,EACZ,YAAaD,EACb,UAAWG,EACT,iKACAJ,CACF,EACC,GAAGG,EACN,CAEJ,CAlBSE,EAAAN,EAAA","names":["SeparatorPrimitive","jsx","Separator","className","orientation","decorative","props","cn","__name"]}