@remoteoss/remote-flows 0.31.0 → 0.32.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/README.md +46 -8
- package/dist/{chunk-OUSDXTNH.js → chunk-2W2XD7ZY.js} +2 -2
- package/dist/chunk-2W2XD7ZY.js.map +1 -0
- package/dist/{chunk-ACQ3OEOE.js → chunk-5AG4K2EA.js} +2 -2
- package/dist/{chunk-FQYK5BJV.js → chunk-5CVD5WZZ.js} +2 -2
- package/dist/chunk-5CVD5WZZ.js.map +1 -0
- package/dist/{chunk-BWJAHRV6.js → chunk-5KZXFQLZ.js} +2 -2
- package/dist/{chunk-LWGVLLBH.js → chunk-5OZPBBXS.js} +2 -2
- package/dist/chunk-5P7INAU2.js +2 -0
- package/dist/chunk-5P7INAU2.js.map +1 -0
- package/dist/{chunk-T2FGDQSU.js → chunk-6FWFRVQE.js} +2 -2
- package/dist/{chunk-5PPUPDYP.js → chunk-76DHIEN7.js} +2 -2
- package/dist/{chunk-XDNUJY3V.js → chunk-7CJX7I3M.js} +2 -2
- package/dist/{chunk-LGJYIUSH.js → chunk-7YQAVDVX.js} +2 -2
- package/dist/chunk-7YQAVDVX.js.map +1 -0
- package/dist/{chunk-PEHK6NHL.js → chunk-A477TZFC.js} +2 -2
- package/dist/{chunk-HWEJIPSK.js → chunk-AA7QB3QQ.js} +1 -1
- package/dist/{chunk-HS4VEURD.js → chunk-AM2IRFHQ.js} +2 -2
- package/dist/{chunk-FPJLWY23.js → chunk-B6IVJUEH.js} +2 -2
- package/dist/{chunk-PNAZ6US5.js → chunk-COBQ4WSJ.js} +2 -2
- package/dist/{chunk-OIVWGY5Z.js → chunk-CW3MAP5L.js} +2 -2
- package/dist/{chunk-H3ZR4EW5.js → chunk-DPWL4KNA.js} +2 -2
- package/dist/{chunk-YXXCHMX3.js → chunk-DXFA52BU.js} +2 -2
- package/dist/{chunk-AVX6IOGC.js → chunk-DXIO72S4.js} +2 -2
- package/dist/{chunk-OOCCLRPH.js → chunk-DZ2R72O5.js} +2 -2
- package/dist/{chunk-5ENAY65Y.js → chunk-E4CABUTS.js} +2 -2
- package/dist/{chunk-GWICTLVR.js → chunk-EM5UYWUQ.js} +2 -2
- package/dist/{chunk-E76DWINZ.js → chunk-ENW4DCDU.js} +2 -2
- package/dist/{chunk-JTOLQCOG.js → chunk-FRTJ4KWA.js} +2 -2
- package/dist/{chunk-GD425MMM.js → chunk-GCJCNDJ3.js} +2 -2
- package/dist/{chunk-NCNXUNBB.js → chunk-GKD2WI2W.js} +2 -2
- package/dist/chunk-GKD2WI2W.js.map +1 -0
- package/dist/chunk-GOGPCCBS.js +2 -0
- package/dist/chunk-GOGPCCBS.js.map +1 -0
- package/dist/{chunk-FJPQPOK3.js → chunk-HBHVB56P.js} +2 -2
- package/dist/{chunk-CYDWBHAA.js → chunk-HO2TIG7R.js} +2 -2
- package/dist/{chunk-QFOYD5Q4.js → chunk-HZDCZFR5.js} +2 -2
- package/dist/chunk-HZDCZFR5.js.map +1 -0
- package/dist/{chunk-OLRZ3U4A.js → chunk-IHNYOUXP.js} +2 -2
- package/dist/chunk-IHNYOUXP.js.map +1 -0
- package/dist/{chunk-4X77DTSW.js → chunk-IUEXOXFA.js} +2 -2
- package/dist/{chunk-SQENUVY5.js → chunk-K2BWF2HC.js} +2 -2
- package/dist/{chunk-H7L735T7.js → chunk-L3D2AK3X.js} +2 -2
- package/dist/{chunk-SXN63FPH.js → chunk-LQAHRGU4.js} +2 -2
- package/dist/{chunk-4OAWZYH7.js → chunk-LV5R6H3D.js} +2 -2
- package/dist/{chunk-LYK6PNAY.js → chunk-M2CI2UDK.js} +2 -2
- package/dist/{chunk-OQJWLV7V.js → chunk-MZB24YJP.js} +2 -2
- package/dist/chunk-OKM7DRCF.js +2 -0
- package/dist/{chunk-ANHUECRI.js → chunk-P7JZC65P.js} +2 -2
- package/dist/{chunk-IJR44ISO.js → chunk-QIVDIOJG.js} +2 -2
- package/dist/{chunk-JBUNDNKJ.js → chunk-QWJFYQK3.js} +1 -1
- package/dist/{chunk-QW322WRX.js → chunk-SHP4ULHS.js} +2 -2
- package/dist/chunk-SHP4ULHS.js.map +1 -0
- package/dist/{chunk-EGSRN2CQ.js → chunk-SO3YQ4WT.js} +2 -2
- package/dist/{chunk-UBN6O7B5.js → chunk-SPQO42TA.js} +2 -2
- package/dist/{chunk-VSMVVIBA.js → chunk-SRRY72CZ.js} +2 -2
- package/dist/chunk-THMWKOHC.js +2 -0
- package/dist/chunk-THMWKOHC.js.map +1 -0
- package/dist/{chunk-NBFJOIV2.js → chunk-TWVFLXVF.js} +2 -2
- package/dist/chunk-U4JVXNOG.js +2 -0
- package/dist/chunk-U4JVXNOG.js.map +1 -0
- package/dist/{chunk-WBN4ZSGC.js → chunk-UJKTTTGB.js} +2 -2
- package/dist/{chunk-6TY7IKSG.js → chunk-WBRWVTZK.js} +2 -2
- package/dist/chunk-WJ6YJFD4.js +2 -0
- package/dist/chunk-WJ6YJFD4.js.map +1 -0
- package/dist/{chunk-GHV4Q4MB.js → chunk-WMPKW7HC.js} +2 -2
- package/dist/{chunk-2MG7YOPU.js → chunk-WW5UCMQZ.js} +2 -2
- package/dist/chunk-WW5UCMQZ.js.map +1 -0
- package/dist/chunk-WXUIXZ7P.js +2 -0
- package/dist/chunk-WXUIXZ7P.js.map +1 -0
- package/dist/{chunk-R7W3BT6P.js → chunk-X6CD3FMG.js} +2 -2
- package/dist/{chunk-UZXTPQ47.js → chunk-XPL5XOQ4.js} +2 -2
- package/dist/{chunk-26ZOPH2I.js → chunk-XPOLXRYT.js} +2 -2
- package/dist/{chunk-7FAT6WCC.js → chunk-YDJVQRND.js} +2 -2
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +4 -3
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
- package/dist/flows/ContractAmendment/context.d.ts +4 -3
- package/dist/flows/ContractAmendment/hooks.d.ts +4 -3
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +4 -3
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/types.d.ts +1 -0
- package/dist/flows/ContractAmendment/utils.d.ts +1 -1
- package/dist/flows/ContractAmendment/utils.js +1 -1
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/api.d.ts +3 -2
- package/dist/flows/ContractorOnboarding/api.js +1 -1
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +5 -4
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
- package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +5 -4
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/ContractorOnboarding/context.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/hooks.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/hooks.js +1 -1
- package/dist/flows/ContractorOnboarding/index.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/ContractorOnboarding/types.d.ts +6 -5
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +4 -3
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +4 -3
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +2 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
- package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +2 -1
- package/dist/flows/CostCalculator/api.d.ts +2 -1
- package/dist/flows/CostCalculator/api.js +1 -1
- package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
- package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
- package/dist/flows/CostCalculator/context.d.ts +4 -3
- package/dist/flows/CostCalculator/hooks.d.ts +4 -3
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +4 -3
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +2 -1
- package/dist/flows/CostCalculator/utils.d.ts +4 -3
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +5 -4
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +7 -6
- package/dist/flows/Onboarding/api.js +1 -1
- package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
- package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
- package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +5 -4
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +5 -4
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +5 -4
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +5 -4
- package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
- package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
- package/dist/flows/Onboarding/components/ReviewStep.d.ts +5 -4
- package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +5 -4
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +5 -4
- package/dist/flows/Onboarding/hooks.d.ts +5 -4
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +5 -4
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +5 -4
- package/dist/flows/Onboarding/utils.d.ts +5 -4
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +5 -4
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +5 -4
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +5 -4
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +5 -4
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +5 -4
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +5 -4
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/api.d.ts +26 -7
- package/dist/flows/Termination/api.js +1 -1
- package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +9 -5
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +9 -5
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +9 -5
- package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
- package/dist/flows/Termination/context.d.ts +5 -4
- package/dist/flows/Termination/hooks.d.ts +5 -4
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +7 -6
- package/dist/flows/Termination/index.js +1 -1
- package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
- package/dist/flows/Termination/json-schemas/schema.d.ts +5 -4
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/Termination/types.d.ts +5 -4
- package/dist/flows/Termination/utils.d.ts +5 -4
- package/dist/flows/types.d.ts +3 -1
- package/dist/index.d.ts +10 -9
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +10 -1
- package/dist/internals.js +1 -1
- package/dist/{mutations-poZZkLvk.d.ts → mutations-Cdk0PM78.d.ts} +1 -1
- package/dist/{remoteFlows-DzRZRhQq.d.ts → remoteFlows-DUivEPPh.d.ts} +41 -6
- package/dist/{types-CpgnTLWW.d.ts → types-BZBdCzER.d.ts} +3 -3
- package/dist/{types-CTSYWNx-.d.ts → types-C-X7siUr.d.ts} +2 -2
- package/dist/{types-BNjv7eD0.d.ts → types-OcTc56P-.d.ts} +1 -1
- package/dist/{types-6uSA0-an.d.ts → types-pohqJTkr.d.ts} +4 -4
- package/dist/{types.gen-B2u-cOXI.d.ts → types.gen-D0ZCnKWv.d.ts} +1 -1
- package/package.json +2 -1
- package/dist/chunk-2L3ISQJL.js +0 -2
- package/dist/chunk-2L3ISQJL.js.map +0 -1
- package/dist/chunk-2MG7YOPU.js.map +0 -1
- package/dist/chunk-7WDO47KQ.js +0 -2
- package/dist/chunk-7WDO47KQ.js.map +0 -1
- package/dist/chunk-7XDJV7LA.js +0 -2
- package/dist/chunk-7XDJV7LA.js.map +0 -1
- package/dist/chunk-A2KMKSSC.js +0 -2
- package/dist/chunk-A2KMKSSC.js.map +0 -1
- package/dist/chunk-CFIJKJXD.js +0 -2
- package/dist/chunk-CFIJKJXD.js.map +0 -1
- package/dist/chunk-D6X2WCEG.js +0 -2
- package/dist/chunk-D6X2WCEG.js.map +0 -1
- package/dist/chunk-FQYK5BJV.js.map +0 -1
- package/dist/chunk-JCKQQFA4.js +0 -2
- package/dist/chunk-LGJYIUSH.js.map +0 -1
- package/dist/chunk-NCNXUNBB.js.map +0 -1
- package/dist/chunk-OLRZ3U4A.js.map +0 -1
- package/dist/chunk-OUSDXTNH.js.map +0 -1
- package/dist/chunk-PAQW5BFW.js +0 -2
- package/dist/chunk-PAQW5BFW.js.map +0 -1
- package/dist/chunk-QFOYD5Q4.js.map +0 -1
- package/dist/chunk-QW322WRX.js.map +0 -1
- package/dist/chunk-ZX5OIIJX.js +0 -1
- package/dist/chunk-ZX5OIIJX.js.map +0 -1
- package/dist/flows/api.d.ts +0 -33
- package/dist/flows/api.js +0 -2
- package/dist/flows/api.js.map +0 -1
- /package/dist/{chunk-ACQ3OEOE.js.map → chunk-5AG4K2EA.js.map} +0 -0
- /package/dist/{chunk-BWJAHRV6.js.map → chunk-5KZXFQLZ.js.map} +0 -0
- /package/dist/{chunk-LWGVLLBH.js.map → chunk-5OZPBBXS.js.map} +0 -0
- /package/dist/{chunk-T2FGDQSU.js.map → chunk-6FWFRVQE.js.map} +0 -0
- /package/dist/{chunk-5PPUPDYP.js.map → chunk-76DHIEN7.js.map} +0 -0
- /package/dist/{chunk-XDNUJY3V.js.map → chunk-7CJX7I3M.js.map} +0 -0
- /package/dist/{chunk-PEHK6NHL.js.map → chunk-A477TZFC.js.map} +0 -0
- /package/dist/{chunk-HWEJIPSK.js.map → chunk-AA7QB3QQ.js.map} +0 -0
- /package/dist/{chunk-HS4VEURD.js.map → chunk-AM2IRFHQ.js.map} +0 -0
- /package/dist/{chunk-FPJLWY23.js.map → chunk-B6IVJUEH.js.map} +0 -0
- /package/dist/{chunk-PNAZ6US5.js.map → chunk-COBQ4WSJ.js.map} +0 -0
- /package/dist/{chunk-OIVWGY5Z.js.map → chunk-CW3MAP5L.js.map} +0 -0
- /package/dist/{chunk-H3ZR4EW5.js.map → chunk-DPWL4KNA.js.map} +0 -0
- /package/dist/{chunk-YXXCHMX3.js.map → chunk-DXFA52BU.js.map} +0 -0
- /package/dist/{chunk-AVX6IOGC.js.map → chunk-DXIO72S4.js.map} +0 -0
- /package/dist/{chunk-OOCCLRPH.js.map → chunk-DZ2R72O5.js.map} +0 -0
- /package/dist/{chunk-5ENAY65Y.js.map → chunk-E4CABUTS.js.map} +0 -0
- /package/dist/{chunk-GWICTLVR.js.map → chunk-EM5UYWUQ.js.map} +0 -0
- /package/dist/{chunk-E76DWINZ.js.map → chunk-ENW4DCDU.js.map} +0 -0
- /package/dist/{chunk-JTOLQCOG.js.map → chunk-FRTJ4KWA.js.map} +0 -0
- /package/dist/{chunk-GD425MMM.js.map → chunk-GCJCNDJ3.js.map} +0 -0
- /package/dist/{chunk-FJPQPOK3.js.map → chunk-HBHVB56P.js.map} +0 -0
- /package/dist/{chunk-CYDWBHAA.js.map → chunk-HO2TIG7R.js.map} +0 -0
- /package/dist/{chunk-4X77DTSW.js.map → chunk-IUEXOXFA.js.map} +0 -0
- /package/dist/{chunk-SQENUVY5.js.map → chunk-K2BWF2HC.js.map} +0 -0
- /package/dist/{chunk-H7L735T7.js.map → chunk-L3D2AK3X.js.map} +0 -0
- /package/dist/{chunk-SXN63FPH.js.map → chunk-LQAHRGU4.js.map} +0 -0
- /package/dist/{chunk-4OAWZYH7.js.map → chunk-LV5R6H3D.js.map} +0 -0
- /package/dist/{chunk-LYK6PNAY.js.map → chunk-M2CI2UDK.js.map} +0 -0
- /package/dist/{chunk-OQJWLV7V.js.map → chunk-MZB24YJP.js.map} +0 -0
- /package/dist/{chunk-JCKQQFA4.js.map → chunk-OKM7DRCF.js.map} +0 -0
- /package/dist/{chunk-ANHUECRI.js.map → chunk-P7JZC65P.js.map} +0 -0
- /package/dist/{chunk-IJR44ISO.js.map → chunk-QIVDIOJG.js.map} +0 -0
- /package/dist/{chunk-JBUNDNKJ.js.map → chunk-QWJFYQK3.js.map} +0 -0
- /package/dist/{chunk-EGSRN2CQ.js.map → chunk-SO3YQ4WT.js.map} +0 -0
- /package/dist/{chunk-UBN6O7B5.js.map → chunk-SPQO42TA.js.map} +0 -0
- /package/dist/{chunk-VSMVVIBA.js.map → chunk-SRRY72CZ.js.map} +0 -0
- /package/dist/{chunk-NBFJOIV2.js.map → chunk-TWVFLXVF.js.map} +0 -0
- /package/dist/{chunk-WBN4ZSGC.js.map → chunk-UJKTTTGB.js.map} +0 -0
- /package/dist/{chunk-6TY7IKSG.js.map → chunk-WBRWVTZK.js.map} +0 -0
- /package/dist/{chunk-GHV4Q4MB.js.map → chunk-WMPKW7HC.js.map} +0 -0
- /package/dist/{chunk-R7W3BT6P.js.map → chunk-X6CD3FMG.js.map} +0 -0
- /package/dist/{chunk-UZXTPQ47.js.map → chunk-XPL5XOQ4.js.map} +0 -0
- /package/dist/{chunk-26ZOPH2I.js.map → chunk-XPOLXRYT.js.map} +0 -0
- /package/dist/{chunk-7FAT6WCC.js.map → chunk-YDJVQRND.js.map} +0 -0
package/README.md
CHANGED
|
@@ -76,14 +76,48 @@ The example app will be available at `http://localhost:3001`. The server handles
|
|
|
76
76
|
|
|
77
77
|
The `RemoteFlows` component serves as a provider for authentication and theming.
|
|
78
78
|
|
|
79
|
-
| Prop
|
|
80
|
-
|
|
|
81
|
-
| `auth`
|
|
82
|
-
| `authId`
|
|
83
|
-
| `environment`
|
|
84
|
-
| `theme`
|
|
85
|
-
| `components`
|
|
86
|
-
| `proxy`
|
|
79
|
+
| Prop | Type | Required | Deprecated | Description |
|
|
80
|
+
| --------------- | --------------------------------------------------------------------------------------------- | -------- | ---------- | ------------------------------------------------------------------------------- |
|
|
81
|
+
| `auth` | `() => Promise<{ accessToken: string, expiresIn: number }>` | Yes | - | Function to fetch authentication token |
|
|
82
|
+
| `authId` | `'default' \| 'client' \|` | No | Yes | Id to differenciate between client token authentication and company based token |
|
|
83
|
+
| `environment` | `'partners' \| 'production' \| 'sandbox' \| 'staging'` | No | - | Environment to use for API calls (defaults to production) |
|
|
84
|
+
| `theme` | `ThemeOptions` | No | - | Custom theme configuration |
|
|
85
|
+
| `components` | `Components` | No | - | Custom field components for form rendering |
|
|
86
|
+
| `proxy` | `{ url: string, headers?: Record<string, string> }` | No | - | Configuration for API request proxy with optional headers |
|
|
87
|
+
| `errorBoundary` | `{ useParentErrorBoundary?: boolean, fallback?: ReactNode \| ((error: Error) => ReactNode) }` | No | - | Error boundary configuration to prevent crashes and show custom fallback UI |
|
|
88
|
+
|
|
89
|
+
#### Error Boundary
|
|
90
|
+
|
|
91
|
+
The `errorBoundary` prop controls how the SDK handles runtime errors to prevent crashes in your host application.
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<RemoteFlows
|
|
95
|
+
auth={fetchToken}
|
|
96
|
+
errorBoundary={{
|
|
97
|
+
useParentErrorBoundary: false,
|
|
98
|
+
fallback: (error) => (
|
|
99
|
+
<div style={{ padding: '20px', textAlign: 'center' }}>
|
|
100
|
+
<h2>Something Went Wrong</h2>
|
|
101
|
+
<p>{error.message}</p>
|
|
102
|
+
<button onClick={() => window.location.reload()}>Reload Page</button>
|
|
103
|
+
</div>
|
|
104
|
+
),
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
{/* Your flows */}
|
|
108
|
+
</RemoteFlows>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Options:**
|
|
112
|
+
|
|
113
|
+
- `useParentErrorBoundary` (boolean, default: `false`): If `true`, errors are re-thrown to your parent error boundary. If `false`, the SDK shows a fallback UI to prevent crashes.
|
|
114
|
+
- `fallback` (ReactNode | function, optional): Custom UI to display when an error occurs. Only used when `useParentErrorBoundary` is `false`. Can be a React element or a function that receives the error object.
|
|
115
|
+
|
|
116
|
+
**Behavior:**
|
|
117
|
+
|
|
118
|
+
- When `useParentErrorBoundary: true` → Errors propagate to your application's error boundary
|
|
119
|
+
- When `useParentErrorBoundary: false` without `fallback` → Shows default error message: "Something went wrong in RemoteFlows. Please refresh the page."
|
|
120
|
+
- When `useParentErrorBoundary: false` with `fallback` → Shows your custom fallback UI
|
|
87
121
|
|
|
88
122
|
### Custom Field Components
|
|
89
123
|
|
|
@@ -337,3 +371,7 @@ We have created an entry point in the package `@remoteoss/remote-flows/internals
|
|
|
337
371
|
This entry endpoint exports internals utils and shadcn components to avoid duplicating these on the `example` folder.
|
|
338
372
|
|
|
339
373
|
We don't guarantee `semver` compatiblity if you used them in your project.
|
|
374
|
+
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
```
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c}from"./chunk-TOA3JILU.js";import{b as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-TOA3JILU.js";import{b as s}from"./chunk-5P7INAU2.js";import{a as l}from"./chunk-WJ6YJFD4.js";import{f as m,g as d}from"./chunk-CNDSIADP.js";import{a as e}from"./chunk-P37U34EQ.js";import{useEffect as f}from"react";import{jsx as p}from"react/jsx-runtime";import{createElement as P}from"react";function B({defaultValues:i,onSubmit:F,components:u}){let{formId:y,contractorOnboardingBag:o}=c(),b=s(o.handleValidation),r=m({resolver:b,defaultValues:i,shouldUnregister:!1,mode:"onBlur"});f(()=>{o.employmentId&&o?.checkFieldUpdates(r.getValues())},[]),f(()=>{let n=r?.watch(t=>{Object.keys(t).some(a=>t[a]!==i[a])&&o?.checkFieldUpdates(t)});return()=>n?.unsubscribe()},[]);let g=e(async n=>{F(n)},"handleSubmit");return P(d,{...r,key:`form-${o.stepState.currentStep.name}`},p("form",{id:y,onSubmit:r.handleSubmit(g),className:"space-y-4 RemoteFlows__OnboardingForm",children:p(l,{components:u,fields:o.fields,fieldsets:o.meta.fieldsets,fieldValues:o.fieldValues})}))}e(B,"ContractorOnboardingForm");export{B as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2W2XD7ZY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/ContractorOnboarding/components/ContractorOnboardingForm.tsx"],"sourcesContent":["import { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { Form } from '@/src/components/ui/form';\nimport { useForm } from 'react-hook-form';\nimport { useJsonSchemasValidationFormResolver } from '@/src/components/form/validationResolver';\nimport { Fields } from '@remoteoss/json-schema-form';\nimport { BasicInformationFormPayload } from '@/src/flows/Onboarding/types';\nimport { Components } from '@/src/types/remoteFlows';\nimport { useContractorOnboardingContext } from '@/src/flows/ContractorOnboarding/context';\nimport { useEffect } from 'react';\nimport { PricingPlanFormPayload } from '@/src/flows/ContractorOnboarding/types';\nimport { ContractorOnboardingContractDetailsFormPayload } from '@/src/flows/ContractorOnboarding/types';\n\ntype ContractorOnboardingFormProps = {\n onSubmit: (\n payload:\n | BasicInformationFormPayload\n | PricingPlanFormPayload\n | ContractorOnboardingContractDetailsFormPayload,\n ) => void;\n components?: Components;\n fields?: Fields;\n defaultValues: Record<string, unknown>;\n};\n\nexport function ContractorOnboardingForm({\n defaultValues,\n onSubmit,\n components,\n}: ContractorOnboardingFormProps) {\n const { formId, contractorOnboardingBag } = useContractorOnboardingContext();\n\n const resolver = useJsonSchemasValidationFormResolver(\n // @ts-expect-error no matching type\n contractorOnboardingBag.handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues,\n shouldUnregister: false,\n mode: 'onBlur',\n });\n\n useEffect(() => {\n // When the employmentId is set,\n // we need to run the checkFieldUpdates to update fieldValues in useStepState\n if (contractorOnboardingBag.employmentId) {\n contractorOnboardingBag?.checkFieldUpdates(form.getValues());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const subscription = form?.watch((values) => {\n const isAnyFieldDirty = Object.keys(values).some(\n (key) =>\n values[key as keyof unknown] !== defaultValues[key as keyof unknown],\n );\n if (isAnyFieldDirty) {\n contractorOnboardingBag?.checkFieldUpdates(values);\n }\n });\n return () => subscription?.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleSubmit = async (values: Record<string, unknown>) => {\n onSubmit(values);\n };\n\n return (\n <Form\n {...form}\n key={`form-${contractorOnboardingBag.stepState.currentStep.name}`}\n >\n <form\n id={formId}\n onSubmit={form.handleSubmit(handleSubmit)}\n className='space-y-4 RemoteFlows__OnboardingForm'\n >\n <JSONSchemaFormFields\n components={components}\n fields={contractorOnboardingBag.fields}\n fieldsets={contractorOnboardingBag.meta.fieldsets}\n fieldValues={contractorOnboardingBag.fieldValues}\n />\n </form>\n </Form>\n );\n}\n"],"mappings":"+MAQA,OAAS,aAAAA,MAAiB,QAwElB,cAAAC,MAAA,oBATJ,wBAAAC,MAAA,QA/CG,SAASC,EAAyB,CACvC,cAAAC,EACA,SAAAC,EACA,WAAAC,CACF,EAAkC,CAChC,GAAM,CAAE,OAAAC,EAAQ,wBAAAC,CAAwB,EAAIC,EAA+B,EAErEC,EAAWC,EAEfH,EAAwB,gBAC1B,EAEMI,EAAOC,EAAQ,CACnB,SAAAH,EACA,cAAAN,EACA,iBAAkB,GAClB,KAAM,QACR,CAAC,EAEDU,EAAU,IAAM,CAGVN,EAAwB,cAC1BA,GAAyB,kBAAkBI,EAAK,UAAU,CAAC,CAG/D,EAAG,CAAC,CAAC,EAELE,EAAU,IAAM,CACd,IAAMC,EAAeH,GAAM,MAAOI,GAAW,CACnB,OAAO,KAAKA,CAAM,EAAE,KACzCC,GACCD,EAAOC,CAAoB,IAAMb,EAAca,CAAoB,CACvE,GAEET,GAAyB,kBAAkBQ,CAAM,CAErD,CAAC,EACD,MAAO,IAAMD,GAAc,YAAY,CAEzC,EAAG,CAAC,CAAC,EAEL,IAAMG,EAAeC,EAAA,MAAOH,GAAoC,CAC9DX,EAASW,CAAM,CACjB,EAFqB,gBAIrB,OACEd,EAACkB,EAAA,CACE,GAAGR,EACJ,IAAK,QAAQJ,EAAwB,UAAU,YAAY,IAAI,IAE/DP,EAAC,QACC,GAAIM,EACJ,SAAUK,EAAK,aAAaM,CAAY,EACxC,UAAU,wCAEV,SAAAjB,EAACoB,EAAA,CACC,WAAYf,EACZ,OAAQE,EAAwB,OAChC,UAAWA,EAAwB,KAAK,UACxC,YAAaA,EAAwB,YACvC,EACF,CACF,CAEJ,CAjEgBW,EAAAhB,EAAA","names":["useEffect","jsx","createElement","ContractorOnboardingForm","defaultValues","onSubmit","components","formId","contractorOnboardingBag","useContractorOnboardingContext","resolver","useJsonSchemasValidationFormResolver","form","useForm","useEffect","subscription","values","key","handleSubmit","__name","Form","JSONSchemaFormFields"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as e}from"./chunk-MZB24YJP.js";import{a as n}from"./chunk-P37U34EQ.js";import{jsx as o,jsxs as t}from"react/jsx-runtime";var a=n(({involuntaryOffboardingServiceChargeZendeskId:r,reconciliationInvoiceZendeskId:i})=>t("p",{className:"RemoteFlows__AcknowledgeInformationFees text-xs text-[#71717A]",children:["You'll receive an"," ",o(e,{zendeskId:r,className:"align-baseline",children:"involuntary offboarding service charge \u2197"})," ","on your"," ",o(e,{zendeskId:i,children:"reconciliation invoice \u2197"})]}),"AcknowledgeInformationFees");export{a};
|
|
2
|
+
//# sourceMappingURL=chunk-5AG4K2EA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as d}from"./chunk-MRYRNB7Y.js";import{b as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as d}from"./chunk-MRYRNB7Y.js";import{b as a}from"./chunk-5P7INAU2.js";import{a as f}from"./chunk-WJ6YJFD4.js";import{f as s,g as l}from"./chunk-CNDSIADP.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as T}from"react";import{jsx as e}from"react/jsx-runtime";function A({fields:m,onSubmit:F}){let{formId:u,terminationBag:o}=d(),c=a(o.handleValidation),i=s({resolver:c,defaultValues:o?.initialValues,shouldUnregister:!1,mode:"onBlur"});T(()=>{let y=i?.watch(r=>{Object.keys(r).some(t=>r[t]!==o?.initialValues?.[t])&&o?.checkFieldUpdates(r)});return()=>y?.unsubscribe()},[]);let p=m||(o?.fields??[]);return e(l,{...i,children:e("form",{id:u,onSubmit:i.handleSubmit(F),className:"space-y-4 RemoteFlows__TerminationForm",children:e(f,{fields:p})})})}n(A,"TerminationForm");export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5CVD5WZZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/Termination/TerminationForm.tsx"],"sourcesContent":["import { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { Form } from '@/src/components/ui/form';\nimport { useEffect } from 'react';\nimport { useTerminationContext } from './context';\nimport { TerminationFormValues } from '@/src/flows/Termination/types';\nimport { useForm } from 'react-hook-form';\nimport { useJsonSchemasValidationFormResolver } from '@/src/components/form/validationResolver';\nimport { Fields } from '@remoteoss/json-schema-form';\n\ntype TerminationFormProps = {\n onSubmit: (payload: TerminationFormValues) => void;\n fields?: Fields;\n};\n\nexport function TerminationForm({ fields, onSubmit }: TerminationFormProps) {\n const { formId, terminationBag } = useTerminationContext();\n\n const resolver = useJsonSchemasValidationFormResolver(\n // @ts-expect-error no matching type\n terminationBag.handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues: terminationBag?.initialValues,\n shouldUnregister: false,\n mode: 'onBlur',\n });\n\n useEffect(() => {\n const subscription = form?.watch((values) => {\n const isAnyFieldDirty = Object.keys(values).some(\n (key) =>\n values[key as keyof TerminationFormValues] !==\n terminationBag?.initialValues?.[key as keyof TerminationFormValues],\n );\n if (isAnyFieldDirty) {\n terminationBag?.checkFieldUpdates(values);\n }\n });\n return () => subscription?.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const jsonSchemaFields = fields ? fields : (terminationBag?.fields ?? []);\n\n return (\n <Form {...form}>\n <form\n id={formId}\n onSubmit={form.handleSubmit(onSubmit)}\n className='space-y-4 RemoteFlows__TerminationForm'\n >\n <JSONSchemaFormFields fields={jsonSchemaFields} />\n </form>\n </Form>\n );\n}\n"],"mappings":"+MAEA,OAAS,aAAAA,MAAiB,QAmDlB,cAAAC,MAAA,oBAvCD,SAASC,EAAgB,CAAE,OAAAC,EAAQ,SAAAC,CAAS,EAAyB,CAC1E,GAAM,CAAE,OAAAC,EAAQ,eAAAC,CAAe,EAAIC,EAAsB,EAEnDC,EAAWC,EAEfH,EAAe,gBACjB,EAEMI,EAAOC,EAAQ,CACnB,SAAAH,EACA,cAAeF,GAAgB,cAC/B,iBAAkB,GAClB,KAAM,QACR,CAAC,EAEDM,EAAU,IAAM,CACd,IAAMC,EAAeH,GAAM,MAAOI,GAAW,CACnB,OAAO,KAAKA,CAAM,EAAE,KACzCC,GACCD,EAAOC,CAAkC,IACzCT,GAAgB,gBAAgBS,CAAkC,CACtE,GAEET,GAAgB,kBAAkBQ,CAAM,CAE5C,CAAC,EACD,MAAO,IAAMD,GAAc,YAAY,CAEzC,EAAG,CAAC,CAAC,EAEL,IAAMG,EAAmBb,IAAmBG,GAAgB,QAAU,CAAC,GAEvE,OACEL,EAACgB,EAAA,CAAM,GAAGP,EACR,SAAAT,EAAC,QACC,GAAII,EACJ,SAAUK,EAAK,aAAaN,CAAQ,EACpC,UAAU,yCAEV,SAAAH,EAACiB,EAAA,CAAqB,OAAQF,EAAkB,EAClD,EACF,CAEJ,CA3CgBG,EAAAjB,EAAA","names":["useEffect","jsx","TerminationForm","fields","onSubmit","formId","terminationBag","useTerminationContext","resolver","useJsonSchemasValidationFormResolver","form","useForm","useEffect","subscription","values","key","jsonSchemaFields","Form","JSONSchemaFormFields","__name"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as U}from"./chunk-WVJDCDGZ.js";import{A as x,D as V,G as R,d as F,f as C,i as g,j as S,p as j,q as w,s as v,v as E,w as O,x as q,z as P}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as U}from"./chunk-WVJDCDGZ.js";import{b as B}from"./chunk-Z5WMKCRJ.js";import{A as x,D as V,G as R,d as F,f as C,i as g,j as S,p as j,q as w,s as v,v as E,w as O,x as q,z as P}from"./chunk-AA7QB3QQ.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as b}from"./chunk-WXUIXZ7P.js";import{a as n}from"./chunk-P37U34EQ.js";import{createHeadlessForm as p,modify as d}from"@remoteoss/json-schema-form";import{useMutation as l,useQuery as f}from"@tanstack/react-query";var Y=n(t=>{let{client:r}=a();return f({queryKey:["employment",t],retry:!1,enabled:!!t,select:n(({data:e})=>e?.data.employment,"select"),queryFn:n(async()=>{let e=await O({client:r,headers:{Authorization:""},path:{employment_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn")})},"useEmployment"),Z=n(t=>{let{client:r}=a();return f({queryKey:["company",t],retry:!1,enabled:!!t,queryFn:n(async()=>{let e=await w({client:r,headers:{Authorization:""},path:{company_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch employment data");return e},"queryFn"),select:n(({data:e})=>e.data.company,"select")})},"useCompany"),$=n(t=>{let{client:r}=a();return f({queryKey:["benefit-offers",t],retry:!1,enabled:!!t,queryFn:n(async()=>g({client:r,path:{employment_id:t}}).then(e=>{if(e.error||!e.data)throw new Error("Failed to fetch benefit offers data");return e}),"queryFn"),select:n(({data:e})=>e?.data?.reduce((o,s)=>({...o,[s.benefit_group.slug]:{value:s.benefit_tier?.slug??"no",...s.benefit_group?.filter?.slug?{filter:s.benefit_group?.filter?.slug}:{}}}),{}),"select")})},"useBenefitOffers"),ee=n(()=>{let{client:t}=a();return l({mutationFn:n(r=>R({client:t,headers:{Authorization:""},path:r}),"mutationFn")})},"useEmploymentInvite"),te=n(()=>{let{client:t}=a();return l({mutationFn:n(r=>j({client:t,body:r}),"mutationFn")})},"useCreateReserveInvoice"),ne=n(({countryCode:t,form:r,fieldValues:e,options:o,query:s={}})=>{let{client:i}=a(),m=o?.jsonSchemaVersion?.form_schema?.[r]?{json_schema_version:o.jsonSchemaVersion.form_schema[r]}:{};return f({queryKey:["onboarding-json-schema-form",t,r],retry:!1,queryFn:n(async()=>{let c=await v({client:i,headers:{Authorization:""},path:{country_code:t,form:r},query:{skip_benefits:!0,...s,...m}});if(c.error||!c.data)throw new Error("Failed to fetch onboarding schema");return c},"queryFn"),enabled:o?.queryOptions?.enabled,select:n(({data:c})=>{let u=c?.data||{};if(o&&o.jsfModify){let{schema:y}=d(u,o.jsfModify);u=y}let z=B(u.properties||{},"money").reduce((y,_)=>(y[_]=b(e[_]),y),{}),A={...e,...z};return{meta:{"x-jsf-fieldsets":u["x-jsf-fieldsets"]},...p(u,{initialValues:A})}},"select")})},"useJSONSchemaForm"),re=n((t,r,e)=>{let o=e?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:e.jsonSchemaVersion.benefit_offers_form_schema}:{},{client:s}=a();return f({queryKey:["benefit-offers-schema",t],retry:!1,enabled:!!t,queryFn:n(async()=>{let i=await E({client:s,path:{employment_id:t},query:o});if(i.error||!i.data)throw new Error("Failed to fetch benefit offers schema");return i},"queryFn"),select:n(({data:i})=>{let m=i?.data?.schema||{};if(e&&e.jsfModify?.benefits){let{schema:h}=d(m,e.jsfModify.benefits);m=h}let c=Object.keys(r).length>0;return p(m,{initialValues:c?{...r}:{}})},"select")})},"useBenefitOffersSchema"),oe=n(t=>{let{client:r}=a(),e=t?.jsonSchemaVersion?.form_schema?.employment_basic_information?{json_schema_version:t.jsonSchemaVersion.form_schema.employment_basic_information}:{};return l({mutationFn:n(o=>C({client:r,headers:{Authorization:""},body:o,query:{...e}}),"mutationFn")})},"useCreateEmployment"),se=n(t=>{let{client:r}=a(),e={employment_basic_information_json_schema_version:t?.jsonSchemaVersion?.form_schema?.employment_basic_information,employment_contract_details_json_schema_version:t?.jsonSchemaVersion?.form_schema?.contract_details},o=Object.fromEntries(Object.entries(e).filter(([,s])=>s!==void 0));return l({mutationFn:n(({employmentId:s,...i})=>q({client:r,headers:{Authorization:""},body:i,path:{employment_id:s},query:{skip_benefits:!0,...o}}),"mutationFn")})},"useUpdateEmployment"),ae=n(t=>{let{client:r}=a();return l({mutationFn:n(({employmentId:e,...o})=>{let s=t?.jsonSchemaVersion?.benefit_offers_form_schema?{json_schema_version:t.jsonSchemaVersion.benefit_offers_form_schema}:{};return S({client:r,body:o,path:{employment_id:e},query:{...s}})},"mutationFn")})},"useUpdateBenefitsOffers"),Q=n(t=>{let{client:r}=a();return f({...t,queryKey:["countries"],retry:!1,queryFn:n(async()=>{let e=await x({client:r,headers:{Authorization:""}});if(e.error||!e.data)throw new Error("Failed to fetch supported countries");return e},"queryFn"),select:n(({data:e})=>e?.data?.filter(o=>o.eor_onboarding).map(o=>({label:o.name,value:o.code}))||[],"select")})},"useCountries"),ie=n(t=>{let{data:r,isLoading:e}=Q(t?.queryOptions),{schema:o}=d(U.data.schema,t?.jsfModify||{}),s=p(o);if(r){let i=s.fields.find(m=>m.name==="country");i&&(i.options=r)}return{isLoading:e,selectCountryForm:s}},"useCountriesSchemaField"),me=n(({type:t="spread"})=>{let{client:r}=a();return l({mutationFn:n(e=>(t==="no_spread"?F:V)({client:r,body:e}),"mutationFn")})},"useConvertCurrency"),ce=n(()=>{let{client:t}=a();return l({mutationFn:n(({employmentId:r,...e})=>P({client:t,path:{employment_id:r},body:e}),"mutationFn")})},"useUpsertContractEligibility");export{Y as a,Z as b,$ as c,ee as d,te as e,ne as f,re as g,oe as h,se as i,ae as j,ie as k,me as l,ce as m};
|
|
2
|
+
//# sourceMappingURL=chunk-5KZXFQLZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as n,g as a}from"./chunk-CNDSIADP.js";import{c as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as n,g as a}from"./chunk-CNDSIADP.js";import{c as m}from"./chunk-WXUIXZ7P.js";import{b as i}from"./chunk-TVZAFTPT.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function w({onSubmit:d,onError:c,onSuccess:l}){let{contractAmendment:{stepState:u,isSubmitting:f,onSubmit:C,fields:p},formId:A}=i(),e=n({defaultValues:u.values?.form}),F=o(async r=>{let S=m(r,p,{isPartialValidation:!1});await d?.(S);let t=await C(r);t.error?c?.(t.error):await l?.(t.data)},"handleSubmit");return f?null:s(a,{...e,children:s("form",{id:A,onSubmit:e.handleSubmit(F),className:"RemoteFlows__ContractAmendmentConfirmationForm"})})}o(w,"ContractAmendmentConfirmationForm");export{w as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5OZPBBXS.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as n}from"./chunk-P37U34EQ.js";function o(e){return e.inner.reduce((t,r)=>({...t,[r.path]:{type:r.type??"validation",message:r.message}}),{})}n(o,"iterateErrors");var i=n(e=>async s=>{let{yupError:t,formErrors:r}=await e(s);return Object.keys(r||{}).length>0?{values:{},errors:o(t)}:{values:s,errors:{}}},"useJsonSchemasValidationFormResolver");export{o as a,i as b};
|
|
2
|
+
//# sourceMappingURL=chunk-5P7INAU2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/form/validationResolver.ts"],"sourcesContent":["import { FieldValues, Resolver } from 'react-hook-form';\nimport type { AnyObjectSchema, InferType, ValidationError } from 'yup';\n\n// TODO: deprecated only used with old json-schema-form-version\nexport function iterateErrors(error: ValidationError) {\n const errors = (error as ValidationError).inner.reduce(\n (\n allErrors: Record<string, { type: string; message: string }>,\n currentError: ValidationError,\n ) => {\n return {\n ...allErrors,\n [currentError.path as string]: {\n type: currentError.type ?? 'validation',\n message: currentError.message,\n },\n };\n },\n {} as Record<string, { type: string; message: string }>,\n );\n\n return errors;\n}\n\n// TODO: deprecated only used with old json-schema-form-version\nexport const useJsonSchemasValidationFormResolver = <T extends AnyObjectSchema>(\n handleValidation: (data: FieldValues) => {\n formErrors: Record<string, string>;\n yupError: ValidationError;\n },\n): Resolver<InferType<T>> => {\n return async (data: FieldValues) => {\n const { yupError, formErrors } = await handleValidation(data);\n\n if (Object.keys(formErrors || {}).length > 0) {\n return {\n values: {},\n errors: iterateErrors(yupError as ValidationError),\n };\n }\n return {\n values: data,\n errors: {},\n };\n };\n};\n\nfunction iterateFormErrors(formErrors: Record<string, string>) {\n return Object.entries(formErrors || {}).reduce(\n (\n allErrors: Record<string, { type: string; message: string }>,\n [fieldName, message],\n ) => {\n return {\n ...allErrors,\n [fieldName]: {\n type: 'validation',\n message,\n },\n };\n },\n {} as Record<string, { type: string; message: string }>,\n );\n}\n\nexport const useJsonSchemasValidationFormResolverNext = <\n T extends AnyObjectSchema,\n>(\n handleValidation: (data: FieldValues) => {\n formErrors: Record<string, string>;\n },\n): Resolver<InferType<T>> => {\n return async (data: FieldValues) => {\n const { formErrors } = await handleValidation(data);\n\n if (Object.keys(formErrors || {}).length > 0) {\n return {\n values: {},\n errors: iterateFormErrors(formErrors),\n };\n }\n return {\n values: data,\n errors: {},\n };\n };\n};\n"],"mappings":"wCAIO,SAASA,EAAcC,EAAwB,CAiBpD,OAhBgBA,EAA0B,MAAM,OAC9C,CACEC,EACAC,KAEO,CACL,GAAGD,EACH,CAACC,EAAa,IAAc,EAAG,CAC7B,KAAMA,EAAa,MAAQ,aAC3B,QAASA,EAAa,OACxB,CACF,GAEF,CAAC,CACH,CAGF,CAlBgBC,EAAAJ,EAAA,iBAqBT,IAAMK,EAAuCD,EAClDE,GAKO,MAAOC,GAAsB,CAClC,GAAM,CAAE,SAAAC,EAAU,WAAAC,CAAW,EAAI,MAAMH,EAAiBC,CAAI,EAE5D,OAAI,OAAO,KAAKE,GAAc,CAAC,CAAC,EAAE,OAAS,EAClC,CACL,OAAQ,CAAC,EACT,OAAQT,EAAcQ,CAA2B,CACnD,EAEK,CACL,OAAQD,EACR,OAAQ,CAAC,CACX,CACF,EAnBkD","names":["iterateErrors","error","allErrors","currentError","__name","useJsonSchemasValidationFormResolver","handleValidation","data","yupError","formErrors"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-HZDCZFR5.js";import{b as a}from"./chunk-PGWKJ6FK.js";import{b as t}from"./chunk-2YTBWEC7.js";import{d as s}from"./chunk-WXUIXZ7P.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function P({components:d,onSubmit:l,onError:i,onSuccess:f}){let{onboardingBag:o}=a(),p=o.fields??[],c=s(p,o.initialValues.benefits);return E(m,{defaultValues:c,components:d,onSubmit:e(async n=>{try{await l?.(n);let r=await o.onSubmit(n);if(r?.data){await f?.(r.data),o?.next();return}if(r?.error){let u=t(r?.fieldErrors||[],o.meta?.fields?.benefits);i?.({error:r.error,rawError:r.rawError,fieldErrors:u})}}catch(r){i?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit")})}e(P,"BenefitsStep");export{P as a};
|
|
2
|
+
//# sourceMappingURL=chunk-6FWFRVQE.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-5CVD5WZZ.js";import{b as i}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";function p({onSubmit:e}){let{terminationBag:m}=i();return a(n,{onSubmit:o(async t=>{await e?.(m?.parseFormValues(t)),m?.next()},"handleSubmit")})}o(p,"EmployeeCommunicationForm");export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-76DHIEN7.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as t}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as t}from"./chunk-5CVD5WZZ.js";import{b as e}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as f}from"react/jsx-runtime";function F({onSubmit:n,onSuccess:s,onError:m}){let{terminationBag:r}=e(),d=i(async a=>{let l=r?.parseFormValues(a,!0);await n?.(l);let o=await r?.onSubmit(a);o?.error?m?.(o.error):o?.data&&await s?.(o.data)},"handleSubmit");return f(t,{fields:r?.fields,onSubmit:d})}i(F,"AdditionalDetailsForm");export{F as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7CJX7I3M.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as X}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as X}from"./chunk-CW3MAP5L.js";import{a as G}from"./chunk-VFRHMNLJ.js";import{a as I,b as z,c as Q,f as W}from"./chunk-XPOLXRYT.js";import{a as C}from"./chunk-HN5HLFTB.js";import{a as K}from"./chunk-5P7INAU2.js";import{c as Y}from"./chunk-THMWKOHC.js";import{a as Z}from"./chunk-2YTBWEC7.js";import{c as V}from"./chunk-WXUIXZ7P.js";import{a as o}from"./chunk-P37U34EQ.js";import{number as Te,object as oe}from"yup";import{createHeadlessForm as Ve,modify as je}from"@remoteoss/json-schema-form";import{useCallback as Re,useEffect as ee,useMemo as Pe,useRef as we,useState as j}from"react";import{string as te,ValidationError as ne}from"yup";import{jsx as re}from"react/jsx-runtime";var O={title:"Estimation",includeBenefits:!1,includeCostBreakdowns:!1,includePremiumBenefits:!1,enableCurrencyConversion:!1,includeEstimationTitle:!1,includeManagementFee:!1},xe=o(t=>{let{schema:i}=je(G.data.schema,t?.jsfModify||{});return Ve(i)},"useStaticSchema");function Be(t,i){if(typeof t=="object"&&t!==null&&"title"in t){let l=t.title;if(l)return l}return i==="my_hiring_budget"?"Hiring budget":"Employee's annual salary"}o(Be,"getSalaryTitle");var Qe=o(({defaultRegion:t,defaultCurrency:i,defaultSalary:l,estimationOptions:s,options:n,version:a}={estimationOptions:O})=>{let c=we({fields:{}}),[k,E]=j(t),[R,P]=j(),[m,q]=j(),[H,se]=j(),{data:_,isLoading:le}=I({includePremiumBenefits:s.includePremiumBenefits}),{data:d,isLoading:ce}=z(),ue=k||R?.value,{data:w,isLoading:me}=W(ue,{includePremiumBenefits:s.includePremiumBenefits,options:n}),U=Q(),{mutateAsync:de}=Z(U),b=R?.currency,p=n?.jsfModify?.fields?.salary,F=p&&typeof p=="object"&&"presentation"in p?p.presentation:void 0,L=Re(()=>{let e=b&&m?b!==m:!1;return b!==m?{from:m,to:b,shouldSwapOrder:e}:{from:b,to:m,shouldSwapOrder:e}},[b,m]),J=s.showManagementFee,$=s.includeEstimationTitle,fe=Pe(()=>{let{from:e,to:r,shouldSwapOrder:u}=L(),g=Be(p,H);return{fields:{salary:{...p,title:g,presentation:{salary_conversion_properties:{label:F?.salary_conversion_properties?.label,description:F?.salary_conversion_properties?.description},currencies:{from:e,to:r},Component:o(y=>re(X,{...y,shouldSwapOrder:u,conversionType:a==="marketing"?"no_spread":"spread",defaultValue:l}),"Component")}},hiring_budget:{...n?.jsfModify?.fields?.hiring_budget,presentation:{hidden:a=="marketing"}},management:{...n?.jsfModify?.fields?.management,properties:{...n?.jsfModify?.fields?.management?.properties,management_fee:{...n?.jsfModify?.fields?.management?.properties?.management_fee,"x-jsf-presentation":{inputType:"money",additionalProps:{currency:m||"USD"}}}},presentation:{...typeof n?.jsfModify?.fields?.management=="object"?(n?.jsfModify?.fields?.management)["x-jsf-presentation"]:{},hidden:!J,Component:o(y=>re(Y,{...y,variant:"inset",features:{toggle:{enabled:!0,stateField:"management._expanded",labels:{expand:"Define",collapse:"Remove"}}}}),"Component")}},estimation_title:{...n?.jsfModify?.fields?.estimation_title,"x-jsf-presentation":{hidden:!$}}}}},[L,p,H,F?.salary_conversion_properties?.label,F?.salary_conversion_properties?.description,n?.jsfModify?.fields?.hiring_budget,n?.jsfModify?.fields?.management,n?.jsfModify?.fields?.estimation_title,a,m,J,$,l]),f=xe({jsfModify:{fields:{...n?.jsfModify?.fields,...fe?.fields}}});ee(()=>{if(t&&_){let e=_.find(({value:r})=>r===t);e&&P(e)}},[t,_]),ee(()=>{if(i&&d){let e=d.find(({value:r})=>r===i);e&&q(e.label)}},[i,d]);async function ge(e){return de(ae(e,s,a))}o(ge,"onSubmit");function ye(e){let r=_?.find(({value:u})=>u===e);r&&r.childRegions.length===0&&r.hasAdditionalFields?E(r.regionSlug):E(void 0),P(r)}o(ye,"onCountryChange");function pe(e){E(e)}o(pe,"onRegionChange");function Ce(e){se(e.target.value)}o(Ce,"onHiringBudgetChange");function _e(e){let r=d?.find(u=>u.value===e)?.label;q(r),n?.onCurrencyChange?.(r||"")}o(_e,"onChangeCurrency");let S=f.fields.find(e=>e.name==="region");if(S){let e=R?.childRegions.map(r=>({value:r.slug,label:r.name}))??[];S.options=e,S.isVisible=e.length>0,S.required=e.length>0,S.onChange=pe,S.schema=e.length>0?te().transform(r=>typeof r=="string"?r:"").required("Region is required"):te()}if(d){let e=f.fields.find(r=>r.name==="currency");e&&(e.options=d,e.onChange=_e)}let v=f.fields.find(e=>e.name==="hiring_budget");if(v&&(v.onChange=Ce),_){let e=f.fields.find(r=>r.name==="country");e&&(e.options=_,e.onChange=ye)}let be=o(()=>{P(void 0),E(t)},"resetForm"),D=[...f.fields.filter(e=>e.name!=="management"),...w?.fields||[],...f.fields.filter(e=>e.name==="management")],N=ie(f.fields,m||"USD",s.includeEstimationTitle);async function Se(e){let r=null;n?.onValidation?.(e);let u=V(e,D);try{await N.validate(u,{abortEarly:!1}),r={formErrors:{},yupError:new ne([],e)}}catch(h){let B=K(h);r={formErrors:Object.entries(B).reduce((T,[A,M])=>({...T,[A]:M.message}),{}),yupError:h}}let g=w?.handleValidation(u),y=[...r?.yupError.inner||[],...g?.yupError?.inner||[]],x={...r?.yupError?.value||{},...g?.yupError?.value||{}};return{formErrors:{...r?.formErrors||{},...g?.formErrors||{}},yupError:new ne(y,x)}}return o(Se,"handleValidation"),{stepState:{current:0,total:1,isLastStep:!0},fields:D,validationSchema:N,parseFormValues:o(e=>{let{country:r,region:u,currency:g,salary_converted:y,hiring_budget:x,salary_conversion:h,management:B,estimation_title:T,...A}=e,M=e.salary;y==="salary_conversion"&&(M=h);let he=V({country:r,region:u,salary:M,salary_converted:y,salary_conversion:h,hiring_budget:x,currency:g,management:B,estimation_title:T},f.fields),Ee=V(A,w?.fields||[]),Fe={currency_code:d?.find(Me=>Me.value===g)?.label};return{...he,...Ee,...Fe}},"parseFormValues"),handleValidation:Se,isSubmitting:U.isPending,isLoading:le&&ce&&me,onSubmit:ge,resetForm:be,currencies:d,meta:{fields:c.current?.fields}}},"useCostCalculator");function ie(t,i,l){let s=t.reduce((n,a)=>(a.name==="salary"||a.name==="salary_conversion"?n[a.name]=a.schema.when("salary_converted",{is:o(c=>c===a.name,"is"),then:o(c=>c.required("Required field"),"then"),otherwise:o(c=>c.optional(),"otherwise")}):a.name==="management"?n[a.name]=oe({management_fee:Te().transform(c=>isNaN(c)?void 0:c).min(0,"Management fee must be greater than or equal to 0").max(i?C[i]:C.USD,()=>`Management fee cannot exceed ${(i?C[i]:C.USD)/100} ${i}`)}):a.name==="estimation_title"&&l?n[a.name]=a.schema.required("Required field"):n[a.name]=a.schema,n),{});return oe(s)}o(ie,"buildValidationSchema");function Ae(t){let i="benefit-";return Object.keys(t).reduce((l,s)=>{let n=t[s];if(n==="none")return l;let c={benefit_group_slug:s.replace(i,""),benefit_tier_slug:n};return[...l,c]},[])}o(Ae,"formatBenefits");function Oe(t,i,l){let s=Number(t.management?.management_fee),n=t.currency_code;return{...{region_slug:t.region||t.country,employment_term:t.contract_duration_type??"fixed",title:t.estimation_title||i.title,age:t.age??void 0,...t.benefits&&{benefits:Ae(t.benefits)},...i.includeManagementFee&&s&&{discount:{quoted_amount:i.showManagementFee?s:C[n]||C.USD,text:""}}},...ke(t,l)}}o(Oe,"mapValueToEmployment");function ke(t,i){let l=i==="marketing"||t.salary_converted==="salary_conversion",s=i==="standard"&&t.salary_converted==="salary",n=t.hiring_budget==="my_hiring_budget";if(l){let a=t.salary_converted==="salary_conversion";return n?{annual_total_cost_in_employer_currency:t.salary}:{[a?"annual_gross_salary_in_employer_currency":"annual_gross_salary"]:t.salary}}return s?n?{annual_total_cost:t.salary}:{annual_gross_salary:t.salary}:{}}o(ke,"getSalaryFields");function ae(t,i=O,l="standard"){let s=Array.isArray(t)?t:[t];if(s.length===0)throw new Error("At least one employment value is required");return s.length>1&&new Set(s.map(a=>a.currency)).size>1&&console.warn("Multiple currencies detected in array. Using currency from first employment."),{employer_currency_slug:s[0].currency,include_benefits:i.includeBenefits,include_cost_breakdowns:i.includeCostBreakdowns,include_premium_benefits:i.includePremiumBenefits,include_management_fee:i.includeManagementFee,employments:s.map(n=>Oe(n,i,l))}}o(ae,"buildPayload");export{ie as a,ae as b,O as c,Qe as d};
|
|
2
|
+
//# sourceMappingURL=chunk-7YQAVDVX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/CostCalculator/utils.ts","../src/flows/CostCalculator/hooks.tsx"],"sourcesContent":["import type {\n CostCalculatorEmploymentParam,\n CostCalculatorEstimateParams,\n} from '@/src/client';\n\nimport { $TSFixMe } from '@/src/types/remoteFlows';\nimport { AnyObjectSchema, number, object } from 'yup';\nimport { CostCalculatorVersion, defaultEstimationOptions } from './hooks';\nimport type {\n CostCalculatorEstimationOptions,\n CostCalculatorEstimationSubmitValues,\n CurrencyKey,\n} from './types';\nimport { BASE_RATES } from '@/src/flows/CostCalculator/constants';\n\n/**\n * Build the validation schema for the form.\n * @returns\n */\nexport function buildValidationSchema(\n fields: $TSFixMe[],\n employerBillingCurrency: string,\n includeEstimationTitle?: boolean,\n) {\n const fieldsSchema = fields.reduce<Record<string, AnyObjectSchema>>(\n (fieldsSchemaAcc, field) => {\n // Special handling for salary fields\n if (field.name === 'salary' || field.name === 'salary_conversion') {\n fieldsSchemaAcc[field.name] = (field.schema as AnyObjectSchema).when(\n 'salary_converted',\n {\n is: (val: string | null) => val === field.name,\n then: (schema) => schema.required('Required field'),\n otherwise: (schema) => schema.optional(),\n },\n );\n } else if (field.name === 'management') {\n fieldsSchemaAcc[field.name] = object({\n management_fee: number()\n .transform((value) => {\n return isNaN(value) ? undefined : value;\n })\n .min(0, 'Management fee must be greater than or equal to 0')\n .max(\n employerBillingCurrency\n ? BASE_RATES[employerBillingCurrency as CurrencyKey]\n : BASE_RATES.USD,\n () => {\n const maxValue = employerBillingCurrency\n ? BASE_RATES[employerBillingCurrency as CurrencyKey]\n : BASE_RATES.USD;\n const displayValue = maxValue / 100;\n return `Management fee cannot exceed ${displayValue} ${employerBillingCurrency}`;\n },\n ),\n });\n } else if (field.name === 'estimation_title' && includeEstimationTitle) {\n // Make estimation_title required when includeEstimationTitle is true\n fieldsSchemaAcc[field.name] = (\n field.schema as AnyObjectSchema\n ).required('Required field');\n } else {\n fieldsSchemaAcc[field.name] = field.schema as AnyObjectSchema;\n }\n return fieldsSchemaAcc;\n },\n {},\n );\n return object(fieldsSchema) as AnyObjectSchema;\n}\n\n/**\n * Format the benefits to the expected format by the API.\n * @param benefits\n * @returns\n */\nfunction formatBenefits(benefits: Record<string, string>) {\n const needle = 'benefit-';\n return Object.keys(benefits).reduce<\n Array<{ benefit_group_slug: string; benefit_tier_slug: string }>\n >((acc, key) => {\n const benefitTierSlug = benefits[key];\n if (benefitTierSlug === 'none') {\n return acc;\n }\n const benefitGroupSlug = key.replace(needle, '');\n const benefitEntry = {\n benefit_group_slug: benefitGroupSlug,\n benefit_tier_slug: benefitTierSlug,\n };\n return [...acc, benefitEntry];\n }, []);\n}\n\nfunction mapValueToEmployment(\n value: CostCalculatorEstimationSubmitValues,\n estimationOptions: CostCalculatorEstimationOptions,\n version: CostCalculatorVersion,\n): CostCalculatorEmploymentParam {\n const managementFee = Number(value.management?.management_fee);\n const currencyCode = value.currency_code;\n\n const base: CostCalculatorEmploymentParam = {\n region_slug: value.region || value.country,\n employment_term: value.contract_duration_type ?? 'fixed',\n title: value.estimation_title || estimationOptions.title,\n age: value.age ?? undefined,\n ...(value.benefits && { benefits: formatBenefits(value.benefits) }),\n ...(estimationOptions.includeManagementFee &&\n managementFee && {\n discount: {\n quoted_amount: estimationOptions.showManagementFee\n ? managementFee\n : BASE_RATES[currencyCode as keyof typeof BASE_RATES] ||\n BASE_RATES.USD,\n text: '',\n },\n }),\n };\n\n return {\n ...base,\n ...getSalaryFields(value, version),\n };\n}\n\nfunction getSalaryFields(\n value: CostCalculatorEstimationSubmitValues,\n version: CostCalculatorVersion,\n): Partial<CostCalculatorEmploymentParam> {\n const isMarketing =\n version === 'marketing' || value.salary_converted === 'salary_conversion';\n const isStandard =\n version === 'standard' && value.salary_converted === 'salary';\n const useHiringBudget = value.hiring_budget === 'my_hiring_budget';\n\n if (isMarketing) {\n const useEmployerCurrency = value.salary_converted === 'salary_conversion';\n return useHiringBudget\n ? {\n annual_total_cost_in_employer_currency: value.salary,\n }\n : {\n [useEmployerCurrency\n ? 'annual_gross_salary_in_employer_currency'\n : 'annual_gross_salary']: value.salary,\n };\n }\n\n if (isStandard) {\n return useHiringBudget\n ? {\n annual_total_cost: value.salary,\n }\n : {\n annual_gross_salary: value.salary,\n };\n }\n\n return {};\n}\n\n/**\n * Build the payload for the cost calculator estimation.\n * @param values\n * @param estimationOptions\n * @returns\n */\nexport function buildPayload(\n values:\n | CostCalculatorEstimationSubmitValues\n | CostCalculatorEstimationSubmitValues[],\n estimationOptions: CostCalculatorEstimationOptions = defaultEstimationOptions,\n version: CostCalculatorVersion = 'standard',\n): CostCalculatorEstimateParams {\n const employments = Array.isArray(values) ? values : [values];\n\n if (employments.length === 0) {\n throw new Error('At least one employment value is required');\n }\n\n if (employments.length > 1) {\n const currencies = new Set(employments.map((v) => v.currency));\n if (currencies.size > 1) {\n console.warn(\n 'Multiple currencies detected in array. Using currency from first employment.',\n );\n }\n }\n\n return {\n employer_currency_slug: employments[0].currency,\n include_benefits: estimationOptions.includeBenefits,\n include_cost_breakdowns: estimationOptions.includeCostBreakdowns,\n include_premium_benefits: estimationOptions.includePremiumBenefits,\n include_management_fee: estimationOptions.includeManagementFee,\n employments: employments.map((value) =>\n mapValueToEmployment(value, estimationOptions, version),\n ),\n };\n}\n","import { MinimalRegion } from '@/src/client';\nimport { jsonSchema } from '@/src/flows/CostCalculator/jsonSchema';\nimport type {\n CostCalculatorEstimationFormValues,\n CostCalculatorEstimationOptions,\n CostCalculatorEstimationSubmitValues,\n UseCostCalculatorOptions,\n} from '@/src/flows/CostCalculator/types';\nimport type { JSFModify } from '@/src/flows/types';\n\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport { iterateErrors } from '@/src/components/form/validationResolver';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { string, ValidationError } from 'yup';\nimport { buildPayload, buildValidationSchema } from './utils';\nimport {\n useCompanyCurrencies,\n useCostCalculatorCountries,\n useCostCalculatorEstimation,\n useRegionFields,\n} from '@/src/flows/CostCalculator/api';\nimport { $TSFixMe, JSFField, Meta } from '@/src/types/remoteFlows';\nimport { SalaryField } from '@/src/flows/CostCalculator/components/SalaryField';\nimport {\n FieldSetField,\n FieldSetProps,\n} from '@/src/components/form/fields/FieldSetField';\nimport { mutationToPromise } from '@/src/lib/mutations';\nexport type CostCalculatorVersion = 'standard' | 'marketing';\n\ntype CostCalculatorCountry = {\n value: string;\n label: string;\n childRegions: MinimalRegion[];\n hasAdditionalFields: boolean | undefined;\n regionSlug: string;\n currency: string;\n};\n\ntype JSFValidationError = {\n formErrors: Record<\n string,\n {\n type: string;\n message: string;\n }\n >;\n yupError: ValidationError;\n};\n\nexport const defaultEstimationOptions: CostCalculatorEstimationOptions = {\n title: 'Estimation',\n includeBenefits: false,\n includeCostBreakdowns: false,\n includePremiumBenefits: false,\n enableCurrencyConversion: false,\n includeEstimationTitle: false,\n includeManagementFee: false,\n};\n\ntype UseCostCalculatorParams = {\n /**\n * The default region slug to preselect a country and a region.\n */\n defaultRegion?: string;\n /**\n * The default currency slug to preselect a currency.\n */\n defaultCurrency?: string;\n\n /**\n * The default salary to preselect a salary.\n */\n defaultSalary?: string;\n /**\n * The estimation options.\n */\n estimationOptions: CostCalculatorEstimationOptions;\n options?: UseCostCalculatorOptions;\n version?: CostCalculatorVersion;\n};\n\nconst useStaticSchema = (options?: { jsfModify?: JSFModify }) => {\n const { schema: jsonSchemaModified } = modify(\n jsonSchema.data.schema,\n options?.jsfModify || {},\n );\n\n return createHeadlessForm(jsonSchemaModified);\n};\n\ntype HiringBudget = 'my_hiring_budget' | 'employee_annual_salary';\n\nfunction getSalaryTitle(\n salaryField: unknown,\n hiringBudget?: HiringBudget,\n): string {\n if (\n typeof salaryField === 'object' &&\n salaryField !== null &&\n 'title' in salaryField\n ) {\n const title = (salaryField as { title?: string }).title;\n if (title) return title;\n }\n return hiringBudget === 'my_hiring_budget'\n ? 'Hiring budget'\n : \"Employee's annual salary\";\n}\n\n/**\n * Hook to use the cost calculator.\n */\nexport const useCostCalculator = (\n {\n defaultRegion,\n defaultCurrency,\n defaultSalary,\n estimationOptions,\n options,\n version,\n }: UseCostCalculatorParams = {\n estimationOptions: defaultEstimationOptions,\n },\n) => {\n const fieldsMetaRef = useRef<{\n fields: Meta;\n }>({\n fields: {},\n });\n const [selectedRegion, setSelectedRegion] = useState<string | undefined>(\n defaultRegion,\n );\n const [selectedCountry, setSelectedCountry] =\n useState<CostCalculatorCountry>();\n const [employerBillingCurrency, setEmployerBillingCurrency] = useState<\n string | undefined\n >();\n const [hiringBudget, setHiringBudget] = useState<HiringBudget>();\n const { data: countries, isLoading: isLoadingCountries } =\n useCostCalculatorCountries({\n includePremiumBenefits: estimationOptions.includePremiumBenefits,\n });\n const { data: currencies, isLoading: isLoadingCurrencies } =\n useCompanyCurrencies();\n\n const jsonSchemaRegionSlug = selectedRegion || selectedCountry?.value;\n\n const { data: jsonSchemaRegionFields, isLoading: isLoadingRegionFields } =\n useRegionFields(jsonSchemaRegionSlug, {\n includePremiumBenefits: estimationOptions.includePremiumBenefits,\n options,\n });\n const costCalculatorEstimationMutation = useCostCalculatorEstimation();\n const { mutateAsync: costCalculatorEstimationMutationAsync } =\n mutationToPromise(costCalculatorEstimationMutation);\n const employeeBillingCurrency = selectedCountry?.currency;\n\n const salaryField = options?.jsfModify?.fields?.salary;\n const salaryFieldPresentation =\n salaryField &&\n typeof salaryField === 'object' &&\n 'presentation' in salaryField\n ? (\n salaryField as {\n presentation?: {\n salary_conversion_properties?: {\n label?: string;\n description?: string;\n };\n };\n }\n ).presentation\n : undefined;\n\n const getCurrencies = useCallback(() => {\n const shouldSwapOrder =\n employeeBillingCurrency && employerBillingCurrency\n ? employeeBillingCurrency !== employerBillingCurrency\n : false;\n\n if (employeeBillingCurrency !== employerBillingCurrency) {\n return {\n from: employerBillingCurrency,\n to: employeeBillingCurrency,\n shouldSwapOrder,\n };\n }\n\n return {\n from: employeeBillingCurrency,\n to: employerBillingCurrency,\n shouldSwapOrder,\n };\n }, [employeeBillingCurrency, employerBillingCurrency]);\n\n const showManagementField = estimationOptions.showManagementFee;\n const showEstimationTitleField = estimationOptions.includeEstimationTitle;\n const customFields = useMemo(() => {\n const { from, to, shouldSwapOrder } = getCurrencies();\n const salaryTitle = getSalaryTitle(salaryField, hiringBudget);\n\n return {\n fields: {\n salary: {\n ...salaryField,\n title: salaryTitle,\n presentation: {\n salary_conversion_properties: {\n label:\n salaryFieldPresentation?.salary_conversion_properties?.label,\n description:\n salaryFieldPresentation?.salary_conversion_properties\n ?.description,\n },\n currencies: { from, to },\n Component: (\n props: JSFField & { currencies: { from: string; to: string } },\n ) => {\n return (\n <SalaryField\n {...props}\n shouldSwapOrder={shouldSwapOrder}\n conversionType={\n version === 'marketing' ? 'no_spread' : 'spread'\n }\n defaultValue={defaultSalary}\n />\n );\n },\n },\n },\n hiring_budget: {\n ...options?.jsfModify?.fields?.hiring_budget,\n presentation: {\n hidden: version == 'marketing',\n },\n },\n management: {\n ...options?.jsfModify?.fields?.management,\n properties: {\n ...(options?.jsfModify?.fields?.management as $TSFixMe)?.properties,\n management_fee: {\n ...(options?.jsfModify?.fields?.management as $TSFixMe)\n ?.properties?.management_fee,\n 'x-jsf-presentation': {\n inputType: 'money',\n additionalProps: {\n currency: employerBillingCurrency || 'USD',\n },\n },\n },\n },\n presentation: {\n ...(typeof options?.jsfModify?.fields?.management === 'object'\n ? (\n options?.jsfModify?.fields?.management as Record<\n string,\n $TSFixMe\n >\n )['x-jsf-presentation']\n : {}),\n hidden: !showManagementField,\n Component: (props: FieldSetProps) => {\n return (\n <FieldSetField\n {...props}\n variant='inset'\n features={{\n toggle: {\n enabled: true,\n stateField: 'management._expanded',\n labels: {\n expand: 'Define',\n collapse: 'Remove',\n },\n },\n }}\n />\n );\n },\n },\n },\n estimation_title: {\n ...options?.jsfModify?.fields?.estimation_title,\n 'x-jsf-presentation': {\n hidden: !showEstimationTitleField,\n },\n },\n },\n };\n }, [\n getCurrencies,\n salaryField,\n hiringBudget,\n salaryFieldPresentation?.salary_conversion_properties?.label,\n salaryFieldPresentation?.salary_conversion_properties?.description,\n options?.jsfModify?.fields?.hiring_budget,\n options?.jsfModify?.fields?.management,\n options?.jsfModify?.fields?.estimation_title,\n version,\n employerBillingCurrency,\n showManagementField,\n showEstimationTitleField,\n defaultSalary,\n ]);\n\n const fieldsJSONSchema = useStaticSchema({\n jsfModify: {\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n });\n\n useEffect(() => {\n // Initialize selectedCountry from defaultRegion\n if (defaultRegion && countries) {\n const defaultCountry = countries.find(\n ({ value }) => value === defaultRegion,\n );\n if (defaultCountry) {\n setSelectedCountry(defaultCountry);\n }\n }\n }, [defaultRegion, countries]);\n\n useEffect(() => {\n // Initialize selectedCurrency from defaultCurrency\n if (defaultCurrency && currencies) {\n const defaultCurrencyObj = currencies.find(\n ({ value }) => value === defaultCurrency,\n );\n if (defaultCurrencyObj) {\n setEmployerBillingCurrency(defaultCurrencyObj.label);\n }\n }\n }, [defaultCurrency, currencies]);\n\n /**\n * Submit the estimation form with the given values.\n * @param values\n */\n async function onSubmit(values: CostCalculatorEstimationSubmitValues) {\n return costCalculatorEstimationMutationAsync(\n buildPayload(values, estimationOptions, version),\n );\n }\n\n /**\n * If the selected country has no child regions and has additional fields,\n * set the current region to the country's region slug and fetch the region fields.\n * @param country\n */\n function onCountryChange(country: string) {\n const currentCountry = countries?.find(({ value }) => value === country);\n\n if (\n currentCountry &&\n currentCountry.childRegions.length === 0 &&\n currentCountry.hasAdditionalFields\n ) {\n setSelectedRegion(currentCountry.regionSlug);\n } else {\n setSelectedRegion(undefined);\n }\n setSelectedCountry(currentCountry);\n }\n\n /**\n * Update the selected region and fetch the region fields.\n * @param region\n */\n function onRegionChange(region: string) {\n setSelectedRegion(region);\n }\n\n function onHiringBudgetChange(event: React.ChangeEvent<HTMLInputElement>) {\n setHiringBudget(event.target.value as HiringBudget);\n }\n\n function onChangeCurrency(currency: string) {\n const selectedCurrency = currencies?.find(\n (c) => c.value === currency,\n )?.label;\n setEmployerBillingCurrency(selectedCurrency);\n options?.onCurrencyChange?.(selectedCurrency || '');\n }\n\n const regionField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'region',\n );\n\n if (regionField) {\n const regions =\n selectedCountry?.childRegions.map((region) => ({\n value: region.slug,\n label: region.name,\n })) ?? [];\n regionField.options = regions;\n regionField.isVisible = regions.length > 0;\n regionField.required = regions.length > 0;\n regionField.onChange = onRegionChange;\n regionField.schema =\n regions.length > 0\n ? string()\n .transform((value) => (typeof value === 'string' ? value : ''))\n .required('Region is required')\n : string();\n }\n\n if (currencies) {\n const currencyField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'currency',\n );\n if (currencyField) {\n currencyField.options = currencies;\n currencyField.onChange = onChangeCurrency;\n }\n }\n\n const hiringBudgetField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'hiring_budget',\n );\n if (hiringBudgetField) {\n hiringBudgetField.onChange = onHiringBudgetChange;\n }\n\n if (countries) {\n const countryField = fieldsJSONSchema.fields.find(\n (field) => field.name === 'country',\n );\n if (countryField) {\n countryField.options = countries;\n countryField.onChange = onCountryChange;\n }\n }\n\n const resetForm = () => {\n setSelectedCountry(undefined);\n setSelectedRegion(defaultRegion);\n };\n\n const allFields = [\n ...fieldsJSONSchema.fields.filter((field) => field.name !== 'management'),\n ...(jsonSchemaRegionFields?.fields || []),\n ...fieldsJSONSchema.fields.filter((field) => field.name === 'management'),\n ];\n\n const validationSchema = buildValidationSchema(\n fieldsJSONSchema.fields,\n employerBillingCurrency || 'USD',\n estimationOptions.includeEstimationTitle,\n );\n\n async function handleValidation(values: CostCalculatorEstimationFormValues) {\n let errors: JSFValidationError | null = null;\n\n options?.onValidation?.(values);\n const parsedValues = parseJSFToValidate(values, allFields);\n\n // 1. validate static fields first using Yup validate function\n try {\n await validationSchema.validate(parsedValues, {\n abortEarly: false,\n });\n errors = {\n formErrors: {},\n yupError: new ValidationError([], values),\n };\n } catch (error) {\n const iterateResult = iterateErrors(error as ValidationError);\n\n errors = {\n // convert the errors to a format that can be used in the form\n formErrors: Object.entries(iterateResult).reduce(\n (acc, [key, value]) => ({ ...acc, [key]: value.message }),\n {},\n ),\n yupError: error as ValidationError,\n };\n }\n\n // 2. validate json schema fields using the handleValidation (from json-schema-form)\n const handleValidationResult =\n jsonSchemaRegionFields?.handleValidation(parsedValues);\n\n // 3. combine the errors from both validations\n const combinedInnerErrors = [\n ...(errors?.yupError.inner || []),\n ...(handleValidationResult?.yupError?.inner || []),\n ];\n const combinedValues = {\n ...(errors?.yupError?.value || {}),\n ...(handleValidationResult?.yupError?.value || {}),\n };\n\n return {\n formErrors: {\n ...(errors?.formErrors || {}),\n ...(handleValidationResult?.formErrors || {}),\n },\n yupError: new ValidationError(combinedInnerErrors, combinedValues),\n };\n }\n\n return {\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState: {\n current: 0,\n total: 1,\n isLastStep: true,\n },\n /**\n * Array of form fields from the cost calculator schema + dynamic region fields like benefits, age, etc.\n */\n fields: allFields,\n /**\n * Validation schema for the cost calculator form\n */\n validationSchema,\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 values: CostCalculatorEstimationFormValues,\n ): CostCalculatorEstimationSubmitValues => {\n const {\n country,\n region,\n currency,\n salary_converted,\n hiring_budget,\n salary_conversion,\n management,\n estimation_title,\n ...rest\n } = values;\n\n // If the salary has been converted, we take the one the user has inputted\n let salary = values.salary;\n if (salary_converted === 'salary_conversion') {\n salary = salary_conversion;\n }\n\n const jsonSchemaStaticFieldValues = {\n country,\n region,\n salary,\n salary_converted,\n salary_conversion,\n hiring_budget,\n currency,\n management,\n estimation_title,\n };\n\n const parsedStaticFields = parseJSFToValidate(\n jsonSchemaStaticFieldValues,\n fieldsJSONSchema.fields,\n );\n\n const parsedRegionFields = parseJSFToValidate(\n rest,\n jsonSchemaRegionFields?.fields || [],\n );\n\n const additionalFields = {\n currency_code: currencies?.find((c) => c.value === currency)?.label,\n };\n\n return {\n ...parsedStaticFields,\n ...parsedRegionFields,\n ...additionalFields,\n } as CostCalculatorEstimationSubmitValues;\n },\n /**\n * Function to handle validation of the cost calculator form\n * @param values - Form values to validate\n * @returns Validation result\n */\n handleValidation,\n /**\n * Whether the cost calculator form is currently being submitted\n */\n isSubmitting: costCalculatorEstimationMutation.isPending,\n /**\n * Whether the cost calculator form is currently loading\n */\n isLoading:\n isLoadingCountries && isLoadingCurrencies && isLoadingRegionFields,\n /**\n * Function to submit the cost calculator form\n */\n onSubmit,\n /**\n * Function to reset the cost calculator form\n */\n resetForm,\n\n /**\n * Currencies data useful to get the currency if you have a currencySlug\n */\n currencies,\n\n /**\n * Fields metadata\n */\n meta: {\n fields: fieldsMetaRef.current?.fields,\n },\n };\n};\n"],"mappings":"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","names":["number","object","createHeadlessForm","modify","useCallback","useEffect","useMemo","useRef","useState","string","ValidationError","jsx","defaultEstimationOptions","useStaticSchema","__name","options","jsonSchemaModified","modify","jsonSchema","createHeadlessForm","getSalaryTitle","salaryField","hiringBudget","title","useCostCalculator","defaultRegion","defaultCurrency","defaultSalary","estimationOptions","version","fieldsMetaRef","useRef","selectedRegion","setSelectedRegion","useState","selectedCountry","setSelectedCountry","employerBillingCurrency","setEmployerBillingCurrency","setHiringBudget","countries","isLoadingCountries","useCostCalculatorCountries","currencies","isLoadingCurrencies","useCompanyCurrencies","jsonSchemaRegionSlug","jsonSchemaRegionFields","isLoadingRegionFields","useRegionFields","costCalculatorEstimationMutation","useCostCalculatorEstimation","costCalculatorEstimationMutationAsync","mutationToPromise","employeeBillingCurrency","salaryFieldPresentation","getCurrencies","useCallback","shouldSwapOrder","showManagementField","showEstimationTitleField","customFields","useMemo","from","to","salaryTitle","props","SalaryField","FieldSetField","fieldsJSONSchema","useEffect","defaultCountry","value","defaultCurrencyObj","onSubmit","values","buildPayload","onCountryChange","country","currentCountry","onRegionChange","region","onHiringBudgetChange","event","onChangeCurrency","currency","selectedCurrency","c","regionField","field","regions","string","currencyField","hiringBudgetField","countryField","resetForm","allFields","validationSchema","buildValidationSchema","handleValidation","errors","parsedValues","parseJSFToValidate","ValidationError","error","iterateResult","iterateErrors","acc","key","handleValidationResult","combinedInnerErrors","combinedValues","salary_converted","hiring_budget","salary_conversion","management","estimation_title","rest","salary","parsedStaticFields","parsedRegionFields","additionalFields","buildValidationSchema","fields","employerBillingCurrency","includeEstimationTitle","fieldsSchema","fieldsSchemaAcc","field","__name","val","schema","object","number","value","BASE_RATES","formatBenefits","benefits","needle","acc","key","benefitTierSlug","benefitEntry","mapValueToEmployment","estimationOptions","version","managementFee","currencyCode","getSalaryFields","isMarketing","isStandard","useHiringBudget","useEmployerCurrency","buildPayload","values","defaultEstimationOptions","employments","v"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{J as f,n as m,u,w as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{J as f,n as m,u,w as d}from"./chunk-AA7QB3QQ.js";import{d as o}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{useMutation as y,useQuery as s}from"@tanstack/react-query";var k=t(({employmentId:e})=>{let{client:n}=o();return s({queryKey:["employment",e],retry:!1,queryFn:t(()=>d({client:n,headers:{Authorization:""},path:{employment_id:e}}),"queryFn"),enabled:!!e,select:t(({data:r})=>r?.data?.employment,"select")})},"useEmploymentQuery"),c=t(({employmentId:e,status:n,timeoffType:r,options:a})=>{let{client:l}=o();return s({queryKey:["timeoff",e,n],retry:!1,queryFn:t(()=>f({client:l,headers:{Authorization:""},query:{employment_id:e,status:n,timeoff_type:r}}),"queryFn"),select:t(({data:i})=>a?.select?.(i)??i,"select"),enabled:a?.enabled})},"useTimeOffQuery"),p=t((e,n)=>{let r=new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),a=new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});return`${r} \u2192 ${a}`},"formatDateRange"),P=t(({employmentId:e,options:n})=>c({employmentId:e,timeoffType:"paid_time_off",options:{enabled:n?.enabled,select:t(r=>({bookedDays:r?.data?.total_count||0,timeoffs:r?.data?.timeoffs?.map(a=>({status:a?.status,duration:a?.timeoff_days.length,startDate:a?.start_date,endDate:a?.end_date,formattedDate:p(a?.start_date,a?.end_date)}))||[]}),"select")}}),"usePaidTimeoffBreakdownQuery"),S=t(({employmentId:e})=>{let{client:n}=o();return s({queryKey:["timeoff-balance",e],retry:!1,queryFn:t(()=>u({client:n,headers:{Authorization:""},path:{employment_id:e}}),"queryFn"),select:t(({data:r})=>r,"select")})},"useTimeOffLeavePoliciesSummaryQuery"),x=t(()=>{let{client:e}=o();return y({mutationFn:t(n=>m({client:e,headers:{Authorization:""},body:n}),"mutationFn")})},"useMagicLink");export{k as a,c as b,P as c,S as d,x as e};
|
|
2
|
+
//# sourceMappingURL=chunk-A477TZFC.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{a as t}from"./chunk-P37U34EQ.js";import{formDataBodySerializer as i}from"@hey-api/client-fetch";import{createClient as o,createConfig as n}from"@hey-api/client-fetch";var r=o(n({baseUrl:"https://gateway.remote.com/"}));var l=t(e=>(e?.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/offboardings",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateOffboarding");var h=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments/schema",...e}),"getShowContractAmendmentSchema");var m=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/currency-converter/raw",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postConvertRawCurrencyConverter"),d=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/countries/{country_code}/contractor-contract-details",...e}),"getShowContractorContractDetailsCountry");var y=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEmployment2"),u=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/help-center-articles/{id}",...e}),"getShowHelpCenterArticle");var E=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/estimation",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEstimation");var C=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers",...e}),"getIndexBenefitOffer"),w=t(e=>(e.client??r).put({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"putUpdateBenefitOffer");var T=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contractor-subscriptions",...e}),"getIndexSubscription");var O=t(e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/payroll-calendars",...e}),"getIndexEorPayrollCalendar");var x=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contract-documents/{id}",...e}),"getShowContractDocument");var b=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/magic-link",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postGenerateMagicLink");var f=t(e=>(e?.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/estimation-pdf",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEstimationPdf");var P=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/risk-reserve",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateRiskReserve");var R=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/companies/{company_id}",...e}),"getShowCompany");var D=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateContractAmendment");var G=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/countries/{country_code}/{form}",...e}),"getShowFormCountry");var v=t(e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/countries",...e}),"getIndexCountry");var g=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/leave-policies/summary/{employment_id}",...e}),"getIndexLeavePoliciesSummary");var I=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers/schema",...e}),"getShowSchema");var S=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}",...e}),"getShowEmployment"),k=t(e=>(e.client??r).patch({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"patchUpdateEmployment2");var U=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/regions/{slug}/fields",...e}),"getShowRegionField");var B=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/contract-eligibility",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateContractEligibility"),q=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/countries",...e}),"getSupportedCountry");var A=t(e=>(e?.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/estimation-csv",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateEstimationCsv"),_=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contract-documents",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateContractDocument");var W=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/currency-converter/effective",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postConvertWithSpreadCurrencyConverter");var F=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments/automatable",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postAutomatableContractAmendment");var j=t(e=>(e?.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/company-currencies",...e}),"getIndexCompanyCurrency");var L=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/invite",...e}),"postInviteEmploymentInvitation");var V=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contract-documents/{contract_document_id}/sign",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postSignContractDocument");var M=t(e=>(e.client??r).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contractor-plus-subscription",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postManageContractorPlusSubscriptionSubscription"),z=t(e=>(e.client??r).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/timeoff",...e}),"getIndexTimeoff");export{r as a,l as b,h as c,m as d,d as e,y as f,u as g,E as h,C as i,w as j,T as k,O as l,x as m,b as n,f as o,P as p,R as q,D as r,G as s,v as t,g as u,I as v,S as w,k as x,U as y,B as z,q as A,A as B,_ as C,W as D,F as E,j as F,L as G,V as H,M as I,z as J};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-AA7QB3QQ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as f}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as f}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-WJ6YJFD4.js";import{b as p}from"./chunk-2YTBWEC7.js";import{g as C}from"./chunk-CNDSIADP.js";import{g as E}from"./chunk-43WMZDDH.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as u}from"react/jsx-runtime";function T({onSubmit:S,onError:w,onSuccess:y,onErrorWithFields:c,shouldResetForm:d,resetFields:a}){let{form:e,formId:V,costCalculatorBag:o}=f(),{formState:{isSubmitSuccessful:s}}=e;R(()=>{if(s&&d){o?.resetForm(),e.reset();return}if(s&&a){let t={...e.getValues()};a.forEach(r=>{t[r]=""}),o?.resetForm(),e.reset(t)}},[s,e,d,o,a]);let b=n(async i=>{try{let t=o?.parseFormValues(i);o?.meta?.fields&&(o.meta.fields=E(i,o.fields),o.meta.fields.employer_currency_slug=o.meta.fields.currency);let r=await o?.onSubmit(t);if(await S?.(t),r?.data&&!r.error){let l={data:{...r.data.data,employments:r.data.data.employments?.map(m=>({...m,title:t.estimation_title}))}};await y?.(l)}else throw{data:null,error:r?.error,fieldErrors:r?.fieldErrors,rawError:r?.rawError}}catch(t){let r=t,l=r.fieldErrors;if(c){let m=o?.meta?.fields,h=p(l,m);c({error:r.error,rawError:r.rawError,fieldErrors:h})}else w?.(r.error)}},"handleSubmit");return u(C,{...e,children:u("form",{id:V,onSubmit:e.handleSubmit(b),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:u(F,{fields:o?.fields??[]})})})}n(T,"CostCalculatorForm");export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-AM2IRFHQ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-2W2XD7ZY.js";import{b as t}from"./chunk-TOA3JILU.js";import{b as e}from"./chunk-2YTBWEC7.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as P}from"react/jsx-runtime";function S({onSubmit:l,onSuccess:d,onError:n}){let{contractorOnboardingBag:o}=t(),c=i(async a=>{try{await l?.(o.parseFormValues(a));let r=await o.onSubmit(a);if(r?.data){await d?.(r?.data),o?.next();return}if(r?.error){let p=e(r?.fieldErrors||[],o.meta?.fields?.pricing_plan);n?.({error:r?.error,rawError:r?.rawError,fieldErrors:p})}}catch(r){n?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),m=o.stepState.values?.pricing_plan||o.initialValues.pricing_plan;return P(s,{defaultValues:m,onSubmit:c})}i(S,"PricingPlanStep");export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-B6IVJUEH.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-LV5R6H3D.js";import{a as r}from"./chunk-P5WUODPR.js";import{a as t}from"./chunk-WW5UCMQZ.js";import{a as f}from"./chunk-7CJX7I3M.js";import{a as e}from"./chunk-76DHIEN7.js";import{a as p}from"./chunk-DZ2R72O5.js";import{a as n}from"./chunk-6VRUYYUV.js";import{a as m}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{useId as c}from"react";import{jsx as F}from"react/jsx-runtime";var k=i(({employmentId:l,render:T,options:d,initialValues:s})=>{let u=c(),o=t({employmentId:l,options:d,initialValues:s});return F(m.Provider,{value:{formId:u,terminationBag:o},children:T({terminationBag:o,components:{SubmitButton:r,Back:n,EmployeeComunicationStep:e,TerminationDetailsStep:a,PaidTimeOffStep:p,AdditionalDetailsStep:f}})})},"TerminationFlow");export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-COBQ4WSJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l}from"./chunk-HO2TIG7R.js";import{a as m,b as y}from"./chunk-MZB24YJP.js";import{c}from"./chunk-CNDSIADP.js";import{a as t}from"./chunk-P37U34EQ.js";import{useEffect as N}from"react";import{Fragment as b,jsx as v,jsxs as C}from"react/jsx-runtime";var R=t(({currencies:{from:d,to:F},shouldSwapOrder:s,salary_conversion_properties:a,conversionType:_="no_spread",defaultValue:r,...e})=>{let{setValue:n,getValues:i}=c(),f={label:a?.label||"Salary conversion",description:a?.description||C(b,{children:["The conversion is based on the Remote FX rate."," ",v(y,{className:"text-sm",zendeskId:m.remoteFxRate,children:"Learn more \u2197"})]})},g=s?"salary_conversion":e.name,u=s?e.name:"salary_conversion";return N(()=>{if(s){let o=i(e.name);o?(n("salary_conversion",o),n("salary_converted","salary_conversion")):r&&(n("salary_conversion",r),n("salary_converted","salary_conversion"))}else{let o=i("salary_conversion");o?(n(e.name,o),n("salary_converted",e.name)):r&&(n(e.name,r),n("salary_converted",e.name))}},[s,r,n,i,e.name]),v(l,{...e,sourceCurrency:d,targetCurrency:F,mainFieldName:g,conversionFieldName:u,conversionProperties:f,classNamePrefix:"RemoteFlows-Salary",conversionType:_})},"SalaryField");export{R as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CW3MAP5L.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n,b as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n,b as i}from"./chunk-MZB24YJP.js";import{a as e}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Fragment as s,jsx as t,jsxs as m}from"react/jsx-runtime";var r=["You submit your termination request.","We review your request along with the employment agreement, local labor laws, and any collective bargaining agreements in place.","A lifecycle specialist contacts you if they need additional details. Sometimes they will request a call.","Depending on the country-specific laws and the terms of the employment agreement, we may need to seek additional legal advice. We\u2019ll let you know if there are additional charges before proceeding.","Terms and conditions for the termination are finalized.","You verbally communicate the termination to the employee.","We share termination documents with the employee.","The employee signs the termination documents if required.","We process the final salary and offboard the employee."],h=o(()=>m(s,{children:[t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__Title"),children:"Please read carefully before you continue"}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description"),children:"Please do not inform the employee of the termination. We'll lead communication with them after you submit this form and we finalize the termination terms."}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description RemoteFlows__TerminationDialogInfoContent__FollowUpDescription"),children:"If you already informed them, that's okay. We'll ask for the details regarding that communication and take it from there."}),t(i,{className:e("RemoteFlows__TerminationDialogInfoContent__ZendeskTriggerButton text-sm"),zendeskId:n.terminationEmployeeCommunication,children:"Learn more about employee communication"}),t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessTitle"),children:"The termination process"}),t("ul",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessList list-disc list-inside"),children:r.map((a,l)=>t("li",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessListItem"),children:a},l))})]}),"TerminationDialogInfoContent");export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DPWL4KNA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R,b as x,c as N,d as A}from"./chunk-DTHBG6BD.js";import{a as T}from"./chunk-ZE3YT3Q6.js";import{a as C}from"./chunk-AFRA4BIW.js";import{a as w,b as f}from"./chunk-OQJWLV7V.js";import{b as B}from"./chunk-WVDTHFGS.js";import{a as i,b as n,e as F}from"./chunk-43WMZDDH.js";import{a as d}from"./chunk-P37U34EQ.js";import{MoreHorizontal as G}from"lucide-react";import{useState as P}from"react";import{Fragment as U,jsx as g,jsxs as E}from"react/jsx-runtime";function L({actions:e=[],className:r,label:l,"data-testid":a}){let[_,m]=P(!1);return E("div",{className:i("relative",r),children:[g(B,{"data-testid":a,variant:"ghost","aria-label":l,className:"h-8 w-8 p-0",onClick:()=>m(!_),children:g(G,{className:"h-4 w-4"})}),_&&E(U,{children:[g("div",{className:"fixed inset-0 z-40",onClick:()=>m(!1)}),g("div",{className:"absolute right-0 top-1/2 mt-1 bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[120px]",children:e.map((c,u)=>g("button",{"data-testid":`${a}-${c.label.toLowerCase().replace(" ","-")}`,className:i("w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100",c.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>{c.onClick(),m(!1)},disabled:c.disabled,children:c.label},u))})]})]})}d(L,"ActionsDropdown");import{ChevronDown as S,Info as $}from"lucide-react";import j from"react-flagpack";import{useState as O}from"react";import{Fragment as b,jsx as o,jsxs as t}from"react/jsx-runtime";var Z={GB:"GB-UKM"},K=d(({title:e,country:r,region:l,annualGrossSalary:a,onDelete:_,onExportPdf:m,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:m},{label:"Delete",onClick:_}];return t("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[t("div",{className:"flex flex-row items-center gap-6",children:[o("div",{className:"RemoteFlows__EstimationResultsHeader__FlagContainer flex h-16 w-16 items-center justify-center rounded-lg bg-[#F4F4F5]",children:o(j,{code:Z[r.alpha_2_code]||r.alpha_2_code})}),t("div",{className:"space-y-1",children:[o("h2",{"data-testid":"estimation-results-header-title",className:"RemoteFlows__EstimationResultsHeader__Title text-lg font-medium leading-none text-[#181818]",children:e}),t("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[r.name," ",l?` (${l.name})`:""]}),t("p",{"data-testid":"estimation-results-header-annual-gross-salary",className:"RemoteFlows__EstimationResultsHeader__AnnualGrossSalary text-xs text-[#71717A]",children:[o("span",{className:"text-[#181818]",children:"Employee annual gross salary:"})," ",a]})]})]}),o(L,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),V=d(()=>({steps:[{id:"add-employment-details",title:"Add employment details",description:"You add employee employments details."},{id:"invite-employee",title:"Invite employee",description:"Hire receives an email invitation from Remote to start the self-enrollment process."},{id:"verify-information",title:"Verify information",description:"Remote prepares the Employment Agreement and verifies all the information."},{id:"sign-contract",title:"Sign contract",description:"All parties sign the Employment Agreement and are ready to start. \u{1F389}"}],helpText:"For customers who accept Remote's Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrollment.",zendeskArticleId:w.employeeOnboardingTimeline}),"getOnboardingTimelineData");function Y({minimumOnboardingDays:e,data:r,className:l}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",l),children:t(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:t("div",{className:"flex items-center justify-between w-full",children:[o("span",{className:"RemoteFlows__OnboardingTimeline__Title text-base font-medium text-[#0F172A]",children:"Onboarding timeline"}),e!=null&&t("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),t(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:r.steps.map(a=>t("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:a.title})," ","- ",a.description]},a.id))}),t("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[r.helpText,r.zendeskArticleId&&o(f,{zendeskId:r.zendeskArticleId,children:"Learn more"})]})]})]})})}d(Y,"OnboardingTimeline");function q({className:e,countryBenefitsUrl:r,countryGuideUrl:l,country:a}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:t(x,{value:"timeline",className:"RemoteFlows__HiringSection__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__HiringSection__AccordionTrigger hover:no-underline px-0 py-4",children:o("div",{className:"flex items-center justify-between w-full",children:t("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",a.name]})})}),o(A,{children:t("div",{className:"flex flex-col gap-1",children:[l&&o("a",{href:l,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),r&&o("a",{href:r,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}d(q,"HiringSection");function J({isMultipleCurrency:e,className:r}){return t("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",r),children:[o("span",{"aria-hidden":!0}),e?t(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):t(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}d(J,"EstimationHeaders");function I({label:e,amounts:r,className:l,children:a}){let[_,m]=O(!0);return t("div",{className:i("RemoteFlows__EstimationResults__Row",l),children:[t("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[t("div",{className:"RemoteFlows__EstimationRow__LabelContainer flex items-center gap-2",children:[o("span",{className:i("RemoteFlows__EstimationRow__Title min-w-[140px] font-medium text-[#09090B]"),children:e}),o("button",{onClick:()=>m(!_),className:"RemoteFlows__EstimationRow__CollapseButton p-1 hover:bg-gray-100 rounded",children:o(S,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(r)?r.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):t(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:r})]})]}),_&&a&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:a})]})}d(I,"EstimationRow");function Q({item:e,isMultipleCurrency:r,level:l=0}){let[a,_]=O(!1),m=e.children&&e.children.length>0,c=l>0,u=e.isCollapsible||m;return t("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[t("div",{className:i(r?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[t("div",{className:i("RemoteFlows__BreakdownList__LabelContainer flex items-center gap-2",c&&"pl-3"),children:[!c&&o("span",{className:"RemoteFlows__BreakdownList__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0","aria-hidden":"true"}),u?t("button",{onClick:()=>_(!a),className:"RemoteFlows__BreakdownList__CollapseButton flex items-center gap-2 hover:bg-gray-100 rounded p-1",children:[o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B]"),children:e.label}),o(S,{className:`RemoteFlows__BreakdownList__ChevronDown h-3 w-3 text-muted-foreground transition-transform ${a?"rotate-180":""}`})]}):o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B] p-1"),children:e.label}),e.tooltip&&o(T,{content:t(b,{children:[o("span",{dangerouslySetInnerHTML:{__html:F(e.tooltip)}})," ",e.zendeskId&&o(f,{zendeskId:Number(e.zendeskId),children:"Learn more"})]}),children:o("button",{className:"RemoteFlows__BreakdownList__InfoButton p-1 hover:bg-gray-100 rounded",children:o($,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),r?t(b,{children:[o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employee-amount",className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"}),o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employer-amount",className:i("RemoteFlows__BreakdownList__EmployerAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__EmployerAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__EmployerAmountText--NotNested text-[#09090B]"),children:e.employerAmount||"\u2014"})]}):o("span",{"data-testid":e.dataSelector,className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"})]}),m&&a&&o("div",{className:"mt-1",children:o(k,{items:e.children,isMultipleCurrency:r,level:l+1})})]})}d(Q,"BreakdownListItem");function k({items:e,isMultipleCurrency:r,className:l,level:a}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",l),children:e.map((_,m)=>o(Q,{item:_,isMultipleCurrency:r,level:a},m))})}d(k,"BreakdownList");var pe=d(({estimation:e,title:r,components:l,onDelete:a,onExportPdf:_,onEdit:m})=>{let c=l?.HiringSection||q,u=l?.OnboardingTimeline||Y,z=l?.Header||K,h=l?.Footer,H=V(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,v=e.employer_currency_costs.monthly_management_fee,D=e.region.code!==e.country.code,M=n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol);return t(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(z,{title:r,annualGrossSalary:M,region:D?e.region:void 0,country:e.country,onDelete:a,onExportPdf:_,onEdit:m})}),t("div",{className:"RemoteFlows__Separator",children:[o(J,{isMultipleCurrency:p,className:"mb-3"}),o(I,{label:"Monthly total cost",amounts:p?[n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross monthly salary",regionalAmount:n(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_gross_salary,e.employer_currency_costs.currency.symbol),zendeskId:w.extraPayments.toString(),tooltip:"This country respects extra payments on top of the gross salary."},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Monthly fee",regionalAmount:n(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})]}),o("div",{className:"RemoteFlows__Separator",children:o(I,{label:"Annual total cost",amounts:p?[n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.symbol)},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Extra statutory payments",regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.extra_statutory_payments_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.extra_statutory_payments_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Annual fee",regionalAmount:n(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})}),o("div",{className:"RemoteFlows__Separator",children:o(u,{minimumOnboardingDays:e.minimum_onboarding_time,data:H})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),h&&o(h,{})]})},"EstimationResults");export{pe as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R,b as x,c as N,d as A}from"./chunk-DTHBG6BD.js";import{a as T}from"./chunk-ZE3YT3Q6.js";import{a as C}from"./chunk-AFRA4BIW.js";import{a as w,b as f}from"./chunk-MZB24YJP.js";import{b as B}from"./chunk-WVDTHFGS.js";import{a as i,b as n,e as F}from"./chunk-43WMZDDH.js";import{a as d}from"./chunk-P37U34EQ.js";import{MoreHorizontal as G}from"lucide-react";import{useState as P}from"react";import{Fragment as U,jsx as g,jsxs as E}from"react/jsx-runtime";function L({actions:e=[],className:r,label:l,"data-testid":a}){let[_,m]=P(!1);return E("div",{className:i("relative",r),children:[g(B,{"data-testid":a,variant:"ghost","aria-label":l,className:"h-8 w-8 p-0",onClick:()=>m(!_),children:g(G,{className:"h-4 w-4"})}),_&&E(U,{children:[g("div",{className:"fixed inset-0 z-40",onClick:()=>m(!1)}),g("div",{className:"absolute right-0 top-1/2 mt-1 bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[120px]",children:e.map((c,u)=>g("button",{"data-testid":`${a}-${c.label.toLowerCase().replace(" ","-")}`,className:i("w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100",c.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>{c.onClick(),m(!1)},disabled:c.disabled,children:c.label},u))})]})]})}d(L,"ActionsDropdown");import{ChevronDown as S,Info as $}from"lucide-react";import j from"react-flagpack";import{useState as O}from"react";import{Fragment as b,jsx as o,jsxs as t}from"react/jsx-runtime";var Z={GB:"GB-UKM"},K=d(({title:e,country:r,region:l,annualGrossSalary:a,onDelete:_,onExportPdf:m,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:m},{label:"Delete",onClick:_}];return t("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[t("div",{className:"flex flex-row items-center gap-6",children:[o("div",{className:"RemoteFlows__EstimationResultsHeader__FlagContainer flex h-16 w-16 items-center justify-center rounded-lg bg-[#F4F4F5]",children:o(j,{code:Z[r.alpha_2_code]||r.alpha_2_code})}),t("div",{className:"space-y-1",children:[o("h2",{"data-testid":"estimation-results-header-title",className:"RemoteFlows__EstimationResultsHeader__Title text-lg font-medium leading-none text-[#181818]",children:e}),t("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[r.name," ",l?` (${l.name})`:""]}),t("p",{"data-testid":"estimation-results-header-annual-gross-salary",className:"RemoteFlows__EstimationResultsHeader__AnnualGrossSalary text-xs text-[#71717A]",children:[o("span",{className:"text-[#181818]",children:"Employee annual gross salary:"})," ",a]})]})]}),o(L,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),V=d(()=>({steps:[{id:"add-employment-details",title:"Add employment details",description:"You add employee employments details."},{id:"invite-employee",title:"Invite employee",description:"Hire receives an email invitation from Remote to start the self-enrollment process."},{id:"verify-information",title:"Verify information",description:"Remote prepares the Employment Agreement and verifies all the information."},{id:"sign-contract",title:"Sign contract",description:"All parties sign the Employment Agreement and are ready to start. \u{1F389}"}],helpText:"For customers who accept Remote's Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrollment.",zendeskArticleId:w.employeeOnboardingTimeline}),"getOnboardingTimelineData");function Y({minimumOnboardingDays:e,data:r,className:l}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",l),children:t(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:t("div",{className:"flex items-center justify-between w-full",children:[o("span",{className:"RemoteFlows__OnboardingTimeline__Title text-base font-medium text-[#0F172A]",children:"Onboarding timeline"}),e!=null&&t("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),t(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:r.steps.map(a=>t("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:a.title})," ","- ",a.description]},a.id))}),t("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[r.helpText,r.zendeskArticleId&&o(f,{zendeskId:r.zendeskArticleId,children:"Learn more"})]})]})]})})}d(Y,"OnboardingTimeline");function q({className:e,countryBenefitsUrl:r,countryGuideUrl:l,country:a}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:t(x,{value:"timeline",className:"RemoteFlows__HiringSection__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__HiringSection__AccordionTrigger hover:no-underline px-0 py-4",children:o("div",{className:"flex items-center justify-between w-full",children:t("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",a.name]})})}),o(A,{children:t("div",{className:"flex flex-col gap-1",children:[l&&o("a",{href:l,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),r&&o("a",{href:r,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}d(q,"HiringSection");function J({isMultipleCurrency:e,className:r}){return t("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",r),children:[o("span",{"aria-hidden":!0}),e?t(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):t(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}d(J,"EstimationHeaders");function I({label:e,amounts:r,className:l,children:a}){let[_,m]=O(!0);return t("div",{className:i("RemoteFlows__EstimationResults__Row",l),children:[t("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[t("div",{className:"RemoteFlows__EstimationRow__LabelContainer flex items-center gap-2",children:[o("span",{className:i("RemoteFlows__EstimationRow__Title min-w-[140px] font-medium text-[#09090B]"),children:e}),o("button",{onClick:()=>m(!_),className:"RemoteFlows__EstimationRow__CollapseButton p-1 hover:bg-gray-100 rounded",children:o(S,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(r)?r.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):t(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:r})]})]}),_&&a&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:a})]})}d(I,"EstimationRow");function Q({item:e,isMultipleCurrency:r,level:l=0}){let[a,_]=O(!1),m=e.children&&e.children.length>0,c=l>0,u=e.isCollapsible||m;return t("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[t("div",{className:i(r?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[t("div",{className:i("RemoteFlows__BreakdownList__LabelContainer flex items-center gap-2",c&&"pl-3"),children:[!c&&o("span",{className:"RemoteFlows__BreakdownList__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0","aria-hidden":"true"}),u?t("button",{onClick:()=>_(!a),className:"RemoteFlows__BreakdownList__CollapseButton flex items-center gap-2 hover:bg-gray-100 rounded p-1",children:[o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B]"),children:e.label}),o(S,{className:`RemoteFlows__BreakdownList__ChevronDown h-3 w-3 text-muted-foreground transition-transform ${a?"rotate-180":""}`})]}):o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B] p-1"),children:e.label}),e.tooltip&&o(T,{content:t(b,{children:[o("span",{dangerouslySetInnerHTML:{__html:F(e.tooltip)}})," ",e.zendeskId&&o(f,{zendeskId:Number(e.zendeskId),children:"Learn more"})]}),children:o("button",{className:"RemoteFlows__BreakdownList__InfoButton p-1 hover:bg-gray-100 rounded",children:o($,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),r?t(b,{children:[o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employee-amount",className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"}),o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employer-amount",className:i("RemoteFlows__BreakdownList__EmployerAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__EmployerAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__EmployerAmountText--NotNested text-[#09090B]"),children:e.employerAmount||"\u2014"})]}):o("span",{"data-testid":e.dataSelector,className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"})]}),m&&a&&o("div",{className:"mt-1",children:o(k,{items:e.children,isMultipleCurrency:r,level:l+1})})]})}d(Q,"BreakdownListItem");function k({items:e,isMultipleCurrency:r,className:l,level:a}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",l),children:e.map((_,m)=>o(Q,{item:_,isMultipleCurrency:r,level:a},m))})}d(k,"BreakdownList");var pe=d(({estimation:e,title:r,components:l,onDelete:a,onExportPdf:_,onEdit:m})=>{let c=l?.HiringSection||q,u=l?.OnboardingTimeline||Y,z=l?.Header||K,h=l?.Footer,H=V(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,v=e.employer_currency_costs.monthly_management_fee,D=e.region.code!==e.country.code,M=n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol);return t(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(z,{title:r,annualGrossSalary:M,region:D?e.region:void 0,country:e.country,onDelete:a,onExportPdf:_,onEdit:m})}),t("div",{className:"RemoteFlows__Separator",children:[o(J,{isMultipleCurrency:p,className:"mb-3"}),o(I,{label:"Monthly total cost",amounts:p?[n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross monthly salary",regionalAmount:n(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_gross_salary,e.employer_currency_costs.currency.symbol),zendeskId:w.extraPayments.toString(),tooltip:"This country respects extra payments on top of the gross salary."},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Monthly fee",regionalAmount:n(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})]}),o("div",{className:"RemoteFlows__Separator",children:o(I,{label:"Annual total cost",amounts:p?[n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.symbol)},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Extra statutory payments",regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.extra_statutory_payments_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.extra_statutory_payments_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Annual fee",regionalAmount:n(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})}),o("div",{className:"RemoteFlows__Separator",children:o(u,{minimumOnboardingDays:e.minimum_onboarding_time,data:H})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),h&&o(h,{})]})},"EstimationResults");export{pe as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DXFA52BU.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as N}from"./chunk-SPQO42TA.js";import{a as R}from"./chunk-E4CABUTS.js";import{a as P}from"./chunk-BCXRPHWY.js";import{a as S}from"./chunk-MQWVZSGH.js";import{a as v}from"./chunk-WBRWVTZK.js";import{a as B}from"./chunk-WMPKW7HC.js";import{a as x,b as k,c as i}from"./chunk-7R347KBY.js";import{a as h,b as p,c as g,d as w,e as T}from"./chunk-AFRA4BIW.js";import{b as f}from"./chunk-HPHWQU34.js";import{a as b}from"./chunk-43WMZDDH.js";import{a as _}from"./chunk-P37U34EQ.js";import{lazy as L,useState as V}from"react";import{Fragment as I,jsx as a,jsxs as r}from"react/jsx-runtime";var z=L(()=>import("./flows/CostCalculator/Results/CostCalculatorResultsChart.js"));function Y({employmentData:D,options:e}){let[o,E]=V("monthly"),n=D.employments?.[0];if(!n)return null;let t=n.employer_currency_costs,s=t.currency.symbol,m=o==="monthly"?t.monthly_gross_salary:t.annual_gross_salary,u=o==="monthly"?t.monthly_benefits_total:t.annual_benefits_total,y=o==="monthly"?t.monthly_contributions_total:t.annual_contributions_total,F=o==="monthly"?t.monthly_total:t.annual_total,l=o==="monthly"?null:t.extra_statutory_payments_breakdown,A=o==="monthly"?null:t.extra_statutory_payments_total,d=o==="monthly"?t.monthly_indirect_tax:t.annual_indirect_tax,c=o==="monthly"?t.monthly_benefits_breakdown:t.annual_benefits_breakdown,H=o==="monthly"?t.monthly_contributions_breakdown:t.annual_contributions_breakdown,C=[{name:"Gross Salary",value:m,color:e?.chartColors?.grossSalary??"#3b82f6"},{name:"Contributions",value:y,color:e?.chartColors?.contributions??"#f59e0b"}];return c&&C.push({name:"Benefits",value:u??0,color:e?.chartColors?.benefits??"#10b981"}),r(I,{children:[r("div",{className:"flex flex-col md:flex-row gap-4 md:items-center justify-between mb-6 RemoteFlows__CostCalculatorResults",children:[r("div",{className:"RemoteFlows__CostCalculatorResults__Header",children:[r("h2",{className:"text-xl font-semibold flex items-center gap-2",children:[a("span",{className:"flex items-center gap-1",children:e?.title??"Cost Calculator"}),a(f,{className:"ml-2",children:n.country.name})]}),a("p",{className:"text-primary-foreground font-medium mt-1",children:e?.description??`Total cost of employment in ${n.country.name}`})]}),a(x,{value:o,onValueChange:G=>E(G),className:"w-full md:w-auto RemoteFlows__CostCalculatorResults__Tabs",children:r(k,{className:"grid w-full md:w-[200px] grid-cols-2",children:[a(i,{value:"monthly",children:"Monthly"}),a(i,{value:"annual",children:"Annual"})]})})]}),r("div",{className:b("grid grid-cols-1 gap-6",e?.showChart?"md:grid-cols-3":"","RemoteFlows__CostCalculatorResults_CostBreakdown"),children:[r(h,{className:"md:col-span-2 rounded-lg",children:[r(p,{className:"pb-2",children:[a(g,{children:"Cost Breakdown"}),a(w,{children:"Detailed breakdown of all employer costs"})]}),a(T,{children:r("div",{className:"space-y-6",children:[a(R,{grossSalary:m,currency:s,hasExtraStatutoryPayment:n.has_extra_statutory_payment}),c?a(v,{benefitsBreakdown:c,benefitsTotal:u,currency:s}):null,a(B,{contributionsBreakdown:H,contributionsTotal:y,currency:s}),Array.isArray(l)&&l.length>0?a(N,{extraStatutoryPaymentsBreakdown:l,extraStatutoryPaymentsTotal:A,currency:s}):null,d?a(P,{indirectTax:d,currency:s}):null,a(S,{totalCost:F,currency:s})]})})]}),e?.showChart&&a(z,{chartData:C,currency:s})]})]})}_(Y,"CostCalculatorResults");export{Y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DXIO72S4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-5CVD5WZZ.js";import{b as m}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as n}from"react/jsx-runtime";function u({onSubmit:r}){let{terminationBag:i}=m();return n(a,{onSubmit:o(async e=>{await r?.(i?.parseFormValues(e)),i?.next()},"handleSubmit")})}o(u,"PaidTimeOffForm");export{u as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DZ2R72O5.js.map
|