{"version":3,"file":"twittersharefix.cda5f2e9e7a924302c00.js","mappings":"8FAAAA,EAAEC,UAAUC,OAAM,KAEd,IAAIC,EAAe,GACnB,MAAMC,EAAwBH,SAASI,iBAAiB,wBAClDC,EAA0BL,SAASI,iBAAiB,+DACpDE,EAA6BN,SAASI,iBAAiB,kCAE1DD,GAAyBA,EAAsBI,OAAS,IACvDL,EAAe,IACRA,KACAC,IAIRE,GAA2BA,EAAwBE,OAAS,IAC3DL,EAAe,IACRA,KACAG,IAIRC,GAA8BA,EAA2BC,OAAS,IACjEL,EAAe,IACRA,KACAI,IAIRJ,EAAaK,OAAS,GACrB,kCAAuDC,MAAK,EAAEC,QAASC,MACnER,EAAaS,SAAQC,IACjB,MAAMC,EAAgBD,EAASE,WAIzBC,EAAmB,kCAHRC,UAAW,GAAEN,EAAUO,SAASC,OAAOC,SAASC,UAAUV,EAAUO,SAASC,OAAOC,SAASE,eAI9GR,EAAcS,KAAOP,EACrBF,EAAcU,iBAAiB,SAAUC,IACrCA,EAAEC,iBACF,MAEMC,GAAQR,OAAOS,WAFF,KAE4B,EACzCC,GAAOV,OAAOW,YAFA,KAE2B,EAQ/CX,OAAOY,KAAKf,EAAiB,gBAAkB,6BAAiDW,SAAYE,IAA5G,GAbJ,GAPJ,GAwBP,G","sources":["webpack://capgemini2020/./assets/js/twitterShareFix.js"],"sourcesContent":["$(document).ready(() => {\r\n\r\n let twitterIcons = [];\r\n const twitterIconsIntroPara = document.querySelectorAll('.intro-para .icon-tw');\r\n const twitterIconsEventAgenda = document.querySelectorAll('.section-events-listing .event-section .social-nav .icon-tw');\r\n const twitterIconsArticleContent = document.querySelectorAll('.article-main-content .icon-tw');\r\n\r\n if(twitterIconsIntroPara && twitterIconsIntroPara.length > 0) {\r\n twitterIcons = [\r\n ...twitterIcons,\r\n ...twitterIconsIntroPara,\r\n ]\r\n }\r\n\r\n if(twitterIconsEventAgenda && twitterIconsEventAgenda.length > 0) {\r\n twitterIcons = [\r\n ...twitterIcons,\r\n ...twitterIconsEventAgenda,\r\n ]\r\n }\r\n\r\n if(twitterIconsArticleContent && twitterIconsArticleContent.length > 0) {\r\n twitterIcons = [\r\n ...twitterIcons,\r\n ...twitterIconsArticleContent,\r\n ]\r\n }\r\n\r\n if(twitterIcons.length > 0){\r\n import(/* webpackChunkName: \"dompurify\" */'dompurify').then(({default: DOMPurify}) => {\r\n twitterIcons.forEach(iconItem => {\r\n const anchorElement = iconItem.parentNode;\r\n const shareUrl = encodeURI(`${DOMPurify.sanitize(window.location.origin)}${DOMPurify.sanitize(window.location.pathname)}`);\r\n // console.log(shareUrl);\r\n // console.log(encodedLink);\r\n const twitterShareUrl = `https://x.com/intent/tweet?url=${shareUrl}`;\r\n anchorElement.href = twitterShareUrl;\r\n anchorElement.addEventListener('click', (e) => {\r\n e.preventDefault();\r\n const popupWidth = 600;\r\n const popupHeight = 400;\r\n const left = (window.innerWidth-popupWidth ) / 2;\r\n const top = (window.innerHeight-popupHeight) / 2;\r\n // const currenthref = anchorElement.href;\r\n // console.log(currenthref);\r\n // const urlParams = new URL(currenthref).searchParams;\r\n // const shareUrl = urlParams.get('url');\r\n\r\n //window.open(fbShareUrl, '_blank');\r\n // Open the Twitter share link in a centered popup window\r\n window.open(twitterShareUrl, 'Twitter Share', `width=${popupWidth},height=${popupHeight},left=${left},top=${top}`);\r\n })\r\n })\r\n })\r\n }\r\n});"],"names":["$","document","ready","twitterIcons","twitterIconsIntroPara","querySelectorAll","twitterIconsEventAgenda","twitterIconsArticleContent","length","then","default","DOMPurify","forEach","iconItem","anchorElement","parentNode","twitterShareUrl","encodeURI","sanitize","window","location","origin","pathname","href","addEventListener","e","preventDefault","left","innerWidth","top","innerHeight","open"],"sourceRoot":""}