(()=>{function _(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */_=function(){return a};var s,a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(s){f=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,a,u,e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype);return f(e,"_invoke",(o=t,i=r,a=new x(n||[]),u=1,function(t,e){if(3===u)throw Error("Generator is already running");if(4===u){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.i[n];if(o===s)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=h(o,e.i,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;o=n.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(1===u)throw u=4,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=3;r=h(o,i,a);if("normal"===r.type){if(u=a.done?4:2,r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(u=4,a.method="throw",a.arg=r.arg)}}),!0),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var l={};function p(){}function i(){}function y(){}var e={},d=(f(e,n,function(){return this}),Object.getPrototypeOf),d=d&&d(d(E([]))),v=(d&&d!==t&&c.call(d,n)&&(e=d),y.prototype=p.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function m(a,u){var e;f(this,"_invoke",function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=h(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==S(r)&&c.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()},!0)}function w(t){this.tryEntries.push(t)}function b(t){var e=t[4]||{};e.type="normal",e.arg=s,t[4]=e}function x(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0)}function E(e){if(null!=e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(c.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(S(e)+" is not iterable")}return f(v,"constructor",i.prototype=y),f(y,"constructor",i),i.displayName=f(y,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,o,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},g(m.prototype),f(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new m(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(v),f(v,o,"Generator"),f(v,n,function(){return this}),f(v,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.unshift(e);return function t(){for(;n.length;)if((e=n.pop())in r)return t.value=e,t.done=!1,t;return t.done=!0,t}},a.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t){i.type="throw",i.arg=e,r.next=t}for(var n=r.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o[4],a=this.prev,u=o[1],c=o[2];if(-1===o[0])return t("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=s,t(u),!0;if(a<c)return t(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(-1<n[0]&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]?null:o)?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o[0]===t)return"throw"===(r=o[4]).type&&(n=r.arg,b(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={i:E(t),r:e,n:r},"next"===this.method&&(this.arg=s),l}},a}function S(t){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function n(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){c(n,e,r,o,i,"next",t)}function i(t){c(n,e,r,o,i,"throw",t)}o(void 0)})}}function o(){t.apply(this,arguments)}function t(){return(t=n(_().mark(function t(){var e,r;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((e=document.querySelectorAll(".izi-widget-placeholder")).length){t.next=3;break}return t.abrupt("return");case 3:if("object"!==("undefined"==typeof InpostIziJavsscriptWoocommerce?"undefined":S(InpostIziJavsscriptWoocommerce)))return t.abrupt("return");t.next=5;break;case 5:return r=Array.from(e).map((()=>{var e=n(_().mark(function t(e){var r,n;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.classList[1],r="izi-widget-product"===n?e.getAttribute("data-product-id"):null,t.next=4,function(){return i.apply(this,arguments)}(n,r);case 4:n=t.sent,e.innerHTML=n,widget.refresh();case 7:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}})()),t.next=8,Promise.all(r);case 8:document.querySelectorAll(".izi-widget-placeholder").forEach(function(t){var o;o=t,new Promise(function(e){var r=0,n=setInterval(function(){var t=o.querySelector("inpost-izi-button");null!=t&&t.shadowRoot&&(clearInterval(n),e(t.shadowRoot)),30<=++r&&(clearInterval(n),e(null))},100)}).then(function(t){var e,r;t&&(e=t.querySelector(".button"))&&(r="pl"==(t="pl"===(null==(t=o.querySelector("inpost-izi-button").getAttribute("language"))?void 0:t.trim().toLowerCase())?"pl":"en")?"Kup z InPost":"Buy with InPost",e.setAttribute("tabindex","0"),e.setAttribute("role","button"),e.setAttribute("aria-label",r),e.setAttribute("lang",t),e.dataset.keyboardHandlerAdded||(e.addEventListener("keydown",function(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.click())}),e.dataset.keyboardHandlerAdded="1"))})});case 9:case"end":return t.stop()}},t)}))).apply(this,arguments)}function i(){return(i=n(_().mark(function t(e){var r,n,o,i,a=arguments;return _().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=1<a.length&&void 0!==a[1]?a[1]:null,t.t0=e,t.next="izi-widget-order"===t.t0?4:"izi-widget-checkout"===t.t0?6:"izi-widget-minicart"===t.t0?8:"izi-widget-cart"===t.t0?10:"izi-widget-product"===t.t0?12:14;break;case 4:return n="wp-json/inpost/v1/izi/widget/place_order_create",t.abrupt("break",14);case 6:return n="wp-json/inpost/v1/izi/widget/place_checkout_page",t.abrupt("break",14);case 8:return n="wp-json/inpost/v1/izi/widget/place_minicart",t.abrupt("break",14);case 10:return n="wp-json/inpost/v1/izi/widget/place_basket_summary",t.abrupt("break",14);case 12:return n="wp-json/inpost/v1/izi/widget/place_product_card/".concat(r),t.abrupt("break",14);case 14:return"undefined"!=typeof InpostIziJavsscriptWoocommerce&&S(InpostIziJavsscriptWoocommerce),o=(new Date).getTime(),t.next=18,fetch("".concat(InpostIziJavsscriptWoocommerce.home_url).concat(n,"?t=").concat(o),{credentials:"same-origin",headers:{"Content-Type":"text/html",cache:"no-cache"}});case 18:if((i=t.sent).ok){t.next=21;break}throw new Error("Network response was not ok");case 21:if(200!==i.status)return t.abrupt("return");t.next=23;break;case 23:return t.next=25,i.text();case 25:return t.abrupt("return",t.sent);case 26:case"end":return t.stop()}},t)}))).apply(this,arguments)}function k(t){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function O(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */O=function(){return a};var s,a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(s){f=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,a,u,e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype);return f(e,"_invoke",(o=t,i=r,a=new x(n||[]),u=1,function(t,e){if(3===u)throw Error("Generator is already running");if(4===u){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.i[n];if(o===s)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=h(o,e.i,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;o=n.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(1===u)throw u=4,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=3;r=h(o,i,a);if("normal"===r.type){if(u=a.done?4:2,r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(u=4,a.method="throw",a.arg=r.arg)}}),!0),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var l={};function p(){}function i(){}function y(){}var e={},d=(f(e,n,function(){return this}),Object.getPrototypeOf),d=d&&d(d(E([]))),v=(d&&d!==t&&c.call(d,n)&&(e=d),y.prototype=p.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function m(a,u){var e;f(this,"_invoke",function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=h(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==k(r)&&c.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()},!0)}function w(t){this.tryEntries.push(t)}function b(t){var e=t[4]||{};e.type="normal",e.arg=s,t[4]=e}function x(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0)}function E(e){if(null!=e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(c.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(k(e)+" is not iterable")}return f(v,"constructor",i.prototype=y),f(y,"constructor",i),i.displayName=f(y,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,o,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},g(m.prototype),f(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new m(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(v),f(v,o,"Generator"),f(v,n,function(){return this}),f(v,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.unshift(e);return function t(){for(;n.length;)if((e=n.pop())in r)return t.value=e,t.done=!1,t;return t.done=!0,t}},a.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t){i.type="throw",i.arg=e,r.next=t}for(var n=r.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o[4],a=this.prev,u=o[1],c=o[2];if(-1===o[0])return t("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=s,t(u),!0;if(a<c)return t(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(-1<n[0]&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]?null:o)?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o[0]===t)return"throw"===(r=o[4]).type&&(n=r.arg,b(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={i:E(t),r:e,n:r},"next"===this.method&&(this.arg=s),l}},a}function s(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function a(){var u;return u=O().mark(function t(e){var r,n,o,i,a,u,c,s,f;return O().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e)return t.abrupt("return");t.next=2;break;case 2:if(n=document.querySelector('inpost-izi-button[data-currency-processed="1"]'))return n.removeAttribute("data-currency-processed"),t.abrupt("return",widgetOptions.basketBindingApiKey);t.next=6;break;case 6:r=new FormData,(n=window.document.querySelector("form.cart"))?(o=n.querySelector("button[type=submit]"),r=new FormData(n,o),t.next=23):t.next=13;break;case 13:if(!(o=window.document.querySelector("input.variation_id"))){t.next=23;break}if(r.append("variation_id",o.value),i=document.querySelector(".variations")){t.next=19;break}return t.abrupt("return");case 19:if(a=i.querySelectorAll("select")){t.next=22;break}return t.abrupt("return");case 22:a.forEach(function(t){return r.append(t.name,t.value)});case 23:return r.append("action","add_to_cart"),void 0!==e&&r.append("product_id",e),(u=document.createElement("div")).id="izi-temp-container",u.style.display="none",document.body.appendChild(u),(c=document.createElement("a")).classList.add("ajax_add_to_cart","add_to_cart_button"),c.dataset.productId=e,c.href="?add-to-cart="+e,u.appendChild(c),(s=document.createElement("span")).classList.add("added_to_cart"),u.appendChild(s),t.prev=37,t.next=40,fetch(InpostIziJavsscriptWoocommerce.ajaxurl,{method:"POST",body:r});case 40:if(500<=t.sent.status)throw new Error("Server error 500");t.next=43;break;case 43:f=window.alert,window.alert=function(t){void 0===t||"undefined"===t?console.warn("[InPostPay] Zablokowano alert(undefined) z pluginu zewnętrznego"):f.call(window,t)},jQuery(document.body).trigger("added_to_cart"),setTimeout(function(){window.alert=f},100),console.warn("[InPostPay] Trigger added_to_cart"),"undefined"!=typeof wc_add_to_cart_params?jQuery.ajax({url:wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","get_refreshed_fragments"),type:"POST",success:function(t){t&&t.fragments&&(jQuery.each(t.fragments,function(e,r){if(0<jQuery(e).length)try{jQuery(e).html(jQuery(r).html())}catch(t){console.error("[InPostPay] Błąd przy podmianie fragmentu:",{key:e,valueSnippet:null==r||null==(r=r.toString())?void 0:r.substring(0,500),error:t,stack:t.stack})}else console.warn("[InPostPay] Nie znaleziono elementu do podmiany:",e)}),"undefined"!=typeof wc_cart_fragments_params&&(sessionStorage.setItem(wc_cart_fragments_params.fragment_name,JSON.stringify(t.fragments)),sessionStorage.setItem("wc_cart_hash",t.cart_hash)),jQuery(document.body).trigger("wc_fragments_refreshed"),jQuery(document.body).trigger("added_to_cart",[null,null,jQuery(c)]),setTimeout(function(){document.getElementById("izi-temp-container")&&document.getElementById("izi-temp-container").remove()},100))},error:function(t,e,r){console.error("[FRAGMENTS-ERROR]",e,r,t.responseText),document.getElementById("izi-temp-container")&&document.getElementById("izi-temp-container").remove()}}):(jQuery(document.body).trigger("added_to_cart",[null,null,jQuery(c)]),setTimeout(function(){document.getElementById("izi-temp-container")&&document.getElementById("izi-temp-container").remove()},100)),t.next=55;break;case 51:t.prev=51,t.t0=t.catch(37),console.error("[InPostPay] Błąd przy ładowaniu koszyka:",t.t0,t.t0.stack),document.getElementById("izi-temp-container")&&document.getElementById("izi-temp-container").remove();case 55:return t.abrupt("return",widgetOptions.basketBindingApiKey);case 56:case"end":return t.stop()}},t,null,[[37,51]])}),(a=function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){s(n,e,r,o,i,"next",t)}function i(t){s(n,e,r,o,i,"throw",t)}o(void 0)})}).apply(this,arguments)}function j(t){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function P(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */P=function(){return a};var s,a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(s){f=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,a,u,e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype);return f(e,"_invoke",(o=t,i=r,a=new x(n||[]),u=1,function(t,e){if(3===u)throw Error("Generator is already running");if(4===u){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.i[n];if(o===s)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=h(o,e.i,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;o=n.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(1===u)throw u=4,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=3;r=h(o,i,a);if("normal"===r.type){if(u=a.done?4:2,r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(u=4,a.method="throw",a.arg=r.arg)}}),!0),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var l={};function p(){}function i(){}function y(){}var e={},d=(f(e,n,function(){return this}),Object.getPrototypeOf),d=d&&d(d(E([]))),v=(d&&d!==t&&c.call(d,n)&&(e=d),y.prototype=p.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function m(a,u){var e;f(this,"_invoke",function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=h(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==j(r)&&c.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()},!0)}function w(t){this.tryEntries.push(t)}function b(t){var e=t[4]||{};e.type="normal",e.arg=s,t[4]=e}function x(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0)}function E(e){if(null!=e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(c.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(j(e)+" is not iterable")}return f(v,"constructor",i.prototype=y),f(y,"constructor",i),i.displayName=f(y,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,o,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},g(m.prototype),f(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new m(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(v),f(v,o,"Generator"),f(v,n,function(){return this}),f(v,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.unshift(e);return function t(){for(;n.length;)if((e=n.pop())in r)return t.value=e,t.done=!1,t;return t.done=!0,t}},a.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t){i.type="throw",i.arg=e,r.next=t}for(var n=r.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o[4],a=this.prev,u=o[1],c=o[2];if(-1===o[0])return t("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=s,t(u),!0;if(a<c)return t(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(-1<n[0]&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]?null:o)?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o[0]===t)return"throw"===(r=o[4]).type&&(n=r.arg,b(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={i:E(t),r:e,n:r},"next"===this.method&&(this.arg=s),l}},a}function f(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function h(){var u;return u=P().mark(function t(e){var r,n,o,i,a,u,c,s,f,h,l,p;return P().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=document.querySelector('.izi-widget-product[data-product-id="'.concat(e,'"]')),r=r?r.closest("form"):null,r=r||window.document.querySelector('form[data-product_id="'.concat(e,'"]'))){t.next=5;break}return t.abrupt("return",!0);case 5:if(n=r.querySelector("button.single_add_to_cart_button"),o=r.querySelector("button.single_add_to_cart_button.disabled"),i=r.querySelector('a.add_to_cart_button[data-product_id="'.concat(e,'"]')),a=r.querySelector(".post-".concat(e)),u=r.querySelectorAll("form.cart .pewc-item"),c=r.querySelectorAll(".wapf input[required]"),i||r||a){t.next=13;break}return t.abrupt("return",!0);case 13:if(n&&n.disabled||o)return t.abrupt("return",!1);t.next=15;break;case 15:if(!(0<c.length)){t.next=19;break}if(Array.from(c).every(function(t){return t.value})){t.next=19;break}return t.abrupt("return",!1);case 19:if(!(0<u.length)){t.next=35;break}if(s=r.querySelectorAll('.pewc-item.required-field input[type="text"]'),f=r.querySelectorAll(".pewc-item select"),h=r.querySelectorAll(".pewc-item.required-field input.pewc_file_data"),!(0<s.length)){t.next=27;break}if(Array.from(s).every(function(t){return t.value})){t.next=27;break}return t.abrupt("return",!1);case 27:if(!(0<f.length)){t.next=31;break}if(Array.from(f).every(function(t){return t.value})){t.next=31;break}return t.abrupt("return",!1);case 31:if(!(0<h.length)){t.next=35;break}if(Array.from(h).every(function(t){return t.value})){t.next=35;break}return t.abrupt("return",!1);case 35:if(r)return l=r.querySelector('button[type="submit"]'),(p=!l.classList.contains("disabled"))||l.click(),t.abrupt("return",p);t.next=40;break;case 40:if(i)return(l=!i.classList.contains("product_type_variable"))||i.click(),t.abrupt("return",l);t.next=44;break;case 44:if(a)return(p=!a.classList.contains("outofstock"))||r.querySelector('a[data-product_id="'.concat(e,'"]')).click(),t.abrupt("return",p);t.next=48;break;case 48:case"end":return t.stop()}},t)}),(h=function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){f(n,e,r,o,i,"next",t)}function i(t){f(n,e,r,o,i,"throw",t)}o(void 0)})}).apply(this,arguments)}function I(t){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function T(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */T=function(){return a};var s,a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(s){f=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,a,u,e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype);return f(e,"_invoke",(o=t,i=r,a=new x(n||[]),u=1,function(t,e){if(3===u)throw Error("Generator is already running");if(4===u){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.i[n];if(o===s)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=h(o,e.i,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;o=n.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(1===u)throw u=4,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=3;r=h(o,i,a);if("normal"===r.type){if(u=a.done?4:2,r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(u=4,a.method="throw",a.arg=r.arg)}}),!0),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var l={};function p(){}function i(){}function y(){}var e={},d=(f(e,n,function(){return this}),Object.getPrototypeOf),d=d&&d(d(E([]))),v=(d&&d!==t&&c.call(d,n)&&(e=d),y.prototype=p.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function m(a,u){var e;f(this,"_invoke",function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=h(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==I(r)&&c.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()},!0)}function w(t){this.tryEntries.push(t)}function b(t){var e=t[4]||{};e.type="normal",e.arg=s,t[4]=e}function x(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0)}function E(e){if(null!=e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(c.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(I(e)+" is not iterable")}return f(v,"constructor",i.prototype=y),f(y,"constructor",i),i.displayName=f(y,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,o,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},g(m.prototype),f(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new m(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(v),f(v,o,"Generator"),f(v,n,function(){return this}),f(v,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.unshift(e);return function t(){for(;n.length;)if((e=n.pop())in r)return t.value=e,t.done=!1,t;return t.done=!0,t}},a.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t){i.type="throw",i.arg=e,r.next=t}for(var n=r.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o[4],a=this.prev,u=o[1],c=o[2];if(-1===o[0])return t("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=s,t(u),!0;if(a<c)return t(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(-1<n[0]&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]?null:o)?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o[0]===t)return"throw"===(r=o[4]).type&&(n=r.arg,b(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={i:E(t),r:e,n:r},"next"===this.method&&(this.arg=s),l}},a}function l(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}var p=null;function e(t){return r.apply(this,arguments)}function r(){var u;return u=T().mark(function t(e){var r,n;return T().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(p&&p.closest("#inpostpay-widget-popup"))return t.abrupt("return");t.next=2;break;case 2:return r=document.querySelector('.izi-widget-product[data-product-id="'.concat(e,'"]')),(r=null==r?void 0:r.getAttribute("data-alert-message"))||(n=document.querySelector("inpost-izi-button"),r=(null==n?void 0:n.getAttribute("data-alert-message"))||"An unknown error occurred."),t.prev=5,t.next=8,function(){return h.apply(this,arguments)}(e);case 8:if(t.sent){t.next=12;break}throw alert(r),new Error("UNDELIVERABLE_PRODUCT");case 12:return t.next=14,function(){return a.apply(this,arguments)}(e);case 14:return n=t.sent,t.abrupt("return",n);case 18:throw t.prev=18,t.t0=t.catch(5),t.t0;case 21:case"end":return t.stop()}},t,null,[[5,18]])}),(r=function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){l(n,e,r,o,i,"next",t)}function i(t){l(n,e,r,o,i,"throw",t)}o(void 0)})}).apply(this,arguments)}document.addEventListener("click",function(t){p=t.target});var y=function(){window.location.href=window.location.href};function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function N(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */N=function(){return a};var s,a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(s){f=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,a,u,e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype);return f(e,"_invoke",(o=t,i=r,a=new x(n||[]),u=1,function(t,e){if(3===u)throw Error("Generator is already running");if(4===u){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.i[n];if(o===s)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=h(o,e.i,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;o=n.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(1===u)throw u=4,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=3;r=h(o,i,a);if("normal"===r.type){if(u=a.done?4:2,r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(u=4,a.method="throw",a.arg=r.arg)}}),!0),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var l={};function p(){}function i(){}function y(){}var e={},d=(f(e,n,function(){return this}),Object.getPrototypeOf),d=d&&d(d(E([]))),v=(d&&d!==t&&c.call(d,n)&&(e=d),y.prototype=p.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function m(a,u){var e;f(this,"_invoke",function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=h(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==G(r)&&c.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()},!0)}function w(t){this.tryEntries.push(t)}function b(t){var e=t[4]||{};e.type="normal",e.arg=s,t[4]=e}function x(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0)}function E(e){if(null!=e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(c.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(G(e)+" is not iterable")}return f(v,"constructor",i.prototype=y),f(y,"constructor",i),i.displayName=f(y,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,o,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},g(m.prototype),f(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new m(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(v),f(v,o,"Generator"),f(v,n,function(){return this}),f(v,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.unshift(e);return function t(){for(;n.length;)if((e=n.pop())in r)return t.value=e,t.done=!1,t;return t.done=!0,t}},a.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t){i.type="throw",i.arg=e,r.next=t}for(var n=r.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o[4],a=this.prev,u=o[1],c=o[2];if(-1===o[0])return t("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=s,t(u),!0;if(a<c)return t(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(-1<n[0]&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]?null:o)?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o[0]===t)return"throw"===(r=o[4]).type&&(n=r.arg,b(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={i:E(t),r:e,n:r},"next"===this.method&&(this.arg=s),l}},a}function m(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function w(t){return b.apply(this,arguments)}function b(){var u;return u=N().mark(function t(e){var r,n;return N().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("orderCreated"===e)return window.location.href=InpostIziJavsscriptWoocommerce.thank_you_url,t.abrupt("return",Promise.resolve(!0));t.next=3;break;case 3:if("basketProductChanged"===e)return y(),t.abrupt("return",Promise.resolve(!0));t.next=6;break;case 6:if("basketDeleted"!==e){t.next=13;break}if(r=document.body.classList.contains("single-product"),n=document.querySelector(".izi-widget-product"),r||n){t.next=11;break}return t.abrupt("return");case 11:return y(),t.abrupt("return",Promise.resolve(!0));case 13:case"end":return t.stop()}},t)}),(b=function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){m(n,e,r,o,i,"next",t)}function i(t){m(n,e,r,o,i,"throw",t)}o(void 0)})}).apply(this,arguments)}function A(t){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function x(t,e){var r,n,o,i,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(a)return o=!(n=!0),{s:function(){a=a.call(t)},n:function(){var t=a.next();return n=t.done,t},e:function(t){o=!0,r=t},f:function(){try{n||null==a.return||a.return()}finally{if(o)throw r}}};if(Array.isArray(t)||(a=((t,e)=>{var r;if(t)return"string"==typeof t?E(t,e):"Map"===(r="Object"===(r={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(t,e):void 0})(t))||e&&t&&"number"==typeof t.length)return a&&(t=a),i=0,{s:e=function(){},n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function q(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */q=function(){return a};var s,a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(s){f=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,a,u,e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype);return f(e,"_invoke",(o=t,i=r,a=new x(n||[]),u=1,function(t,e){if(3===u)throw Error("Generator is already running");if(4===u){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.i[n];if(o===s)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=h(o,e.i,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;o=n.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(1===u)throw u=4,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=3;r=h(o,i,a);if("normal"===r.type){if(u=a.done?4:2,r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(u=4,a.method="throw",a.arg=r.arg)}}),!0),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var l={};function p(){}function i(){}function y(){}var e={},d=(f(e,n,function(){return this}),Object.getPrototypeOf),d=d&&d(d(E([]))),v=(d&&d!==t&&c.call(d,n)&&(e=d),y.prototype=p.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function m(a,u){var e;f(this,"_invoke",function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=h(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==A(r)&&c.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()},!0)}function w(t){this.tryEntries.push(t)}function b(t){var e=t[4]||{};e.type="normal",e.arg=s,t[4]=e}function x(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0)}function E(e){if(null!=e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(c.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(A(e)+" is not iterable")}return f(v,"constructor",i.prototype=y),f(y,"constructor",i),i.displayName=f(y,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,o,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},g(m.prototype),f(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new m(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(v),f(v,o,"Generator"),f(v,n,function(){return this}),f(v,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.unshift(e);return function t(){for(;n.length;)if((e=n.pop())in r)return t.value=e,t.done=!1,t;return t.done=!0,t}},a.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t){i.type="throw",i.arg=e,r.next=t}for(var n=r.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o[4],a=this.prev,u=o[1],c=o[2];if(-1===o[0])return t("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=s,t(u),!0;if(a<c)return t(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(-1<n[0]&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]?null:o)?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o[0]===t)return"throw"===(r=o[4]).type&&(n=r.arg,b(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={i:E(t),r:e,n:r},"next"===this.method&&(this.arg=s),l}},a}function J(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function M(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){J(n,e,r,o,i,"next",t)}function i(t){J(n,e,r,o,i,"throw",t)}o(void 0)})}}var u=!1,d=!1,Y=!1;function D(){return(D=M(q().mark(function t(){return q().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(document.body.classList.contains("woocommerce-cart")){t.next=3;break}return t.abrupt("return");case 3:jQuery(document.body).on("wc_fragments_refreshed",function(){var t=document.querySelector("#inpostpay-widget-popup");u||(d=!1,t)||d||g(30,250).then(function(){v()}).catch(function(){v()})}),Y||(Y=!0,document.addEventListener("click",(()=>{var e=M(q().mark(function t(e){var r,n;return q().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.target.closest("inpost-izi-button")){t.next=3;break}return t.abrupt("return");case 3:return u=!0,t.prev=4,t.next=7,g(8,250);case 7:return t.next=9,function(){var o=0<arguments.length&&void 0!==arguments[0]?arguments[0]:20,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:300;return new Promise(function(e,t){var r=0,n=setInterval(function(){var t=document.querySelector("#inpostpay-widget-popup"),t=null==t?void 0:t.shadowRoot,t=null==t?void 0:t.querySelector("#button-connect");t?(clearInterval(n),e(t)):++r>=o&&clearInterval(n)},i)})}();case 9:t.next=17;break;case 11:t.prev=11,t.t0=t.catch(4),r=document.querySelector("#inpostpay-widget-popup"),n=document.querySelector("inpost-izi-button"),!r&&!n&&v();case 17:case"end":return t.stop()}},t,null,[[4,11]])}));return function(t){return e.apply(this,arguments)}})()),jQuery(document.body).on("wc_fragments_refreshed",function(){u||v()}),new MutationObserver(function(t){var e,r=x(t);try{for(r.s();!(e=r.n()).done;)e.value.removedNodes.forEach(function(t){"inpostpay-widget-popup"===t.id&&(d=u=!1,document.body.classList.contains("woocommerce-cart")&&g(30,250).then(function(){v()}).catch(function(){v()}),document.querySelector("inpost-izi-button")||g(30,250).then(function(){v()}).catch(function(){v()}),setTimeout(function(){document.querySelector("#inpostpay-widget-popup")||d||v()},1e3))})}catch(t){r.e(t)}finally{r.f()}}).observe(document.body,{childList:!0,subtree:!0}));case 5:case"end":return t.stop()}},t)}))).apply(this,arguments)}function v(){var t=!!document.querySelector("#inpostpay-widget-popup"),e=document.querySelector("inpost-izi-button");t||d||e||(window.widget=InPostPayWidget.init(window.widgetOptions),o(),d=!0)}function g(t,e){var i=0<arguments.length&&void 0!==t?t:20,a=1<arguments.length&&void 0!==e?e:250;return new Promise(function(e,r){var n=0,o=setInterval(function(){var t=document.querySelector("#inpostpay-widget-popup");t?(clearInterval(o),e(t)):++n>=i&&(clearInterval(o),r(new Error("Popup nie pojawił się w czasie")))},a)})}function z(t){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function F(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */F=function(){return a};var s,a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(s){f=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,a,u,e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype);return f(e,"_invoke",(o=t,i=r,a=new x(n||[]),u=1,function(t,e){if(3===u)throw Error("Generator is already running");if(4===u){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.i[n];if(o===s)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=h(o,e.i,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;o=n.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(1===u)throw u=4,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=3;r=h(o,i,a);if("normal"===r.type){if(u=a.done?4:2,r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(u=4,a.method="throw",a.arg=r.arg)}}),!0),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var l={};function p(){}function i(){}function y(){}var e={},d=(f(e,n,function(){return this}),Object.getPrototypeOf),d=d&&d(d(E([]))),v=(d&&d!==t&&c.call(d,n)&&(e=d),y.prototype=p.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function m(a,u){var e;f(this,"_invoke",function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=h(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==z(r)&&c.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()},!0)}function w(t){this.tryEntries.push(t)}function b(t){var e=t[4]||{};e.type="normal",e.arg=s,t[4]=e}function x(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0)}function E(e){if(null!=e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(c.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(z(e)+" is not iterable")}return f(v,"constructor",i.prototype=y),f(y,"constructor",i),i.displayName=f(y,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,o,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},g(m.prototype),f(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new m(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(v),f(v,o,"Generator"),f(v,n,function(){return this}),f(v,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.unshift(e);return function t(){for(;n.length;)if((e=n.pop())in r)return t.value=e,t.done=!1,t;return t.done=!0,t}},a.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t){i.type="throw",i.arg=e,r.next=t}for(var n=r.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o[4],a=this.prev,u=o[1],c=o[2];if(-1===o[0])return t("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=s,t(u),!0;if(a<c)return t(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(-1<n[0]&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]?null:o)?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o[0]===t)return"throw"===(r=o[4]).type&&(n=r.arg,b(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={i:E(t),r:e,n:r},"next"===this.method&&(this.arg=s),l}},a}function K(t,e){var r,n,o,i,a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(a)return o=!(n=!0),{s:function(){a=a.call(t)},n:function(){var t=a.next();return n=t.done,t},e:function(t){o=!0,r=t},f:function(){try{n||null==a.return||a.return()}finally{if(o)throw r}}};if(Array.isArray(t)||(a=((t,e)=>{var r;if(t)return"string"==typeof t?U(t,e):"Map"===(r="Object"===(r={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?U(t,e):void 0})(t))||e&&t&&"number"==typeof t.length)return a&&(t=a),i=0,{s:e=function(){},n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function H(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Z(){var u;return u=F().mark(function t(){var e,r,n;return F().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=function(){return!!document.querySelector(".wp-block-woocommerce-empty-cart-block")||!!document.querySelector(".cart-empty")||(document.querySelector(".woocommerce-cart-form")||document.querySelector('form[action*="cart"]'),!1)},r=function(){var e,t=document.querySelectorAll('[data-from-elementor="1"]');0!==t.length&&(e=n(),t.forEach(function(t){"BASKET_SUMMARY"===t.getAttribute("binding_place")&&(t.style.display=e?"none":"block")}))},e=document.querySelector(".elementor-widget-container")){t.next=5;break}return t.abrupt("return");case 5:r(),jQuery(document.body).on("wc_fragments_refreshed",function(){r()}),jQuery(document.body).on("updated_cart_totals removed_from_cart added_to_cart",function(){r()}),new MutationObserver(function(t){var e,r=K(t);try{for(r.s();!(e=r.n()).done;)e.value.addedNodes.forEach(function(t){var e;"INPOST-IZI-BUTTON"===t.nodeName&&(e=document.querySelector(".woocommerce-cart-form"),t.style.display=e?"block":"none")})}catch(t){r.e(t)}finally{r.f()}}).observe(e,{childList:!0,subtree:!0});case 10:case"end":return t.stop()}},t)}),(Z=function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){H(n,e,r,o,i,"next",t)}function i(t){H(n,e,r,o,i,"throw",t)}o(void 0)})}).apply(this,arguments)}function L(t){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function B(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */B=function(){return a};var s,a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(s){f=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,a,u,e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype);return f(e,"_invoke",(o=t,i=r,a=new x(n||[]),u=1,function(t,e){if(3===u)throw Error("Generator is already running");if(4===u){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.i[n];if(o===s)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=h(o,e.i,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;o=n.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(1===u)throw u=4,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=3;r=h(o,i,a);if("normal"===r.type){if(u=a.done?4:2,r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(u=4,a.method="throw",a.arg=r.arg)}}),!0),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var l={};function p(){}function i(){}function y(){}var e={},d=(f(e,n,function(){return this}),Object.getPrototypeOf),d=d&&d(d(E([]))),v=(d&&d!==t&&c.call(d,n)&&(e=d),y.prototype=p.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function m(a,u){var e;f(this,"_invoke",function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=h(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==L(r)&&c.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()},!0)}function w(t){this.tryEntries.push(t)}function b(t){var e=t[4]||{};e.type="normal",e.arg=s,t[4]=e}function x(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0)}function E(e){if(null!=e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(c.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(L(e)+" is not iterable")}return f(v,"constructor",i.prototype=y),f(y,"constructor",i),i.displayName=f(y,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,o,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},g(m.prototype),f(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new m(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(v),f(v,o,"Generator"),f(v,n,function(){return this}),f(v,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.unshift(e);return function t(){for(;n.length;)if((e=n.pop())in r)return t.value=e,t.done=!1,t;return t.done=!0,t}},a.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t){i.type="throw",i.arg=e,r.next=t}for(var n=r.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o[4],a=this.prev,u=o[1],c=o[2];if(-1===o[0])return t("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=s,t(u),!0;if(a<c)return t(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(-1<n[0]&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]?null:o)?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o[0]===t)return"throw"===(r=o[4]).type&&(n=r.arg,b(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={i:E(t),r:e,n:r},"next"===this.method&&(this.arg=s),l}},a}function $(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function V(){var u;return u=B().mark(function t(){var e,r,n,o,i,a;return B().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=document.querySelector(".izi-widget-product"),e=document.querySelector("inpost-izi-button"),i||e){t.next=4;break}return t.abrupt("return");case 4:n=r=!1,o=null,i=function(t){null!=t&&null!=(t=t.shadowRoot)&&t.querySelector(".count-badge")&&y()},a=function(t){o&&o.disconnect(),(o=new MutationObserver(function(t){t.forEach(function(t){t.addedNodes.forEach(function(t){t.nodeType===Node.ELEMENT_NODE&&(t.querySelector&&t.querySelector(".count-badge")&&(r=!1,y()),t.classList.contains("product-count"))&&t.querySelector(".count-badge")&&(r=!1,y())}),"attributes"===t.type&&t.target.classList.contains("product-count")&&t.target.querySelector(".count-badge")&&(r=!1,y())})})).observe(t,{childList:!0,subtree:!0,attributes:!0})},jQuery(document.body).on("added_to_cart",function(){r=!0;var t,e=document.querySelector("inpost-izi-button");e.shadowRoot&&(null!=e&&null!=(t=e.shadowRoot)&&t.querySelector(".count-badge")?(r=!1,y()):a(e.shadowRoot))}),new MutationObserver(function(t){t.forEach(function(t){t.addedNodes.forEach(function(t){"inpostpay-widget-popup"===t.id&&(t=document.querySelector("#inpostpay-widget-popup").shadowRoot,a(t),t.addEventListener("click",function(t){n="button-unpair"===t.target.id}))}),t.removedNodes.forEach(function(t){"inpostpay-widget-popup"===t.id&&r&&!n&&(r=!1,y())})})}).observe(document.body,{childList:!0,subtree:!0}),i(e);case 13:case"end":return t.stop()}},t)}),(V=function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){$(n,e,r,o,i,"next",t)}function i(t){$(n,e,r,o,i,"throw",t)}o(void 0)})}).apply(this,arguments)}function X(t){return(X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function R(t){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */W=function(){return a};var s,a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(s){f=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,a,u,e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype);return f(e,"_invoke",(o=t,i=r,a=new x(n||[]),u=1,function(t,e){if(3===u)throw Error("Generator is already running");if(4===u){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.i[n];if(o===s)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=h(o,e.i,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;o=n.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(1===u)throw u=4,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=3;r=h(o,i,a);if("normal"===r.type){if(u=a.done?4:2,r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(u=4,a.method="throw",a.arg=r.arg)}}),!0),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var l={};function p(){}function i(){}function y(){}var e={},d=(f(e,n,function(){return this}),Object.getPrototypeOf),d=d&&d(d(E([]))),v=(d&&d!==t&&c.call(d,n)&&(e=d),y.prototype=p.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function m(a,u){var e;f(this,"_invoke",function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=h(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==R(r)&&c.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()},!0)}function w(t){this.tryEntries.push(t)}function b(t){var e=t[4]||{};e.type="normal",e.arg=s,t[4]=e}function x(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0)}function E(e){if(null!=e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(c.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(R(e)+" is not iterable")}return f(v,"constructor",i.prototype=y),f(y,"constructor",i),i.displayName=f(y,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,o,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},g(m.prototype),f(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new m(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(v),f(v,o,"Generator"),f(v,n,function(){return this}),f(v,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.unshift(e);return function t(){for(;n.length;)if((e=n.pop())in r)return t.value=e,t.done=!1,t;return t.done=!0,t}},a.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t){i.type="throw",i.arg=e,r.next=t}for(var n=r.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o[4],a=this.prev,u=o[1],c=o[2];if(-1===o[0])return t("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=s,t(u),!0;if(a<c)return t(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(-1<n[0]&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]?null:o)?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o[0]===t)return"throw"===(r=o[4]).type&&(n=r.arg,b(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={i:E(t),r:e,n:r},"next"===this.method&&(this.arg=s),l}},a}function tt(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function et(){var u;return u=W().mark(function t(){var e;return W().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("/?wc-ajax=inpost_pay_bind",{method:"GET"});case 3:if((e=t.sent).ok){t.next=6;break}throw new Error("Błąd sieci: ".concat(e.status));case 6:t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),console.error("Wystąpił błąd:",t.t0);case 11:case"end":return t.stop()}},t,null,[[0,8]])}),(et=function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){tt(n,e,r,o,i,"next",t)}function i(t){tt(n,e,r,o,i,"throw",t)}o(void 0)})}).apply(this,arguments)}function C(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */C=function(){return a};var s,a={},t=Object.prototype,c=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",r=e.asyncIterator||"@@asyncIterator",o=e.toStringTag||"@@toStringTag";function f(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{f({},"")}catch(s){f=function(t,e,r){return t[e]=r}}function u(t,e,r,n){var o,i,a,u,e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype);return f(e,"_invoke",(o=t,i=r,a=new x(n||[]),u=1,function(t,e){if(3===u)throw Error("Generator is already running");if(4===u){if("throw"===t)throw e;return{value:s,done:!0}}for(a.method=t,a.arg=e;;){var r=a.delegate;if(r){r=function t(e,r){var n=r.method,o=e.i[n];if(o===s)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=s,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),l;n=h(o,e.i,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,l;o=n.arg;return o?o.done?(r[e.r]=o.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=s),r.delegate=null,l):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,l)}(r,a);if(r){if(r===l)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(1===u)throw u=4,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);u=3;r=h(o,i,a);if("normal"===r.type){if(u=a.done?4:2,r.arg===l)continue;return{value:r.arg,done:a.done}}"throw"===r.type&&(u=4,a.method="throw",a.arg=r.arg)}}),!0),e}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var l={};function p(){}function i(){}function y(){}var e={},d=(f(e,n,function(){return this}),Object.getPrototypeOf),d=d&&d(d(E([]))),v=(d&&d!==t&&c.call(d,n)&&(e=d),y.prototype=p.prototype=Object.create(e));function g(t){["next","throw","return"].forEach(function(e){f(t,e,function(t){return this._invoke(e,t)})})}function m(a,u){var e;f(this,"_invoke",function(r,n){function t(){return new u(function(t,e){!function e(t,r,n,o){var i,t=h(a[t],a,r);if("throw"!==t.type)return(r=(i=t.arg).value)&&"object"==Q(r)&&c.call(r,"__await")?u.resolve(r.__await).then(function(t){e("next",t,n,o)},function(t){e("throw",t,n,o)}):u.resolve(r).then(function(t){i.value=t,n(i)},function(t){return e("throw",t,n,o)});o(t.arg)}(r,n,t,e)})}return e=e?e.then(t,t):t()},!0)}function w(t){this.tryEntries.push(t)}function b(t){var e=t[4]||{};e.type="normal",e.arg=s,t[4]=e}function x(t){this.tryEntries=[[-1]],t.forEach(w,this),this.reset(!0)}function E(e){if(null!=e){var r,t=e[n];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return r=-1,(t=function t(){for(;++r<e.length;)if(c.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=s,t.done=!0,t}).next=t}throw new TypeError(Q(e)+" is not iterable")}return f(v,"constructor",i.prototype=y),f(y,"constructor",i),i.displayName=f(y,o,"GeneratorFunction"),a.isGeneratorFunction=function(t){t="function"==typeof t&&t.constructor;return!!t&&(t===i||"GeneratorFunction"===(t.displayName||t.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,f(t,o,"GeneratorFunction")),t.prototype=Object.create(v),t},a.awrap=function(t){return{__await:t}},g(m.prototype),f(m.prototype,r,function(){return this}),a.AsyncIterator=m,a.async=function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new m(u(t,e,r,n),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},g(v),f(v,o,"Generator"),f(v,n,function(){return this}),f(v,"toString",function(){return"[object Generator]"}),a.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.unshift(e);return function t(){for(;n.length;)if((e=n.pop())in r)return t.value=e,t.done=!1,t;return t.done=!0,t}},a.values=E,x.prototype={constructor:x,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&c.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function t(t){i.type="throw",i.arg=e,r.next=t}for(var n=r.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n],i=o[4],a=this.prev,u=o[1],c=o[2];if(-1===o[0])return t("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=a){if(a<u)return this.method="next",this.arg=s,t(u),!0;if(a<c)return t(c),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(-1<n[0]&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}var i=(o=o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]?null:o)?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],l):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),b(r),l}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o[0]===t)return"throw"===(r=o[4]).type&&(n=r.arg,b(o)),n}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={i:E(t),r:e,n:r},"next"===this.method&&(this.arg=s),l}},a}function rt(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function nt(u){return function(){var t=this,a=arguments;return new Promise(function(e,r){var n=u.apply(t,a);function o(t){rt(n,e,r,o,i,"next",t)}function i(t){rt(n,e,r,o,i,"throw",t)}o(void 0)})}}function Q(t){return(Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}"object"===("undefined"==typeof InpostIziJavsscriptWoocommerce?"undefined":Q(InpostIziJavsscriptWoocommerce))&&(window.addEventListener("load",nt(C().mark(function t(){var r,n;return C().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=void 0,n=null==(e=document.cookie.split("; ").find(function(t){return t.startsWith("basket_binding_api_key=")}))?void 0:e.split("=")[1],widgetOptions&&"string"==typeof n&&""!==n.trim()&&"undefined"!==n?(widgetOptions.basketBindingApiKey=n.trim(),t.next=17):t.next=5;break;case 5:if(widgetOptions)return t.prev=6,t.next=9,fetch(InpostIziJavsscriptWoocommerce.basket_binding_api_key.toString(),{method:"GET",headers:{"Content-Type":"application/json"}});t.next=17;break;case 9:return n=t.sent,t.next=12,n.json().then(function(t){widgetOptions.basketBindingApiKey=t.basket_binding_api_key});case 12:t.next=17;break;case 14:throw t.prev=14,t.t0=t.catch(6),new Error("cd2e2b76-e91f-4836-96db-0a35855544a2");case 17:window.widget=InPostPayWidget.init(widgetOptions),o(),(()=>{var o;document.querySelectorAll(".izi-widget-placeholder").length&&"object"===("undefined"==typeof InpostIziJavsscriptWoocommerce?"undefined":X(InpostIziJavsscriptWoocommerce))&&(o=(()=>{try{return{gclid:localStorage.getItem("gclid")||null,fbclid:localStorage.getItem("fbclid")||null,client_id:localStorage.getItem("client_id")||null}}catch(t){return console.error("Błąd przy odczycie identyfikatorów z localStorage:",t),{gclid:null,fbclid:null,client_id:null}}})(),document.querySelectorAll("form").forEach(function(n){n.querySelector('button[type="submit"], input[type="submit"]')&&["gclid","fbclid","client_id"].forEach(function(t){var e,r=o[t];r&&!n.querySelector('[name="inpostpay_'.concat(t,'"]'))&&((e=document.createElement("input")).type="hidden",e.name="inpostpay_".concat(t),e.value=r,n.appendChild(e))})}))})(),(()=>{var e=!1,r=null;function n(){var t=document.querySelector("inpost-izi-button");t&&t.shadowRoot?(t=t.shadowRoot.querySelector(".count-badge"))&&!e?(e=!0,function(){et.apply(this,arguments)}()):t||(e=e&&!1):e=!1}new MutationObserver(function(){var t=document.querySelector("inpost-izi-button");t&&t.shadowRoot?(r||(r=new MutationObserver(n)).observe(t.shadowRoot,{childList:!0,subtree:!0}),n()):(r&&(r.disconnect(),r=null),e=!1)}).observe(document.body,{childList:!0,subtree:!0}),setInterval(n,200)})(),(t=>{var e,r;t&&(e=0,r=setInterval(function(){var t=document.querySelectorAll("inpost-izi-button");0<t.length?(clearInterval(r),t.forEach(function(e){var r=0,n=setInterval(function(){var t;e.shadowRoot?(clearInterval(n),(t=e.shadowRoot.querySelector(".button"))&&(e.setAttribute("data-currency-processed","1"),t.click(),console.log("BUTTON CLICKED"))):30<=++r&&clearInterval(n)},200)})):30<=++e&&clearInterval(r)},300))})(Boolean(null==(r=window.InpostIziJavsscriptWoocommerce)?void 0:r.currency_restored));case 23:case"end":return t.stop()}var e},t,null,[[6,14]])}))),document.addEventListener("DOMContentLoaded",function(){widgetOptions.unboundWidgetClicked=e,widgetOptions.handleBasketEvent=w,function(){D.apply(this,arguments)}(),function(){Z.apply(this,arguments)}(),function(){V.apply(this,arguments)}()},!1))})();