@remoteoss/remote-flows 1.19.0 → 1.21.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/ButtonDefault-2YV2Z474.js +2 -0
- package/dist/{CountryFieldDefault-X7772U44.js → CountryFieldDefault-IBVQJVMW.js} +2 -2
- package/dist/DatePickerFieldDefault-5LEOVIM2.js +2 -0
- package/dist/FieldsetToggleButtonDefault-MFLN2WWT.js +2 -0
- package/dist/FileUploadFieldDefault-Y2ZYBSTV.js +2 -0
- package/dist/MultiSelectFieldDefault-UK7652MS.js +2 -0
- package/dist/{WorkScheduleFieldDefault-FPXVZLXP.js → WorkScheduleFieldDefault-SR3G37MN.js} +2 -2
- package/dist/{chunk-U4H65USG.js → chunk-24FMEFH5.js} +2 -2
- package/dist/{chunk-PP25XZSV.js → chunk-2V7SP7UR.js} +2 -2
- package/dist/{chunk-ZWIH53GL.js → chunk-3C6N7DK6.js} +2 -2
- package/dist/{chunk-FUGPVPYX.js → chunk-3NESYBEJ.js} +2 -2
- package/dist/{chunk-N7CS4LVY.js → chunk-3OJVYYPZ.js} +2 -2
- package/dist/chunk-42R2H2DW.js +2 -0
- package/dist/chunk-4OJ4TAXO.js +2 -0
- package/dist/chunk-4OJ4TAXO.js.map +1 -0
- package/dist/{chunk-YMNB6DO2.js → chunk-5OHSFPY6.js} +2 -2
- package/dist/{chunk-EFLRT7G5.js → chunk-5YRQBCHM.js} +2 -2
- package/dist/chunk-6JTHV4QS.js +2 -0
- package/dist/chunk-6JTHV4QS.js.map +1 -0
- package/dist/{chunk-QH57S4OP.js → chunk-7EUMRKH4.js} +2 -2
- package/dist/{chunk-2QGJBYQP.js → chunk-7FBVVWZL.js} +2 -2
- package/dist/chunk-AHRG5QCS.js +2 -0
- package/dist/chunk-AHRG5QCS.js.map +1 -0
- package/dist/{chunk-WUOSCFTG.js → chunk-ATVQXA4X.js} +2 -2
- package/dist/chunk-AYC6DTFV.js +2 -0
- package/dist/chunk-AYC6DTFV.js.map +1 -0
- package/dist/{chunk-EKR5ME7C.js → chunk-BIP2WGMA.js} +2 -2
- package/dist/{chunk-WH4AY6UO.js → chunk-BLGKOMH3.js} +2 -2
- package/dist/{chunk-RQJYOWP4.js → chunk-BNHZ4W7L.js} +2 -2
- package/dist/{chunk-QYWF2RMX.js → chunk-BTS5Q6UZ.js} +2 -2
- package/dist/{chunk-BAGPUVVO.js → chunk-BUOCIXUH.js} +2 -2
- package/dist/{chunk-SS2FAFUZ.js → chunk-BYDQHL6O.js} +2 -2
- package/dist/{chunk-3DKYJYLD.js → chunk-DPRCPBRB.js} +2 -2
- package/dist/chunk-DPVXSN7T.js +2 -0
- package/dist/chunk-DPVXSN7T.js.map +1 -0
- package/dist/{chunk-P7P5KATB.js → chunk-DUEZWXBY.js} +2 -2
- package/dist/chunk-EFRT6C7V.js +2 -0
- package/dist/chunk-EFRT6C7V.js.map +1 -0
- package/dist/{chunk-3W3VKY2J.js → chunk-EMP4ZIVB.js} +2 -2
- package/dist/chunk-ENW77KKX.js +2 -0
- package/dist/chunk-ENW77KKX.js.map +1 -0
- package/dist/{chunk-QEEZZSOQ.js → chunk-FYSLOFAJ.js} +2 -2
- package/dist/{chunk-FVBPHUV6.js → chunk-I5FVESDZ.js} +2 -2
- package/dist/{chunk-NEKE5PRJ.js → chunk-IF42CZJH.js} +2 -2
- package/dist/{chunk-VYINI3DD.js → chunk-IVXIAOMR.js} +2 -2
- package/dist/chunk-IYCOIHYW.js +2 -0
- package/dist/chunk-IYCOIHYW.js.map +1 -0
- package/dist/{chunk-W4RON3XZ.js → chunk-JFJIYAMB.js} +2 -2
- package/dist/chunk-JIW2JK7J.js +2 -0
- package/dist/chunk-JIW2JK7J.js.map +1 -0
- package/dist/{chunk-R7R6D7D4.js → chunk-JTPKAIYL.js} +2 -2
- package/dist/{chunk-D3EB2FG3.js → chunk-JZM3TDK2.js} +2 -2
- package/dist/{chunk-4QNOC3FL.js → chunk-KANAWPXZ.js} +2 -2
- package/dist/{chunk-U32PNP6D.js → chunk-LSW66EIR.js} +2 -2
- package/dist/{chunk-UKTMSVMG.js → chunk-M7KQPXCS.js} +2 -2
- package/dist/{chunk-FDEJ4CIO.js → chunk-MGY23P25.js} +2 -2
- package/dist/chunk-MP3VDCI7.js +2 -0
- package/dist/chunk-MP3VDCI7.js.map +1 -0
- package/dist/{chunk-FY5OFJRY.js → chunk-MVQOMW7S.js} +2 -2
- package/dist/{chunk-E2ONHNZD.js → chunk-MXSKCQOT.js} +2 -2
- package/dist/{chunk-IGLKMXWJ.js → chunk-NAMR4DA5.js} +2 -2
- package/dist/chunk-PGVYRAFJ.js +2 -0
- package/dist/chunk-PGVYRAFJ.js.map +1 -0
- package/dist/chunk-PX5PE6GX.js +2 -0
- package/dist/chunk-PX5PE6GX.js.map +1 -0
- package/dist/{chunk-RZQIAOMZ.js → chunk-Q72MEHVY.js} +2 -2
- package/dist/chunk-ROQYHTFQ.js +2 -0
- package/dist/chunk-ROQYHTFQ.js.map +1 -0
- package/dist/{chunk-2HBSVDEH.js → chunk-T5JT2ZU2.js} +2 -2
- package/dist/{chunk-7RP5F62S.js → chunk-VPSESR6G.js} +2 -2
- package/dist/{chunk-7FHNJWIY.js → chunk-VXMLYWZ2.js} +2 -2
- package/dist/{chunk-ONXEJSDK.js → chunk-VZV7ZSZ5.js} +2 -2
- package/dist/{chunk-GCMEX4I6.js → chunk-WOWIJ56S.js} +2 -2
- package/dist/{chunk-IYQDAHMG.js → chunk-WPC2PZ6E.js} +2 -2
- package/dist/chunk-WZSDVFJ3.js +2 -0
- package/dist/chunk-WZSDVFJ3.js.map +1 -0
- package/dist/chunk-YC7FCCXS.js +2 -0
- package/dist/chunk-YC7FCCXS.js.map +1 -0
- package/dist/{chunk-QLMEA4FA.js → chunk-YHQQSL4Q.js} +2 -2
- package/dist/{chunk-WURYTVWC.js → chunk-YSDNZHEB.js} +2 -2
- package/dist/{chunk-AJCKNHZB.js → chunk-YWOJ4NKF.js} +2 -2
- package/dist/{chunk-AUV3PA2A.js → chunk-Z6B3PA4M.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/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 +6 -5
- package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
- package/dist/flows/ContractorOnboarding/api.d.ts +2 -2
- 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/ContractDetailsStep.d.ts +6 -5
- 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 +6 -5
- package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
- package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.d.ts +6 -5
- 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 +6 -5
- package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
- package/dist/flows/ContractorOnboarding/components/SaveDraftButton.d.ts +20 -0
- package/dist/flows/ContractorOnboarding/components/SaveDraftButton.js +2 -0
- package/dist/flows/ContractorOnboarding/components/SaveDraftButton.js.map +1 -0
- 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 +7 -5
- package/dist/flows/ContractorOnboarding/hooks.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/hooks.js +1 -1
- package/dist/flows/ContractorOnboarding/index.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/index.js +1 -1
- package/dist/flows/ContractorOnboarding/jsfModify.d.ts +8 -7
- package/dist/flows/ContractorOnboarding/jsfModify.js +1 -1
- package/dist/flows/ContractorOnboarding/types.d.ts +6 -5
- package/dist/flows/ContractorOnboarding/utils.d.ts +12 -5
- 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/SummaryResults/SummaryResults.js +1 -1
- package/dist/flows/CostCalculator/api.d.ts +2 -2
- package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
- 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/CreateCompany/CreateCompany.d.ts +4 -4
- package/dist/flows/CreateCompany/CreateCompany.js +1 -1
- package/dist/flows/CreateCompany/api.d.ts +2 -2
- package/dist/flows/CreateCompany/components/AddressDetailsStep.d.ts +4 -4
- package/dist/flows/CreateCompany/components/AddressDetailsStep.js +1 -1
- package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.d.ts +4 -4
- package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.js +1 -1
- package/dist/flows/CreateCompany/components/CreateCompanyForm.d.ts +2 -2
- package/dist/flows/CreateCompany/components/CreateCompanyForm.js +1 -1
- package/dist/flows/CreateCompany/context.d.ts +4 -4
- package/dist/flows/CreateCompany/hooks.d.ts +4 -4
- package/dist/flows/CreateCompany/index.d.ts +4 -4
- package/dist/flows/CreateCompany/index.js +1 -1
- package/dist/flows/CreateCompany/types.d.ts +4 -4
- 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/components/AnnualGrossSalary.d.ts +2 -2
- 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/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 +4 -4
- 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/PaidTimeOff/PaidTimeOff.d.ts +6 -6
- package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
- 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/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +12 -11
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internals.d.ts +5 -9
- package/dist/internals.js +1 -1
- package/dist/{mutations-BsydWn3-.d.ts → mutations-Cw8GlAq0.d.ts} +1 -1
- package/dist/{remoteFlows-BVt9wH8Z.d.ts → remoteFlows-E3wOGnCt.d.ts} +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/dist/{types-C0ri3b3L.d.ts → types-BDH4I_fE.d.ts} +1 -1
- package/dist/{types-BfQMv-8p.d.ts → types-ByTWAmkv.d.ts} +2 -2
- package/dist/{types-DqoTDHM1.d.ts → types-DsVpuWHl.d.ts} +10 -3
- package/dist/{types-5zVzEzw3.d.ts → types-LjlUphtT.d.ts} +18 -5
- package/dist/{types-uW0BsP56.d.ts → types-RXM_JpA8.d.ts} +3 -3
- package/dist/{types.gen-Oz2Tvvr6.d.ts → types.gen-DdX2syl4.d.ts} +1 -1
- package/dist/{utils-Db2G1Kxo.d.ts → utils-BDEB1dzv.d.ts} +1 -1
- package/package.json +1 -3
- package/dist/ButtonDefault-6LBHWUQH.js +0 -2
- package/dist/DatePickerFieldDefault-7HPCPBEI.js +0 -2
- package/dist/FieldsetToggleButtonDefault-MXBQJ55Q.js +0 -2
- package/dist/FileUploadFieldDefault-T7EK7RTI.js +0 -2
- package/dist/MultiSelectFieldDefault-57GAREIU.js +0 -2
- package/dist/chunk-3GBODX6S.js +0 -2
- package/dist/chunk-3GBODX6S.js.map +0 -1
- package/dist/chunk-6EAABHVV.js +0 -2
- package/dist/chunk-6EAABHVV.js.map +0 -1
- package/dist/chunk-ALVZNFB7.js +0 -2
- package/dist/chunk-ALVZNFB7.js.map +0 -1
- package/dist/chunk-CRKLC7BP.js +0 -2
- package/dist/chunk-CRKLC7BP.js.map +0 -1
- package/dist/chunk-GSPD4EIV.js +0 -2
- package/dist/chunk-GSPD4EIV.js.map +0 -1
- package/dist/chunk-KRSUSMJK.js +0 -2
- package/dist/chunk-KRSUSMJK.js.map +0 -1
- package/dist/chunk-LHEF2FN7.js +0 -2
- package/dist/chunk-LHEF2FN7.js.map +0 -1
- package/dist/chunk-MTYN4AM3.js +0 -2
- package/dist/chunk-RJY6AEJB.js +0 -2
- package/dist/chunk-RJY6AEJB.js.map +0 -1
- package/dist/chunk-TXQWBDNF.js +0 -2
- package/dist/chunk-TXQWBDNF.js.map +0 -1
- package/dist/chunk-U2LHFJXY.js +0 -2
- package/dist/chunk-U2LHFJXY.js.map +0 -1
- package/dist/chunk-UAWJQ3EH.js +0 -2
- package/dist/chunk-UAWJQ3EH.js.map +0 -1
- package/dist/chunk-VWFZ6CMP.js +0 -2
- package/dist/chunk-VWFZ6CMP.js.map +0 -1
- package/dist/chunk-WFXSA66P.js +0 -2
- package/dist/chunk-WFXSA66P.js.map +0 -1
- package/dist/chunk-YBAV2FE4.js +0 -2
- package/dist/chunk-YBAV2FE4.js.map +0 -1
- /package/dist/{ButtonDefault-6LBHWUQH.js.map → ButtonDefault-2YV2Z474.js.map} +0 -0
- /package/dist/{CountryFieldDefault-X7772U44.js.map → CountryFieldDefault-IBVQJVMW.js.map} +0 -0
- /package/dist/{DatePickerFieldDefault-7HPCPBEI.js.map → DatePickerFieldDefault-5LEOVIM2.js.map} +0 -0
- /package/dist/{FieldsetToggleButtonDefault-MXBQJ55Q.js.map → FieldsetToggleButtonDefault-MFLN2WWT.js.map} +0 -0
- /package/dist/{FileUploadFieldDefault-T7EK7RTI.js.map → FileUploadFieldDefault-Y2ZYBSTV.js.map} +0 -0
- /package/dist/{MultiSelectFieldDefault-57GAREIU.js.map → MultiSelectFieldDefault-UK7652MS.js.map} +0 -0
- /package/dist/{WorkScheduleFieldDefault-FPXVZLXP.js.map → WorkScheduleFieldDefault-SR3G37MN.js.map} +0 -0
- /package/dist/{chunk-U4H65USG.js.map → chunk-24FMEFH5.js.map} +0 -0
- /package/dist/{chunk-PP25XZSV.js.map → chunk-2V7SP7UR.js.map} +0 -0
- /package/dist/{chunk-ZWIH53GL.js.map → chunk-3C6N7DK6.js.map} +0 -0
- /package/dist/{chunk-FUGPVPYX.js.map → chunk-3NESYBEJ.js.map} +0 -0
- /package/dist/{chunk-N7CS4LVY.js.map → chunk-3OJVYYPZ.js.map} +0 -0
- /package/dist/{chunk-MTYN4AM3.js.map → chunk-42R2H2DW.js.map} +0 -0
- /package/dist/{chunk-YMNB6DO2.js.map → chunk-5OHSFPY6.js.map} +0 -0
- /package/dist/{chunk-EFLRT7G5.js.map → chunk-5YRQBCHM.js.map} +0 -0
- /package/dist/{chunk-QH57S4OP.js.map → chunk-7EUMRKH4.js.map} +0 -0
- /package/dist/{chunk-2QGJBYQP.js.map → chunk-7FBVVWZL.js.map} +0 -0
- /package/dist/{chunk-WUOSCFTG.js.map → chunk-ATVQXA4X.js.map} +0 -0
- /package/dist/{chunk-EKR5ME7C.js.map → chunk-BIP2WGMA.js.map} +0 -0
- /package/dist/{chunk-WH4AY6UO.js.map → chunk-BLGKOMH3.js.map} +0 -0
- /package/dist/{chunk-RQJYOWP4.js.map → chunk-BNHZ4W7L.js.map} +0 -0
- /package/dist/{chunk-QYWF2RMX.js.map → chunk-BTS5Q6UZ.js.map} +0 -0
- /package/dist/{chunk-BAGPUVVO.js.map → chunk-BUOCIXUH.js.map} +0 -0
- /package/dist/{chunk-SS2FAFUZ.js.map → chunk-BYDQHL6O.js.map} +0 -0
- /package/dist/{chunk-3DKYJYLD.js.map → chunk-DPRCPBRB.js.map} +0 -0
- /package/dist/{chunk-P7P5KATB.js.map → chunk-DUEZWXBY.js.map} +0 -0
- /package/dist/{chunk-3W3VKY2J.js.map → chunk-EMP4ZIVB.js.map} +0 -0
- /package/dist/{chunk-QEEZZSOQ.js.map → chunk-FYSLOFAJ.js.map} +0 -0
- /package/dist/{chunk-FVBPHUV6.js.map → chunk-I5FVESDZ.js.map} +0 -0
- /package/dist/{chunk-NEKE5PRJ.js.map → chunk-IF42CZJH.js.map} +0 -0
- /package/dist/{chunk-VYINI3DD.js.map → chunk-IVXIAOMR.js.map} +0 -0
- /package/dist/{chunk-W4RON3XZ.js.map → chunk-JFJIYAMB.js.map} +0 -0
- /package/dist/{chunk-R7R6D7D4.js.map → chunk-JTPKAIYL.js.map} +0 -0
- /package/dist/{chunk-D3EB2FG3.js.map → chunk-JZM3TDK2.js.map} +0 -0
- /package/dist/{chunk-4QNOC3FL.js.map → chunk-KANAWPXZ.js.map} +0 -0
- /package/dist/{chunk-U32PNP6D.js.map → chunk-LSW66EIR.js.map} +0 -0
- /package/dist/{chunk-UKTMSVMG.js.map → chunk-M7KQPXCS.js.map} +0 -0
- /package/dist/{chunk-FDEJ4CIO.js.map → chunk-MGY23P25.js.map} +0 -0
- /package/dist/{chunk-FY5OFJRY.js.map → chunk-MVQOMW7S.js.map} +0 -0
- /package/dist/{chunk-E2ONHNZD.js.map → chunk-MXSKCQOT.js.map} +0 -0
- /package/dist/{chunk-IGLKMXWJ.js.map → chunk-NAMR4DA5.js.map} +0 -0
- /package/dist/{chunk-RZQIAOMZ.js.map → chunk-Q72MEHVY.js.map} +0 -0
- /package/dist/{chunk-2HBSVDEH.js.map → chunk-T5JT2ZU2.js.map} +0 -0
- /package/dist/{chunk-7RP5F62S.js.map → chunk-VPSESR6G.js.map} +0 -0
- /package/dist/{chunk-7FHNJWIY.js.map → chunk-VXMLYWZ2.js.map} +0 -0
- /package/dist/{chunk-ONXEJSDK.js.map → chunk-VZV7ZSZ5.js.map} +0 -0
- /package/dist/{chunk-GCMEX4I6.js.map → chunk-WOWIJ56S.js.map} +0 -0
- /package/dist/{chunk-IYQDAHMG.js.map → chunk-WPC2PZ6E.js.map} +0 -0
- /package/dist/{chunk-QLMEA4FA.js.map → chunk-YHQQSL4Q.js.map} +0 -0
- /package/dist/{chunk-WURYTVWC.js.map → chunk-YSDNZHEB.js.map} +0 -0
- /package/dist/{chunk-AJCKNHZB.js.map → chunk-YWOJ4NKF.js.map} +0 -0
- /package/dist/{chunk-AUV3PA2A.js.map → chunk-Z6B3PA4M.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=CountryFieldDefault-
|
|
1
|
+
import{a}from"./chunk-M7KQPXCS.js";import"./chunk-VPSESR6G.js";import"./chunk-RGLQY27T.js";import"./chunk-MSBCYMSH.js";import"./chunk-YHCH57B7.js";import"./chunk-7EONM7HL.js";import"./chunk-WQ4H5V7U.js";import"./chunk-6JTHV4QS.js";import"./chunk-547UHEDI.js";import"./chunk-MP3VDCI7.js";import"./chunk-EOMVTXER.js";import"./chunk-VIGKOVHP.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as CountryFieldDefault};
|
|
2
|
+
//# sourceMappingURL=CountryFieldDefault-IBVQJVMW.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-DPRCPBRB.js";import"./chunk-RGLQY27T.js";import"./chunk-MSBCYMSH.js";import"./chunk-YHCH57B7.js";import"./chunk-7EONM7HL.js";import"./chunk-WQ4H5V7U.js";import"./chunk-MP3VDCI7.js";import"./chunk-EOMVTXER.js";import"./chunk-VIGKOVHP.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as DatePickerFieldDefault};
|
|
2
|
+
//# sourceMappingURL=DatePickerFieldDefault-5LEOVIM2.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-VXMLYWZ2.js";import"./chunk-7EONM7HL.js";import"./chunk-3NESYBEJ.js";import"./chunk-MP3VDCI7.js";import"./chunk-EOMVTXER.js";import"./chunk-VIGKOVHP.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-P37U34EQ.js";export{a as FileUploadFieldDefault};
|
|
2
|
+
//# sourceMappingURL=FileUploadFieldDefault-Y2ZYBSTV.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-YHQQSL4Q.js";import"./chunk-VPSESR6G.js";import"./chunk-MSBCYMSH.js";import"./chunk-7EONM7HL.js";import"./chunk-6JTHV4QS.js";import"./chunk-547UHEDI.js";import"./chunk-MP3VDCI7.js";import"./chunk-EOMVTXER.js";import"./chunk-VIGKOVHP.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-P37U34EQ.js";export{a as MultiSelectFieldDefault};
|
|
2
|
+
//# sourceMappingURL=MultiSelectFieldDefault-UK7652MS.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=WorkScheduleFieldDefault-
|
|
1
|
+
import{a}from"./chunk-MGY23P25.js";import"./chunk-AOSXULKY.js";import"./chunk-HJ7WOTV7.js";import"./chunk-7EONM7HL.js";import"./chunk-547UHEDI.js";import"./chunk-MP3VDCI7.js";import"./chunk-EOMVTXER.js";import"./chunk-VIGKOVHP.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as WorkScheduleFieldDefault};
|
|
2
|
+
//# sourceMappingURL=WorkScheduleFieldDefault-SR3G37MN.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-Z6B3PA4M.js";import{b as e}from"./chunk-MRYRNB7Y.js";import{a as m}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function p({onSubmit:n}){let{terminationBag:o}=e(),a=m(async t=>{let r=await o?.parseFormValues(t);await n?.(r),o?.next()},"handleSubmit");return u(i,{defaultValues:o.fieldValues,onSubmit:a})}m(p,"EmployeeCommunicationForm");export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-24FMEFH5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-PGVYRAFJ.js";import{b as a}from"./chunk-Q3ALCPJN.js";import{k as n}from"./chunk-VIGKOVHP.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as b}from"react/jsx-runtime";function g({onSubmit:l,onSuccess:u,onError:d}){let{contractorOnboardingBag:i}=a(),m=e(async t=>{try{let o=await i.parseFormValues(t);await l?.(o);let r=await i.onSubmit(t);if(r?.data){await u?.(r?.data),r?._skipNextStep||i?.next();return}}catch(o){let r=n(o,i.meta?.fields?.eligibility_questionnaire);d?.(r)}},"handleSubmit"),p=i.stepState.values?.eligibility_questionnaire||i.initialValues.eligibility_questionnaire;return b(s,{defaultValues:p,onSubmit:m})}e(g,"EligibilityQuestionnaireStep");export{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2V7SP7UR.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o,b as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as o,b as r}from"./chunk-PX5PE6GX.js";import{a as t}from"./chunk-SNECOPBD.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as a}from"react/jsx-runtime";var n={[o]:" Remote provides its Contractor Services Agreement (CSA) \u201Cas is\u201D; it does not constitute legal advice or create an attorney-client relationship with Remote. Remote is not liable for the content You enter herein and You are encouraged to seek independent legal advice tailored to the specific relationship between You and Your Contractor. By use of the CSA, You release Remote from liability for any claim for damages or losses which may arise related to Your use thereof.",[r]:"Remote provides its Contractor Services Agreement (CSA) \u201Cas is\u201D; it does not constitute legal advice or create an attorney-client relationship with Remote. Remote is not liable for the content You enter herein and You are encouraged to seek independent legal advice tailored to the specific relationship between You and Your Contractor."},d=e(({subscription:i})=>a(t,{title:"Contractor Services Agreement",description:n[i],severity:"info"}),"StatementOfWorkDisclaimer");export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3C6N7DK6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as p}from"./chunk-MP3VDCI7.js";import{a as g}from"./chunk-VIGKOVHP.js";import{a as n}from"./chunk-P37U34EQ.js";import{useState as y,useRef as E,useEffect as R}from"react";import{Upload as k,X as B}from"lucide-react";import{jsx as t,jsxs as o}from"react/jsx-runtime";var M=n(l=>l?l.split(",").map(m=>m.trim().toUpperCase()).join(", "):null,"getAcceptedFormats");function L({onChange:l,className:m,multiple:r,accept:f,files:i,id:h}){let[a,c]=y(i||[]),d=E(null);R(()=>{i&&i.length>0&&c(i)},[i]);let v=n(e=>{e.preventDefault(),d.current?.click()},"handleClick"),N=n(e=>{if(e.target.files&&e.target.files.length>0){let s=Array.from(e.target.files);c([...a,...s]),l([...a,...s])}},"handleChange"),F=n(e=>{c(s=>s.filter(C=>C.name!==e.name)),l(a.filter(s=>s.name!==e.name))},"onRemoveFile"),u=M(f);return o("div",{className:g("flex flex-col items-start gap-4",m),children:[t("input",{type:"file",ref:d,id:h,onChange:N,className:"hidden","aria-label":"File upload",multiple:r,accept:f}),o(p,{type:"button",onClick:v,className:"gap-2",children:[t(k,{className:"h-4 w-4"}),"Choose File"]}),u&&o("div",{className:"text-sm text-gray-600",children:["Accepted formats:"," ",t("span",{className:"font-medium",children:u})]}),a.length===0&&t("div",{className:"text-sm",children:r?t("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):t("span",{className:"font-medium",children:"No file selected."})}),a.length>0&&a.map((e,s)=>o("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",t("span",{className:"font-medium",children:e.name})," (",Math.round(e.size/1024)," KB)",t(p,{type:"button",variant:"ghost",onClick:()=>F(e),children:t(B,{})})]},s))]})}n(L,"FileUploader");export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3NESYBEJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as p}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as p}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-BUOCIXUH.js";import{g as C}from"./chunk-7EONM7HL.js";import{h as E}from"./chunk-VIGKOVHP.js";import{b as f}from"./chunk-X6ZAR7ZL.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as u}from"react/jsx-runtime";function T({onSubmit:S,onError:w,onSuccess:y,onErrorWithFields:c,shouldResetForm:d,resetFields:a}){let{form:e,formId:V,costCalculatorBag:o}=p(),{formState:{isSubmitSuccessful:s}}=e;R(()=>{if(s&&d){o?.resetForm(),e.reset();return}if(s&&a){let t={...e.getValues()};a.forEach(r=>{t[r]=""}),o?.resetForm(),e.reset(t)}},[s,e,d,o,a]);let b=n(async i=>{try{let t=await o?.parseFormValues(i);o?.meta?.fields&&(o.meta.fields=E(i,o.fields),o.meta.fields.employer_currency_slug=o.meta.fields.currency);let r=await o?.onSubmit(t);if(await S?.(t),r?.data&&!r.error){let l={data:{...r.data.data,employments:r.data.data.employments?.map(m=>({...m,title:t.estimation_title}))}};await y?.(l)}else throw{data:null,error:r?.error,fieldErrors:r?.fieldErrors,rawError:r?.rawError}}catch(t){let r=t,l=r.fieldErrors;if(c){let m=o?.meta?.fields,h=f(l,m);c({error:r.error,rawError:r.rawError,fieldErrors:h})}else w?.(r.error)}},"handleSubmit");return u(C,{...e,children:u("form",{id:V,onSubmit:e.handleSubmit(b),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:u(F,{fields:o?.fields??[]})})})}n(T,"CostCalculatorForm");export{T as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3OJVYYPZ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-LMYJ6V44.js";import{a as o}from"./chunk-TC7EQZJK.js";import{a as m}from"./chunk-NX7MM6XR.js";import{a as e}from"./chunk-ZXGAFQXW.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-42R2H2DW.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as Be}from"./chunk-B7TQYSAY.js";import{a as qe}from"./chunk-VAIBLWOY.js";import{b as Ve,c as Pe,f as xe,g as Oe,h as Me,i as Re,j as ve,k as we,m as Te,n as Le}from"./chunk-Q3VMPVT3.js";import{a as ge,b as Ee,c as Ce,d as Fe,f as he}from"./chunk-STF3NTPS.js";import{a as ke}from"./chunk-YIOLMWB5.js";import{e as C,f as T,h as $}from"./chunk-T7O3YYOG.js";import{h as M}from"./chunk-VIGKOVHP.js";import{a as w}from"./chunk-X6ZAR7ZL.js";import{a as De}from"./chunk-TSPDJUGG.js";import{a as o}from"./chunk-P37U34EQ.js";import{useCallback as Ft,useEffect as ht,useMemo as p,useRef as Vt,useState as Ie}from"react";import Pt from"lodash.mergewith";import{createContext as yt,useContext as _t,useMemo as St,useCallback as bt,useRef as gt}from"react";import{jsx as Et}from"react/jsx-runtime";var Je=yt(void 0);function Tt({children:r}){let u=gt({}),c=bt(a=>{u.current={...u.current,...a}},[]),F=St(()=>({errorContextRef:u,updateContext:c}),[c]);return Et(Je.Provider,{value:F,children:r})}o(Tt,"ErrorContextProvider");var je=o(()=>{let r=_t(Je);if(!r)throw new Error("useErrorContext must be used within ErrorContextProvider");return r},"useErrorContext");import{useEffect as Ne,useMemo as Ct}from"react";function Ae(r){let{updateContext:u,errorContextRef:c}=je();return Ne(()=>{r&&(c.current=r)},[]),Ne(()=>()=>{c.current={}},[c]),{...Ct(()=>({updateErrorContext:o(a=>{u(a)},"updateErrorContext"),clearErrorContext:o(()=>{c.current={}},"clearErrorContext")}),[]),errorContext:c}}o(Ae,"useErrorReporting");import{jsx as Ue}from"react/jsx-runtime";var xt={employment_basic_information:"basic_information",contract_details:"contract_details"},Ot={select_country:null,basic_information:"employment_basic_information",contract_details:"contract_details",benefits:null,review:null},Mt=o(({isLoadingBasicInformationForm:r,isLoadingContractDetailsForm:u,isLoadingEmployment:c,isLoadingBenefitsOffersSchema:F,isLoadingBenefitOffers:a,isLoadingCompany:N,isLoadingCountries:R,employmentStatus:s,employmentId:L,currentStepName:A,basicInformationFields:I,contractDetailsFields:y})=>{let t=r||u||c||F||a||N||R,k=s&&Ce.includes(s),U=s&&!Fe.includes(s),D=!!(L&&k&&A!=="review"),v=t||D,B=!!(D&&!t&&I.length>0&&y.length>0);return{isLoading:v,isNavigatingToReview:B,isEmploymentReadOnly:k,canInvite:U}},"getLoadingStates"),Zt=o(({employmentId:r,companyId:u,countryCode:c,type:F,options:a,skipSteps:N,externalId:R,initialValues:s})=>{let{updateErrorContext:L}=Ae({flow:"onboarding",metadata:{employmentId:r,companyId:u,isUpdating:!!r}}),A=N?.includes("select_country")?Ee:ge,I=Ft(e=>{L({step:e.name})},[L]),{fieldValues:y,stepState:t,setFieldValues:k,previousStep:U,nextStep:D,goToStep:v,setStepValues:B}=De(A,I),q=Vt({select_country:{},basic_information:{},contract_details:{},benefits:{}}),[l,He]=Ie(r),[d,z]=Ie(c||null),{data:m,isLoading:K,refetch:We}=ke({employmentId:l,queryParams:{exclude_files:!0}});r&&m?.country?.code&&!d&&z(m.country.code);let{data:Q,isLoading:Y}=Pe(l),{data:J,isLoading:X,refetch:Ge}=Ve(u),$e=a?.features?.includes("onboarding_reserves")&&t.currentStep.name==="review"||!1,{data:ze}=Le(u,l,$e),{selectCountryForm:j,isLoading:Z}=we({jsfModify:a?.jsfModify?.select_country,queryOptions:{enabled:t.currentStep.name==="select_country"}}),ee=Me(),te=Re(d,a),ne=ve(a),oe=Te(),{mutateAsync:Ke}=w(ee),{mutateAsync:re}=w(te),{mutateAsync:Qe}=w(ne),{mutateAsync:Ye}=w(oe),Xe=Ot[t.currentStep.name]||"employment_basic_information",Ze=xt[Xe],et=m?.[Ze]||{},ae=o(({form:e,options:i={},query:f={},jsonSchemaVersion:O})=>{let W=Object.keys(y).length>0?{...s,...t.values?.[t.currentStep.name],...y}:{...s,...et};return xe({countryCode:d,form:e,fieldValues:W,query:f,options:{...i,queryOptions:{enabled:i.queryOptions?.enabled??!0}},jsonSchemaVersion:O})},"useJSONSchema"),tt=!!(d&&(t.currentStep.name==="basic_information"||r)),nt=!!(d&&(t.currentStep.name==="contract_details"||r)),{data:_,isLoading:ie}=ae({form:"employment_basic_information",options:{jsfModify:a?.jsfModify?.basic_information,queryOptions:{enabled:tt}},jsonSchemaVersion:1}),h=a?.jsfModify?.contract_details?.fields?.annual_gross_salary,H=h&&typeof h=="object"&&"presentation"in h?h.presentation:void 0,se=a?.jsfModify?.contract_details?.fields?.equity_compensation,ot=p(()=>({fields:{annual_gross_salary:{...h,presentation:{annual_gross_salary_conversion_properties:{label:H?.annual_gross_salary_conversion_properties?.label,description:H?.annual_gross_salary_conversion_properties?.description},desiredCurrency:J?.desired_currency,Component:o(e=>Ue(Be,{desiredCurrency:J?.desired_currency||"",...e}),"Component")}},equity_compensation:{...se,presentation:{calculateDynamicProperties:o((e,i)=>{let f=e.equity_compensation?.offer_equity_compensation,O=i?.meta?.cost;return{extra:Ue(qe,{offerEquity:f,equityCost:O})}},"calculateDynamicProperties")}}}}),[h,H,J?.desired_currency,se]),rt=he(a,d),{data:S,isLoading:ce}=ae({form:"contract_details",query:{employment_id:l},options:{jsfModify:{...a?.jsfModify?.contract_details,fields:{...a?.jsfModify?.contract_details?.fields,...ot.fields}},queryOptions:{enabled:nt}},jsonSchemaVersion:rt}),{data:g,isLoading:le}=Oe(l,y,a),de=p(()=>{if(t.currentStep.name==="benefits"){let e={...t.values?.[t.currentStep.name],...y};return Pt({},Q,e)}return{}},[t.currentStep.name,Q,t.values,y]),n=p(()=>({select_country:j?.fields||[],basic_information:_?.fields||[],contract_details:S?.fields||[],benefits:g?.fields||[],review:[]}),[j?.fields,_?.fields,S?.fields,g?.fields]),at={select_country:null,basic_information:_?.meta["x-jsf-fieldsets"],contract_details:S?.meta["x-jsf-fieldsets"],benefits:null,review:null},{country:it,basic_information:ue={},contract_details:me={},status:fe}=m||{},pe=it?.code,ye=t.currentStep.name,V=p(()=>T(n.select_country,{country:d||pe||""}),[n.select_country,d,pe]),P=p(()=>{let e={...s,...ue};return T(n.basic_information,e)},[n.basic_information,ue,s]),E=p(()=>{let e={...s,...me};return T(n.contract_details,e)},[n.contract_details,me,s]),x=p(()=>{let e={...s,...de};return T(n.benefits,e)},[n.benefits,de,s]),st=p(()=>m?{select_country:V,basic_information:$(n.basic_information,P),contract_details:m?.contract_details!==null?$(n.contract_details,E):E,benefits:x}:{select_country:V,basic_information:P,contract_details:E,benefits:x},[V,P,E,x,m,n]),{isLoading:ct,isNavigatingToReview:_e,isEmploymentReadOnly:lt,canInvite:dt}=p(()=>Mt({isLoadingBasicInformationForm:ie,isLoadingContractDetailsForm:ce,isLoadingEmployment:K,isLoadingBenefitsOffersSchema:le,isLoadingBenefitOffers:Y,isLoadingCompany:X,isLoadingCountries:Z,employmentId:r,employmentStatus:fe,basicInformationFields:n.basic_information,contractDetailsFields:n.contract_details,currentStepName:ye}),[ie,ce,K,le,Y,X,Z,r,fe,n.basic_information,n.contract_details,ye]);ht(()=>{_e&&(q.current={select_country:M(V,n.select_country),basic_information:M(P,n.basic_information),contract_details:M(E,n.contract_details),benefits:M(x,n.benefits)},B({select_country:V,basic_information:P,contract_details:E,benefits:x,review:{}}),v("review"))},[P,x,E,v,_e,V,B,n.basic_information,n.benefits,n.contract_details,n.select_country]);let Se=o(async e=>j&&t.currentStep.name==="select_country"?e:_&&t.currentStep.name==="basic_information"?await C(e,_?.fields,{isPartialValidation:!1}):S&&t.currentStep.name==="contract_details"?await C(e,S?.fields,{isPartialValidation:!1}):g&&t.currentStep.name==="benefits"?await C(e,g?.fields,{isPartialValidation:!1}):{},"parseFormValues");async function ut(e){let i=t.currentStep.name;i in q.current&&(q.current[i]=M(e,n[i]));let f=await Se(e);switch(Ge(),t.currentStep.name){case"select_country":return z(f.country),Promise.resolve({data:{countryCode:f.country}});case"basic_information":{let O=!l&&d,be=l&&d&&m?.country&&m?.country.code!==d;if(O||be){let W={basic_information:f,type:F,country_code:d,external_id:R};try{let b=await Ke(W);if(b.error)return b;if(b.data){let G=b.data?.data?.employment?.id;return G&&(He(G),await Ye({employmentId:G,eligible_to_work_in_residing_country:"citizen",employer_or_work_restrictions:!1})),b}}catch(b){throw console.error("Error creating onboarding:",b),b}}else if(l)return re({employmentId:l,basic_information:f,pricing_plan_details:{frequency:"monthly"},external_id:R});return}case"contract_details":return re({employmentId:l,external_id:R,...{contract_details:f,pricing_plan_details:{frequency:"monthly"}}});case"benefits":return Qe({employmentId:l,...f})}}o(ut,"onSubmit");function mt(){U()}o(mt,"back");function ft(){D()}o(ft,"next");function pt(e){v(e)}return o(pt,"goTo"),{employmentId:l,creditRiskStatus:J?.default_legal_entity_credit_risk_status,onboardingReservesStatus:ze,fieldValues:y,stepState:t,fields:n[t.currentStep.name],isLoading:ct,isSubmitting:ee.isPending||te.isPending||ne.isPending||oe.isPending,initialValues:st,handleValidation:o(async e=>{if(t.currentStep.name==="select_country")return j.handleValidation(e);if(t.currentStep.name==="benefits"&&g){let i=await C(e,g?.fields,{isPartialValidation:!1});return g?.handleValidation(i)}if(_&&t.currentStep.name==="basic_information"){let i=await C(e,_?.fields,{isPartialValidation:!1});return _?.handleValidation(i)}if(S&&t.currentStep.name==="contract_details"){let i=await C(e,S?.fields,{isPartialValidation:!1});return S?.handleValidation(i)}return null},"handleValidation"),checkFieldUpdates:k,parseFormValues:Se,onSubmit:ut,back:mt,next:ft,goTo:pt,meta:{fields:q.current,fieldsets:at[t.currentStep.name]},refetchEmployment:We,employment:m,isEmploymentReadOnly:lt,canInvite:dt}},"useOnboarding");export{Je as a,Tt as b,Zt as c};
|
|
2
|
+
//# sourceMappingURL=chunk-4OJ4TAXO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/Onboarding/hooks.tsx","../src/components/error-handling/ErrorContext.tsx","../src/components/error-handling/useErrorReporting.ts"],"sourcesContent":["import { ValidationResult } from '@remoteoss/remote-json-schema-form-kit';\nimport {\n Employment,\n EmploymentCreateParams,\n EmploymentFullParams,\n} from '@/src/client';\nimport { JSFFields } from '@/src/types/remoteFlows';\nimport { useStepState, Step } from '@/src/flows/useStepState';\nimport {\n disabledInviteButtonEmploymentStatus,\n getContractDetailsSchemaVersion,\n reviewStepAllowedEmploymentStatus,\n STEPS,\n STEPS_WITHOUT_SELECT_COUNTRY,\n} from '@/src/flows/Onboarding/utils';\nimport { prettifyFormValues } from '@/src/lib/utils';\nimport {\n getInitialValues,\n enableAckFields,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { FieldValues } from 'react-hook-form';\nimport { OnboardingFlowProps } from '@/src/flows/Onboarding/types';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport mergeWith from 'lodash.mergewith';\nimport {\n useBenefitOffers,\n useBenefitOffersSchema,\n useCompany,\n useCountriesSchemaField,\n useCreateEmployment,\n useEmploymentOnboardingReservesStatus,\n useJSONSchemaForm,\n useUpdateBenefitsOffers,\n useUpdateEmployment,\n useUpsertContractEligibility,\n} from '@/src/flows/Onboarding/api';\nimport { JSFModify, JSONSchemaFormType } from '@/src/flows/types';\nimport { AnnualGrossSalary } from '@/src/flows/Onboarding/components/AnnualGrossSalary';\nimport { $TSFixMe, JSFField, JSFFieldset, Meta } from '@/src/types/remoteFlows';\nimport { EquityPriceDetails } from '@/src/flows/Onboarding/components/EquityPriceDetails';\nimport { useErrorReporting } from '@/src/components/error-handling/useErrorReporting';\nimport { useEmploymentQuery } from '@/src/common/api/employment';\n\ntype OnboardingHookProps = Omit<OnboardingFlowProps, 'render'>;\n\nconst jsonSchemaToEmployment: Partial<\n Record<JSONSchemaFormType, keyof Employment>\n> = {\n employment_basic_information: 'basic_information',\n contract_details: 'contract_details',\n};\n\nconst stepToFormSchemaMap: Record<\n keyof typeof STEPS,\n JSONSchemaFormType | null\n> = {\n select_country: null,\n basic_information: 'employment_basic_information',\n contract_details: 'contract_details',\n benefits: null,\n review: null,\n};\n\nconst getLoadingStates = ({\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentStatus,\n employmentId,\n currentStepName,\n basicInformationFields,\n contractDetailsFields,\n}: {\n isLoadingBasicInformationForm: boolean;\n isLoadingContractDetailsForm: boolean;\n isLoadingEmployment: boolean;\n isLoadingBenefitsOffersSchema: boolean;\n isLoadingBenefitOffers: boolean;\n isLoadingCompany: boolean;\n isLoadingCountries: boolean;\n employmentStatus?: Employment['status'];\n employmentId?: string;\n currentStepName: string;\n basicInformationFields: JSFFields;\n contractDetailsFields: JSFFields;\n}) => {\n const initialLoading =\n isLoadingBasicInformationForm ||\n isLoadingContractDetailsForm ||\n isLoadingEmployment ||\n isLoadingBenefitsOffersSchema ||\n isLoadingBenefitOffers ||\n isLoadingCompany ||\n isLoadingCountries;\n\n const isEmploymentReadOnly =\n employmentStatus &&\n reviewStepAllowedEmploymentStatus.includes(employmentStatus);\n\n const canInvite =\n employmentStatus &&\n !disabledInviteButtonEmploymentStatus.includes(employmentStatus);\n\n const shouldHandleReadOnlyEmployment = Boolean(\n employmentId && isEmploymentReadOnly && currentStepName !== 'review',\n );\n\n const isLoading = initialLoading || shouldHandleReadOnlyEmployment;\n\n const isNavigatingToReview = Boolean(\n shouldHandleReadOnlyEmployment &&\n !initialLoading &&\n basicInformationFields.length > 0 &&\n contractDetailsFields.length > 0,\n );\n\n return {\n isLoading,\n isNavigatingToReview,\n isEmploymentReadOnly,\n canInvite,\n };\n};\n\nexport const useOnboarding = ({\n employmentId,\n companyId,\n countryCode,\n type,\n options,\n skipSteps,\n externalId,\n initialValues: onboardingInitialValues,\n}: OnboardingHookProps) => {\n const { updateErrorContext } = useErrorReporting({\n flow: 'onboarding',\n metadata: {\n employmentId,\n companyId,\n isUpdating: Boolean(employmentId),\n },\n });\n const stepsToUse = skipSteps?.includes('select_country')\n ? STEPS_WITHOUT_SELECT_COUNTRY\n : STEPS;\n\n const onStepChange = useCallback(\n (step: Step<keyof typeof STEPS>) => {\n updateErrorContext({\n step: step.name,\n });\n },\n [updateErrorContext],\n );\n\n const {\n fieldValues,\n stepState,\n setFieldValues,\n previousStep,\n nextStep,\n goToStep,\n setStepValues,\n } = useStepState(\n stepsToUse as Record<keyof typeof STEPS, Step<keyof typeof STEPS>>,\n onStepChange,\n );\n\n const fieldsMetaRef = useRef<{\n select_country: Meta;\n basic_information: Meta;\n contract_details: Meta;\n benefits: Meta;\n }>({\n select_country: {},\n basic_information: {},\n contract_details: {},\n benefits: {},\n });\n const [internalEmploymentId, setInternalEmploymentId] = useState<\n string | undefined\n >(employmentId);\n const [internalCountryCode, setInternalCountryCode] = useState<string | null>(\n countryCode || null,\n );\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n refetch: refetchEmployment,\n } = useEmploymentQuery({\n employmentId: internalEmploymentId as string,\n queryParams: { exclude_files: true },\n });\n\n // if the employment is loaded, country code has not been set yet\n // we set the internal country code with the employment country code\n if (employmentId && employment?.country?.code && !internalCountryCode) {\n setInternalCountryCode(employment.country.code);\n }\n\n const { data: benefitOffers, isLoading: isLoadingBenefitOffers } =\n useBenefitOffers(internalEmploymentId);\n\n const {\n data: company,\n isLoading: isLoadingCompany,\n refetch: refetchCompany,\n } = useCompany(companyId);\n\n const isOnboardingReservesEnabled =\n (options?.features?.includes('onboarding_reserves') &&\n stepState.currentStep.name === 'review') ||\n false;\n\n const { data: onboardingReservesStatus } =\n useEmploymentOnboardingReservesStatus(\n companyId,\n internalEmploymentId,\n isOnboardingReservesEnabled,\n );\n\n const { selectCountryForm, isLoading: isLoadingCountries } =\n useCountriesSchemaField({\n jsfModify: options?.jsfModify?.select_country,\n queryOptions: {\n enabled: stepState.currentStep.name === 'select_country',\n },\n });\n\n const createEmploymentMutation = useCreateEmployment();\n const updateEmploymentMutation = useUpdateEmployment(\n internalCountryCode as string,\n options,\n );\n const updateBenefitsOffersMutation = useUpdateBenefitsOffers(options);\n const updateContractEligibilityMutation = useUpsertContractEligibility();\n const { mutateAsync: createEmploymentMutationAsync } = mutationToPromise(\n createEmploymentMutation,\n );\n const { mutateAsync: updateEmploymentMutationAsync } = mutationToPromise(\n updateEmploymentMutation,\n );\n const { mutateAsync: updateBenefitsOffersMutationAsync } = mutationToPromise(\n updateBenefitsOffersMutation,\n );\n const { mutateAsync: updateContractEligibilityMutationAsync } =\n mutationToPromise(updateContractEligibilityMutation);\n\n const formType =\n stepToFormSchemaMap[stepState.currentStep.name] ||\n 'employment_basic_information';\n const employmentKey = jsonSchemaToEmployment[formType] as keyof Employment;\n const serverEmploymentData = (employment?.[employmentKey] || {}) as Record<\n string,\n unknown\n >;\n\n const useJSONSchema = ({\n form,\n options: jsonSchemaOptions = {},\n query = {},\n jsonSchemaVersion,\n }: {\n form: JSONSchemaFormType;\n options?: {\n jsfModify?: JSFModify;\n queryOptions?: { enabled?: boolean };\n };\n query?: Record<string, string>;\n jsonSchemaVersion?: number | 'latest';\n }) => {\n const hasUserEnteredAnyValues = Object.keys(fieldValues).length > 0;\n // when you write on the fields, the values are stored in the fieldValues state\n // when values are stored in the stepState is when the user has navigated to the step\n // and then we have the values from the server and the onboardingInitialValues that the user can inject,\n const mergedFormValues = hasUserEnteredAnyValues\n ? {\n ...onboardingInitialValues,\n ...stepState.values?.[stepState.currentStep.name], // Restore values for the current step\n ...fieldValues,\n }\n : {\n ...onboardingInitialValues,\n ...serverEmploymentData,\n };\n\n return useJSONSchemaForm({\n countryCode: internalCountryCode as string,\n form: form,\n fieldValues: mergedFormValues,\n query,\n options: {\n ...jsonSchemaOptions,\n queryOptions: {\n enabled: jsonSchemaOptions.queryOptions?.enabled ?? true,\n },\n },\n jsonSchemaVersion,\n });\n };\n\n const isBasicInformationDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'basic_information' ||\n Boolean(employmentId)),\n );\n\n const isContractDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'contract_details' ||\n Boolean(employmentId)),\n );\n\n const {\n data: basicInformationForm,\n isLoading: isLoadingBasicInformationForm,\n } = useJSONSchema({\n form: 'employment_basic_information',\n options: {\n jsfModify: options?.jsfModify?.basic_information,\n queryOptions: {\n enabled: isBasicInformationDetailsEnabled,\n },\n },\n jsonSchemaVersion: 1,\n });\n\n const annualGrossSalaryField =\n options?.jsfModify?.contract_details?.fields?.annual_gross_salary;\n const annualSalaryFieldPresentation =\n annualGrossSalaryField &&\n typeof annualGrossSalaryField === 'object' &&\n 'presentation' in annualGrossSalaryField\n ? (\n annualGrossSalaryField as {\n presentation?: {\n annual_gross_salary_conversion_properties?: {\n label?: string;\n description?: string;\n };\n };\n }\n ).presentation\n : undefined;\n\n const equityCompensationField =\n options?.jsfModify?.contract_details?.fields?.equity_compensation;\n\n const contractDetailsCustomFields = useMemo(\n () => ({\n fields: {\n annual_gross_salary: {\n ...annualGrossSalaryField,\n presentation: {\n annual_gross_salary_conversion_properties: {\n label:\n annualSalaryFieldPresentation\n ?.annual_gross_salary_conversion_properties?.label,\n description:\n annualSalaryFieldPresentation\n ?.annual_gross_salary_conversion_properties?.description,\n },\n desiredCurrency: company?.desired_currency,\n Component: (props: JSFField & { currency: string }) => {\n return (\n <AnnualGrossSalary\n desiredCurrency={company?.desired_currency || ''}\n {...props}\n />\n );\n },\n },\n },\n equity_compensation: {\n ...equityCompensationField,\n presentation: {\n calculateDynamicProperties: (\n values: FieldValues,\n field: JSFField,\n ) => {\n const offerEquity =\n values.equity_compensation?.offer_equity_compensation;\n const equityCost = field?.meta?.cost;\n\n return {\n extra: (\n <EquityPriceDetails\n offerEquity={offerEquity}\n equityCost={equityCost as $TSFixMe}\n />\n ),\n };\n },\n },\n },\n },\n }),\n [\n annualGrossSalaryField,\n annualSalaryFieldPresentation,\n company?.desired_currency,\n equityCompensationField,\n ],\n );\n\n const effectiveContractDetailsJsonSchemaVersion =\n getContractDetailsSchemaVersion(options, internalCountryCode);\n\n const { data: contractDetailsForm, isLoading: isLoadingContractDetailsForm } =\n useJSONSchema({\n form: 'contract_details',\n query: {\n employment_id: internalEmploymentId as string,\n },\n options: {\n jsfModify: {\n ...options?.jsfModify?.contract_details,\n fields: {\n ...options?.jsfModify?.contract_details?.fields,\n ...contractDetailsCustomFields.fields,\n },\n },\n queryOptions: {\n enabled: isContractDetailsEnabled,\n },\n },\n jsonSchemaVersion: effectiveContractDetailsJsonSchemaVersion,\n });\n\n const {\n data: benefitOffersSchema,\n isLoading: isLoadingBenefitsOffersSchema,\n } = useBenefitOffersSchema(\n internalEmploymentId as string,\n fieldValues,\n options,\n );\n\n const initialValuesBenefitOffers = useMemo(() => {\n if (stepState.currentStep.name === 'benefits') {\n const benefitsFormValues = {\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...fieldValues,\n };\n return mergeWith({}, benefitOffers, benefitsFormValues);\n }\n return {};\n }, [\n stepState.currentStep.name,\n benefitOffers,\n stepState.values,\n fieldValues,\n ]);\n\n const stepFields: Record<keyof typeof STEPS, JSFFields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n contract_details: contractDetailsForm?.fields || [],\n benefits: benefitOffersSchema?.fields || [],\n review: [],\n }),\n [\n selectCountryForm?.fields,\n basicInformationForm?.fields,\n contractDetailsForm?.fields,\n benefitOffersSchema?.fields,\n ],\n );\n\n const stepFieldsWithFlatFieldsets: Record<\n keyof typeof STEPS,\n JSFFieldset | null | undefined\n > = {\n select_country: null,\n basic_information: basicInformationForm?.meta['x-jsf-fieldsets'],\n contract_details: contractDetailsForm?.meta['x-jsf-fieldsets'],\n benefits: null,\n review: null,\n };\n\n const {\n country,\n basic_information: employmentBasicInformation = {},\n contract_details: employmentContractDetails = {},\n status: employmentStatus,\n } = employment || {};\n\n const employmentCountryCode = country?.code;\n const currentStepName = stepState.currentStep.name;\n\n const selectCountryInitialValues = useMemo(\n () =>\n getInitialValues(stepFields.select_country, {\n country: internalCountryCode || employmentCountryCode || '',\n }),\n [stepFields.select_country, internalCountryCode, employmentCountryCode],\n );\n\n const basicInformationInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentBasicInformation,\n };\n\n return getInitialValues(stepFields.basic_information, initialValues);\n }, [\n stepFields.basic_information,\n employmentBasicInformation,\n onboardingInitialValues,\n ]);\n\n const contractDetailsInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_details, initialValues);\n }, [\n stepFields.contract_details,\n employmentContractDetails,\n onboardingInitialValues,\n ]);\n\n const benefitsInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...initialValuesBenefitOffers,\n };\n\n return getInitialValues(stepFields.benefits, initialValues);\n }, [\n stepFields.benefits,\n initialValuesBenefitOffers,\n onboardingInitialValues,\n ]);\n\n const initialValues = useMemo(() => {\n if (employment) {\n return {\n select_country: selectCountryInitialValues,\n // We don't store ack fields in the db, eg \"ack_start_date_ammendment\" for Argentina, and therefore is not returned in the employment response\n // So when an employmentId exists, it means that the user has already started the onboarding process, and we need to enable the ack fields\n basic_information: enableAckFields(\n stepFields['basic_information'],\n basicInformationInitialValues,\n ),\n contract_details:\n // if contract details is null, it means it has not been filled yet, so we can't enable the ack fields\n employment?.contract_details !== null\n ? enableAckFields(\n stepFields['contract_details'],\n contractDetailsInitialValues,\n )\n : contractDetailsInitialValues,\n benefits: benefitsInitialValues,\n };\n }\n return {\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n benefits: benefitsInitialValues,\n };\n }, [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n benefitsInitialValues,\n employment,\n stepFields,\n ]);\n\n const { isLoading, isNavigatingToReview, isEmploymentReadOnly, canInvite } =\n useMemo(\n () =>\n getLoadingStates({\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentId,\n employmentStatus: employmentStatus,\n basicInformationFields: stepFields.basic_information,\n contractDetailsFields: stepFields.contract_details,\n currentStepName: currentStepName,\n }),\n [\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentId,\n employmentStatus,\n stepFields.basic_information,\n stepFields.contract_details,\n currentStepName,\n ],\n );\n\n useEffect(() => {\n if (isNavigatingToReview) {\n fieldsMetaRef.current = {\n select_country: prettifyFormValues(\n selectCountryInitialValues,\n stepFields.select_country,\n ),\n basic_information: prettifyFormValues(\n basicInformationInitialValues,\n stepFields.basic_information,\n ),\n contract_details: prettifyFormValues(\n contractDetailsInitialValues,\n stepFields.contract_details,\n ),\n benefits: prettifyFormValues(\n benefitsInitialValues,\n stepFields.benefits,\n ),\n };\n\n setStepValues({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n benefits: benefitsInitialValues,\n review: {},\n });\n\n goToStep('review');\n }\n }, [\n basicInformationInitialValues,\n benefitsInitialValues,\n contractDetailsInitialValues,\n goToStep,\n isNavigatingToReview,\n selectCountryInitialValues,\n setStepValues,\n stepFields.basic_information,\n stepFields.benefits,\n stepFields.contract_details,\n stepFields.select_country,\n ]);\n\n const parseFormValues = async (values: FieldValues) => {\n if (selectCountryForm && stepState.currentStep.name === 'select_country') {\n return values;\n }\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n return await parseJSFToValidate(values, basicInformationForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n contractDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n return await parseJSFToValidate(values, contractDetailsForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (benefitOffersSchema && stepState.currentStep.name === 'benefits') {\n return await parseJSFToValidate(values, benefitOffersSchema?.fields, {\n isPartialValidation: false,\n });\n }\n\n return {};\n };\n\n async function onSubmit(values: FieldValues) {\n // Prettify values for the current step\n const currentStepName = stepState.currentStep.name;\n if (currentStepName in fieldsMetaRef.current) {\n fieldsMetaRef.current[\n currentStepName as keyof typeof fieldsMetaRef.current\n ] = prettifyFormValues(values, stepFields[currentStepName]);\n }\n\n const parsedValues = await parseFormValues(values);\n refetchCompany();\n switch (stepState.currentStep.name) {\n case 'select_country': {\n setInternalCountryCode(parsedValues.country);\n return Promise.resolve({ data: { countryCode: parsedValues.country } });\n }\n case 'basic_information': {\n const isEmploymentNotLoaded =\n !internalEmploymentId && internalCountryCode;\n const hasChangedCountry =\n internalEmploymentId &&\n internalCountryCode &&\n employment?.country &&\n employment?.country.code !== internalCountryCode;\n if (isEmploymentNotLoaded || hasChangedCountry) {\n const payload: EmploymentCreateParams = {\n basic_information: parsedValues,\n type: type,\n country_code: internalCountryCode,\n external_id: externalId,\n };\n try {\n const response = await createEmploymentMutationAsync(payload);\n\n if (response.error) {\n return response;\n }\n\n if (response.data) {\n // @ts-expect-error the types from the response are not matching\n const employmentId = response.data?.data?.employment?.id;\n if (employmentId) {\n setInternalEmploymentId(employmentId);\n await updateContractEligibilityMutationAsync({\n employmentId: employmentId,\n eligible_to_work_in_residing_country: 'citizen',\n employer_or_work_restrictions: false,\n });\n }\n\n return response;\n }\n } catch (error) {\n console.error('Error creating onboarding:', error);\n throw error;\n }\n } else if (internalEmploymentId) {\n return updateEmploymentMutationAsync({\n employmentId: internalEmploymentId,\n basic_information: parsedValues,\n pricing_plan_details: {\n frequency: 'monthly',\n },\n external_id: externalId,\n });\n }\n\n return;\n }\n case 'contract_details': {\n const payload: EmploymentFullParams = {\n contract_details: parsedValues,\n pricing_plan_details: {\n frequency: 'monthly',\n },\n };\n return updateEmploymentMutationAsync({\n employmentId: internalEmploymentId as string,\n external_id: externalId,\n ...payload,\n });\n }\n\n case 'benefits': {\n return updateBenefitsOffersMutationAsync({\n employmentId: internalEmploymentId as string,\n ...parsedValues,\n });\n }\n }\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n function goTo(step: keyof typeof STEPS) {\n goToStep(step);\n }\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId: internalEmploymentId,\n\n /**\n * Credit risk status of the company, useful to know what to to show in the review step\n * The possible values are:\n * - not_started\n * - ready\n * - in_progress\n * - referred\n * - fail\n * - deposit_required\n * - no_deposit_required\n */\n\n creditRiskStatus: company?.default_legal_entity_credit_risk_status,\n /**\n * Onboarding reserves status for the employment\n * Returns 'deposit_required' if a deposit is required based on onboarding reserves policies\n */\n onboardingReservesStatus: onboardingReservesStatus,\n /**\n * Current state of the form fields for the current step.\n */\n fieldValues,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the onboarding schema\n */\n fields: stepFields[stepState.currentStep.name],\n /**\n * Loading state indicating if the onboarding schema is being fetched\n */\n isLoading: isLoading,\n /**\n * Loading state indicating if the onboarding mutation is in progress\n */\n isSubmitting:\n createEmploymentMutation.isPending ||\n updateEmploymentMutation.isPending ||\n updateBenefitsOffersMutation.isPending ||\n updateContractEligibilityMutation.isPending,\n /**\n * Initial form values\n */\n initialValues,\n /**\n * Function to validate form values against the onboarding schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: async (\n values: FieldValues,\n ): Promise<ValidationResult | null> => {\n if (stepState.currentStep.name === 'select_country') {\n return selectCountryForm.handleValidation(values);\n }\n if (stepState.currentStep.name === 'benefits' && benefitOffersSchema) {\n const parsedValues = await parseJSFToValidate(\n values,\n benefitOffersSchema?.fields,\n { isPartialValidation: false },\n );\n\n return benefitOffersSchema?.handleValidation(parsedValues);\n }\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n basicInformationForm?.fields,\n { isPartialValidation: false },\n );\n return basicInformationForm?.handleValidation(parsedValues);\n }\n\n if (\n contractDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n contractDetailsForm?.fields,\n { isPartialValidation: false },\n );\n return contractDetailsForm?.handleValidation(parsedValues);\n }\n\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues,\n\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n\n /**\n * Function to handle going to a specific step\n * @param step The step to go to.\n * @returns {void}\n */\n goTo,\n\n /**\n * Fields metadata for each step\n */\n meta: {\n fields: fieldsMetaRef.current,\n fieldsets: stepFieldsWithFlatFieldsets[stepState.currentStep.name],\n },\n\n /**\n * Function to refetch the employment data\n * @returns {void}\n */\n refetchEmployment,\n /**\n * Employment data\n */\n employment,\n\n /**\n * let's the user know that the employment cannot be edited, happens when employment.status is invited, created_awaiting_reserve or created_reserve_paid\n * @returns {boolean}\n */\n isEmploymentReadOnly,\n\n /**\n * let's the user know if the company can invite employees\n * @returns {boolean}\n */\n canInvite,\n };\n};\n","import {\n createContext,\n useContext,\n ReactNode,\n useMemo,\n useCallback,\n useRef,\n RefObject,\n} from 'react';\nimport type { ErrorContextData } from './types';\n\nexport type ErrorContextValue = {\n errorContextRef: RefObject<ErrorContextData>;\n updateContext: (updates: Partial<ErrorContextData>) => void;\n};\n\nexport const ErrorContext = createContext<ErrorContextValue | undefined>(\n undefined,\n);\n\nexport function ErrorContextProvider({ children }: { children: ReactNode }) {\n const errorContextRef = useRef<ErrorContextData>({});\n\n const updateContext = useCallback((updates: Partial<ErrorContextData>) => {\n errorContextRef.current = { ...errorContextRef.current, ...updates };\n }, []);\n\n // Memoize the value object to prevent unnecessary re-renders\n // Note: setContext is stable from useState and doesn't need to be in deps\n const value = useMemo(\n () => ({\n errorContextRef,\n updateContext,\n }),\n [updateContext],\n );\n\n return (\n <ErrorContext.Provider value={value}>{children}</ErrorContext.Provider>\n );\n}\n\nexport const useErrorContext = () => {\n const ctx = useContext(ErrorContext);\n if (!ctx) {\n throw new Error('useErrorContext must be used within ErrorContextProvider');\n }\n return ctx;\n};\n","import { useErrorContext } from '@/src/components/error-handling/ErrorContext';\nimport { ErrorContextData } from '@/src/components/error-handling/types';\nimport { useEffect, useMemo } from 'react';\n\nexport function useErrorReporting(initialContext: ErrorContextData) {\n const { updateContext, errorContextRef } = useErrorContext();\n\n // Set initial context on mount\n useEffect(() => {\n if (initialContext) {\n errorContextRef.current = initialContext;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // Clear context on unmount\n useEffect(() => {\n return () => {\n errorContextRef.current = {};\n };\n }, [errorContextRef]);\n\n // Note: setContext and updateContext are stable, don't need to be in deps\n const handlers = useMemo(\n () => ({\n updateErrorContext: (updates: Partial<ErrorContextData>) => {\n updateContext(updates);\n },\n\n clearErrorContext: () => {\n errorContextRef.current = {};\n },\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n return {\n ...handlers,\n /**\n * @internal For unit testing only - we access the errorContext in the error boundary directly\n * Use updateErrorContext() and clearErrorContext() handlers instead.\n */\n errorContext: errorContextRef,\n };\n}\n"],"mappings":"4gBAwBA,OAAS,eAAAA,GAAa,aAAAC,GAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,OAAgB,QAClE,OAAOC,OAAe,mBCzBtB,OACE,iBAAAC,GACA,cAAAC,GAEA,WAAAC,GACA,eAAAC,GACA,UAAAC,OAEK,QA8BH,cAAAC,OAAA,oBAtBG,IAAMC,GAAeC,GAC1B,MACF,EAEO,SAASC,GAAqB,CAAE,SAAAC,CAAS,EAA4B,CAC1E,IAAMC,EAAkBC,GAAyB,CAAC,CAAC,EAE7CC,EAAgBC,GAAaC,GAAuC,CACxEJ,EAAgB,QAAU,CAAE,GAAGA,EAAgB,QAAS,GAAGI,CAAQ,CACrE,EAAG,CAAC,CAAC,EAICC,EAAQC,GACZ,KAAO,CACL,gBAAAN,EACA,cAAAE,CACF,GACA,CAACA,CAAa,CAChB,EAEA,OACEP,GAACC,GAAa,SAAb,CAAsB,MAAOS,EAAQ,SAAAN,EAAS,CAEnD,CApBgBQ,EAAAT,GAAA,wBAsBT,IAAMU,GAAkBD,EAAA,IAAM,CACnC,IAAME,EAAMC,GAAWd,EAAY,EACnC,GAAI,CAACa,EACH,MAAM,IAAI,MAAM,0DAA0D,EAE5E,OAAOA,CACT,EAN+B,mBCxC/B,OAAS,aAAAE,G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BkG,GACqC,CACrC,GAAI5D,EAAU,YAAY,OAAS,iBACjC,OAAOyB,EAAkB,iBAAiBmC,CAAM,EAElD,GAAI5D,EAAU,YAAY,OAAS,YAAcoE,EAAqB,CACpE,IAAMuB,EAAe,MAAMF,EACzB7B,EACAQ,GAAqB,OACrB,CAAE,oBAAqB,EAAM,CAC/B,EAEA,OAAOA,GAAqB,iBAAiBuB,CAAY,CAC3D,CACA,GACEvC,GACApD,EAAU,YAAY,OAAS,oBAC/B,CACA,IAAM2F,EAAe,MAAMF,EACzB7B,EACAR,GAAsB,OACtB,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAsB,iBAAiBuC,CAAY,CAC5D,CAEA,GACExB,GACAnE,EAAU,YAAY,OAAS,mBAC/B,CACA,IAAM2F,EAAe,MAAMF,EACzB7B,EACAO,GAAqB,OACrB,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAqB,iBAAiBwB,CAAY,CAC3D,CAEA,OAAO,IACT,EAxCkB,oBA6ClB,kBAAmB1F,EAOnB,gBAAAuF,GAOA,SAAAE,GAMA,KAAAO,GAMA,KAAAC,GAOA,KAAAC,GAKA,KAAM,CACJ,OAAQ5F,EAAc,QACtB,UAAWmE,GAA4B1E,EAAU,YAAY,IAAI,CACnE,EAMA,kBAAAe,GAIA,WAAAD,EAMA,qBAAAtC,GAMA,UAAAE,EACF,CACF,EA/zB6B","names":["useCallback","useEffect","useMemo","useRef","useState","mergeWith","createContext","useContext","useMemo","useCallback","useRef","jsx","ErrorContext","createContext","ErrorContextProvider","children","errorContextRef","useRef","updateContext","useCallback","updates","value","useMemo","__name","useErrorContext","ctx","useContext","useEffect","useMemo","useErrorReporting","initialContext","updateContext","errorContextRef","useErrorContext","useEffect","useMemo","__name","updates","jsx","jsonSchemaToEmployment","stepToFormSchemaMap","getLoadingStates","__name","isLoadingBasicInformationForm","isLoadingContractDetailsForm","isLoadingEmployment","isLoadingBenefitsOffersSchema","isLoadingBenefitOffers","isLoadingCompany","isLoadingCountries","employmentStatus","employmentId","currentStepName","basicInformationFields","contractDetailsFields","initialLoading","isEmploymentReadOnly","reviewStepAllowedEmploymentStatus","canInvite","disabledInviteButtonEmploymentStatus","shouldHandleReadOnlyEmployment","isLoading","isNavigatingToReview","useOnboarding","companyId","countryCode","type","options","skipSteps","externalId","onboardingInitialValues","updateErrorContext","useErrorReporting","stepsToUse","STEPS_WITHOUT_SELECT_COUNTRY","STEPS","onStepChange","useCallback","step","fieldValues","stepState","setFieldValues","previousStep","nextStep","goToStep","setStepValues","useStepState","fieldsMetaRef","useRef","internalEmploymentId","setInternalEmploymentId","useState","internalCountryCode","setInternalCountryCode","employment","refetchEmployment","useEmploymentQuery","benefitOffers","useBenefitOffers","company","refetchCompany","useCompany","isOnboardingReservesEnabled","onboardingReservesStatus","useEmploymentOnboardingReservesStatus","selectCountryForm","useCountriesSchemaField","createEmploymentMutation","useCreateEmployment","updateEmploymentMutation","useUpdateEmployment","updateBenefitsOffersMutation","useUpdateBenefitsOffers","updateContractEligibilityMutation","useUpsertContractEligibility","createEmploymentMutationAsync","mutationToPromise","updateEmploymentMutationAsync","updateBenefitsOffersMutationAsync","updateContractEligibilityMutationAsync","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","query","jsonSchemaVersion","mergedFormValues","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractDetailsEnabled","basicInformationForm","annualGrossSalaryField","annualSalaryFieldPresentation","equityCompensationField","contractDetailsCustomFields","useMemo","props","AnnualGrossSalary","values","field","offerEquity","equityCost","EquityPriceDetails","effectiveContractDetailsJsonSchemaVersion","getContractDetailsSchemaVersion","contractDetailsForm","benefitOffersSchema","useBenefitOffersSchema","initialValuesBenefitOffers","benefitsFormValues","mergeWith","stepFields","stepFieldsWithFlatFieldsets","country","employmentBasicInformation","employmentContractDetails","employmentCountryCode","selectCountryInitialValues","getInitialValues","basicInformationInitialValues","initialValues","contractDetailsInitialValues","benefitsInitialValues","enableAckFields","useEffect","prettifyFormValues","parseFormValues","parseJSFToValidate","onSubmit","parsedValues","isEmploymentNotLoaded","hasChangedCountry","payload","response","error","back","next","goTo"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-PGVYRAFJ.js";import{b as n}from"./chunk-Q3ALCPJN.js";import{k as i}from"./chunk-VIGKOVHP.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function P({onSubmit:d,onSuccess:m,onError:p}){let{contractorOnboardingBag:r}=n(),l=e(async a=>{try{let t=await r.parseFormValues(a);await d?.(t);let o=await r.onSubmit(a);if(o?.data){await m?.(o?.data),r?.next();return}}catch(t){let o=i(t,r.meta?.fields?.contract_preview);p?.(o)}},"handleSubmit"),u=r.stepState.values?.contract_preview||r.initialValues.contract_preview;return c("div",{className:"space-y-4",children:c(s,{defaultValues:u,onSubmit:l})})}e(P,"ContractPreviewStep");export{P as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5OHSFPY6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as s}from"./chunk-PGVYRAFJ.js";import{b as e}from"./chunk-Q3ALCPJN.js";import{k as n}from"./chunk-VIGKOVHP.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as f}from"react/jsx-runtime";function b({onSubmit:m,onSuccess:d,onError:c}){let{contractorOnboardingBag:o}=e(),p=t(async i=>{try{let a=await o.parseFormValues(i);await m?.(a);let r=await o.onSubmit(i);if(r?.data){await d?.(r?.data),o?.next();return}}catch(a){let r=n(a,o.meta?.fields?.basic_information);c?.(r)}},"handleSubmit"),l=o.stepState.values?.basic_information||o.initialValues.basic_information;return f(s,{defaultValues:l,onSubmit:p})}t(b,"BasicInformationStep");export{b as a};
|
|
2
|
+
//# sourceMappingURL=chunk-5YRQBCHM.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as r}from"./chunk-VIGKOVHP.js";import{a as e}from"./chunk-P37U34EQ.js";import{cva as i}from"class-variance-authority";import{jsx as d}from"react/jsx-runtime";var o=i("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-badge text-badge-foreground rounded-full [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground rounded-full [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white rounded-full [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"text-foreground rounded-full [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function c({className:t,variant:a,...n}){return d("span",{"data-slot":"badge",className:r(o({variant:a}),t),...n})}e(c,"Badge");export{o as a,c as b};
|
|
2
|
+
//# sourceMappingURL=chunk-6JTHV4QS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/src/lib/utils';\n\nconst badgeVariants = cva(\n 'inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden',\n {\n variants: {\n variant: {\n default:\n 'border-transparent bg-badge text-badge-foreground rounded-full [a&]:hover:bg-primary/90',\n secondary:\n 'border-transparent bg-secondary text-secondary-foreground rounded-full [a&]:hover:bg-secondary/90',\n destructive:\n 'border-transparent bg-destructive text-white rounded-full [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40',\n outline:\n 'text-foreground rounded-full [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n },\n);\n\nfunction Badge({\n className,\n variant,\n ...props\n}: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants>) {\n return (\n <span\n data-slot='badge'\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nexport { Badge, badgeVariants };\n"],"mappings":"gFACA,OAAS,OAAAA,MAA8B,2BA+BnC,cAAAC,MAAA,oBA3BJ,IAAMC,EAAgBC,EACpB,iZACA,CACE,SAAU,CACR,QAAS,CACP,QACE,0FACF,UACE,oGACF,YACE,kKACF,QACE,qFACJ,CACF,EACA,gBAAiB,CACf,QAAS,SACX,CACF,CACF,EAEA,SAASC,EAAM,CACb,UAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAAsE,CACpE,OACEN,EAAC,QACC,YAAU,QACV,UAAWO,EAAGN,EAAc,CAAE,QAAAI,CAAQ,CAAC,EAAGD,CAAS,EAClD,GAAGE,EACN,CAEJ,CAZSE,EAAAL,EAAA","names":["cva","jsx","badgeVariants","cva","Badge","className","variant","props","cn","__name"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as e}from"./chunk-Z6B3PA4M.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function d({onSubmit:m}){let{terminationBag:o}=a(),r=i(async t=>{let n=await o?.parseFormValues(t);await m?.(n),o?.next()},"handleSubmit");return s(e,{defaultValues:o.fieldValues,onSubmit:r})}i(d,"PaidTimeOffForm");export{d as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7EUMRKH4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as W}from"./chunk-TRBEYNRN.js";import{a as Y}from"./chunk-CJG77FUT.js";import{a as Q}from"./chunk-YWOJ4NKF.js";import{a as J}from"./chunk-YSDNZHEB.js";import{a as H}from"./chunk-IF42CZJH.js";import{a as U}from"./chunk-6DHV4GT6.js";import{a as q,b as B,c as L,d as z}from"./chunk-L5DII4MV.js";import{f as Z,g as K}from"./chunk-JFJIYAMB.js";import{a as R}from"./chunk-ZXGAFQXW.js";import{a as S}from"./chunk-RAH453TV.js";import{a as N}from"./chunk-YIOLMWB5.js";import{a as E}from"./chunk-EUSCQL4H.js";import{e as _}from"./chunk-T7O3YYOG.js";import{a as u,b as v}from"./chunk-YHCH57B7.js";import{q as $}from"./chunk-WQ4H5V7U.js";import{a as D}from"./chunk-VIGKOVHP.js";import{a as w}from"./chunk-X6ZAR7ZL.js";import{a as A}from"./chunk-TSPDJUGG.js";import{a as I}from"./chunk-Z5WMKCRJ.js";import{d as O}from"./chunk-KQPDXXG3.js";import{a as o}from"./chunk-P37U34EQ.js";import xe from"lodash.omitby";import je from"lodash.isnull";import{format as x,isFuture as Ve,parseISO as j,subDays as Pe}from"date-fns";import{useMemo as V}from"react";import be from"lodash.omit";import{useQuery as Fe}from"@tanstack/react-query";var G=o(({query:t,options:e})=>{let{client:y}=O();return Fe({queryKey:["payroll-calendars"],queryFn:o(()=>$({client:y,query:{year:t?.year,country_code:t?.countryCode}}),"queryFn"),enabled:e?.enabled,select:o(c=>c.data?.data?.payroll_calendars?.[0],"select")})},"usePayrollCalendars");import{isFuture as Me,isToday as ge,parseISO as Se}from"date-fns";var X=o(t=>{if(!t)return!1;let e=Se(t);return Me(e)||ge(e)},"isInProbationPeriod");import{Fragment as ke,jsx as m,jsxs as Ce}from"react/jsx-runtime";var lo=o(({employmentId:t,options:e,initialValues:y})=>{let{fieldValues:c,setFieldValues:ee,stepState:l,previousStep:oe,nextStep:ie}=A(q),{data:n,isLoading:te}=N({employmentId:t,queryParams:{exclude_files:!0}}),{data:ne}=G({query:{year:new Date().getFullYear().toString(),countryCode:n?.country?.code},options:{enabled:!!n?.country?.code}}),T=X(n?.probation_period_end_date),F=B(ne),P=V(()=>T?x(new Date,"yyyy-MM-dd"):x(F,"yyyy-MM-dd"),[T,F]),M=!!(n?.provisional_start_date&&Ve(j(n.provisional_start_date))),ae={personal_email:n?.basic_information?.email},g=z({...ae,...y,...l.values?.employee_communication,...l.values?.termination_details,...l.values?.paid_time_off,...l.values?.additional_information},M),d=V(()=>({...g,...c}),[c,g]),b=L({minTerminationDate:F,isEmployeeInProbationPeriod:T,selectedDate:j(d.proposed_termination_date)}),re=V(()=>{let s=R.data.schema.properties.termination_reason.oneOf,a=M?s.filter(i=>i.const==="cancellation_before_start_date"):s.filter(i=>i.const!=="cancellation_before_start_date");return{fields:{risk_assesment_info:S("Offboarding risk assessment","Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.",{className:e?.jsfModify?.fields?.risk_assesment_info?.["x-jsf-presentation"]?.className}),termination_reason:{...e?.jsfModify?.fields?.termination_reason,oneOf:a},proposed_termination_date_info:S("Proposed termination date",Ce(ke,{children:["In most cases, Remote must provide notice to the employee before termination. The required notice period depends on local labor laws, the employment agreement, and other factors. We'll use those factors to determine the required notice period.",m(v,{external:!0,zendeskId:u.terminationNoticePeriods,className:D("text-sm",e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.zendeskTriggerButtonClassName),children:"Learn about notice periods"})]}),{className:e?.jsfModify?.fields?.proposed_termination_date_info?.["x-jsf-presentation"]?.className}),proposed_termination_date:{...e?.jsfModify?.fields?.proposed_termination_date,"x-jsf-presentation":{...e?.jsfModify?.fields?.proposed_termination_date?.["x-jsf-presentation"],minDate:P,...d.termination_reason==="cancellation_before_start_date"&&n?.provisional_start_date?{maxDate:x(Pe(j(n.provisional_start_date),1),"yyyy-MM-dd")}:{},...b},...d.termination_reason==="cancellation_before_start_date"?{"x-jsf-errorMessage":{maximum:"The proposed termination date must be before the employee's start date."}}:{}},paid_time_off_info:{...e?.jsfModify?.fields?.paid_time_off_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.paid_time_off_info?.["x-jsf-presentation"]?.Component;return m(J,{employeeName:n?.basic_information?.name,proposedTerminationDate:d.proposed_termination_date,employmentId:t,employment:n,render:r=>i?m(i,{...r}):m(Q,{...r})})},"Component")}},acknowledge_termination_procedure_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"],Component:o(()=>{let i=e?.jsfModify?.fields?.acknowledge_termination_procedure_info?.["x-jsf-presentation"]?.Component;return m(U,{render:r=>i?m(i,{...r}):m(W,{...r})})},"Component")}},acknowledge_termination_procedure_fees_info:{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,"x-jsf-presentation":{...e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"],Component:o(()=>{let i={involuntaryOffboardingServiceChargeZendeskId:u.involuntaryOffboardingServiceCharge,reconciliationInvoiceZendeskId:u.reconciliationInvoice},r=e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info?.["x-jsf-presentation"]?.Component;return r?m(r,{...i}):m(Y,{...i})},"Component")}}}}},[n,t,d.proposed_termination_date,d.termination_reason,M,P,e?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,e?.jsfModify?.fields?.acknowledge_termination_procedure_info,e?.jsfModify?.fields?.paid_time_off_info,e?.jsfModify?.fields?.proposed_termination_date,e?.jsfModify?.fields?.proposed_termination_date_info,e?.jsfModify?.fields?.risk_assesment_info,e?.jsfModify?.fields?.termination_reason,b]),{data:f,isLoading:se}=K({formValues:d,jsfModify:{...e?.jsfModify,fields:{...e?.jsfModify?.fields,...re?.fields}},step:l.currentStep.name}),me=E(H.data.schema),k=Z(),{mutateAsync:de}=w(k);async function fe(s){if(!t)throw new Error("Employment id is missing");if(f){let a=await C(s,!0),{customer_informed_employee:i}=a,r=i==="yes"?{employee_awareness:{date:a.customer_informed_employee_date,note:a.customer_informed_employee_description}}:void 0,ue=await I(a,["agrees_to_pto_amount","confidential","customer_informed_employee","will_challenge_termination"]),_e=be(ue,"customer_informed_employee_date","customer_informed_employee_description"),ye=xe({..._e,...r},je),p=a.timesheet_file??[],h=Array.isArray(p)&&p.length>0?{content:p[0].content,name:p[0].name}:void 0,Te={employment_id:t,termination_details:{...ye,timesheet_file:h||void 0},type:"termination"};return de(Te)}}o(fe,"onSubmit");function le(){oe()}o(le,"back");function ce(){ie()}o(ce,"next");let pe=Object.keys(c).length>0,C=o(async(s,a=!1)=>a?await _(s,me.fields,{isPartialValidation:!0}):f?await _(s,f?.fields,{isPartialValidation:!0}):{},"parseFormValues");return{employmentId:t,employment:n,fieldValues:d,isDirty:pe,stepState:l,fields:f?.fields||[],isLoading:se||te,isSubmitting:k.isPending,initialValues:g,handleValidation:o(async s=>{if(f){let a=await _(s,f?.fields);return f?.handleValidation(a)}return null},"handleValidation"),checkFieldUpdates:ee,parseFormValues:C,onSubmit:fe,back:le,next:ce}},"useTermination");export{lo as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7FBVVWZL.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a,b as s,e as l,h as c,i as d}from"./chunk-PX5PE6GX.js";import{a as n}from"./chunk-P37U34EQ.js";function _(e={}){let o=[{name:"select_country",label:"Select Country",visible:!!e?.includeSelectCountry},{name:"basic_information",label:"Basic Information",visible:!0},{name:"pricing_plan",label:"Pricing Plan",visible:!0},{name:"eligibility_questionnaire",label:"Eligibility Questionnaire",visible:!!e?.includeEligibilityQuestionnaire},{name:"contract_details",label:"Contract Details",visible:!0},{name:"contract_preview",label:"Contract Preview",visible:!!e?.includeContractPreview},{name:"review",label:"Review",visible:!0}].map((i,r)=>({name:i.name,index:r,label:i.label,visible:i.visible}));return{steps:o.reduce((i,r)=>(i[r.name]={index:r.index,name:r.name,visible:r.visible},i),{}),stepsArray:o}}n(_,"buildSteps");var E=n((e,t)=>{if(e&&t&&e!==t)return`When the contractor will start providing service to your company. ${`This date does not match the date you provided in the Basic Information step - ${e} - and will override it only when both parties have signed the contract.`}`},"calculateProvisionalStartDateDescription"),v=n(e=>e===a||e===s,"isCMOrCMPlus"),p=["SAU","KWT","OMN","QAT","BHR"],g=n(e=>p.includes(e),"isNationalityCountryCode"),y=n((e,t)=>!t||t.length===0?!0:!t.some(o=>l[o]===e),"shouldIncludeProduct"),S=["invited","created_awaiting_reserve","created_reserve_paid"],f=["created_awaiting_reserve","invited"];function R(e){return e?d:c}n(R,"transformAiErrorResponse");export{_ as a,E as b,v as c,g as d,y as e,S as f,f as g,R as h};
|
|
2
|
+
//# sourceMappingURL=chunk-AHRG5QCS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/ContractorOnboarding/utils.ts"],"sourcesContent":["import { Step } from '@/src/flows/useStepState';\nimport {\n contractorStandardProductIdentifier,\n contractorPlusProductIdentifier,\n ProductType,\n PRODUCT_IDENTIFIER_MAP,\n REMOTE_AI_SERVICES_AND_DELIVERABLES_ERROR_MESSAGE,\n REMOTE_AI_SERVICES_AND_DELIVERABLES_COR_ERROR_MESSAGE,\n} from '@/src/flows/ContractorOnboarding/constants';\nimport { Employment } from '@/src/flows/Onboarding/types';\n\nexport type StepKeys =\n | 'select_country'\n | 'basic_information'\n | 'contract_details'\n | 'eligibility_questionnaire'\n | 'contract_preview'\n | 'pricing_plan'\n | 'review';\n\ntype StepConfig = {\n includeSelectCountry?: boolean;\n includeEligibilityQuestionnaire?: boolean;\n includeContractPreview?: boolean;\n};\n\nexport function buildSteps(config: StepConfig = {}) {\n const stepDefinitions: Array<{\n name: StepKeys;\n label: string;\n visible: boolean;\n }> = [\n {\n name: 'select_country',\n label: 'Select Country',\n visible: Boolean(config?.includeSelectCountry),\n },\n {\n name: 'basic_information',\n label: 'Basic Information',\n visible: true,\n },\n {\n name: 'pricing_plan',\n label: 'Pricing Plan',\n visible: true,\n },\n {\n name: 'eligibility_questionnaire',\n label: 'Eligibility Questionnaire',\n visible: Boolean(config?.includeEligibilityQuestionnaire),\n },\n {\n name: 'contract_details',\n label: 'Contract Details',\n visible: true,\n },\n {\n name: 'contract_preview',\n label: 'Contract Preview',\n visible: Boolean(config?.includeContractPreview),\n },\n {\n name: 'review',\n label: 'Review',\n visible: true,\n },\n ];\n\n const stepsArray = stepDefinitions.map((step, index) => ({\n name: step.name,\n index,\n label: step.label,\n visible: step.visible,\n }));\n\n const steps = stepsArray.reduce(\n (acc, step) => {\n acc[step.name] = {\n index: step.index,\n name: step.name,\n visible: step.visible,\n };\n return acc;\n },\n {} as Record<string, Step<StepKeys>>,\n );\n\n return { steps, stepsArray };\n}\n\n/**\n * Calculates the description for the provisional start date field\n * based on whether the dates match between basic information and contract details steps\n */\nexport const calculateProvisionalStartDateDescription = (\n employmentProvisionalStartDate: string | undefined,\n fieldProvisionalStartDate: string | undefined,\n): string | undefined => {\n const datesNotMatching =\n employmentProvisionalStartDate &&\n fieldProvisionalStartDate &&\n employmentProvisionalStartDate !== fieldProvisionalStartDate;\n\n if (datesNotMatching) {\n const datesDontMatchWarning = `This date does not match the date you provided in the Basic Information step - ${\n employmentProvisionalStartDate\n } - and will override it only when both parties have signed the contract.`;\n return `When the contractor will start providing service to your company. ${datesDontMatchWarning}`;\n }\n return undefined;\n};\n\n/**\n * Checks if the selected pricing plan is CM (standard) or CM+ (plus)\n */\nexport const isCMOrCMPlus = (subscription: string | undefined): boolean => {\n return (\n subscription === contractorStandardProductIdentifier ||\n subscription === contractorPlusProductIdentifier\n );\n};\n\nconst NATIONALITY_COUNTRY_CODES = ['SAU', 'KWT', 'OMN', 'QAT', 'BHR'];\n\n/**\n * Checks if the country code is a country code that requires nationality status field\n */\nexport const isNationalityCountryCode = (countryCode: string) => {\n return NATIONALITY_COUNTRY_CODES.includes(countryCode);\n};\n\n/**\n * Checks if a product should be included based on the excludeProducts list\n * @param productIdentifier - The product identifier to check\n * @param excludeProducts - Array of products to exclude\n * @returns true if the product should be included, false otherwise\n */\nexport const shouldIncludeProduct = (\n productIdentifier: string,\n excludeProducts?: ProductType[],\n): boolean => {\n if (!excludeProducts || excludeProducts.length === 0) {\n return true;\n }\n\n return !excludeProducts.some(\n (excluded) => PRODUCT_IDENTIFIER_MAP[excluded] === productIdentifier,\n );\n};\n\n/**\n * Array of employment statuses that are allowed to proceed to the review step.\n * These statuses indicate that the employment is in a final state and the employment cannot be modified further.\n * @type {Employment['status'][]}\n * @constant\n */\nexport const reviewStepAllowedEmploymentStatus: Employment['status'][] = [\n 'invited',\n 'created_awaiting_reserve',\n 'created_reserve_paid',\n];\n\nexport const disabledInviteButtonEmploymentStatus: Employment['status'][] = [\n 'created_awaiting_reserve',\n 'invited',\n];\n\n/**\n * Transforms AI error messages to use default localized messages\n * @param isContractorOfRecord - Whether the contractor is a Contractor of Record\n * @param errors - Array of error messages from the API\n * @returns Array containing the appropriate default error message\n */\nexport function transformAiErrorResponse(\n isContractorOfRecord: boolean,\n): string {\n const remoteAiErrorMessage = isContractorOfRecord\n ? REMOTE_AI_SERVICES_AND_DELIVERABLES_COR_ERROR_MESSAGE\n : REMOTE_AI_SERVICES_AND_DELIVERABLES_ERROR_MESSAGE;\n return remoteAiErrorMessage;\n}\n"],"mappings":"uGA0BO,SAASA,EAAWC,EAAqB,CAAC,EAAG,CA2ClD,IAAMC,EAtCD,CACH,CACE,KAAM,iBACN,MAAO,iBACP,QAAS,EAAQD,GAAQ,oBAC3B,EACA,CACE,KAAM,oBAC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ps","config","stepsArray","step","index","acc","__name","calculateProvisionalStartDateDescription","employmentProvisionalStartDate","fieldProvisionalStartDate","isCMOrCMPlus","subscription","contractorStandardProductIdentifier","contractorPlusProductIdentifier","NATIONALITY_COUNTRY_CODES","isNationalityCountryCode","countryCode","shouldIncludeProduct","productIdentifier","excludeProducts","excluded","PRODUCT_IDENTIFIER_MAP","reviewStepAllowedEmploymentStatus","disabledInviteButtonEmploymentStatus","transformAiErrorResponse","isContractorOfRecord","REMOTE_AI_SERVICES_AND_DELIVERABLES_COR_ERROR_MESSAGE","REMOTE_AI_SERVICES_AND_DELIVERABLES_ERROR_MESSAGE"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as d,d as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as d,d as S}from"./chunk-EMP4ZIVB.js";import{a as u}from"./chunk-HN5HLFTB.js";import{a as f}from"./chunk-KSHK3ZPX.js";import{b as C}from"./chunk-LNV36S6D.js";import{f as y}from"./chunk-7EONM7HL.js";import{a as o}from"./chunk-P37U34EQ.js";import{useEffect as T,useId as U,useState as I}from"react";import{jsx as k}from"react/jsx-runtime";var l=o((n,e,r)=>r&&r[e]?r[e]:n[e]?n[e]/100:0,"getDefaultManagementFee"),A=o((n,e,r,g)=>!e&&!r?.management_fee&&n?l(u,n,g):e&&!r?.management_fee?"":r?.management_fee,"getManagementFee"),W=o(({estimationOptions:n=d,defaultValues:e={countryRegionSlug:"",regionSlug:"",currencySlug:"",salary:"",benefits:{},management:{management_fee:""}},options:r,render:g,version:_="standard"})=>{let p=U(),[R,m]=I("USD"),F=o(s=>{m(s);let a=l(u,s,n.managementFees);a&&c.setValue("management.management_fee",a.toString())},"onCurrencyChange"),t=S({defaultRegion:e.countryRegionSlug,defaultCurrency:e.currencySlug,defaultSalary:e.salary,estimationOptions:n,version:_,options:{...r,onCurrencyChange:F}}),K=C(t.handleValidation),b=A(R,e.currencySlug,e.management,n.managementFees),{countryRegionSlug:v,currencySlug:h,salary:D,benefits:P,hiringBudget:B,age:E,contractDurationType:M,regionSlug:w,...x}=e,c=y({resolver:K,defaultValues:{country:v,currency:h,region:w,salary:D,salary_conversion:"",salary_converted:void 0,hiring_budget:B||"employee_annual_salary",age:E,contract_duration_type:M,management:{management_fee:b?.toString()||""},benefits:P,estimation_title:n.title,...x},shouldUnregister:!1,mode:"onBlur"});return T(()=>{if(e.currencySlug&&t.currencies&&n.includeManagementFee&&!e.management?.management_fee){let a=t.currencies.find(i=>i.value===e.currencySlug)?.label;if(a){m(a);let i=l(u,a,n.managementFees);c.setValue("management.management_fee",i?.toString()||"")}}},[e.currencySlug,t.currencies,n.includeManagementFee,n.managementFees,e.management?.management_fee,c]),k(f.Provider,{value:{form:c,formId:p,costCalculatorBag:t},children:g(t)})},"CostCalculatorFlow");export{W as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ATVQXA4X.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as g}from"./chunk-VIGKOVHP.js";import{a as d}from"./chunk-P37U34EQ.js";import*as e from"react";import{ChevronDownIcon as h}from"lucide-react";import{jsx as l,jsxs as y}from"react/jsx-runtime";var x=e.createContext(null),R=d(()=>{let t=e.useContext(x);if(!t)throw new Error("Accordion components must be used within Accordion");return t},"useAccordion");function P({collapsible:t=!1,defaultValue:u,value:r,onValueChange:o,className:n,children:i,...c}){let[s,p]=e.useState(u),m=r!==void 0,a=m?r:s,f=e.useCallback(A=>{let v;a===A?v=t?"":A:v=A,m||p(v),o&&o(v)},[a,t,m,o]),C=e.useMemo(()=>({openItem:a,toggleItem:f,collapsible:t}),[a,f,t]);return l(x.Provider,{value:C,children:l("div",{"data-slot":"accordion",className:n,...c,children:i})})}d(P,"Accordion");var I=e.createContext(null),b=d(()=>{let t=e.useContext(I);if(!t)throw new Error("AccordionItem components must be used within AccordionItem");return t},"useAccordionItem");function E({value:t,className:u,children:r,...o}){let{openItem:n}=R(),i=n===t,c=e.useId(),s=e.useMemo(()=>({value:t,isOpen:i,contentId:c}),[t,i,c]);return l(I.Provider,{value:s,children:l("div",{"data-slot":"accordion-item",className:g("border-b last:border-b-0",u),...o,children:r})})}d(E,"AccordionItem");function T({className:t,iconClassName:u,children:r,onClick:o,...n}){let{toggleItem:i}=R(),{value:c,isOpen:s,contentId:p}=b(),m=e.useId(),a=d(f=>{i(c),o?.(f)},"handleClick");return l("div",{className:"flex items-center",children:y("button",{id:m,type:"button","data-slot":"accordion-trigger","data-state":s?"open":"closed","aria-expanded":s,"aria-controls":p,className:g("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",t),onClick:a,...n,children:[r,l(h,{className:g("text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 mt-1",u)})]})})}d(T,"AccordionTrigger");function V({className:t,children:u,...r}){let{isOpen:o,contentId:n}=b(),[i,c]=e.useState(o),[s,p]=e.useState(o);return e.useLayoutEffect(()=>{if(o){c(!0);let a=requestAnimationFrame(()=>{window.getComputedStyle(document.getElementById(n)).height,p(!0)});return()=>cancelAnimationFrame(a)}p(!1);let m=setTimeout(()=>c(!1),200);return()=>clearTimeout(m)},[o,n]),i?l("div",{id:n,role:"region","data-slot":"accordion-content","data-state":o?"open":"closed",className:g("overflow-hidden text-sm transition-all duration-200 ease-out",s?"max-h-[2000px] opacity-100":"max-h-0 opacity-0"),...r,children:l("div",{className:g("pt-0 pb-4",t),children:u})}):null}d(V,"AccordionContent");export{P as a,E as b,T as c,V as d};
|
|
2
|
+
//# sourceMappingURL=chunk-AYC6DTFV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/accordion.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChevronDownIcon } from 'lucide-react';\n\nimport { cn } from '@/src/lib/utils';\n\ntype AccordionContextValue = {\n openItem: string | undefined;\n toggleItem: (value: string) => void;\n collapsible: boolean;\n};\n\nconst AccordionContext = React.createContext<AccordionContextValue | null>(\n null,\n);\n\nconst useAccordion = () => {\n const context = React.useContext(AccordionContext);\n if (!context) {\n throw new Error('Accordion components must be used within Accordion');\n }\n return context;\n};\n\ntype AccordionProps = {\n collapsible?: boolean;\n defaultValue?: string;\n value?: string;\n onValueChange?: (value: string) => void;\n className?: string;\n children: React.ReactNode;\n};\n\nfunction Accordion({\n collapsible = false,\n defaultValue,\n value: controlledValue,\n onValueChange,\n className,\n children,\n ...props\n}: AccordionProps) {\n const [uncontrolledValue, setUncontrolledValue] = React.useState<\n string | undefined\n >(defaultValue);\n\n const isControlled = controlledValue !== undefined;\n const openItem = isControlled ? controlledValue : uncontrolledValue;\n\n const toggleItem = React.useCallback(\n (value: string) => {\n let newValue: string | undefined;\n\n if (openItem === value) {\n // Clicking the open item\n newValue = collapsible ? '' : value;\n } else {\n // Clicking a different item\n newValue = value;\n }\n\n if (!isControlled) {\n setUncontrolledValue(newValue);\n }\n\n if (onValueChange) {\n onValueChange(newValue);\n }\n },\n [openItem, collapsible, isControlled, onValueChange],\n );\n\n const contextValue = React.useMemo(\n () => ({ openItem, toggleItem, collapsible }),\n [openItem, toggleItem, collapsible],\n );\n\n return (\n <AccordionContext.Provider value={contextValue}>\n <div data-slot='accordion' className={className} {...props}>\n {children}\n </div>\n </AccordionContext.Provider>\n );\n}\n\ntype AccordionItemContextValue = {\n value: string;\n isOpen: boolean;\n contentId: string;\n};\n\nconst AccordionItemContext =\n React.createContext<AccordionItemContextValue | null>(null);\n\nconst useAccordionItem = () => {\n const context = React.useContext(AccordionItemContext);\n if (!context) {\n throw new Error(\n 'AccordionItem components must be used within AccordionItem',\n );\n }\n return context;\n};\n\ntype AccordionItemProps = {\n value: string;\n className?: string;\n children: React.ReactNode;\n};\n\nfunction AccordionItem({\n value,\n className,\n children,\n ...props\n}: AccordionItemProps) {\n const { openItem } = useAccordion();\n const isOpen = openItem === value;\n const contentId = React.useId();\n\n const contextValue = React.useMemo(\n () => ({ value, isOpen, contentId }),\n [value, isOpen, contentId],\n );\n\n return (\n <AccordionItemContext.Provider value={contextValue}>\n <div\n data-slot='accordion-item'\n className={cn('border-b last:border-b-0', className)}\n {...props}\n >\n {children}\n </div>\n </AccordionItemContext.Provider>\n );\n}\n\ntype AccordionTriggerProps = {\n className?: string;\n iconClassName?: string;\n children: React.ReactNode;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nfunction AccordionTrigger({\n className,\n iconClassName,\n children,\n onClick,\n ...props\n}: AccordionTriggerProps) {\n const { toggleItem } = useAccordion();\n const { value, isOpen, contentId } = useAccordionItem();\n const triggerId = React.useId();\n\n const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n toggleItem(value);\n onClick?.(event);\n };\n\n return (\n <div className='flex items-center'>\n <button\n id={triggerId}\n type='button'\n data-slot='accordion-trigger'\n data-state={isOpen ? 'open' : 'closed'}\n aria-expanded={isOpen}\n aria-controls={contentId}\n className={cn(\n 'focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180',\n className,\n )}\n onClick={handleClick}\n {...props}\n >\n {children}\n <ChevronDownIcon\n className={cn(\n 'text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200 mt-1',\n iconClassName,\n )}\n />\n </button>\n </div>\n );\n}\n\ntype AccordionContentProps = {\n className?: string;\n children: React.ReactNode;\n};\n\nfunction AccordionContent({\n className,\n children,\n ...props\n}: AccordionContentProps): React.ReactElement | null {\n const { isOpen, contentId } = useAccordionItem();\n const [shouldRender, setShouldRender] = React.useState(isOpen);\n const [shouldAnimate, setShouldAnimate] = React.useState(isOpen);\n\n React.useLayoutEffect(() => {\n if (isOpen) {\n setShouldRender(true);\n const rafId = requestAnimationFrame(() => {\n void window.getComputedStyle(document.getElementById(contentId)!)\n .height;\n setShouldAnimate(true);\n });\n return () => cancelAnimationFrame(rafId);\n }\n setShouldAnimate(false);\n const timer = setTimeout(() => setShouldRender(false), 200);\n return () => clearTimeout(timer);\n }, [isOpen, contentId]);\n\n if (!shouldRender) return null;\n\n return (\n <div\n id={contentId}\n role='region'\n data-slot='accordion-content'\n data-state={isOpen ? 'open' : 'closed'}\n className={cn(\n 'overflow-hidden text-sm transition-all duration-200 ease-out',\n shouldAnimate ? 'max-h-[2000px] opacity-100' : 'max-h-0 opacity-0',\n )}\n {...props}\n >\n <div className={cn('pt-0 pb-4', className)}>{children}</div>\n </div>\n );\n}\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n"],"mappings":"gFAAA,UAAYA,MAAW,QACvB,OAAS,mBAAAC,MAAuB,eA6E1B,cAAAC,EAoFA,QAAAC,MApFA,oBAnEN,IAAMC,EAAyB,gBAC7B,IACF,EAEMC,EAAeC,EAAA,IAAM,CACzB,IAAMC,EAAgB,aAAWH,CAAgB,EACjD,GAAI,CAACG,EACH,MAAM,IAAI,MAAM,oDAAoD,EAEtE,OAAOA,CACT,EANqB,gBAiBrB,SAASC,EAAU,CACjB,YAAAC,EAAc,GACd,aAAAC,EACA,MAAOC,EACP,cAAAC,EACA,UAAAC,EACA,SAAAC,EACA,GAAGC,CACL,EAAmB,CACjB,GAAM,CAACC,EAAmBC,CAAoB,EAAU,WAEtDP,CAAY,EAERQ,EAAeP,IAAoB,OACnCQ,EAAWD,EAAeP,EAAkBK,EAE5CI,EAAmB,cACtBC,GAAkB,CACjB,IAAIC,EAEAH,IAAaE,EAEfC,EAAWb,EAAc,GAAKY,EAG9BC,EAAWD,EAGRH,GACHD,EAAqBK,CAAQ,EAG3BV,GACFA,EAAcU,CAAQ,CAE1B,EACA,CAACH,EAAUV,EAAaS,EAAcN,CAAa,CACrD,EAEMW,EAAqB,UACzB,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OAAI,UAAU,oBACb,SAAAC,EAAC,UACC,GAAI8B,EACJ,KAAK,SACL,YAAU,oBACV,aAAYN,EAAS,OAAS,SAC9B,gBAAeA,EACf,gBAAeC,EACf,UAAWC,EACT,6SACAhB,CACF,EACA,QAASqB,EACR,GAAGnB,EAEH,UAAAD,EACDZ,EAACkC,EAAA,CACC,UAAWP,EACT,mHACAE,CACF,EACF,GACF,EACF,CAEJ,CA1CSzB,EAAAwB,EAAA,oBAiDT,SAASO,EAAiB,CACxB,UAAAxB,EACA,SAAAC,EACA,GAAGC,CACL,EAAqD,CACnD,GAAM,CAAE,OAAAY,EAAQ,UAAAC,CAAU,EAAIH,EAAiB,EACzC,CAACa,EAAcC,CAAe,EAAU,WAASZ,CAAM,EACvD,CAACa,EAAeC,CAAgB,EAAU,WAASd,CAAM,EAiB/D,OAfM,kBAAgB,IAAM,CAC1B,GAAIA,EAAQ,CACVY,EAAgB,EAAI,EACpB,IAAMG,EAAQ,sBAAsB,IAAM,CACnC,OAAO,iBAAiB,SAAS,eAAed,CAAS,CAAE,EAC7D,OACHa,EAAiB,EAAI,CACvB,CAAC,EACD,MAAO,IAAM,qBAAqBC,CAAK,CACzC,CACAD,EAAiB,EAAK,EACtB,IAAME,EAAQ,WAAW,IAAMJ,EAAgB,EAAK,EAAG,GAAG,EAC1D,MAAO,IAAM,aAAaI,CAAK,CACjC,EAAG,CAAChB,EAAQC,CAAS,CAAC,EAEjBU,EAGHpC,EAAC,OACC,GAAI0B,EACJ,KAAK,SACL,YAAU,oBACV,aAAYD,EAAS,OAAS,SAC9B,UAAWE,EACT,+DACAW,EAAgB,6BAA+B,mBACjD,EACC,GAAGzB,EAEJ,SAAAb,EAAC,OAAI,UAAW2B,EAAG,YAAahB,CAAS,EAAI,SAAAC,EAAS,EACxD,EAfwB,IAiB5B,CAzCSR,EAAA+B,EAAA","names":["React","ChevronDownIcon","jsx","jsxs","AccordionContext","useAccordion","__name","context","Accordion","collapsible","defaultValue","controlledValue","onValueChange","className","children","props","uncontrolledValue","setUncontrolledValue","isControlled","openItem","toggleItem","value","newValue","contextValue","AccordionItemContext","useAccordionItem","AccordionItem","isOpen","contentId","cn","AccordionTrigger","iconClassName","onClick","triggerId","handleClick","event","ChevronDownIcon","AccordionContent","shouldRender","setShouldRender","shouldAnimate","setShouldAnimate","rafId","timer"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-KRJETP7I.js";import{a}from"./chunk-ZOTT6IZN.js";import{a as i}from"./chunk-W7YC2IO2.js";import{a as c}from"./chunk-FHYOWPXB.js";import{a as S}from"./chunk-YIMWF5GR.js";import{a as f}from"./chunk-KANAWPXZ.js";import{a as n}from"./chunk-Q72MEHVY.js";import{a as p}from"./chunk-BNHZ4W7L.js";import{a as s}from"./chunk-FYSLOFAJ.js";import{c as e}from"./chunk-4OJ4TAXO.js";import{a as r}from"./chunk-PGWKJ6FK.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as D,useState as P}from"react";import{jsx as R}from"react/jsx-runtime";var L=t(({employmentId:d,companyId:u,countryCode:b,type:l="employee",externalId:v,skipSteps:g,initialValues:B,render:I,options:O})=>{let w=D(),o=e({companyId:u,countryCode:b,employmentId:d,type:l,options:O,skipSteps:g,externalId:v,initialValues:B}),[C,h]=P({showReserveInvoice:!1,showInviteSuccessful:!1});return R(r.Provider,{value:{formId:w,onboardingBag:o,creditScore:C,setCreditScore:h},children:I({onboardingBag:o,components:{BasicInformationStep:n,ContractDetailsStep:s,BenefitsStep:p,SubmitButton:i,SaveDraftButton:S,BackButton:m,OnboardingInvite:a,SelectCountryStep:f,ReviewStep:c}})})},"OnboardingFlow");export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BIP2WGMA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-QJ2XK63I.js";import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-QJ2XK63I.js";import{a as r}from"./chunk-LSW66EIR.js";import{a}from"./chunk-U6LRMWRI.js";import{a as c}from"./chunk-POKLRB3M.js";import{a as e}from"./chunk-D5AR26AI.js";import{a as o}from"./chunk-TVZAFTPT.js";import{a as n}from"./chunk-P37U34EQ.js";import{useId as f}from"react";import{jsx as s}from"react/jsx-runtime";function k({employmentId:d,countryCode:C,options:p,render:A}){let t=c({employmentId:d,countryCode:C,options:p}),i=f();return s(o.Provider,{value:{formId:i,contractAmendmentBag:t},children:A({contractAmendmentBag:t,components:{Form:r,SubmitButton:a,ConfirmationForm:m,BackButton:e}})})}n(k,"ContractAmendmentFlow");export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BLGKOMH3.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as m}from"./chunk-WZSDVFJ3.js";import{b as a}from"./chunk-PGWKJ6FK.js";import{f as t}from"./chunk-T7O3YYOG.js";import{b as s}from"./chunk-X6ZAR7ZL.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as E}from"react/jsx-runtime";function P({components:d,onSubmit:l,onError:i,onSuccess:f}){let{onboardingBag:o}=a(),p=o.fields??[],c=t(p,o.initialValues.benefits);return E(m,{defaultValues:c,components:d,onSubmit:e(async n=>{try{await l?.(n);let r=await o.onSubmit(n);if(r?.data){await f?.(r.data),o?.next();return}if(r?.error){let u=s(r?.fieldErrors||[],o.meta?.fields?.benefits);i?.({error:r.error,rawError:r.rawError,fieldErrors:u})}}catch(r){i?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit")})}e(P,"BenefitsStep");export{P as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BNHZ4W7L.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as n}from"./chunk-Z6B3PA4M.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-BTS5Q6UZ.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-JTPKAIYL.js";import{a as F}from"./chunk-SNECOPBD.js";import{g as S}from"./chunk-T7O3YYOG.js";import{b as T}from"./chunk-YHCH57B7.js";import{c}from"./chunk-7EONM7HL.js";import{e as m}from"./chunk-VIGKOVHP.js";import{a as i}from"./chunk-P37U34EQ.js";import{Fragment as x}from"react";var d={..._,fieldset:g,"fieldset-flat":g};import{useEffect as P}from"react";import{Fragment as R,jsx as p,jsxs as h}from"react/jsx-runtime";var C=i(({name:e,description:a,helpCenter:n})=>h("span",{children:[p("span",{className:`text-xs RemoteFlows__ForcedValue__Description__${e}`,dangerouslySetInnerHTML:{__html:m(a)}}),n?.callToAction&&n?.id&&p(T,{className:"RemoteFlows__ForcedValue__HelpCenterLink",zendeskId:n.id,children:n.callToAction})]}),"Description");function k({name:e,value:a,description:n,statement:r,label:u,helpCenter:l}){let{setValue:t}=c(),s=m(r?.description||n);return P(()=>{t(e,a)},[]),p("div",{children:r?h(R,{children:[p("p",{className:`text-sm RemoteFlows__ForcedValue__Title__${e}`,dangerouslySetInnerHTML:{__html:m(r?.title||u)}}),p(C,{name:e,description:m(r?.description||n),helpCenter:l})]}):p(C,{name:e,description:s,helpCenter:l})})}i(k,"ForcedValueField");import{Fragment as M,jsx as o,jsxs as y}from"react/jsx-runtime";function J(e){return e.const!==void 0&&e.const===e.default&&e.inputType!=="checkbox"&&e.inputType!=="hidden"}i(J,"checkFieldHasForcedValue");var G=i(({fields:e,fieldsets:a,fieldValues:n,components:r})=>{let{setValue:u}=c();if(!e||e.length===0)return null;let l=a&&n?S({fields:e,fieldsets:a,values:n}):e;return o(M,{children:l.map(t=>{if(t.calculateDynamicProperties&&(t={...t,...t.calculateDynamicProperties(n,t)||{}}),t.isVisible===!1||t.deprecated||t.hidden)return null;if(J(t))return o(k,{name:t.name,description:t.description,value:t.const,statement:t.statement,label:t.label,helpCenter:t.meta?.helpCenter},t.name);if(t.Component){let{Component:b}=t;return y(x,{children:[o(b,{setValue:V=>u(t.name,V),...t}),t.statement?o(F,{...t.statement}):null,t.extra?t.extra:null]},t.name)}let s=d[t.inputType];return s?t.inputType==="fieldset"?o(s,{...t,components:r},t.name):t.inputType==="fieldset-flat"?o(s,{...t,components:r,isFlatFieldset:!0},t.name):(t.inputType==="select"&&t.multiple&&(s=d["multi-select"]),y(x,{children:[o(s,{...t,component:r&&r[t.inputType]}),t.statement?o(F,{...t.statement}):null,t.extra?t.extra:null]},t.name)):y("p",{className:"error",children:["Field type ",t.inputType," not supported"]})})})},"JSONSchemaFormFields");export{G as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BUOCIXUH.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as e}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as e}from"./chunk-MP3VDCI7.js";import{a as t}from"./chunk-VIGKOVHP.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";var s=o(({isExpanded:l,onToggle:n,className:m,...i})=>p(e,{type:"button",className:t("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",m),variant:"default",onClick:n,...i,children:l?"Remove":"Define"}),"FieldsetToggleButtonDefault");export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BYDQHL6O.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-RGLQY27T.js";import{a as C,b as w,c as F,d as P}from"./chunk-MSBCYMSH.js";import{i as _,j as v,k as x,l as h,m as b}from"./chunk-7EONM7HL.js";import{a as u,b as D}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-RGLQY27T.js";import{a as C,b as w,c as F,d as P}from"./chunk-MSBCYMSH.js";import{i as _,j as v,k as x,l as h,m as b}from"./chunk-7EONM7HL.js";import{a as u,b as D}from"./chunk-MP3VDCI7.js";import{a as t}from"./chunk-VIGKOVHP.js";import{a as o}from"./chunk-P37U34EQ.js";import{CalendarIcon as L}from"lucide-react";import{format as R}from"date-fns";import{ChevronLeft as I,ChevronRight as M}from"lucide-react";import{DayPicker as z}from"react-day-picker";import{jsx as p}from"react/jsx-runtime";function N({className:r,classNames:i,showOutsideDays:s=!0,...n}){return p(z,{showOutsideDays:s,className:t("p-3",r),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:t(u({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:t("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:t(u({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...i},components:{IconLeft:o(({className:d,...l})=>p(I,{className:t("size-4",d),...l}),"IconLeft"),IconRight:o(({className:d,...l})=>p(M,{className:t("size-4",d),...l}),"IconRight")},...n})}o(N,"Calendar");import{Fragment as V,jsx as e,jsxs as m}from"react/jsx-runtime";function X({field:r,fieldData:i,fieldState:s}){let{name:n,label:d,description:l,minDate:f,maxDate:g}=i,c=f?new Date(f):void 0,y=g?new Date(g):void 0;return m(_,{"data-field":n,className:`flex flex-col RemoteFlows__DatePickerField__Item__${n}`,children:[e(v,{className:"RemoteFlows__DatePickerField__Label",children:d}),m(w,{children:[e(F,{asChild:!0,children:e(x,{children:e("div",{children:m(D,{type:"button",variant:"outline",className:t("w-full pl-3 text-left font-normal",!r.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${n}`,children:[r.value&&e(V,{children:R(r.value,"yyyy-MM-dd")}),e(L,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),e(P,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:e(N,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:r.value?new Date(r.value):void 0,onSelect:a=>{r.onChange(a?R(a,"yyyy-MM-dd"):null)},defaultMonth:c,components:{DayContent:o(a=>e(C,{children:a.date.getDate()}),"DayContent")},disabled:a=>!!(c&&a<c||y&&a>y)})})]}),l?m(h,{children:[l," ",e(k,{helpCenter:i.meta?.helpCenter})]}):null,s.error&&e(b,{className:"RemoteFlows__DatePickerField__Error"})]})}o(X,"DatePickerFieldDefault");export{X as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DPRCPBRB.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as s}from"./chunk-Q3ALCPJN.js";import{b as e}from"./chunk-KQPDXXG3.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as p}from"react/jsx-runtime";var S=o(({onSuccess:i,onError:a,className:m,children:u,disabled:c=!1,...d})=>{let{contractorOnboardingBag:f,formId:l}=s(),{components:b}=e(),E=o(async()=>{let n=document.getElementById(l);if(n){let r=new Event("submit",{bubbles:!0,cancelable:!0});r.isDraftSubmission=!0,r.draftCallbacks={onSuccess:i,onError:a},n.dispatchEvent(r)}},"handleSaveDraft"),t=b?.button;if(!t)throw new Error("Button component not found");return p(t,{...d,onClick:E,disabled:c||f.isSubmitting,className:m,children:u})},"SaveDraftButton");export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DPVXSN7T.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/flows/ContractorOnboarding/components/SaveDraftButton.tsx"],"sourcesContent":["import { useFormFields } from '@/src/context';\nimport { useContractorOnboardingContext } from '@/src/flows/ContractorOnboarding/context';\nimport { ButtonHTMLAttributes } from 'react';\nimport { NormalizedFieldError } from '@/src/lib/mutations';\nimport { $TSFixMe } from '@/src/types/remoteFlows';\n\ntype SaveDraftButtonProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'onError'\n> & {\n onSuccess?: () => void | Promise<void>;\n onError?: ({\n error,\n rawError,\n fieldErrors,\n }: {\n error: Error;\n rawError: Record<string, unknown>;\n fieldErrors: NormalizedFieldError[];\n }) => void;\n};\n\nexport const SaveDraftButton = ({\n onSuccess,\n onError,\n className,\n children,\n disabled = false,\n ...props\n}: SaveDraftButtonProps) => {\n const { contractorOnboardingBag, formId } = useContractorOnboardingContext();\n\n const { components } = useFormFields();\n\n const handleSaveDraft = async () => {\n const form = document.getElementById(formId);\n if (form) {\n const submitEvent = new Event('submit', {\n bubbles: true,\n cancelable: true,\n });\n (submitEvent as $TSFixMe).isDraftSubmission = true;\n (submitEvent as $TSFixMe).draftCallbacks = { onSuccess, onError };\n form.dispatchEvent(submitEvent);\n }\n };\n\n const CustomButton = components?.button;\n if (!CustomButton) {\n throw new Error(`Button component not found`);\n }\n\n return (\n <CustomButton\n {...props}\n onClick={handleSaveDraft}\n disabled={disabled || contractorOnboardingBag.isSubmitting}\n className={className}\n >\n {children}\n </CustomButton>\n );\n};\n"],"mappings":"wHAqDI,cAAAA,MAAA,oBA/BG,IAAMC,EAAkBC,EAAA,CAAC,CAC9B,UAAAC,EACA,QAAAC,EACA,UAAAC,EACA,SAAAC,EACA,SAAAC,EAAW,GACX,GAAGC,CACL,IAA4B,CAC1B,GAAM,CAAE,wBAAAC,EAAyB,OAAAC,CAAO,EAAIC,EAA+B,EAErE,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAkBZ,EAAA,SAAY,CAClC,IAAMa,EAAO,SAAS,eAAeL,CAAM,EAC3C,GAAIK,EAAM,CACR,IAAMC,EAAc,IAAI,MAAM,SAAU,CACtC,QAAS,GACT,WAAY,EACd,CAAC,EACAA,EAAyB,kBAAoB,GAC7CA,EAAyB,eAAiB,CAAE,UAAAb,EAAW,QAAAC,CAAQ,EAChEW,EAAK,cAAcC,CAAW,CAChC,CACF,EAXwB,mBAalBC,EAAeL,GAAY,OACjC,GAAI,CAACK,EACH,MAAM,IAAI,MAAM,4BAA4B,EAG9C,OACEjB,EAACiB,EAAA,CACE,GAAGT,EACJ,QAASM,EACT,SAAUP,GAAYE,EAAwB,aAC9C,UAAWJ,EAEV,SAAAC,EACH,CAEJ,EAxC+B","names":["jsx","SaveDraftButton","__name","onSuccess","onError","className","children","disabled","props","contractorOnboardingBag","formId","useContractorOnboardingContext","components","useFormFields","handleSaveDraft","form","submitEvent","CustomButton"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a}from"./chunk-MVQOMW7S.js";import{a as m}from"./chunk-I5FVESDZ.js";import{a as p}from"./chunk-QPN6X6UA.js";import{a as e}from"./chunk-76ZDXC2T.js";import{a as r}from"./chunk-WKLTHGWU.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as y}from"react";import{jsx as d}from"react/jsx-runtime";var P=t(({render:n,countryCode:C,options:i,initialValues:s})=>{let o=r({options:i,countryCode:C,initialValues:s}),f=y();return d(e.Provider,{value:{createCompanyBag:o,formId:f},children:n({createCompanyBag:o,components:{CompanyBasicInformationStep:m,AddressDetailsStep:a,SubmitButton:p}})})},"CreateCompanyFlow");export{P as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DUEZWXBY.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as y,b as d,c as p,d as R}from"./chunk-AYC6DTFV.js";import{a as w}from"./chunk-TFSRZOMP.js";import{a as _,b as i}from"./chunk-VIGKOVHP.js";import{a as m}from"./chunk-P37U34EQ.js";import{ChevronDown as A,Globe as N}from"lucide-react";import{useState as h}from"react";import{Fragment as C,jsx as e,jsxs as l}from"react/jsx-runtime";var v=m(s=>{if(s.length<2)return{currency:null,costsPerCountry:[],employeesCost:null};let o=s[0]?.employer_currency_costs.currency,c=s.reduce((r,t)=>{let a=t.country.name;return r[a]={country:t.country,monthlyTotal:(r[a]?.monthlyTotal||0)+t.employer_currency_costs.monthly_total,annualTotal:(r[a]?.annualTotal||0)+t.employer_currency_costs.annual_total},r},{}),n=Object.values(c).map(({country:r,monthlyTotal:t,annualTotal:a})=>({country:r,monthlyCost:i(t,o.code),annualCost:i(a,o.code)})),u={monthlyTotal:i(s.reduce((r,t)=>r+t.employer_currency_costs.monthly_total,0),o.code),annualTotal:i(s.reduce((r,t)=>r+t.employer_currency_costs.annual_total,0),o.code)};return{currency:o,costsPerCountry:n,employeesCost:u}},"useSummaryResults"),f=m(({currency:s,title:o})=>e("div",{className:"RemoteFlows__SummaryResults__Header flex items-center justify-between w-full",children:l("div",{className:"RemoteFlows__SummaryHeader__Container flex flex-row items-center gap-6",children:[e("div",{className:"RemoteFlows__SummaryHeader__IconContainer flex h-12 w-12 items-center justify-center rounded-lg bg-[#F4F4F5]",children:e(N,{className:"RemoteFlows__SummaryHeader__Icon h-6 w-6 text-[#000000]"})}),l("div",{className:"RemoteFlows__SummaryHeader__Content space-y-1",children:[e("h2",{className:"RemoteFlows__SummaryHeader__Title text-lg font-medium leading-none text-[#181818]",children:o}),l("p",{className:"RemoteFlows__SummaryHeader__Currency text-xs text-[#71717A]",children:["Employer billing currency: ",s.code]})]})]})}),"SummaryHeader"),g=m(({label:s,columns:o,rows:c,defaultValue:n="accordion",className:u})=>{let r=o.length===1?"grid-cols-2":"grid-cols-3";return e(y,{collapsible:!0,defaultValue:n,className:_("RemoteFlows__SummaryResults__MultiColumnAccordion w-full",u),children:l(d,{value:n,className:"RemoteFlows__SummaryResults__AccordionItem border-none",children:[e(p,{className:"RemoteFlows__SummaryResults__AccordionTrigger hover:no-underline px-0 py-3 [&>svg]:hidden group",children:l("div",{className:_("RemoteFlows__SummaryResults__AccordionHeader grid items-center w-full",r),children:[l("div",{className:"RemoteFlows__SummaryResults__AccordionHeader__LabelContainer flex items-center gap-2",children:[s,e(A,{className:"RemoteFlows__SummaryResults__ChevronDown h-4 w-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180"})]}),o.length===1?e("span",{className:"RemoteFlows__SummaryResults__ColumnHeader text-xs text-[#27272A] text-right",children:o[0]}):o.map((t,a)=>e("span",{className:"RemoteFlows__SummaryResults__ColumnHeader text-xs text-[#27272A] text-right",children:t},a))]})}),e(R,{className:"RemoteFlows__SummaryResults__AccordionContent px-0 pb-4",children:e("div",{className:"RemoteFlows__SummaryResults__AccordionRows space-y-3",children:c.map((t,a)=>l("div",{className:_("RemoteFlows__SummaryResults__AccordionRow grid items-center",r),children:[e("div",{className:"flex items-center gap-2",children:t.label}),o.length===1?e("span",{className:"RemoteFlows__SummaryResults__RowValue text-sm text-[#09090B] text-right",children:t.values[0]}):t.values.map((F,x)=>e("span",{className:"RemoteFlows__SummaryResults__RowValue text-sm text-[#09090B] text-right",children:F},x))]},a))})})]})})},"MultiColumnAccordion"),S=m(({employeesCost:s})=>e(g,{label:e("span",{className:"RemoteFlows__CostForAllEmployees__Label text-sm font-medium text-[#0F172A]",children:"Cost for all employees"}),columns:["Total cost"],rows:[{label:l(C,{children:[e("span",{className:"RemoteFlows__CostForAllEmployees__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0"}),e("span",{className:"RemoteFlows__CostForAllEmployees__MonthlyLabel text-sm text-[#09090B]",children:"Monthly cost"})]}),values:[s.monthlyTotal]},{label:l(C,{children:[e("span",{className:"RemoteFlows__CostForAllEmployees__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0"}),e("span",{className:"RemoteFlows__CostForAllEmployees__AnnualLabel text-sm text-[#09090B]",children:"Annual cost"})]}),values:[s.annualTotal]}],defaultValue:"cost-breakdown"}),"CostForAllEmployees"),b=m(({costsPerCountry:s})=>e(g,{label:e("span",{className:"RemoteFlows__CostsPerCountry__Label text-sm font-medium text-[#0F172A]",children:"Cost per country"}),columns:["Monthly cost","Annual cost"],rows:s.map(o=>({label:l(C,{children:[e("span",{className:"RemoteFlows__CostsPerCountry__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0"}),e("span",{className:"RemoteFlows__CostsPerCountry__CountryName text-sm text-[#09090B]",children:o.country.name})]}),values:[o.monthlyCost,o.annualCost]})),defaultValue:"country-breakdown"}),"CostsPerCountry"),k=m(({estimations:s})=>{let{currency:o,costsPerCountry:c,employeesCost:n}=v(s),[u,r]=h("summary");return!o||c.length===0||Object.keys(n).length===0?null:e(w,{className:"RemoteFlows__SummaryResults__Card p-10",children:e(y,{collapsible:!0,defaultValue:u,onValueChange:t=>r(t),className:"RemoteFlows__SummaryResults__Accordion w-full",children:l(d,{value:"summary",className:"RemoteFlows__SummaryResults__AccordionItem border-border",children:[e("div",{className:_("RemoteFlows__SummaryResults__AccordionTriggerContainer",{RemoteFlows__Separator:!!u}),children:e(p,{iconClassName:"size-6",className:"RemoteFlows__SummaryResults__MainAccordionTrigger hover:no-underline px-0 py-4",children:e(f,{currency:o,title:"Summary Overview"})})}),l(R,{className:"RemoteFlows__SummaryResults__MainAccordionContent px-0 pb-4 mt-6",children:[e("div",{className:"RemoteFlows__Separator",children:e(S,{employeesCost:n})}),e("div",{className:"RemoteFlows__SummaryResults__CostsPerCountryContainer mt-6",children:e(b,{costsPerCountry:c})})]})]})})})},"SummaryResults");export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-EFRT6C7V.js.map
|