=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:R(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function c(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){c(i,n,o,a,s,"next",e)}function s(e){c(i,n,o,a,s,"throw",e)}a(void 0)}))}}var f=Array.from(document.querySelectorAll(".age-gate-shortcode-js")),h=function(e,t){var r=atob(t),n=(new DOMParser).parseFromString(r,"text/html");e.parentNode.replaceChild(n.body.firstChild,e)},p=function(){var e=l(u().mark((function e(r,n){var o,i,a,s;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(o=new FormData(r)).append("age_gate[confirm]",n.value),i=new URLSearchParams(o).toString(),e.next=5,t().get("/wp-json/age-gate/v3/check?".concat(i));case 5:return a=e.sent,s=a.data,e.abrupt("return",s);case 8:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();window.addEventListener("age_gate_sc",(function(e){var t=e.detail.age;Array.from(document.querySelectorAll(".age-gate-shortcode-js")).forEach((function(e){var r=e.dataset,n=r.agegate,o=r.data,i=JSON.parse(atob(o)).age;if(t>=i)return h(e,n)}))})),f.forEach((function(e){var t=new n.Crawler,r=e.dataset,o=r.agegate,i=r.data;if(t.isCrawler(navigator.userAgent))return h(e,o);var s=JSON.parse(atob(i)),c=s.age,f=s.cookieName,d=s.cookieDomain;if(a.get(f)>=c)return h(e,o);!function(e,t,r,n){var o=e.querySelector("script").textContent;e.insertAdjacentHTML("beforeend",o),e.querySelector("form").addEventListener("submit",function(){var o=l(u().mark((function o(i){var s,c,l,f,d;return u().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return i.preventDefault(),o.next=3,p(i.target,i.submitter);case 3:!1!==(s=o.sent).status?(c=s.data.user_age,a.set(r,c,{domain:n,path:"/",secure:!0,sameSite:"None"}),h(e,t),l=new CustomEvent("age_gate_sc",{detail:{age:c}}),window.dispatchEvent(l)):(f=s.errors,d=''.concat(f[Object.keys(f).pop()],"
"),e.querySelector(".age-gate__errors, .age-gate-errors").innerHTML=d,a.set("".concat(r,"_failed"),1,cookieOptions));case 6:case"end":return o.stop()}}),o)})));return function(e){return o.apply(this,arguments)}}())}(e,o,f,d)}))})()})();