{"version":3,"sources":["webpack:///./LeLab.Web/src/js/recaptcha.entry.js"],"names":["Captcha","constructor","node","this","sitekey","dataset","captchaId","grecaptcha","render","destroy","reset","s","document","createElement","src","querySelector","lang","async","defer","head","appendChild","window","onloadTurnstileCallback","PageComponent"],"mappings":"4FAAA,yBAGA,MAAMA,EACFC,aAAY,KAAEC,IACVC,KAAKD,KAAOA,EACZC,KAAKC,QAAUD,KAAKD,KAAKG,QAAQD,QACjCD,KAAKG,UAAYC,WAAWC,OACxBL,KAAKD,KACL,CAAEE,QAASD,KAAKC,UAIxBK,UACQN,KAAKG,WACLC,WAAWG,MAAMP,KAAKG,kBAGnBH,KAAKD,YACLC,KAAKC,eACLD,KAAKG,WASpB,MAAMK,EAAIC,SAASC,cAAc,UACjCF,EAAEG,IAAF,mIAAoIF,SAASG,cAAc,QAAQC,MAAQ,MAC3KL,EAAEM,OAAQ,EACVN,EAAEO,OAAQ,EACVN,SAASO,KAAKC,YAAYT,GAG1BU,OAAOC,wBAA0B,KAC7B,IAAIC,IAAc,eAAgBvB,K","file":"recaptcha.js","sourcesContent":["import \"./recaptcha.scss\"\r\nimport { PageComponent } from \"barba\"\r\n\r\nclass Captcha {\r\n constructor({ node }) {\r\n this.node = node\r\n this.sitekey = this.node.dataset.sitekey\r\n this.captchaId = grecaptcha.render(\r\n this.node,\r\n { sitekey: this.sitekey }\r\n )\r\n }\r\n\r\n destroy() {\r\n if (this.captchaId) {\r\n grecaptcha.reset(this.captchaId)\r\n }\r\n\r\n delete this.node\r\n delete this.sitekey\r\n delete this.captchaId\r\n }\r\n}\r\n\r\n///////////////////////////////////////////////////////\r\n// Cloudflare Turnstile alternative to Google ReCaptcha\r\n///////////////////////////////////////////////////////\r\n\r\n// Load external lib\r\nconst s = document.createElement('script');\r\ns.src = `https://challenges.cloudflare.com/turnstile/v0/api.js?compat=recaptcha&onload=onloadTurnstileCallback&render=explicit&hl=${document.querySelector('html').lang || 'en'}`;\r\ns.async = true;\r\ns.defer = true;\r\ndocument.head.appendChild(s);\r\n\r\n// Trunstile lib loaded\r\nwindow.onloadTurnstileCallback = () => {\r\n new PageComponent(\".g-recaptcha\", Captcha);\r\n}"],"sourceRoot":""}