@remoteoss/remote-flows 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/{chunk-IKJFPDZL.js → chunk-2YGGLGBG.js} +2 -2
  2. package/dist/{chunk-RNR4JEHX.js → chunk-3AOOE4V2.js} +2 -2
  3. package/dist/{chunk-6ACGE24H.js → chunk-42M5XC23.js} +2 -2
  4. package/dist/{chunk-QJWVOD4K.js → chunk-4OWFS6J6.js} +2 -2
  5. package/dist/{chunk-BLVS2A23.js → chunk-B4UHZS6S.js} +2 -2
  6. package/dist/{chunk-L6CLZL2D.js → chunk-DIL47M74.js} +2 -2
  7. package/dist/{chunk-XIPPSRO6.js → chunk-F66G33YT.js} +2 -2
  8. package/dist/{chunk-XIPPSRO6.js.map → chunk-F66G33YT.js.map} +1 -1
  9. package/dist/{chunk-M6ZWJ7KV.js → chunk-GPPJCUV6.js} +2 -2
  10. package/dist/chunk-HUEFMP54.js +2 -0
  11. package/dist/{chunk-SG67NZYI.js.map → chunk-HUEFMP54.js.map} +1 -1
  12. package/dist/{chunk-KT6EAWZO.js → chunk-HVZOU73K.js} +2 -2
  13. package/dist/chunk-KDWPT7ZP.js +2 -0
  14. package/dist/chunk-KDWPT7ZP.js.map +1 -0
  15. package/dist/{chunk-CK2Y7YLV.js → chunk-LRCSXZ5Y.js} +2 -2
  16. package/dist/chunk-MPMOHDZP.js +2 -0
  17. package/dist/chunk-MPMOHDZP.js.map +1 -0
  18. package/dist/{chunk-PJ6EQF5M.js → chunk-RMFW7BZM.js} +2 -2
  19. package/dist/{chunk-BIXYNFMY.js → chunk-S2VTL2TR.js} +2 -2
  20. package/dist/{chunk-G7ELSCK7.js → chunk-S4WAMYEE.js} +2 -2
  21. package/dist/chunk-STEO7MS2.js +2 -0
  22. package/dist/chunk-STEO7MS2.js.map +1 -0
  23. package/dist/chunk-SYYKU72Z.js +2 -0
  24. package/dist/chunk-SYYKU72Z.js.map +1 -0
  25. package/dist/chunk-T33QM3L4.js +2 -0
  26. package/dist/{chunk-TQNMLD3A.js.map → chunk-T33QM3L4.js.map} +1 -1
  27. package/dist/{chunk-SX5W3CBP.js → chunk-T3HJ2JSB.js} +2 -2
  28. package/dist/chunk-TWLIQ3LY.js +2 -0
  29. package/dist/{chunk-CM7ZXKYC.js.map → chunk-TWLIQ3LY.js.map} +1 -1
  30. package/dist/{chunk-HHMKYM4S.js → chunk-VFR5R7GS.js} +2 -2
  31. package/dist/chunk-VQM22EFM.js +2 -0
  32. package/dist/{chunk-V4X62BBS.js.map → chunk-VQM22EFM.js.map} +1 -1
  33. package/dist/{chunk-ZHGFPGWR.js → chunk-WBL23WGD.js} +2 -2
  34. package/dist/{chunk-5KX664N7.js → chunk-Y3HI42AP.js} +2 -2
  35. package/dist/{chunk-2XVOKTPC.js → chunk-YMOTYFSL.js} +2 -2
  36. package/dist/chunk-YYFIIPLI.js +2 -0
  37. package/dist/{chunk-GATKVXGB.js.map → chunk-YYFIIPLI.js.map} +1 -1
  38. package/dist/chunk-Z7WBY27D.js +2 -0
  39. package/dist/chunk-Z7WBY27D.js.map +1 -0
  40. package/dist/chunk-ZKALTI3E.js +2 -0
  41. package/dist/{chunk-OZCFRM4R.js.map → chunk-ZKALTI3E.js.map} +1 -1
  42. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  43. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  44. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +1 -1
  45. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  46. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  47. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  48. package/dist/flows/ContractAmendment/context.d.ts +1 -1
  49. package/dist/flows/ContractAmendment/hooks.d.ts +1 -1
  50. package/dist/flows/ContractAmendment/hooks.js +1 -1
  51. package/dist/flows/ContractAmendment/index.d.ts +1 -1
  52. package/dist/flows/ContractAmendment/index.js +1 -1
  53. package/dist/flows/ContractAmendment/utils.d.ts +1 -1
  54. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +1 -1
  55. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  56. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +1 -1
  57. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  58. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
  59. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  60. package/dist/flows/CostCalculator/api.d.ts +1 -1
  61. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  62. package/dist/flows/CostCalculator/context.d.ts +1 -1
  63. package/dist/flows/CostCalculator/hooks.d.ts +1 -1
  64. package/dist/flows/CostCalculator/hooks.js +1 -1
  65. package/dist/flows/CostCalculator/index.d.ts +1 -1
  66. package/dist/flows/CostCalculator/index.js +1 -1
  67. package/dist/flows/CostCalculator/types.d.ts +1 -1
  68. package/dist/flows/CostCalculator/utils.d.ts +1 -1
  69. package/dist/flows/CostCalculator/utils.js +1 -1
  70. package/dist/flows/Onboarding/OnboardingFlow.d.ts +1 -1
  71. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  72. package/dist/flows/Onboarding/api.d.ts +1 -1
  73. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  74. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +1 -1
  75. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  76. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +1 -1
  77. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  78. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +1 -1
  79. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  80. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +1 -1
  81. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  82. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +1 -1
  83. package/dist/flows/Onboarding/components/ReviewStep.d.ts +2 -1
  84. package/dist/flows/Onboarding/components/ReviewStep.js +1 -1
  85. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +1 -1
  86. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  87. package/dist/flows/Onboarding/context.d.ts +2 -1
  88. package/dist/flows/Onboarding/hooks.d.ts +6 -1
  89. package/dist/flows/Onboarding/hooks.js +1 -1
  90. package/dist/flows/Onboarding/index.d.ts +1 -1
  91. package/dist/flows/Onboarding/index.js +1 -1
  92. package/dist/flows/Onboarding/types.d.ts +2 -2
  93. package/dist/flows/Onboarding/utils.d.ts +3 -2
  94. package/dist/flows/Onboarding/utils.js +1 -1
  95. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +1 -1
  96. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  97. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +1 -1
  98. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  99. package/dist/flows/Termination/PaidTimeOffForm.d.ts +1 -1
  100. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  101. package/dist/flows/Termination/TerminationDetailsForm.d.ts +1 -1
  102. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  103. package/dist/flows/Termination/TerminationFlow.d.ts +1 -1
  104. package/dist/flows/Termination/TerminationFlow.js +1 -1
  105. package/dist/flows/Termination/TerminationForm.d.ts +1 -1
  106. package/dist/flows/Termination/TerminationForm.js +1 -1
  107. package/dist/flows/Termination/TimeOff.d.ts +1 -1
  108. package/dist/flows/Termination/context.d.ts +1 -1
  109. package/dist/flows/Termination/hooks.d.ts +1 -1
  110. package/dist/flows/Termination/index.d.ts +1 -1
  111. package/dist/flows/Termination/index.js +1 -1
  112. package/dist/flows/Termination/types.d.ts +1 -1
  113. package/dist/index.d.ts +2 -2
  114. package/dist/index.js +1 -1
  115. package/dist/{types.gen-DSJsKiNm.d.ts → types.gen-uIYQx7Be.d.ts} +1 -1
  116. package/package.json +1 -1
  117. package/dist/chunk-52J6QK2N.js +0 -2
  118. package/dist/chunk-52J6QK2N.js.map +0 -1
  119. package/dist/chunk-CCJOYSVQ.js +0 -2
  120. package/dist/chunk-CCJOYSVQ.js.map +0 -1
  121. package/dist/chunk-CM7ZXKYC.js +0 -2
  122. package/dist/chunk-GATKVXGB.js +0 -2
  123. package/dist/chunk-GVDARE4K.js +0 -2
  124. package/dist/chunk-GVDARE4K.js.map +0 -1
  125. package/dist/chunk-KFVOK5X5.js +0 -2
  126. package/dist/chunk-KFVOK5X5.js.map +0 -1
  127. package/dist/chunk-OZCFRM4R.js +0 -2
  128. package/dist/chunk-SG67NZYI.js +0 -2
  129. package/dist/chunk-TQNMLD3A.js +0 -2
  130. package/dist/chunk-V4X62BBS.js +0 -2
  131. package/dist/chunk-Y6K2UK3D.js +0 -2
  132. package/dist/chunk-Y6K2UK3D.js.map +0 -1
  133. /package/dist/{chunk-IKJFPDZL.js.map → chunk-2YGGLGBG.js.map} +0 -0
  134. /package/dist/{chunk-RNR4JEHX.js.map → chunk-3AOOE4V2.js.map} +0 -0
  135. /package/dist/{chunk-6ACGE24H.js.map → chunk-42M5XC23.js.map} +0 -0
  136. /package/dist/{chunk-QJWVOD4K.js.map → chunk-4OWFS6J6.js.map} +0 -0
  137. /package/dist/{chunk-BLVS2A23.js.map → chunk-B4UHZS6S.js.map} +0 -0
  138. /package/dist/{chunk-L6CLZL2D.js.map → chunk-DIL47M74.js.map} +0 -0
  139. /package/dist/{chunk-M6ZWJ7KV.js.map → chunk-GPPJCUV6.js.map} +0 -0
  140. /package/dist/{chunk-KT6EAWZO.js.map → chunk-HVZOU73K.js.map} +0 -0
  141. /package/dist/{chunk-CK2Y7YLV.js.map → chunk-LRCSXZ5Y.js.map} +0 -0
  142. /package/dist/{chunk-PJ6EQF5M.js.map → chunk-RMFW7BZM.js.map} +0 -0
  143. /package/dist/{chunk-BIXYNFMY.js.map → chunk-S2VTL2TR.js.map} +0 -0
  144. /package/dist/{chunk-G7ELSCK7.js.map → chunk-S4WAMYEE.js.map} +0 -0
  145. /package/dist/{chunk-SX5W3CBP.js.map → chunk-T3HJ2JSB.js.map} +0 -0
  146. /package/dist/{chunk-HHMKYM4S.js.map → chunk-VFR5R7GS.js.map} +0 -0
  147. /package/dist/{chunk-ZHGFPGWR.js.map → chunk-WBL23WGD.js.map} +0 -0
  148. /package/dist/{chunk-5KX664N7.js.map → chunk-Y3HI42AP.js.map} +0 -0
  149. /package/dist/{chunk-2XVOKTPC.js.map → chunk-YMOTYFSL.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flows/Onboarding/components/OnboardingForm.tsx"],"sourcesContent":["import { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { Form } from '@/src/components/ui/form';\nimport { useEffect } from 'react';\nimport { useOnboardingContext } from '@/src/flows/Onboarding/context';\nimport { useForm } from 'react-hook-form';\nimport { useJsonSchemasValidationFormResolver } from '@/src/components/form/yupValidationResolver';\nimport { Fields } from '@remoteoss/json-schema-form';\nimport {\n BasicInformationFormPayload,\n BenefitsFormPayload,\n ContractDetailsFormPayload,\n} from '@/src/flows/Onboarding/types';\nimport { $TSFixMe, Components } from '@/src/types/remoteFlows';\nimport { normalizeFieldErrors } from '@/src/lib/mutations';\n\ntype OnboardingFormProps = {\n onSubmit: (\n payload:\n | BasicInformationFormPayload\n | BenefitsFormPayload\n | ContractDetailsFormPayload,\n ) => void;\n components?: Components;\n fields?: Fields;\n defaultValues: Record<string, unknown>;\n};\n\nexport function OnboardingForm({\n defaultValues,\n onSubmit,\n components,\n}: OnboardingFormProps) {\n const { formId, onboardingBag } = useOnboardingContext();\n\n const resolver = useJsonSchemasValidationFormResolver(\n // @ts-expect-error no matching type\n onboardingBag.handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues,\n shouldUnregister: false,\n mode: 'onBlur',\n });\n\n useEffect(() => {\n // When the employmentId is set,\n // we need to run the checkFieldUpdates to update fieldValues in useStepState\n if (onboardingBag.employmentId) {\n onboardingBag?.checkFieldUpdates(form.getValues());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const subscription = form?.watch((values) => {\n const isAnyFieldDirty = Object.keys(values).some(\n (key) =>\n values[key as keyof unknown] !== defaultValues[key as keyof unknown],\n );\n if (isAnyFieldDirty) {\n onboardingBag?.checkFieldUpdates(values);\n }\n });\n return () => subscription?.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleSubmit = async (\n values: Record<string, unknown>,\n event?: React.BaseSyntheticEvent,\n ) => {\n const nativeEvent = event?.nativeEvent as $TSFixMe;\n\n if (nativeEvent?.isDraftSubmission) {\n // Handle draft submission\n const { onSuccess, onError } = nativeEvent.draftCallbacks;\n\n try {\n // Trigger validation\n const isValid = await form.trigger();\n if (!isValid) {\n return; // Don't submit if validation fails\n }\n\n // Submit the form\n const response = await onboardingBag.onSubmit(values);\n\n if (response?.data) {\n onSuccess?.();\n } else if (response?.error) {\n const currentStepName = onboardingBag.stepState.currentStep.name;\n\n // Get the appropriate fields based on current step\n const currentStepFields =\n onboardingBag.meta?.fields?.[\n currentStepName as keyof typeof onboardingBag.meta.fields\n ];\n\n const normalizedFieldErrors = normalizeFieldErrors(\n response?.fieldErrors || [],\n currentStepFields,\n );\n onError?.({\n error: response.error,\n rawError: response.rawError,\n fieldErrors: normalizedFieldErrors,\n });\n }\n } catch (error) {\n onError?.({\n error: error as Error,\n rawError: error as Record<string, unknown>,\n fieldErrors: [],\n });\n }\n } else {\n // Handle normal form submission\n onSubmit(values);\n }\n };\n\n return (\n <Form {...form}>\n <form\n id={formId}\n onSubmit={form.handleSubmit(handleSubmit)}\n className=\"space-y-4 RemoteFlows__OnboardingForm\"\n >\n <JSONSchemaFormFields\n components={components}\n fields={onboardingBag.fields}\n fieldsets={onboard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,SAAUA,EAAS,SACnB,YAAaG,CACf,CAAC,CACH,CACF,OAASE,EAAO,CACdN,IAAU,CACR,MAAOM,EACP,SAAUA,EACV,YAAa,CAAC,CAChB,CAAC,CACH,CACF,MAEExB,EAASW,CAAM,CAEnB,EApDqB,gBAsDrB,OACEd,EAAC4B,EAAA,CAAM,GAAGlB,EACR,SAAAV,EAAC,QACC,GAAIK,EACJ,SAAUK,EAAK,aAAaM,CAAY,EACxC,UAAU,wCAEV,SAAAhB,EAAC6B,EAAA,CACC,WAAYzB,EACZ,OAAQE,EAAc,OACtB,UAAWA,EAAc,KAAK,UAC9B,YAAaA,EAAc,YAC7B,EACF,EACF,CAEJ,CAhHgBW,EAAAhB,EAAA","names":["useEffect","useForm","jsx","OnboardingForm","defaultValues","onSubmit","components","formId","onboardingBag","useOnboardingContext","resolver","useJsonSchemasValidationFormResolver","form","useForm","useEffect","subscription","values","key","handleSubmit","__name","event","nativeEvent","onSuccess","onError","response","currentStepName","currentStepFields","normalizedFieldErrors","normalizeFieldErrors","error","Form","JSONSchemaFormFields"]}
1
+ {"version":3,"sources":["../src/flows/Onboarding/components/OnboardingForm.tsx"],"sourcesContent":["import { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { Form } from '@/src/components/ui/form';\nimport { useEffect } from 'react';\nimport { useOnboardingContext } from '@/src/flows/Onboarding/context';\nimport { useForm } from 'react-hook-form';\nimport { useJsonSchemasValidationFormResolver } from '@/src/components/form/yupValidationResolver';\nimport { Fields } from '@remoteoss/json-schema-form';\nimport {\n BasicInformationFormPayload,\n BenefitsFormPayload,\n ContractDetailsFormPayload,\n} from '@/src/flows/Onboarding/types';\nimport { $TSFixMe, Components } from '@/src/types/remoteFlows';\nimport { normalizeFieldErrors } from '@/src/lib/mutations';\n\ntype OnboardingFormProps = {\n onSubmit: (\n payload:\n | BasicInformationFormPayload\n | BenefitsFormPayload\n | ContractDetailsFormPayload,\n ) => void;\n components?: Components;\n fields?: Fields;\n defaultValues: Record<string, unknown>;\n};\n\nexport function OnboardingForm({\n defaultValues,\n onSubmit,\n components,\n}: OnboardingFormProps) {\n const { formId, onboardingBag } = useOnboardingContext();\n\n const resolver = useJsonSchemasValidationFormResolver(\n // @ts-expect-error no matching type\n onboardingBag.handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues,\n shouldUnregister: false,\n mode: 'onBlur',\n });\n\n useEffect(() => {\n // When the employmentId is set,\n // we need to run the checkFieldUpdates to update fieldValues in useStepState\n if (onboardingBag.employmentId) {\n onboardingBag?.checkFieldUpdates(form.getValues());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n const subscription = form?.watch((values) => {\n const isAnyFieldDirty = Object.keys(values).some(\n (key) =>\n values[key as keyof unknown] !== defaultValues[key as keyof unknown],\n );\n if (isAnyFieldDirty) {\n onboardingBag?.checkFieldUpdates(values);\n }\n });\n return () => subscription?.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleSubmit = async (\n values: Record<string, unknown>,\n event?: React.BaseSyntheticEvent,\n ) => {\n const nativeEvent = event?.nativeEvent as $TSFixMe;\n\n if (nativeEvent?.isDraftSubmission) {\n // Handle draft submission\n const { onSuccess, onError } = nativeEvent.draftCallbacks;\n\n try {\n // Trigger validation\n const isValid = await form.trigger();\n if (!isValid) {\n return; // Don't submit if validation fails\n }\n\n // Submit the form\n const response = await onboardingBag.onSubmit(values);\n\n if (response?.data) {\n onSuccess?.();\n } else if (response?.error) {\n const currentStepName = onboardingBag.stepState.currentStep.name;\n\n // Get the appropriate fields based on current step\n const currentStepFields =\n onboardingBag.meta?.fields?.[\n currentStepName as keyof typeof onboardingBag.meta.fields\n ];\n\n const normalizedFieldErrors = normalizeFieldErrors(\n response?.fieldErrors || [],\n currentStepFields,\n );\n onError?.({\n error: response.error,\n rawError: response.rawError,\n fieldErrors: normalizedFieldErrors,\n });\n }\n } catch (error) {\n onError?.({\n error: error as Error,\n rawError: error as Record<string, unknown>,\n fieldErrors: [],\n });\n }\n } else {\n // Handle normal form submission\n onSubmit(values);\n }\n };\n\n return (\n <Form {...form}>\n <form\n id={formId}\n onSubmit={form.handleSubmit(handleSubmit)}\n className=\"space-y-4 RemoteFlows__OnboardingForm\"\n >\n <JSONSchemaFormFields\n components={components}\n fields={onboardingBag.fields}\n fieldsets={onboardingBag.meta.fieldsets}\n fieldValues={onboardingBag.fieldValues}\n />\n </form>\n </Form>\n );\n}\n"],"mappings":"kPAEA,OAAS,aAAAA,MAAiB,QAgIlB,cAAAC,MAAA,oBAvGD,SAASC,EAAe,CAC7B,cAAAC,EACA,SAAAC,EACA,WAAAC,CACF,EAAwB,CACtB,GAAM,CAAE,OAAAC,EAAQ,cAAAC,CAAc,EAAIC,EAAqB,EAEjDC,EAAWC,EAEfH,EAAc,gBAChB,EAEMI,EAAOC,EAAQ,CACnB,SAAAH,EACA,cAAAN,EACA,iBAAkB,GAClB,KAAM,QACR,CAAC,EAEDU,EAAU,IAAM,CAGVN,EAAc,cAChBA,GAAe,kBAAkBI,EAAK,UAAU,CAAC,CAGrD,EAAG,CAAC,CAAC,EAELE,EAAU,IAAM,CACd,IAAMC,EAAeH,GAAM,MAAOI,GAAW,CACnB,OAAO,KAAKA,CAAM,EAAE,KACzCC,GACCD,EAAOC,CAAoB,IAAMb,EAAca,CAAoB,CACvE,GAEET,GAAe,kBAAkBQ,CAAM,CAE3C,CAAC,EACD,MAAO,IAAMD,GAAc,YAAY,CAEzC,EAAG,CAAC,CAAC,EAEL,IAAMG,EAAeC,EAAA,MACnBH,EACAI,IACG,CACH,IAAMC,EAAcD,GAAO,YAE3B,GAAIC,GAAa,kBAAmB,CAElC,GAAM,CAAE,UAAAC,EAAW,QAAAC,CAAQ,EAAIF,EAAY,eAE3C,GAAI,CAGF,GAAI,CADY,MAAMT,EAAK,QAAQ,EAEjC,OAIF,IAAMY,EAAW,MAAMhB,EAAc,SAASQ,CAAM,EAEpD,GAAIQ,GAAU,KACZF,IAAY,UACHE,GAAU,MAAO,CAC1B,IAAMC,EAAkBjB,EAAc,UAAU,YAAY,KAGtDkB,EACJlB,EAAc,MAAM,SAClBiB,CACF,EAEIE,EAAwBC,EAC5BJ,GAAU,aAAe,CAAC,EAC1BE,CACF,EACAH,IAAU,CACR,MAAOC,EAAS,MAChB,SAAUA,EAAS,SACnB,YAAaG,CACf,CAAC,CACH,CACF,OAASE,EAAO,CACdN,IAAU,CACR,MAAOM,EACP,SAAUA,EACV,YAAa,CAAC,CAChB,CAAC,CACH,CACF,MAEExB,EAASW,CAAM,CAEnB,EApDqB,gBAsDrB,OACEd,EAAC4B,EAAA,CAAM,GAAGlB,EACR,SAAAV,EAAC,QACC,GAAIK,EACJ,SAAUK,EAAK,aAAaM,CAAY,EACxC,UAAU,wCAEV,SAAAhB,EAAC6B,EAAA,CACC,WAAYzB,EACZ,OAAQE,EAAc,OACtB,UAAWA,EAAc,KAAK,UAC9B,YAAaA,EAAc,YAC7B,EACF,EACF,CAEJ,CAhHgBW,EAAAhB,EAAA","names":["useEffect","jsx","OnboardingForm","defaultValues","onSubmit","components","formId","onboardingBag","useOnboardingContext","resolver","useJsonSchemasValidationFormResolver","form","useForm","useEffect","subscription","values","key","handleSubmit","__name","event","nativeEvent","onSuccess","onError","response","currentStepName","currentStepFields","normalizedFieldErrors","normalizeFieldErrors","error","Form","JSONSchemaFormFields"]}
@@ -1,2 +1,2 @@
1
- import{b as i}from"./chunk-KSHK3ZPX.js";import{a as e}from"./chunk-Y6K2UK3D.js";import{a as l}from"./chunk-GVDARE4K.js";import{a as r}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function b({onSubmit:u,onError:c,onSuccess:C,shouldResetForm:n}){let{form:a,formId:d,costCalculatorBag:o}=i(),f=r(async p=>{let m=o?.parseFormValues(p),t=await o?.onSubmit(m);await u?.(m),t?.error?c?.(t.error):t?.data&&(await C?.(t?.data),n&&(o?.resetForm(),a.reset()))},"handleSubmit");return s(l,{...a,children:s("form",{id:d,onSubmit:a.handleSubmit(f),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:s(e,{fields:o?.fields??[]})})})}r(b,"CostCalculatorForm");export{b as a};
2
- //# sourceMappingURL=chunk-HHMKYM4S.js.map
1
+ import{b as i}from"./chunk-KSHK3ZPX.js";import{a as e}from"./chunk-SYYKU72Z.js";import{g as l}from"./chunk-STEO7MS2.js";import{a as r}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function b({onSubmit:u,onError:c,onSuccess:C,shouldResetForm:n}){let{form:a,formId:d,costCalculatorBag:o}=i(),f=r(async p=>{let m=o?.parseFormValues(p),t=await o?.onSubmit(m);await u?.(m),t?.error?c?.(t.error):t?.data&&(await C?.(t?.data),n&&(o?.resetForm(),a.reset()))},"handleSubmit");return s(l,{...a,children:s("form",{id:d,onSubmit:a.handleSubmit(f),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:s(e,{fields:o?.fields??[]})})})}r(b,"CostCalculatorForm");export{b as a};
2
+ //# sourceMappingURL=chunk-VFR5R7GS.js.map
@@ -0,0 +1,2 @@
1
+ import{b as d}from"./chunk-MRYRNB7Y.js";import{b as s}from"./chunk-CFIJKJXD.js";import{a as f}from"./chunk-SYYKU72Z.js";import{f as a,g as l}from"./chunk-STEO7MS2.js";import{a as n}from"./chunk-P37U34EQ.js";import{useEffect as T}from"react";import{jsx as e}from"react/jsx-runtime";function A({fields:m,onSubmit:F}){let{formId:u,terminationBag:o}=d(),c=s(o.handleValidation),i=a({resolver:c,defaultValues:o?.initialValues,shouldUnregister:!1,mode:"onBlur"});T(()=>{let y=i?.watch(r=>{Object.keys(r).some(t=>r[t]!==o?.initialValues?.[t])&&o?.checkFieldUpdates(r)});return()=>y?.unsubscribe()},[]);let p=m||(o?.fields??[]);return e(l,{...i,children:e("form",{id:u,onSubmit:i.handleSubmit(F),className:"space-y-4 RemoteFlows__TerminationForm",children:e(f,{fields:p})})})}n(A,"TerminationForm");export{A as a};
2
+ //# sourceMappingURL=chunk-VQM22EFM.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flows/Termination/TerminationForm.tsx"],"sourcesContent":["import { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { Form } from '@/src/components/ui/form';\nimport { useEffect } from 'react';\nimport { useTerminationContext } from './context';\nimport { TerminationFormValues } from '@/src/flows/Termination/types';\nimport { useForm } from 'react-hook-form';\nimport { useJsonSchemasValidationFormResolver } from '@/src/components/form/yupValidationResolver';\nimport { Fields } from '@remoteoss/json-schema-form';\n\ntype TerminationFormProps = {\n onSubmit: (payload: TerminationFormValues) => void;\n fields?: Fields;\n};\n\nexport function TerminationForm({ fields, onSubmit }: TerminationFormProps) {\n const { formId, terminationBag } = useTerminationContext();\n\n const resolver = useJsonSchemasValidationFormResolver(\n // @ts-expect-error no matching type\n terminationBag.handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues: terminationBag?.initialValues,\n shouldUnregister: false,\n mode: 'onBlur',\n });\n\n useEffect(() => {\n const subscription = form?.watch((values) => {\n const isAnyFieldDirty = Object.keys(values).some(\n (key) =>\n values[key as keyof TerminationFormValues] !==\n terminationBag?.initialValues?.[key as keyof TerminationFormValues],\n );\n if (isAnyFieldDirty) {\n terminationBag?.checkFieldUpdates(values);\n }\n });\n return () => subscription?.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const jsonSchemaFields = fields ? fields : (terminationBag?.fields ?? []);\n\n return (\n <Form {...form}>\n <form\n id={formId}\n onSubmit={form.handleSubmit(onSubmit)}\n className=\"space-y-4 RemoteFlows__TerminationForm\"\n >\n <JSONSchemaFormFields fields={jsonSchemaFields} />\n </form>\n </Form>\n );\n}\n"],"mappings":"mMAEA,OAAS,aAAAA,MAAiB,QAG1B,OAAS,WAAAC,MAAe,kBAgDhB,cAAAC,MAAA,oBAvCD,SAASC,EAAgB,CAAE,OAAAC,EAAQ,SAAAC,CAAS,EAAyB,CAC1E,GAAM,CAAE,OAAAC,EAAQ,eAAAC,CAAe,EAAIC,EAAsB,EAEnDC,EAAWC,EAEfH,EAAe,gBACjB,EAEMI,EAAOC,EAAQ,CACnB,SAAAH,EACA,cAAeF,GAAgB,cAC/B,iBAAkB,GAClB,KAAM,QACR,CAAC,EAEDM,EAAU,IAAM,CACd,IAAMC,EAAeH,GAAM,MAAOI,GAAW,CACnB,OAAO,KAAKA,CAAM,EAAE,KACzCC,GACCD,EAAOC,CAAkC,IACzCT,GAAgB,gBAAgBS,CAAkC,CACtE,GAEET,GAAgB,kBAAkBQ,CAAM,CAE5C,CAAC,EACD,MAAO,IAAMD,GAAc,YAAY,CAEzC,EAAG,CAAC,CAAC,EAEL,IAAMG,EAAmBb,IAAmBG,GAAgB,QAAU,CAAC,GAEvE,OACEL,EAACgB,EAAA,CAAM,GAAGP,EACR,SAAAT,EAAC,QACC,GAAII,EACJ,SAAUK,EAAK,aAAaN,CAAQ,EACpC,UAAU,yCAEV,SAAAH,EAACiB,EAAA,CAAqB,OAAQF,EAAkB,EAClD,EACF,CAEJ,CA3CgBG,EAAAjB,EAAA","names":["useEffect","useForm","jsx","TerminationForm","fields","onSubmit","formId","terminationBag","useTerminationContext","resolver","useJsonSchemasValidationFormResolver","form","useForm","useEffect","subscription","values","key","jsonSchemaFields","Form","JSONSchemaFormFields","__name"]}
1
+ {"version":3,"sources":["../src/flows/Termination/TerminationForm.tsx"],"sourcesContent":["import { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { Form } from '@/src/components/ui/form';\nimport { useEffect } from 'react';\nimport { useTerminationContext } from './context';\nimport { TerminationFormValues } from '@/src/flows/Termination/types';\nimport { useForm } from 'react-hook-form';\nimport { useJsonSchemasValidationFormResolver } from '@/src/components/form/yupValidationResolver';\nimport { Fields } from '@remoteoss/json-schema-form';\n\ntype TerminationFormProps = {\n onSubmit: (payload: TerminationFormValues) => void;\n fields?: Fields;\n};\n\nexport function TerminationForm({ fields, onSubmit }: TerminationFormProps) {\n const { formId, terminationBag } = useTerminationContext();\n\n const resolver = useJsonSchemasValidationFormResolver(\n // @ts-expect-error no matching type\n terminationBag.handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues: terminationBag?.initialValues,\n shouldUnregister: false,\n mode: 'onBlur',\n });\n\n useEffect(() => {\n const subscription = form?.watch((values) => {\n const isAnyFieldDirty = Object.keys(values).some(\n (key) =>\n values[key as keyof TerminationFormValues] !==\n terminationBag?.initialValues?.[key as keyof TerminationFormValues],\n );\n if (isAnyFieldDirty) {\n terminationBag?.checkFieldUpdates(values);\n }\n });\n return () => subscription?.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const jsonSchemaFields = fields ? fields : (terminationBag?.fields ?? []);\n\n return (\n <Form {...form}>\n <form\n id={formId}\n onSubmit={form.handleSubmit(onSubmit)}\n className=\"space-y-4 RemoteFlows__TerminationForm\"\n >\n <JSONSchemaFormFields fields={jsonSchemaFields} />\n </form>\n </Form>\n );\n}\n"],"mappings":"+MAEA,OAAS,aAAAA,MAAiB,QAmDlB,cAAAC,MAAA,oBAvCD,SAASC,EAAgB,CAAE,OAAAC,EAAQ,SAAAC,CAAS,EAAyB,CAC1E,GAAM,CAAE,OAAAC,EAAQ,eAAAC,CAAe,EAAIC,EAAsB,EAEnDC,EAAWC,EAEfH,EAAe,gBACjB,EAEMI,EAAOC,EAAQ,CACnB,SAAAH,EACA,cAAeF,GAAgB,cAC/B,iBAAkB,GAClB,KAAM,QACR,CAAC,EAEDM,EAAU,IAAM,CACd,IAAMC,EAAeH,GAAM,MAAOI,GAAW,CACnB,OAAO,KAAKA,CAAM,EAAE,KACzCC,GACCD,EAAOC,CAAkC,IACzCT,GAAgB,gBAAgBS,CAAkC,CACtE,GAEET,GAAgB,kBAAkBQ,CAAM,CAE5C,CAAC,EACD,MAAO,IAAMD,GAAc,YAAY,CAEzC,EAAG,CAAC,CAAC,EAEL,IAAMG,EAAmBb,IAAmBG,GAAgB,QAAU,CAAC,GAEvE,OACEL,EAACgB,EAAA,CAAM,GAAGP,EACR,SAAAT,EAAC,QACC,GAAII,EACJ,SAAUK,EAAK,aAAaN,CAAQ,EACpC,UAAU,yCAEV,SAAAH,EAACiB,EAAA,CAAqB,OAAQF,EAAkB,EAClD,EACF,CAEJ,CA3CgBG,EAAAjB,EAAA","names":["useEffect","jsx","TerminationForm","fields","onSubmit","formId","terminationBag","useTerminationContext","resolver","useJsonSchemasValidationFormResolver","form","useForm","useEffect","subscription","values","key","jsonSchemaFields","Form","JSONSchemaFormFields","__name"]}
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-V4X62BBS.js";import{b as m}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as e}from"react/jsx-runtime";function f({onSubmit:n}){let{terminationBag:i}=m();return e(r,{onSubmit:o(async a=>{await n?.(i?.parseFormValues(a)),i?.next()},"handleSubmit")})}o(f,"PaidTimeOffForm");export{f as a};
2
- //# sourceMappingURL=chunk-ZHGFPGWR.js.map
1
+ import{a as r}from"./chunk-VQM22EFM.js";import{b as m}from"./chunk-MRYRNB7Y.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as e}from"react/jsx-runtime";function f({onSubmit:n}){let{terminationBag:i}=m();return e(r,{onSubmit:o(async a=>{await n?.(i?.parseFormValues(a)),i?.next()},"handleSubmit")})}o(f,"PaidTimeOffForm");export{f as a};
2
+ //# sourceMappingURL=chunk-WBL23WGD.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-CM7ZXKYC.js";import{b as t}from"./chunk-PGWKJ6FK.js";import{b as e}from"./chunk-QW4JPW6J.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function S({onSubmit:m,onSuccess:d,onError:a}){let{onboardingBag:o}=t(),l=i(async n=>{try{await m?.(o.parseFormValues(n));let r=await o.onSubmit(n);if(r?.data){await d?.(r?.data),o?.next();return}if(r?.error){let p=e(r?.fieldErrors||[],o.meta?.fields?.basic_information);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:p})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),f=o.stepState.values?.basic_information||o.initialValues.basic_information;return c(s,{defaultValues:f,onSubmit:l})}i(S,"BasicInformationStep");export{S as a};
2
- //# sourceMappingURL=chunk-5KX664N7.js.map
1
+ import{a as s}from"./chunk-TWLIQ3LY.js";import{b as t}from"./chunk-PGWKJ6FK.js";import{b as e}from"./chunk-QW4JPW6J.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as c}from"react/jsx-runtime";function S({onSubmit:m,onSuccess:d,onError:a}){let{onboardingBag:o}=t(),l=i(async n=>{try{await m?.(o.parseFormValues(n));let r=await o.onSubmit(n);if(r?.data){await d?.(r?.data),o?.next();return}if(r?.error){let p=e(r?.fieldErrors||[],o.meta?.fields?.basic_information);a?.({error:r?.error,rawError:r?.rawError,fieldErrors:p})}}catch(r){a?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),f=o.stepState.values?.basic_information||o.initialValues.basic_information;return c(s,{defaultValues:f,onSubmit:l})}i(S,"BasicInformationStep");export{S as a};
2
+ //# sourceMappingURL=chunk-Y3HI42AP.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-CM7ZXKYC.js";import{b as i}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function y({onSubmit:s,onSuccess:c,onError:t}){let{onboardingBag:o}=i(),u=e(async n=>{try{await s?.({countryCode:n.country});let r=await o.onSubmit(n);if(r?.data){await c?.(r?.data),o?.next();return}r?.error&&t?.({error:r.error,rawError:r.rawError,fieldErrors:[]})}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),l=o.stepState.values?.select_country||o.initialValues.select_country;return d(a,{defaultValues:l,onSubmit:u})}e(y,"SelectCountryStep");export{y as a};
2
- //# sourceMappingURL=chunk-2XVOKTPC.js.map
1
+ import{a}from"./chunk-TWLIQ3LY.js";import{b as i}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function y({onSubmit:s,onSuccess:c,onError:t}){let{onboardingBag:o}=i(),u=e(async n=>{try{await s?.({countryCode:n.country});let r=await o.onSubmit(n);if(r?.data){await c?.(r?.data),o?.next();return}r?.error&&t?.({error:r.error,rawError:r.rawError,fieldErrors:[]})}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),l=o.stepState.values?.select_country||o.initialValues.select_country;return d(a,{defaultValues:l,onSubmit:u})}e(y,"SelectCountryStep");export{y as a};
2
+ //# sourceMappingURL=chunk-YMOTYFSL.js.map
@@ -0,0 +1,2 @@
1
+ import{b as l}from"./chunk-CFIJKJXD.js";import{a as F}from"./chunk-SYYKU72Z.js";import{f,g as p}from"./chunk-STEO7MS2.js";import{c as u}from"./chunk-CNYSTJVL.js";import{b as _}from"./chunk-TVZAFTPT.js";import{a as r}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as a}from"react/jsx-runtime";var w=["effective_date","reason_for_change","reason_for_change_description","additional_comments","additional_comments_toggle"];function x({onSubmit:b,onError:m,onSuccess:A}){let{formId:C,contractAmendment:{checkFieldUpdates:h,fields:s,onSubmit:S,stepState:g,initialValues:i,handleValidation:y}}=_(),V=l(y),e=f({resolver:V,defaultValues:g.values?.form||i,shouldUnregister:!0,mode:"onBlur"});R(()=>{let t=e?.watch(o=>{(Object.keys(e.formState.dirtyFields).length>0||e.formState.isDirty)&&h(o)});return()=>t?.unsubscribe()},[]);let v=r(async t=>{let o=!1;for(let[c,P]of Object.entries(t))if(!w.includes(c)&&i[c]!==P){o=!0;break}if(!o)return m?.({message:"no_changes_detected_contract_details"});let d=u(t,s,{isPartialValidation:!1});await b?.(d);let n=await S(t);n.error?m?.(n.error):await A?.(n.data)},"handleSubmit");return a(p,{...e,children:a("form",{id:C,"data-testid":"contract-amendment-form",onSubmit:e.handleSubmit(v),className:"space-y-4 RemoteFlows__ContractAmendmentForm",children:a(F,{fields:s})})})}r(x,"ContractAmendmentForm");export{x as a};
2
+ //# sourceMappingURL=chunk-YYFIIPLI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flows/ContractAmendment/ContractAmendmentForm.tsx"],"sourcesContent":["import {\n ContractAmendmentAutomatableResponse,\n PostAutomatableContractAmendmentError,\n} from '@/src/client';\nimport { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport { useJsonSchemasValidationFormResolver } from '@/src/components/form/yupValidationResolver';\nimport { Form } from '@/src/components/ui/form';\nimport { useEffect } from 'react';\nimport { FieldValues, useForm } from 'react-hook-form';\nimport { useContractAmendmentContext } from './context';\n\ntype ContractAmendmentFormProps = {\n /**\n * Callback function to be called when the contract amendment form is submitted.\n * This function is called before the contract amendment is submitted.\n * It can be used to perform any additional validation or processing before\n * the contract amendment is submitted.\n * @param values\n * @returns\n */\n onSubmit?: (values: FieldValues) => void | Promise<void>;\n /**\n * Callback function to be called when the contract amendment fails.\n * @param error\n * @returns\n */\n onError?: (\n error:\n | PostAutomatableContractAmendmentError\n | { message: 'no_changes_detected_contract_details' },\n ) => void;\n /**\n * Callback function to be called when the contract amendment is successfully submitted.\n * This function is called after the contract amendment is submitted.\n * @param data\n * @returns\n */\n onSuccess?: (\n data: ContractAmendmentAutomatableResponse,\n ) => void | Promise<void>;\n};\n\nconst commonFields = [\n 'effective_date',\n 'reason_for_change',\n 'reason_for_change_description',\n 'additional_comments',\n 'additional_comments_toggle',\n] as const;\n\ntype CommonFields = (typeof commonFields)[number];\n\nexport function ContractAmendmentForm({\n onSubmit,\n onError,\n onSuccess,\n}: ContractAmendmentFormProps) {\n const {\n formId,\n contractAmendment: {\n checkFieldUpdates,\n fields,\n onSubmit: submitContractAmendment,\n stepState,\n initialValues,\n handleValidation,\n },\n } = useContractAmendmentContext();\n\n const resolver = useJsonSchemasValidationFormResolver(\n // @ts-expect-error no matching type\n handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues:\n // stepState.values is used as defaultValues for the form when the form is\n // rendered when clicking on the back button after the user has submitted the form\n // and the confirmation form is displayed.\n // This is because the form is unmounted when the user submits the form.\n stepState.values?.form || initialValues,\n shouldUnregister: true,\n mode: 'onBlur',\n });\n\n useEffect(() => {\n const subscription = form?.watch((values) => {\n const isFormDirty =\n Object.keys(form.formState.dirtyFields).length > 0 ||\n form.formState.isDirty;\n if (isFormDirty) {\n checkFieldUpdates(values);\n }\n });\n return () => subscription?.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleSubmit = async (values: FieldValues) => {\n let hasContractDetailsChanges = false;\n for (const [key, value] of Object.entries(values)) {\n if (\n !commonFields.includes(key as CommonFields) &&\n // @ts-expect-error error\n initialValues[key] !== value\n ) {\n hasContractDetailsChanges = true;\n break;\n }\n }\n\n if (!hasContractDetailsChanges) {\n return onError?.({\n message: 'no_changes_detected_contract_details',\n });\n }\n\n const parsedValues = parseJSFToValidate(values, fields, {\n isPartialValidation: false,\n });\n\n await onSubmit?.(parsedValues);\n\n const contractAmendmentResult = await submitContractAmendment(values);\n\n if (contractAmendmentResult.error) {\n onError?.(contractAmendmentResult.error);\n } else {\n await onSuccess?.(\n contractAmendmentResult.data as ContractAmendmentAutomatableResponse,\n );\n }\n };\n\n return (\n <Form {...form}>\n <form\n id={formId}\n data-testid=\"contract-amendment-form\"\n onSubmit={form.handleSubmit(handleSubmit)}\n className=\"space-y-4 RemoteFlows__ContractAmendmentForm\"\n >\n <JSONSchemaFormFields fields={fields} />\n </form>\n </Form>\n );\n}\n"],"mappings":"gPAQA,OAAS,aAAAA,MAAiB,QAC1B,OAAsB,WAAAC,MAAe,kBAuI7B,cAAAC,MAAA,oBArGR,IAAMC,EAAe,CACnB,iBACA,oBACA,gCACA,sBACA,4BACF,EAIO,SAASC,EAAsB,CACpC,SAAAC,EACA,QAAA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F,CAEJ,CA/FgBc,EAAApB,EAAA","names":["useEffect","useForm","jsx","commonFields","ContractAmendmentForm","onSubmit","onError","onSuccess","formId","checkFieldUpdates","fields","submitContractAmendment","stepState","initialValues","handleValidation","useContractAmendmentContext","resolver","useJsonSchemasValidationFormResolver","form","useForm","useEffect","subscription","values","handleSubmit","__name","hasContractDetailsChanges","key","value","parsedValues","parseJSFToValidate","contractAmendmentResult","Form","JSONSchemaFormFields"]}
1
+ {"version":3,"sources":["../src/flows/ContractAmendment/ContractAmendmentForm.tsx"],"sourcesContent":["import {\n ContractAmendmentAutomatableResponse,\n PostAutomatableContractAmendmentError,\n} from '@/src/client';\nimport { JSONSchemaFormFields } from '@/src/components/form/JSONSchemaForm';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport { useJsonSchemasValidationFormResolver } from '@/src/components/form/yupValidationResolver';\nimport { Form } from '@/src/components/ui/form';\nimport { useEffect } from 'react';\nimport { FieldValues, useForm } from 'react-hook-form';\nimport { useContractAmendmentContext } from './context';\n\ntype ContractAmendmentFormProps = {\n /**\n * Callback function to be called when the contract amendment form is submitted.\n * This function is called before the contract amendment is submitted.\n * It can be used to perform any additional validation or processing before\n * the contract amendment is submitted.\n * @param values\n * @returns\n */\n onSubmit?: (values: FieldValues) => void | Promise<void>;\n /**\n * Callback function to be called when the contract amendment fails.\n * @param error\n * @returns\n */\n onError?: (\n error:\n | PostAutomatableContractAmendmentError\n | { message: 'no_changes_detected_contract_details' },\n ) => void;\n /**\n * Callback function to be called when the contract amendment is successfully submitted.\n * This function is called after the contract amendment is submitted.\n * @param data\n * @returns\n */\n onSuccess?: (\n data: ContractAmendmentAutomatableResponse,\n ) => void | Promise<void>;\n};\n\nconst commonFields = [\n 'effective_date',\n 'reason_for_change',\n 'reason_for_change_description',\n 'additional_comments',\n 'additional_comments_toggle',\n] as const;\n\ntype CommonFields = (typeof commonFields)[number];\n\nexport function ContractAmendmentForm({\n onSubmit,\n onError,\n onSuccess,\n}: ContractAmendmentFormProps) {\n const {\n formId,\n contractAmendment: {\n checkFieldUpdates,\n fields,\n onSubmit: submitContractAmendment,\n stepState,\n initialValues,\n handleValidation,\n },\n } = useContractAmendmentContext();\n\n const resolver = useJsonSchemasValidationFormResolver(\n // @ts-expect-error no matching type\n handleValidation,\n );\n\n const form = useForm({\n resolver,\n defaultValues:\n // stepState.values is used as defaultValues for the form when the form is\n // rendered when clicking on the back button after the user has submitted the form\n // and the confirmation form is displayed.\n // This is because the form is unmounted when the user submits the form.\n stepState.values?.form || initialValues,\n shouldUnregister: true,\n mode: 'onBlur',\n });\n\n useEffect(() => {\n const subscription = form?.watch((values) => {\n const isFormDirty =\n Object.keys(form.formState.dirtyFields).length > 0 ||\n form.formState.isDirty;\n if (isFormDirty) {\n checkFieldUpdates(values);\n }\n });\n return () => subscription?.unsubscribe();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const handleSubmit = async (values: FieldValues) => {\n let hasContractDetailsChanges = false;\n for (const [key, value] of Object.entries(values)) {\n if (\n !commonFields.includes(key as CommonFields) &&\n // @ts-expect-error error\n initialValues[key] !== value\n ) {\n hasContractDetailsChanges = true;\n break;\n }\n }\n\n if (!hasContractDetailsChanges) {\n return onError?.({\n message: 'no_changes_detected_contract_details',\n });\n }\n\n const parsedValues = parseJSFToValidate(values, fields, {\n isPartialValidation: false,\n });\n\n await onSubmit?.(parsedValues);\n\n const contractAmendmentResult = await submitContractAmendment(values);\n\n if (contractAmendmentResult.error) {\n onError?.(contractAmendmentResult.error);\n } else {\n await onSuccess?.(\n contractAmendmentResult.data as ContractAmendmentAutomatableResponse,\n );\n }\n };\n\n return (\n <Form {...form}>\n <form\n id={formId}\n data-testid=\"contract-amendment-form\"\n onSubmit={form.handleSubmit(handleSubmit)}\n className=\"space-y-4 RemoteFlows__ContractAmendmentForm\"\n >\n <JSONSchemaFormFields fields={fields} />\n </form>\n </Form>\n );\n}\n"],"mappings":"kPAQA,OAAS,aAAAA,MAAiB,QAwIlB,cAA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Y,0BACZ,SAAUU,EAAK,aAAaK,CAAY,EACxC,UAAU,+CAEV,SAAArB,EAAC8B,EAAA,CAAqB,OAAQtB,EAAQ,EACxC,EACF,CAEJ,CA/FgBc,EAAApB,EAAA","names":["useEffect","jsx","commonFields","ContractAmendmentForm","onSubmit","onError","onSuccess","formId","checkFieldUpdates","fields","submitContractAmendment","stepState","initialValues","handleValidation","useContractAmendmentContext","resolver","useJsonSchemasValidationFormResolver","form","useForm","useEffect","subscription","values","handleSubmit","__name","hasContractDetailsChanges","key","value","parsedValues","parseJSFToValidate","contractAmendmentResult","Form","JSONSchemaFormFields"]}
@@ -0,0 +1,2 @@
1
+ import{b as r}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-P37U34EQ.js";var R=["invited","created_reserve_paid"],p=["deposit_required","referred"];function m({render:o}){let{onboardingBag:t,creditScore:s}=r(),d=t.creditRiskStatus==="deposit_required",n=t.creditRiskStatus==="referred",i=t.employment?.status&&R.includes(t.employment.status),u=t.creditRiskStatus&&p.includes(t.creditRiskStatus),c=d&&t.employment?.status&&!i,a=t.creditRiskStatus&&!u||t.employment?.status&&i,S=e(()=>n?"referred":c?s.showReserveInvoice?"deposit_required_successful":"deposit_required":a?s.showInviteSuccessful?"invite_successful":"invite":null,"getCreditRiskState")();return o({creditRiskState:S,creditRiskStatus:t.creditRiskStatus})}e(m,"ReviewStep");export{m as a};
2
+ //# sourceMappingURL=chunk-Z7WBY27D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Onboarding/components/ReviewStep.tsx"],"sourcesContent":["import { useOnboardingContext } from '@/src/flows/Onboarding/context';\nimport {\n CreditRiskStatus,\n CreditRiskState,\n Employment,\n} from '@/src/flows/Onboarding/types';\n\ntype ReviewStepProps = {\n /**\n * Render prop function for customizing the review step credit risk flow UI\n *\n * @param props - Object containing credit risk information\n * @param props.creditRiskState - Current state of the credit risk flow\n * - 'referred': Company has been referred for manual review\n * - 'deposit_required': Deposit payment is required but not yet paid\n * - 'deposit_required_successful': Deposit payment has been successfully processed\n * - 'invite': Regular invite flow is available (no deposit required)\n * - 'invite_successful': Invitation has been successfully sent\n * - null: No specific credit risk state applies\n *\n * @param props.creditRiskStatus - Credit risk status from the backend\n * - 'not_started': Credit risk assessment has not been initiated\n * - 'ready': Ready for credit risk assessment\n * - 'in_progress': Credit risk assessment is in progress\n * - 'referred': Company has been referred for manual review\n * - 'fail': Credit risk assessment failed\n * - 'deposit_required': Company requires a deposit payment\n * - 'no_deposit_required': No deposit is required for this company\n * - undefined: Credit risk status not yet determined\n * @returns React.ReactNode to render for the review step\n */\n render: (props: {\n creditRiskState: CreditRiskState;\n creditRiskStatus: CreditRiskStatus | undefined;\n }) => React.ReactNode;\n};\n\nconst statusesToNotShowDeposit: Employment['status'][] = [\n 'invited',\n 'created_reserve_paid',\n];\n\nconst CREDIT_RISK_STATUSES: CreditRiskStatus[] = [\n 'deposit_required',\n 'referred',\n];\n\nexport function ReviewStep({ render }: ReviewStepProps) {\n const { onboardingBag, creditScore } = useOnboardingContext();\n\n // Helper variables to make logic more readable\n const isDepositRequiredCreditRisk =\n onboardingBag.creditRiskStatus === 'deposit_required';\n\n const isReferred = onboardingBag.creditRiskStatus === 'referred';\n\n const hasEmploymentStatusThatHidesDeposit =\n onboardingBag.employment?.status &&\n statusesToNotShowDeposit.includes(onboardingBag.employment.status);\n\n const isCreditRiskStatusInExclusionList =\n onboardingBag.creditRiskStatus &&\n CREDIT_RISK_STATUSES.includes(onboardingBag.creditRiskStatus);\n\n const shouldShowDepositFlow =\n isDepositRequiredCreditRisk &&\n onboardingBag.employment?.status &&\n !hasEmploymentStatusThatHidesDeposit;\n\n const shouldShowInviteFlow =\n (onboardingBag.creditRiskStatus && !isCreditRiskStatusInExclusionList) ||\n (onboardingBag.employment?.status && hasEmploymentStatusThatHidesDeposit);\n\n const getCreditRiskState = (): CreditRiskState => {\n // check if the company is referred\n if (isReferred) {\n return 'referred';\n }\n\n // Deposit required flow\n if (shouldShowDepositFlow) {\n return creditScore.showReserveInvoice\n ? 'deposit_required_successful'\n : 'deposit_required';\n }\n\n // Invite flow\n if (shouldShowInviteFlow) {\n return creditScore.showInviteSuccessful ? 'invite_successful' : 'invite';\n }\n\n // Default case\n return null;\n };\n\n const creditRiskState = getCreditRiskState();\n\n return render({\n creditRiskState,\n creditRiskStatus: onboardingBag.creditRiskStatus,\n });\n}\n"],"mappings":"gFAqCA,IAAMA,EAAmD,CACvD,UACA,sBACF,EAEMC,EAA2C,CAC/C,mBACA,UACF,EAEO,SAASC,EAAW,CAAE,OAAAC,CAAO,EAAoB,CACtD,GAAM,CAAE,cAAAC,EAAe,YAAAC,CAAY,EAAIC,EAAqB,EAGtDC,EACJH,EAAc,mBAAqB,mBAE/BI,EAAaJ,EAAc,mBAAqB,WAEhDK,EACJL,EAAc,YAAY,QAC1BJ,EAAyB,SAASI,EAAc,WAAW,MAAM,EAE7DM,EACJN,EAAc,kBACdH,EAAqB,SAASG,EAAc,gBAAgB,EAExDO,EACJJ,GACAH,EAAc,YAAY,QAC1B,CAACK,EAEGG,EACHR,EAAc,kBAAoB,CAACM,GACnCN,EAAc,YAAY,QAAUK,EAwBjCI,EAtBqBC,EAAA,IAErBN,EACK,WAILG,EACKN,EAAY,mBACf,8BACA,mBAIFO,EACKP,EAAY,qBAAuB,oBAAsB,SAI3D,KAnBkB,sBAsBgB,EAE3C,OAAOF,EAAO,CACZ,gBAAAU,EACA,iBAAkBT,EAAc,gBAClC,CAAC,CACH,CAtDgBU,EAAAZ,EAAA","names":["statusesToNotShowDeposit","CREDIT_RISK_STATUSES","ReviewStep","render","onboardingBag","creditScore","useOnboardingContext","isDepositRequiredCreditRisk","isReferred","hasEmploymentStatusThatHidesDeposit","isCreditRiskStatusInExclusionList","shouldShowDepositFlow","shouldShowInviteFlow","creditRiskState","__name"]}
@@ -0,0 +1,2 @@
1
+ import{m as _}from"./chunk-X36OBDKD.js";import{a as P}from"./chunk-MPMOHDZP.js";import{b as W}from"./chunk-3ZWDIEEM.js";import{c as D}from"./chunk-STEO7MS2.js";import{a as t,b as c,c as he}from"./chunk-P37U34EQ.js";var k=c((xt,B)=>{"use strict";function Se(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}t(Se,"isObject");B.exports=Se});var A=c((Tt,H)=>{"use strict";var je=typeof global=="object"&&global&&global.Object===Object&&global;H.exports=je});var M=c((ht,G)=>{"use strict";var Oe=A(),Ee=typeof self=="object"&&self&&self.Object===Object&&self,qe=Oe||Ee||Function("return this")();G.exports=qe});var U=c((St,J)=>{"use strict";var Fe=M(),Re=t(function(){return Fe.Date.now()},"now");J.exports=Re});var X=c((Ot,V)=>{"use strict";var Ie=/\s/;function Pe(e){for(var n=e.length;n--&&Ie.test(e.charAt(n)););return n}t(Pe,"trimmedEndIndex");V.exports=Pe});var K=c((qt,z)=>{"use strict";var ke=X(),Me=/^\s+/;function we(e){return e&&e.slice(0,ke(e)+1).replace(Me,"")}t(we,"baseTrim");z.exports=we});var w=c((Rt,Q)=>{"use strict";var Le=M(),Ne=Le.Symbol;Q.exports=Ne});var te=c((It,ee)=>{"use strict";var Y=w(),Z=Object.prototype,$e=Z.hasOwnProperty,We=Z.toString,T=Y?Y.toStringTag:void 0;function De(e){var n=$e.call(e,T),o=e[T];try{e[T]=void 0;var s=!0}catch{}var a=We.call(e);return s&&(n?e[T]=o:delete e[T]),a}t(De,"getRawTag");ee.exports=De});var re=c((kt,ne)=>{"use strict";var _e=Object.prototype,Be=_e.toString;function He(e){return Be.call(e)}t(He,"objectToString");ne.exports=He});var ae=c((wt,se)=>{"use strict";var oe=w(),Ae=te(),Ge=re(),Je="[object Null]",Ue="[object Undefined]",ie=oe?oe.toStringTag:void 0;function Ve(e){return e==null?e===void 0?Ue:Je:ie&&ie in Object(e)?Ae(e):Ge(e)}t(Ve,"baseGetTag");se.exports=Ve});var ue=c((Nt,ce)=>{"use strict";function Xe(e){return e!=null&&typeof e=="object"}t(Xe,"isObjectLike");ce.exports=Xe});var le=c((Wt,fe)=>{"use strict";var ze=ae(),Ke=ue(),Qe="[object Symbol]";function Ye(e){return typeof e=="symbol"||Ke(e)&&ze(e)==Qe}t(Ye,"isSymbol");fe.exports=Ye});var ge=c((_t,pe)=>{"use strict";var Ze=K(),de=k(),et=le(),me=NaN,tt=/^[-+]0x[0-9a-f]+$/i,nt=/^0b[01]+$/i,rt=/^0o[0-7]+$/i,ot=parseInt;function it(e){if(typeof e=="number")return e;if(et(e))return me;if(de(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=de(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Ze(e);var o=nt.test(e);return o||rt.test(e)?ot(e.slice(2),o?2:8):tt.test(e)?me:+e}t(it,"toNumber");pe.exports=it});var ye=c((Ht,ve)=>{"use strict";var st=k(),L=U(),be=ge(),at="Expected a function",ct=Math.max,ut=Math.min;function ft(e,n,o){var s,a,l,u,i,m,d=0,S=!1,p=!1,b=!0;if(typeof e!="function")throw new TypeError(at);n=be(n)||0,st(o)&&(S=!!o.leading,p="maxWait"in o,l=p?ct(be(o.maxWait)||0,n):l,b="trailing"in o?!!o.trailing:b);function y(r){var f=s,g=a;return s=a=void 0,d=r,u=e.apply(g,f),u}t(y,"invokeFunc");function j(r){return d=r,i=setTimeout(v,n),S?y(r):u}t(j,"leadingEdge");function O(r){var f=r-m,g=r-d,q=n-f;return p?ut(q,l-g):q}t(O,"remainingWait");function x(r){var f=r-m,g=r-d;return m===void 0||f>=n||f<0||p&&g>=l}t(x,"shouldInvoke");function v(){var r=L();if(x(r))return E(r);i=setTimeout(v,O(r))}t(v,"timerExpired");function E(r){return i=void 0,b&&s?y(r):(s=a=void 0,u)}t(E,"trailingEdge");function R(){i!==void 0&&clearTimeout(i),d=0,s=m=a=i=void 0}t(R,"cancel");function I(){return i===void 0?u:E(L())}t(I,"flush");function C(){var r=L(),f=x(r);if(s=arguments,a=this,m=r,f){if(i===void 0)return j(m);if(p)return clearTimeout(i),i=setTimeout(v,n),y(m)}return i===void 0&&(i=setTimeout(v,n)),u}return t(C,"debounced"),C.cancel=R,C.flush=I,C}t(ft,"debounce");ve.exports=ft});import{useState as mt,useCallback as pt,useEffect as gt,useRef as bt}from"react";var Ce=he(ye(),1);import{useCallback as lt,useEffect as dt,useRef as xe}from"react";function N(e,n){let o=xe(e);dt(()=>{o.current=e},[e]);let s=xe((0,Ce.default)(a=>{o.current(a)},n)).current;return lt(a=>{s(a)},[s])}t(N,"useDebounce");import{Fragment as yt,jsx as h,jsxs as Te}from"react/jsx-runtime";var vt=t(({description:e,showConversion:n,targetCurrency:o,className:s,onClick:a})=>{let{components:l}=W(),u=n?`Hide ${o} conversion`:`Show ${o} conversion`,i=l?.button;return Te("span",{className:s,children:[e," ",i?h(i,{className:`${s.replace("-description","-button")}`,"data-type":"inline",onClick:a,children:u}):h("button",{className:`${s.replace("-description","-button")}`,onClick:a,children:u})]})},"DescriptionWithConversion"),en=t(({sourceCurrency:e,targetCurrency:n,conversionFieldName:o,conversionProperties:s,classNamePrefix:a,description:l,...u})=>{let[i,m]=mt(!1),{setValue:d,watch:S}=D(),p=S(u.name),b=bt(!0),y=e&&n&&e!==n,{mutateAsync:j}=_();gt(()=>{if(b.current){b.current=!1;return}d(o,"")},[e,o,d]);let O=pt(async(r,f,g,q)=>{if(r)try{let F=await j({source_currency:f,target_currency:g,amount:Number(r)});if(F.data?.data?.conversion_data?.target_amount){let $=F.data.data.conversion_data.target_amount;$&&d(q,$?.toString())}}catch(F){console.error("Error converting currency:",F)}},[j,d]),x=N(r=>O(r,e,n,o),500),v=N(r=>O(r,n,e,u.name),500),E=t(r=>{i&&x(r.target.value)},"handleMainFieldChange"),R=t(r=>{v(r.target.value)},"handleConversionFieldChange"),I=t(r=>{r.preventDefault(),m(f=>!f),!i&&p&&x(p)},"toggleConversion"),C=y?h(vt,{targetCurrency:n,description:l,showConversion:i,className:`${a}-description`,onClick:I}):l;return Te(yt,{children:[h(P,{...u,additionalProps:{currency:e},description:C,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:E}),i&&h(P,{additionalProps:{currency:n},name:o,label:s?.label||"Conversion",description:s?.description,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:R})]})},"CurrencyConversionField");export{en as a};
2
+ //# sourceMappingURL=chunk-ZKALTI3E.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../node_modules/lodash/isObject.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/now.js","../node_modules/lodash/_trimmedEndIndex.js","../node_modules/lodash/_baseTrim.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/toNumber.js","../node_modules/lodash/debounce.js","../src/components/form/fields/CurrencyConversionField.tsx","../src/common/hooks.ts"],"sourcesContent":["/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","import { ReactNode, useState, useCallback, useEffect, useRef } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { TextField } from '@/src/components/form/fields/TextField';\nimport { useConvertCurrency } from '@/src/flows/Onboarding/api';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { useFormFields } from '@/src/context';\nimport { useDebounce } from '@/src/common/hooks';\n\ntype DescriptionWithConversionProps = {\n description: ReactNode;\n showConversion: boolean;\n targetCurrency: string;\n className: string;\n onClick: (evt: React.MouseEvent<HTMLButtonElement>) => void;\n};\n\nconst DescriptionWithConversion = ({\n description,\n showConversion,\n targetCurrency,\n className,\n onClick,\n}: DescriptionWithConversionProps) => {\n const { components } = useFormFields();\n const label = showConversion\n ? `Hide ${targetCurrency} conversion`\n : `Show ${targetCurrency} conversion`;\n\n const CustomButton = components?.button;\n return (\n <span className={className}>\n {description}{' '}\n {CustomButton ? (\n <CustomButton\n className={`${className.replace('-description', '-button')}`}\n data-type=\"inline\"\n onClick={onClick}\n >\n {label}\n </CustomButton>\n ) : (\n <button\n className={`${className.replace('-description', '-button')}`}\n onClick={onClick}\n >\n {label}\n </button>\n )}\n </span>\n );\n};\n\nexport type CurrencyConversionFieldProps = JSFField & {\n sourceCurrency: string;\n targetCurrency: string;\n conversionFieldName: string;\n conversionProperties?: {\n label?: string;\n description?: string;\n };\n useProxy?: boolean;\n classNamePrefix: string;\n};\n\nexport const CurrencyConversionField = ({\n sourceCurrency,\n targetCurrency,\n conversionFieldName,\n conversionProperties,\n classNamePrefix,\n description,\n ...props\n}: CurrencyConversionFieldProps) => {\n const [showConversion, setShowConversion] = useState(false);\n const { setValue, watch } = useFormContext();\n const fieldValue = watch(props.name);\n const isFirstRender = useRef(true);\n\n const canShowConversion =\n sourceCurrency && targetCurrency && sourceCurrency !== targetCurrency;\n\n const { mutateAsync: convertCurrency } = useConvertCurrency();\n\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n return;\n }\n\n // when source currency changes, reset the conversion field\n setValue(conversionFieldName, '');\n }, [sourceCurrency, conversionFieldName, setValue]);\n\n const convertCurrencyCallback = useCallback(\n async (\n value: string,\n fromCurrency: string,\n toCurrency: string,\n targetField: string,\n ) => {\n if (!value) return;\n\n try {\n const response = await convertCurrency({\n source_currency: fromCurrency,\n target_currency: toCurrency,\n amount: Number(value),\n });\n if (response.data?.data?.conversion_data?.target_amount) {\n const amount = response.data.data.conversion_data.target_amount;\n if (amount) {\n setValue(targetField, amount?.toString());\n }\n }\n } catch (error) {\n console.error('Error converting currency:', error);\n }\n },\n [convertCurrency, setValue],\n );\n\n const debouncedConvertCurrency = useDebounce(\n (value: string) =>\n convertCurrencyCallback(\n value,\n sourceCurrency,\n targetCurrency,\n conversionFieldName,\n ),\n 500,\n );\n const debouncedConvertCurrencyReverse = useDebounce(\n (value: string) =>\n convertCurrencyCallback(\n value,\n targetCurrency,\n sourceCurrency,\n props.name,\n ),\n 500,\n );\n\n const handleMainFieldChange = (evt: React.ChangeEvent<HTMLInputElement>) => {\n if (showConversion) {\n debouncedConvertCurrency(evt.target.value);\n }\n };\n\n const handleConversionFieldChange = (\n evt: React.ChangeEvent<HTMLInputElement>,\n ) => {\n debouncedConvertCurrencyReverse(evt.target.value);\n };\n\n const toggleConversion = (evt: React.MouseEvent<HTMLButtonElement>) => {\n evt.preventDefault();\n setShowConversion((prev) => !prev);\n\n if (!showConversion && fieldValue) {\n debouncedConvertCurrency(fieldValue);\n }\n };\n\n const extraDescription = canShowConversion ? (\n <DescriptionWithConversion\n targetCurrency={targetCurrency}\n description={description}\n showConversion={showConversion}\n className={`${classNamePrefix}-description`}\n onClick={toggleConversion}\n />\n ) : (\n description\n );\n\n return (\n <>\n <TextField\n {...props}\n additionalProps={{ currency: sourceCurrency }}\n description={extraDescription}\n type=\"text\"\n inputMode=\"decimal\"\n pattern=\"^[0-9.]*$\"\n maxLength={15}\n onChange={handleMainFieldChange}\n />\n {showConversion && (\n <TextField\n additionalProps={{ currency: targetCurrency }}\n name={conversionFieldName}\n label={conversionProperties?.label || 'Conversion'}\n description={conversionProperties?.description}\n type=\"text\"\n inputMode=\"decimal\"\n pattern=\"^[0-9.]*$\"\n maxLength={15}\n onChange={handleConversionFieldChange}\n />\n )}\n </>\n );\n};\n","import { useCallback, useEffect, useRef } from 'react';\nimport debounce from 'lodash/debounce';\n\nexport function useDebounce(\n callback: (value: string) => Promise<void>,\n delay: number,\n) {\n const callbackRef = useRef(callback);\n\n useEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n\n const debouncedFn = useRef(\n debounce((value: string) => {\n callbackRef.current(value);\n }, delay),\n ).current;\n\n return useCallback(\n (value: string) => {\n debouncedFn(value);\n },\n [debouncedFn],\n );\n}\n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sB,OAAS,aACtC,YAAaA,GAAsB,YACnC,KAAK,OACL,UAAU,UACV,QAAQ,YACR,UAAW,GACX,SAAU6B,EACZ,GAEJ,CAEJ,EA1IuC","names":["require_isObject","__commonJSMin","exports","module","isObject","value","type","__name","require_freeGlobal","__commonJSMin","exports","module","freeGlobal","require_root","__commonJSMin","exports","module","freeGlobal","freeSelf","root","require_now","__commonJSMin","exports","module","root","now","__name","require_trimmedEndIndex","__commonJSMin","exports","module","reWhitespace","trimmedEndIndex","string","index","__name","require_baseTrim","__commonJSMin","exports","module","trimmedEndIndex","reTrimStart","baseTrim","string","__name","require_Symbol","__commonJSMin","exports","module","root","Symbol","require_getRawTag","__commonJSMin","exports","module","Symbol","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","value","isOwn","tag","unmasked","result","__name","require_objectToString","__commonJSMin","exports","module","objectProto","nativeObjectToString","objectToString","value","__name","require_baseGetTag","__commonJSMin","exports","module","Symbol","getRawTag","objectToString","nullTag","undefinedTag","symToStringTag","baseGetTag","value","__name","require_isObjectLike","__commonJSMin","exports","module","isObjectLike","value","__name","require_isSymbol","__commonJSMin","exports","module","baseGetTag","isObjectLike","symbolTag","isSymbol","value","__name","require_toNumber","__commonJSMin","exports","module","baseTrim","isObject","isSymbol","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","value","other","isBinary","__name","require_debounce","__commonJSMin","exports","module","isObject","now","toNumber","FUNC_ERROR_TEXT","nativeMax","nativeMin","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","args","thisArg","__name","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","useState","useCallback","useEffect","useRef","useFormContext","import_debounce","useCallback","useEffect","useRef","useDebounce","callback","delay","callbackRef","useRef","useEffect","debouncedFn","debounce","value","useCallback","__name","Fragment","jsx","jsxs","DescriptionWithConversion","__name","description","showConversion","targetCurrency","className","onClick","components","useFormFields","label","CustomButton","CurrencyConversionField","sourceCurrency","conversionFieldName","conversionProperties","classNamePrefix","props","setShowConversion","useState","setValue","watch","useFormContext","fieldValue","isFirstRender","useRef","canShowConversion","convertCurrency","useConvertCurrency","useEffect","convertCurrencyCallback","useCallback","value","fromCurrency","toCurrency","targetField","response","amount","error","debouncedConvertCurrency","useDebounce","debouncedConvertCurrencyReverse","handleMainFieldChange","evt","handleConversionFieldChange","toggleConversion","prev","extraDescription","TextField"]}
1
+ {"version":3,"sources":["../node_modules/lodash/isObject.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/now.js","../node_modules/lodash/_trimmedEndIndex.js","../node_modules/lodash/_baseTrim.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/toNumber.js","../node_modules/lodash/debounce.js","../src/components/form/fields/CurrencyConversionField.tsx","../src/common/hooks.ts"],"sourcesContent":["/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","import { ReactNode, useState, useCallback, useEffect, useRef } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport { TextField } from '@/src/components/form/fields/TextField';\nimport { useConvertCurrency } from '@/src/flows/Onboarding/api';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { useFormFields } from '@/src/context';\nimport { useDebounce } from '@/src/common/hooks';\n\ntype DescriptionWithConversionProps = {\n description: ReactNode;\n showConversion: boolean;\n targetCurrency: string;\n className: string;\n onClick: (evt: React.MouseEvent<HTMLButtonElement>) => void;\n};\n\nconst DescriptionWithConversion = ({\n description,\n showConversion,\n targetCurrency,\n className,\n onClick,\n}: DescriptionWithConversionProps) => {\n const { components } = useFormFields();\n const label = showConversion\n ? `Hide ${targetCurrency} conversion`\n : `Show ${targetCurrency} conversion`;\n\n const CustomButton = components?.button;\n return (\n <span className={className}>\n {description}{' '}\n {CustomButton ? (\n <CustomButton\n className={`${className.replace('-description', '-button')}`}\n data-type=\"inline\"\n onClick={onClick}\n >\n {label}\n </CustomButton>\n ) : (\n <button\n className={`${className.replace('-description', '-button')}`}\n onClick={onClick}\n >\n {label}\n </button>\n )}\n </span>\n );\n};\n\nexport type CurrencyConversionFieldProps = JSFField & {\n sourceCurrency: string;\n targetCurrency: string;\n conversionFieldName: string;\n conversionProperties?: {\n label?: string;\n description?: string;\n };\n useProxy?: boolean;\n classNamePrefix: string;\n};\n\nexport const CurrencyConversionField = ({\n sourceCurrency,\n targetCurrency,\n conversionFieldName,\n conversionProperties,\n classNamePrefix,\n description,\n ...props\n}: CurrencyConversionFieldProps) => {\n const [showConversion, setShowConversion] = useState(false);\n const { setValue, watch } = useFormContext();\n const fieldValue = watch(props.name);\n const isFirstRender = useRef(true);\n\n const canShowConversion =\n sourceCurrency && targetCurrency && sourceCurrency !== targetCurrency;\n\n const { mutateAsync: convertCurrency } = useConvertCurrency();\n\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n return;\n }\n\n // when source currency changes, reset the conversion field\n setValue(conversionFieldName, '');\n }, [sourceCurrency, conversionFieldName, setValue]);\n\n const convertCurrencyCallback = useCallback(\n async (\n value: string,\n fromCurrency: string,\n toCurrency: string,\n targetField: string,\n ) => {\n if (!value) return;\n\n try {\n const response = await convertCurrency({\n source_currency: fromCurrency,\n target_currency: toCurrency,\n amount: Number(value),\n });\n if (response.data?.data?.conversion_data?.target_amount) {\n const amount = response.data.data.conversion_data.target_amount;\n if (amount) {\n setValue(targetField, amount?.toString());\n }\n }\n } catch (error) {\n console.error('Error converting currency:', error);\n }\n },\n [convertCurrency, setValue],\n );\n\n const debouncedConvertCurrency = useDebounce(\n (value: string) =>\n convertCurrencyCallback(\n value,\n sourceCurrency,\n targetCurrency,\n conversionFieldName,\n ),\n 500,\n );\n const debouncedConvertCurrencyReverse = useDebounce(\n (value: string) =>\n convertCurrencyCallback(\n value,\n targetCurrency,\n sourceCurrency,\n props.name,\n ),\n 500,\n );\n\n const handleMainFieldChange = (evt: React.ChangeEvent<HTMLInputElement>) => {\n if (showConversion) {\n debouncedConvertCurrency(evt.target.value);\n }\n };\n\n const handleConversionFieldChange = (\n evt: React.ChangeEvent<HTMLInputElement>,\n ) => {\n debouncedConvertCurrencyReverse(evt.target.value);\n };\n\n const toggleConversion = (evt: React.MouseEvent<HTMLButtonElement>) => {\n evt.preventDefault();\n setShowConversion((prev) => !prev);\n\n if (!showConversion && fieldValue) {\n debouncedConvertCurrency(fieldValue);\n }\n };\n\n const extraDescription = canShowConversion ? (\n <DescriptionWithConversion\n targetCurrency={targetCurrency}\n description={description}\n showConversion={showConversion}\n className={`${classNamePrefix}-description`}\n onClick={toggleConversion}\n />\n ) : (\n description\n );\n\n return (\n <>\n <TextField\n {...props}\n additionalProps={{ currency: sourceCurrency }}\n description={extraDescription}\n type=\"text\"\n inputMode=\"decimal\"\n pattern=\"^[0-9.]*$\"\n maxLength={15}\n onChange={handleMainFieldChange}\n />\n {showConversion && (\n <TextField\n additionalProps={{ currency: targetCurrency }}\n name={conversionFieldName}\n label={conversionProperties?.label || 'Conversion'}\n description={conversionProperties?.description}\n type=\"text\"\n inputMode=\"decimal\"\n pattern=\"^[0-9.]*$\"\n maxLength={15}\n onChange={handleConversionFieldChange}\n />\n )}\n </>\n );\n};\n","import { useCallback, useEffect, useRef } from 'react';\nimport debounce from 'lodash/debounce';\n\nexport function useDebounce(\n callback: (value: string) => Promise<void>,\n delay: number,\n) {\n const callbackRef = useRef(callback);\n\n useEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n\n const debouncedFn = useRef(\n debounce((value: string) => {\n callbackRef.current(value);\n }, delay),\n ).current;\n\n return useCallback(\n (value: string) => {\n debouncedFn(value);\n },\n [debouncedFn],\n );\n}\n"],"mappings":"uNAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cAyBA,SAASC,GAASC,EAAO,CACvB,IAAIC,EAAO,OAAOD,EAClB,OAAOA,GAAS,OAASC,GAAQ,UAAYA,GAAQ,WACvD,CAHSC,EAAAH,GAAA,YAKTD,EAAO,QAAUC,KC9BjB,IAAAI,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cACA,IAAIC,GAAa,OAAO,QAAU,UAAY,QAAU,OAAO,SAAW,QAAU,OAEpFD,EAAO,QAAUC,KCHjB,IAAAC,EAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,GAAa,IAGbC,GAAW,OAAO,MAAQ,UAAY,MAAQ,KAAK,SAAW,QAAU,KAGxEC,GAAOF,IAAcC,IAAY,SAAS,aAAa,EAAE,EAE7DF,EAAO,QAAUG,KCRjB,IAAAC,EAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,GAAO,IAkBPC,GAAMC,EAAA,UAAW,CACnB,OAAOF,GAAK,KAAK,IAAI,CACvB,EAFU,OAIVD,EAAO,QAAUE,KCtBjB,IAAAE,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cACA,IAAIC,GAAe,KAUnB,SAASC,GAAgBC,EAAQ,CAG/B,QAFIC,EAAQD,EAAO,OAEZC,KAAWH,GAAa,KAAKE,EAAO,OAAOC,CAAK,CAAC,GAAG,CAC3D,OAAOA,CACT,CALSC,EAAAH,GAAA,mBAOTF,EAAO,QAAUE,KClBjB,IAAAI,EAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,GAAkB,IAGlBC,GAAc,OASlB,SAASC,GAASC,EAAQ,CACxB,OAAOA,GACHA,EAAO,MAAM,EAAGH,GAAgBG,CAAM,EAAI,CAAC,EAAE,QA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X,SAAUL,EACZ,EACCtC,GACCL,EAACiD,EAAA,CACC,gBAAiB,CAAE,SAAU3C,CAAe,EAC5C,KAAMS,EACN,MAAOC,GAAsB,OAAS,aACtC,YAAaA,GAAsB,YACnC,KAAK,OACL,UAAU,UACV,QAAQ,YACR,UAAW,GACX,SAAU6B,EACZ,GAEJ,CAEJ,EA1IuC","names":["require_isObject","__commonJSMin","exports","module","isObject","value","type","__name","require_freeGlobal","__commonJSMin","exports","module","freeGlobal","require_root","__commonJSMin","exports","module","freeGlobal","freeSelf","root","require_now","__commonJSMin","exports","module","root","now","__name","require_trimmedEndIndex","__commonJSMin","exports","module","reWhitespace","trimmedEndIndex","string","index","__name","require_baseTrim","__commonJSMin","exports","module","trimmedEndIndex","reTrimStart","baseTrim","string","__name","require_Symbol","__commonJSMin","exports","module","root","Symbol","require_getRawTag","__commonJSMin","exports","module","Symbol","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","value","isOwn","tag","unmasked","result","__name","require_objectToString","__commonJSMin","exports","module","objectProto","nativeObjectToString","objectToString","value","__name","require_baseGetTag","__commonJSMin","exports","module","Symbol","getRawTag","objectToString","nullTag","undefinedTag","symToStringTag","baseGetTag","value","__name","require_isObjectLike","__commonJSMin","exports","module","isObjectLike","value","__name","require_isSymbol","__commonJSMin","exports","module","baseGetTag","isObjectLike","symbolTag","isSymbol","value","__name","require_toNumber","__commonJSMin","exports","module","baseTrim","isObject","isSymbol","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","value","other","isBinary","__name","require_debounce","__commonJSMin","exports","module","isObject","now","toNumber","FUNC_ERROR_TEXT","nativeMax","nativeMin","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","args","thisArg","__name","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","useState","useCallback","useEffect","useRef","import_debounce","useCallback","useEffect","useRef","useDebounce","callback","delay","callbackRef","useRef","useEffect","debouncedFn","debounce","value","useCallback","__name","Fragment","jsx","jsxs","DescriptionWithConversion","__name","description","showConversion","targetCurrency","className","onClick","components","useFormFields","label","CustomButton","CurrencyConversionField","sourceCurrency","conversionFieldName","conversionProperties","classNamePrefix","props","setShowConversion","useState","setValue","watch","useFormContext","fieldValue","isFirstRender","useRef","canShowConversion","convertCurrency","useConvertCurrency","useEffect","convertCurrencyCallback","useCallback","value","fromCurrency","toCurrency","targetField","response","amount","error","debouncedConvertCurrency","useDebounce","debouncedConvertCurrencyReverse","handleMainFieldChange","evt","handleConversionFieldChange","toggleConversion","prev","extraDescription","TextField"]}
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { b as PostCreateContractAmendmentError, a as ContractAmendmentResponse } from '../../types.gen-DSJsKiNm.js';
2
+ import { b as PostCreateContractAmendmentError, a as ContractAmendmentResponse } from '../../types.gen-uIYQx7Be.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentConfirmationFormProps = {
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-SG67NZYI.js";import"../../chunk-GVDARE4K.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm};
1
+ import{a}from"../../chunk-HUEFMP54.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm};
2
2
  //# sourceMappingURL=ContractAmendmentConfirmationForm.js.map
@@ -5,7 +5,7 @@ import { ContractAmendmentForm } from './ContractAmendmentForm.js';
5
5
  import { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
6
6
  import { useContractAmendment } from './hooks.js';
7
7
  import { ContractAmendmentParams } from './types.js';
8
- import '../../types.gen-DSJsKiNm.js';
8
+ import '../../types.gen-uIYQx7Be.js';
9
9
  import 'react-hook-form';
10
10
  import 'react';
11
11
  import '../../mutations-B6HWH-rZ.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-KT6EAWZO.js";import"../../chunk-YECC5GAT.js";import"../../chunk-SX5W3CBP.js";import"../../chunk-VTNGEN34.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-Z4FTX74F.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-HS3TP43Z.js";import"../../chunk-SG67NZYI.js";import"../../chunk-GATKVXGB.js";import"../../chunk-Y6K2UK3D.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-52J6QK2N.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-GVDARE4K.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentFlow};
1
+ import{a}from"../../chunk-HVZOU73K.js";import"../../chunk-YECC5GAT.js";import"../../chunk-T3HJ2JSB.js";import"../../chunk-VTNGEN34.js";import"../../chunk-Z4FTX74F.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-HS3TP43Z.js";import"../../chunk-HUEFMP54.js";import"../../chunk-YYFIIPLI.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentFlow};
2
2
  //# sourceMappingURL=ContractAmendmentFlow.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { P as PostAutomatableContractAmendmentError, C as ContractAmendmentAutomatableResponse } from '../../types.gen-DSJsKiNm.js';
2
+ import { P as PostAutomatableContractAmendmentError, C as ContractAmendmentAutomatableResponse } from '../../types.gen-uIYQx7Be.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentFormProps = {
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-GATKVXGB.js";import"../../chunk-Y6K2UK3D.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-52J6QK2N.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-GVDARE4K.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
1
+ import{a}from"../../chunk-YYFIIPLI.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
2
2
  //# sourceMappingURL=ContractAmendmentForm.js.map
@@ -1,5 +1,5 @@
1
1
  import { S as SuccessResponse, E as ErrorResponse } from '../../mutations-B6HWH-rZ.js';
2
- import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-DSJsKiNm.js';
2
+ import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-uIYQx7Be.js';
3
3
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
4
4
  import * as react from 'react';
5
5
  import '../../remoteFlows-B-p1H61n.js';
@@ -1,5 +1,5 @@
1
1
  import { S as SuccessResponse, E as ErrorResponse } from '../../mutations-B6HWH-rZ.js';
2
- import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-DSJsKiNm.js';
2
+ import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-uIYQx7Be.js';
3
3
  import * as react from 'react';
4
4
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
5
5
  import { Step } from '../useStepState.js';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-SX5W3CBP.js";import"../../chunk-VTNGEN34.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-Z4FTX74F.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-P37U34EQ.js";export{a as useContractAmendment};
1
+ import{a}from"../../chunk-T3HJ2JSB.js";import"../../chunk-VTNGEN34.js";import"../../chunk-Z4FTX74F.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-P37U34EQ.js";export{a as useContractAmendment};
2
2
  //# sourceMappingURL=hooks.js.map
@@ -4,7 +4,7 @@ export { ContractAmendmentForm } from './ContractAmendmentForm.js';
4
4
  export { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
5
5
  export { useContractAmendment } from './hooks.js';
6
6
  import 'react/jsx-runtime';
7
- import '../../types.gen-DSJsKiNm.js';
7
+ import '../../types.gen-uIYQx7Be.js';
8
8
  import 'react-hook-form';
9
9
  import './ContractAmendmentBack.js';
10
10
  import 'react';
@@ -1,2 +1,2 @@
1
- import"../../chunk-A7ZJQCNU.js";import{a as e}from"../../chunk-KT6EAWZO.js";import{a as c}from"../../chunk-YECC5GAT.js";import{a as d}from"../../chunk-SX5W3CBP.js";import"../../chunk-VTNGEN34.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-Z4FTX74F.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-HS3TP43Z.js";import{a}from"../../chunk-SG67NZYI.js";import{a as b}from"../../chunk-GATKVXGB.js";import"../../chunk-Y6K2UK3D.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-52J6QK2N.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-GVDARE4K.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm,e as ContractAmendmentFlow,b as ContractAmendmentForm,c as ContractAmendmentSubmit,d as useContractAmendment};
1
+ import"../../chunk-A7ZJQCNU.js";import{a as e}from"../../chunk-HVZOU73K.js";import{a as c}from"../../chunk-YECC5GAT.js";import{a as d}from"../../chunk-T3HJ2JSB.js";import"../../chunk-VTNGEN34.js";import"../../chunk-Z4FTX74F.js";import"../../chunk-QW4JPW6J.js";import"../../chunk-276MJCIE.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-HS3TP43Z.js";import{a}from"../../chunk-HUEFMP54.js";import{a as b}from"../../chunk-YYFIIPLI.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm,e as ContractAmendmentFlow,b as ContractAmendmentForm,c as ContractAmendmentSubmit,d as useContractAmendment};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { E as EmploymentShowResponse } from '../../types.gen-DSJsKiNm.js';
1
+ import { E as EmploymentShowResponse } from '../../types.gen-uIYQx7Be.js';
2
2
  import { Fields } from '@remoteoss/json-schema-form';
3
3
  import { Step } from '../useStepState.js';
4
4
  import 'react';
@@ -4,7 +4,7 @@ import { CostCalculatorEstimationOptions } from './types.js';
4
4
  import { JSFModify } from '../types.js';
5
5
  import react__default from 'react';
6
6
  import 'yup';
7
- import '../../types.gen-DSJsKiNm.js';
7
+ import '../../types.gen-uIYQx7Be.js';
8
8
  import '@remoteoss/json-schema-form';
9
9
 
10
10
  type CostCalculatorFlowProps = {
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-TQNMLD3A.js";import"../../chunk-KSHK3ZPX.js";import"../../chunk-M6ZWJ7KV.js";import"../../chunk-G7ELSCK7.js";import"../../chunk-UPRUP24B.js";import"../../chunk-OZCFRM4R.js";import"../../chunk-X36OBDKD.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-MC6FNME3.js";import"../../chunk-PWUYHFON.js";import"../../chunk-276MJCIE.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-52J6QK2N.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-GVDARE4K.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as CostCalculatorFlow};
1
+ import{a}from"../../chunk-T33QM3L4.js";import"../../chunk-GPPJCUV6.js";import"../../chunk-S4WAMYEE.js";import"../../chunk-MC6FNME3.js";import"../../chunk-UPRUP24B.js";import"../../chunk-KSHK3ZPX.js";import"../../chunk-ZKALTI3E.js";import"../../chunk-X36OBDKD.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-PWUYHFON.js";import"../../chunk-276MJCIE.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as CostCalculatorFlow};
2
2
  //# sourceMappingURL=CostCalculatorFlow.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { c as CostCalculatorEstimateResponse } from '../../types.gen-DSJsKiNm.js';
2
+ import { u as CostCalculatorEstimateResponse } from '../../types.gen-uIYQx7Be.js';
3
3
  import { EstimationError } from './hooks.js';
4
4
  import { CostCalculatorEstimationSubmitValues } from './types.js';
5
5
  import 'yup';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-HHMKYM4S.js";import"../../chunk-KSHK3ZPX.js";import"../../chunk-Y6K2UK3D.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-52J6QK2N.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-GVDARE4K.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as CostCalculatorForm};
1
+ import{a}from"../../chunk-VFR5R7GS.js";import"../../chunk-KSHK3ZPX.js";import"../../chunk-SYYKU72Z.js";import"../../chunk-OYI5OCMY.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-WZSGDTVV.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as CostCalculatorForm};
2
2
  //# sourceMappingURL=CostCalculatorForm.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { c as CostCalculatorEstimateResponse } from '../../../types.gen-DSJsKiNm.js';
2
+ import { u as CostCalculatorEstimateResponse } from '../../../types.gen-uIYQx7Be.js';
3
3
 
4
4
  interface CostCalculatorResultProps {
5
5
  employmentData: CostCalculatorEstimateResponse['data'];
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-L6CLZL2D.js";import"../../../chunk-CVXZNBHC.js";import"../../../chunk-3TAUIOLW.js";import"../../../chunk-ZOTFG7GS.js";import"../../../chunk-MIALHORP.js";import"../../../chunk-NTJN7NCK.js";import"../../../chunk-2IOIRPXX.js";import"../../../chunk-BHXNRWYC.js";import"../../../chunk-OYI5OCMY.js";import"../../../chunk-WZSGDTVV.js";import"../../../chunk-TC3SWPEN.js";import"../../../chunk-P37U34EQ.js";export{a as CostCalculatorResults};
1
+ import{a}from"../../../chunk-DIL47M74.js";import"../../../chunk-2IOIRPXX.js";import"../../../chunk-BHXNRWYC.js";import"../../../chunk-CVXZNBHC.js";import"../../../chunk-3TAUIOLW.js";import"../../../chunk-ZOTFG7GS.js";import"../../../chunk-MIALHORP.js";import"../../../chunk-NTJN7NCK.js";import"../../../chunk-OYI5OCMY.js";import"../../../chunk-WZSGDTVV.js";import"../../../chunk-TC3SWPEN.js";import"../../../chunk-P37U34EQ.js";export{a as CostCalculatorResults};
2
2
  //# sourceMappingURL=CostCalculatorResults.js.map
@@ -1,6 +1,6 @@
1
1
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
- import { d as CostCalculatorEstimatePdfResponse, e as PostCreateEstimationPdfError, f as CostCalculatorEstimateParams, M as MinimalRegion, c as CostCalculatorEstimateResponse, g as PostCreateEstimationError } from '../../types.gen-DSJsKiNm.js';
3
+ import { v as CostCalculatorEstimatePdfResponse, w as PostCreateEstimationPdfError, x as CostCalculatorEstimateParams, y as MinimalRegion, u as CostCalculatorEstimateResponse, z as PostCreateEstimationError } from '../../types.gen-uIYQx7Be.js';
4
4
  import { CostCalculatorEstimationOptions } from './types.js';
5
5
  import { JSFModify } from '../types.js';
6
6
 
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-G7ELSCK7.js";import"../../../chunk-OZCFRM4R.js";import"../../../chunk-X36OBDKD.js";import"../../../chunk-WVJDCDGZ.js";import"../../../chunk-PWUYHFON.js";import"../../../chunk-276MJCIE.js";import"../../../chunk-52J6QK2N.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-GVDARE4K.js";import"../../../chunk-CNYSTJVL.js";import"../../../chunk-TC3SWPEN.js";import"../../../chunk-P37U34EQ.js";export{a as SalaryField};
1
+ import{a}from"../../../chunk-S4WAMYEE.js";import"../../../chunk-ZKALTI3E.js";import"../../../chunk-X36OBDKD.js";import"../../../chunk-WVJDCDGZ.js";import"../../../chunk-PWUYHFON.js";import"../../../chunk-276MJCIE.js";import"../../../chunk-MPMOHDZP.js";import"../../../chunk-3ZWDIEEM.js";import"../../../chunk-STEO7MS2.js";import"../../../chunk-CNYSTJVL.js";import"../../../chunk-TC3SWPEN.js";import"../../../chunk-P37U34EQ.js";export{a as SalaryField};
2
2
  //# sourceMappingURL=SalaryField.js.map
@@ -2,7 +2,7 @@ import { Result } from '../types.js';
2
2
  import { useCostCalculator, EstimationError } from './hooks.js';
3
3
  import { CostCalculatorEstimationFormValues, CostCalculatorEstimationSubmitValues } from './types.js';
4
4
  import * as react from 'react';
5
- import { c as CostCalculatorEstimateResponse } from '../../types.gen-DSJsKiNm.js';
5
+ import { u as CostCalculatorEstimateResponse } from '../../types.gen-uIYQx7Be.js';
6
6
  import { $ as $TSFixMe } from '../../remoteFlows-B-p1H61n.js';
7
7
  import * as yup from 'yup';
8
8
  import { UseFormReturn } from 'react-hook-form';
@@ -1,6 +1,6 @@
1
1
  import * as yup from 'yup';
2
2
  import { ValidationError } from 'yup';
3
- import { c as CostCalculatorEstimateResponse, g as PostCreateEstimationError } from '../../types.gen-DSJsKiNm.js';
3
+ import { u as CostCalculatorEstimateResponse, z as PostCreateEstimationError } from '../../types.gen-uIYQx7Be.js';
4
4
  import { CostCalculatorEstimationOptions, CostCalculatorEstimationFormValues, CostCalculatorEstimationSubmitValues } from './types.js';
5
5
  import { JSFModify, Result } from '../types.js';
6
6
  import '@remoteoss/json-schema-form';
@@ -1,2 +1,2 @@
1
- import{c as a,d as b}from"../../chunk-M6ZWJ7KV.js";import"../../chunk-G7ELSCK7.js";import"../../chunk-UPRUP24B.js";import"../../chunk-OZCFRM4R.js";import"../../chunk-X36OBDKD.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-MC6FNME3.js";import"../../chunk-PWUYHFON.js";import"../../chunk-276MJCIE.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-52J6QK2N.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-GVDARE4K.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as defaultEstimationOptions,b as useCostCalculator};
1
+ import{c as a,d as b}from"../../chunk-GPPJCUV6.js";import"../../chunk-S4WAMYEE.js";import"../../chunk-MC6FNME3.js";import"../../chunk-UPRUP24B.js";import"../../chunk-ZKALTI3E.js";import"../../chunk-X36OBDKD.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-PWUYHFON.js";import"../../chunk-276MJCIE.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-MPMOHDZP.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-STEO7MS2.js";import"../../chunk-CNYSTJVL.js";import"../../chunk-TC3SWPEN.js";import"../../chunk-P37U34EQ.js";export{a as defaultEstimationOptions,b as useCostCalculator};
2
2
  //# sourceMappingURL=hooks.js.map
@@ -10,7 +10,7 @@ export { CostCalculatorResults } from './Results/CostCalculatorResults.js';
10
10
  export { buildPayload as buildCostCalculatorEstimationPayload } from './utils.js';
11
11
  import 'react/jsx-runtime';
12
12
  import './types.js';
13
- import '../../types.gen-DSJsKiNm.js';
13
+ import '../../types.gen-uIYQx7Be.js';
14
14
  import '../types.js';
15
15
  import '@remoteoss/json-schema-form';
16
16
  import 'react';