{"version":3,"file":"index.58bcbf76.js","sources":["../../../../../../../node_modules/@babylon/ui-kit-searchers/esm/components/others/searcher/redirecting-modal/constants.mjs","../../../../../../../node_modules/@babylon/ui-kit-searchers/esm/components/others/searcher/redirecting-modal/styled.mjs","../../../../../../../node_modules/@babylon/ui-kit-searchers/esm/components/others/searcher/redirecting-modal/index.mjs"],"sourcesContent":["const LOADING = {\n LOADING_SRC: \"/contenidos/fotos/CIUDADES/\",\n LOADING_ALTERNATIVE: \"/comun/images/lineas/paquetes_800x600.jpg\"\n};\n\nexport { LOADING };\n","import Modal from '@babylon/ui-kit-structures/components/others/modal';\nimport { FontMixin } from '@babylon/ui-kit-styles/common/mixins/helpers.styled';\nimport styled, { keyframes } from 'styled-components';\n\nconst SearcherRedirectingModalWrapper = styled(Modal)`\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`;\nconst SearcherRedirectingModalLoader = styled.div`\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`;\nconst SearcherRedirectingModalContent = styled.div`\n\tpadding: 32px;\n\ttext-align: center;\n`;\nconst SearcherRedirectingModalTitle = styled.p`\n\tmargin-bottom: 12px;\n\tcolor: ${({ theme }) => theme.colors.grays.darker};\n\t${FontMixin({ size: \"largest\", height: \"larger\", weight: \"light\" })}\n`;\nconst SearcherRedirectingModalDescription = styled.div`\n\tmargin-bottom: 4px;\n\tcolor: ${({ theme }) => theme.colors.grays.darker};\n\t${FontMixin({ size: \"medium\", height: \"medium\", weight: \"light\" })}\n`;\nconst SearcherRedirectingModalMessage = styled.p`\n\tcolor: ${({ theme }) => theme.colors.grays.dark};\n\t${FontMixin({ size: \"medium\", height: \"medium\", weight: \"light\" })}\n`;\n\nexport { SearcherRedirectingModalContent, SearcherRedirectingModalDescription, SearcherRedirectingModalLoader, SearcherRedirectingModalMessage, SearcherRedirectingModalTitle, SearcherRedirectingModalWrapper };\n","import { jsx, jsxs, Fragment } from 'react/jsx-runtime';\nimport Image from '@babylon/ui-kit-base/components/multimedia/image';\nimport contextBabylon from '@babylon/ui-kit-context';\nimport { transformAccommodationValueToText } from '@babylon/ui-kit-forms/helpers/accommodation';\nimport { transformPassengersValueToText } from '@babylon/ui-kit-forms/helpers/passengers';\nimport { formatDate } from '@babylon/ui-kit-helpers/date';\nimport { useContext, useState, useEffect, useMemo } from 'react';\nimport { LOADING } from './constants.mjs';\nimport { SearcherRedirectingModalWrapper, SearcherRedirectingModalLoader, SearcherRedirectingModalContent, SearcherRedirectingModalTitle, SearcherRedirectingModalDescription, SearcherRedirectingModalMessage } from './styled.mjs';\n\nconst SearcherRedirectingModal = ({\n visible = false,\n literals,\n alternative,\n loadingImage,\n origin,\n destination,\n accommodation,\n passengers,\n dates = [],\n months,\n days\n}) => {\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 }, [Language, dates]);\n const displayedDate = useMemo(() => {\n if (displayedStartDate && displayedEndDate) {\n return /* @__PURE__ */ jsx(\"p\", { children: `${displayedStartDate} \\u2192 ${displayedEndDate},` });\n }\n if (displayedStartDate && !displayedEndDate) {\n return /* @__PURE__ */ jsx(\"p\", { children: displayedStartDate });\n }\n return null;\n }, [displayedEndDate, displayedStartDate]);\n return /* @__PURE__ */ jsx(\n SearcherRedirectingModalWrapper,\n {\n \"data-testid\": \"SearcherRedirectingModal\",\n visible,\n iconRight: \"\",\n content: /* @__PURE__ */ jsxs(\"div\", { children: [\n /* @__PURE__ */ jsx(\n Image,\n {\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, height: 220, resize: { width: 450, height: 220 } }\n }\n ),\n /* @__PURE__ */ jsx(SearcherRedirectingModalLoader, {}),\n /* @__PURE__ */ jsxs(SearcherRedirectingModalContent, { children: [\n /* @__PURE__ */ jsx(SearcherRedirectingModalTitle, { children: loadingTitle || titleLoaderLabel }),\n /* @__PURE__ */ jsxs(SearcherRedirectingModalDescription, { children: [\n (!!origin || !!destination) && /* @__PURE__ */ jsxs(\"span\", { children: [\n (origin && origin?.text) ?? origin?.label ?? origin?.name,\n origin && destination && \" \\u2192 \",\n destination?.text || (destination?.label ?? destination?.name)\n ] }),\n displayedDate,\n accommodation && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(\"span\", { children: transformAccommodationValueToText(\n accommodation,\n literals\n ) }) }),\n passengers && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(\"span\", { children: transformPassengersValueToText(\n passengers,\n literals\n ) }) }),\n months && /* @__PURE__ */ jsx(\"div\", { children: months.map((month) => month.label).join(\" - \") }),\n days && /* @__PURE__ */ jsx(\"div\", { children: days.map((day) => day.label).join(\", \") })\n ] }),\n /* @__PURE__ */ jsx(SearcherRedirectingModalMessage, { children: loadingMessage || messageLoaderLabel })\n ] })\n ] })\n }\n );\n};\n\nexport { SearcherRedirectingModal, SearcherRedirectingModal as default };\n"],"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","jsxs","Image","Fragment","transformAccommodationValueToText","transformPassengersValueToText","month","day"],"mappings":"mHAAA,MAAMA,EAAU,CACd,YAAa,8BACb,oBAAqB,2CACvB,ECCMC,EAAkCC,EAAOC,CAAK;AAAA;AAAA;AAAA;AAAA,EAK9CC,EAA0CC;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,EA0B1CC,EAAiCJ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAcxB,CAAC,CAAE,MAAAK,CAAO,IAAKA,EAAM,OAAO,OAAO,OAAO;AAAA,eACjDH,CAAuC;AAAA;AAAA,EAGhDI,EAAkCN,EAAO;AAAA;AAAA;AAAA,EAIzCO,EAAgCP,EAAO;AAAA;AA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