(()=>{"use strict";var e,t={1210:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(){this.widgets=new Map}static load(){(new r).init()}init(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>this.setup()):this.setup()}setup(){const e=document.querySelectorAll(".cf-turnstile");if(0!==e.length){if(void 0!==window.turnstile)this.renderAll(e);else{const t=()=>{void 0!==window.turnstile?this.renderAll(e):setTimeout(t,100)};t()}jQuery(document).on("updated_checkout",()=>this.onCheckoutUpdate())}}renderAll(e){e.forEach(e=>{this.renderWidget(e)})}renderWidget(e){if(this.widgets.has(e))return;const t={sitekey:e.dataset.sitekey||"",theme:e.dataset.theme||"light",size:e.dataset.size||"normal",callback:t=>this.onSuccess(t,e),"error-callback":()=>this.onError(e)},r=window.turnstile.render(e,t);this.widgets.set(e,r)}onSuccess(e,t){this.setToken(e,t),this.hideError(t)}onError(e){this.setToken("",e),this.showError(e)}setToken(e,t){const r=t.closest("form")||document.querySelector("form.checkout, form#order_review, form.woocommerce-form");if(!r)return;const o="cf-turnstile-response";let s=r.querySelector(`input[name="${o}"]`);s||(s=document.createElement("input"),s.type="hidden",s.name=o,r.appendChild(s)),s.value=e}showError(e){var t;const r=null===(t=e.parentElement)||void 0===t?void 0:t.querySelector(".cfw-turnstile-error");r&&(r.style.display="block")}hideError(e){var t;const r=null===(t=e.parentElement)||void 0===t?void 0:t.querySelector(".cfw-turnstile-error");r&&(r.style.display="none")}onCheckoutUpdate(){setTimeout(()=>{document.querySelectorAll(".cf-turnstile").forEach(e=>{const t=e;this.widgets.has(t)||this.renderWidget(t)})},100)}reset(){this.widgets.forEach(e=>{window.turnstile.reset(e)})}resetWidget(e){const t=this.widgets.get(e);t&&window.turnstile.reset(t)}}t.default=r},5503:function(e,t,r){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),o(r(1210)).default.load()},6172:()=>{}},r={};function o(e){var s=r[e];if(void 0!==s)return s.exports;var n=r[e]={exports:{}};return t[e].call(n.exports,n,n.exports,o),n.exports}o.m=t,e=[],o.O=(t,r,s,n)=>{if(!r){var i=1/0;for(u=0;u<e.length;u++){for(var[r,s,n]=e[u],l=!0,c=0;c<r.length;c++)(!1&n||i>=n)&&Object.keys(o.O).every(e=>o.O[e](r[c]))?r.splice(c--,1):(l=!1,n<i&&(i=n));if(l){e.splice(u--,1);var d=s();void 0!==d&&(t=d)}}return t}n=n||0;for(var u=e.length;u>0&&e[u-1][2]>n;u--)e[u]=e[u-1];e[u]=[r,s,n]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={213:0,704:0};o.O.j=t=>0===e[t];var t=(t,r)=>{var s,n,[i,l,c]=r,d=0;if(i.some(t=>0!==e[t])){for(s in l)o.o(l,s)&&(o.m[s]=l[s]);if(c)var u=c(o)}for(t&&t(r);d<i.length;d++)n=i[d],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(u)},r=globalThis.webpackChunkcheckout_for_woocommerce=globalThis.webpackChunkcheckout_for_woocommerce||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),o.O(void 0,[704],()=>o(5503));var s=o.O(void 0,[704],()=>o(6172));s=o.O(s)})();