{"version":3,"file":"js/email-protect.js","mappings":"kCAgBA,MAAMA,EAAWC,GACNA,EACF,MAAM,EAAE,EACR,IAAKC,GAAkB,OAAO,aAAaA,EAAK,WAAW,CAAC,EAAI,CAAC,CAAC,EAClE,KAAK,EAAE,EAIVC,EAAkB,qBAClBC,EAAgB,2BAEhBC,EAA0C,SAAS,iBAAiB,IAAIF,IAAkB,EACjD,SAAS,iBAAiB,IAAIC,IAAgB,EAEtF,QAASE,GAA6B,CAC1CA,EAAK,iBAAiB,QAAU,GAAM,CA/BzC,MAgCO,EAAE,eAAe,EACjB,OAAO,SAAS,KAAO,UAAYN,GAAQ,EAAAM,EAAK,aAAaF,CAAa,IAA/B,OAAoC,EAAE,CACrF,CAAC,CACJ,CAAC,EAEDC,EAAU,QAASC,GAA2B,CArC9C,MAsCIA,EAAK,YAAcN,GAAQ,EAAAM,EAAK,aAAaH,CAAe,IAAjC,OAAsC,EAAE,CACvE,CAAC,C","sources":["webpack://email-protect/./src/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2021 - 2023 CodeLeaf\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n */\n\nconst decrypt = (str : string) : string => {\n return str\n .split(\"\")\n .map((char : string) => String.fromCharCode(char.charCodeAt(0) - 2))\n .join(\"\")\n ;\n}\n\nconst addressSelector = 'data-email-protect';\nconst clickSelector = 'data-email-protect-click';\n\nconst addresses : NodeListOf = document.querySelectorAll(`[${addressSelector}]`);\nconst clicks : NodeListOf = document.querySelectorAll(`[${clickSelector}]`);\n\nclicks.forEach((elem : HTMLAnchorElement) => {\n elem.addEventListener('click', (e) => {\n e.preventDefault();\n window.location.href = 'mailto:' + decrypt(elem.getAttribute(clickSelector) ?? \"\");\n });\n});\n\naddresses.forEach((elem : HTMLSpanElement) => {\n elem.textContent = decrypt(elem.getAttribute(addressSelector) ?? \"\");\n});"],"names":["decrypt","str","char","addressSelector","clickSelector","addresses","elem"],"sourceRoot":""}