{"version":3,"file":"turnstile.js","names":[],"sources":["../resources/modern-javascript/turnstile.js"],"sourcesContent":["(() => {\n    /**\n     * This is when the Turnstile widget completes - the challenge could be a\n     * failure or a success.\n     *\n     * This callback is just for notifying the form that Turnstile has finished\n     * doing what it needs to do - so you could, for example, enable the submit\n     * button.\n     *\n     * @param {String} token This is the token gerenated by Turnstile\n     */\n    window.emitTurnstileChallengeComplete = token => {\n        // find the hidden form element that contains this token\n        const hiddenInput = document.querySelector(\n            `.field--turnstile input[type=\"hidden\"][value=\"${token}\"]`\n        );\n\n        if (!hiddenInput) {\n            console.debug(\n                'Turnstile challenge complete, but no matching hidden input found.'\n            );\n            return;\n        }\n\n        const parentForm = hiddenInput.closest('form');\n\n        if (parentForm) {\n            console.debug('Dispatching turnstile:complete event on form');\n            parentForm.dispatchEvent(new CustomEvent('turnstile:complete'));\n        }\n    };\n})();\n"],"mappings":"AAWI,OAAO,+BAAiC,GAAS,CAE7C,IAAM,EAAc,SAAS,cACzB,iDAAiD,EAAA,GACrD,EAEA,GAAI,CAAC,EAAa,CACd,QAAQ,MACJ,mEACJ,EACA,MACJ,CAEA,IAAM,EAAa,EAAY,QAAQ,MAAM,EAEzC,IACA,QAAQ,MAAM,8CAA8C,EAC5D,EAAW,cAAc,IAAI,YAAY,oBAAoB,CAAC,EAEtE"}