@remoteoss/remote-flows 1.22.0 → 1.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-JTD4HJSK.js → chunk-2MTSUYN6.js} +2 -2
- package/dist/{chunk-IJQBLGTI.js → chunk-2PDHYTZ2.js} +2 -2
- package/dist/{chunk-JBVLUY4M.js → chunk-3MLYDDLK.js} +2 -2
- package/dist/{chunk-AHBNUSR4.js → chunk-4EFT4EBW.js} +2 -2
- package/dist/{chunk-J5I5ZSW3.js → chunk-4EU3AWEX.js} +2 -2
- package/dist/{chunk-67GUBRC6.js → chunk-4Q2FKKQU.js} +2 -2
- package/dist/{chunk-MAOJJ4WX.js → chunk-5MDNW5H7.js} +2 -2
- package/dist/{chunk-E6B4ZECN.js → chunk-5QOEBELF.js} +2 -2
- package/dist/{chunk-XJECSJYB.js → chunk-6ORP3EVR.js} +2 -2
- package/dist/{chunk-SAUF7ZUE.js → chunk-7DRY6YCN.js} +2 -2
- package/dist/{chunk-BRPBSA4E.js → chunk-AKFNSADJ.js} +2 -2
- package/dist/chunk-D4TLSPX5.js +2 -0
- package/dist/chunk-D4TLSPX5.js.map +1 -0
- package/dist/{chunk-LT27CPJ6.js → chunk-D5ABWBC6.js} +2 -2
- package/dist/{chunk-OZWLRF6P.js → chunk-D5K4NBOG.js} +2 -2
- package/dist/{chunk-BNY76RHM.js → chunk-DNVTXLTP.js} +2 -2
- package/dist/{chunk-Y2JE46ZY.js → chunk-FXTOBTW4.js} +2 -2
- package/dist/{chunk-YYGLCI2S.js → chunk-GECXYMDU.js} +2 -2
- package/dist/{chunk-SCEOHA2U.js → chunk-GRE4RCPB.js} +2 -2
- package/dist/{chunk-OC3MVHTM.js → chunk-H3HNBOAE.js} +2 -2
- package/dist/{chunk-C52C6J6Q.js → chunk-HNTEGDI2.js} +2 -2
- package/dist/{chunk-XW7ZYSJ3.js → chunk-HVOYAQHI.js} +2 -2
- package/dist/{chunk-EULZWL2F.js → chunk-IN74TK34.js} +2 -2
- package/dist/{chunk-YVAEVXHP.js → chunk-ITTXYDGV.js} +2 -2
- package/dist/{chunk-KQSWP3Y3.js → chunk-JAZLNJM3.js} +2 -2
- package/dist/{chunk-I3DVKJCW.js → chunk-JEGVULKU.js} +2 -2
- package/dist/{chunk-I3DVKJCW.js.map → chunk-JEGVULKU.js.map} +1 -1
- package/dist/{chunk-KIQNU673.js → chunk-JJMBP6FU.js} +2 -2
- package/dist/{chunk-W5USIIXL.js → chunk-JNMD7SWN.js} +2 -2
- package/dist/{chunk-DPZHLV7U.js → chunk-JVHQ5EG3.js} +2 -2
- package/dist/{chunk-7XLP5WFW.js → chunk-K5HZE7M6.js} +2 -2
- package/dist/{chunk-72TX2GXH.js → chunk-KEFIHTZ2.js} +2 -2
- package/dist/{chunk-QWQPTZQD.js → chunk-KO264IE2.js} +2 -2
- package/dist/chunk-LU265KXN.js +2 -0
- package/dist/{chunk-VZ5BGG3N.js.map → chunk-LU265KXN.js.map} +1 -1
- package/dist/chunk-LXOYWRNU.js +2 -0
- package/dist/{chunk-STF3NTPS.js.map → chunk-LXOYWRNU.js.map} +1 -1
- package/dist/{chunk-KWLKQ6N6.js → chunk-NI3CJNG3.js} +2 -2
- package/dist/{chunk-XAPDPR3N.js → chunk-R7G5G45H.js} +2 -2
- package/dist/{chunk-7Y4XCQZX.js → chunk-RKGD6XC7.js} +2 -2
- package/dist/{chunk-KN5M3VJD.js → chunk-S42DBWAF.js} +2 -2
- package/dist/{chunk-EUQH4FU4.js → chunk-S5VSWHJY.js} +2 -2
- package/dist/{chunk-JD2O7KNE.js → chunk-SQPCNBJC.js} +2 -2
- package/dist/{chunk-UWL56AOZ.js → chunk-TGQTFWAB.js} +2 -2
- package/dist/{chunk-QELEVTDT.js → chunk-TJHW5QSC.js} +2 -2
- package/dist/{chunk-7AFCHGML.js → chunk-U33Q35CB.js} +2 -2
- package/dist/chunk-U4QOJDBZ.js +2 -0
- package/dist/chunk-U4QOJDBZ.js.map +1 -0
- package/dist/{chunk-HGNICQUY.js → chunk-UEDPRIG7.js} +2 -2
- package/dist/{chunk-CT2D4IBR.js → chunk-UTLIN5S6.js} +2 -2
- package/dist/{chunk-TMVRAQYA.js → chunk-UVBIRNQ4.js} +2 -2
- package/dist/{chunk-TZQ2O23Z.js → chunk-V3ZGBTES.js} +2 -2
- package/dist/{chunk-Z7AWT3MQ.js → chunk-VHLCM6IM.js} +2 -2
- package/dist/{chunk-KKOBWE62.js → chunk-VL5TI4XT.js} +2 -2
- package/dist/{chunk-7PTTOR6T.js → chunk-WWXX3PU7.js} +2 -2
- package/dist/{chunk-AQ4WWMOK.js → chunk-X6PTF3PD.js} +2 -2
- package/dist/{chunk-IW6OJUGY.js → chunk-ZEJRVVLJ.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/utils.js +1 -1
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/api.js +1 -1
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +1 -1
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
- package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/ContractorOnboarding/context.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/hooks.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/hooks.js +1 -1
- package/dist/flows/ContractorOnboarding/index.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/ContractorOnboarding/jsfModify.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/types.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/utils.d.ts +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/api.js +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/CreateCompany/CreateCompany.js +1 -1
- package/dist/flows/CreateCompany/api.js +1 -1
- package/dist/flows/CreateCompany/components/AddressDetailsStep.js +1 -1
- package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.js +1 -1
- package/dist/flows/CreateCompany/components/CreateCompanyForm.js +1 -1
- package/dist/flows/CreateCompany/hooks.js +1 -1
- package/dist/flows/CreateCompany/index.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +2 -2
- package/dist/flows/Onboarding/api.js +1 -1
- package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/components/ReviewStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +1 -1
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +1 -1
- package/dist/flows/Onboarding/hooks.d.ts +1 -1
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +1 -1
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +1 -1
- package/dist/flows/Onboarding/utils.d.ts +1 -1
- package/dist/flows/Onboarding/utils.js +1 -1
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/api.d.ts +1 -1
- package/dist/flows/Termination/api.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +1 -1
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +1 -1
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/types.d.ts +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{types-DEfISb39.d.ts → types-BUI5G3ML.d.ts} +1 -1
- package/dist/{types-gQ_Tx-qG.d.ts → types-C0m9mu0v.d.ts} +55 -7
- package/package.json +1 -1
- package/dist/chunk-HPLRAHY7.js +0 -2
- package/dist/chunk-HPLRAHY7.js.map +0 -1
- package/dist/chunk-RQWB2F74.js +0 -2
- package/dist/chunk-RQWB2F74.js.map +0 -1
- package/dist/chunk-STF3NTPS.js +0 -2
- package/dist/chunk-VZ5BGG3N.js +0 -2
- /package/dist/{chunk-JTD4HJSK.js.map → chunk-2MTSUYN6.js.map} +0 -0
- /package/dist/{chunk-IJQBLGTI.js.map → chunk-2PDHYTZ2.js.map} +0 -0
- /package/dist/{chunk-JBVLUY4M.js.map → chunk-3MLYDDLK.js.map} +0 -0
- /package/dist/{chunk-AHBNUSR4.js.map → chunk-4EFT4EBW.js.map} +0 -0
- /package/dist/{chunk-J5I5ZSW3.js.map → chunk-4EU3AWEX.js.map} +0 -0
- /package/dist/{chunk-67GUBRC6.js.map → chunk-4Q2FKKQU.js.map} +0 -0
- /package/dist/{chunk-MAOJJ4WX.js.map → chunk-5MDNW5H7.js.map} +0 -0
- /package/dist/{chunk-E6B4ZECN.js.map → chunk-5QOEBELF.js.map} +0 -0
- /package/dist/{chunk-XJECSJYB.js.map → chunk-6ORP3EVR.js.map} +0 -0
- /package/dist/{chunk-SAUF7ZUE.js.map → chunk-7DRY6YCN.js.map} +0 -0
- /package/dist/{chunk-BRPBSA4E.js.map → chunk-AKFNSADJ.js.map} +0 -0
- /package/dist/{chunk-LT27CPJ6.js.map → chunk-D5ABWBC6.js.map} +0 -0
- /package/dist/{chunk-OZWLRF6P.js.map → chunk-D5K4NBOG.js.map} +0 -0
- /package/dist/{chunk-BNY76RHM.js.map → chunk-DNVTXLTP.js.map} +0 -0
- /package/dist/{chunk-Y2JE46ZY.js.map → chunk-FXTOBTW4.js.map} +0 -0
- /package/dist/{chunk-YYGLCI2S.js.map → chunk-GECXYMDU.js.map} +0 -0
- /package/dist/{chunk-SCEOHA2U.js.map → chunk-GRE4RCPB.js.map} +0 -0
- /package/dist/{chunk-OC3MVHTM.js.map → chunk-H3HNBOAE.js.map} +0 -0
- /package/dist/{chunk-C52C6J6Q.js.map → chunk-HNTEGDI2.js.map} +0 -0
- /package/dist/{chunk-XW7ZYSJ3.js.map → chunk-HVOYAQHI.js.map} +0 -0
- /package/dist/{chunk-EULZWL2F.js.map → chunk-IN74TK34.js.map} +0 -0
- /package/dist/{chunk-YVAEVXHP.js.map → chunk-ITTXYDGV.js.map} +0 -0
- /package/dist/{chunk-KQSWP3Y3.js.map → chunk-JAZLNJM3.js.map} +0 -0
- /package/dist/{chunk-KIQNU673.js.map → chunk-JJMBP6FU.js.map} +0 -0
- /package/dist/{chunk-W5USIIXL.js.map → chunk-JNMD7SWN.js.map} +0 -0
- /package/dist/{chunk-DPZHLV7U.js.map → chunk-JVHQ5EG3.js.map} +0 -0
- /package/dist/{chunk-7XLP5WFW.js.map → chunk-K5HZE7M6.js.map} +0 -0
- /package/dist/{chunk-72TX2GXH.js.map → chunk-KEFIHTZ2.js.map} +0 -0
- /package/dist/{chunk-QWQPTZQD.js.map → chunk-KO264IE2.js.map} +0 -0
- /package/dist/{chunk-KWLKQ6N6.js.map → chunk-NI3CJNG3.js.map} +0 -0
- /package/dist/{chunk-XAPDPR3N.js.map → chunk-R7G5G45H.js.map} +0 -0
- /package/dist/{chunk-7Y4XCQZX.js.map → chunk-RKGD6XC7.js.map} +0 -0
- /package/dist/{chunk-KN5M3VJD.js.map → chunk-S42DBWAF.js.map} +0 -0
- /package/dist/{chunk-EUQH4FU4.js.map → chunk-S5VSWHJY.js.map} +0 -0
- /package/dist/{chunk-JD2O7KNE.js.map → chunk-SQPCNBJC.js.map} +0 -0
- /package/dist/{chunk-UWL56AOZ.js.map → chunk-TGQTFWAB.js.map} +0 -0
- /package/dist/{chunk-QELEVTDT.js.map → chunk-TJHW5QSC.js.map} +0 -0
- /package/dist/{chunk-7AFCHGML.js.map → chunk-U33Q35CB.js.map} +0 -0
- /package/dist/{chunk-HGNICQUY.js.map → chunk-UEDPRIG7.js.map} +0 -0
- /package/dist/{chunk-CT2D4IBR.js.map → chunk-UTLIN5S6.js.map} +0 -0
- /package/dist/{chunk-TMVRAQYA.js.map → chunk-UVBIRNQ4.js.map} +0 -0
- /package/dist/{chunk-TZQ2O23Z.js.map → chunk-V3ZGBTES.js.map} +0 -0
- /package/dist/{chunk-Z7AWT3MQ.js.map → chunk-VHLCM6IM.js.map} +0 -0
- /package/dist/{chunk-KKOBWE62.js.map → chunk-VL5TI4XT.js.map} +0 -0
- /package/dist/{chunk-7PTTOR6T.js.map → chunk-WWXX3PU7.js.map} +0 -0
- /package/dist/{chunk-AQ4WWMOK.js.map → chunk-X6PTF3PD.js.map} +0 -0
- /package/dist/{chunk-IW6OJUGY.js.map → chunk-ZEJRVVLJ.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../../../chunk-
|
|
1
|
+
import{a}from"../../../../chunk-VL5TI4XT.js";import"../../../../chunk-GECXYMDU.js";import"../../../../chunk-XFD3ULUF.js";import"../../../../chunk-42R2H2DW.js";import"../../../../chunk-LMYJ6V44.js";import"../../../../chunk-TC7EQZJK.js";import"../../../../chunk-NX7MM6XR.js";import"../../../../chunk-ZXGAFQXW.js";import"../../../../chunk-DFJNVGK4.js";import"../../../../chunk-SGE4DLC3.js";import"../../../../chunk-TXSUZLOI.js";import"../../../../chunk-VDRNNOVA.js";import"../../../../chunk-S5VSWHJY.js";import"../../../../chunk-JEGVULKU.js";import"../../../../chunk-WQ4H5V7U.js";import"../../../../chunk-Z5WMKCRJ.js";import"../../../../chunk-KQPDXXG3.js";import"../../../../chunk-P37U34EQ.js";export{a as PaidTimeOffContainer};
|
|
2
2
|
//# sourceMappingURL=PaidTimeOffContainer.js.map
|
|
@@ -9,7 +9,7 @@ import 'yup';
|
|
|
9
9
|
import '../../../../types-ZWIpiFgj.js';
|
|
10
10
|
import 'react-hook-form';
|
|
11
11
|
import '@remoteoss/remote-json-schema-form-kit';
|
|
12
|
-
import '../../../../types-
|
|
12
|
+
import '../../../../types-C0m9mu0v.js';
|
|
13
13
|
import 'react/jsx-runtime';
|
|
14
14
|
import '../../../Onboarding/components/OnboardingBack.js';
|
|
15
15
|
import '../../../Onboarding/components/OnboardingInvite.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-HVOYAQHI.js";import"../../chunk-TRBEYNRN.js";import"../../chunk-CJG77FUT.js";import"../../chunk-YWOJ4NKF.js";import"../../chunk-VL5TI4XT.js";import"../../chunk-IF42CZJH.js";import"../../chunk-6DHV4GT6.js";import"../../chunk-5WFWHEXV.js";import"../../chunk-L5DII4MV.js";import"../../chunk-GECXYMDU.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-42R2H2DW.js";import"../../chunk-LMYJ6V44.js";import"../../chunk-TC7EQZJK.js";import"../../chunk-NX7MM6XR.js";import"../../chunk-ZXGAFQXW.js";import"../../chunk-DFJNVGK4.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-TXSUZLOI.js";import"../../chunk-4WSJ2A6Q.js";import"../../chunk-RAH453TV.js";import"../../chunk-VDRNNOVA.js";import"../../chunk-YIOLMWB5.js";import"../../chunk-S5VSWHJY.js";import"../../chunk-JEGVULKU.js";import"../../chunk-YHCH57B7.js";import"../../chunk-WQ4H5V7U.js";import"../../chunk-6AAV34CT.js";import"../../chunk-TFSRZOMP.js";import"../../chunk-R4X2WQXX.js";import"../../chunk-SNBAM7SA.js";import"../../chunk-7G5JSUZU.js";import"../../chunk-56UXOD27.js";import"../../chunk-3NESYBEJ.js";import"../../chunk-DXIJUMLU.js";import"../../chunk-6JTHV4QS.js";import"../../chunk-547UHEDI.js";import"../../chunk-TNN3W5TU.js";import"../../chunk-MP3VDCI7.js";import"../../chunk-EOMVTXER.js";import"../../chunk-VIGKOVHP.js";import"../../chunk-X6ZAR7ZL.js";import"../../chunk-TSPDJUGG.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-P37U34EQ.js";export{a as useTermination};
|
|
2
2
|
//# sourceMappingURL=hooks.js.map
|
|
@@ -24,7 +24,7 @@ import '../../types-C0ri3b3L.js';
|
|
|
24
24
|
import '@tanstack/react-query';
|
|
25
25
|
import '@tanstack/query-core';
|
|
26
26
|
import './api.js';
|
|
27
|
-
import '../../types-
|
|
27
|
+
import '../../types-C0m9mu0v.js';
|
|
28
28
|
import '../Onboarding/components/OnboardingBack.js';
|
|
29
29
|
import '../Onboarding/components/OnboardingInvite.js';
|
|
30
30
|
import '../Onboarding/components/OnboardingSubmit.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../chunk-FZ7FWFJX.js";import{a as b}from"../../chunk-UMVA4SIV.js";import{a as c}from"../../chunk-X6CON4YE.js";import{a}from"../../chunk-
|
|
1
|
+
import"../../chunk-FZ7FWFJX.js";import{a as b}from"../../chunk-UMVA4SIV.js";import{a as c}from"../../chunk-X6CON4YE.js";import{a}from"../../chunk-NI3CJNG3.js";import"../../chunk-WWXX3PU7.js";import"../../chunk-MJQUJZCD.js";import"../../chunk-HVOYAQHI.js";import"../../chunk-TRBEYNRN.js";import"../../chunk-CJG77FUT.js";import"../../chunk-YWOJ4NKF.js";import"../../chunk-VL5TI4XT.js";import"../../chunk-IF42CZJH.js";import"../../chunk-6DHV4GT6.js";import"../../chunk-5WFWHEXV.js";import"../../chunk-L5DII4MV.js";import"../../chunk-GECXYMDU.js";import"../../chunk-XFD3ULUF.js";import"../../chunk-42R2H2DW.js";import"../../chunk-LMYJ6V44.js";import"../../chunk-TC7EQZJK.js";import"../../chunk-NX7MM6XR.js";import"../../chunk-ZXGAFQXW.js";import"../../chunk-DFJNVGK4.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-X6PTF3PD.js";import"../../chunk-V3ZGBTES.js";import"../../chunk-R7G5G45H.js";import"../../chunk-JVHQ5EG3.js";import"../../chunk-WR5DSTKP.js";import"../../chunk-MRYRNB7Y.js";import"../../chunk-TXSUZLOI.js";import"../../chunk-4WSJ2A6Q.js";import"../../chunk-RAH453TV.js";import"../../chunk-VDRNNOVA.js";import"../../chunk-LNV36S6D.js";import"../../chunk-LU265KXN.js";import"../../chunk-UTLIN5S6.js";import"../../chunk-SNECOPBD.js";import"../../chunk-YIOLMWB5.js";import"../../chunk-S5VSWHJY.js";import"../../chunk-JEGVULKU.js";import"../../chunk-AOSXULKY.js";import"../../chunk-BYDQHL6O.js";import"../../chunk-HJ7WOTV7.js";import"../../chunk-YHCH57B7.js";import"../../chunk-7EONM7HL.js";import"../../chunk-WQ4H5V7U.js";import"../../chunk-6AAV34CT.js";import"../../chunk-TFSRZOMP.js";import"../../chunk-R4X2WQXX.js";import"../../chunk-SNBAM7SA.js";import"../../chunk-7G5JSUZU.js";import"../../chunk-56UXOD27.js";import"../../chunk-3NESYBEJ.js";import"../../chunk-DXIJUMLU.js";import"../../chunk-6JTHV4QS.js";import"../../chunk-547UHEDI.js";import"../../chunk-TNN3W5TU.js";import"../../chunk-MP3VDCI7.js";import"../../chunk-EOMVTXER.js";import"../../chunk-VIGKOVHP.js";import"../../chunk-X6ZAR7ZL.js";import"../../chunk-TSPDJUGG.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-KQPDXXG3.js";import"../../chunk-P37U34EQ.js";export{c as TerminationDialogInfoContent,a as TerminationFlow,b as TerminationReasonsDetailContent};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/flows/types.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -22,9 +22,9 @@ export { AcknowledgeInformationFeesProps } from './flows/Termination/components/
|
|
|
22
22
|
export { AcknowledgeInformationProps } from './flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js';
|
|
23
23
|
export { OnboardingFlow } from './flows/Onboarding/OnboardingFlow.js';
|
|
24
24
|
export { OnboardingInviteProps } from './flows/Onboarding/components/OnboardingInvite.js';
|
|
25
|
-
export { B as BasicInformationFormPayload, c as BenefitsFormPayload, C as ContractDetailsFormPayload, e as CreditRiskState, d as CreditRiskStatus, E as Employment, f as OnboardingRenderProps, a as SelectCountryFormPayload, b as SelectCountrySuccess } from './types-
|
|
25
|
+
export { B as BasicInformationFormPayload, c as BenefitsFormPayload, C as ContractDetailsFormPayload, e as CreditRiskState, d as CreditRiskStatus, E as Employment, f as OnboardingRenderProps, a as SelectCountryFormPayload, b as SelectCountrySuccess } from './types-C0m9mu0v.js';
|
|
26
26
|
export { ContractorOnboardingFlow } from './flows/ContractorOnboarding/ContractorOnboarding.js';
|
|
27
|
-
export { e as ContractPreviewFormPayload, f as ContractPreviewResponse, a as ContractorOnboardingContractDetailsFormPayload, d as ContractorOnboardingContractDetailsResponse, C as ContractorOnboardingFlowProps, b as ContractorOnboardingRenderProps, E as EligibilityQuestionnaireFormPayload, g as EligibilityQuestionnaireResponse, P as PricingPlanFormPayload, c as PricingPlanResponse } from './types-
|
|
27
|
+
export { e as ContractPreviewFormPayload, f as ContractPreviewResponse, a as ContractorOnboardingContractDetailsFormPayload, d as ContractorOnboardingContractDetailsResponse, C as ContractorOnboardingFlowProps, b as ContractorOnboardingRenderProps, E as EligibilityQuestionnaireFormPayload, g as EligibilityQuestionnaireResponse, P as PricingPlanFormPayload, c as PricingPlanResponse } from './types-BUI5G3ML.js';
|
|
28
28
|
export { contractorPlusProductIdentifier, contractorStandardProductIdentifier, corProductIdentifier, eorProductIdentifier, onboardingWorkflows, pricingPlanDetails } from './flows/ContractorOnboarding/constants.js';
|
|
29
29
|
export { ContractPreviewStatementProps } from './flows/ContractorOnboarding/components/ContractPreviewStatement.js';
|
|
30
30
|
export { CreateCompanyFlow } from './flows/CreateCompany/CreateCompany.js';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-FZ7FWFJX.js";import{a as ge}from"./chunk-UMVA4SIV.js";import{a as ye}from"./chunk-X6CON4YE.js";import{a as fe}from"./chunk-
|
|
1
|
+
import"./chunk-FZ7FWFJX.js";import{a as ge}from"./chunk-UMVA4SIV.js";import{a as ye}from"./chunk-X6CON4YE.js";import{a as fe}from"./chunk-NI3CJNG3.js";import"./chunk-WWXX3PU7.js";import"./chunk-MJQUJZCD.js";import"./chunk-HVOYAQHI.js";import"./chunk-TRBEYNRN.js";import"./chunk-CJG77FUT.js";import"./chunk-YWOJ4NKF.js";import"./chunk-VL5TI4XT.js";import"./chunk-IF42CZJH.js";import"./chunk-6DHV4GT6.js";import"./chunk-5WFWHEXV.js";import"./chunk-L5DII4MV.js";import{a as de,b as pe,c as ue}from"./chunk-GECXYMDU.js";import"./chunk-XFD3ULUF.js";import"./chunk-42R2H2DW.js";import"./chunk-LMYJ6V44.js";import"./chunk-TC7EQZJK.js";import"./chunk-NX7MM6XR.js";import"./chunk-ZXGAFQXW.js";import"./chunk-DFJNVGK4.js";import"./chunk-SGE4DLC3.js";import"./chunk-GULCZWSK.js";import"./chunk-X6PTF3PD.js";import"./chunk-V3ZGBTES.js";import"./chunk-R7G5G45H.js";import"./chunk-JVHQ5EG3.js";import"./chunk-WR5DSTKP.js";import"./chunk-MRYRNB7Y.js";import"./chunk-5KMUUL7U.js";import{a as Ce}from"./chunk-TJHW5QSC.js";import"./chunk-KRJETP7I.js";import"./chunk-4Q2FKKQU.js";import"./chunk-W7YC2IO2.js";import"./chunk-FHYOWPXB.js";import"./chunk-YIMWF5GR.js";import"./chunk-4EFT4EBW.js";import"./chunk-JJMBP6FU.js";import"./chunk-S42DBWAF.js";import"./chunk-IN74TK34.js";import"./chunk-HNTEGDI2.js";import{a as T,b as S}from"./chunk-D4TLSPX5.js";import"./chunk-4EU3AWEX.js";import"./chunk-VAIBLWOY.js";import"./chunk-PGWKJ6FK.js";import"./chunk-FGBEOUQK.js";import{a as oe}from"./chunk-JIW2JK7J.js";import{a as te}from"./chunk-EFRT6C7V.js";import"./chunk-AYC6DTFV.js";import{a as ve}from"./chunk-H3HNBOAE.js";import"./chunk-QPN6X6UA.js";import"./chunk-2PDHYTZ2.js";import"./chunk-JAZLNJM3.js";import"./chunk-KO264IE2.js";import"./chunk-76ZDXC2T.js";import"./chunk-TGQTFWAB.js";import"./chunk-TXSUZLOI.js";import"./chunk-A3LRPGV3.js";import"./chunk-2MTSUYN6.js";import"./chunk-5WIBTOCI.js";import{a as q}from"./chunk-5MDNW5H7.js";import{b as H,d as Y}from"./chunk-KEFIHTZ2.js";import"./chunk-UVBIRNQ4.js";import"./chunk-FXTOBTW4.js";import"./chunk-VFRHMNLJ.js";import{a as j}from"./chunk-U33Q35CB.js";import{a as re}from"./chunk-WD2JGIDK.js";import{a as ee}from"./chunk-3BBQDNZD.js";import"./chunk-KSHK3ZPX.js";import{d as J,e as X}from"./chunk-AKFNSADJ.js";import"./chunk-HN5HLFTB.js";import"./chunk-UYUPSPOE.js";import{a as xe}from"./chunk-3MLYDDLK.js";import"./chunk-RKGD6XC7.js";import"./chunk-VAWEOFUO.js";import"./chunk-D5K4NBOG.js";import"./chunk-WD5DNUSS.js";import"./chunk-ITTXYDGV.js";import"./chunk-DPVXSN7T.js";import"./chunk-DNVTXLTP.js";import"./chunk-ZEJRVVLJ.js";import"./chunk-VHLCM6IM.js";import"./chunk-3C6N7DK6.js";import"./chunk-D5ABWBC6.js";import"./chunk-K5HZE7M6.js";import"./chunk-P3QDMRCC.js";import"./chunk-4WSJ2A6Q.js";import"./chunk-Q3ALCPJN.js";import"./chunk-GRE4RCPB.js";import"./chunk-U4QOJDBZ.js";import"./chunk-LXOYWRNU.js";import"./chunk-7DRY6YCN.js";import"./chunk-AP56UUME.js";import"./chunk-IJCTN52C.js";import"./chunk-WVJDCDGZ.js";import"./chunk-O6H66UM2.js";import"./chunk-ROQYHTFQ.js";import"./chunk-3UDRMQNE.js";import"./chunk-3DMWQJ5W.js";import"./chunk-RAH453TV.js";import"./chunk-VDRNNOVA.js";import"./chunk-AHRG5QCS.js";import{a as Pe,b as he,c as Ee,d as Re,k as Fe,l as we}from"./chunk-PX5PE6GX.js";import"./chunk-A7ZJQCNU.js";import{a as ce}from"./chunk-UEDPRIG7.js";import{a as ne}from"./chunk-6ORP3EVR.js";import{a as se}from"./chunk-JNMD7SWN.js";import"./chunk-LNV36S6D.js";import"./chunk-LU265KXN.js";import"./chunk-UTLIN5S6.js";import"./chunk-SNECOPBD.js";import{a as ae}from"./chunk-U6LRMWRI.js";import{a as me}from"./chunk-5QOEBELF.js";import"./chunk-SQPCNBJC.js";import{a as ie,b as le}from"./chunk-YIOLMWB5.js";import"./chunk-S5VSWHJY.js";import{d as Z}from"./chunk-JEGVULKU.js";import"./chunk-AOSXULKY.js";import"./chunk-BYDQHL6O.js";import"./chunk-HJ7WOTV7.js";import{a as G,b as $}from"./chunk-YHCH57B7.js";import"./chunk-7EONM7HL.js";import{a as E,b as R,l as F,u as w}from"./chunk-WQ4H5V7U.js";import"./chunk-6AAV34CT.js";import"./chunk-TFSRZOMP.js";import"./chunk-R4X2WQXX.js";import"./chunk-SNBAM7SA.js";import"./chunk-7G5JSUZU.js";import"./chunk-56UXOD27.js";import"./chunk-3NESYBEJ.js";import"./chunk-DXIJUMLU.js";import"./chunk-6JTHV4QS.js";import"./chunk-547UHEDI.js";import"./chunk-TNN3W5TU.js";import"./chunk-MP3VDCI7.js";import"./chunk-EOMVTXER.js";import{c as Q,d as h}from"./chunk-VIGKOVHP.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-LWGSXQKI.js";import"./chunk-TSPDJUGG.js";import"./chunk-Z5WMKCRJ.js";import"./chunk-D5AR26AI.js";import"./chunk-TVZAFTPT.js";import{a as x,c as v,d as b}from"./chunk-KQPDXXG3.js";import{a as o}from"./chunk-P37U34EQ.js";import{useMutation as be}from"@tanstack/react-query";var Te=o(()=>{let{client:e}=b();return be({mutationFn:o(r=>w({client:e,headers:{Authorization:""},body:r}),"mutationFn")})},"useMagicLink");import{QueryClientProvider as er}from"@tanstack/react-query";import{useMemo as rr,Suspense as or,useRef as tr}from"react";function f(e){let r=document.documentElement;Object.keys(e).forEach(t=>{let n=e[t];n&&r.style.setProperty(t,n)})}o(f,"setCssProperties");function Se(e){let r={};return Object.keys(e).forEach(t=>{r[`--${t}`]=e[t]}),r}o(Se,"mapThemeColors");function ke(e){return{"--spacing":e}}o(ke,"mapThemeSpacing");function De(e){return{"--radius":e}}o(De,"mapThemeBorderRadius");function Ne(e){return{"--fontSizeBase":e.fontSizeBase}}o(Ne,"mapThemeFont");function k(e){e?.colors&&f(Se(e.colors)),e?.spacing&&f(ke(e.spacing)),e?.borderRadius&&f(De(e.borderRadius)),e?.font&&f(Ne(e.font))}o(k,"applyTheme");import{createContext as Oe,useEffect as Ae,useMemo as Be}from"react";import{jsx as Ie}from"react/jsx-runtime";var Me=Oe({theme:{}});function D(e){Ae(()=>{e.theme&&Object.keys(e.theme).length>0&&k(e.theme)},[e.theme]);let r=Be(()=>({theme:e.theme}),[e.theme]);return Ie(Me.Provider,{value:r,children:e.children})}o(D,"ThemeProvider");var N={local:"http://localhost:4000/api/eor",partners:"https://gateway.partners.remote-sandbox.com",production:"https://gateway.remote.com",sandbox:"https://gateway.remote-sandbox.com",staging:"https://gateway.niceremote.com"},P="production";var d="1.23.0";function Ve(e){try{return new URL(e),!0}catch{return!1}}o(Ve,"isValidUrl");function O(e,r){let t={current:null},n=r?.environment?N[r?.environment]:"https://gateway.remote.com",s=R.getConfig();r?.environment&&r?.environment!=="production"&&h(d);let l=!!r?.proxy&&Ve(r.proxy.url);return r?.proxy&&!l&&console.error("Invalid proxy URL provided. Using default base URL."),E({...s,...r?.credentials&&{credentials:r.credentials},headers:{...s.headers,...l?r?.proxy?.headers:{},"X-Client-Name":"remote-flows-sdk","X-Client-Version":d},baseUrl:l?r.proxy?.url:n,auth:o(async()=>{if(!e)return;function m(a){return!a||Date.now()+6e4>a}if(o(m,"hasTokenExpired"),!t.current||m(t.current.expiresAt))try{let a=await e();t.current={accessToken:a.accessToken,expiresAt:Date.now()+a.expiresIn*1e3}}catch(a){console.error("Failed to fetch auth token:",a);return}return t.current?.accessToken},"auth")})}o(O,"createClient");import{Component as $e}from"react";var A=[{category:"RENDER_ERROR",severity:"critical",messagePatterns:["element type is invalid","hydration","rendered more hooks","rendered fewer hooks"],namePatterns:["invariantviolation"]},{category:"HOOK_ERROR",severity:"critical",messagePatterns:["hook","useeffect","usestate","usecontext"],namePatterns:[]},{category:"STATE_ERROR",severity:"error",messagePatterns:["state","context","provider"],namePatterns:[]},{category:"RENDER_ERROR",severity:"critical",messagePatterns:["render","component"],namePatterns:[]},{category:"RUNTIME_ERROR",severity:"critical",messagePatterns:[],namePatterns:["typeerror","referenceerror"]},{category:"RUNTIME_ERROR",severity:"error",messagePatterns:[],namePatterns:["rangeerror"]}],Le=["cannot read property","is not a function","is not defined"],B=["warning","deprecated"],M=o(e=>{let r=e.message.toLowerCase(),t=e.name.toLowerCase();if(B.some(n=>r.includes(n)))return"UNKNOWN_ERROR";for(let n of A){let s=n.messagePatterns.some(m=>r.includes(m)),l=n.namePatterns.some(m=>t.includes(m));if(s||l)return n.category}return"UNKNOWN_ERROR"},"categorizeError"),I=o((e,r)=>{let t=e.message.toLowerCase(),n=e.name.toLowerCase();if(B.some(s=>t.includes(s)))return"warning";if(Le.some(s=>t.includes(s)))return"critical";for(let s of A){if(s.category!==r)continue;let l=s.messagePatterns.some(a=>t.includes(a)),m=s.namePatterns.some(a=>n.includes(a));if(l||m)return s.severity}return"error"},"determineErrorSeverity");var p=new Map,V=100;function _e(e){return`${e.name}:${e.message}:${e.stack?.substring(0,100)||""}`}o(_e,"getErrorSignature");function Ue(e){let r=_e(e),t=p.get(r),n=Date.now();if(t&&n-t<V)return!0;if(p.set(r,n),p.size>100)for(let[s,l]of p.entries())n-l>V&&p.delete(s);return!1}o(Ue,"wasRecentlyReported");var We=o((e,r)=>{if(!r)return;let t={critical:"\u{1F534}",error:"\u{1F7E0}",warning:"\u{1F7E1}",info:"\u{1F535}"};console.group("\u{1F4EE} [RemoteFlows] Error Report (Debug Mode)"),console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),console.log("\u274C Error:",e.error.message),console.log("\u{1F4DB} Name:",e.error.name),console.log(`${t[e.error.severity]} Severity:`,e.error.severity.toUpperCase()),console.log("\u{1F3F7}\uFE0F Category:",e.error.category),e.context?.flow&&console.log("\u{1F504} Flow:",e.context.flow),e.context?.step!==void 0&&console.log("\u{1F4CD} Step:",e.context.step),e.context?.metadata&&console.log("\u{1F4DD} Context Metadata:",e.context.metadata),console.log("\u23F0 Timestamp:",e.metadata.timestamp),console.log("\u{1F310} URL:",e.metadata.url),console.log("\u{1F4E6} SDK Version:",e.metadata.sdk_version),e.error.stack&&(console.log(`
|
|
2
2
|
\u{1F4DA} Stack Trace:`),console.log(e.error.stack)),console.log(`
|
|
3
3
|
\u{1F4CB} Full Payload (would be sent to telemetry):`),console.log(JSON.stringify(e,null,2)),console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),console.groupEnd()},"logDebugPayload"),ze=o(()=>typeof window<"u"?window.location.href:"unknown","getUrl"),Ke=o(e=>e?btoa(e):"","encodeStack");function Qe(e,r,t,n){let s=M(e),l=I(e,s),m=ze(),a=Ke(e.stack);return{error:{message:e.message,stack:a,name:e.name,category:s,severity:l},context:n,metadata:{sdk_version:r,timestamp:new Date().toISOString(),url:m,user_agent:typeof navigator<"u"?navigator.userAgent:"unknown",environment:t}}}o(Qe,"buildErrorPayload");function Ge(e,r){let t=e==="local",n=r.includes("localhost")||r.includes("127.0.0.1");return t===n}o(Ge,"shouldSendTelemetry");function L(e,r,t={debugMode:!1}){let{error:n,sdkVersion:s,client:l,environment:m}=e;if(Ue(n)){t.debugMode&&console.log("[RemoteFlows] Skipping duplicate error report");return}let a=Qe(n,s,m??P,r);if(t.debugMode&&We(a,!!t.debugMode),!Ge(m??P,a.metadata.url)){t.debugMode&&console.log("[RemoteFlows] Skipping telemetry API call (local environment)");return}F({client:l,body:a}).catch(u=>{t.debugMode&&console.warn("[RemoteFlows] Failed to report error telemetry:",u)})}o(L,"reportTelemetryError");import{jsx as _}from"react/jsx-runtime";var Ze=o(()=>_("div",{style:{padding:"20px",border:"1px solid #dc2626",borderRadius:"4px",backgroundColor:"#fef2f2",color:"#991b1b"},children:"Something went wrong in RemoteFlows. Please refresh the page."}),"FallbackErrorBoundary"),g=class extends $e{static{o(this,"RemoteFlowsErrorBoundary")}constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}static contextType=T;componentDidCatch(r,t){console.error("[RemoteFlows] Error caught:",r,t);let n=this.context?.errorContextRef.current,s={error:r,sdkVersion:d,client:this.props.client,environment:this.props.environment};if(L(s,n,{debugMode:this.props.debug}),this.props.errorBoundary?.useParentErrorBoundary)throw r}render(){return this.state.hasError&&this.state.error?this.props.errorBoundary?.fallback?typeof this.props.errorBoundary?.fallback=="function"?this.props.errorBoundary?.fallback(this.state.error):this.props.errorBoundary?.fallback:_(Ze,{}):this.props.children}};import{lazy as i}from"react";var U={button:i(()=>import("./ButtonDefault-2YV2Z474.js").then(e=>({default:e.ButtonDefault}))),checkbox:i(()=>import("./CheckboxFieldDefault-SZZQUVAM.js").then(e=>({default:e.CheckboxFieldDefault}))),countries:i(()=>import("./CountryFieldDefault-IBVQJVMW.js").then(e=>({default:e.CountryFieldDefault}))),date:i(()=>import("./DatePickerFieldDefault-5LEOVIM2.js").then(e=>({default:e.DatePickerFieldDefault}))),drawer:i(()=>import("./DrawerDefault-AAUS7T5W.js").then(e=>({default:e.DrawerDefault}))),email:i(()=>import("./EmailFieldDefault-2PMSDIXF.js").then(e=>({default:e.EmailFieldDefault}))),fieldsetToggle:i(()=>import("./FieldsetToggleButtonDefault-MFLN2WWT.js").then(e=>({default:e.FieldsetToggleButtonDefault}))),file:i(()=>import("./FileUploadFieldDefault-Y2ZYBSTV.js").then(e=>({default:e.FileUploadFieldDefault}))),"multi-select":i(()=>import("./MultiSelectFieldDefault-UK7652MS.js").then(e=>({default:e.MultiSelectFieldDefault}))),number:i(()=>import("./NumberFieldDefault-C5V6POQ7.js").then(e=>({default:e.NumberFieldDefault}))),radio:i(()=>import("./RadioGroupFieldDefault-DNESPKMT.js").then(e=>({default:e.RadioGroupFieldDefault}))),select:i(()=>import("./SelectFieldDefault-4KQUV57C.js").then(e=>({default:e.SelectFieldDefault}))),statement:i(()=>import("./StatementDefault-DORMITL7.js").then(e=>({default:e.StatementDefault}))),textarea:i(()=>import("./TextAreaFieldDefault-5P2MEQUR.js").then(e=>({default:e.TextAreaFieldDefault}))),text:i(()=>import("./TextFieldDefault-PMCQSPPT.js").then(e=>({default:e.TextFieldDefault}))),zendeskDrawer:i(()=>import("./ZendeskDrawerDefault-A5PVWI4R.js").then(e=>({default:e.ZendeskDrawerDefault}))),table:i(()=>import("./TableFieldDefault-URJVK7YR.js").then(e=>({default:e.TableFieldDefault}))),"work-schedule":i(()=>import("./WorkScheduleFieldDefault-SR3G37MN.js").then(e=>({default:e.WorkScheduleFieldDefault}))),pdfViewer:i(()=>import("./PDFPreviewDefault-HSSMYKV5.js").then(e=>({default:e.PDFPreviewDefault})))};import{jsx as y,jsxs as He}from"react/jsx-runtime";function W(){return He("div",{className:"animate-pulse space-y-4 p-4",children:[y("div",{className:"h-4 bg-gray-200 rounded w-1/4"}),y("div",{className:"h-10 bg-gray-200 rounded"}),y("div",{className:"h-4 bg-gray-200 rounded w-1/4"}),y("div",{className:"h-10 bg-gray-200 rounded"})]})}o(W,"FormLoadingFallback");import{useState as Je,useEffect as Xe}from"react";import{Fragment as Ye,jsx as qe}from"react/jsx-runtime";function z({fallback:e,delay:r=200}){let[t,n]=Je(!1);return Xe(()=>{let s=setTimeout(()=>{n(!0)},r);return()=>clearTimeout(s)},[r]),t?qe(Ye,{children:e}):null}o(z,"DelayedFallback");import{QueryClient as je}from"@tanstack/react-query";var K=o(()=>new je,"getQueryClient");import{jsx as c}from"react/jsx-runtime";function nr({children:e,client:r}){return c(v.Provider,{value:{client:r},children:e})}o(nr,"RemoteFlowContextWrapper");function sr({children:e,components:r={}}){let t=rr(()=>({...U,...r}),[r]);return c(x.Provider,{value:{components:t},children:c(or,{fallback:c(z,{fallback:c(W,{}),delay:200}),children:e})})}o(sr,"FormFieldsProvider");var ar=K();function ir({auth:e,children:r,components:t,theme:n,proxy:s,environment:l,errorBoundary:m={useParentErrorBoundary:!0},debug:a=!1,credentials:C}){let u=tr(O(e,{proxy:s,environment:l,credentials:C})).current;return c(S,{children:c(g,{errorBoundary:m,debug:a,environment:l,client:u,children:c(er,{client:ar,children:c(sr,{components:t,children:c(nr,{environment:l,debug:a,client:u,children:c(D,{theme:n,children:r})})})})})})}o(ir,"RemoteFlows");export{ne as ContractAmendmentConfirmationForm,ce as ContractAmendmentFlow,se as ContractAmendmentForm,ae as ContractAmendmentSubmit,xe as ContractorOnboardingFlow,q as CostCalculatorFlow,j as CostCalculatorForm,re as CostCalculatorResetButton,ee as CostCalculatorSubmitButton,ve as CreateCompanyFlow,oe as EstimationResults,Ce as OnboardingFlow,ir as RemoteFlows,te as SummaryResults,ye as TerminationDialogInfoContent,fe as TerminationFlow,ge as TerminationReasonsDetailContent,$ as ZendeskTriggerButton,H as buildCostCalculatorEstimationPayload,he as contractorPlusProductIdentifier,Pe as contractorStandardProductIdentifier,Z as convertFromCents,Ee as corProductIdentifier,Re as eorProductIdentifier,Fe as onboardingWorkflows,we as pricingPlanDetails,Q as transformYupErrorsIntoObject,me as useContractAmendment,Y as useCostCalculator,X as useCostCalculatorEstimationCsv,J as useCostCalculatorEstimationPdf,le as useDiscardEmploymentMutation,ie as useEmploymentQuery,Te as useMagicLink,pe as usePaidTimeoffBreakdownQuery,ue as useTimeOffLeavePoliciesSummaryQuery,de as useTimeOffQuery,G as zendeskArticles};
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -11,7 +11,7 @@ import { FieldValues } from 'react-hook-form';
|
|
|
11
11
|
import { ValidationResult } from '@remoteoss/remote-json-schema-form-kit';
|
|
12
12
|
import { StepKeys } from './flows/ContractorOnboarding/utils.js';
|
|
13
13
|
import { BasicInformationStep } from './flows/ContractorOnboarding/components/BasicInformationStep.js';
|
|
14
|
-
import { g as SelectCountryStep } from './types-
|
|
14
|
+
import { g as SelectCountryStep } from './types-C0m9mu0v.js';
|
|
15
15
|
import { FlowOptions, JSFModify } from './flows/types.js';
|
|
16
16
|
import { OnboardingInvite } from './flows/ContractorOnboarding/components/OnboardingInvite.js';
|
|
17
17
|
import { ContractReviewButton } from './flows/ContractorOnboarding/components/ContractReviewButton.js';
|
|
@@ -88,6 +88,18 @@ declare const DEFAULT_VERSION = 1;
|
|
|
88
88
|
* @returns The effective jsonSchemaVersion configuration
|
|
89
89
|
*/
|
|
90
90
|
declare const getContractDetailsSchemaVersion: (options: OnboardingFlowProps["options"], countryCode: string | null) => number | "latest";
|
|
91
|
+
/**
|
|
92
|
+
* Gets the basic information schema version from options
|
|
93
|
+
* @param options - The flow options containing version configurations
|
|
94
|
+
* @returns The jsonSchemaVersion for basic information or default
|
|
95
|
+
*/
|
|
96
|
+
declare const getBasicInformationSchemaVersion: (options: OnboardingFlowProps["options"]) => number | "latest";
|
|
97
|
+
/**
|
|
98
|
+
* Gets the benefit offers schema version from options
|
|
99
|
+
* @param options - The flow options containing version configurations
|
|
100
|
+
* @returns The jsonSchemaVersion for benefit offers or undefined if not set
|
|
101
|
+
*/
|
|
102
|
+
declare const getBenefitOffersSchemaVersion: (options: OnboardingFlowProps["options"]) => number | "latest";
|
|
91
103
|
|
|
92
104
|
type OnboardingHookProps = Omit<OnboardingFlowProps, 'render'>;
|
|
93
105
|
declare const useOnboarding: ({ employmentId, companyId, countryCode, type, options, skipSteps, externalId, initialValues: onboardingInitialValues, }: OnboardingHookProps) => {
|
|
@@ -335,6 +347,25 @@ type OnboardingRenderProps = {
|
|
|
335
347
|
};
|
|
336
348
|
};
|
|
337
349
|
type OnboardingFeatures = 'onboarding_reserves';
|
|
350
|
+
/**
|
|
351
|
+
* JSON schema version configuration for a specific country
|
|
352
|
+
*/
|
|
353
|
+
type CountryJsonSchemaVersion = {
|
|
354
|
+
/**
|
|
355
|
+
* @deprecated Use `jsonSchemaVersion.employment_basic_information` instead for global configuration.
|
|
356
|
+
* This country-specific override is no longer recommended.
|
|
357
|
+
*
|
|
358
|
+
* The json schema version to use for the basic information step by country.
|
|
359
|
+
* The default value is 1.
|
|
360
|
+
*/
|
|
361
|
+
employment_basic_information?: number;
|
|
362
|
+
/**
|
|
363
|
+
* The json schema version to use for the contract details step by country.
|
|
364
|
+
* This is used to override the json schema version for the contract details step by country.
|
|
365
|
+
* The default value is 1.
|
|
366
|
+
*/
|
|
367
|
+
contract_details?: number | 'latest';
|
|
368
|
+
};
|
|
338
369
|
type OnboardingFlowProps = {
|
|
339
370
|
/**
|
|
340
371
|
* The country code to use for the onboarding.
|
|
@@ -370,23 +401,40 @@ type OnboardingFlowProps = {
|
|
|
370
401
|
/**
|
|
371
402
|
* The options to use for the onboarding.
|
|
372
403
|
*/
|
|
373
|
-
options?: Omit<FlowOptions, 'jsfModify'> & {
|
|
404
|
+
options?: Omit<FlowOptions, 'jsfModify' | 'jsonSchemaVersion'> & {
|
|
374
405
|
jsfModify?: {
|
|
375
406
|
select_country?: JSFModify;
|
|
376
407
|
basic_information?: JSFModify;
|
|
377
408
|
contract_details?: JSFModify;
|
|
378
409
|
benefits?: JSFModify;
|
|
379
410
|
};
|
|
411
|
+
/**
|
|
412
|
+
* The json schema version to use for the onboarding.
|
|
413
|
+
* These versions apply globally to all countries.
|
|
414
|
+
* For country-specific overrides (e.g., contract_details), use jsonSchemaVersionByCountry instead.
|
|
415
|
+
* The default value is 1.
|
|
416
|
+
*/
|
|
417
|
+
jsonSchemaVersion?: {
|
|
418
|
+
/**
|
|
419
|
+
* The json schema version to use for the basic information step.
|
|
420
|
+
* Applies globally to all countries.
|
|
421
|
+
* The default value is 1.
|
|
422
|
+
*/
|
|
423
|
+
employment_basic_information?: number | 'latest';
|
|
424
|
+
/**
|
|
425
|
+
* The json schema version to use for the benefit offers step.
|
|
426
|
+
* This is used to override the json schema version for the benefit offers step.
|
|
427
|
+
* The default value is 1.
|
|
428
|
+
*/
|
|
429
|
+
benefit_offers_form_schema?: number | 'latest';
|
|
430
|
+
};
|
|
380
431
|
/**
|
|
381
432
|
* The json schema version to use for the onboarding by country.
|
|
382
433
|
* This is used to override the json schema version for the onboarding by country.
|
|
383
|
-
*
|
|
434
|
+
* Current use case is to support contract_details
|
|
384
435
|
*/
|
|
385
436
|
jsonSchemaVersionByCountry?: {
|
|
386
|
-
[countryCode: string]:
|
|
387
|
-
employment_basic_information?: number;
|
|
388
|
-
contract_details?: number | 'latest';
|
|
389
|
-
};
|
|
437
|
+
[countryCode: string]: CountryJsonSchemaVersion;
|
|
390
438
|
};
|
|
391
439
|
/**
|
|
392
440
|
* The features to use for the onboarding.
|
|
@@ -438,4 +486,4 @@ type Employment = Employment$1 & {
|
|
|
438
486
|
};
|
|
439
487
|
type CreditRiskState = 'deposit_required' | 'deposit_required_successful' | 'invite' | 'invite_successful' | 'referred' | null;
|
|
440
488
|
|
|
441
|
-
export { type BasicInformationFormPayload as B, type ContractDetailsFormPayload as C, DEFAULT_VERSION as D, type Employment as E, type OnboardingFlowProps as O, ReviewStep as R, STEPS as S, type SelectCountryFormPayload as a, type SelectCountrySuccess as b, type BenefitsFormPayload as c, type CreditRiskStatus as d, type CreditRiskState as e, type OnboardingRenderProps as f, SelectCountryStep as g, BasicInformationStep as h, ContractDetailsStep as i, BenefitsStep as j, STEPS_WITHOUT_SELECT_COUNTRY as k, disabledInviteButtonEmploymentStatus as l, getContractDetailsSchemaVersion as m, reviewStepAllowedEmploymentStatus as r, useOnboarding as u };
|
|
489
|
+
export { type BasicInformationFormPayload as B, type ContractDetailsFormPayload as C, DEFAULT_VERSION as D, type Employment as E, type OnboardingFlowProps as O, ReviewStep as R, STEPS as S, type SelectCountryFormPayload as a, type SelectCountrySuccess as b, type BenefitsFormPayload as c, type CreditRiskStatus as d, type CreditRiskState as e, type OnboardingRenderProps as f, SelectCountryStep as g, BasicInformationStep as h, ContractDetailsStep as i, BenefitsStep as j, STEPS_WITHOUT_SELECT_COUNTRY as k, disabledInviteButtonEmploymentStatus as l, getContractDetailsSchemaVersion as m, getBasicInformationSchemaVersion as n, getBenefitOffersSchemaVersion as o, reviewStepAllowedEmploymentStatus as r, useOnboarding as u };
|
package/package.json
CHANGED
package/dist/chunk-HPLRAHY7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{f as j}from"./chunk-STF3NTPS.js";import{a as q}from"./chunk-WVJDCDGZ.js";import{a as P}from"./chunk-O6H66UM2.js";import{a as p}from"./chunk-EUQH4FU4.js";import{A as _,E as F,G as S,H as w,J as v,O as E,T as O,g as f,i as y,j as d,n as h,o as b,w as g,x as C}from"./chunk-WQ4H5V7U.js";import{d as i}from"./chunk-KQPDXXG3.js";import{a as n}from"./chunk-P37U34EQ.js";import{useMutation as c,useQuery as m}from"@tanstack/react-query";var H=n(e=>{let{client:r}=i();return m({queryKey:["employment",e],retry:!1,enabled:!!e,select:n(({data:t})=>t?.data.employment,"select"),queryFn:n(async()=>{let t=await S({client:r,headers:{Authorization:""},path:{employment_id:e}});if(t.error||!t.data)throw new Error("Failed to fetch employment data");return t},"queryFn")})},"useEmployment"),L=n(e=>{let{client:r}=i();return m({queryKey:["company",e],retry:!1,enabled:!!e,queryFn:n(async()=>{let t=await C({client:r,headers:{Authorization:""},path:{company_id:e}});if(t.error||!t.data)throw new Error("Failed to fetch employment data");return t},"queryFn"),select:n(({data:t})=>t.data.company,"select")})},"useCompany"),G=n(e=>{let{client:r}=i();return m({queryKey:["benefit-offers",e],retry:!1,enabled:!!e,queryFn:n(async()=>h({client:r,path:{employment_id:e}}).then(t=>{if(t.error||!t.data)throw new Error("Failed to fetch benefit offers data");return t}),"queryFn"),select:n(({data:t})=>t?.data?.reduce((s,o)=>({...s,[o.benefit_group.slug]:{value:o.benefit_tier?.slug??"no",...o.benefit_group?.filter?.slug?{filter:o.benefit_group?.filter?.slug}:{}}}),{}),"select")})},"useBenefitOffers"),I=n(()=>{let{client:e}=i();return c({mutationFn:n(r=>O({client:e,headers:{Authorization:""},path:r}),"mutationFn")})},"useEmploymentInvite"),X=n(()=>{let{client:e}=i();return c({mutationFn:n(r=>g({client:e,body:r}),"mutationFn")})},"useCreateReserveInvoice"),Y=n(({countryCode:e,form:r,fieldValues:t,options:s,query:o={},jsonSchemaVersion:a})=>{let{client:l}=i(),x=a?{json_schema_version:a}:{};return m({queryKey:["onboarding-json-schema-form",e,r],retry:!1,queryFn:n(async()=>{let u=await _({client:l,headers:{Authorization:""},path:{country_code:e,form:r},query:{skip_benefits:!0,...o,...x}});if(u.error||!u.data)throw new Error("Failed to fetch onboarding schema");return u},"queryFn"),enabled:s?.queryOptions?.enabled,select:n(({data:u})=>{let R=u?.data||{};return p(R,t,s)},"select")})},"useJSONSchemaForm"),Z=n((e,r,t)=>{let s=t?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:t.jsonSchemaVersion.benefit_offers_form_schema}:{},{client:o}=i();return m({queryKey:["benefit-offers-schema",e],retry:!1,enabled:!!e,queryFn:n(async()=>{let a=await F({client:o,path:{employment_id:e},query:s});if(a.error||!a.data)throw new Error("Failed to fetch benefit offers schema");return a},"queryFn"),select:n(({data:a})=>{let l=a?.data?.schema||{};return p(l,r,{jsfModify:t?.jsfModify?.benefits})},"select")})},"useBenefitOffersSchema"),$=n(()=>{let{client:e}=i(),r={json_schema_version:1};return c({mutationFn:n(t=>y({client:e,headers:{Authorization:""},body:t,query:{...r}}),"mutationFn")})},"useCreateEmployment"),ee=n((e,r)=>{let{client:t}=i(),s={employment_basic_information_json_schema_version:1,contract_details_json_schema_version:j(r,e)||1};return c({mutationFn:n(({employmentId:o,...a})=>w({client:t,headers:{Authorization:""},body:a,path:{employment_id:o},query:{skip_benefits:!0,...s}}),"mutationFn")})},"useUpdateEmployment"),te=n(e=>{let{client:r}=i();return c({mutationFn:n(({employmentId:t,...s})=>{let o=e?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:e.jsonSchemaVersion.benefit_offers_form_schema}:{};return b({client:r,body:s,path:{employment_id:t},query:{...o}})},"mutationFn")})},"useUpdateBenefitsOffers"),ne=n(e=>{let{client:r}=i(),{data:t,isLoading:s}=m({...P(r,"onboarding-countries"),select:n(a=>a.data?.data?.filter(l=>l.eor_onboarding).map(l=>({label:l.name,value:l.code}))||[],"select"),enabled:e?.queryOptions?.enabled}),o=p(q.data.schema,{},e);if(t){let a=o.fields.find(l=>l.name==="country");a&&(a.options=t)}return{isLoading:s,selectCountryForm:o}},"useCountriesSchemaField"),re=n(({type:e="spread"})=>{let{client:r}=i();return c({mutationFn:n(t=>(e==="no_spread"?f:E)({client:r,body:t}),"mutationFn")})},"useConvertCurrency"),oe=n(()=>{let{client:e}=i();return c({mutationFn:n(({employmentId:r,...t})=>v({client:e,path:{employment_id:r},body:t}),"mutationFn")})},"useUpsertContractEligibility"),se=n((e,r,t=!0)=>{let{client:s}=i();return m({queryKey:["employment-onboarding-reserves-status",e,r],retry:!1,enabled:t&&!!e&&!!r,queryFn:n(async()=>{let o=await d({client:s,headers:{Authorization:""},path:{company_id:e,employment_id:r}});if(o.error||!o.data)throw new Error("Failed to fetch employment onboarding reserves status");return o},"queryFn"),select:n(({data:o})=>o?.data?.status,"select")})},"useEmploymentOnboardingReservesStatus");export{H as a,L as b,G as c,I as d,X as e,Y as f,Z as g,$ as h,ee as i,te as j,ne as k,re as l,oe as m,se as n};
|
|
2
|
-
//# sourceMappingURL=chunk-HPLRAHY7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Onboarding/api.ts"],"sourcesContent":["import { useMutation, useQuery, UseQueryResult } from '@tanstack/react-query';\nimport { FieldValues } from 'react-hook-form';\nimport { Client } from '@/src/client/client';\nimport {\n ConvertCurrencyParams,\n CreateContractEligibilityParams,\n EmploymentCreateParams,\n EmploymentFullParams,\n getIndexBenefitOffer,\n getShowCompany,\n getShowCompanyEmploymentOnboardingReservesStatus,\n getShowEmployment,\n getShowFormCountry,\n getShowSchema,\n patchUpdateEmployment2,\n postConvertRawCurrencyConverter,\n postConvertWithSpreadCurrencyConverter,\n postCreateContractEligibility,\n postCreateEmployment2,\n postCreateRiskReserve,\n postInviteEmploymentInvitation,\n PostInviteEmploymentInvitationData,\n putUpdateBenefitOffer,\n UnifiedEmploymentUpsertBenefitOffersRequest,\n} from '@/src/client';\n\nimport { useClient } from '@/src/context';\nimport { selectCountryStepSchema } from '@/src/flows/Onboarding/json-schemas/selectCountryStep';\nimport { OnboardingFlowProps } from '@/src/flows/Onboarding/types';\nimport {\n JSONSchemaFormResultWithFieldsets,\n JSONSchemaFormType,\n FlowOptions,\n} from '@/src/flows/types';\nimport { getContractDetailsSchemaVersion } from '@/src/flows/Onboarding/utils';\nimport { createHeadlessForm } from '@/src/common/createHeadlessForm';\nimport { countriesOptions } from '@/src/common/api/countries';\n\nexport const useEmployment = (employmentId: string | undefined) => {\n const { client } = useClient();\n\n return useQuery({\n queryKey: ['employment', employmentId],\n retry: false,\n enabled: !!employmentId,\n select: ({ data }) => {\n return data?.data.employment;\n },\n queryFn: async () => {\n const response = await getShowEmployment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n employment_id: employmentId as string,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n });\n};\n\nexport const useCompany = (companyId: string) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['company', companyId],\n retry: false,\n enabled: !!companyId,\n queryFn: async () => {\n const response = await getShowCompany({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n company_id: companyId,\n },\n });\n\n if (response.error || !response.data) {\n throw new Error('Failed to fetch employment data');\n }\n\n return response;\n },\n select: ({ data }) => {\n return data.data.company;\n },\n });\n};\n\nexport const useBenefitOffers = (employmentId: string | undefined) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n return getIndexBenefitOffer({\n client: client as Client,\n path: {\n employment_id: employmentId as string,\n },\n }).then((response) => {\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers data');\n }\n\n return response;\n });\n },\n select: ({ data }) =>\n data?.data?.reduce(\n (acc, item) => {\n return {\n ...acc,\n [item.benefit_group.slug]: {\n value: item.benefit_tier?.slug ?? 'no',\n ...(item.benefit_group?.filter?.slug\n ? { filter: item.benefit_group?.filter?.slug }\n : {}),\n },\n };\n },\n {} as Record<string, { value: string }>,\n ),\n });\n};\n/**\n * Use this hook to invite an employee to the onboarding flow\n * @returns\n */\nexport const useEmploymentInvite = () => {\n const { client } = useClient();\n\n return useMutation({\n mutationFn: (payload: PostInviteEmploymentInvitationData['path']) => {\n return postInviteEmploymentInvitation({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: payload,\n });\n },\n });\n};\n\nexport const useCreateReserveInvoice = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: { employment_slug: string }) => {\n return postCreateRiskReserve({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\n/**\n * Use this hook to get the JSON schema form for the onboarding flow\n * @param param0\n * @returns\n */\nexport const useJSONSchemaForm = ({\n countryCode,\n form,\n fieldValues,\n options,\n query = {},\n jsonSchemaVersion,\n}: {\n countryCode: string;\n form: JSONSchemaFormType;\n fieldValues: FieldValues;\n options?: FlowOptions & { queryOptions?: { enabled?: boolean } };\n query?: Record<string, unknown>;\n jsonSchemaVersion?: number | 'latest';\n}): UseQueryResult<JSONSchemaFormResultWithFieldsets> => {\n const { client } = useClient();\n const jsonSchemaQueryParam = jsonSchemaVersion\n ? {\n json_schema_version: jsonSchemaVersion,\n }\n : {};\n return useQuery({\n queryKey: ['onboarding-json-schema-form', countryCode, form],\n retry: false,\n queryFn: async () => {\n const response = await getShowFormCountry({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n country_code: countryCode,\n form: form,\n },\n query: {\n skip_benefits: true,\n ...query,\n ...jsonSchemaQueryParam,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch onboarding schema');\n }\n\n return response;\n },\n enabled: options?.queryOptions?.enabled,\n select: ({ data }) => {\n const jsfSchema = data?.data || {};\n return createHeadlessForm(jsfSchema, fieldValues, options);\n },\n });\n};\n\nexport const useBenefitOffersSchema = (\n employmentId: string,\n fieldValues: FieldValues,\n options: OnboardingFlowProps['options'],\n) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n const { client } = useClient();\n return useQuery({\n queryKey: ['benefit-offers-schema', employmentId],\n retry: false,\n enabled: !!employmentId,\n queryFn: async () => {\n const response = await getShowSchema({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n query: jsonSchemaQueryParam,\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch benefit offers schema');\n }\n\n return response;\n },\n select: ({ data }) => {\n const jsfSchema = data?.data?.schema || {};\n\n return createHeadlessForm(jsfSchema, fieldValues, {\n jsfModify: options?.jsfModify?.benefits,\n });\n },\n });\n};\n\n/**\n * Use this hook to create an employment\n * @returns\n */\nexport const useCreateEmployment = () => {\n const { client } = useClient();\n // TODO: setting 1 as basic_information only supports v1 for now in the API\n const jsonSchemaQueryParam = {\n json_schema_version: 1,\n };\n return useMutation({\n mutationFn: (payload: EmploymentCreateParams) => {\n return postCreateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useUpdateEmployment = (\n countryCode: string,\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n const jsonSchemaQueryParams = {\n // TODO: setting 1 as basic_information only supports v1 for now in the API\n employment_basic_information_json_schema_version: 1,\n contract_details_json_schema_version:\n getContractDetailsSchemaVersion(options, countryCode) || 1,\n };\n\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: EmploymentFullParams & { employmentId: string }) => {\n return patchUpdateEmployment2({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n skip_benefits: true,\n ...jsonSchemaQueryParams,\n },\n });\n },\n });\n};\n\nexport const useUpdateBenefitsOffers = (\n options?: OnboardingFlowProps['options'],\n) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: UnifiedEmploymentUpsertBenefitOffersRequest & {\n employmentId: string;\n }) => {\n const jsonSchemaQueryParam = options?.jsonSchemaVersion\n ?.benefit_offers_form_schema\n ? {\n json_schema_version:\n options.jsonSchemaVersion.benefit_offers_form_schema,\n }\n : {};\n return putUpdateBenefitOffer({\n client: client as Client,\n body: payload,\n path: {\n employment_id: employmentId,\n },\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useCountriesSchemaField = (\n options?: Omit<FlowOptions, 'jsonSchemaVersion'> & {\n queryOptions?: { enabled?: boolean };\n },\n) => {\n const { client } = useClient();\n const { data: countries, isLoading } = useQuery({\n ...countriesOptions(client as Client, 'onboarding-countries'),\n select: (response) => {\n return (\n response.data?.data\n ?.filter((country) => country.eor_onboarding)\n .map((country) => {\n return {\n label: country.name,\n value: country.code,\n };\n }) || []\n );\n },\n enabled: options?.queryOptions?.enabled,\n });\n\n const selectCountryForm = createHeadlessForm(\n selectCountryStepSchema.data.schema,\n {},\n options,\n );\n\n if (countries) {\n const countryField = selectCountryForm.fields.find(\n (field) => field.name === 'country',\n );\n if (countryField) {\n countryField.options = countries;\n }\n }\n\n return {\n isLoading,\n selectCountryForm,\n };\n};\n\nexport const useConvertCurrency = ({\n type = 'spread',\n}: {\n type?: 'spread' | 'no_spread';\n}) => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: ConvertCurrencyParams) => {\n const apiFn =\n type === 'no_spread'\n ? postConvertRawCurrencyConverter\n : postConvertWithSpreadCurrencyConverter;\n return apiFn({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\nexport const useUpsertContractEligibility = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: ({\n employmentId,\n ...payload\n }: { employmentId: string } & CreateContractEligibilityParams) => {\n return postCreateContractEligibility({\n client: client as Client,\n path: {\n employment_id: employmentId,\n },\n body: payload,\n });\n },\n });\n};\n\n/**\n * Hook to fetch onboarding reserves status for an employment\n * @param companyId - Company ID\n * @param employmentId - Employment ID\n * @param enabled - Whether the query should be enabled\n * @returns Query result with onboarding reserves status\n */\nexport const useEmploymentOnboardingReservesStatus = (\n companyId: string | undefined,\n employmentId: string | undefined,\n enabled = true,\n) => {\n const { client } = useClient();\n return useQuery({\n queryKey: [\n 'employment-onboarding-reserves-status',\n companyId,\n employmentId,\n ],\n retry: false,\n enabled: enabled && !!companyId && !!employmentId,\n queryFn: async () => {\n const response = await getShowCompanyEmploymentOnboardingReservesStatus({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: {\n company_id: companyId as string,\n employment_id: employmentId as string,\n },\n });\n\n if (response.error || !response.data) {\n throw new Error(\n 'Failed to fetch employment onboarding reserves status',\n );\n }\n\n return response;\n },\n select: ({ data }) => data?.data?.status,\n });\n};\n"],"mappings":"mXAAA,OAAS,eAAAA,EAAa,YAAAC,MAAgC,wBAsC/C,IAAMC,EAAgBC,EAACC,GAAqC,CACjE,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAE7B,OAAOC,EAAS,CACd,SAAU,CAAC,aAAcH,CAAY,EACrC,MAAO,GACP,QAAS,CAAC,CAACA,EACX,OAAQD,EAAA,CAAC,CAAE,KAAAK,CAAK,IACPA,GAAM,KAAK,WADZ,UAGR,QAASL,EAAA,SAAY,CACnB,IAAMM,EAAW,MAAMC,EAAkB,CACvC,OAAQL,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAM,CACJ,cAAeD,CACjB,CACF,CAAC,EAGD,GAAIK,EAAS,OAAS,CAACA,EAAS,KAC9B,MAAM,IAAI,MAAM,iCAAiC,EAGnD,OAAOA,CACT,EAjBS,UAkBX,CAAC,CACH,EA7B6B,iBA+BhBE,EAAaR,EAACS,GAAsB,CAC/C,GAAM,CAAE,OAAAP,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,UAAWK,CAAS,EAC/B,MAAO,GACP,QAAS,CAAC,CAACA,EACX,QAAST,EAAA,SAAY,CACnB,IAAMM,EAAW,MAAMI,EAAe,CACpC,OAAQR,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAM,CACJ,WAAYO,CACd,CACF,CAAC,EAED,GAAIH,EAAS,OAAS,CAACA,EAAS,KAC9B,MAAM,IAAI,MAAM,iCAAiC,EAGnD,OAAOA,CACT,EAh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B,CACR,CAAC,EAVS,aAYd,CAAC,CACH,EAhB4C,gCAyB/BwC,GAAwCzD,EAAA,CACnDS,EACAR,EACAyD,EAAU,KACP,CACH,GAAM,CAAE,OAAAxD,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CACR,wCACAK,EACAR,CACF,EACA,MAAO,GACP,QAASyD,GAAW,CAAC,CAACjD,GAAa,CAAC,CAACR,EACrC,QAASD,EAAA,SAAY,CACnB,IAAMM,EAAW,MAAMqD,EAAiD,CACtE,OAAQzD,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAM,CACJ,WAAYO,EACZ,cAAeR,CACjB,CACF,CAAC,EAED,GAAIK,EAAS,OAAS,CAACA,EAAS,KAC9B,MAAM,IAAI,MACR,uDACF,EAGF,OAAOA,CACT,EAnBS,WAoBT,OAAQN,EAAA,CAAC,CAAE,KAAAK,CAAK,IAAMA,GAAM,MAAM,OAA1B,SACV,CAAC,CACH,EApCqD","names":["useMutation","useQuery","useEmployment","__name","employmentId","client","useClient","useQuery","data","response","getShowEmployment","useCompany","companyId","getShowCompany","useBenefitOffers","getIndexBenefitOffer","acc","item","useEmploymentInvite","useMutation","payload","postInviteEmploymentInvitation","useCreateReserveInvoice","postCreateRiskReserve","useJSONSchemaForm","countryCode","form","fieldValues","options","query","jsonSchemaVersion","jsonSchemaQueryParam","getShowFormCountry","jsfSchema","createHeadlessForm","useBenefitOffersSchema","getShowSchema","useCreateEmployment","postCreateEmployment2","useUpdateEmployment","jsonSchemaQueryParams","getContractDetailsSchemaVersion","patchUpdateEmployment2","useUpdateBenefitsOffers","putUpdateBenefitOffer","useCountriesSchemaField","countries","isLoading","countriesOptions","country","selectCountryForm","selectCountryStepSchema","countryField","field","useConvertCurrency","type","postConvertRawCurrencyConverter","postConvertWithSpreadCurrencyConverter","useUpsertContractEligibility","postCreateContractEligibility","useEmploymentOnboardingReservesStatus","enabled","getShowCompanyEmploymentOnboardingReservesStatus"]}
|
package/dist/chunk-RQWB2F74.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Be}from"./chunk-J5I5ZSW3.js";import{a as qe}from"./chunk-VAIBLWOY.js";import{b as Ve,c as Pe,f as xe,g as Oe,h as Me,i as Re,j as ve,k as we,m as Te,n as Le}from"./chunk-HPLRAHY7.js";import{a as ge,b as Ee,c as Ce,d as Fe,f as he}from"./chunk-STF3NTPS.js";import{a as ke}from"./chunk-YIOLMWB5.js";import{e as C,f as T,h as $}from"./chunk-I3DVKJCW.js";import{h as M}from"./chunk-VIGKOVHP.js";import{a as w}from"./chunk-X6ZAR7ZL.js";import{a as De}from"./chunk-TSPDJUGG.js";import{a as o}from"./chunk-P37U34EQ.js";import{useCallback as Ft,useEffect as ht,useMemo as p,useRef as Vt,useState as Ie}from"react";import Pt from"lodash.mergewith";import{createContext as yt,useContext as _t,useMemo as St,useCallback as bt,useRef as gt}from"react";import{jsx as Et}from"react/jsx-runtime";var Je=yt(void 0);function Tt({children:r}){let u=gt({}),c=bt(a=>{u.current={...u.current,...a}},[]),F=St(()=>({errorContextRef:u,updateContext:c}),[c]);return Et(Je.Provider,{value:F,children:r})}o(Tt,"ErrorContextProvider");var je=o(()=>{let r=_t(Je);if(!r)throw new Error("useErrorContext must be used within ErrorContextProvider");return r},"useErrorContext");import{useEffect as Ne,useMemo as Ct}from"react";function Ae(r){let{updateContext:u,errorContextRef:c}=je();return Ne(()=>{r&&(c.current=r)},[]),Ne(()=>()=>{c.current={}},[c]),{...Ct(()=>({updateErrorContext:o(a=>{u(a)},"updateErrorContext"),clearErrorContext:o(()=>{c.current={}},"clearErrorContext")}),[]),errorContext:c}}o(Ae,"useErrorReporting");import{jsx as Ue}from"react/jsx-runtime";var xt={employment_basic_information:"basic_information",contract_details:"contract_details"},Ot={select_country:null,basic_information:"employment_basic_information",contract_details:"contract_details",benefits:null,review:null},Mt=o(({isLoadingBasicInformationForm:r,isLoadingContractDetailsForm:u,isLoadingEmployment:c,isLoadingBenefitsOffersSchema:F,isLoadingBenefitOffers:a,isLoadingCompany:N,isLoadingCountries:R,employmentStatus:s,employmentId:L,currentStepName:A,basicInformationFields:I,contractDetailsFields:y})=>{let t=r||u||c||F||a||N||R,k=s&&Ce.includes(s),U=s&&!Fe.includes(s),D=!!(L&&k&&A!=="review"),v=t||D,B=!!(D&&!t&&I.length>0&&y.length>0);return{isLoading:v,isNavigatingToReview:B,isEmploymentReadOnly:k,canInvite:U}},"getLoadingStates"),Zt=o(({employmentId:r,companyId:u,countryCode:c,type:F,options:a,skipSteps:N,externalId:R,initialValues:s})=>{let{updateErrorContext:L}=Ae({flow:"onboarding",metadata:{employmentId:r,companyId:u,isUpdating:!!r}}),A=N?.includes("select_country")?Ee:ge,I=Ft(e=>{L({step:e.name})},[L]),{fieldValues:y,stepState:t,setFieldValues:k,previousStep:U,nextStep:D,goToStep:v,setStepValues:B}=De(A,I),q=Vt({select_country:{},basic_information:{},contract_details:{},benefits:{}}),[l,He]=Ie(r),[d,z]=Ie(c||null),{data:m,isLoading:K,refetch:We}=ke({employmentId:l,queryParams:{exclude_files:!0}});r&&m?.country?.code&&!d&&z(m.country.code);let{data:Q,isLoading:Y}=Pe(l),{data:J,isLoading:X,refetch:Ge}=Ve(u),$e=a?.features?.includes("onboarding_reserves")&&t.currentStep.name==="review"||!1,{data:ze}=Le(u,l,$e),{selectCountryForm:j,isLoading:Z}=we({jsfModify:a?.jsfModify?.select_country,queryOptions:{enabled:t.currentStep.name==="select_country"}}),ee=Me(),te=Re(d,a),ne=ve(a),oe=Te(),{mutateAsync:Ke}=w(ee),{mutateAsync:re}=w(te),{mutateAsync:Qe}=w(ne),{mutateAsync:Ye}=w(oe),Xe=Ot[t.currentStep.name]||"employment_basic_information",Ze=xt[Xe],et=m?.[Ze]||{},ae=o(({form:e,options:i={},query:f={},jsonSchemaVersion:O})=>{let W=Object.keys(y).length>0?{...s,...t.values?.[t.currentStep.name],...y}:{...s,...et};return xe({countryCode:d,form:e,fieldValues:W,query:f,options:{...i,queryOptions:{enabled:i.queryOptions?.enabled??!0}},jsonSchemaVersion:O})},"useJSONSchema"),tt=!!(d&&(t.currentStep.name==="basic_information"||r)),nt=!!(d&&(t.currentStep.name==="contract_details"||r)),{data:_,isLoading:ie}=ae({form:"employment_basic_information",options:{jsfModify:a?.jsfModify?.basic_information,queryOptions:{enabled:tt}},jsonSchemaVersion:1}),h=a?.jsfModify?.contract_details?.fields?.annual_gross_salary,H=h&&typeof h=="object"&&"presentation"in h?h.presentation:void 0,se=a?.jsfModify?.contract_details?.fields?.equity_compensation,ot=p(()=>({fields:{annual_gross_salary:{...h,presentation:{annual_gross_salary_conversion_properties:{label:H?.annual_gross_salary_conversion_properties?.label,description:H?.annual_gross_salary_conversion_properties?.description},desiredCurrency:J?.desired_currency,Component:o(e=>Ue(Be,{desiredCurrency:J?.desired_currency||"",...e}),"Component")}},equity_compensation:{...se,presentation:{calculateDynamicProperties:o((e,i)=>{let f=e.equity_compensation?.offer_equity_compensation,O=i?.meta?.cost;return{extra:Ue(qe,{offerEquity:f,equityCost:O})}},"calculateDynamicProperties")}}}}),[h,H,J?.desired_currency,se]),rt=he(a,d),{data:S,isLoading:ce}=ae({form:"contract_details",query:{employment_id:l},options:{jsfModify:{...a?.jsfModify?.contract_details,fields:{...a?.jsfModify?.contract_details?.fields,...ot.fields}},queryOptions:{enabled:nt}},jsonSchemaVersion:rt}),{data:g,isLoading:le}=Oe(l,y,a),de=p(()=>{if(t.currentStep.name==="benefits"){let e={...t.values?.[t.currentStep.name],...y};return Pt({},Q,e)}return{}},[t.currentStep.name,Q,t.values,y]),n=p(()=>({select_country:j?.fields||[],basic_information:_?.fields||[],contract_details:S?.fields||[],benefits:g?.fields||[],review:[]}),[j?.fields,_?.fields,S?.fields,g?.fields]),at={select_country:null,basic_information:_?.meta["x-jsf-fieldsets"],contract_details:S?.meta["x-jsf-fieldsets"],benefits:null,review:null},{country:it,basic_information:ue={},contract_details:me={},status:fe}=m||{},pe=it?.code,ye=t.currentStep.name,V=p(()=>T(n.select_country,{country:d||pe||""}),[n.select_country,d,pe]),P=p(()=>{let e={...s,...ue};return T(n.basic_information,e)},[n.basic_information,ue,s]),E=p(()=>{let e={...s,...me};return T(n.contract_details,e)},[n.contract_details,me,s]),x=p(()=>{let e={...s,...de};return T(n.benefits,e)},[n.benefits,de,s]),st=p(()=>m?{select_country:V,basic_information:$(n.basic_information,P),contract_details:m?.contract_details!==null?$(n.contract_details,E):E,benefits:x}:{select_country:V,basic_information:P,contract_details:E,benefits:x},[V,P,E,x,m,n]),{isLoading:ct,isNavigatingToReview:_e,isEmploymentReadOnly:lt,canInvite:dt}=p(()=>Mt({isLoadingBasicInformationForm:ie,isLoadingContractDetailsForm:ce,isLoadingEmployment:K,isLoadingBenefitsOffersSchema:le,isLoadingBenefitOffers:Y,isLoadingCompany:X,isLoadingCountries:Z,employmentId:r,employmentStatus:fe,basicInformationFields:n.basic_information,contractDetailsFields:n.contract_details,currentStepName:ye}),[ie,ce,K,le,Y,X,Z,r,fe,n.basic_information,n.contract_details,ye]);ht(()=>{_e&&(q.current={select_country:M(V,n.select_country),basic_information:M(P,n.basic_information),contract_details:M(E,n.contract_details),benefits:M(x,n.benefits)},B({select_country:V,basic_information:P,contract_details:E,benefits:x,review:{}}),v("review"))},[P,x,E,v,_e,V,B,n.basic_information,n.benefits,n.contract_details,n.select_country]);let Se=o(async e=>j&&t.currentStep.name==="select_country"?e:_&&t.currentStep.name==="basic_information"?await C(e,_?.fields,{isPartialValidation:!1}):S&&t.currentStep.name==="contract_details"?await C(e,S?.fields,{isPartialValidation:!1}):g&&t.currentStep.name==="benefits"?await C(e,g?.fields,{isPartialValidation:!1}):{},"parseFormValues");async function ut(e){let i=t.currentStep.name;i in q.current&&(q.current[i]=M(e,n[i]));let f=await Se(e);switch(Ge(),t.currentStep.name){case"select_country":return z(f.country),Promise.resolve({data:{countryCode:f.country}});case"basic_information":{let O=!l&&d,be=l&&d&&m?.country&&m?.country.code!==d;if(O||be){let W={basic_information:f,type:F,country_code:d,external_id:R};try{let b=await Ke(W);if(b.error)return b;if(b.data){let G=b.data?.data?.employment?.id;return G&&(He(G),await Ye({employmentId:G,eligible_to_work_in_residing_country:"citizen",employer_or_work_restrictions:!1})),b}}catch(b){throw console.error("Error creating onboarding:",b),b}}else if(l)return re({employmentId:l,basic_information:f,pricing_plan_details:{frequency:"monthly"},external_id:R});return}case"contract_details":return re({employmentId:l,external_id:R,...{contract_details:f,pricing_plan_details:{frequency:"monthly"}}});case"benefits":return Qe({employmentId:l,...f})}}o(ut,"onSubmit");function mt(){U()}o(mt,"back");function ft(){D()}o(ft,"next");function pt(e){v(e)}return o(pt,"goTo"),{employmentId:l,creditRiskStatus:J?.default_legal_entity_credit_risk_status,onboardingReservesStatus:ze,fieldValues:y,stepState:t,fields:n[t.currentStep.name],isLoading:ct,isSubmitting:ee.isPending||te.isPending||ne.isPending||oe.isPending,initialValues:st,handleValidation:o(async e=>{if(t.currentStep.name==="select_country")return j.handleValidation(e);if(t.currentStep.name==="benefits"&&g){let i=await C(e,g?.fields,{isPartialValidation:!1});return g?.handleValidation(i)}if(_&&t.currentStep.name==="basic_information"){let i=await C(e,_?.fields,{isPartialValidation:!1});return _?.handleValidation(i)}if(S&&t.currentStep.name==="contract_details"){let i=await C(e,S?.fields,{isPartialValidation:!1});return S?.handleValidation(i)}return null},"handleValidation"),checkFieldUpdates:k,parseFormValues:Se,onSubmit:ut,back:mt,next:ft,goTo:pt,meta:{fields:q.current,fieldsets:at[t.currentStep.name]},refetchEmployment:We,employment:m,isEmploymentReadOnly:lt,canInvite:dt}},"useOnboarding");export{Je as a,Tt as b,Zt as c};
|
|
2
|
-
//# sourceMappingURL=chunk-RQWB2F74.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/flows/Onboarding/hooks.tsx","../src/components/error-handling/ErrorContext.tsx","../src/components/error-handling/useErrorReporting.ts"],"sourcesContent":["import { ValidationResult } from '@remoteoss/remote-json-schema-form-kit';\nimport {\n Employment,\n EmploymentCreateParams,\n EmploymentFullParams,\n} from '@/src/client';\nimport { JSFFields } from '@/src/types/remoteFlows';\nimport { useStepState, Step } from '@/src/flows/useStepState';\nimport {\n disabledInviteButtonEmploymentStatus,\n getContractDetailsSchemaVersion,\n reviewStepAllowedEmploymentStatus,\n STEPS,\n STEPS_WITHOUT_SELECT_COUNTRY,\n} from '@/src/flows/Onboarding/utils';\nimport { prettifyFormValues } from '@/src/lib/utils';\nimport {\n getInitialValues,\n enableAckFields,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { FieldValues } from 'react-hook-form';\nimport { OnboardingFlowProps } from '@/src/flows/Onboarding/types';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport mergeWith from 'lodash.mergewith';\nimport {\n useBenefitOffers,\n useBenefitOffersSchema,\n useCompany,\n useCountriesSchemaField,\n useCreateEmployment,\n useEmploymentOnboardingReservesStatus,\n useJSONSchemaForm,\n useUpdateBenefitsOffers,\n useUpdateEmployment,\n useUpsertContractEligibility,\n} from '@/src/flows/Onboarding/api';\nimport { JSFModify, JSONSchemaFormType } from '@/src/flows/types';\nimport { AnnualGrossSalary } from '@/src/flows/Onboarding/components/AnnualGrossSalary';\nimport { $TSFixMe, JSFField, JSFFieldset, Meta } from '@/src/types/remoteFlows';\nimport { EquityPriceDetails } from '@/src/flows/Onboarding/components/EquityPriceDetails';\nimport { useErrorReporting } from '@/src/components/error-handling/useErrorReporting';\nimport { useEmploymentQuery } from '@/src/common/api/employment';\n\ntype OnboardingHookProps = Omit<OnboardingFlowProps, 'render'>;\n\nconst jsonSchemaToEmployment: Partial<\n Record<JSONSchemaFormType, keyof Employment>\n> = {\n employment_basic_information: 'basic_information',\n contract_details: 'contract_details',\n};\n\nconst stepToFormSchemaMap: Record<\n keyof typeof STEPS,\n JSONSchemaFormType | null\n> = {\n select_country: null,\n basic_information: 'employment_basic_information',\n contract_details: 'contract_details',\n benefits: null,\n review: null,\n};\n\nconst getLoadingStates = ({\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentStatus,\n employmentId,\n currentStepName,\n basicInformationFields,\n contractDetailsFields,\n}: {\n isLoadingBasicInformationForm: boolean;\n isLoadingContractDetailsForm: boolean;\n isLoadingEmployment: boolean;\n isLoadingBenefitsOffersSchema: boolean;\n isLoadingBenefitOffers: boolean;\n isLoadingCompany: boolean;\n isLoadingCountries: boolean;\n employmentStatus?: Employment['status'];\n employmentId?: string;\n currentStepName: string;\n basicInformationFields: JSFFields;\n contractDetailsFields: JSFFields;\n}) => {\n const initialLoading =\n isLoadingBasicInformationForm ||\n isLoadingContractDetailsForm ||\n isLoadingEmployment ||\n isLoadingBenefitsOffersSchema ||\n isLoadingBenefitOffers ||\n isLoadingCompany ||\n isLoadingCountries;\n\n const isEmploymentReadOnly =\n employmentStatus &&\n reviewStepAllowedEmploymentStatus.includes(employmentStatus);\n\n const canInvite =\n employmentStatus &&\n !disabledInviteButtonEmploymentStatus.includes(employmentStatus);\n\n const shouldHandleReadOnlyEmployment = Boolean(\n employmentId && isEmploymentReadOnly && currentStepName !== 'review',\n );\n\n const isLoading = initialLoading || shouldHandleReadOnlyEmployment;\n\n const isNavigatingToReview = Boolean(\n shouldHandleReadOnlyEmployment &&\n !initialLoading &&\n basicInformationFields.length > 0 &&\n contractDetailsFields.length > 0,\n );\n\n return {\n isLoading,\n isNavigatingToReview,\n isEmploymentReadOnly,\n canInvite,\n };\n};\n\nexport const useOnboarding = ({\n employmentId,\n companyId,\n countryCode,\n type,\n options,\n skipSteps,\n externalId,\n initialValues: onboardingInitialValues,\n}: OnboardingHookProps) => {\n const { updateErrorContext } = useErrorReporting({\n flow: 'onboarding',\n metadata: {\n employmentId,\n companyId,\n isUpdating: Boolean(employmentId),\n },\n });\n const stepsToUse = skipSteps?.includes('select_country')\n ? STEPS_WITHOUT_SELECT_COUNTRY\n : STEPS;\n\n const onStepChange = useCallback(\n (step: Step<keyof typeof STEPS>) => {\n updateErrorContext({\n step: step.name,\n });\n },\n [updateErrorContext],\n );\n\n const {\n fieldValues,\n stepState,\n setFieldValues,\n previousStep,\n nextStep,\n goToStep,\n setStepValues,\n } = useStepState(\n stepsToUse as Record<keyof typeof STEPS, Step<keyof typeof STEPS>>,\n onStepChange,\n );\n\n const fieldsMetaRef = useRef<{\n select_country: Meta;\n basic_information: Meta;\n contract_details: Meta;\n benefits: Meta;\n }>({\n select_country: {},\n basic_information: {},\n contract_details: {},\n benefits: {},\n });\n const [internalEmploymentId, setInternalEmploymentId] = useState<\n string | undefined\n >(employmentId);\n const [internalCountryCode, setInternalCountryCode] = useState<string | null>(\n countryCode || null,\n );\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n refetch: refetchEmployment,\n } = useEmploymentQuery({\n employmentId: internalEmploymentId as string,\n queryParams: { exclude_files: true },\n });\n\n // if the employment is loaded, country code has not been set yet\n // we set the internal country code with the employment country code\n if (employmentId && employment?.country?.code && !internalCountryCode) {\n setInternalCountryCode(employment.country.code);\n }\n\n const { data: benefitOffers, isLoading: isLoadingBenefitOffers } =\n useBenefitOffers(internalEmploymentId);\n\n const {\n data: company,\n isLoading: isLoadingCompany,\n refetch: refetchCompany,\n } = useCompany(companyId);\n\n const isOnboardingReservesEnabled =\n (options?.features?.includes('onboarding_reserves') &&\n stepState.currentStep.name === 'review') ||\n false;\n\n const { data: onboardingReservesStatus } =\n useEmploymentOnboardingReservesStatus(\n companyId,\n internalEmploymentId,\n isOnboardingReservesEnabled,\n );\n\n const { selectCountryForm, isLoading: isLoadingCountries } =\n useCountriesSchemaField({\n jsfModify: options?.jsfModify?.select_country,\n queryOptions: {\n enabled: stepState.currentStep.name === 'select_country',\n },\n });\n\n const createEmploymentMutation = useCreateEmployment();\n const updateEmploymentMutation = useUpdateEmployment(\n internalCountryCode as string,\n options,\n );\n const updateBenefitsOffersMutation = useUpdateBenefitsOffers(options);\n const updateContractEligibilityMutation = useUpsertContractEligibility();\n const { mutateAsync: createEmploymentMutationAsync } = mutationToPromise(\n createEmploymentMutation,\n );\n const { mutateAsync: updateEmploymentMutationAsync } = mutationToPromise(\n updateEmploymentMutation,\n );\n const { mutateAsync: updateBenefitsOffersMutationAsync } = mutationToPromise(\n updateBenefitsOffersMutation,\n );\n const { mutateAsync: updateContractEligibilityMutationAsync } =\n mutationToPromise(updateContractEligibilityMutation);\n\n const formType =\n stepToFormSchemaMap[stepState.currentStep.name] ||\n 'employment_basic_information';\n const employmentKey = jsonSchemaToEmployment[formType] as keyof Employment;\n const serverEmploymentData = (employment?.[employmentKey] || {}) as Record<\n string,\n unknown\n >;\n\n const useJSONSchema = ({\n form,\n options: jsonSchemaOptions = {},\n query = {},\n jsonSchemaVersion,\n }: {\n form: JSONSchemaFormType;\n options?: {\n jsfModify?: JSFModify;\n queryOptions?: { enabled?: boolean };\n };\n query?: Record<string, string>;\n jsonSchemaVersion?: number | 'latest';\n }) => {\n const hasUserEnteredAnyValues = Object.keys(fieldValues).length > 0;\n // when you write on the fields, the values are stored in the fieldValues state\n // when values are stored in the stepState is when the user has navigated to the step\n // and then we have the values from the server and the onboardingInitialValues that the user can inject,\n const mergedFormValues = hasUserEnteredAnyValues\n ? {\n ...onboardingInitialValues,\n ...stepState.values?.[stepState.currentStep.name], // Restore values for the current step\n ...fieldValues,\n }\n : {\n ...onboardingInitialValues,\n ...serverEmploymentData,\n };\n\n return useJSONSchemaForm({\n countryCode: internalCountryCode as string,\n form: form,\n fieldValues: mergedFormValues,\n query,\n options: {\n ...jsonSchemaOptions,\n queryOptions: {\n enabled: jsonSchemaOptions.queryOptions?.enabled ?? true,\n },\n },\n jsonSchemaVersion,\n });\n };\n\n const isBasicInformationDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'basic_information' ||\n Boolean(employmentId)),\n );\n\n const isContractDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'contract_details' ||\n Boolean(employmentId)),\n );\n\n const {\n data: basicInformationForm,\n isLoading: isLoadingBasicInformationForm,\n } = useJSONSchema({\n form: 'employment_basic_information',\n options: {\n jsfModify: options?.jsfModify?.basic_information,\n queryOptions: {\n enabled: isBasicInformationDetailsEnabled,\n },\n },\n jsonSchemaVersion: 1,\n });\n\n const annualGrossSalaryField =\n options?.jsfModify?.contract_details?.fields?.annual_gross_salary;\n const annualSalaryFieldPresentation =\n annualGrossSalaryField &&\n typeof annualGrossSalaryField === 'object' &&\n 'presentation' in annualGrossSalaryField\n ? (\n annualGrossSalaryField as {\n presentation?: {\n annual_gross_salary_conversion_properties?: {\n label?: string;\n description?: string;\n };\n };\n }\n ).presentation\n : undefined;\n\n const equityCompensationField =\n options?.jsfModify?.contract_details?.fields?.equity_compensation;\n\n const contractDetailsCustomFields = useMemo(\n () => ({\n fields: {\n annual_gross_salary: {\n ...annualGrossSalaryField,\n presentation: {\n annual_gross_salary_conversion_properties: {\n label:\n annualSalaryFieldPresentation\n ?.annual_gross_salary_conversion_properties?.label,\n description:\n annualSalaryFieldPresentation\n ?.annual_gross_salary_conversion_properties?.description,\n },\n desiredCurrency: company?.desired_currency,\n Component: (props: JSFField & { currency: string }) => {\n return (\n <AnnualGrossSalary\n desiredCurrency={company?.desired_currency || ''}\n {...props}\n />\n );\n },\n },\n },\n equity_compensation: {\n ...equityCompensationField,\n presentation: {\n calculateDynamicProperties: (\n values: FieldValues,\n field: JSFField,\n ) => {\n const offerEquity =\n values.equity_compensation?.offer_equity_compensation;\n const equityCost = field?.meta?.cost;\n\n return {\n extra: (\n <EquityPriceDetails\n offerEquity={offerEquity}\n equityCost={equityCost as $TSFixMe}\n />\n ),\n };\n },\n },\n },\n },\n }),\n [\n annualGrossSalaryField,\n annualSalaryFieldPresentation,\n company?.desired_currency,\n equityCompensationField,\n ],\n );\n\n const effectiveContractDetailsJsonSchemaVersion =\n getContractDetailsSchemaVersion(options, internalCountryCode);\n\n const { data: contractDetailsForm, isLoading: isLoadingContractDetailsForm } =\n useJSONSchema({\n form: 'contract_details',\n query: {\n employment_id: internalEmploymentId as string,\n },\n options: {\n jsfModify: {\n ...options?.jsfModify?.contract_details,\n fields: {\n ...options?.jsfModify?.contract_details?.fields,\n ...contractDetailsCustomFields.fields,\n },\n },\n queryOptions: {\n enabled: isContractDetailsEnabled,\n },\n },\n jsonSchemaVersion: effectiveContractDetailsJsonSchemaVersion,\n });\n\n const {\n data: benefitOffersSchema,\n isLoading: isLoadingBenefitsOffersSchema,\n } = useBenefitOffersSchema(\n internalEmploymentId as string,\n fieldValues,\n options,\n );\n\n const initialValuesBenefitOffers = useMemo(() => {\n if (stepState.currentStep.name === 'benefits') {\n const benefitsFormValues = {\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...fieldValues,\n };\n return mergeWith({}, benefitOffers, benefitsFormValues);\n }\n return {};\n }, [\n stepState.currentStep.name,\n benefitOffers,\n stepState.values,\n fieldValues,\n ]);\n\n const stepFields: Record<keyof typeof STEPS, JSFFields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n contract_details: contractDetailsForm?.fields || [],\n benefits: benefitOffersSchema?.fields || [],\n review: [],\n }),\n [\n selectCountryForm?.fields,\n basicInformationForm?.fields,\n contractDetailsForm?.fields,\n benefitOffersSchema?.fields,\n ],\n );\n\n const stepFieldsWithFlatFieldsets: Record<\n keyof typeof STEPS,\n JSFFieldset | null | undefined\n > = {\n select_country: null,\n basic_information: basicInformationForm?.meta['x-jsf-fieldsets'],\n contract_details: contractDetailsForm?.meta['x-jsf-fieldsets'],\n benefits: null,\n review: null,\n };\n\n const {\n country,\n basic_information: employmentBasicInformation = {},\n contract_details: employmentContractDetails = {},\n status: employmentStatus,\n } = employment || {};\n\n const employmentCountryCode = country?.code;\n const currentStepName = stepState.currentStep.name;\n\n const selectCountryInitialValues = useMemo(\n () =>\n getInitialValues(stepFields.select_country, {\n country: internalCountryCode || employmentCountryCode || '',\n }),\n [stepFields.select_country, internalCountryCode, employmentCountryCode],\n );\n\n const basicInformationInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentBasicInformation,\n };\n\n return getInitialValues(stepFields.basic_information, initialValues);\n }, [\n stepFields.basic_information,\n employmentBasicInformation,\n onboardingInitialValues,\n ]);\n\n const contractDetailsInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_details, initialValues);\n }, [\n stepFields.contract_details,\n employmentContractDetails,\n onboardingInitialValues,\n ]);\n\n const benefitsInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...initialValuesBenefitOffers,\n };\n\n return getInitialValues(stepFields.benefits, initialValues);\n }, [\n stepFields.benefits,\n initialValuesBenefitOffers,\n onboardingInitialValues,\n ]);\n\n const initialValues = useMemo(() => {\n if (employment) {\n return {\n select_country: selectCountryInitialValues,\n // We don't store ack fields in the db, eg \"ack_start_date_ammendment\" for Argentina, and therefore is not returned in the employment response\n // So when an employmentId exists, it means that the user has already started the onboarding process, and we need to enable the ack fields\n basic_information: enableAckFields(\n stepFields['basic_information'],\n basicInformationInitialValues,\n ),\n contract_details:\n // if contract details is null, it means it has not been filled yet, so we can't enable the ack fields\n employment?.contract_details !== null\n ? enableAckFields(\n stepFields['contract_details'],\n contractDetailsInitialValues,\n )\n : contractDetailsInitialValues,\n benefits: benefitsInitialValues,\n };\n }\n return {\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n benefits: benefitsInitialValues,\n };\n }, [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n benefitsInitialValues,\n employment,\n stepFields,\n ]);\n\n const { isLoading, isNavigatingToReview, isEmploymentReadOnly, canInvite } =\n useMemo(\n () =>\n getLoadingStates({\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentId,\n employmentStatus: employmentStatus,\n basicInformationFields: stepFields.basic_information,\n contractDetailsFields: stepFields.contract_details,\n currentStepName: currentStepName,\n }),\n [\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentId,\n employmentStatus,\n stepFields.basic_information,\n stepFields.contract_details,\n currentStepName,\n ],\n );\n\n useEffect(() => {\n if (isNavigatingToReview) {\n fieldsMetaRef.current = {\n select_country: prettifyFormValues(\n selectCountryInitialValues,\n stepFields.select_country,\n ),\n basic_information: prettifyFormValues(\n basicInformationInitialValues,\n stepFields.basic_information,\n ),\n contract_details: prettifyFormValues(\n contractDetailsInitialValues,\n stepFields.contract_details,\n ),\n benefits: prettifyFormValues(\n benefitsInitialValues,\n stepFields.benefits,\n ),\n };\n\n setStepValues({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n benefits: benefitsInitialValues,\n review: {},\n });\n\n goToStep('review');\n }\n }, [\n basicInformationInitialValues,\n benefitsInitialValues,\n contractDetailsInitialValues,\n goToStep,\n isNavigatingToReview,\n selectCountryInitialValues,\n setStepValues,\n stepFields.basic_information,\n stepFields.benefits,\n stepFields.contract_details,\n stepFields.select_country,\n ]);\n\n const parseFormValues = async (values: FieldValues) => {\n if (selectCountryForm && stepState.currentStep.name === 'select_country') {\n return values;\n }\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n return await parseJSFToValidate(values, basicInformationForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n contractDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n return await parseJSFToValidate(values, contractDetailsForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (benefitOffersSchema && stepState.currentStep.name === 'benefits') {\n return await parseJSFToValidate(values, benefitOffersSchema?.fields, {\n isPartialValidation: false,\n });\n }\n\n return {};\n };\n\n async function onSubmit(values: FieldValues) {\n // Prettify values for the current step\n const currentStepName = stepState.currentStep.name;\n if (currentStepName in fieldsMetaRef.current) {\n fieldsMetaRef.current[\n currentStepName as keyof typeof fieldsMetaRef.current\n ] = prettifyFormValues(values, stepFields[currentStepName]);\n }\n\n const parsedValues = await parseFormValues(values);\n refetchCompany();\n switch (stepState.currentStep.name) {\n case 'select_country': {\n setInternalCountryCode(parsedValues.country);\n return Promise.resolve({ data: { countryCode: parsedValues.country } });\n }\n case 'basic_information': {\n const isEmploymentNotLoaded =\n !internalEmploymentId && internalCountryCode;\n const hasChangedCountry =\n internalEmploymentId &&\n internalCountryCode &&\n employment?.country &&\n employment?.country.code !== internalCountryCode;\n if (isEmploymentNotLoaded || hasChangedCountry) {\n const payload: EmploymentCreateParams = {\n basic_information: parsedValues,\n type: type,\n country_code: internalCountryCode,\n external_id: externalId,\n };\n try {\n const response = await createEmploymentMutationAsync(payload);\n\n if (response.error) {\n return response;\n }\n\n if (response.data) {\n // @ts-expect-error the types from the response are not matching\n const employmentId = response.data?.data?.employment?.id;\n if (employmentId) {\n setInternalEmploymentId(employmentId);\n await updateContractEligibilityMutationAsync({\n employmentId: employmentId,\n eligible_to_work_in_residing_country: 'citizen',\n employer_or_work_restrictions: false,\n });\n }\n\n return response;\n }\n } catch (error) {\n console.error('Error creating onboarding:', error);\n throw error;\n }\n } else if (internalEmploymentId) {\n return updateEmploymentMutationAsync({\n employmentId: internalEmploymentId,\n basic_information: parsedValues,\n pricing_plan_details: {\n frequency: 'monthly',\n },\n external_id: externalId,\n });\n }\n\n return;\n }\n case 'contract_details': {\n const payload: EmploymentFullParams = {\n contract_details: parsedValues,\n pricing_plan_details: {\n frequency: 'monthly',\n },\n };\n return updateEmploymentMutationAsync({\n employmentId: internalEmploymentId as string,\n external_id: externalId,\n ...payload,\n });\n }\n\n case 'benefits': {\n return updateBenefitsOffersMutationAsync({\n employmentId: internalEmploymentId as string,\n ...parsedValues,\n });\n }\n }\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n function goTo(step: keyof typeof STEPS) {\n goToStep(step);\n }\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId: internalEmploymentId,\n\n /**\n * Credit risk status of the company, useful to know what to to show in the review step\n * The possible values are:\n * - not_started\n * - ready\n * - in_progress\n * - referred\n * - fail\n * - deposit_required\n * - no_deposit_required\n */\n\n creditRiskStatus: company?.default_legal_entity_credit_risk_status,\n /**\n * Onboarding reserves status for the employment\n * Returns 'deposit_required' if a deposit is required based on onboarding reserves policies\n */\n onboardingReservesStatus: onboardingReservesStatus,\n /**\n * Current state of the form fields for the current step.\n */\n fieldValues,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the onboarding schema\n */\n fields: stepFields[stepState.currentStep.name],\n /**\n * Loading state indicating if the onboarding schema is being fetched\n */\n isLoading: isLoading,\n /**\n * Loading state indicating if the onboarding mutation is in progress\n */\n isSubmitting:\n createEmploymentMutation.isPending ||\n updateEmploymentMutation.isPending ||\n updateBenefitsOffersMutation.isPending ||\n updateContractEligibilityMutation.isPending,\n /**\n * Initial form values\n */\n initialValues,\n /**\n * Function to validate form values against the onboarding schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: async (\n values: FieldValues,\n ): Promise<ValidationResult | null> => {\n if (stepState.currentStep.name === 'select_country') {\n return selectCountryForm.handleValidation(values);\n }\n if (stepState.currentStep.name === 'benefits' && benefitOffersSchema) {\n const parsedValues = await parseJSFToValidate(\n values,\n benefitOffersSchema?.fields,\n { isPartialValidation: false },\n );\n\n return benefitOffersSchema?.handleValidation(parsedValues);\n }\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n basicInformationForm?.fields,\n { isPartialValidation: false },\n );\n return basicInformationForm?.handleValidation(parsedValues);\n }\n\n if (\n contractDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n contractDetailsForm?.fields,\n { isPartialValidation: false },\n );\n return contractDetailsForm?.handleValidation(parsedValues);\n }\n\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues,\n\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n\n /**\n * Function to handle going to a specific step\n * @param step The step to go to.\n * @returns {void}\n */\n goTo,\n\n /**\n * Fields metadata for each step\n */\n meta: {\n fields: fieldsMetaRef.current,\n fieldsets: stepFieldsWithFlatFieldsets[stepState.currentStep.name],\n },\n\n /**\n * Function to refetch the employment data\n * @returns {void}\n */\n refetchEmployment,\n /**\n * Employment data\n */\n employment,\n\n /**\n * let's the user know that the employment cannot be edited, happens when employment.status is invited, created_awaiting_reserve or created_reserve_paid\n * @returns {boolean}\n */\n isEmploymentReadOnly,\n\n /**\n * let's the user know if the company can invite employees\n * @returns {boolean}\n */\n canInvite,\n };\n};\n","import {\n createContext,\n useContext,\n ReactNode,\n useMemo,\n useCallback,\n useRef,\n RefObject,\n} from 'react';\nimport type { ErrorContextData } from './types';\n\nexport type ErrorContextValue = {\n errorContextRef: RefObject<ErrorContextData>;\n updateContext: (updates: Partial<ErrorContextData>) => void;\n};\n\nexport const ErrorContext = createContext<ErrorContextValue | undefined>(\n undefined,\n);\n\nexport function ErrorContextProvider({ children }: { children: ReactNode }) {\n const errorContextRef = useRef<ErrorContextData>({});\n\n const updateContext = useCallback((updates: Partial<ErrorContextData>) => {\n errorContextRef.current = { ...errorContextRef.current, ...updates };\n }, []);\n\n // Memoize the value object to prevent unnecessary re-renders\n // Note: setContext is stable from useState and doesn't need to be in deps\n const value = useMemo(\n () => ({\n errorContextRef,\n updateContext,\n }),\n [updateContext],\n );\n\n return (\n <ErrorContext.Provider value={value}>{children}</ErrorContext.Provider>\n );\n}\n\nexport const useErrorContext = () => {\n const ctx = useContext(ErrorContext);\n if (!ctx) {\n throw new Error('useErrorContext must be used within ErrorContextProvider');\n }\n return ctx;\n};\n","import { useErrorContext } from '@/src/components/error-handling/ErrorContext';\nimport { ErrorContextData } from '@/src/components/error-handling/types';\nimport { useEffect, useMemo } from 'react';\n\nexport function useErrorReporting(initialContext: ErrorContextData) {\n const { updateContext, errorContextRef } = useErrorContext();\n\n // Set initial context on mount\n useEffect(() => {\n if (initialContext) {\n errorContextRef.current = initialContext;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Clear context on unmount\n useEffect(() => {\n return () => {\n errorContextRef.current = {};\n };\n }, [errorContextRef]);\n\n // Note: setContext and updateContext are stable, don't need to be in deps\n const handlers = useMemo(\n () => ({\n updateErrorContext: (updates: Partial<ErrorContextData>) => {\n updateContext(updates);\n },\n\n clearErrorContext: () => {\n errorContextRef.current = {};\n },\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n return {\n ...handlers,\n /**\n * @internal For unit testing only - we access the errorContext in the error boundary directly\n * Use updateErrorContext() and clearErrorContext() handlers instead.\n */\n errorContext: errorContextRef,\n };\n}\n"],"mappings":"4gBAwBA,OAAS,eAAAA,GAAa,aAAAC,GAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,OAAgB,QAClE,OAAOC,OAAe,mBCzBtB,OACE,iBAAAC,GACA,cAAAC,GAEA,WAAAC,GACA,eAAAC,GACA,UAAAC,OAEK,QA8BH,cAAAC,OAAA,oBAtBG,IAAMC,GAAeC,GAC1B,MACF,EAEO,SA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A,KAAAC,GAOA,KAAAC,GAKA,KAAM,CACJ,OAAQ5F,EAAc,QACtB,UAAWmE,GAA4B1E,EAAU,YAAY,IAAI,CACnE,EAMA,kBAAAe,GAIA,WAAAD,EAMA,qBAAAtC,GAMA,UAAAE,EACF,CACF,EA/zB6B","names":["useCallback","useEffect","useMemo","useRef","useState","mergeWith","createContext","useContext","useMemo","useCallback","useRef","jsx","ErrorContext","createContext","ErrorContextProvider","children","errorContextRef","useRef","updateContext","useCallback","updates","value","useMemo","__name","useErrorContext","ctx","useContext","useEffect","useMemo","useErrorReporting","initialContext","updateContext","errorContextRef","useErrorContext","useEffect","useMemo","__name","updates","jsx","jsonSchemaToEmployment","stepToFormSchemaMap","getLoadingStates","__name","isLoadingBasicInformationForm","isLoadingContractDetailsForm","isLoadingEmployment","isLoadingBenefitsOffersSchema","isLoadingBenefitOffers","isLoadingCompany","isLoadingCountries","employmentStatus","employmentId","currentStepName","basicInformationFields","contractDetailsFields","initialLoading","isEmploymentReadOnly","reviewStepAllowedEmploymentStatus","canInvite","disabledInviteButtonEmploymentStatus","shouldHandleReadOnlyEmployment","isLoading","isNavigatingToReview","useOnboarding","companyId","countryCode","type","options","skipSteps","externalId","onboardingInitialValues","updateErrorContext","useErrorReporting","stepsToUse","STEPS_WITHOUT_SELECT_COUNTRY","STEPS","onStepChange","useCallback","step","fieldValues","stepState","setFieldValues","previousStep","nextStep","goToStep","setStepValues","useStepState","fieldsMetaRef","useRef","internalEmploymentId","setInternalEmploymentId","useState","internalCountryCode","setInternalCountryCode","employment","refetchEmployment","useEmploymentQuery","benefitOffers","useBenefitOffers","company","refetchCompany","useCompany","isOnboardingReservesEnabled","onboardingReservesStatus","useEmploymentOnboardingReservesStatus","selectCountryForm","useCountriesSchemaField","createEmploymentMutation","useCreateEmployment","updateEmploymentMutation","useUpdateEmployment","updateBenefitsOffersMutation","useUpdateBenefitsOffers","updateContractEligibilityMutation","useUpsertContractEligibility","createEmploymentMutationAsync","mutationToPromise","updateEmploymentMutationAsync","updateBenefitsOffersMutationAsync","updateContractEligibilityMutationAsync","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","query","jsonSchemaVersion","mergedFormValues","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractDetailsEnabled","basicInformationForm","annualGrossSalaryField","annualSalaryFieldPresentation","equityCompensationField","contractDetailsCustomFields","useMemo","props","AnnualGrossSalary","values","field","offerEquity","equityCost","EquityPriceDetails","effectiveContractDetailsJsonSchemaVersion","getContractDetailsSchemaVersion","contractDetailsForm","benefitOffersSchema","useBenefitOffersSchema","initialValuesBenefitOffers","benefitsFormValues","mergeWith","stepFields","stepFieldsWithFlatFieldsets","country","employmentBasicInformation","employmentContractDetails","employmentCountryCode","selectCountryInitialValues","getInitialValues","basicInformationInitialValues","initialValues","contractDetailsInitialValues","benefitsInitialValues","enableAckFields","useEffect","prettifyFormValues","parseFormValues","parseJSFToValidate","onSubmit","parsedValues","isEmploymentNotLoaded","hasChangedCountry","payload","response","error","back","next","goTo"]}
|
package/dist/chunk-STF3NTPS.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-P37U34EQ.js";var c={select_country:{index:0,name:"select_country"},basic_information:{index:1,name:"basic_information"},contract_details:{index:2,name:"contract_details"},benefits:{index:3,name:"benefits"},review:{index:4,name:"review"}},d={basic_information:{index:0,name:"basic_information"},contract_details:{index:1,name:"contract_details"},benefits:{index:2,name:"benefits"},review:{index:3,name:"review"}},m=["invited","created_awaiting_reserve","created_reserve_paid"],l=["created_awaiting_reserve","invited"],s=1,r=e(()=>s,"getDefaultContractDetailsSchemaVersion"),p=e((o,t)=>{let i=o?.jsonSchemaVersionByCountry,n=t?i?.[t]?.contract_details:void 0;return n||r()},"getContractDetailsSchemaVersion");export{c as a,d as b,m as c,l as d,s as e,p as f};
|
|
2
|
-
//# sourceMappingURL=chunk-STF3NTPS.js.map
|
package/dist/chunk-VZ5BGG3N.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as T,b as g}from"./chunk-CT2D4IBR.js";import{a as d}from"./chunk-SNECOPBD.js";import{g as C}from"./chunk-I3DVKJCW.js";import{b as _}from"./chunk-YHCH57B7.js";import{c as u}from"./chunk-7EONM7HL.js";import{e as l}from"./chunk-VIGKOVHP.js";import{a as i}from"./chunk-P37U34EQ.js";import{Fragment as b}from"react";var y={...T,fieldset:g,"fieldset-flat":g};import{useEffect as R}from"react";import{Fragment as J,jsx as m,jsxs as x}from"react/jsx-runtime";var k=i(({name:t,description:a,helpCenter:n})=>x("span",{children:[m("span",{className:`text-xs RemoteFlows__ForcedValue__Description__${t}`,dangerouslySetInnerHTML:{__html:l(a)}}),n?.callToAction&&n?.id&&m(_,{className:"RemoteFlows__ForcedValue__HelpCenterLink",zendeskId:n.id,children:n.callToAction})]}),"Description");function h({name:t,value:a,description:n,statement:r,label:F,helpCenter:c}){let{setValue:e}=u(),o=l(r?.description||n);return R(()=>{e(t,a)},[]),m("div",{children:r?x(J,{children:[m("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${t}`,dangerouslySetInnerHTML:{__html:l(r?.title||F)}}),m(k,{name:t,description:l(r?.description||n),helpCenter:c})]}):m(k,{name:t,description:o,helpCenter:c})})}i(h,"ForcedValueField");import{Fragment as N,jsx as s,jsxs as S}from"react/jsx-runtime";function M(t){return t.const!==void 0&&t.const===t.default&&t.type!=="checkbox"&&t.type!=="hidden"}i(M,"checkFieldHasForcedValue");var K=i(({fields:t,fieldsets:a,fieldValues:n,components:r})=>{let{setValue:F}=u();if(!t||t.length===0)return null;let c=a&&n?C({fields:t,fieldsets:a,values:n}):t;return s(N,{children:c.map(e=>{if(e.calculateDynamicProperties&&(e={...e,...e.calculateDynamicProperties(n,e)||{}}),e.isVisible===!1||e.deprecated||e.hidden)return null;if(M(e))return s(h,{name:e.name,description:e.description,value:e.const,statement:e.statement,label:e.label,helpCenter:e.meta?.helpCenter},e.name);if(e.Component){let{Component:V}=e;return S(b,{children:[s(V,{setValue:P=>F(e.name,P),...e}),e.statement?s(d,{...e.statement}):null,e.extra?e.extra:null]},e.name)}let o=e.type,p=y[o];return p?o==="fieldset"?s(p,{...e,components:r},e.name):o==="fieldset-flat"?s(p,{...e,components:r,isFlatFieldset:!0},e.name):(o==="select"&&e.multiple&&(p=y["multi-select"]),S(b,{children:[s(p,{...e,component:r&&r[o]}),e.statement?s(d,{...e.statement}):null,e.extra?e.extra:null]},e.name)):S("p",{className:"error",children:["Field type ",o," not supported"]})})})},"JSONSchemaFormFields");export{K as a};
|
|
2
|
-
//# sourceMappingURL=chunk-VZ5BGG3N.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|