{"version":3,"file":"zoomv.9196.min.js?t=3f4aec5e7216856f964b","mappings":"wzBAwCA,QAvCmB,WAWhB,O,EAVD,SAAAA,EAAYC,I,4FAAIC,CAAA,KAAAF,GACdG,KAAKF,GAAKA,EACVE,KAAKC,OAAS,CACZC,YAAaF,KAAKF,GAAGK,cAAc,iCACnCC,oBAAqBJ,KAAKF,GAAGK,cAC3B,oCAEFE,aAAcL,KAAKF,GAAGK,cAAc,iCAEtCH,KAAKM,cACP,G,EAAC,EAAAC,IAAA,eAAAC,MAED,WACMR,KAAKC,OAAOC,YAAYO,UAAUC,SAAS,0BAC7CV,KAAKC,OAAOC,YAAYS,iBAAiB,QAASX,KAAKY,QAAQC,KAAKb,OAEnEA,KAAKC,OAAOI,cACbL,KAAKC,OAAOI,aAAaM,iBAAiB,QAASX,KAAKc,MAAMD,KAAKb,MAEvE,GAAC,CAAAO,IAAA,UAAAC,MAED,WACE,IAAAO,EAA6Cf,KAAKC,OAA1CC,EAAWa,EAAXb,YAAaE,EAAmBW,EAAnBX,oBACfY,EAAMd,EAAYe,QAAQD,IAChCE,UAAUC,UAAUC,UAAUJ,GAAKK,MAAK,WAClCjB,EAAoBkB,aAAa,UACnClB,EAAoBmB,gBAAgB,UAEpCnB,EAAoBoB,aAAa,SAAU,GAE/C,GACF,GAAC,CAAAjB,IAAA,QAAAC,MAED,WACEiB,OAAOX,OACT,M,6EAAC,CApCgB,E","sources":["webpack://@hero-digital/zoom/./src/components/foundation/SocialSharing/SocialSharing.js"],"sourcesContent":["// SocialSharing Component\r\nclass SocialSharing {\r\n constructor(el) {\r\n this.el = el\r\n this.domMap = {\r\n $copyButton: this.el.querySelector('button.social-sharing__button'),\r\n $successCopyMessage: this.el.querySelector(\r\n '.social-sharing__success-message'\r\n ),\r\n $printButton: this.el.querySelector('button.social-sharing__print')\r\n }\r\n this.addListeners()\r\n }\r\n\r\n addListeners() {\r\n if(!this.domMap.$copyButton.classList.contains('social-sharing__print')){\r\n this.domMap.$copyButton.addEventListener('click', this.copyUrl.bind(this))\r\n }\r\n if(this.domMap.$printButton){\r\n this.domMap.$printButton.addEventListener('click', this.print.bind(this))\r\n }\r\n }\r\n\r\n copyUrl() {\r\n const { $copyButton, $successCopyMessage } = this.domMap\r\n const url = $copyButton.dataset.url\r\n navigator.clipboard.writeText(url).then(() => {\r\n if ($successCopyMessage.hasAttribute('hidden')) {\r\n $successCopyMessage.removeAttribute('hidden')\r\n } else {\r\n $successCopyMessage.setAttribute('hidden', '')\r\n }\r\n })\r\n }\r\n\r\n print(){\r\n window.print()\r\n }\r\n}\r\n\r\nexport default SocialSharing\r\n"],"names":["SocialSharing","el","_classCallCheck","this","domMap","$copyButton","querySelector","$successCopyMessage","$printButton","addListeners","key","value","classList","contains","addEventListener","copyUrl","bind","print","_this$domMap","url","dataset","navigator","clipboard","writeText","then","hasAttribute","removeAttribute","setAttribute","window"],"sourceRoot":""}