{"version":3,"file":"index.718c66b5.js","sources":["../../../../../../../node_modules/@babylon/ui-kit/dist/components/common/searchers/searcher/redirecting-modal/constants.js","../../../../../../../node_modules/@babylon/ui-kit/dist/components/common/searchers/searcher/redirecting-modal/styled.js","../../../../../../../node_modules/@babylon/ui-kit/dist/components/common/searchers/searcher/redirecting-modal/index.js"],"sourcesContent":["export const LOADING = {\n LOADING_SRC: '/contenidos/fotos/CIUDADES/',\n LOADING_ALTERNATIVE: '/comun/images/lineas/paquetes_800x600.jpg'\n};\n\n//# sourceMappingURL=constants.js.map","import styled, { keyframes } from \"styled-components\";\nimport Modal from \"../../../../structures/others/modal/index.js\";\nimport { FontMixin } from \"../../../../../styles/common/mixins/helpers.styled.js\";\nexport const SearcherRedirectingModalWrapper = styled(Modal).withConfig({\n displayName: \"styled__SearcherRedirectingModalWrapper\",\n componentId: \"sc-d782a8cc-0\"\n})`\n\t& > div {\n\t\tmax-width: 450px;\n\t}\n`;\nconst SearcherRedirectingModalLoaderAnimation = keyframes`\n from {\n left: -200px;\n width: 30%;\n }\n\n 50% {\n width: 30%;\n }\n\n 70% {\n width: 70%;\n }\n\n 80% {\n left: 50%;\n }\n\n 95% {\n left: 120%;\n }\n\n to {\n left: 100%;\n }\n`;\nexport const SearcherRedirectingModalLoader = styled.div.withConfig({\n displayName: \"styled__SearcherRedirectingModalLoader\",\n componentId: \"sc-d782a8cc-1\"\n})`\n\tbackground-color: rgba(39, 174, 96, 0.2);\n\theight: 4px;\n\toverflow: hidden;\n\tposition: relative;\n\twidth: 100%;\n\n\t&::before {\n\t\tcontent: '';\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tleft: -200px;\n\t\twidth: 200px;\n\t\theight: 4px;\n\t\tbackground-color: ${({ theme })=>theme.colors.status.success};\n\t\tanimation: ${SearcherRedirectingModalLoaderAnimation} 2s linear infinite;\n\t}\n`;\nexport const SearcherRedirectingModalContent = styled.div.withConfig({\n displayName: \"styled__SearcherRedirectingModalContent\",\n componentId: \"sc-d782a8cc-2\"\n})`\n\tpadding: 32px;\n\ttext-align: center;\n`;\nexport const SearcherRedirectingModalTitle = styled.p.withConfig({\n displayName: \"styled__SearcherRedirectingModalTitle\",\n componentId: \"sc-d782a8cc-3\"\n})`\n\tmargin-bottom: 12px;\n\tcolor: ${({ theme })=>theme.colors.grays.darker};\n\t${FontMixin({\n size: 'largest',\n height: 'larger',\n weight: 'light'\n})}\n`;\nexport const SearcherRedirectingModalDescription = styled.div.withConfig({\n displayName: \"styled__SearcherRedirectingModalDescription\",\n componentId: \"sc-d782a8cc-4\"\n})`\n\tmargin-bottom: 4px;\n\tcolor: ${({ theme })=>theme.colors.grays.darker};\n\t${FontMixin({\n size: 'medium',\n height: 'medium',\n weight: 'light'\n})}\n`;\nexport const SearcherRedirectingModalMessage = styled.p.withConfig({\n displayName: \"styled__SearcherRedirectingModalMessage\",\n componentId: \"sc-d782a8cc-5\"\n})`\n\tcolor: ${({ theme })=>theme.colors.grays.dark};\n\t${FontMixin({\n size: 'medium',\n height: 'medium',\n weight: 'light'\n})}\n`;\n\n//# sourceMappingURL=styled.js.map","import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { useContext, useEffect, useMemo, useState } from \"react\";\nimport Image from \"../../../../base/multimedia/image/index.js\";\nimport contextBabylon from \"../../../../../context/index.js\";\nimport { formatDate } from \"../../../../../helpers/date.js\";\nimport { transformAccommodationValueToText } from \"../../../../../helpers/forms/accommodation.js\";\nimport { transformPassengersValueToText } from \"../../../../../helpers/forms/passengers.js\";\nimport { LOADING } from \"./constants.js\";\nimport * as S from \"./styled.js\";\nexport const SearcherRedirectingModal = ({ visible =false , literals , alternative , loadingImage , origin , destination , accommodation , passengers , dates =[] , months , days })=>{\n const { loadingTitle ='' , titleLoaderLabel ='' , loadingMessage ='' , messageLoaderLabel ='' } = literals ?? {};\n const { Language } = useContext(contextBabylon);\n const [displayedStartDate, setDisplayedStartDate] = useState('');\n const [displayedEndDate, setDisplayedEndDate] = useState('');\n useEffect(()=>{\n if (dates[0] && dates[1]) {\n formatDate(dates[0] || '', 'ccc, dd LLL', Language).then(setDisplayedStartDate).catch(console.error);\n formatDate(dates[1] || '', 'ccc, dd LLL', Language).then(setDisplayedEndDate).catch(console.error);\n } else if (dates[0] && !dates[1]) {\n formatDate(dates[0] || '', 'eeee, d MMMM uuuu', Language).then(setDisplayedStartDate).catch(console.error);\n setDisplayedEndDate('');\n }\n }, [\n Language,\n dates\n ]);\n const displayedDate = useMemo(()=>{\n if (displayedStartDate && displayedEndDate) {\n return /*#__PURE__*/ _jsx(\"p\", {\n children: `${displayedStartDate} → ${displayedEndDate},`\n });\n }\n if (displayedStartDate && !displayedEndDate) {\n return /*#__PURE__*/ _jsx(\"p\", {\n children: displayedStartDate\n });\n }\n return null;\n }, [\n displayedEndDate,\n displayedStartDate\n ]);\n return /*#__PURE__*/ _jsx(S.SearcherRedirectingModalWrapper, {\n \"data-testid\": \"SearcherRedirectingModal\",\n visible: visible,\n iconRight: \"\",\n content: /*#__PURE__*/ _jsxs(\"div\", {\n children: [\n /*#__PURE__*/ _jsx(Image, {\n src: loadingImage ?? `${LOADING.LOADING_SRC}${destination?.value ?? destination?.code}.jpg`,\n alternative: alternative ?? LOADING.LOADING_ALTERNATIVE,\n alt: loadingTitle || titleLoaderLabel,\n isLazy: false,\n width: 450,\n height: 220,\n resize: {\n width: 450,\n height: 220\n }\n }),\n /*#__PURE__*/ _jsx(S.SearcherRedirectingModalLoader, {}),\n /*#__PURE__*/ _jsxs(S.SearcherRedirectingModalContent, {\n children: [\n /*#__PURE__*/ _jsx(S.SearcherRedirectingModalTitle, {\n children: loadingTitle || titleLoaderLabel\n }),\n /*#__PURE__*/ _jsxs(S.SearcherRedirectingModalDescription, {\n children: [\n (!!origin || !!destination) && /*#__PURE__*/ _jsxs(\"span\", {\n children: [\n (origin && origin?.text) ?? origin?.label ?? origin?.name,\n origin && destination && ' → ',\n destination?.text || (destination?.label ?? destination?.name)\n ]\n }),\n displayedDate,\n accommodation && /*#__PURE__*/ _jsx(_Fragment, {\n children: /*#__PURE__*/ _jsx(\"span\", {\n children: transformAccommodationValueToText(accommodation, literals)\n })\n }),\n passengers && /*#__PURE__*/ _jsx(_Fragment, {\n children: /*#__PURE__*/ _jsx(\"span\", {\n children: transformPassengersValueToText(passengers, literals)\n })\n }),\n months && /*#__PURE__*/ _jsx(\"div\", {\n children: months.map((month)=>month.label).join(' - ')\n }),\n days && /*#__PURE__*/ _jsx(\"div\", {\n children: days.map((day)=>day.label).join(', ')\n })\n ]\n }),\n /*#__PURE__*/ _jsx(S.SearcherRedirectingModalMessage, {\n children: loadingMessage || messageLoaderLabel\n })\n ]\n })\n ]\n })\n });\n};\nexport default SearcherRedirectingModal;\n\n//# sourceMappingURL=index.js.map"],"names":["LOADING","SearcherRedirectingModalWrapper","styled","Modal","SearcherRedirectingModalLoaderAnimation","keyframes","SearcherRedirectingModalLoader","theme","SearcherRedirectingModalContent","SearcherRedirectingModalTitle","FontMixin","SearcherRedirectingModalDescription","SearcherRedirectingModalMessage","SearcherRedirectingModal","visible","literals","alternative","loadingImage","origin","destination","accommodation","passengers","dates","months","days","loadingTitle","titleLoaderLabel","loadingMessage","messageLoaderLabel","Language","useContext","contextBabylon","displayedStartDate","setDisplayedStartDate","useState","displayedEndDate","setDisplayedEndDate","useEffect","formatDate","displayedDate","useMemo","_jsx","S.SearcherRedirectingModalWrapper","_jsxs","Image","S.SearcherRedirectingModalLoader","S.SearcherRedirectingModalContent","S.SearcherRedirectingModalTitle","S.SearcherRedirectingModalDescription","_Fragment","transformAccommodationValueToText","transformPassengersValueToText","month","day","S.SearcherRedirectingModalMessage"],"mappings":"mHAAO,MAAMA,EAAU,CACnB,YAAa,8BACb,oBAAqB,2CACzB,ECAaC,EAAkCC,EAAOC,CAAK,EAAE,WAAW,CACpE,YAAa,0CACb,YAAa,eACjB,CAAC;AAAA;AAAA;AAAA;AAAA,EAKKC,EAA0CC;AAAAA;AAAAA;AAA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