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,mBAAoB,YAAa,SAAU,cAAe,QAC7G,gBAAoBQ,EAAA,EAAsB,CAAEH,MAAOlC,aAA+C,EAASA,EAAWkC,QAA+M,QAApM5C,EAAgJ,QAA1ID,EAA2F,QAArFD,EAAKY,aAA+C,EAASA,EAAWiB,eAA4B,IAAP7B,OAAgB,EAASA,EAAGqD,aAA0B,IAAPpD,OAAgB,EAASA,EAAG8B,kBAA+B,IAAP7B,OAAgB,EAASA,EAAGoD,SAAW,gBAAoBC,EAAA,QAAoB,CAAEC,YAAa5C,aAA+C,EAASA,EAAWsB,GAAImB,MAAkJ,QAA1IjD,EAA2F,QAArFD,EAAKS,aAA+C,EAASA,EAAWiB,eAA4B,IAAP1B,OAAgB,EAASA,EAAGkD,aAA0B,IAAPjD,OAAgB,EAASA,EAAG2B,eAAkB,ECvDtsB,MAAM2B,GAAQ,E,SAAA,MAKd,MAJ8BhE,GAClB,gBAAoB,KAAU,CAAEgE,MAAOA,GAC3C,gBAAoB,EAAgBd,OAAOC,OAAO,CAAC,EAAGnD,I","sources":["webpack:///./assets/stone/src/components/clientService/ReturnFormPage.tsx","webpack:///./assets/stone/src/components/clientService/ReturnFormPageLoader.tsx"],"sourcesContent":["import ReturnsGuestForm from '@stone/components/clientService/ReturnsGuestForm';\nimport ReturnsOrdersListing from '@stone/components/clientService/ReturnsOrdersListing';\nimport { UserInfoActionTypes } from '@state/features/common.types';\nimport { isUserAuthenticated } from '@state/features/orders.selectors';\nimport React, { useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useDispatch, useSelector } from 'react-redux';\nimport ClientServiceSection from './ClientServiceSection';\nimport api from '@common/utils/api';\nimport ClientServiceSteps from './ClientServiceSteps';\nconst ReturnFormPage = (props) => {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n const { t } = useTranslation();\n const [step_1, setStep_1] = useState(null);\n const [step_2, setStep_2] = useState(null);\n const [activeStep, setActiveStep] = useState(null);\n const [index, setIndex] = useState(0);\n const { loading: waitingUserInfo, user: { isAuthenticated }, } = useSelector(isUserAuthenticated);\n const dispatch = useDispatch();\n useEffect(() => {\n if (props.printSteps && props.pageId) {\n api.getPageJson(props.pageId).then((res) => {\n var _a, _b, _c, _d, _e, _f, _g;\n const main_component = (_c = (_b = (_a = res === null || res === void 0 ? void 0 : res.page) === null || _a === void 0 ? void 0 : _a.regions) === null || _b === void 0 ? void 0 : _b.main) === null || _c === void 0 ? void 0 : _c.components.find((el) => el.ID == props.componentId);\n if (main_component) {\n const _step_1 = (_e = (_d = main_component.regions) === null || _d === void 0 ? void 0 : _d.steps_1) === null || _e === void 0 ? void 0 : _e.components[0];\n const _step_2 = (_g = (_f = main_component.regions) === null || _f === void 0 ? void 0 : _f.steps_2) === null || _g === void 0 ? void 0 : _g.components[0];\n setStep_1(_step_1);\n setStep_2(_step_2);\n }\n });\n }\n }, []);\n useEffect(() => {\n dispatch({\n type: UserInfoActionTypes.FETCH_USERINFO,\n });\n }, []);\n useEffect(() => {\n if (step_1 || step_2) {\n const selectedStep = index == 0 ? step_1 : index == 1 && step_2;\n setActiveStep(selectedStep);\n }\n }, [index, step_1, step_2]);\n if (waitingUserInfo) {\n return React.createElement(\"div\", { className: \"hiddenloading\" });\n }\n if (isAuthenticated || props.displayOrders) {\n return (React.createElement(\"div\", { className: \"client-service\" },\n React.createElement(ReturnsOrdersListing, Object.assign({}, props, { title: t('returns.eligibleitems'), description: t('exchanges.selectorder'), isReturn: true })),\n React.createElement(ClientServiceSection, { title: t('returns.makereturn') },\n React.createElement(ReturnsGuestForm, Object.assign({}, props, { loggedUser: true, onTabChange: setIndex }))),\n activeStep && (React.createElement(\"div\", { className: \"cs-steps_wrapper\", \"aria-live\": \"polite\", \"aria-atomic\": \"true\" },\n React.createElement(ClientServiceSection, { title: activeStep === null || activeStep === void 0 ? void 0 : activeStep.title }, ((_c = (_b = (_a = activeStep === null || activeStep === void 0 ? void 0 : activeStep.regions) === null || _a === void 0 ? void 0 : _a.steps) === null || _b === void 0 ? void 0 : _b.components) === null || _c === void 0 ? void 0 : _c.length) && React.createElement(ClientServiceSteps, { componentid: activeStep === null || activeStep === void 0 ? void 0 : activeStep.ID, steps: (_e = (_d = activeStep === null || activeStep === void 0 ? void 0 : activeStep.regions) === null || _d === void 0 ? void 0 : _d.steps) === null || _e === void 0 ? void 0 : _e.components }))))));\n }\n return (React.createElement(\"div\", { className: \"client-service\" },\n React.createElement(ClientServiceSection, { title: t('returns.makereturn'), introSection: true },\n React.createElement(ReturnsGuestForm, Object.assign({}, props, { onTabChange: setIndex }))),\n activeStep && (React.createElement(\"div\", { className: \"cs-steps_wrapper\", \"aria-live\": \"polite\", \"aria-atomic\": \"true\" },\n React.createElement(ClientServiceSection, { title: activeStep === null || activeStep === void 0 ? void 0 : activeStep.title }, ((_h = (_g = (_f = activeStep === null || activeStep === void 0 ? void 0 : activeStep.regions) === null || _f === void 0 ? void 0 : _f.steps) === null || _g === void 0 ? void 0 : _g.components) === null || _h === void 0 ? void 0 : _h.length) && React.createElement(ClientServiceSteps, { componentid: activeStep === null || activeStep === void 0 ? void 0 : activeStep.ID, steps: (_k = (_j = activeStep === null || activeStep === void 0 ? void 0 : activeStep.regions) === null || _j === void 0 ? void 0 : _j.steps) === null || _k === void 0 ? void 0 : _k.components }))))));\n};\nexport default ReturnFormPage;\n","import ReturnFormPage from '@stone/components/clientService/ReturnFormPage';\nimport { configureAccountStore } from '@state';\nimport React from 'react';\nimport { Provider } from 'react-redux';\nconst store = configureAccountStore();\nconst ReturnFormPageLoader = (props) => {\n return (React.createElement(Provider, { store: store },\n React.createElement(ReturnFormPage, Object.assign({}, props))));\n};\nexport default ReturnFormPageLoader;\n"],"names":["props","_a","_b","_c","_d","_e","_f","_g","_h","_j","_k","t","useTranslation","step_1","setStep_1","useState","step_2","setStep_2","activeStep","setActiveStep","index","setIndex","loading","waitingUserInfo","user","isAuthenticated","dispatch","useEffect","printSteps","pageId","api","then","res","main_component","page","regions","main","components","find","el","ID","componentId","_step_1","steps_1","_step_2","steps_2","type","className","displayOrders","ReturnsOrdersListing","Object","assign","title","description","isReturn","ClientServiceSection","ReturnsGuestForm","loggedUser","onTabChange","steps","length","ClientServiceSteps","componentid","introSection","store"],"sourceRoot":""}