{"version":3,"sources":["webpack:///./LeLab.Gcv.Web/src/controller/ctrl-recaptcha/ctrl-recaptcha.chunk.js"],"names":["$","require","each","$tokenInput","$button","action","data","callback","$form","click","e","grecaptcha","enterprise","preventDefault","ready","execute","window","recaptchaEnterpriseSiteKey","then","token","val","call","submit","catch","error","console","log"],"mappings":";;;;;;;;AAAA,IAAIA,IAAI,mBAAAC,CAAQ,CAAR,CAAR;;AAEA;AACAD,EAAE,2BAAF,EAA+BE,IAA/B,CAAoC,YAAY;AAC5C,QAAMC,cAAcH,EAAE,wBAAF,CAApB;AACA,QAAMI,UAAUJ,EAAE,sBAAF,CAAhB;AACA,QAAMK,SAASD,QAAQE,IAAR,CAAa,kBAAb,CAAf;AACA,QAAMC,WAAWH,QAAQE,IAAR,CAAa,oBAAb,CAAjB;;AAEA,QAAIE,QAAQR,EAAE,IAAF,CAAZ;;AAEAI,YAAQK,KAAR,CAAc,UAAUC,CAAV,EAAa;AACvB,YAAIC,WAAWC,UAAX,IAAyBT,WAA7B,EAA0C;AACtCO,cAAEG,cAAF;;AAEAF,uBAAWC,UAAX,CAAsBE,KAAtB,CAA4B,YAAY;AACpCH,2BAAWC,UAAX,CACKG,OADL,CACaC,OAAOC,0BADpB,EACgD,EAACZ,QAAQA,MAAT,EADhD,EAEKa,IAFL,CAEU,UAAUC,KAAV,EAAiB;AACnB;AACAhB,gCAAYiB,GAAZ,CAAgBD,KAAhB;;AAEA;AACA,wBAAGZ,QAAH,EAAY;AACRS,+BAAOT,QAAP,EAAiBc,IAAjB,CAAsB,IAAtB,EAA4BrB,CAA5B,EAA+BQ,KAA/B;AACA;AACH;;AAEDA,0BAAM,CAAN,EAASc,MAAT;AACH,iBAbL,EAcKC,KAdL,CAcW,UAACC,KAAD;AAAA,2BAAWC,QAAQC,GAAR,CAAYF,KAAZ,CAAX;AAAA,iBAdX;AAeH,aAhBD;AAiBH;AACJ,KAtBD;AAuBH,CA/BD,E","file":"ctrl-recaptcha.js","sourcesContent":["let $ = require(\"jquery\");\r\n\r\n//init\r\n$(\"form[data-recaptcha-form]\").each(function () {\r\n const $tokenInput = $(\"[data-recaptcha-token]\");\r\n const $button = $(\"[data-recaptcha-btn]\");\r\n const action = $button.data(\"recaptcha-action\");\r\n const callback = $button.data(\"recaptcha-callback\");\r\n\r\n let $form = $(this);\r\n\r\n $button.click(function (e) {\r\n if (grecaptcha.enterprise && $tokenInput) {\r\n e.preventDefault();\r\n\r\n grecaptcha.enterprise.ready(function () {\r\n grecaptcha.enterprise\r\n .execute(window.recaptchaEnterpriseSiteKey, {action: action})\r\n .then(function (token) {\r\n //stock the token in an hidden input\r\n $tokenInput.val(token);\r\n\r\n //then submit the form so backend can assess. \r\n if(callback){ \r\n window[callback].call(this, $, $form);\r\n return\r\n }\r\n \r\n $form[0].submit();\r\n })\r\n .catch((error) => console.log(error));\r\n });\r\n }\r\n })\r\n});\n\n\n// WEBPACK FOOTER //\n// ./LeLab.Gcv.Web/src/controller/ctrl-recaptcha/ctrl-recaptcha.chunk.js"],"sourceRoot":""}