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IAAKJ,EAAMhB,KACXF,UAAU,WACV,aAAW,UAIjBpB,EAAAA,cAAA,WACEA,EAAAA,cAAA,OAAKoB,UAAU,+BACXO,KAAKC,EAAE,gCAEX5B,EAAAA,cAAA,OAAKoB,UAAU,8BACXkB,EAAMhB,QAMdiB,EAASiB,SAAWxD,EAAAA,cAACwC,EAAoB,QAMjDxC,EAAAA,cAAA,OAAKoB,UAAU,+DACViB,GAAaE,EAASiB,SAAWxD,EAAAA,cAACwC,EAAoB,OAIjE,C","sources":["webpack:///./app/javascript/components/DetailedViewHeader/Contacts/SmallContactBlock.jsx","webpack:///./app/javascript/components/DetailedViewHeader/Contacts/index.jsx"],"sourcesContent":["import React, { useState } from 'react';\nimport CryptoJS from \"crypto-js\";\n\nimport { postLocationContactDetailsShown } from '../../../utils/api';\nimport { SvgIco } from '../../SharedComponents/Icons';\n\n\nconst SmallContactBlock = ({ addressLine1,\n contact,\n locationId,\n siteKey,\n streetName,\n }) => {\n\n const [isContactsShown, setIsContactsShown] = useState(false);\n const [contactEmail, setContactEmail] = useState(null);\n\n const address = streetName || addressLine1;\n\n\n const handleEmail = () => {\n const encodedEmail = CryptoJS.enc.Base64.parse(contact.tag);\n const key = CryptoJS.enc.Utf8.parse('75smg2w68qmy2ori75smg2w68qmy2ori');\n const iv = CryptoJS.enc.Utf8.parse('javatzwkbnkmih8t');\n const decryptEmail = CryptoJS.AES.decrypt({ ciphertext: encodedEmail }, key, { iv: iv, mode: CryptoJS.mode.CBC });\n const originalEmail = decryptEmail.toString(CryptoJS.enc.Utf8);\n\n return originalEmail;\n };\n\n const handleClick = () => {\n setIsContactsShown(true);\n setContactEmail(handleEmail());\n postLocationContactDetailsShown(locationId)\n .catch(error => console.log('Error: ', error));\n };\n\n\n return (\n
\n
\n \n { isContactsShown\n ? { contact.phone }\n : I18n.t('generic.show_phone_number')\n }\n
\n
\n \n { isContactsShown\n ? (siteKey === 'dk'\n ?\n \n { contactEmail }\n \n :\n \n { contactEmail }\n \n )\n : I18n.t('generic.show_email')\n }\n
\n
\n )\n};\n\n\nexport default SmallContactBlock;\n","import React, { Fragment, useContext } from 'react';\n\nimport partnerBadge from \"../../../src/images/premium-partner-badge.png\";\nimport PersonPlaceholder from \"../../../src/images/placeholder_person.png\";\nimport { postLocationProviderAdvertsShown } from \"../../../utils/api\";\nimport SmallContactBlock from \"./SmallContactBlock\";\nimport { Context } from \"../index\";\n\nimport './index.sass';\n\n\nconst Contacts = () => {\n\n const {\n location: { addressLine1 },\n locationClosed,\n locationContactDetails,\n locationId,\n partnerBadgeUrl,\n siteKey,\n streetName,\n } = useContext(Context);\n\n const { available, contact, owner, provider } = locationContactDetails;\n\n\n const ProviderBadgeSection = () => (\n
\n
\n \n
\n
\n
\n { I18n.t('partner_badge.title') }\n
\n
\n { I18n.t('partner_badge.name') }\n
\n \n { I18n.t('generic.read_more') }\n \n
\n
\n );\n\n\n return (\n \n\n { available && (\n
\n

{ I18n.t('generic.contact_details') }

\n\n
\n\n { !locationClosed &&\n
\n
\n \n
\n
\n
\n { I18n.t('generic.contact_person') }\n
\n
\n { contact.name }\n
\n \n
\n
\n }\n\n
\n { provider.logo &&\n
\n \n
\n }\n
\n
\n { provider.title }\n
\n\n
\n { provider.name }\n
\n\n { provider.info &&\n \n { I18n.t('generic.read_more') }\n \n }\n\n { !locationClosed &&\n \n }\n
\n
\n\n { owner && (owner.name || owner.logo) &&\n
\n { owner.logo &&\n
\n \n
\n }\n
\n
\n { I18n.t('locations.owner_box.heading') }\n
\n
\n { owner.name }\n
\n
\n
\n }\n\n { provider.partner && }\n\n
\n
\n )}\n\n
\n { !available && provider.partner && }\n
\n
\n )\n}\n\nexport default Contacts;\n"],"names":["_ref","addressLine1","contact","locationId","siteKey","streetName","_useState","useState","_useState2","_slicedToArray","isContactsShown","setIsContactsShown","_useState3","_useState4","contactEmail","setContactEmail","address","React","onClick","encodedEmail","key","iv","CryptoJS","Base64","parse","tag","Utf8","decrypt","ciphertext","mode","CBC","toString","postLocationContactDetailsShown","catch","error","console","log","className","SvgIco","name","size","href","concat","phone","I18n","t","window","location","_useContext","useContext","Context","locationClosed","locationContactDetails","partnerBadgeUrl","available","owner","provider","ProviderBadgeSection","partnerBadge","alt","height","width","Fragment","photo","PersonPlaceholder","SmallContactBlock","logo","title","info","postLocationProviderAdvertsShown","dangerouslySetInnerHTML","__html","advertLink","partner"],"sourceRoot":""}