@remoteoss/remote-flows 1.12.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CountryFieldDefault-LOWXZDAD.js → CountryFieldDefault-SFTKBP6V.js} +2 -2
- package/dist/DatePickerFieldDefault-GHHRA5MC.js +2 -0
- package/dist/RadioGroupFieldDefault-WSWNB62Y.js +2 -0
- package/dist/{chunk-IHLUQ477.js → chunk-2TPHCOVE.js} +2 -2
- package/dist/{chunk-BV5ALJ53.js → chunk-2UKAVWUS.js} +2 -2
- package/dist/{chunk-TP7ZSHZ3.js → chunk-3EK647EG.js} +2 -2
- package/dist/chunk-3FCX7SWN.js +2 -0
- package/dist/chunk-3FCX7SWN.js.map +1 -0
- package/dist/{chunk-QXTTO2MJ.js → chunk-3YKLEDVY.js} +2 -2
- package/dist/{chunk-OHQRA2NZ.js → chunk-43UKWTHS.js} +2 -2
- package/dist/{chunk-FKM2NCIV.js → chunk-4HVLMGRA.js} +2 -2
- package/dist/chunk-4TJ2QZ7P.js +2 -0
- package/dist/chunk-4TJ2QZ7P.js.map +1 -0
- package/dist/{chunk-NMDURBYL.js → chunk-5RFDYBDY.js} +2 -2
- package/dist/chunk-6CASSN2Z.js +2 -0
- package/dist/{chunk-CIVW6O46.js → chunk-6IFPFK23.js} +2 -2
- package/dist/{chunk-X5LRTFCO.js → chunk-7RC7EB47.js} +2 -2
- package/dist/{chunk-MSCROI55.js → chunk-AGUAPUCU.js} +2 -2
- package/dist/{chunk-F7E2ENZH.js → chunk-BKVBDV6E.js} +2 -2
- package/dist/{chunk-363GGPXU.js → chunk-BMFFLDYL.js} +2 -2
- package/dist/{chunk-VFN7G6LL.js → chunk-BOWNQTTR.js} +2 -2
- package/dist/{chunk-RV4IDUEI.js → chunk-BWMATZIU.js} +2 -2
- package/dist/{chunk-APHY5GJ6.js → chunk-BZ5XEZCL.js} +2 -2
- package/dist/{chunk-FJL46ZTU.js → chunk-CB7T2SPX.js} +2 -2
- package/dist/{chunk-FVOZEZJP.js → chunk-CE4ZEIWI.js} +2 -2
- package/dist/{chunk-RBVGOVSD.js → chunk-CWHIIHQP.js} +2 -2
- package/dist/chunk-DG3T5KLP.js +2 -0
- package/dist/chunk-DG3T5KLP.js.map +1 -0
- package/dist/chunk-DZGLLSY7.js +2 -0
- package/dist/chunk-DZGLLSY7.js.map +1 -0
- package/dist/chunk-E6256SK7.js +2 -0
- package/dist/chunk-E6256SK7.js.map +1 -0
- package/dist/{chunk-GVK4VLLD.js → chunk-EPLPD54O.js} +2 -2
- package/dist/{chunk-XFPUH6H2.js → chunk-FD2FTALC.js} +2 -2
- package/dist/{chunk-YV2MRBXB.js → chunk-GSSC5OVG.js} +2 -2
- package/dist/{chunk-MKSMTFPZ.js → chunk-HCJP6RDC.js} +2 -2
- package/dist/{chunk-AB3I4P3N.js → chunk-HPBYZOPP.js} +2 -2
- package/dist/{chunk-XQIVHGI3.js → chunk-HRK4FJGT.js} +2 -2
- package/dist/{chunk-BQ5A22TW.js → chunk-I3J7LKY3.js} +2 -2
- package/dist/chunk-I4CH573Y.js +2 -0
- package/dist/chunk-I4CH573Y.js.map +1 -0
- package/dist/{chunk-HO7BGGLQ.js → chunk-IAIHITHL.js} +2 -2
- package/dist/{chunk-CNGXYZQI.js → chunk-JHMIAK67.js} +2 -2
- package/dist/chunk-JRUJLG27.js +2 -0
- package/dist/{chunk-65ZDTC36.js.map → chunk-JRUJLG27.js.map} +1 -1
- package/dist/{chunk-UV242U4J.js → chunk-JYYCK5IN.js} +2 -2
- package/dist/{chunk-N4AO3L3N.js → chunk-K6WWMYKM.js} +2 -2
- package/dist/{chunk-HPA2A2WQ.js → chunk-L622FFV6.js} +2 -2
- package/dist/chunk-LHEF2FN7.js +2 -0
- package/dist/chunk-LHEF2FN7.js.map +1 -0
- package/dist/{chunk-WALC3PW7.js → chunk-MKT4MPUT.js} +2 -2
- package/dist/{chunk-XI6P2XA7.js → chunk-NFLKVFAD.js} +2 -2
- package/dist/{chunk-4SGF6UNL.js → chunk-NKPRRBFG.js} +2 -2
- package/dist/chunk-OPQTTZBK.js +2 -0
- package/dist/chunk-OPQTTZBK.js.map +1 -0
- package/dist/{chunk-A6KKKCLW.js → chunk-P4GE72PQ.js} +2 -2
- package/dist/chunk-PPY77NYV.js +2 -0
- package/dist/chunk-PPY77NYV.js.map +1 -0
- package/dist/{chunk-BYAU5GDU.js → chunk-Q5LU2ZBL.js} +2 -2
- package/dist/{chunk-LLGY2ZUZ.js → chunk-QE62LRON.js} +2 -2
- package/dist/{chunk-SLBEVNBG.js → chunk-RE2IHPDB.js} +2 -2
- package/dist/chunk-RXP4X2CU.js +2 -0
- package/dist/chunk-RXP4X2CU.js.map +1 -0
- package/dist/chunk-TSPDJUGG.js +2 -0
- package/dist/chunk-TSPDJUGG.js.map +1 -0
- package/dist/{chunk-JTKKY7II.js → chunk-TUJXQF4Q.js} +2 -2
- package/dist/{chunk-QW6TETWW.js → chunk-UBYT2TI4.js} +2 -2
- package/dist/{chunk-7G35F5CI.js → chunk-UP27IEE4.js} +2 -2
- package/dist/{chunk-5MXQRMNN.js → chunk-VON7RTMD.js} +2 -2
- package/dist/{chunk-YRC6EEM3.js → chunk-XGECMN4V.js} +2 -2
- package/dist/{chunk-6SB4KOSY.js → chunk-Y7NHXFRX.js} +2 -2
- package/dist/{chunk-ZHRMPK42.js → chunk-YAJJJ2JV.js} +2 -2
- package/dist/{chunk-ZHRMPK42.js.map → chunk-YAJJJ2JV.js.map} +1 -1
- package/dist/chunk-YHP23JNL.js +2 -0
- package/dist/chunk-YHP23JNL.js.map +1 -0
- package/dist/{chunk-UY2IFS7S.js → chunk-Z7A4LTSB.js} +2 -2
- package/dist/{chunk-E6NEMSIG.js → chunk-ZURHNW3D.js} +2 -2
- package/dist/{chunk-UCVXGG6B.js → chunk-ZYLVMO7E.js} +2 -2
- package/dist/default-components.d.ts +2 -2
- package/dist/default-components.js +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
- package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -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 +3 -3
- package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
- package/dist/flows/ContractAmendment/hooks.js +1 -1
- package/dist/flows/ContractAmendment/index.d.ts +3 -3
- package/dist/flows/ContractAmendment/index.js +1 -1
- package/dist/flows/ContractAmendment/types.d.ts +2 -2
- package/dist/flows/ContractAmendment/utils.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +8 -6
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/api.d.ts +40 -4
- package/dist/flows/ContractorOnboarding/api.js +1 -1
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
- package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ChooseAlternativePlanStep.d.ts +29 -0
- package/dist/flows/ContractorOnboarding/components/ChooseAlternativePlanStep.js +2 -0
- package/dist/flows/ContractorOnboarding/components/ChooseAlternativePlanStep.js.map +1 -0
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +8 -6
- package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractPreviewHeader.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStatement.d.ts +2 -2
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +8 -6
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +7 -5
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
- package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.d.ts +8 -6
- package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.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 +8 -6
- package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
- package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/StatementOfWorkDisclaimer.js +1 -1
- package/dist/flows/ContractorOnboarding/constants.d.ts +4 -1
- package/dist/flows/ContractorOnboarding/constants.js +1 -1
- package/dist/flows/ContractorOnboarding/context.d.ts +12 -8
- package/dist/flows/ContractorOnboarding/hooks.d.ts +7 -5
- package/dist/flows/ContractorOnboarding/hooks.js +1 -1
- package/dist/flows/ContractorOnboarding/index.d.ts +8 -7
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/ContractorOnboarding/jsfModify.d.ts +10 -7
- package/dist/flows/ContractorOnboarding/jsfModify.js +1 -1
- package/dist/flows/ContractorOnboarding/json-schemas/chooseAlternativePlanStep.d.ts +23 -0
- package/dist/flows/ContractorOnboarding/json-schemas/chooseAlternativePlanStep.js +2 -0
- package/dist/flows/ContractorOnboarding/json-schemas/chooseAlternativePlanStep.js.map +1 -0
- package/dist/flows/ContractorOnboarding/types.d.ts +7 -5
- package/dist/flows/ContractorOnboarding/utils.d.ts +37 -2
- package/dist/flows/ContractorOnboarding/utils.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
- package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
- package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
- package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +2 -2
- package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
- package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +2 -2
- package/dist/flows/CostCalculator/api.d.ts +2 -2
- 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 +3 -3
- package/dist/flows/CostCalculator/hooks.d.ts +3 -3
- package/dist/flows/CostCalculator/hooks.js +1 -1
- package/dist/flows/CostCalculator/index.d.ts +3 -3
- package/dist/flows/CostCalculator/index.js +1 -1
- package/dist/flows/CostCalculator/types.d.ts +2 -2
- package/dist/flows/CostCalculator/utils.d.ts +3 -3
- package/dist/flows/CostCalculator/utils.js +1 -1
- package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
- package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
- package/dist/flows/Onboarding/api.d.ts +4 -4
- 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 +4 -4
- package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
- package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
- package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
- package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -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 +4 -4
- package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
- package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
- package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
- package/dist/flows/Onboarding/context.d.ts +6 -6
- package/dist/flows/Onboarding/hooks.d.ts +4 -4
- package/dist/flows/Onboarding/hooks.js +1 -1
- package/dist/flows/Onboarding/index.d.ts +4 -4
- package/dist/flows/Onboarding/index.js +1 -1
- package/dist/flows/Onboarding/types.d.ts +4 -4
- package/dist/flows/Onboarding/utils.d.ts +4 -4
- package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
- package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
- package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
- package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
- package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
- package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
- package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
- package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
- package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
- package/dist/flows/Termination/TerminationFlow.js +1 -1
- package/dist/flows/Termination/TerminationForm.d.ts +4 -4
- package/dist/flows/Termination/TerminationForm.js +1 -1
- package/dist/flows/Termination/api.d.ts +5 -5
- 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 +6 -6
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +6 -6
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
- package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +6 -6
- package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
- package/dist/flows/Termination/context.d.ts +4 -4
- package/dist/flows/Termination/hooks.d.ts +4 -4
- package/dist/flows/Termination/hooks.js +1 -1
- package/dist/flows/Termination/index.d.ts +6 -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 +4 -4
- package/dist/flows/Termination/json-schemas/schema.js +1 -1
- package/dist/flows/Termination/types.d.ts +4 -4
- package/dist/flows/Termination/utils.d.ts +4 -4
- package/dist/flows/types.d.ts +2 -2
- package/dist/flows/useStepState.d.ts +1 -0
- package/dist/flows/useStepState.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +30 -12
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +3 -3
- package/dist/internals.js +1 -1
- package/dist/{mutations-D9uKrVyZ.d.ts → mutations-Cviv4PN1.d.ts} +1 -1
- package/dist/{remoteFlows-C_jytkce.d.ts → remoteFlows-C41d3S6K.d.ts} +2 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/{types-DFiXoRxe.d.ts → types-B3j6CHqF.d.ts} +21 -8
- package/dist/{types-CReB0W2v.d.ts → types-C2Jm8UUR.d.ts} +1 -1
- package/dist/{types-CJGBgp6W.d.ts → types-DGsUn7MK.d.ts} +2 -2
- package/dist/{types-Bt9myqn7.d.ts → types-SHZYNK7B.d.ts} +3 -3
- package/dist/{types.gen-CU3zhQBc.d.ts → types.gen-f6p9DLeW.d.ts} +1 -1
- package/dist/{utils-CiZCA68j.d.ts → utils-4FdXJdn7.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/DatePickerFieldDefault-GWFIBBMB.js +0 -2
- package/dist/RadioGroupFieldDefault-M5CIDW2Y.js +0 -2
- package/dist/chunk-4MPMEB2P.js +0 -2
- package/dist/chunk-4MPMEB2P.js.map +0 -1
- package/dist/chunk-5BRMLRS7.js +0 -2
- package/dist/chunk-5BRMLRS7.js.map +0 -1
- package/dist/chunk-65ZDTC36.js +0 -2
- package/dist/chunk-6OKI4CS4.js +0 -2
- package/dist/chunk-6OKI4CS4.js.map +0 -1
- package/dist/chunk-DG7WU355.js +0 -2
- package/dist/chunk-DG7WU355.js.map +0 -1
- package/dist/chunk-O3G6HQ3B.js +0 -2
- package/dist/chunk-O3G6HQ3B.js.map +0 -1
- package/dist/chunk-VQZ6JMPG.js +0 -2
- package/dist/chunk-VQZ6JMPG.js.map +0 -1
- package/dist/chunk-Y6VOAJG5.js +0 -2
- package/dist/chunk-Y6VOAJG5.js.map +0 -1
- package/dist/chunk-ZF56VYDM.js +0 -2
- package/dist/chunk-ZF56VYDM.js.map +0 -1
- package/dist/chunk-ZVHB54PM.js +0 -2
- package/dist/chunk-ZVHB54PM.js.map +0 -1
- package/dist/chunk-ZVUQDK2E.js +0 -2
- /package/dist/{CountryFieldDefault-LOWXZDAD.js.map → CountryFieldDefault-SFTKBP6V.js.map} +0 -0
- /package/dist/{DatePickerFieldDefault-GWFIBBMB.js.map → DatePickerFieldDefault-GHHRA5MC.js.map} +0 -0
- /package/dist/{RadioGroupFieldDefault-M5CIDW2Y.js.map → RadioGroupFieldDefault-WSWNB62Y.js.map} +0 -0
- /package/dist/{chunk-IHLUQ477.js.map → chunk-2TPHCOVE.js.map} +0 -0
- /package/dist/{chunk-BV5ALJ53.js.map → chunk-2UKAVWUS.js.map} +0 -0
- /package/dist/{chunk-TP7ZSHZ3.js.map → chunk-3EK647EG.js.map} +0 -0
- /package/dist/{chunk-QXTTO2MJ.js.map → chunk-3YKLEDVY.js.map} +0 -0
- /package/dist/{chunk-OHQRA2NZ.js.map → chunk-43UKWTHS.js.map} +0 -0
- /package/dist/{chunk-FKM2NCIV.js.map → chunk-4HVLMGRA.js.map} +0 -0
- /package/dist/{chunk-NMDURBYL.js.map → chunk-5RFDYBDY.js.map} +0 -0
- /package/dist/{chunk-ZVUQDK2E.js.map → chunk-6CASSN2Z.js.map} +0 -0
- /package/dist/{chunk-CIVW6O46.js.map → chunk-6IFPFK23.js.map} +0 -0
- /package/dist/{chunk-X5LRTFCO.js.map → chunk-7RC7EB47.js.map} +0 -0
- /package/dist/{chunk-MSCROI55.js.map → chunk-AGUAPUCU.js.map} +0 -0
- /package/dist/{chunk-F7E2ENZH.js.map → chunk-BKVBDV6E.js.map} +0 -0
- /package/dist/{chunk-363GGPXU.js.map → chunk-BMFFLDYL.js.map} +0 -0
- /package/dist/{chunk-VFN7G6LL.js.map → chunk-BOWNQTTR.js.map} +0 -0
- /package/dist/{chunk-RV4IDUEI.js.map → chunk-BWMATZIU.js.map} +0 -0
- /package/dist/{chunk-APHY5GJ6.js.map → chunk-BZ5XEZCL.js.map} +0 -0
- /package/dist/{chunk-FJL46ZTU.js.map → chunk-CB7T2SPX.js.map} +0 -0
- /package/dist/{chunk-FVOZEZJP.js.map → chunk-CE4ZEIWI.js.map} +0 -0
- /package/dist/{chunk-RBVGOVSD.js.map → chunk-CWHIIHQP.js.map} +0 -0
- /package/dist/{chunk-GVK4VLLD.js.map → chunk-EPLPD54O.js.map} +0 -0
- /package/dist/{chunk-XFPUH6H2.js.map → chunk-FD2FTALC.js.map} +0 -0
- /package/dist/{chunk-YV2MRBXB.js.map → chunk-GSSC5OVG.js.map} +0 -0
- /package/dist/{chunk-MKSMTFPZ.js.map → chunk-HCJP6RDC.js.map} +0 -0
- /package/dist/{chunk-AB3I4P3N.js.map → chunk-HPBYZOPP.js.map} +0 -0
- /package/dist/{chunk-XQIVHGI3.js.map → chunk-HRK4FJGT.js.map} +0 -0
- /package/dist/{chunk-BQ5A22TW.js.map → chunk-I3J7LKY3.js.map} +0 -0
- /package/dist/{chunk-HO7BGGLQ.js.map → chunk-IAIHITHL.js.map} +0 -0
- /package/dist/{chunk-CNGXYZQI.js.map → chunk-JHMIAK67.js.map} +0 -0
- /package/dist/{chunk-UV242U4J.js.map → chunk-JYYCK5IN.js.map} +0 -0
- /package/dist/{chunk-N4AO3L3N.js.map → chunk-K6WWMYKM.js.map} +0 -0
- /package/dist/{chunk-HPA2A2WQ.js.map → chunk-L622FFV6.js.map} +0 -0
- /package/dist/{chunk-WALC3PW7.js.map → chunk-MKT4MPUT.js.map} +0 -0
- /package/dist/{chunk-XI6P2XA7.js.map → chunk-NFLKVFAD.js.map} +0 -0
- /package/dist/{chunk-4SGF6UNL.js.map → chunk-NKPRRBFG.js.map} +0 -0
- /package/dist/{chunk-A6KKKCLW.js.map → chunk-P4GE72PQ.js.map} +0 -0
- /package/dist/{chunk-BYAU5GDU.js.map → chunk-Q5LU2ZBL.js.map} +0 -0
- /package/dist/{chunk-LLGY2ZUZ.js.map → chunk-QE62LRON.js.map} +0 -0
- /package/dist/{chunk-SLBEVNBG.js.map → chunk-RE2IHPDB.js.map} +0 -0
- /package/dist/{chunk-JTKKY7II.js.map → chunk-TUJXQF4Q.js.map} +0 -0
- /package/dist/{chunk-QW6TETWW.js.map → chunk-UBYT2TI4.js.map} +0 -0
- /package/dist/{chunk-7G35F5CI.js.map → chunk-UP27IEE4.js.map} +0 -0
- /package/dist/{chunk-5MXQRMNN.js.map → chunk-VON7RTMD.js.map} +0 -0
- /package/dist/{chunk-YRC6EEM3.js.map → chunk-XGECMN4V.js.map} +0 -0
- /package/dist/{chunk-6SB4KOSY.js.map → chunk-Y7NHXFRX.js.map} +0 -0
- /package/dist/{chunk-UY2IFS7S.js.map → chunk-Z7A4LTSB.js.map} +0 -0
- /package/dist/{chunk-E6NEMSIG.js.map → chunk-ZURHNW3D.js.map} +0 -0
- /package/dist/{chunk-UCVXGG6B.js.map → chunk-ZYLVMO7E.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/ContractorOnboarding/hooks.tsx","../src/common/api/legal-entities.ts","../src/common/api/identity.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\nimport { FieldValues } from 'react-hook-form';\nimport omit from 'lodash.omit';\nimport { $TSFixMe, JSFFields } from '@/src/types/remoteFlows';\nimport {\n CreateContractDocument,\n Employment,\n EmploymentCreateParams,\n} from '@/src/client/types.gen';\nimport {\n getInitialValues,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport { ValidationResult } from '@remoteoss/remote-json-schema-form-kit';\nimport {\n useContractorOnboardingDetailsSchema,\n useCreateContractorContractDocument,\n useGetContractDocumentSignatureSchema,\n usePostManageContractorSubscriptions,\n useContractorSubscriptionSchemaField,\n useGetShowContractDocument,\n useSignContractDocument,\n useUpdateUKandSaudiFields,\n useGetIR35File,\n useGetContractDocuments,\n useGetEligibilityQuestionnaire,\n usePostCreateEligibilityQuestionnaire,\n usePostManageContractorCorSubscription,\n useDeleteContractorCorSubscription,\n useCountriesSchemaField,\n useGetChooseAlternativePlan,\n} from '@/src/flows/ContractorOnboarding/api';\nimport { ContractorOnboardingFlowProps } from '@/src/flows/ContractorOnboarding/types';\nimport {\n buildSteps,\n calculateProvisionalStartDateDescription,\n reviewStepAllowedEmploymentStatus,\n disabledInviteButtonEmploymentStatus,\n StepKeys,\n} from '@/src/flows/ContractorOnboarding/utils';\nimport {\n useCreateEmployment,\n useJSONSchemaForm,\n useUpdateEmployment,\n} from '@/src/flows/Onboarding/api';\nimport { FlowOptions, JSFModify, JSONSchemaFormType } from '@/src/flows/types';\nimport { useStepState } from '@/src/flows/useStepState';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { createStructuredError, prettifyFormValues } from '@/src/lib/utils';\nimport { JSFFieldset, Meta } from '@/src/types/remoteFlows';\nimport {\n contractorStandardProductIdentifier,\n contractorPlusProductIdentifier,\n corProductIdentifier,\n} from '@/src/flows/ContractorOnboarding/constants';\nimport {\n buildBasicInformationJsfModify,\n buildContractDetailsJsfModify,\n buildContractPreviewJsfModify,\n} from '@/src/flows/ContractorOnboarding/jsfModify';\nimport { useUploadFile } from '@/src/common/api/files';\nimport { dataURLtoFile } from '@/src/lib/files';\nimport { useEmploymentQuery } from '@/src/common/api/employment';\nimport { useDefaultLegalEntity } from '@/src/common/api/legal-entities';\n\ntype useContractorOnboardingProps = Omit<\n ContractorOnboardingFlowProps,\n 'render'\n>;\n\nconst stepToFormSchemaMap: Record<StepKeys, JSONSchemaFormType | null> = {\n select_country: null,\n basic_information: 'employment_basic_information',\n contract_details: null,\n eligibility_questionnaire: null,\n pricing_plan: null,\n choose_alternative_plan: null,\n contract_preview: null,\n review: null,\n};\n\nconst jsonSchemaToEmployment: Partial<\n Record<JSONSchemaFormType, keyof Employment>\n> = {\n employment_basic_information: 'basic_information',\n};\n\nexport const useContractorOnboarding = ({\n countryCode,\n externalId,\n employmentId,\n skipSteps,\n options,\n initialValues: onboardingInitialValues,\n}: useContractorOnboardingProps) => {\n const excludeProducts = options?.excludeProducts || [];\n const [internalCountryCode, setInternalCountryCode] = useState<string | null>(\n countryCode || null,\n );\n const [internalEmploymentId, setInternalEmploymentId] = useState<\n string | undefined\n >(employmentId);\n const [internalContractDocumentId, setInternalContractDocumentId] = useState<\n string | undefined\n >(undefined);\n const fieldsMetaRef = useRef<{\n select_country: Meta;\n basic_information: Meta;\n contract_details: Meta;\n contract_preview: Meta;\n pricing_plan: Meta;\n eligibility_questionnaire: Meta;\n choose_alternative_plan: Meta;\n }>({\n select_country: {},\n basic_information: {},\n contract_details: {},\n contract_preview: {},\n pricing_plan: {},\n eligibility_questionnaire: {},\n choose_alternative_plan: {},\n });\n\n const [selectedProduct, setSelectedProduct] = useState<string | undefined>(\n undefined,\n );\n\n const [includeEligibilityQuestionnaire, setIncludeEligibilityQuestionnaire] =\n useState<boolean>(false);\n\n const [includeChooseAlternativePlan, setIncludeChooseAlternativePlan] =\n useState<boolean>(false);\n\n const [pendingNavigationStep, setPendingNavigationStep] =\n useState<StepKeys | null>(null);\n\n const { steps, stepsArray } = useMemo(\n () =>\n buildSteps({\n includeSelectCountry: !skipSteps?.includes('select_country'),\n includeEligibilityQuestionnaire: includeEligibilityQuestionnaire,\n }),\n [includeEligibilityQuestionnaire, skipSteps],\n );\n\n const {\n fieldValues,\n stepState,\n setFieldValues,\n previousStep,\n nextStep,\n goToStep,\n setStepValues,\n } = useStepState(steps);\n\n useEffect(() => {\n if (pendingNavigationStep) {\n // Now steps have been updated\n goToStep(pendingNavigationStep);\n setPendingNavigationStep(null);\n }\n }, [pendingNavigationStep, goToStep]);\n\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n refetch: refetchEmployment,\n } = useEmploymentQuery({\n employmentId: internalEmploymentId as string,\n queryParams: { exclude_files: true },\n });\n\n const defaultLegalEntity = useDefaultLegalEntity();\n\n const { status: employmentStatus } = employment || {};\n\n const isEmploymentReadOnly =\n employmentStatus &&\n reviewStepAllowedEmploymentStatus.includes(employmentStatus);\n\n const canInvite =\n employmentStatus &&\n !disabledInviteButtonEmploymentStatus.includes(employmentStatus);\n\n const invitedStatus: 'invited' | 'not_invited' = useMemo(() => {\n const isInvited = employmentStatus === 'invited';\n\n return isInvited ? 'invited' : 'not_invited';\n }, [employmentStatus]);\n\n const createEmploymentMutation = useCreateEmployment();\n const updateEmploymentMutation = useUpdateEmployment(\n internalCountryCode as string,\n options,\n );\n const createContractorContractDocumentMutation =\n useCreateContractorContractDocument();\n const uploadFileMutation = useUploadFile();\n const { mutateAsync: updateUKandSaudiFieldsMutation } =\n useUpdateUKandSaudiFields(\n createContractorContractDocumentMutation,\n uploadFileMutation,\n fieldValues,\n );\n const createEligibilityQuestionnaireMutation =\n usePostCreateEligibilityQuestionnaire();\n const manageContractorCorSubscriptionMutation =\n usePostManageContractorCorSubscription();\n\n const { mutateAsyncOrThrow: updateEmploymentMutationAsync } =\n mutationToPromise(updateEmploymentMutation);\n const signContractDocumentMutation = useSignContractDocument();\n const manageContractorSubscriptionMutation =\n usePostManageContractorSubscriptions();\n const deleteContractorCorSubscriptionMutation =\n useDeleteContractorCorSubscription();\n\n const { mutateAsyncOrThrow: createEmploymentMutationAsync } =\n mutationToPromise(createEmploymentMutation);\n\n const { mutateAsyncOrThrow: createContractorContractDocumentMutationAsync } =\n mutationToPromise(createContractorContractDocumentMutation);\n\n const { mutateAsyncOrThrow: signContractDocumentMutationAsync } =\n mutationToPromise(signContractDocumentMutation);\n\n const { mutateAsyncOrThrow: manageContractorSubscriptionMutationAsync } =\n mutationToPromise(manageContractorSubscriptionMutation);\n\n const { mutateAsyncOrThrow: createEligibilityQuestionnaireMutationAsync } =\n mutationToPromise(createEligibilityQuestionnaireMutation);\n\n const { mutateAsyncOrThrow: manageContractorCorSubscriptionMutationAsync } =\n mutationToPromise(manageContractorCorSubscriptionMutation);\n\n const { mutateAsyncOrThrow: deleteContractorCorSubscriptionMutationAsync } =\n mutationToPromise(deleteContractorCorSubscriptionMutation);\n\n // if the employment is loaded, country code has not been set yet\n // we set the internal country code with the employment country code\n if (employmentId && employment?.country?.code && !internalCountryCode) {\n setInternalCountryCode(employment.country.code);\n }\n\n const {\n selectCountryForm,\n isLoading: isLoadingCountries,\n countries,\n } = useCountriesSchemaField({\n jsfModify: options?.jsfModify?.select_country,\n });\n\n const isPricingPlanEnabled =\n stepState.currentStep.name === 'pricing_plan' ||\n (Boolean(employmentId) && isEmploymentReadOnly);\n\n const {\n form: selectContractorSubscriptionForm,\n isLoading: isLoadingContractorSubscriptions,\n contractorSubscriptions,\n refetch: refetchContractorSubscriptions,\n isEligibilityQuestionnaireBlocked,\n } = useContractorSubscriptionSchemaField(internalEmploymentId as string, {\n jsonSchemaVersion: options?.jsonSchemaVersion,\n queryOptions: {\n enabled: isPricingPlanEnabled,\n },\n excludeProducts: excludeProducts,\n jsfModify: options?.jsfModify?.pricing_plan,\n });\n\n const hasEligibilityQuestionnaireSubmitted = useMemo(() => {\n return Boolean(\n contractorSubscriptions?.find(\n (subscription) => subscription.product.short_name === 'COR',\n )?.eligibility_questionnaire?.submitted_at,\n );\n }, [contractorSubscriptions]);\n\n useEffect(() => {\n if (hasEligibilityQuestionnaireSubmitted) {\n setIncludeEligibilityQuestionnaire(false);\n return;\n } else if (selectedProduct === corProductIdentifier) {\n setIncludeEligibilityQuestionnaire(true);\n } else {\n setIncludeEligibilityQuestionnaire(false);\n }\n }, [hasEligibilityQuestionnaireSubmitted, selectedProduct]);\n\n const eligibilityAnswers = useMemo(() => {\n return contractorSubscriptions?.find(\n (subscription) => subscription.product.short_name === 'COR',\n )?.eligibility_questionnaire?.responses;\n }, [contractorSubscriptions]);\n\n const formType =\n stepToFormSchemaMap[stepState.currentStep.name] ||\n 'contractor_basic_information';\n const employmentKey = jsonSchemaToEmployment[formType] as keyof Employment;\n const serverEmploymentData = (employment?.[employmentKey] || {}) as Record<\n string,\n unknown\n >;\n\n const useJSONSchema = ({\n form,\n options: jsonSchemaOptions = {},\n query = {},\n }: {\n form: JSONSchemaFormType;\n options?: {\n jsfModify?: JSFModify;\n queryOptions?: { enabled?: boolean };\n jsonSchemaVersion?: FlowOptions['jsonSchemaVersion'];\n };\n query?: Record<string, string>;\n }) => {\n const hasUserEnteredAnyValues = Object.keys(fieldValues).length > 0;\n // when you write on the fields, the values are stored in the fieldValues state\n // when values are stored in the stepState is when the user has navigated to the step\n // and then we have the values from the server and the onboardingInitialValues that the user can inject,\n const mergedFormValues = hasUserEnteredAnyValues\n ? {\n ...onboardingInitialValues,\n ...stepState.values?.[stepState.currentStep.name], // Restore values for the current step\n ...fieldValues,\n }\n : {\n ...onboardingInitialValues,\n ...serverEmploymentData,\n };\n\n return useJSONSchemaForm({\n countryCode: internalCountryCode as string,\n form: form,\n fieldValues: mergedFormValues,\n query,\n options: {\n ...jsonSchemaOptions,\n queryOptions: {\n enabled: jsonSchemaOptions.queryOptions?.enabled ?? true,\n },\n },\n });\n };\n\n const isBasicInformationDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'basic_information' ||\n Boolean(employmentId)),\n );\n\n const isContractorOnboardingDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'contract_details' ||\n Boolean(employmentId)),\n );\n\n const isIR35FileEnabled = Boolean(\n internalCountryCode === 'GBR' &&\n employmentId &&\n stepState.currentStep.name === 'basic_information',\n );\n\n const { data: ir35File, isLoading: isLoadingIR35File } = useGetIR35File(\n employmentId as string,\n {\n enabled: isIR35FileEnabled,\n },\n );\n\n const { data: contractDocuments, isLoading: isLoadingContractDocuments } =\n useGetContractDocuments(employmentId as string, {\n enabled: Boolean(employmentId),\n });\n\n useEffect(() => {\n if (\n contractDocuments &&\n contractDocuments.length > 0 &&\n !internalContractDocumentId\n ) {\n setInternalContractDocumentId(contractDocuments[0].id);\n }\n }, [contractDocuments, internalContractDocumentId]);\n\n const countryName = useMemo(() => {\n return countries?.find((country) => country.value === internalCountryCode)\n ?.label;\n }, [countries, internalCountryCode]);\n\n const {\n data: basicInformationForm,\n isLoading: isLoadingBasicInformationForm,\n } = useJSONSchema({\n form: 'contractor_basic_information',\n options: {\n jsfModify: buildBasicInformationJsfModify(\n internalCountryCode as string,\n countryName,\n options,\n ),\n queryOptions: {\n enabled: isBasicInformationDetailsEnabled,\n },\n },\n });\n\n const descriptionProvisionalStartDate = useMemo(() => {\n return calculateProvisionalStartDateDescription(\n employment?.basic_information?.provisional_start_date as string,\n fieldValues?.service_duration?.provisional_start_date as string,\n );\n }, [\n employment?.basic_information?.provisional_start_date,\n fieldValues?.service_duration?.provisional_start_date,\n ]);\n\n /**\n * When the user selects COR, the data isn't saved yet in the BE\n * We need to use the internalState to know what has happened\n */\n const selectedPricingPlan = useMemo(() => {\n const subscriptions = {\n standard: contractorStandardProductIdentifier,\n plus: contractorPlusProductIdentifier,\n cor: corProductIdentifier,\n };\n\n // HIGHEST PRIORITY: Current form value (user is actively selecting)\n if (fieldValues.subscription) {\n return fieldValues.subscription;\n }\n\n // SECOND: Previously submitted value in this session\n const subscription = stepState.values?.pricing_plan?.subscription;\n if (subscription && !isEligibilityQuestionnaireBlocked) {\n return subscription;\n }\n\n // THIRD: Backend state (eligibility submitted or employment contractor_type)\n if (\n hasEligibilityQuestionnaireSubmitted &&\n !isEligibilityQuestionnaireBlocked\n ) {\n return corProductIdentifier;\n }\n\n // Fourth: If the eligibility questionnaire is blocked and has been submitted, return the standard product\n if (\n isEligibilityQuestionnaireBlocked &&\n hasEligibilityQuestionnaireSubmitted\n ) {\n return contractorStandardProductIdentifier;\n }\n\n // FALLBACK: Employment contractor_type or default\n return (\n subscriptions[\n employment?.contractor_type as keyof typeof subscriptions\n ] || contractorStandardProductIdentifier\n );\n }, [\n fieldValues,\n stepState.values,\n hasEligibilityQuestionnaireSubmitted,\n employment?.contractor_type,\n isEligibilityQuestionnaireBlocked,\n ]);\n\n useEffect(() => {\n if (selectedPricingPlan && selectedPricingPlan !== selectedProduct) {\n setSelectedProduct(selectedPricingPlan);\n }\n }, [selectedPricingPlan, selectedProduct]);\n\n const eligibilityFields = useMemo(() => {\n return {\n ...eligibilityAnswers,\n ...onboardingInitialValues,\n ...stepState.values?.eligibility_questionnaire,\n ...fieldValues,\n };\n }, [\n eligibilityAnswers,\n onboardingInitialValues,\n stepState.values?.eligibility_questionnaire,\n fieldValues,\n ]);\n\n const isEligibilityQuestionnaireEnabled = useMemo(() => {\n return (\n (selectedPricingPlan === corProductIdentifier &&\n stepState.currentStep.name === 'eligibility_questionnaire') ||\n (Boolean(employmentId) &&\n isEmploymentReadOnly &&\n selectedPricingPlan === corProductIdentifier)\n );\n }, [\n selectedPricingPlan,\n stepState.currentStep.name,\n employmentId,\n isEmploymentReadOnly,\n ]);\n\n const {\n data: eligibilityQuestionnaireForm,\n isLoading: isLoadingEligibilityQuestionnaire,\n } = useGetEligibilityQuestionnaire({\n options: {\n queryOptions: {\n enabled: isEligibilityQuestionnaireEnabled,\n },\n jsfModify: options?.jsfModify?.eligibility_questionnaire,\n },\n fieldValues: eligibilityFields,\n });\n\n const {\n form: chooseAlternativePlanForm,\n isLoading: isLoadingChooseAlternativePlan,\n } = useGetChooseAlternativePlan(internalEmploymentId as string, {\n jsfModify: options?.jsfModify?.choose_alternative_plan,\n queryOptions: {\n enabled: includeChooseAlternativePlan,\n },\n excludeProducts: excludeProducts,\n });\n\n const {\n data: contractorOnboardingDetailsForm,\n isLoading: isLoadingContractorOnboardingDetailsForm,\n } = useContractorOnboardingDetailsSchema({\n countryCode: internalCountryCode as string,\n fieldValues: fieldValues,\n employmentId: internalEmploymentId as string,\n options: {\n queryOptions: {\n enabled: isContractorOnboardingDetailsEnabled,\n },\n jsfModify: buildContractDetailsJsfModify(\n options?.jsfModify?.contract_details,\n descriptionProvisionalStartDate,\n selectedPricingPlan,\n fieldValues,\n ),\n },\n });\n\n const isSignatureSchemaEnabled = useMemo(() => {\n return (\n stepState.currentStep.name === 'contract_preview' ||\n (Boolean(employmentId) && isEmploymentReadOnly)\n );\n }, [stepState.currentStep.name, employmentId, isEmploymentReadOnly]);\n\n const { data: signatureSchemaForm } = useGetContractDocumentSignatureSchema({\n fieldValues: fieldValues,\n options: {\n queryOptions: {\n enabled: isSignatureSchemaEnabled,\n },\n jsfModify: buildContractPreviewJsfModify(options, fieldValues),\n },\n });\n\n const { data: documentPreviewPdf, isLoading: isLoadingDocumentPreviewForm } =\n useGetShowContractDocument({\n employmentId: internalEmploymentId as string,\n contractDocumentId: internalContractDocumentId as string,\n options: {\n queryOptions: {\n enabled: Boolean(internalContractDocumentId),\n },\n },\n });\n\n const stepFields: Record<StepKeys, JSFFields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n pricing_plan: selectContractorSubscriptionForm?.fields || [],\n eligibility_questionnaire: eligibilityQuestionnaireForm?.fields || [],\n choose_alternative_plan: chooseAlternativePlanForm?.fields || [],\n contract_details: contractorOnboardingDetailsForm?.fields || [],\n contract_preview: signatureSchemaForm?.fields || [],\n review: [],\n }),\n [\n selectCountryForm?.fields,\n basicInformationForm?.fields,\n selectContractorSubscriptionForm?.fields,\n contractorOnboardingDetailsForm?.fields,\n signatureSchemaForm?.fields,\n eligibilityQuestionnaireForm?.fields,\n chooseAlternativePlanForm?.fields,\n ],\n );\n\n const stepFieldsWithFlatFieldsets: Record<\n StepKeys,\n JSFFieldset | null | undefined\n > = {\n select_country: null,\n basic_information: basicInformationForm?.meta['x-jsf-fieldsets'],\n pricing_plan: null,\n contract_details: contractorOnboardingDetailsForm?.meta['x-jsf-fieldsets'],\n eligibility_questionnaire: null,\n choose_alternative_plan: null,\n contract_preview: null,\n review: null,\n };\n\n const {\n country,\n basic_information: employmentBasicInformation = {},\n contract_details: employmentContractDetails = {},\n } = employment || {};\n\n const employmentCountryCode = country?.code;\n\n const selectCountryInitialValues = useMemo(\n () =>\n getInitialValues(stepFields.select_country, {\n country: internalCountryCode || employmentCountryCode || '',\n }),\n [stepFields.select_country, internalCountryCode, employmentCountryCode],\n );\n\n // memoize file conversion to avoid re-converting the file on every render\n // noticed performance issues when not doing memoizing individually\n const convertedIr35File = useMemo(() => {\n if (!ir35File?.content) return null;\n return dataURLtoFile(ir35File.content as unknown as string, ir35File.name);\n }, [ir35File?.content, ir35File?.name]);\n\n const basicInformationInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentBasicInformation,\n ir35: employment?.contract_details?.ir_35,\n nationality_status: employment?.contract_details?.nationality,\n ...(convertedIr35File && {\n ir35_sds_file: [convertedIr35File],\n }),\n };\n\n return getInitialValues(stepFields.basic_information, initialValues);\n }, [\n onboardingInitialValues,\n employmentBasicInformation,\n employment?.contract_details?.ir_35,\n employment?.contract_details?.nationality,\n convertedIr35File,\n stepFields.basic_information,\n ]);\n\n const contractDetailsInitialValues = useMemo(() => {\n const hardcodedValues = {\n service_duration: {\n provisional_start_date:\n employmentBasicInformation.provisional_start_date,\n },\n };\n const initialValues = {\n ...hardcodedValues,\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_details, initialValues);\n }, [\n stepFields.contract_details,\n employmentContractDetails,\n onboardingInitialValues,\n employmentBasicInformation,\n ]);\n\n const contractPreviewInitialValues = useMemo(() => {\n const signature = documentPreviewPdf?.contract_document?.signatories?.find(\n (signatory) => signatory.type === 'company',\n );\n const initialValues = {\n ...onboardingInitialValues,\n signature: signature?.signature,\n };\n\n return getInitialValues(stepFields.contract_preview, initialValues);\n }, [\n stepFields.contract_preview,\n onboardingInitialValues,\n documentPreviewPdf,\n ]);\n\n const pricingPlanInitialValues = useMemo(() => {\n const preselectedPricingPlan = {\n subscription: selectedPricingPlan,\n };\n const initialValues = {\n ...preselectedPricingPlan,\n ...onboardingInitialValues,\n };\n\n return getInitialValues(stepFields.pricing_plan, initialValues);\n }, [stepFields.pricing_plan, onboardingInitialValues, selectedPricingPlan]);\n\n const eligibilityQuestionnaireInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...eligibilityAnswers,\n };\n return getInitialValues(\n stepFields.eligibility_questionnaire,\n initialValues,\n );\n }, [\n stepFields.eligibility_questionnaire,\n onboardingInitialValues,\n eligibilityAnswers,\n ]);\n\n const initialValues = useMemo(() => {\n return {\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: contractPreviewInitialValues,\n pricing_plan: pricingPlanInitialValues,\n eligibility_questionnaire: eligibilityQuestionnaireInitialValues,\n };\n }, [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n contractPreviewInitialValues,\n pricingPlanInitialValues,\n eligibilityQuestionnaireInitialValues,\n ]);\n\n const shouldHandleReadOnlyEmployment = Boolean(\n employmentId &&\n isEmploymentReadOnly &&\n stepState.currentStep.name !== 'review',\n );\n\n const initialLoading =\n isLoadingCountries ||\n isLoadingBasicInformationForm ||\n isLoadingEmployment ||\n isLoadingContractorOnboardingDetailsForm ||\n isLoadingContractorSubscriptions ||\n isLoadingDocumentPreviewForm ||\n isLoadingIR35File ||\n isLoadingContractDocuments ||\n isLoadingEligibilityQuestionnaire ||\n isLoadingChooseAlternativePlan;\n\n const isNavigatingToReview = useMemo(() => {\n return Boolean(\n shouldHandleReadOnlyEmployment &&\n !initialLoading &&\n Boolean(internalContractDocumentId) &&\n stepFields.basic_information.length > 0 &&\n stepFields.contract_details.length > 0 &&\n stepFields.contract_preview.length > 0,\n );\n }, [\n shouldHandleReadOnlyEmployment,\n initialLoading,\n internalContractDocumentId,\n stepFields.basic_information.length,\n stepFields.contract_details.length,\n stepFields.contract_preview.length,\n ]);\n\n useEffect(() => {\n if (isNavigatingToReview) {\n fieldsMetaRef.current = {\n select_country: prettifyFormValues(\n selectCountryInitialValues,\n stepFields.select_country,\n ),\n basic_information: prettifyFormValues(\n basicInformationInitialValues,\n stepFields.basic_information,\n ),\n contract_details: prettifyFormValues(\n contractDetailsInitialValues,\n stepFields.contract_details,\n ),\n contract_preview: prettifyFormValues(\n contractPreviewInitialValues,\n stepFields.contract_preview,\n ),\n pricing_plan: prettifyFormValues(\n pricingPlanInitialValues,\n stepFields.pricing_plan,\n ),\n eligibility_questionnaire: prettifyFormValues(\n eligibilityQuestionnaireInitialValues,\n stepFields.eligibility_questionnaire,\n ),\n // we don't need to tell the user about this values\n choose_alternative_plan: {},\n };\n\n setStepValues({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: contractPreviewInitialValues,\n pricing_plan: pricingPlanInitialValues,\n eligibility_questionnaire: eligibilityQuestionnaireInitialValues,\n choose_alternative_plan: {},\n review: {},\n });\n goToStep('review');\n }\n }, [\n isNavigatingToReview,\n goToStep,\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n setStepValues,\n stepFields.select_country,\n stepFields.basic_information,\n stepFields.contract_details,\n stepFields.pricing_plan,\n pricingPlanInitialValues,\n stepFields.contract_preview,\n contractPreviewInitialValues,\n stepFields.eligibility_questionnaire,\n eligibilityQuestionnaireInitialValues,\n ]);\n\n const goTo = (step: StepKeys) => {\n goToStep(step);\n };\n\n const parseFormValues = async (values: FieldValues) => {\n if (selectCountryForm && stepState.currentStep.name === 'select_country') {\n return values;\n }\n\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n return await parseJSFToValidate(values, basicInformationForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n return await parseJSFToValidate(\n values,\n contractorOnboardingDetailsForm?.fields,\n {\n isPartialValidation: false,\n },\n );\n }\n\n if (\n signatureSchemaForm &&\n stepState.currentStep.name === 'contract_preview'\n ) {\n return await parseJSFToValidate(values, signatureSchemaForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n selectContractorSubscriptionForm &&\n stepState.currentStep.name === 'pricing_plan'\n ) {\n return await parseJSFToValidate(\n values,\n selectContractorSubscriptionForm?.fields,\n {\n isPartialValidation: false,\n },\n );\n }\n\n if (\n eligibilityQuestionnaireForm &&\n stepState.currentStep.name === 'eligibility_questionnaire'\n ) {\n return await parseJSFToValidate(\n values,\n eligibilityQuestionnaireForm?.fields,\n {\n isPartialValidation: false,\n },\n );\n }\n\n if (\n chooseAlternativePlanForm &&\n stepState.currentStep.name === 'choose_alternative_plan'\n ) {\n return await parseJSFToValidate(\n values,\n chooseAlternativePlanForm?.fields,\n {\n isPartialValidation: false,\n },\n );\n }\n\n return {};\n };\n\n async function onSubmit(values: FieldValues) {\n const currentStepName = stepState.currentStep.name;\n if (currentStepName in fieldsMetaRef.current) {\n fieldsMetaRef.current[\n currentStepName as keyof typeof fieldsMetaRef.current\n ] = prettifyFormValues(values, stepFields[currentStepName]);\n }\n const parsedValues = await parseFormValues(values);\n switch (stepState.currentStep.name) {\n case 'select_country': {\n setInternalCountryCode(parsedValues.country);\n return Promise.resolve({ data: { countryCode: parsedValues.country } });\n }\n case 'basic_information': {\n const isEmploymentNotLoaded =\n !internalEmploymentId && internalCountryCode;\n const hasChangedCountry =\n internalEmploymentId &&\n internalCountryCode &&\n employment?.country &&\n employment?.country.code !== internalCountryCode;\n\n if (isEmploymentNotLoaded || hasChangedCountry) {\n const basicInformationParsedValues = omit(\n parsedValues,\n 'nationality_status',\n 'ir35',\n 'ir35_sds_file',\n );\n const basicInformationPayload: EmploymentCreateParams = {\n basic_information: basicInformationParsedValues,\n type: 'contractor',\n country_code: internalCountryCode,\n external_id: externalId,\n };\n const response = await createEmploymentMutationAsync(\n basicInformationPayload,\n );\n const employmentId = response?.data?.employment?.id;\n if (!employmentId) {\n throw createStructuredError('Employment ID not found');\n }\n\n setInternalEmploymentId(employmentId);\n await updateUKandSaudiFieldsMutation({\n employmentId: employmentId as string,\n });\n\n return response;\n } else if (internalEmploymentId) {\n const basicInformationParsedValues = omit(\n parsedValues,\n 'nationality_status',\n 'ir35',\n 'ir35_sds_file',\n );\n\n await updateUKandSaudiFieldsMutation({\n employmentId: internalEmploymentId,\n });\n return updateEmploymentMutationAsync({\n employmentId: internalEmploymentId,\n basic_information: basicInformationParsedValues,\n });\n }\n\n return;\n }\n case 'contract_details': {\n const payload: CreateContractDocument = {\n contract_document: parsedValues,\n };\n const response = await createContractorContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n payload,\n });\n const contractDocumentId = response?.data?.contract_document?.id;\n if (!contractDocumentId) {\n throw createStructuredError('Contract document ID not found');\n }\n setInternalContractDocumentId(contractDocumentId);\n return response;\n }\n\n case 'contract_preview': {\n return signContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n contractDocumentId: internalContractDocumentId as string,\n payload: {\n signature: parsedValues.signature,\n },\n });\n }\n case 'pricing_plan': {\n if (\n hasEligibilityQuestionnaireSubmitted &&\n values.subscription !== corProductIdentifier\n ) {\n try {\n await deleteContractorCorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n });\n await refetchContractorSubscriptions();\n } catch (error) {\n if ((error as $TSFixMe)?.response?.status !== 404) {\n throw error;\n }\n // Still refetch to update the UI state\n await refetchContractorSubscriptions();\n }\n }\n\n if (values.subscription == contractorStandardProductIdentifier) {\n return manageContractorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n payload: {\n operation: 'downgrade',\n },\n });\n } else if (values.subscription == contractorPlusProductIdentifier) {\n return manageContractorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n payload: {\n operation: 'upgrade',\n },\n });\n } else if (values.subscription == corProductIdentifier) {\n return Promise.resolve({\n data: { subscription: values.subscription },\n });\n }\n\n throw createStructuredError('invalid selection');\n }\n\n case 'eligibility_questionnaire': {\n try {\n const response = await createEligibilityQuestionnaireMutationAsync({\n employmentId: internalEmploymentId as string,\n payload: parsedValues,\n });\n\n const isEligibilityQuestionnaireBlocked = response?.data?.is_blocking;\n\n if (isEligibilityQuestionnaireBlocked) {\n setIncludeChooseAlternativePlan(true);\n setPendingNavigationStep('choose_alternative_plan');\n return { ...response, _skipNextStep: true };\n }\n\n return await manageContractorCorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n });\n } finally {\n // Always refetch to keep state in sync, even on error\n await refetchContractorSubscriptions();\n }\n }\n\n case 'choose_alternative_plan': {\n const subscription = parsedValues.subscription;\n\n if (subscription === contractorStandardProductIdentifier) {\n await manageContractorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n payload: {\n operation: 'downgrade',\n },\n });\n }\n\n setIncludeChooseAlternativePlan(false);\n\n return Promise.resolve({\n data: { subscription },\n });\n }\n\n default: {\n throw createStructuredError('Invalid step state');\n }\n }\n }\n\n const isLoading = initialLoading || shouldHandleReadOnlyEmployment;\n\n return {\n /**\n * Loading state indicating if the flow is loading data\n */\n isLoading,\n\n /**\n * Current state of the form fields for the current step.\n */\n fieldValues,\n\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back: previousStep,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next: nextStep,\n\n /**\n * Function to handle going to a specific step\n * @param step The step to go to.\n * @returns {void}\n */\n goTo: goTo,\n\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Array of form fields from the onboarding schema\n */\n fields: stepFields[stepState.currentStep.name],\n\n /**\n * Fields metadata for each step\n */\n meta: {\n fields: fieldsMetaRef.current,\n fieldsets: stepFieldsWithFlatFieldsets[stepState.currentStep.name],\n },\n\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues,\n\n /**\n * Function to validate form values against the onboarding schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: async (\n values: FieldValues,\n ): Promise<ValidationResult | null> => {\n if (stepState.currentStep.name === 'select_country') {\n return selectCountryForm.handleValidation(values);\n }\n\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n basicInformationForm?.fields,\n { isPartialValidation: false },\n );\n return basicInformationForm?.handleValidation(parsedValues);\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n contractorOnboardingDetailsForm?.fields,\n { isPartialValidation: false },\n );\n return contractorOnboardingDetailsForm?.handleValidation(parsedValues);\n }\n\n if (\n signatureSchemaForm &&\n stepState.currentStep.name === 'contract_preview'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n signatureSchemaForm?.fields,\n { isPartialValidation: true },\n );\n return signatureSchemaForm?.handleValidation(parsedValues);\n }\n\n if (\n selectContractorSubscriptionForm &&\n stepState.currentStep.name === 'pricing_plan'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n selectContractorSubscriptionForm?.fields,\n { isPartialValidation: false },\n );\n return selectContractorSubscriptionForm?.handleValidation(parsedValues);\n }\n\n if (\n eligibilityQuestionnaireForm &&\n stepState.currentStep.name === 'eligibility_questionnaire'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n eligibilityQuestionnaireForm?.fields,\n { isPartialValidation: false },\n );\n return eligibilityQuestionnaireForm?.handleValidation(parsedValues);\n }\n\n if (\n chooseAlternativePlanForm &&\n stepState.currentStep.name === 'choose_alternative_plan'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n chooseAlternativePlanForm?.fields,\n );\n return chooseAlternativePlanForm?.handleValidation(parsedValues);\n }\n\n return null;\n },\n\n /**\n * Initial form values\n */\n initialValues,\n\n /**\n * Employment id\n */\n employmentId: internalEmploymentId,\n\n /**\n * Function to refetch the employment data\n * @returns {void}\n */\n refetchEmployment: refetchEmployment,\n\n /**\n * Loading state indicating if the onboarding mutation is in progress\n */\n isSubmitting:\n createEmploymentMutation.isPending ||\n updateEmploymentMutation.isPending ||\n createContractorContractDocumentMutation.isPending ||\n signContractDocumentMutation.isPending ||\n manageContractorSubscriptionMutation.isPending ||\n uploadFileMutation.isPending ||\n createEligibilityQuestionnaireMutation.isPending ||\n manageContractorCorSubscriptionMutation.isPending ||\n deleteContractorCorSubscriptionMutation.isPending,\n\n /**\n * Document preview PDF data\n */\n documentPreviewPdf,\n\n /**\n * let's the user know if the company can invite employees\n * @returns {boolean}\n */\n canInvite,\n\n /**\n * let's the user know that the employment cannot be edited, happens when employment.status is invited\n * @returns {boolean}\n */\n isEmploymentReadOnly,\n /**\n * let's the user know if the employment is invited or not\n * @returns {'invited' | 'not_invited'}\n */\n invitedStatus,\n\n /**\n * Employment data\n * @returns {Employment}\n */\n employment,\n\n /**\n * Default legal entity\n * @returns {CompanyLegalEntity}\n */\n defaultLegalEntity,\n /**\n * Steps array\n * @returns {Array<{name: string, index: number, label: string}>}\n */\n steps: stepsArray,\n };\n};\n","import { useQuery } from '@tanstack/react-query';\nimport {\n getIndexCompanyLegalEntities,\n IdentityCurrentResponse,\n} from '@/src/client';\nimport { Client } from '@/src/client/client';\nimport { useClient } from '@/src/context';\nimport { useIdentity } from '@/src/common/api/identity';\n\nfunction hasCompany(\n identity: IdentityCurrentResponse['data'] | undefined,\n): identity is Extract<\n IdentityCurrentResponse['data'],\n { company: { id: string } }\n> {\n return identity != null && 'company' in identity;\n}\n\n/**\n * Hook to get the legal entities for a company\n * @param companyId - The company ID\n * @returns The legal entities\n */\nexport const useLegalEntities = () => {\n const { client } = useClient();\n const { data: identity } = useIdentity();\n const companyId = hasCompany(identity) ? (identity?.company?.id ?? '') : '';\n\n return useQuery({\n queryKey: ['legal-entities', companyId],\n queryFn: () =>\n getIndexCompanyLegalEntities({\n client: client as Client,\n path: {\n company_id: companyId,\n },\n }),\n select: (data) => data.data?.data?.legal_entities,\n enabled: !!companyId,\n });\n};\n\nexport const useDefaultLegalEntity = () => {\n const { data: legalEntities } = useLegalEntities();\n return legalEntities?.find((legalEntity) => legalEntity.is_default);\n};\n","import { useQuery } from '@tanstack/react-query';\nimport { getCurrentIdentity } from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { Client } from '@/src/client/client';\n\nexport const useIdentity = () => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['identity'],\n queryFn: () =>\n getCurrentIdentity({\n client: client as Client,\n headers: { Authorization: `` },\n }),\n select: (data) => data.data?.data,\n });\n};\n"],"mappings":"qvBAAA,OAAS,aAAAA,EAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,MAAgB,QAErD,OAAOC,OAAU,cCFjB,OAAS,YAAAC,OAAgB,wBCAzB,OAAS,YAAAC,OAAgB,wBAKlB,IAAMC,GAAcC,EAAA,IAAM,CAC/B,GAAM,CAAE,OAAAC,CAAO,EAAIC,GAAU,EAC7B,OAAOC,GAAS,CACd,SAAU,CAAC,UAAU,EACrB,QAASH,EAAA,IACPI,GAAmB,CACjB,OAAQH,EACR,QAAS,CAAE,cAAe,EAAG,CAC/B,CAAC,EAJM,WAKT,OAAQD,EAACK,GAASA,EAAK,MAAM,KAArB,SACV,CAAC,CACH,EAX2B,eDI3B,SAASC,GACPC,EAIA,CACA,OAAOA,GAAY,MAAQ,YAAaA,CAC1C,CAPSC,EAAAF,GAAA,cAcF,IAAMG,GAAmBD,EAAA,IAAM,CACpC,GAAM,CAAE,OAAAE,CAAO,EAAIC,GAAU,EACvB,CAA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A/F,EAAU,YAAY,OAAS,4BAC/B,CACA,IAAM4I,EAAe,MAAMH,EACzBD,EACAzC,GAA8B,OAC9B,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAA8B,iBAAiB6C,CAAY,CACpE,CAEA,GACE1C,GACAlG,EAAU,YAAY,OAAS,0BAC/B,CACA,IAAM4I,EAAe,MAAMH,EACzBD,EACAtC,GAA2B,MAC7B,EACA,OAAOA,GAA2B,iBAAiB0C,CAAY,CACjE,CAEA,OAAO,IACT,EA/EkB,oBAoFlB,cAAAlB,GAKA,aAAc7I,EAMd,kBAAmB6B,GAKnB,aACEU,GAAyB,WACzBE,GAAyB,WACzBE,GAAyC,WACzCY,GAA6B,WAC7BE,GAAqC,WACrCZ,GAAmB,WACnBI,GAAuC,WACvCE,GAAwC,WACxCQ,GAAwC,UAK1C,mBAAAqE,GAMA,UAAA5F,GAMA,qBAAAF,EAKA,cAAAI,GAMA,WAAAX,EAMA,mBAAAI,GAKA,MAAOhB,EACT,CACF,EAztCuC","names":["useEffect","useMemo","useRef","useState","omit","useQuery","useQuery","useIdentity","__name","client","useClient","useQuery","getCurrentIdentity","data","hasCompany","identity","__name","useLegalEntities","client","useClient","useIdentity","companyId","useQuery","getIndexCompanyLegalEntities","data","useDefaultLegalEntity","legalEntities","legalEntity","stepToFormSchemaMap","jsonSchemaToEmployment","useContractorOnboarding","__name","countryCode","externalId","employmentId","skipSteps","options","onboardingInitialValues","excludeProducts","internalCountryCode","setInternalCountryCode","useState","internalEmploymentId","setInternalEmploymentId","internalContractDocumentId","setInternalContractDocumentId","fieldsMetaRef","useRef","selectedProduct","setSelectedProduct","includeEligibilityQuestionnaire","setIncludeEligibilityQuestionnaire","includeChooseAlternativePlan","setIncludeChooseAlternativePlan","pendingNavigationStep","setPendingNavigationStep","steps","stepsArray","useMemo","buildSteps","fieldValues","stepState","setFieldValues","previousStep","nextStep","goToStep","setStepValues","useStepState","useEffect","employment","isLoadingEmployment","refetchEmployment","useEmploymentQuery","defaultLegalEntity","useDefaultLegalEntity","employmentStatus","isEmploymentReadOnly","reviewStepAllowedEmploymentStatus","canInvite","disabledInviteButtonEmploymentStatus","invitedStatus","createEmploymentMutation","useCreateEmployment","updateEmploymentMutation","useUpdateEmployment","createContractorContractDocumentMutation","useCreateContractorContractDocument","uploadFileMutation","useUploadFile","updateUKandSaudiFieldsMutation","useUpdateUKandSaudiFields","createEligibilityQuestionnaireMutation","usePostCreateEligibilityQuestionnaire","manageContractorCorSubscriptionMutation","usePostManageContractorCorSubscription","updateEmploymentMutationAsync","mutationToPromise","signContractDocumentMutation","useSignContractDocument","manageContractorSubscriptionMutation","usePostManageContractorSubscriptions","deleteContractorCorSubscriptionMutation","useDeleteContractorCorSubscription","createEmploymentMutationAsync","createContractorContractDocumentMutationAsync","signContractDocumentMutationAsync","manageContractorSubscriptionMutationAsync","createEligibilityQuestionnaireMutationAsync","manageContractorCorSubscriptionMutationAsync","deleteContractorCorSubscriptionMutationAsync","selectCountryForm","isLoadingCountries","countries","useCountriesSchemaField","isPricingPlanEnabled","selectContractorSubscriptionForm","isLoadingContractorSubscriptions","contractorSubscriptions","refetchContractorSubscriptions","isEligibilityQuestionnaireBlocked","useContractorSubscriptionSchemaField","hasEligibilityQuestionnaireSubmitted","subscription","corProductIdentifier","eligibilityAnswers","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","query","mergedFormValues","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractorOnboardingDetailsEnabled","isIR35FileEnabled","ir35File","isLoadingIR35File","useGetIR35File","contractDocuments","isLoadingContractDocuments","useGetContractDocuments","countryName","country","basicInformationForm","isLoadingBasicInformationForm","buildBasicInformationJsfModify","descriptionProvisionalStartDate","calculateProvisionalStartDateDescription","selectedPricingPlan","subscriptions","contractorStandardProductIdentifier","contractorPlusProductIdentifier","eligibilityFields","isEligibilityQuestionnaireEnabled","eligibilityQuestionnaireForm","isLoadingEligibilityQuestionnaire","useGetEligibilityQuestionnaire","chooseAlternativePlanForm","isLoadingChooseAlternativePlan","useGetChooseAlternativePlan","contractorOnboardingDetailsForm","isLoadingContractorOnboardingDetailsForm","useContractorOnboardingDetailsSchema","buildContractDetailsJsfModify","isSignatureSchemaEnabled","signatureSchemaForm","useGetContractDocumentSignatureSchema","buildContractPreviewJsfModify","documentPreviewPdf","isLoadingDocumentPreviewForm","useGetShowContractDocument","stepFields","stepFieldsWithFlatFieldsets","employmentBasicInformation","employmentContractDetails","employmentCountryCode","selectCountryInitialValues","getInitialValues","convertedIr35File","dataURLtoFile","basicInformationInitialValues","initialValues","contractDetailsInitialValues","contractPreviewInitialValues","signature","signatory","pricingPlanInitialValues","eligibilityQuestionnaireInitialValues","shouldHandleReadOnlyEmployment","initialLoading","isNavigatingToReview","prettifyFormValues","goTo","step","parseFormValues","values","parseJSFToValidate","onSubmit","currentStepName","parsedValues","isEmploymentNotLoaded","hasChangedCountry","basicInformationPayload","omit","response","createStructuredError","basicInformationParsedValues","contractDocumentId","error"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as l}from"./chunk-P37U34EQ.js";import{useState as S,useEffect as V}from"react";var v=l(t=>Object.values(t).find(r=>r.visible!==!1)||t[Object.keys(t)[0]],"getInitialStep"),m=l((t,i)=>{let c=Object.keys(t);if(c.length===0)throw new Error("No steps provided to useStepState");let[r,p]=S({}),o=v(t),[d,u]=S({currentStep:o,totalSteps:c.length,values:null});V(()=>{i?.(o)},[]);function T(){let{index:s}=d.currentStep,n=Object.values(t).find(e=>e.index>s&&e.visible!==!1);n&&(u(e=>({...e,currentStep:n,values:{...e.values,[e.currentStep.name]:{...e.values?.[e.currentStep.name],...r}}})),i?.(n),p({}))}l(T,"nextStep");function f(){let{index:s}=d.currentStep,n=Object.values(t).reverse().find(e=>e.index<s&&e.visible!==!1);n&&(u(e=>({...e,currentStep:n,values:{...e.values,[e.currentStep.name]:{...e.values?.[e.currentStep.name],...r}}})),i?.(n),p({}))}l(f,"previousStep");function F(s){u(a=>({...a,currentStep:t[s]})),i?.(t[s])}l(F,"goToStep");function b(s){u(a=>({...a,values:s}))}return l(b,"setStepValues"),{nextStep:T,previousStep:f,stepState:d,goToStep:F,fieldValues:r,setFieldValues:p,setStepValues:b}},"useStepState");export{m as a};
|
|
2
|
+
//# sourceMappingURL=chunk-TSPDJUGG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/useStepState.ts"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { FieldValues } from 'react-hook-form';\n\nexport type Step<T extends string> = {\n index: number;\n name: T;\n visible?: boolean;\n};\n\ntype StepState<T extends string, Fields = FieldValues> = {\n currentStep: Step<T>;\n totalSteps: number;\n values:\n | {\n [key in T]: Fields;\n }\n | null;\n};\n\nconst getInitialStep = <T extends string>(steps: Record<T, Step<T>>) => {\n const stepValues = Object.values(steps) as Step<T>[];\n const firstVisibleStep = stepValues.find((step) => step.visible !== false);\n return firstVisibleStep || steps[Object.keys(steps)[0] as T]; // Fallback to first if none found\n};\n\nexport const useStepState = <T extends string, Fields = FieldValues>(\n steps: Record<T, Step<T>>,\n onStepChange?: (step: Step<T>) => void,\n) => {\n const stepKeys = Object.keys(steps) as Array<keyof typeof steps>;\n\n if (stepKeys.length === 0) {\n throw new Error('No steps provided to useStepState');\n }\n\n const [fieldValues, setFieldValues] = useState<Fields>({} as Fields);\n const initialStep = getInitialStep(steps);\n const [stepState, setStepState] = useState<StepState<T, Fields>>({\n currentStep: initialStep,\n totalSteps: stepKeys.length,\n values: null,\n });\n\n // Call onStepChange once when the hook initializes\n // Note: intentionally no deps to only run on mount and avoid re-renders\n // when onStepChange/steps references change\n useEffect(() => {\n onStepChange?.(initialStep);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n function nextStep() {\n const { index } = stepState.currentStep;\n const stepValues = Object.values<Step<T>>(steps);\n const nextStep = stepValues.find(\n (step) => step.index > index && step.visible !== false,\n );\n\n if (nextStep) {\n setStepState((previousState) => ({\n ...previousState,\n currentStep: nextStep,\n values: {\n ...previousState.values,\n [previousState.currentStep.name]: {\n ...previousState.values?.[previousState.currentStep.name as T],\n ...fieldValues,\n },\n } as { [key in T]: Fields },\n }));\n onStepChange?.(nextStep);\n setFieldValues({} as Fields);\n }\n }\n\n function previousStep() {\n const { index } = stepState.currentStep;\n const stepValues = Object.values<Step<T>>(steps);\n const previousStep = stepValues\n .reverse()\n .find((step) => step.index < index && step.visible !== false);\n\n if (previousStep) {\n setStepState((previousState) => ({\n ...previousState,\n currentStep: previousStep,\n values: {\n ...previousState.values,\n [previousState.currentStep.name]: {\n ...previousState.values?.[previousState.currentStep.name as T],\n ...fieldValues,\n },\n } as { [key in T]: Fields },\n }));\n onStepChange?.(previousStep);\n setFieldValues({} as Fields);\n }\n }\n\n function goToStep(step: T) {\n setStepState((previousState) => ({\n ...previousState,\n currentStep: steps[step],\n }));\n onStepChange?.(steps[step]);\n }\n\n function setStepValues(values: Record<T, Fields>) {\n setStepState((previousState) => ({\n ...previousState,\n values: values,\n }));\n }\n\n return {\n /**\n * Moves to the next step in the step state.\n * It updates the current step and resets the field values for the next step.\n * The field values for the current step are stored in the step state.\n * @returns {void}\n */\n nextStep,\n /**\n * Moves to the previous step in the step state.\n * It updates the current step and resets the field values for the previous step.\n * The field values for the current step are stored in the step state.\n * @returns {void}\n */\n previousStep,\n /**\n * The current step state containing the current step, total number of steps and\n * the form values for each step.\n * @returns {StepState<T>} The current step state.\n */\n stepState,\n /**\n * Goes to a specific step in the step state.\n * @param step The step to go to.\n * @returns {void}\n */\n goToStep,\n /**\n * The field values for the current step.\n * @returns {FieldValues} The field values for the current step.\n */\n fieldValues,\n /**\n * Sets the field values for the current step.\n * @param values The field values to set.\n * @returns {void}\n */\n setFieldValues,\n /**\n * Sets the step values for the step state.\n * This is used to update all values in the step state.\n * @param values The values to set for the all steps.\n * @returns {void}\n */\n setStepValues,\n };\n};\n"],"mappings":"wCAAA,OAAS,YAAAA,EAAU,aAAAC,MAA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,CAACA,EAAc,YAAY,IAAI,EAAG,CAChC,GAAGA,EAAc,SAASA,EAAc,YAAY,IAAS,EAC7D,GAAGT,CACL,CACF,CACF,EAAE,EACFF,IAAeY,CAAY,EAC3BT,EAAe,CAAC,CAAW,EAE/B,CAtBSP,EAAAgB,EAAA,gBAwBT,SAASC,EAASf,EAAS,CACzBS,EAAcI,IAAmB,CAC/B,GAAGA,EACH,YAAad,EAAMC,CAAI,CACzB,EAAE,EACFE,IAAeH,EAAMC,CAAI,CAAC,CAC5B,CANSF,EAAAiB,EAAA,YAQT,SAASC,EAAcC,EAA2B,CAChDR,EAAcI,IAAmB,CAC/B,GAAGA,EACH,OAAQI,CACV,EAAE,CACJ,CALS,OAAAnB,EAAAkB,EAAA,iBAOF,CAOL,SAAAL,EAOA,aAAAG,EAMA,UAAAN,EAMA,SAAAO,EAKA,YAAAX,EAMA,eAAAC,EAOA,cAAAW,CACF,CACF,EAvI4B","names":["useState","useEffect","getInitialStep","__name","steps","step","useStepState","onStepChange","stepKeys","fieldValues","setFieldValues","useState","initialStep","stepState","setStepState","useEffect","nextStep","index","previousState","previousStep","goToStep","setStepValues","values"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as De}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as De}from"./chunk-7RC7EB47.js";import{a as Be}from"./chunk-VAIBLWOY.js";import{b as Ve,c as xe,f as Pe,g as Oe,h as Me,i as Te,j as we,k as Re,m as Le}from"./chunk-4TJ2QZ7P.js";import{a as ge,b as Ee,c as Ce,d as Fe,f as he}from"./chunk-STF3NTPS.js";import{a as ve}from"./chunk-PPY77NYV.js";import{e as O,f as L,h as $}from"./chunk-T7O3YYOG.js";import{h as P}from"./chunk-3PIJOIYR.js";import{a as R}from"./chunk-X6ZAR7ZL.js";import{a as ke}from"./chunk-TSPDJUGG.js";import{a as o}from"./chunk-P37U34EQ.js";import{useCallback as gt,useEffect as Et,useMemo as p,useRef as Ct,useState as Ae}from"react";import Ft from"lodash.mergewith";import{createContext as mt,useContext as ft,useMemo as pt,useCallback as yt,useRef as _t}from"react";import{jsx as St}from"react/jsx-runtime";var qe=mt(void 0);function Tt({children:r}){let u=_t({}),c=yt(i=>{u.current={...u.current,...i}},[]),E=pt(()=>({errorContextRef:u,updateContext:c}),[c]);return St(qe.Provider,{value:E,children:r})}o(Tt,"ErrorContextProvider");var Je=o(()=>{let r=ft(qe);if(!r)throw new Error("useErrorContext must be used within ErrorContextProvider");return r},"useErrorContext");import{useEffect as je,useMemo as bt}from"react";function Ne(r){let{updateContext:u,errorContextRef:c}=Je();return je(()=>{r&&(c.current=r)},[]),je(()=>()=>{c.current={}},[c]),{...bt(()=>({updateErrorContext:o(i=>{u(i)},"updateErrorContext"),clearErrorContext:o(()=>{c.current={}},"clearErrorContext")}),[]),errorContext:c}}o(Ne,"useErrorReporting");import{jsx as Ie}from"react/jsx-runtime";var ht={employment_basic_information:"basic_information",contract_details:"contract_details"},Vt={select_country:null,basic_information:"employment_basic_information",contract_details:"contract_details",benefits:null,review:null},xt=o(({isLoadingBasicInformationForm:r,isLoadingContractDetailsForm:u,isLoadingEmployment:c,isLoadingBenefitsOffersSchema:E,isLoadingBenefitOffers:i,isLoadingCompany:N,isLoadingCountries:M,employmentStatus:s,employmentId:v,currentStepName:A,basicInformationFields:I,contractDetailsFields:y})=>{let t=r||u||c||E||i||N||M,k=s&&Ce.includes(s),U=s&&!Fe.includes(s),D=!!(v&&k&&A!=="review"),T=t||D,B=!!(D&&!t&&I.length>0&&y.length>0);return{isLoading:T,isNavigatingToReview:B,isEmploymentReadOnly:k,canInvite:U}},"getLoadingStates"),Qt=o(({employmentId:r,companyId:u,countryCode:c,type:E,options:i,skipSteps:N,externalId:M,initialValues:s})=>{let{updateErrorContext:v}=Ne({flow:"onboarding",metadata:{employmentId:r,companyId:u,isUpdating:!!r}}),A=N?.includes("select_country")?Ee:ge,I=gt(e=>{v({step:e.name})},[v]),{fieldValues:y,stepState:t,setFieldValues:k,previousStep:U,nextStep:D,goToStep:T,setStepValues:B}=ke(A,I),q=Ct({select_country:{},basic_information:{},contract_details:{},benefits:{}}),[d,Ue]=Ae(r),[l,z]=Ae(c||null),{data:m,isLoading:K,refetch:He}=ve({employmentId:d,queryParams:{exclude_files:!0}});r&&m?.country?.code&&!l&&z(m.country.code);let{data:Q,isLoading:Y}=xe(d),{data:J,isLoading:X,refetch:We}=Ve(u),{selectCountryForm:j,isLoading:Z}=Re({jsfModify:i?.jsfModify?.select_country,queryOptions:{enabled:t.currentStep.name==="select_country"}}),ee=Me(),te=Te(l,i),ne=we(i),oe=Le(),{mutateAsync:Ge}=R(ee),{mutateAsync:re}=R(te),{mutateAsync:$e}=R(ne),{mutateAsync:ze}=R(oe),Ke=Vt[t.currentStep.name]||"employment_basic_information",Qe=ht[Ke],Ye=m?.[Qe]||{},ie=o(({form:e,options:a={},query:f={},jsonSchemaVersion:x})=>{let W=Object.keys(y).length>0?{...s,...t.values?.[t.currentStep.name],...y}:{...s,...Ye};return Pe({countryCode:l,form:e,fieldValues:W,query:f,options:{...a,queryOptions:{enabled:a.queryOptions?.enabled??!0}},jsonSchemaVersion:x})},"useJSONSchema"),Xe=!!(l&&(t.currentStep.name==="basic_information"||r)),Ze=!!(l&&(t.currentStep.name==="contract_details"||r)),{data:_,isLoading:ae}=ie({form:"employment_basic_information",options:{jsfModify:i?.jsfModify?.basic_information,queryOptions:{enabled:Xe}},jsonSchemaVersion:1}),C=i?.jsfModify?.contract_details?.fields?.annual_gross_salary,H=C&&typeof C=="object"&&"presentation"in C?C.presentation:void 0,se=i?.jsfModify?.contract_details?.fields?.equity_compensation,et=p(()=>({fields:{annual_gross_salary:{...C,presentation:{annual_gross_salary_conversion_properties:{label:H?.annual_gross_salary_conversion_properties?.label,description:H?.annual_gross_salary_conversion_properties?.description},desiredCurrency:J?.desired_currency,Component:o(e=>Ie(De,{desiredCurrency:J?.desired_currency||"",...e}),"Component")}},equity_compensation:{...se,presentation:{calculateDynamicProperties:o((e,a)=>{let f=e.equity_compensation?.offer_equity_compensation,x=a?.meta?.cost;return{extra:Ie(Be,{offerEquity:f,equityCost:x})}},"calculateDynamicProperties")}}}}),[C,H,J?.desired_currency,se]),tt=he(i,l),{data:S,isLoading:ce}=ie({form:"contract_details",query:{employment_id:d},options:{jsfModify:{...i?.jsfModify?.contract_details,fields:{...i?.jsfModify?.contract_details?.fields,...et.fields}},queryOptions:{enabled:Ze}},jsonSchemaVersion:tt}),{data:w,isLoading:le}=Oe(d,y,i),de=p(()=>{if(t.currentStep.name==="benefits"){let e={...t.values?.[t.currentStep.name],...y};return Ft({},Q,e)}return{}},[t.currentStep.name,Q,t.values,y]),n=p(()=>({select_country:j?.fields||[],basic_information:_?.fields||[],contract_details:S?.fields||[],benefits:w?.fields||[],review:[]}),[j?.fields,_?.fields,S?.fields,w?.fields]),nt={select_country:null,basic_information:_?.meta["x-jsf-fieldsets"],contract_details:S?.meta["x-jsf-fieldsets"],benefits:null,review:null},{country:ot,basic_information:ue={},contract_details:me={},status:fe}=m||{},pe=ot?.code,ye=t.currentStep.name,F=p(()=>L(n.select_country,{country:l||pe||""}),[n.select_country,l,pe]),h=p(()=>{let e={...s,...ue};return L(n.basic_information,e)},[n.basic_information,ue,s]),g=p(()=>{let e={...s,...me};return L(n.contract_details,e)},[n.contract_details,me,s]),V=p(()=>{let e={...s,...de};return L(n.benefits,e)},[n.benefits,de,s]),rt=p(()=>m?{select_country:F,basic_information:$(n.basic_information,h),contract_details:m?.contract_details!==null?$(n.contract_details,g):g,benefits:V}:{select_country:F,basic_information:h,contract_details:g,benefits:V},[F,h,g,V,m,n]),{isLoading:it,isNavigatingToReview:_e,isEmploymentReadOnly:at,canInvite:st}=p(()=>xt({isLoadingBasicInformationForm:ae,isLoadingContractDetailsForm:ce,isLoadingEmployment:K,isLoadingBenefitsOffersSchema:le,isLoadingBenefitOffers:Y,isLoadingCompany:X,isLoadingCountries:Z,employmentId:r,employmentStatus:fe,basicInformationFields:n.basic_information,contractDetailsFields:n.contract_details,currentStepName:ye}),[ae,ce,K,le,Y,X,Z,r,fe,n.basic_information,n.contract_details,ye]);Et(()=>{_e&&(q.current={select_country:P(F,n.select_country),basic_information:P(h,n.basic_information),contract_details:P(g,n.contract_details),benefits:P(V,n.benefits)},B({select_country:F,basic_information:h,contract_details:g,benefits:V,review:{}}),T("review"))},[h,V,g,T,_e,F,B,n.basic_information,n.benefits,n.contract_details,n.select_country]);let Se=o(async e=>j&&t.currentStep.name==="select_country"?e:_&&t.currentStep.name==="basic_information"?await O(e,_?.fields,{isPartialValidation:!1}):S&&t.currentStep.name==="contract_details"?await O(e,S?.fields,{isPartialValidation:!1}):{},"parseFormValues");async function ct(e){let a=t.currentStep.name;a in q.current&&(q.current[a]=P(e,n[a]));let f=await Se(e);switch(We(),t.currentStep.name){case"select_country":return z(f.country),Promise.resolve({data:{countryCode:f.country}});case"basic_information":{let x=!d&&l,be=d&&l&&m?.country&&m?.country.code!==l;if(x||be){let W={basic_information:f,type:E,country_code:l,external_id:M};try{let b=await Ge(W);if(b.error)return b;if(b.data){let G=b.data?.data?.employment?.id;return G&&(Ue(G),await ze({employmentId:G,eligible_to_work_in_residing_country:"citizen",employer_or_work_restrictions:!1})),b}}catch(b){throw console.error("Error creating onboarding:",b),b}}else if(d)return re({employmentId:d,basic_information:f,pricing_plan_details:{frequency:"monthly"},external_id:M});return}case"contract_details":return re({employmentId:d,external_id:M,...{contract_details:f,pricing_plan_details:{frequency:"monthly"}}});case"benefits":return $e({employmentId:d,...e})}}o(ct,"onSubmit");function lt(){U()}o(lt,"back");function dt(){D()}o(dt,"next");function ut(e){T(e)}return o(ut,"goTo"),{employmentId:d,creditRiskStatus:J?.default_legal_entity_credit_risk_status,fieldValues:y,stepState:t,fields:n[t.currentStep.name],isLoading:it,isSubmitting:ee.isPending||te.isPending||ne.isPending||oe.isPending,initialValues:rt,handleValidation:o(async e=>{if(t.currentStep.name==="select_country")return j.handleValidation(e);if(t.currentStep.name==="benefits"&&w){let a=await O(e,w?.fields,{isPartialValidation:!1});return w?.handleValidation(a)}if(_&&t.currentStep.name==="basic_information"){let a=await O(e,_?.fields,{isPartialValidation:!1});return _?.handleValidation(a)}if(S&&t.currentStep.name==="contract_details"){let a=await O(e,S?.fields,{isPartialValidation:!1});return S?.handleValidation(a)}return null},"handleValidation"),checkFieldUpdates:k,parseFormValues:Se,onSubmit:ct,back:lt,next:dt,goTo:ut,meta:{fields:q.current,fieldsets:nt[t.currentStep.name]},refetchEmployment:He,employment:m,isEmploymentReadOnly:at,canInvite:st}},"useOnboarding");export{qe as a,Tt as b,Qt as c};
|
|
2
|
+
//# sourceMappingURL=chunk-TUJXQF4Q.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-2TPHCOVE.js";import{b as e}from"./chunk-MRYRNB7Y.js";import{a as r}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function F({onSubmit:t,onSuccess:s,onError:m}){let{terminationBag:o}=e(),d=r(async a=>{let l=await o?.parseFormValues(a,!0);await t?.(l);let i=await o?.onSubmit(a);i?.error?m?.(i.rawError):i?.data&&await s?.(i.data)},"handleSubmit");return u(n,{defaultValues:o.fieldValues,fields:o?.fields,onSubmit:d})}r(F,"AdditionalDetailsForm");export{F as a};
|
|
2
|
+
//# sourceMappingURL=chunk-UBYT2TI4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as _,b as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as _,b as g}from"./chunk-NFLKVFAD.js";import{a as F}from"./chunk-ZPG6GRAX.js";import{g as S}from"./chunk-T7O3YYOG.js";import{b as T}from"./chunk-I3J7LKY3.js";import{c}from"./chunk-ZSJ6YADQ.js";import{e as m}from"./chunk-3PIJOIYR.js";import{a as i}from"./chunk-P37U34EQ.js";import{Fragment as x}from"react";var d={..._,fieldset:g,"fieldset-flat":g};import{useEffect as P}from"react";import{Fragment as R,jsx as p,jsxs as h}from"react/jsx-runtime";var C=i(({name:e,description:a,helpCenter:n})=>h("span",{children:[p("span",{className:`text-xs RemoteFlows__ForcedValue__Description__${e}`,dangerouslySetInnerHTML:{__html:m(a)}}),n?.callToAction&&n?.id&&p(T,{className:"RemoteFlows__ForcedValue__HelpCenterLink",zendeskId:n.id,children:n.callToAction})]}),"Description");function k({name:e,value:a,description:n,statement:r,label:u,helpCenter:l}){let{setValue:t}=c(),s=m(r?.description||n);return P(()=>{t(e,a)},[]),p("div",{children:r?h(R,{children:[p("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${e}`,dangerouslySetInnerHTML:{__html:m(r?.title||u)}}),p(C,{name:e,description:m(r?.description||n),helpCenter:l})]}):p(C,{name:e,description:s,helpCenter:l})})}i(k,"ForcedValueField");import{Fragment as M,jsx as o,jsxs as y}from"react/jsx-runtime";function J(e){return e.const!==void 0&&e.const===e.default&&e.inputType!=="checkbox"&&e.inputType!=="hidden"}i(J,"checkFieldHasForcedValue");var G=i(({fields:e,fieldsets:a,fieldValues:n,components:r})=>{let{setValue:u}=c();if(!e||e.length===0)return null;let l=a&&n?S({fields:e,fieldsets:a,values:n}):e;return o(M,{children:l.map(t=>{if(t.calculateDynamicProperties&&(t={...t,...t.calculateDynamicProperties(n,t)||{}}),t.isVisible===!1||t.deprecated||t.hidden)return null;if(J(t))return o(k,{name:t.name,description:t.description,value:t.const,statement:t.statement,label:t.label,helpCenter:t.meta?.helpCenter},t.name);if(t.Component){let{Component:b}=t;return y(x,{children:[o(b,{setValue:V=>u(t.name,V),...t}),t.statement?o(F,{...t.statement}):null,t.extra?t.extra:null]},t.name)}let s=d[t.inputType];return s?t.inputType==="fieldset"?o(s,{...t,components:r},t.name):t.inputType==="fieldset-flat"?o(s,{...t,components:r,isFlatFieldset:!0},t.name):(t.inputType==="select"&&t.multiple&&(s=d["multi-select"]),y(x,{children:[o(s,{...t,component:r&&r[t.inputType]}),t.statement?o(F,{...t.statement}):null,t.extra?t.extra:null]},t.name)):y("p",{className:"error",children:["Field type ",t.inputType," not supported"]})})})},"JSONSchemaFormFields");export{G as a};
|
|
2
|
+
//# sourceMappingURL=chunk-UP27IEE4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l as J}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{l as J}from"./chunk-4TJ2QZ7P.js";import{b as G,c as M,d as L}from"./chunk-T7O3YYOG.js";import{a as k}from"./chunk-D5NBOIPS.js";import{c as B,l as A}from"./chunk-ZSJ6YADQ.js";import{b as H}from"./chunk-KQPDXXG3.js";import{a as n,b as d,c as qe}from"./chunk-P37U34EQ.js";var D=d((En,U)=>{"use strict";function we(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}n(we,"isObject");U.exports=we});var X=d((In,V)=>{"use strict";var Fe=typeof global=="object"&&global&&global.Object===Object&&global;V.exports=Fe});var _=d((qn,z)=>{"use strict";var Pe=X(),ke=typeof self=="object"&&self&&self.Object===Object&&self,Me=Pe||ke||Function("return this")();z.exports=Me});var Q=d((wn,K)=>{"use strict";var Le=_(),De=n(function(){return Le.Date.now()},"now");K.exports=De});var Z=d((Pn,Y)=>{"use strict";var _e=/\s/;function $e(e){for(var t=e.length;t--&&_e.test(e.charAt(t)););return t}n($e,"trimmedEndIndex");Y.exports=$e});var ne=d((Mn,ee)=>{"use strict";var Ne=Z(),We=/^\s+/;function Be(e){return e&&e.slice(0,Ne(e)+1).replace(We,"")}n(Be,"baseTrim");ee.exports=Be});var $=d((Dn,te)=>{"use strict";var Ae=_(),He=Ae.Symbol;te.exports=He});var se=d((_n,ie)=>{"use strict";var re=$(),oe=Object.prototype,Ge=oe.hasOwnProperty,Je=oe.toString,O=re?re.toStringTag:void 0;function Ue(e){var t=Ge.call(e,O),r=e[O];try{e[O]=void 0;var i=!0}catch{}var u=Je.call(e);return i&&(t?e[O]=r:delete e[O]),u}n(Ue,"getRawTag");ie.exports=Ue});var ce=d((Nn,ae)=>{"use strict";var Ve=Object.prototype,Xe=Ve.toString;function ze(e){return Xe.call(e)}n(ze,"objectToString");ae.exports=ze});var le=d((Bn,de)=>{"use strict";var ue=$(),Ke=se(),Qe=ce(),Ye="[object Null]",Ze="[object Undefined]",fe=ue?ue.toStringTag:void 0;function en(e){return e==null?e===void 0?Ze:Ye:fe&&fe in Object(e)?Ke(e):Qe(e)}n(en,"baseGetTag");de.exports=en});var pe=d((Hn,me)=>{"use strict";function nn(e){return e!=null&&typeof e=="object"}n(nn,"isObjectLike");me.exports=nn});var be=d((Jn,ge)=>{"use strict";var tn=le(),rn=pe(),on="[object Symbol]";function sn(e){return typeof e=="symbol"||rn(e)&&tn(e)==on}n(sn,"isSymbol");ge.exports=sn});var Ce=d((Vn,xe)=>{"use strict";var an=ne(),ve=D(),cn=be(),ye=NaN,un=/^[-+]0x[0-9a-f]+$/i,fn=/^0b[01]+$/i,dn=/^0o[0-7]+$/i,ln=parseInt;function mn(e){if(typeof e=="number")return e;if(cn(e))return ye;if(ve(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ve(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=an(e);var r=fn.test(e);return r||dn.test(e)?ln(e.slice(2),r?2:8):un.test(e)?ye:+e}n(mn,"toNumber");xe.exports=mn});var Se=d((zn,Te)=>{"use strict";var pn=D(),N=Q(),he=Ce(),gn="Expected a function",bn=Math.max,vn=Math.min;function yn(e,t,r){var i,u,b,l,s,a,p=0,E=!1,f=!1,x=!0;if(typeof e!="function")throw new TypeError(gn);t=he(t)||0,pn(r)&&(E=!!r.leading,f="maxWait"in r,b=f?bn(he(r.maxWait)||0,t):b,x="trailing"in r?!!r.trailing:x);function C(o){var g=i,y=u;return i=u=void 0,p=o,l=e.apply(y,g),l}n(C,"invokeFunc");function R(o){return p=o,s=setTimeout(m,t),E?C(o):l}n(R,"leadingEdge");function q(o){var g=o-a,y=o-p,c=t-g;return f?vn(c,b-y):c}n(q,"remainingWait");function T(o){var g=o-a,y=o-p;return a===void 0||g>=t||g<0||f&&y>=b}n(T,"shouldInvoke");function m(){var o=N();if(T(o))return S(o);s=setTimeout(m,q(o))}n(m,"timerExpired");function S(o){return s=void 0,x&&i?C(o):(i=u=void 0,l)}n(S,"trailingEdge");function I(){s!==void 0&&clearTimeout(s),p=0,i=a=u=s=void 0}n(I,"cancel");function w(){return s===void 0?l:S(N())}n(w,"flush");function j(){var o=N(),g=T(o);if(i=arguments,u=this,a=o,g){if(s===void 0)return R(a);if(f)return clearTimeout(s),s=setTimeout(m,t),C(a)}return s===void 0&&(s=setTimeout(m,t)),l}return n(j,"debounced"),j.cancel=I,j.flush=w,j}n(yn,"debounce");Te.exports=yn});import{useState as hn,useCallback as Tn,useEffect as Ee,useRef as Sn}from"react";var Oe=qe(Se(),1);import{useCallback as xn,useEffect as Cn,useRef as je}from"react";function W(e,t){let r=je(e);Cn(()=>{r.current=e},[e]);let i=je((0,Oe.default)(u=>{r.current(u)},t)).current;return xn(u=>{i(u)},[i])}n(W,"useDebounce");import{Fragment as On,jsx as h,jsxs as Re}from"react/jsx-runtime";var jn=n(({description:e,showConversion:t,targetCurrency:r,className:i,onClick:u})=>{let{components:b}=H(),l=t?`Hide ${r} conversion`:`Show ${r} conversion`,s=b?.button;if(!s)throw new Error("Button component not found");return Re("span",{className:i,children:[h(A,{as:"span",children:e})," ",h(s,{className:`${i.replace("-description","-button")}`,"data-type":"inline",onClick:u,children:l})]})},"DescriptionWithConversion"),ut=n(({sourceCurrency:e,targetCurrency:t,mainFieldName:r,conversionFieldName:i,conversionProperties:u,classNamePrefix:b,description:l,conversionType:s="spread",...a})=>{let[p,E]=hn(!1),{setValue:f,watch:x}=B(),C=x(r||a.name),R=Sn(!0),q=e&&t&&e!==t,{mutateAsync:T}=J({type:s}),m=`${a.name}_converted`;Ee(()=>{f(m,r||a.name)},[f,r,a.name,m]),Ee(()=>{if(R.current){R.current=!1;return}f(i,"")},[e,i,f]);let S=Tn(async(c,v,F)=>{if(!(!c||isNaN(c)||c<=0))return T({source_currency:v,target_currency:F,amount:c})},[T]),I=W(async c=>{let v=M(c),P=1/((await S(v,t,e))?.data?.data.conversion_data?.exchange_rate??1),Ie=G(Number(v)*P);f(i,L(Ie))},500),w=W(async c=>{let v=M(c),P=(await S(v,t,e))?.data?.data.conversion_data.target_amount;f(r||a.name,L(P))},500),j=n(c=>{f(m,r||a.name),p&&I(c.target.value)},"handleMainFieldChange"),o=n(c=>{f(m,i),w(c.target.value)},"handleConversionFieldChange"),g=n(c=>{c.preventDefault(),E(v=>!v),!p&&C&&I(C)},"toggleConversion"),y=q?h(jn,{targetCurrency:t,description:l,showConversion:p,className:`${b}-description`,onClick:g}):l;return Re(On,{children:[h(k,{...a,name:r||a.name,additionalProps:{currency:e},description:y,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:j}),p&&h(k,{additionalProps:{currency:t},name:i,label:u?.label||"Conversion",description:u?.description,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:o}),h("input",{type:"hidden",name:m,value:x(m)||r||a.name})]})},"CurrencyConversionField");export{ut as a};
|
|
2
|
+
//# sourceMappingURL=chunk-VON7RTMD.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as r}from"./chunk-NX7MM6XR.js";import{a as t}from"./chunk-ZXGAFQXW.js";import{a}from"./chunk-LMYJ6V44.js";import{a as e}from"./chunk-TC7EQZJK.js";var i={data:{version:7,schema:{additionalProperties:!1,allOf:[...e.data.schema.allOf,...t.data.schema.allOf,...r.data.schema.allOf,...a.data.schema.allOf],properties:{...e.data.schema.properties,...t.data.schema.properties,...r.data.schema.properties,...a.data.schema.properties},required:[...e.data.schema.required,...t.data.schema.required,...r.data.schema.required,...a.data.schema.required],type:"object","x-jsf-order":[...e.data.schema["x-jsf-order"],...t.data.schema["x-jsf-order"],...r.data.schema["x-jsf-order"],...a.data.schema["x-jsf-order"]]}}};export{i as a};
|
|
2
|
+
//# sourceMappingURL=chunk-XGECMN4V.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as e}from"./chunk-I3J7LKY3.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-Y7NHXFRX.js.map
|
|
@@ -2,5 +2,5 @@ import{a as t}from"./chunk-P37U34EQ.js";var N=t((e,r,o)=>{typeof o=="string"||o
|
|
|
2
2
|
|
|
3
3
|
`);A=F.pop()??"";for(let oe of F){let ne=oe.split(`
|
|
4
4
|
`),I=[],V;for(let b of ne)if(b.startsWith("data:"))I.push(b.replace(/^data:\s*/,""));else if(b.startsWith("event:"))V=b.replace(/^event:\s*/,"");else if(b.startsWith("id:"))E=b.replace(/^id:\s*/,"");else if(b.startsWith("retry:")){let H=Number.parseInt(b.replace(/^retry:\s*/,""),10);Number.isNaN(H)||(m=H)}let P,M=!1;if(I.length){let b=I.join(`
|
|
5
|
-
`);try{P=JSON.parse(b),M=!0}catch{P=b}}M&&(i&&await i(P),s&&(P=await s(P))),o?.({data:P,event:V,id:E,retry:m}),I.length&&(yield P)}}}finally{T.removeEventListener("abort",L),w.releaseLock()}break}catch(x){if(r?.(x),c!==void 0&&C>=c)break;let O=Math.min(m*2**(C-1),p??3e4);await g(O)}}},"createStream")()}},"createSseClient");var se=t(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"separatorArrayExplode"),ae=t(e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},"separatorArrayNoExplode"),ie=t(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"separatorObjectExplode"),k=t(({allowReserved:e,explode:r,name:o,style:s,value:i})=>{if(!r){let p=(e?i:i.map(l=>encodeURIComponent(l))).join(ae(s));switch(s){case"label":return`.${p}`;case"matrix":return`;${o}=${p}`;case"simple":return p;default:return`${o}=${p}`}}let h=se(s),c=i.map(p=>s==="label"||s==="simple"?e?p:encodeURIComponent(p):R({allowReserved:e,name:o,value:p})).join(h);return s==="label"||s==="matrix"?h+c:c},"serializeArrayParam"),R=t(({allowReserved:e,name:r,value:o})=>{if(o==null)return"";if(typeof o=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?o:encodeURIComponent(o)}`},"serializePrimitiveParam"),U=t(({allowReserved:e,explode:r,name:o,style:s,value:i,valueOnly:h})=>{if(i instanceof Date)return h?i.toISOString():`${o}=${i.toISOString()}`;if(s!=="deepObject"&&!r){let l=[];Object.entries(i).forEach(([n,E])=>{l=[...l,n,e?E:encodeURIComponent(E)]});let d=l.join(",");switch(s){case"form":return`${o}=${d}`;case"label":return`.${d}`;case"matrix":return`;${o}=${d}`;default:return d}}let c=ie(s),p=Object.entries(i).map(([l,d])=>R({allowReserved:e,name:s==="deepObject"?`${o}[${l}]`:l,value:d})).join(c);return s==="label"||s==="matrix"?c+p:p},"serializeObjectParam");var pe=/\{[^{}]+\}/g,ce=t(({path:e,url:r})=>{let o=r,s=r.match(pe);if(s)for(let i of s){let h=!1,c=i.substring(1,i.length-1),p="simple";c.endsWith("*")&&(h=!0,c=c.substring(0,c.length-1)),c.startsWith(".")?(c=c.substring(1),p="label"):c.startsWith(";")&&(c=c.substring(1),p="matrix");let l=e[c];if(l==null)continue;if(Array.isArray(l)){o=o.replace(i,k({explode:h,name:c,style:p,value:l}));continue}if(typeof l=="object"){o=o.replace(i,U({explode:h,name:c,style:p,value:l,valueOnly:!0}));continue}if(p==="matrix"){o=o.replace(i,`;${R({name:c,value:l})}`);continue}let d=encodeURIComponent(p==="label"?`.${l}`:l);o=o.replace(i,d)}return o},"defaultPathSerializer"),$=t(({baseUrl:e,path:r,query:o,querySerializer:s,url:i})=>{let h=i.startsWith("/")?i:`/${i}`,c=(e??"")+h;r&&(c=ce({path:r,url:c}));let p=o?s(o):"";return p.startsWith("?")&&(p=p.substring(1)),p&&(c+=`?${p}`),c},"getUrl");function J(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}t(J,"getValidRequestBody");var K=t(async(e,r)=>{let o=typeof r=="function"?await r(e):r;if(o)return e.scheme==="bearer"?`Bearer ${o}`:e.scheme==="basic"?`Basic ${btoa(o)}`:o},"getAuthToken");var X=t(({parameters:e={},...r}={})=>t(s=>{let i=[];if(s&&typeof s=="object")for(let h in s){let c=s[h];if(c==null)continue;let p=e[h]||r;if(Array.isArray(c)){let l=k({allowReserved:p.allowReserved,explode:!0,name:h,style:"form",value:c,...p.array});l&&i.push(l)}else if(typeof c=="object"){let l=U({allowReserved:p.allowReserved,explode:!0,name:h,style:"deepObject",value:c,...p.object});l&&i.push(l)}else{let l=R({allowReserved:p.allowReserved,name:h,value:c});l&&i.push(l)}}return i.join("&")},"querySerializer"),"createQuerySerializer"),Y=t(e=>{if(!e)return"stream";let r=e.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(o=>r.startsWith(o)))return"blob";if(r.startsWith("text/"))return"text"}},"getParseAs"),le=t((e,r)=>r?!!(e.headers.has(r)||e.query?.[r]||e.headers.get("Cookie")?.includes(`${r}=`)):!1,"checkForExistence"),Z=t(async({security:e,...r})=>{for(let o of e){if(le(r,o.name))continue;let s=await K(o,r.auth);if(!s)continue;let i=o.name??"Authorization";switch(o.in){case"query":r.query||(r.query={}),r.query[i]=s;break;case"cookie":r.headers.append("Cookie",`${i}=${s}`);break;case"header":default:r.headers.set(i,s);break}}},"setAuthParams"),z=t(e=>$({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),"buildUrl"),W=t((e,r)=>{let o={...e,...r};return o.baseUrl?.endsWith("/")&&(o.baseUrl=o.baseUrl.substring(0,o.baseUrl.length-1)),o.headers=q(e.headers,r.headers),o},"mergeConfigs"),he=t(e=>{let r=[];return e.forEach((o,s)=>{r.push([s,o])}),r},"headersEntries"),q=t((...e)=>{let r=new Headers;for(let o of e){if(!o)continue;let s=o instanceof Headers?he(o):Object.entries(o);for(let[i,h]of s)if(h===null)r.delete(i);else if(Array.isArray(h))for(let c of h)r.append(i,c);else h!==void 0&&r.set(i,typeof h=="object"?JSON.stringify(h):h)}return r},"mergeHeaders"),G=class{static{t(this,"Interceptors")}fns=[];clear(){this.fns=[]}eject(r){let o=this.getInterceptorIndex(r);this.fns[o]&&(this.fns[o]=null)}exists(r){let o=this.getInterceptorIndex(r);return!!this.fns[o]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,o){let s=this.getInterceptorIndex(r);return this.fns[s]?(this.fns[s]=o,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=t(()=>({error:new G,request:new G,response:new G}),"createInterceptors"),me=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),de={"Content-Type":"application/json"},S=t((e={})=>({...j,headers:de,parseAs:"auto",querySerializer:me,...e}),"createConfig");var _=t((e={})=>{let r=W(S(),e),o=t(()=>({...r}),"getConfig"),s=t(d=>(r=W(r,d),o()),"setConfig"),i=ee(),h=t(async d=>{let n={...r,...d,fetch:d.fetch??r.fetch??globalThis.fetch,headers:q(r.headers,d.headers),serializedBody:void 0};n.security&&await Z({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody==="")&&n.headers.delete("Content-Type");let E=z(n);return{opts:n,url:E}},"beforeRequest"),c=t(async d=>{let{opts:n,url:E}=await h(d),g={redirect:"follow",...n,body:J(n)},f=new Request(E,g);for(let y of i.request.fns)y&&(f=await y(f,n));let v=n.fetch,m;try{m=await v(f)}catch(y){let u=y;for(let w of i.error.fns)w&&(u=await w(y,void 0,f,n));if(u=u||{},n.throwOnError)throw u;return n.responseStyle==="data"?void 0:{error:u,request:f,response:void 0}}for(let y of i.response.fns)y&&(m=await y(m,f,n));let C={request:f,response:m};if(m.ok){let y=(n.parseAs==="auto"?Y(m.headers.get("Content-Type")):n.parseAs)??"json";if(m.status===204||m.headers.get("Content-Length")==="0"){let w;switch(y){case"arrayBuffer":case"blob":case"text":w=await m[y]();break;case"formData":w=new FormData;break;case"stream":w=m.body;break;case"json":default:w={};break}return n.responseStyle==="data"?w:{data:w,...C}}let u;switch(y){case"arrayBuffer":case"blob":case"formData":case"json":case"text":u=await m[y]();break;case"stream":return n.responseStyle==="data"?m.body:{data:m.body,...C}}return y==="json"&&(n.responseValidator&&await n.responseValidator(u),n.responseTransformer&&(u=await n.responseTransformer(u))),n.responseStyle==="data"?u:{data:u,...C}}let T=await m.text(),D;try{D=JSON.parse(T)}catch{}let x=D??T,O=x;for(let y of i.error.fns)y&&(O=await y(x,m,f,n));if(O=O||{},n.throwOnError)throw O;return n.responseStyle==="data"?void 0:{error:O,...C}},"request"),p=t(d=>n=>c({...n,method:d}),"makeMethodFn"),l=t(d=>async n=>{let{opts:E,url:g}=await h(n);return Q({...E,body:E.body,headers:E.headers,method:d,onRequest:t(async(f,v)=>{let m=new Request(f,v);for(let C of i.request.fns)C&&(m=await C(m,E));return m},"onRequest"),url:g})},"makeSseFn");return{buildUrl:z,connect:p("CONNECT"),delete:p("DELETE"),get:p("GET"),getConfig:o,head:p("HEAD"),interceptors:i,options:p("OPTIONS"),patch:p("PATCH"),post:p("POST"),put:p("PUT"),request:c,setConfig:s,sse:{connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),head:l("HEAD"),options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),trace:l("TRACE")},trace:p("TRACE")}},"createClient");var a=_(S({baseUrl:"https://gateway.remote.com/"}));var He=t(e=>(e?.client??a).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/offboardings",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateOffboarding");var Ne=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments/schema",...e}),"getShowContractAmendmentSchema");var Qe=t(e=>(e.client??a).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"),$e=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/countries/{country_code}/contractor-contract-details",...e}),"getShowContractorContractDetailsCountry");var Je=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postCreateEmployment2"),Ke=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/help-center-articles/{id}",...e}),"getShowHelpCenterArticle");var Xe=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/sdk/telemetry-errors",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postReportErrorsTelemetry");var Ye=t(e=>(e.client??a).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 Ze=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers",...e}),"getIndexBenefitOffer"),et=t(e=>(e.client??a).put({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers",...e,headers:{"Content-Type":"application/json",...e.headers}}),"putUpdateBenefitOffer");var tt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contractor-subscriptions",...e}),"getIndexSubscription");var rt=t(e=>(e?.client??a).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/payroll-calendars",...e}),"getIndexEorPayrollCalendar");var ot=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contract-documents/{id}",...e}),"getShowContractDocument"),nt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/contract-documents",...e}),"getIndexEmploymentContractDocument");var st=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/magic-link",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postGenerateMagicLink");var at=t(e=>(e?.client??a).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 it=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/risk-reserve",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postCreateRiskReserve");var pt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/companies/{company_id}",...e}),"getShowCompany");var ct=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postCreateContractAmendment");var lt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/countries/{country_code}/{form}",...e}),"getShowFormCountry"),ht=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/files/{id}",...e}),"getShowFile");var mt=t(e=>(e?.client??a).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 dt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/leave-policies/summary/{employment_id}",...e}),"getIndexLeavePoliciesSummary");var yt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers/schema",...e}),"getShowSchema"),ut=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/eligibility-questionnaire",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postCreateEligibilityQuestionnaire");var Et=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}",...e}),"getShowEmployment"),Ct=t(e=>(e.client??a).patch({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}",...e,headers:{"Content-Type":"application/json",...e.headers}}),"patchUpdateEmployment2");var wt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/regions/{slug}/fields",...e}),"getShowRegionField");var ft=t(e=>(e.client??a).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"),bt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/countries",...e}),"getSupportedCountry");var Ot=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/companies/{company_id}/legal-entities",...e}),"getIndexCompanyLegalEntities");var Tt=t(e=>(e?.client??a).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"),xt=t(e=>(e.client??a).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 Pt=t(e=>(e.client??a).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 Rt=t(e=>(e.client??a).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 gt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/files",...e}),"getIndexEmploymentFile");var Dt=t(e=>(e?.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/company-currencies",...e}),"getIndexCompanyCurrency");var Gt=t(e=>(e.client??a).post({...B,security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/documents",...e,headers:{"Content-Type":null,...e.headers}}),"postUploadEmployeeFileFile"),St=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/invite",...e}),"postInviteEmploymentInvitation");var vt=t(e=>(e.client??a).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"),It=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/identity/current",...e}),"getCurrentIdentity");var kt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/schemas/eligibility-questionnaire",...e}),"getShowEligibilityQuestionnaire");var Ut=t(e=>(e.client??a).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"),qt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/timeoff",...e}),"getIndexTimeoff");var At=t(e=>(e.client??a).delete({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contractor-cor-subscription",...e}),"deleteDeleteContractorCorSubscriptionSubscription"),Bt=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contractor-cor-subscription",...e}),"postManageContractorCorSubscriptionSubscription");export{_ as a,a as b,He as c,Ne as d,Qe as e,$e as f,Je as g,Ke as h,Xe as i,Ye as j,Ze as k,et as l,tt as m,rt as n,ot as o,nt as p,st as q,at as r,it as s,pt as t,ct as u,lt as v,ht as w,mt as x,dt as y,yt as z,ut as A,Et as B,Ct as C,wt as D,ft as E,bt as F,Ot as G,Tt as H,xt as I,Pt as J,Rt as K,gt as L,Dt as M,Gt as N,St as O,vt as P,It as Q,kt as R,Ut as S,qt as T,At as U,Bt as V};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
`);try{P=JSON.parse(b),M=!0}catch{P=b}}M&&(i&&await i(P),s&&(P=await s(P))),o?.({data:P,event:V,id:E,retry:m}),I.length&&(yield P)}}}finally{T.removeEventListener("abort",L),w.releaseLock()}break}catch(x){if(r?.(x),c!==void 0&&C>=c)break;let O=Math.min(m*2**(C-1),p??3e4);await g(O)}}},"createStream")()}},"createSseClient");var se=t(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"separatorArrayExplode"),ae=t(e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},"separatorArrayNoExplode"),ie=t(e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"separatorObjectExplode"),k=t(({allowReserved:e,explode:r,name:o,style:s,value:i})=>{if(!r){let p=(e?i:i.map(l=>encodeURIComponent(l))).join(ae(s));switch(s){case"label":return`.${p}`;case"matrix":return`;${o}=${p}`;case"simple":return p;default:return`${o}=${p}`}}let h=se(s),c=i.map(p=>s==="label"||s==="simple"?e?p:encodeURIComponent(p):R({allowReserved:e,name:o,value:p})).join(h);return s==="label"||s==="matrix"?h+c:c},"serializeArrayParam"),R=t(({allowReserved:e,name:r,value:o})=>{if(o==null)return"";if(typeof o=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${e?o:encodeURIComponent(o)}`},"serializePrimitiveParam"),U=t(({allowReserved:e,explode:r,name:o,style:s,value:i,valueOnly:h})=>{if(i instanceof Date)return h?i.toISOString():`${o}=${i.toISOString()}`;if(s!=="deepObject"&&!r){let l=[];Object.entries(i).forEach(([n,E])=>{l=[...l,n,e?E:encodeURIComponent(E)]});let d=l.join(",");switch(s){case"form":return`${o}=${d}`;case"label":return`.${d}`;case"matrix":return`;${o}=${d}`;default:return d}}let c=ie(s),p=Object.entries(i).map(([l,d])=>R({allowReserved:e,name:s==="deepObject"?`${o}[${l}]`:l,value:d})).join(c);return s==="label"||s==="matrix"?c+p:p},"serializeObjectParam");var pe=/\{[^{}]+\}/g,ce=t(({path:e,url:r})=>{let o=r,s=r.match(pe);if(s)for(let i of s){let h=!1,c=i.substring(1,i.length-1),p="simple";c.endsWith("*")&&(h=!0,c=c.substring(0,c.length-1)),c.startsWith(".")?(c=c.substring(1),p="label"):c.startsWith(";")&&(c=c.substring(1),p="matrix");let l=e[c];if(l==null)continue;if(Array.isArray(l)){o=o.replace(i,k({explode:h,name:c,style:p,value:l}));continue}if(typeof l=="object"){o=o.replace(i,U({explode:h,name:c,style:p,value:l,valueOnly:!0}));continue}if(p==="matrix"){o=o.replace(i,`;${R({name:c,value:l})}`);continue}let d=encodeURIComponent(p==="label"?`.${l}`:l);o=o.replace(i,d)}return o},"defaultPathSerializer"),$=t(({baseUrl:e,path:r,query:o,querySerializer:s,url:i})=>{let h=i.startsWith("/")?i:`/${i}`,c=(e??"")+h;r&&(c=ce({path:r,url:c}));let p=o?s(o):"";return p.startsWith("?")&&(p=p.substring(1)),p&&(c+=`?${p}`),c},"getUrl");function J(e){let r=e.body!==void 0;if(r&&e.bodySerializer)return"serializedBody"in e?e.serializedBody!==void 0&&e.serializedBody!==""?e.serializedBody:null:e.body!==""?e.body:null;if(r)return e.body}t(J,"getValidRequestBody");var K=t(async(e,r)=>{let o=typeof r=="function"?await r(e):r;if(o)return e.scheme==="bearer"?`Bearer ${o}`:e.scheme==="basic"?`Basic ${btoa(o)}`:o},"getAuthToken");var X=t(({parameters:e={},...r}={})=>t(s=>{let i=[];if(s&&typeof s=="object")for(let h in s){let c=s[h];if(c==null)continue;let p=e[h]||r;if(Array.isArray(c)){let l=k({allowReserved:p.allowReserved,explode:!0,name:h,style:"form",value:c,...p.array});l&&i.push(l)}else if(typeof c=="object"){let l=U({allowReserved:p.allowReserved,explode:!0,name:h,style:"deepObject",value:c,...p.object});l&&i.push(l)}else{let l=R({allowReserved:p.allowReserved,name:h,value:c});l&&i.push(l)}}return i.join("&")},"querySerializer"),"createQuerySerializer"),Y=t(e=>{if(!e)return"stream";let r=e.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(o=>r.startsWith(o)))return"blob";if(r.startsWith("text/"))return"text"}},"getParseAs"),le=t((e,r)=>r?!!(e.headers.has(r)||e.query?.[r]||e.headers.get("Cookie")?.includes(`${r}=`)):!1,"checkForExistence"),Z=t(async({security:e,...r})=>{for(let o of e){if(le(r,o.name))continue;let s=await K(o,r.auth);if(!s)continue;let i=o.name??"Authorization";switch(o.in){case"query":r.query||(r.query={}),r.query[i]=s;break;case"cookie":r.headers.append("Cookie",`${i}=${s}`);break;case"header":default:r.headers.set(i,s);break}}},"setAuthParams"),z=t(e=>$({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:X(e.querySerializer),url:e.url}),"buildUrl"),W=t((e,r)=>{let o={...e,...r};return o.baseUrl?.endsWith("/")&&(o.baseUrl=o.baseUrl.substring(0,o.baseUrl.length-1)),o.headers=q(e.headers,r.headers),o},"mergeConfigs"),he=t(e=>{let r=[];return e.forEach((o,s)=>{r.push([s,o])}),r},"headersEntries"),q=t((...e)=>{let r=new Headers;for(let o of e){if(!o)continue;let s=o instanceof Headers?he(o):Object.entries(o);for(let[i,h]of s)if(h===null)r.delete(i);else if(Array.isArray(h))for(let c of h)r.append(i,c);else h!==void 0&&r.set(i,typeof h=="object"?JSON.stringify(h):h)}return r},"mergeHeaders"),G=class{static{t(this,"Interceptors")}fns=[];clear(){this.fns=[]}eject(r){let o=this.getInterceptorIndex(r);this.fns[o]&&(this.fns[o]=null)}exists(r){let o=this.getInterceptorIndex(r);return!!this.fns[o]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,o){let s=this.getInterceptorIndex(r);return this.fns[s]?(this.fns[s]=o,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},ee=t(()=>({error:new G,request:new G,response:new G}),"createInterceptors"),me=X({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),de={"Content-Type":"application/json"},S=t((e={})=>({...j,headers:de,parseAs:"auto",querySerializer:me,...e}),"createConfig");var _=t((e={})=>{let r=W(S(),e),o=t(()=>({...r}),"getConfig"),s=t(d=>(r=W(r,d),o()),"setConfig"),i=ee(),h=t(async d=>{let n={...r,...d,fetch:d.fetch??r.fetch??globalThis.fetch,headers:q(r.headers,d.headers),serializedBody:void 0};n.security&&await Z({...n,security:n.security}),n.requestValidator&&await n.requestValidator(n),n.body!==void 0&&n.bodySerializer&&(n.serializedBody=n.bodySerializer(n.body)),(n.body===void 0||n.serializedBody==="")&&n.headers.delete("Content-Type");let E=z(n);return{opts:n,url:E}},"beforeRequest"),c=t(async d=>{let{opts:n,url:E}=await h(d),g={redirect:"follow",...n,body:J(n)},f=new Request(E,g);for(let y of i.request.fns)y&&(f=await y(f,n));let v=n.fetch,m;try{m=await v(f)}catch(y){let u=y;for(let w of i.error.fns)w&&(u=await w(y,void 0,f,n));if(u=u||{},n.throwOnError)throw u;return n.responseStyle==="data"?void 0:{error:u,request:f,response:void 0}}for(let y of i.response.fns)y&&(m=await y(m,f,n));let C={request:f,response:m};if(m.ok){let y=(n.parseAs==="auto"?Y(m.headers.get("Content-Type")):n.parseAs)??"json";if(m.status===204||m.headers.get("Content-Length")==="0"){let w;switch(y){case"arrayBuffer":case"blob":case"text":w=await m[y]();break;case"formData":w=new FormData;break;case"stream":w=m.body;break;case"json":default:w={};break}return n.responseStyle==="data"?w:{data:w,...C}}let u;switch(y){case"arrayBuffer":case"blob":case"formData":case"json":case"text":u=await m[y]();break;case"stream":return n.responseStyle==="data"?m.body:{data:m.body,...C}}return y==="json"&&(n.responseValidator&&await n.responseValidator(u),n.responseTransformer&&(u=await n.responseTransformer(u))),n.responseStyle==="data"?u:{data:u,...C}}let T=await m.text(),D;try{D=JSON.parse(T)}catch{}let x=D??T,O=x;for(let y of i.error.fns)y&&(O=await y(x,m,f,n));if(O=O||{},n.throwOnError)throw O;return n.responseStyle==="data"?void 0:{error:O,...C}},"request"),p=t(d=>n=>c({...n,method:d}),"makeMethodFn"),l=t(d=>async n=>{let{opts:E,url:g}=await h(n);return Q({...E,body:E.body,headers:E.headers,method:d,onRequest:t(async(f,v)=>{let m=new Request(f,v);for(let C of i.request.fns)C&&(m=await C(m,E));return m},"onRequest"),url:g})},"makeSseFn");return{buildUrl:z,connect:p("CONNECT"),delete:p("DELETE"),get:p("GET"),getConfig:o,head:p("HEAD"),interceptors:i,options:p("OPTIONS"),patch:p("PATCH"),post:p("POST"),put:p("PUT"),request:c,setConfig:s,sse:{connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),head:l("HEAD"),options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),trace:l("TRACE")},trace:p("TRACE")}},"createClient");var a=_(S({baseUrl:"https://gateway.remote.com/"}));var He=t(e=>(e?.client??a).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/offboardings",...e,headers:{"Content-Type":"application/json",...e?.headers}}),"postCreateOffboarding");var Ne=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/cancel-onboarding/{employment_id}",...e}),"postUpdateCancelOnboarding"),Qe=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments/schema",...e}),"getShowContractAmendmentSchema");var $e=t(e=>(e.client??a).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"),Je=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/countries/{country_code}/contractor-contract-details",...e}),"getShowContractorContractDetailsCountry");var Ke=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postCreateEmployment2"),Xe=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/help-center-articles/{id}",...e}),"getShowHelpCenterArticle");var Ye=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/sdk/telemetry-errors",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postReportErrorsTelemetry");var Ze=t(e=>(e.client??a).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 et=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers",...e}),"getIndexBenefitOffer"),tt=t(e=>(e.client??a).put({security:[{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers",...e,headers:{"Content-Type":"application/json",...e.headers}}),"putUpdateBenefitOffer");var rt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contractor-subscriptions",...e}),"getIndexSubscription");var ot=t(e=>(e?.client??a).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/payroll-calendars",...e}),"getIndexEorPayrollCalendar");var nt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contract-documents/{id}",...e}),"getShowContractDocument"),st=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/contract-documents",...e}),"getIndexEmploymentContractDocument");var at=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"}],url:"/v1/magic-link",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postGenerateMagicLink");var it=t(e=>(e?.client??a).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 pt=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/risk-reserve",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postCreateRiskReserve");var ct=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/companies/{company_id}",...e}),"getShowCompany");var lt=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contract-amendments",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postCreateContractAmendment");var ht=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/countries/{country_code}/{form}",...e}),"getShowFormCountry"),mt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/files/{id}",...e}),"getShowFile");var dt=t(e=>(e?.client??a).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 yt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/leave-policies/summary/{employment_id}",...e}),"getIndexLeavePoliciesSummary");var ut=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/benefit-offers/schema",...e}),"getShowSchema"),Et=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/eligibility-questionnaire",...e,headers:{"Content-Type":"application/json",...e.headers}}),"postCreateEligibilityQuestionnaire");var Ct=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}",...e}),"getShowEmployment"),wt=t(e=>(e.client??a).patch({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}",...e,headers:{"Content-Type":"application/json",...e.headers}}),"patchUpdateEmployment2");var ft=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/cost-calculator/regions/{slug}/fields",...e}),"getShowRegionField");var bt=t(e=>(e.client??a).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"),Ot=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/countries",...e}),"getSupportedCountry");var Tt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/companies/{company_id}/legal-entities",...e}),"getIndexCompanyLegalEntities");var xt=t(e=>(e?.client??a).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"),Pt=t(e=>(e.client??a).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 Rt=t(e=>(e.client??a).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 gt=t(e=>(e.client??a).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 Dt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/files",...e}),"getIndexEmploymentFile");var Gt=t(e=>(e?.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/company-currencies",...e}),"getIndexCompanyCurrency");var St=t(e=>(e.client??a).post({...B,security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/documents",...e,headers:{"Content-Type":null,...e.headers}}),"postUploadEmployeeFileFile"),vt=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/employments/{employment_id}/invite",...e}),"postInviteEmploymentInvitation");var It=t(e=>(e.client??a).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"),kt=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"}],url:"/v1/identity/current",...e}),"getCurrentIdentity");var Ut=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/schemas/eligibility-questionnaire",...e}),"getShowEligibilityQuestionnaire");var qt=t(e=>(e.client??a).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"),At=t(e=>(e.client??a).get({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/timeoff",...e}),"getIndexTimeoff");var Bt=t(e=>(e.client??a).delete({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contractor-cor-subscription",...e}),"deleteDeleteContractorCorSubscriptionSubscription"),jt=t(e=>(e.client??a).post({security:[{scheme:"bearer",type:"http"},{scheme:"bearer",type:"http"}],url:"/v1/contractors/employments/{employment_id}/contractor-cor-subscription",...e}),"postManageContractorCorSubscriptionSubscription");export{_ as a,a as b,He as c,Ne as d,Qe as e,$e as f,Je as g,Ke as h,Xe as i,Ye as j,Ze as k,et as l,tt as m,rt as n,ot as o,nt as p,st as q,at as r,it as s,pt as t,ct as u,lt as v,ht as w,mt as x,dt as y,yt as z,ut as A,Et as B,Ct as C,wt as D,ft as E,bt as F,Ot as G,Tt as H,xt as I,Pt as J,Rt as K,gt as L,Dt as M,Gt as N,St as O,vt as P,It as Q,kt as R,Ut as S,qt as T,At as U,Bt as V,jt as W};
|
|
6
|
+
//# sourceMappingURL=chunk-YAJJJ2JV.js.map
|