1if (window.Feature.isActive("v6.7.0.0")) { 2(()=>{var t={156:t=>{"use strict";var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==n},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(t,e){return!1!==e.clone&&e.isMergeableObject(t)?s(Array.isArray(t)?[]:{},t,e):t}function o(t,e,n){return t.concat(e).map(function(t){return r(t,n)})}function i(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function a(t,e){try{return e in t}catch(t){return!1}}function s(t,n,c){(c=c||{}).arrayMerge=c.arrayMerge||o,c.isMergeableObject=c.isMergeableObject||e,c.cloneUnlessOtherwiseSpecified=r;var l,p,u=Array.isArray(n);return u!==Array.isArray(t)?r(n,c):u?c.arrayMerge(t,n,c):(p={},(l=c).isMergeableObject(t)&&i(t).forEach(function(e){p[e]=r(t[e],l)}),i(n).forEach(function(e){(!a(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(a(t,e)&&l.isMergeableObject(n[e])?p[e]=(function(t,e){if(!e.customMerge)return s;var n=e.customMerge(t);return"function"==typeof n?n:s})(e,l)(t[e],n[e],l):p[e]=r(n[e],l))}),p)}s.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,n){return s(t,n,e)},{})},t.exports=s},960:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function p(t,n,r,i){var a,s,c=Object.create((n&&n.prototype instanceof y?n:y).prototype);return o(c,"_invoke",{value:(a=new O(i||[]),s=d,function(n,o){if(s===h)throw Error("Generator is already running");if(s===m){if("throw"===n)throw o;return C()}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var c=function t(n,r){var o=r.method,i=n.iterator[o];if(e===i)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),f;var a=u(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,f;var s=a.arg;return s?s.done?(r[n.resultName]=s.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,f):s:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,f)}(i,a);if(c){if(c===f)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===d)throw s=m,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=h;var l=u(t,r,a);if("normal"===l.type){if(s=a.done?m:"suspendedYield",l.arg===f)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(s=m,a.method="throw",a.arg=l.arg)}})}),c}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=p;var d="suspendedStart",h="executing",m="completed",f={};function y(){}function g(){}function v(){}var b={};l(b,a,function(){return this});var w=Object.getPrototypeOf,x=w&&w(w(_([])));x&&x!==n&&r.call(x,a)&&(b=x);var S=v.prototype=y.prototype=Object.create(b);function L(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){var n;o(this,"_invoke",{value:function(o,i){function a(){return new e(function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"===c.type)s(c.arg);else{var l=c.arg,p=l.value;return p&&"object"==typeof p&&r.call(p,"__await")?e.resolve(p.__await).then(function(t){n("next",t,a,s)},function(t){n("throw",t,a,s)}):e.resolve(p).then(function(t){l.value=t,a(l)},function(t){return n("throw",t,a,s)})}}(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function _(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:C}}function C(){return{value:e,done:!0}}return g.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:g,configurable:!0}),g.displayName=l(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},t.awrap=function(t){return{__await:t}},L(E.prototype),l(E.prototype,s,function(){return this}),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Prom
vendor: 6,566 bytes, line 2
2ise);var a=new E(p(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(t){return t.done?t.value:a.next()})},L(S),l(S,c,"Generator"),l(S,a,function(){return this}),l(S,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=_,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else if(l){if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else throw Error("try statement without catch or finally")}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return(a.type=t,a.arg=e,i)?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},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),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),f}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},882:t=>{var e=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function p(t,n,r,i){var a,s,c=Object.create((n&&n.prototype instanceof y?n:y).prototype);return o(c,"_invoke",{value:(a=new O(i||[]),s=d,function(n,o){if(s===h)throw Error("Generator is already running");if(s===m){if("throw"===n)throw o;return C()}for(a.method=n,a.arg=o;;){var i=a.delegate;if(i){var c=function t(n,r){var o=r.method,i=n.iterator[o];if(i===e)return r.delegate=null,"throw"===o&&n.iterator.return&&(r.method="return",r.arg=e,t(n,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+o+"' method")),f;var a=u(i,n.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,f;var s=a.arg;return s?s.done?(r[n.resultName]=s.value,r.next=n.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,f):s:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,f)}(i,a);if(c){if(c===f)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===d)throw s=m,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=h;var l=u(t,r,a);if("normal"===l.type){if(s=a.done?m:"suspendedYield",l.arg===f)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(s=m,a.method="throw",a.arg=l.arg)}})}),c}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=p;var d="suspendedStart",h="executing",m="completed",f={};function y(){}function g(){}function v(){}var b={};l(b,a,function(){return this});var w=Object.getPrototypeOf,x=w&&w(w(_([])));x&&x!==n&&r.call(x,a)&&(b=x);var S=v.prototype=y.prototype=Object.create(b);function L(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){var n;o(this,"_invoke",{value:function(o,i){function a(){return new e(function(n,a){!function n(o,i,a,s){var c=u(t[o],t,i);if("throw"!==c.type){var l=c.arg,p=l.value;return p&&"object"==typeof p&&r.call(p,"__await")?e.resolve(p.__await).then(function(t){n("next",t,a,s)},function(t){n("throw",t,a,s)}):e.resolve(p).then(function(t){l.value=t,a(l)},function(t){return n("throw",t,a,s)})}s(c.arg)}(o,i,n,a)})}return n=n?n.then(a,a):a()}})}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function _(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}return{next:C}}function C(){return{value:e,done:!0}}return g.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:g,configurable:!0}),g.displayName=l(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},t.awrap=function(t){return{__await:t}},L(E.prototype),l(E.prototype,s,function(){return this}),t.AsyncIterator=E,t.async=function(e,n,r,o,i){void 0===i&&(i=Prom
2ise);var a=new E(p(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then(function(t){return t.done?t.value:a.next()})},L(S),l(S,c,"Generator"),l(S,a,function(){return this}),l(S,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=_,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return s.type="throw",s.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},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),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),f}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=n(156),e=n.n(t);class r{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let n=r.toUpperCamelCase(t,e);return r.lcFirst(n)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>r.ucFirst(t.toLowerCase())).join(""):r.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class o{constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new CustomEvent(t,{detail:e,cancelable:n});return this.el.dispatchEvent(r),r}subscribe(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this,o=t.split("."),i=n.scope?e.bind(n.scope):e;if(n.once&&!0===n.once){let e=i;i=function(n){r.unsubscribe(t),e(n)}}return this.el.addEventListener(o[0],i),this.listeners.push({splitEventName:o,opts:n,cb:i}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,n)=>([...n.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(n.splitEventName[0],n.cb):t.push(n),t),[]),!0}
2reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}}class i{constructor(t,e={},n=!1){if(!(t instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${n}".`);return}this.el=t,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(n),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let n=[this.constructor.options,this.options,t];return n.push(this._getConfigFromDataAttribute()),n.push(this._getOptionsFromDataAttribute()),e().all(n.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_getConfigFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=r.toDashCase(this._pluginName),n=this.el.getAttribute(`data-${e}-config`);return n?window.PluginConfigManager.get(this._pluginName,n):t}_getOptionsFromDataAttribute(){let t={};if("function"!=typeof this.el.getAttribute)return t;let e=r.toDashCase(this._pluginName),n=this.el.getAttribute(`data-${e}-options`);if(n)try{return JSON.parse(n)}catch(t){console.error(`The data attribute "data-${e}-options" could not be parsed to json: ${t.message}`)}return t}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}}class a{static #t=this.appearance={rules:{".AccordionItem":{borderColor:"#fff",boxShadow:"false"},".AccordionItem--selected":{borderColor:"#fff",boxShadow:"false"}}}}try{n(960)}catch(t){n(882)}class s extends i{static #t=this.options={context:null,page:null,appShopId:null,stripePaymentMethodId:null,locale:null,appUrl:null,appVersion:null};static #e=this.layouts={tabs:{type:"tabs",defaultCollapsed:!1},accordion:{type:"accordion",defaultCollapsed:!1,radios:!1,spacedAccordionItems:!0,visibleAccordionItemsCount:0},radio:{type:"accordion",defaultCollapsed:!1,radios:!0,spacedAccordionItems:!0,visibleAccordionItemsCount:0}};init(){let t,e,n,r;if(s.options=JSON.parse(this.el.dataset.stripePaymentsAppOptions),!s.options.stripePaymentMethodId){console.warn("Stripe payment method is not enabled. Please enable in Settings -> Shop -> Payment methods -> Pay online | Stripe -> Activate."),console.warn("Stripe payment method is not enabled. Please enable in Settings -> Shop -> Payment methods -> Pay online | Stripe -> Edit details -> Allow payment change after checkout.");return}let o=s.options.appShopId.match(/.{1,2}/g),i="ePiRtSeRaWpOhS".match(/.{1,1}/g),c="",l=0,p=0;for(let t=0;t<10;t++)void 0!==o[t]?c+=o[t]:(c+=o[l],l++),void 0!==i[t]?c+=i[t]:(c+=i[p],p++);let u=c,d=!1,h=!1,m=!1,f=()=>void 0!==s.options.page.cart&&s.options.page.cart&&s.options.page.cart.price?s.options.page.cart.price.totalPrice:void 0!==s.options.page.order&&s.options.page.order&&s.options.page.order.price?s.options.page.order.price.totalPrice:0,y=function(){let t=sessionStorage.getItem("stripeCurrentTotal");if(sessionStorage.removeItem("stripeCurrentTotal"),null!==t){let e=parseFloat(t);if(!isNaN(e)&&e>0)return e}return f()}();function g(t,e,n){let r=t+"="+encodeURIComponent(e);"number"==typeof n&&(r+="; max-age="+86400*n,document.cookie=r)}function v(t){let e=document.cookie.split(";");for(let n=0;n<e.length;n++){let r=e[n].split("=");if(t===r[0].trim())return decodeURIComponent(r[1])}return null}function b(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"warning",n=document.querySelector("#stripe-checkout-validation-message"),r=document.querySelector("#confirmOrderForm");r&&(n||((n=document.createElement("div")).id="stripe-checkout-validation-message",n.style.marginBottom="15px",r.prepend(n)),n.className="danger"===e?"alert alert-danger":"alert alert-warning",n.textContent=t,n.scrollIntoView({behavior:"smooth",block:"center"}))}function w(){let t=document.querySelector("#stripe-checkout-validation-message");t&&t.remove()}async function x(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(h)return{ok:!0,cartChanged:!1};h=!0;try{let e=await fetch(s.options.appUrl+"/checkout/cart-validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:s.options.appShopId,salesChannelId:s.options.context.salesChannel.i
2d,currencyIso:s.options.context.currency.isoCode,checkoutPageTotal:y,contextToken:s.options.context.token||null,customerId:s.options.context.customer&&s.options.context.customer.id?s.options.context.customer.id:null,paymentMethodId:s.options.context.paymentMethod&&s.options.context.paymentMethod.id?s.options.context.paymentMethod.id:null,appVersion:s.options.appVersion,locale:s.options.locale||null})}),n=await e.json();if(!n||void 0===n.ok)return t?b(n.message||"We could not verify your cart. Please refresh the page and try again.","danger"):w(),{ok:!1,cartChanged:!1};if(!1===n.ok)return b(n.message||"We could not verify your cart. Please refresh the page and try again.","danger"),n;if(n.cartChanged){if(void 0!==s.options.page.order&&s.options.page.order)return void 0!==n.currentTotal&&null!==n.currentTotal&&n.currentTotal>0&&(y=n.currentTotal),w(),{ok:!0,cartChanged:!1};let t=n.message||"Your cart has been updated. Please review the new total before placing your order.";return sessionStorage.setItem("stripeCheckoutValidationMessage",t),sessionStorage.setItem("stripeCheckoutValidationLevel","warning"),void 0!==n.currentTotal&&null!==n.currentTotal&&sessionStorage.setItem("stripeCurrentTotal",n.currentTotal),window.location.reload(),{ok:!1,cartChanged:!0,currentTotal:n.currentTotal,message:t}}return void 0!==n.currentTotal&&null!==n.currentTotal&&(y=n.currentTotal),w(),n}catch(t){return console.error("Cart validation failed",t),b("We could not verify your cart. Please refresh the page and try again.","danger"),{ok:!1,cartChanged:!1,validationFailed:!0,message:"We could not verify your cart. Please refresh the page and try again."}}finally{h=!1}}g("sw.pm",!0,1);let S=document.querySelector("#paymentMethod"+s.options.stripePaymentMethodId);S&&S.checked&&(d=!0,g("sw.pm",!1,1)),function(){let t=sessionStorage.getItem("stripeCheckoutValidationMessage"),e=sessionStorage.getItem("stripeCheckoutValidationLevel");t&&window.setTimeout(()=>{b(t,e||"warning")},100),sessionStorage.removeItem("stripeCheckoutValidationMessage"),sessionStorage.removeItem("stripeCheckoutValidationLevel")}();let L=I();async function E(){if(n=await fetch(s.options.appUrl+"/auth/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:s.options.appShopId,token:u,appVersion:s.options.appVersion})}).then(t=>t.json()),!(r=await fetch(s.options.appUrl+"/shop/configuration",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:s.options.appShopId,salesChannelId:s.options.context.salesChannel.id,token:n.token,appVersion:s.options.appVersion})}).then(t=>t.json()).catch(()=>null))||!1===r.success||!1===r.stripeEnabled||!r.key){console.warn("Stripe Payments disabled by backend:",r&&(r.reason||r.error)||"no configuration returned"),(r=r||{}).paymentElements=!1,r.stripeEnabled=!1;let t=document.querySelector("#paymentMethod"+s.options.stripePaymentMethodId),e=document.querySelector('label[for="paymentMethod'+s.options.stripePaymentMethodId+'"]'),n=e?e.closest(".payment-method-radio"):null;if(t&&(t.checked=!1,t.disabled=!0),n?n.setAttribute("style","display:none"):e&&e.setAttribute("style","display:none"),d=!1,g("sw.pm",!0,1),!document.querySelector('input[name="paymentMethodId"]:checked:not(#paymentMethod'+s.options.stripePaymentMethodId+")")){let t=document.querySelector('input[name="paymentMethodId"]:not(#paymentMethod'+s.options.stripePaymentMethodId+"):not([disabled])");t&&(t.checked=!0,t.dispatchEvent(new Event("change",{bubbles:!0})))}return}if(r.paymentElements){let t='label[for="paymentMethod'+s.options.stripePaymentMethodId+'"]',e=document.querySelector(t);if(e){let t=e.querySelector("p");t&&t.setAttribute("style","display:none;")}}}async function I(){if(await E(),r&&!1!==r.stripeEnabled&&r.paymentElements&&r.key&&r.paymentElements){let n;e=Stripe(r.key);let o=await fetch(s.options.appUrl+"/create-elements",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:s.options.appShopId,currencyIso:s.options.context.currency.isoCode,amount:y,appVersion:s.options.appVersion,customerId:s.options.context.customer.id,salesChannelId:s.options.context.salesChannel.i
2d})}).then(t=>t.json()).catch(()=>null);if(!o||!o.element){console.warn("Stripe Payments: /create-elements returned no payload, aborting init.");return}let i=o.element.theme?o.element.theme:void 0!==a.appearance.theme?a.appearance.theme:"stripe";a.appearance.theme=i;let c={mode:o.element.mode,amount:o.element.amount,capture_method:"automatic",currency:o.element.currency.toLowerCase(),appearance:a.appearance,paymentMethodCreation:"manual",locale:s.options.locale,customerSessionClientSecret:o.customerSessionClientSecret};t=e.elements(c);let l=o.element.layout;r.position=r.position?r.position:"middle";let p='label[for="paymentMethod'+s.options.stripePaymentMethodId+'"]',u="",h='<form id="stripe-payment-form"><div id="stripe-payment-element" style="padding-bottom: 15px; formStyle">\x3c!--Stripe.js injects the Payment Element--\x3e</div></form>';"radio"===l&&"bottom"!==r.position?(u="margin-left: -17px",h=h.replace("formStyle",u)):"radio"===l&&"bottom"===r.position?(u="margin-left: -17px; margin-top: -25px",h=h.replace("formStyle",u)):"bottom"===r.position&&(u="margin-top: -25px",h=h.replace("formStyle",u));let m=document.querySelector(p).closest(".payment-methods"),f=document.querySelector(p).closest(".payment-method-radio");if("top"===r.position&&m&&f)m.insertAdjacentHTML("beforebegin",h),f.setAttribute("style","display:none");else if("middle"===r.position){let t=document.querySelector(p);t&&(t.innerHTML+=h)}else"bottom"===r.position&&m&&f&&(m.insertAdjacentHTML("afterend",h),f.setAttribute("style","display:none"));d||(s.layouts[l].defaultCollapsed=!0),n=s.layouts[l];let b={defaultValues:{billingDetails:{address:{country:s.options.context.shippingLocation.country.iso,postal_code:s.options.context.shippingLocation.address.zipcode},email:s.options.context.customer.email,name:s.options.context.customer.firstName+" "+s.options.context.customer.lastName}},layout:n},w=v("stripe.payment-method");w&&(b.paymentMethodOrder=[w]);let x=t.create("payment",b);x.mount("#stripe-payment-element"),d||"middle"!==r.position||x.unmount();let S=!1,L=!1;x.on("ready",function(){S=!0}),x.on("change",function(t){g("stripe.payment-method",t.value.type,1);let e=v("sw.pm");if(!e||"true"!==e||t.collapsed||L)g("sw.pm",!1,1),e="false";else{f&&f.setAttribute("style","display:block");let t=document.querySelector("#stripe-payment-element");t&&t.remove()}L=t.collapsed;let n=document.querySelector("#paymentMethod"+s.options.stripePaymentMethodId);if(n&&!n.checked&&S&&!t.collapsed&&e&&"false"===e){let t=document.querySelector("#stripe-payment-element");t&&t.remove(),n.click()}})}}E(),document.querySelectorAll('input[name="paymentMethodId"]').forEach(function(t){t.addEventListener("change",function(){this.id==="paymentMethod"+s.options.stripePaymentMethodId&&this.checked?(d=!0,g("sw.pm",!1,1)):(d=!1,g("sw.pm",!0,1))})});let P=document.querySelector("#confirmOrderForm button"),O=document.querySelector("#confirmOrderForm");if(P&&P.addEventListener("click",_),O){O.addEventListener("submit",_);let t=O.submit;O.submit=async function(){let e=document.querySelector("#paymentMethod"+s.options.stripePaymentMethodId);e&&e.checked&&!m?await _(new Event("submit")):t.call(O)}}async function _(n){if(m)return;let o=document.querySelector("#paymentMethod"+s.options.stripePaymentMethodId);if(!o||!o.checked||r&&!1===r.stripeEnabled)return;n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation();let i=document.querySelector("#confirmOrderForm button");i&&i.setAttribute("disabled","disabled");try{await L}catch(t){}if(!r){i&&i.removeAttribute("disabled"),b("Payment could not be initialized. Please refresh the page and try again.","danger");return}if(void 0!==t&&t&&r.paymentElements)try{let{error:e}=await t.submit();if(e){i&&i.removeAttribute("disabled");let t=document.querySelector("#stripe-payment-element");t&&t.scrollIntoView();return}}catch(t){i&&i.removeAttribute("disabled"),b("Payment form is not ready yet. Please wait a moment and try again.","warning");return}let a=document.querySelector("#tos");if(a&&!a.checked){i&&i.removeAttribute("disabled"),a.classList.add("is-invalid"),a.scrollIntoView();return}let c=await x(!0);if(!c.ok||c.cartChanged){i&&i.removeAttribute("disabled");return}if(r.paymentElements){let n,r;if(!1===await C()){i&&i.removeAttribute("disabled");return}let o=await fetch(s.options.appUrl+"/create-billing-details",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:s.options.appShopId,countryIso:s.options.context.shippingLocation.country.iso,countryName:s.options.context.shippingLocation.country.name,firstName:s.options.context.shippingLocation.address.firstName,lastName:s.options.context.shippingLocation.address.lastName,zipCode:s.options.context.shippingLocation.address.zipcode,city:s.options.context.shippingLocation.address.city,street:s.options.context.shippingLocation.address.street,state:null!==s.options.context.shippingLocation.state?s.options.context.shippingLocation.state.name:null,email:s.options.context.customer.email,appVersion:s.options.appVersion})}).then(t=>t.json());if(-1!==function(t,e){let n=t.split(".").map(Number),r=e.split(".").map(Number),o=Math.max(n.length,r.length);for(let t=0;t<o;t++){let e=t<n.length?n[t]:0,o=t<r.length?r[t]:0;if(e>o)return 1;if(o>e)return -1}return 0}(s.options.appVersion,"1.5.0")){let r=await e.createConfirmationToken({elements:t,params:o.payment_method_data});n=r.confirmationToken&&r.confirmationToken.id?r.confirmationToken.id:null}else{let n=await e.createPaymentMethod({elements:t,params:o.cardPayment.payment_method});r=n.paymentMethod&&n.paymentMethod.id?n.paymentMethod.id:null}(r||n)&&await fetch(s.options.appUrl+"/create-intent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:s.options.appShopId,salesChannelId:s.options.context.salesChannel.i
2d,countryIso:s.options.context.shippingLocation.country.iso,countryName:s.options.context.shippingLocation.country.name,firstName:s.options.context.shippingLocation.address.firstName,lastName:s.options.context.shippingLocation.address.lastName,zipCode:s.options.context.shippingLocation.address.zipcode,city:s.options.context.shippingLocation.address.city,street:s.options.context.shippingLocation.address.street,state:null!==s.options.context.shippingLocation.state?s.options.context.shippingLocation.state.name:null,email:s.options.context.customer.email,currencyIso:s.options.context.currency.isoCode,amount:y,paymentMethodId:s.options.context.paymentMethod.id,customerId:s.options.context.customer.id,stripePaymentMethodId:r,stripeConfirmationToken:n,transactionId:void 0!==s.options.page.order?s.options.page.order.transactions[0].id:null,appVersion:s.options.appVersion})}).then(t=>t.json()),m=!0,i&&(i.removeAttribute("disabled"),i.click())}else m=!0,i&&(i.removeAttribute("disabled"),i.click())}async function C(){let t=new URLSearchParams(window.location.search),e=void 0!==s.options.page.order?s.options.page.order.transactions[0].id:null,n=void 0!==s.options.page.order?s.options.page.order.orderNumber:null;if(t&&t.get("error-code")){if(!e)return console.warn("No transaction id, error checking aborted!"),!0;let t=new URLSearchParams({transactionId:e}).toString();return await fetch(s.options.appUrl+"/payment/check-transaction-completed?"+t,{method:"GET",headers:{"Content-Type":"application/json"}}).then(t=>t.json().then(t=>"success"!==t.status||(window.location.href="/account/order?stripe_order_status=order_paid&order_number="+n,!1)))}return!0}document.addEventListener("visibilitychange",async()=>{document.hidden||await x(!1)})}}window.PluginManager.register("StripePaymentsApp",s,"[data-stripe-payments-app]")})()})(); 3} else if (window.Feature.isActive("v6.6.0.0")) { 4(()=>{var t={857:t=>{"use strict";var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?s(Array.isArray(t)?[]:{},t,e):t}function o(t,e,r){return t.concat(e).map(function(t){return n(t,r)})}function i(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function a(t,e){try{return e in t}catch(t){return!1}}function s(t,r,c){(c=c||{}).arrayMerge=c.arrayMerge||o,c.isMergeableObject=c.isMergeableObject||e,c.cloneUnlessOtherwiseSpecified=n;var l,u,p=Array.isArray(r);return p!==Array.isArray(t)?n(r,c):p?c.arrayMerge(t,r,c):(u={},(l=c).isMergeableObject(t)&&i(t).forEach(function(e){u[e]=n(t[e],l)}),i(r).forEach(function(e){(!a(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(a(t,e)&&l.isMergeableObject(r[e])?u[e]=(function(t,e){if(!e.customMerge)return s;var r=e.customMerge(t);return"function"==typeof r?r:s})(e,l)(t[e],r[e],l):u[e]=n(r[e],l))}),u)}s.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,r){return s(t,r,e)},{})},t.exports=s},248:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,r,n,i){var a,s,c=Object.create((r&&r.prototype instanceof y?r:y).prototype);return o(c,"_invoke",{value:(a=new O(i||[]),s=d,function(r,o){if(s===h)throw Error("Generator is already running");if(s===m){if("throw"===r)throw o;return C()}for(a.method=r,a.arg=o;;){var i=a.delegate;if(i){var c=function t(r,n){var o=n.method,i=r.iterator[o];if(e===i)return n.delegate=null,"throw"===o&&r.iterator.return&&
4(n.method="return",n.arg=e,t(r,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=TypeError("The iterator does not provide a '"+o+"' method")),f;var a=p(i,r.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,f;var s=a.arg;return s?s.done?(n[r.resultName]=s.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,f):s:(n.method="throw",n.arg=TypeError("iterator result is not an object"),n.delegate=null,f)}(i,a);if(c){if(c===f)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===d)throw s=m,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=h;var l=p(t,n,a);if("normal"===l.type){if(s=a.done?m:"suspendedYield",l.arg===f)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(s=m,a.method="throw",a.arg=l.arg)}})}),c}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var d="suspendedStart",h="executing",m="completed",f={};function y(){}function g(){}function v(){}var b={};l(b,a,function(){return this});var w=Object.getPrototypeOf,x=w&&w(w(k([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=v.prototype=y.prototype=Object.create(b);function L(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){var r;o(this,"_invoke",{value:function(o,i){function a(){return new e(function(r,a){!function r(o,i,a,s){var c=p(t[o],t,i);if("throw"===c.type)s(c.arg);else{var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(u).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}}(o,i,r,a)})}return r=r?r.then(a,a):a()}})}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function k(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:C}}function C(){return{value:e,done:!0}}return g.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:g,configurable:!0}),g.displayName=l(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||(e.displayName||e.name)==="GeneratorFunction")},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},t.awrap=function(t){return{__await:t}},L(E.prototype),l(E.prototype,s,function(){return this}),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},L(S),l(S,c,"Generator"),l(S,a,function(){return this}),l(S,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else if(l){if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else throw Error("try statement without catch or finally")}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return(a.type=t,a.arg=e,i)?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},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),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:k(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),f}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}},994:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,r,n,i){var a,s,c=Object.create((r&&r.prototype instanceof y?r:y).prototype);return o(c,"_invoke",{value:(a=new O(i||[]),s=d,function(r,o){if(s===h)throw Error("Generator is already running");if(s===m){if("throw"===r)throw o;return C()}for(a.method=r,a.arg=o;;){var i=a.delegate;if(i){var c=function t(r,n){var o=n.method,i=r.iterator[o];if(i===e)return n.delegate=null,"throw"===o&&r.iterator.return&&
4(n.method="return",n.arg=e,t(r,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=TypeError("The iterator does not provide a '"+o+"' method")),f;var a=p(i,r.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,f;var s=a.arg;return s?s.done?(n[r.resultName]=s.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,f):s:(n.method="throw",n.arg=TypeError("iterator result is not an object"),n.delegate=null,f)}(i,a);if(c){if(c===f)continue;return c}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===d)throw s=m,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=h;var l=p(t,n,a);if("normal"===l.type){if(s=a.done?m:"suspendedYield",l.arg===f)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(s=m,a.method="throw",a.arg=l.arg)}})}),c}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var d="suspendedStart",h="executing",m="completed",f={};function y(){}function g(){}function v(){}var b={};l(b,a,function(){return this});var w=Object.getPrototypeOf,x=w&&w(w(k([])));x&&x!==r&&n.call(x,a)&&(b=x);var S=v.prototype=y.prototype=Object.create(b);function L(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function E(t,e){var r;o(this,"_invoke",{value:function(o,i){function a(){return new e(function(r,a){!function r(o,i,a,s){var c=p(t[o],t,i);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&n.call(u,"__await")?e.resolve(u.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(u).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(c.arg)}(o,i,r,a)})}return r=r?r.then(a,a):a()}})}function I(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(I,this),this.reset(!0)}function k(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:C}}function C(){return{value:e,done:!0}}return g.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:g,configurable:!0}),g.displayName=l(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},t.awrap=function(t){return{__await:t}},L(E.prototype),l(E.prototype,s,function(){return this}),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},L(S),l(S,c,"Generator"),l(S,a,function(){return this}),l(S,"toString",function(){return"[object Generator]"}),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},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),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:k(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),f}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}(()=>{r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e}})(),(()=>{r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})}})(),(()=>{r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})(),(()=>{"use strict";var t=r(857),e=r.n(t);class n{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let r=n.toUpperCamelCase(t,e);return n.lcFirst(r)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>n.ucFirst(t.toLowerCase())).join(""):n.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class o{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!o.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!1===o.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(r)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=e.replace(/^data(|-)/,""),a=n.toLowerCamelCase(i,"-");if(!o.isNode(t)){if(r)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(r)throw Error("This node doesn't support the dataset attribute!");return}let s=t.dataset[a];if(void 0===s){if(r)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return s}return n.parsePrimitive(s)}static querySelector(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!o.isNode(t))throw Error("The parent node is not a valid HTML Node!");let n=t.querySelector(e)||!1;if(r&&!1===n)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return n}static querySelectorAll(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!o.isNode(t))throw Error("The parent node is not a valid HTML Node!");let n=t.querySelectorAll(e);if(0===n.length&&(n=!1),r&&!1===n)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return n}}class i{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new CustomEvent(t,{detail:e,cancelable:r});return this.el.dispatchEvent(n),n}subscribe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this,o=t.split("."),i=r.scope?e.bind(r.scope):e;if(r.once&&!0===r.once){let e=i;i=function(r){n.unsubscribe(t),e(r)}}return this.el.addEventListener(o[0],i),this.listeners.push({splitEventName:o,opts:r,cb:i}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,r)=>([...r.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):t.push(r),t),[]),!0}
4reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}}class a{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let r=n.toDashCase(this._pluginName),i=o.getDataAttribute(this.el,"data-".concat(r,"-config"),!1),a=o.getAttribute(this.el,"data-".concat(r,"-options"),!1),s=[this.constructor.options,this.options,t];i&&s.push(window.PluginConfigManager.get(this._pluginName,i));try{a&&s.push(JSON.parse(a))}catch(t){throw console.error(this.el),Error('The data attribute "data-'.concat(r,'-options" could not be parsed to json: ').concat(t.message))}return e().all(s.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}constructor(t,e={},r=!1){if(!o.isNode(t))throw Error("There is no valid element given.");this.el=t,this.$emitter=new i(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}}class s{}s.appearance={rules:{".AccordionItem":{borderColor:"#fff",boxShadow:"false"},".AccordionItem--selected":{borderColor:"#fff",boxShadow:"false"}}};try{r(248)}catch(t){r(994)}class c extends a{init(){let t,e,r,n;if(c.options=JSON.parse(this.el.dataset.stripePaymentsAppOptions),!c.options.stripePaymentMethodId){console.warn("Stripe payment method is not enabled. Please enable in Settings -> Shop -> Payment methods -> Pay online | Stripe -> Activate."),console.warn("Stripe payment method is not enabled. Please enable in Settings -> Shop -> Payment methods -> Pay online | Stripe -> Edit details -> Allow payment change after checkout.");return}let o=c.options.appShopId.match(/.{1,2}/g),i="ePiRtSeRaWpOhS".match(/.{1,1}/g),a="",l=0,u=0;for(let t=0;t<10;t++)void 0!==o[t]?a+=o[t]:(a+=o[l],l++),void 0!==i[t]?a+=i[t]:(a+=i[u],u++);let p=a,d=!1,h=!1,m=!1,f=()=>void 0!==c.options.page.cart&&c.options.page.cart&&c.options.page.cart.price?c.options.page.cart.price.totalPrice:void 0!==c.options.page.order&&c.options.page.order&&c.options.page.order.price?c.options.page.order.price.totalPrice:0,y=function(){let t=sessionStorage.getItem("stripeCurrentTotal");if(sessionStorage.removeItem("stripeCurrentTotal"),null!==t){let e=parseFloat(t);if(!isNaN(e)&&e>0)return e}return f()}();function g(t,e,r){let n=t+"="+encodeURIComponent(e);"number"==typeof r&&(n+="; max-age="+86400*r,document.cookie=n)}function v(t){let e=document.cookie.split(";");for(let r=0;r<e.length;r++){let n=e[r].split("=");if(t===n[0].trim())return decodeURIComponent(n[1])}return null}function b(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"warning",r=document.querySelector("#stripe-checkout-validation-message"),n=document.querySelector("#confirmOrderForm");n&&(r||((r=document.createElement("div")).id="stripe-checkout-validation-message",r.style.marginBottom="15px",n.prepend(r)),r.className="danger"===e?"alert alert-danger":"alert alert-warning",r.textContent=t,r.scrollIntoView({behavior:"smooth",block:"center"}))}function w(){let t=document.querySelector("#stripe-checkout-validation-message");t&&t.remove()}async function x(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(h)return{ok:!0,cartChanged:!1};h=!0;try{let e=await fetch(c.options.appUrl+"/checkout/cart-validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:c.options.appShopId,salesChannelId:c.options.context.salesChannel.id,currencyIso:c.options.context.currency.isoCode,checkoutPageTotal:y,contextToken:c.options.context.token||null,customerId:c.options.context.customer&&c.options.context.customer.id?c.options.context.customer.id:null,paymentMethodId:c.options.context.paymentMethod&&c.options.context.paymentMethod.id?c.options.context.paymentMethod.id:null,appVersion:c.options.appVersion,locale:c.options.locale||null})}),r=await e.json();if(!r||void 0===r.ok)return t?b(r.message||"We could not verify your cart. Please refresh the page and try again.","danger"):w(),{ok:!1,cartChanged:!1};if(!1===r.ok)return b(r.message||"We could not verify your cart. Please refresh the page and try again.","danger"),r;if(r.cartChanged){if(void 0!==c.options.page.order&&c.options.page.order)return void 0!==r.currentTotal&&null!==r.currentTotal&&r.currentTotal>0&&(y=r.currentTotal),w(),{ok:!0,cartChanged:!1};let t=r.message||"Your cart has been updated. Please review the new total before placing your order.";return sessionStorage.setItem("stripeCheckoutValidationMessage",t),sessionStorage.setItem("stripeCheckoutValidationLevel","warning"),void 0!==r.currentTotal&&null!==r.currentTotal&&sessionStorage.setItem("stripeCurrentTotal",r.currentTotal),window.location.reload(),{ok:!1,cartChanged:!0,currentTotal:r.currentTotal,message:t}}return void 0!==r.currentTotal&&null!==r.currentTotal&&(y=r.currentTotal),w(),r}catch(t){return console.error("Cart validation failed",t),b("We could not verify your cart. Please refresh the page and try again.","danger"),{ok:!1,cartChanged:!1,validationFailed:!0,message:"We could not verify your cart. Please refresh the page and try again."}}finally{h=!1}}g("sw.pm",!0,1);let S=document.querySelector("#paymentMethod"+c.options.stripePaymentMethodId);S&&S.checked&&(d=!0,g("sw.pm",!1,1)),function(){let t=sessionStorage.getItem("stripeCheckoutValidationMessage"),e=sessionStorage.getItem("stripeCheckoutValidationLevel");t&&window.setTimeout(()=>{b(t,e||"warning")},100),sessionStorage.removeItem("stripeCheckoutValidationMessage"),sessionStorage.removeItem("stripeCheckoutValidationLevel")}();let L=I();
4async function E(){if(r=await fetch(c.options.appUrl+"/auth/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:c.options.appShopId,token:p,appVersion:c.options.appVersion})}).then(t=>t.json()),!(n=await fetch(c.options.appUrl+"/shop/configuration",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:c.options.appShopId,salesChannelId:c.options.context.salesChannel.id,token:r.token,appVersion:c.options.appVersion})}).then(t=>t.json()).catch(()=>null))||!1===n.success||!1===n.stripeEnabled||!n.key){console.warn("Stripe Payments disabled by backend:",n&&(n.reason||n.error)||"no configuration returned"),(n=n||{}).paymentElements=!1,n.stripeEnabled=!1;let t=document.querySelector("#paymentMethod"+c.options.stripePaymentMethodId),e=document.querySelector('label[for="paymentMethod'+c.options.stripePaymentMethodId+'"]'),r=e?e.closest(".payment-method-radio"):null;if(t&&(t.checked=!1,t.disabled=!0),r?r.setAttribute("style","display:none"):e&&e.setAttribute("style","display:none"),d=!1,g("sw.pm",!0,1),!document.querySelector('input[name="paymentMethodId"]:checked:not(#paymentMethod'+c.options.stripePaymentMethodId+")")){let t=document.querySelector('input[name="paymentMethodId"]:not(#paymentMethod'+c.options.stripePaymentMethodId+"):not([disabled])");t&&(t.checked=!0,t.dispatchEvent(new Event("change",{bubbles:!0})))}return}if(n.paymentElements){let t='label[for="paymentMethod'+c.options.stripePaymentMethodId+'"]',e=document.querySelector(t);if(e){let t=e.querySelector("p");t&&t.setAttribute("style","display:none;")}}}async function I(){if(await E(),n&&!1!==n.stripeEnabled&&n.paymentElements&&n.key&&n.paymentElements){let r;e=Stripe(n.key);let o=await fetch(c.options.appUrl+"/create-elements",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:c.options.appShopId,currencyIso:c.options.context.currency.isoCode,amount:y,appVersion:c.options.appVersion,customerId:c.options.context.customer.id,salesChannelId:c.options.context.salesChannel.id})}).then(t=>t.json()).catch(()=>null);if(!o||!o.element){console.warn("Stripe Payments: /create-elements returned no payload, aborting init.");return}let i=o.element.theme?o.element.theme:void 0!==s.appearance.theme?s.appearance.theme:"stripe";s.appearance.theme=i;let a={mode:o.element.mode,amount:o.element.amount,capture_method:"automatic",currency:o.element.currency.toLowerCase(),appearance:s.appearance,paymentMethodCreation:"manual",locale:c.options.locale,customerSessionClientSecret:o.customerSessionClientSecret};t=e.elements(a);let l=o.element.layout;n.position=n.position?n.position:"middle";let u='label[for="paymentMethod'+c.options.stripePaymentMethodId+'"]',p="",h='<form id="stripe-payment-form"><div id="stripe-payment-element" style="padding-bottom: 15px; formStyle"><!--Stripe.js injects the Payment Element--></div></form>';"radio"===l&&"bottom"!==n.position?(p="margin-left: -17px",h=h.replace("formStyle",p)):"radio"===l&&"bottom"===n.position?(p="margin-left: -17px; margin-top: -25px",h=h.replace("formStyle",p)):"bottom"===n.position&&(p="margin-top: -25px",h=h.replace("formStyle",p));let m=document.querySelector(u).closest(".payment-methods"),f=document.querySelector(u).closest(".payment-method-radio");if("top"===n.position&&m&&f)m.insertAdjacentHTML("beforebegin",h),f.setAttribute("style","display:none");else if("middle"===n.position){let t=document.querySelector(u);t&&(t.innerHTML+=h)}else"bottom"===n.position&&m&&f&&(m.insertAdjacentHTML("afterend",h),f.setAttribute("style","display:none"));d||(c.layouts[l].defaultCollapsed=!0),r=c.layouts[l];let b={defaultValues:{billingDetails:{address:{country:c.options.context.shippingLocation.country.iso,postal_code:c.options.context.shippingLocation.address.zipcode},email:c.options.context.customer.email,name:c.options.context.customer.firstName+" "+c.options.context.customer.lastName}},layout:r},w=v("stripe.payment-method");w&&(b.paymentMethodOrder=[w]);let x=t.create("payment",b);x.mount("#stripe-payment-element"),d||"middle"!==n.position||x.unmount();let S=!1,L=!1;x.on("ready",function(){S=!0}),x.on("change",function(t){g("stripe.payment-method",t.value.type,1);let e=v("sw.pm");if(!e||"true"!==e||t.collapsed||L)g("sw.pm",!1,1),e="false";else{f&&f.setAttribute("style","display:block");let t=document.querySelector("#stripe-payment-element");t&&t.remove()}L=t.collapsed;let r=document.querySelector("#paymentMethod"+c.options.stripePaymentMethodId);if(r&&!r.checked&&S&&!t.collapsed&&e&&"false"===e){let t=document.querySelector("#stripe-payment-element");t&&t.remove(),r.click()}})}}E(),document.querySelectorAll('input[name="paymentMethodId"]').forEach(function(t){t.addEventListener("change",function(){this.id==="paymentMethod"+c.options.stripePaymentMethodId&&this.checked?(d=!0,g("sw.pm",!1,1)):(d=!1,g("sw.pm",!0,1))})});let P=document.querySelector("#confirmOrderForm button"),O=document.querySelector("#confirmOrderForm");if(P&&P.addEventListener("click",k),O){O.addEventListener("submit",k);let t=O.submit;O.submit=async function(){let e=document.querySelector("#paymentMethod"+c.options.stripePaymentMethodId);e&&e.checked&&!m?await k(new Event("submit")):t.call(O)}}async function k(r){if(m)return;let o=document.querySelector("#paymentMethod"+c.options.stripePaymentMethodId);
4if(!o||!o.checked||n&&!1===n.stripeEnabled)return;r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation();let i=document.querySelector("#confirmOrderForm button");i&&i.setAttribute("disabled","disabled");try{await L}catch(t){}if(!n){i&&i.removeAttribute("disabled"),b("Payment could not be initialized. Please refresh the page and try again.","danger");return}if(void 0!==t&&t&&n.paymentElements)try{let{error:e}=await t.submit();if(e){i&&i.removeAttribute("disabled");let t=document.querySelector("#stripe-payment-element");t&&t.scrollIntoView();return}}catch(t){i&&i.removeAttribute("disabled"),b("Payment form is not ready yet. Please wait a moment and try again.","warning");return}let a=document.querySelector("#tos");if(a&&!a.checked){i&&i.removeAttribute("disabled"),a.classList.add("is-invalid"),a.scrollIntoView();return}let s=await x(!0);if(!s.ok||s.cartChanged){i&&i.removeAttribute("disabled");return}if(n.paymentElements){let r,n;if(!1===await C()){i&&i.removeAttribute("disabled");return}let o=await fetch(c.options.appUrl+"/create-billing-details",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:c.options.appShopId,countryIso:c.options.context.shippingLocation.country.iso,countryName:c.options.context.shippingLocation.country.name,firstName:c.options.context.shippingLocation.address.firstName,lastName:c.options.context.shippingLocation.address.lastName,zipCode:c.options.context.shippingLocation.address.zipcode,city:c.options.context.shippingLocation.address.city,street:c.options.context.shippingLocation.address.street,state:null!==c.options.context.shippingLocation.state?c.options.context.shippingLocation.state.name:null,email:c.options.context.customer.email,appVersion:c.options.appVersion})}).then(t=>t.json());if(-1!==function(t,e){let r=t.split(".").map(Number),n=e.split(".").map(Number),o=Math.max(r.length,n.length);for(let t=0;t<o;t++){let e=t<r.length?r[t]:0,o=t<n.length?n[t]:0;if(e>o)return 1;if(o>e)return -1}return 0}(c.options.appVersion,"1.5.0")){let n=await e.createConfirmationToken({elements:t,params:o.payment_method_data});r=n.confirmationToken&&n.confirmationToken.id?n.confirmationToken.id:null}else{let r=await e.createPaymentMethod({elements:t,params:o.cardPayment.payment_method});n=r.paymentMethod&&r.paymentMethod.id?r.paymentMethod.id:null}(n||r)&&await fetch(c.options.appUrl+"/create-intent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shopId:c.options.appShopId,salesChannelId:c.options.context.salesChannel.id,countryIso:c.options.context.shippingLocation.country.iso,countryName:c.options.context.shippingLocation.country.name,firstName:c.options.context.shippingLocation.address.firstName,lastName:c.options.context.shippingLocation.address.lastName,zipCode:c.options.context.shippingLocation.address.zipcode,city:c.options.context.shippingLocation.address.city,street:c.options.context.shippingLocation.address.street,state:null!==c.options.context.shippingLocation.state?c.options.context.shippingLocation.state.name:null,email:c.options.context.customer.email,currencyIso:c.options.context.currency.isoCode,amount:y,paymentMethodId:c.options.context.paymentMethod.id,customerId:c.options.context.customer.id,stripePaymentMethodId:n,stripeConfirmationToken:r,transactionId:void 0!==c.options.page.order?c.options.page.order.transactions[0].id:null,appVersion:c.options.appVersion})}).then(t=>t.json()),m=!0,i&&(i.removeAttribute("disabled"),i.click())}else m=!0,i&&(i.removeAttribute("disabled"),i.click())}async function C(){let t=window.location.search,e=new URLSearchParams(t),r=void 0!==c.options.page.order?c.options.page.order.transactions[0].id:null,n=void 0!==c.options.page.order?c.options.page.order.orderNumber:null;if(e&&e.get("error-code")){if(!r)return console.warn("No transaction id, error checking aborted!"),!0;let t=new URLSearchParams({transactionId:r}).toString();return await fetch(c.options.appUrl+"/payment/check-transaction-completed?"+t,{method:"GET",headers:{"Content-Type":"application/json"}}).then(t=>t.json().then(t=>"success"!==t.status||(window.location.href="/account/order?stripe_order_status=order_paid&order_number="+n,!1)))}return!0}document.addEventListener("visibilitychange",async()=>{document.hidden||await x(!1)})}}
4c.options={context:null,page:null,appShopId:null,stripePaymentMethodId:null,locale:null,appUrl:null,appVersion:null},c.layouts={tabs:{type:"tabs",defaultCollapsed:!1},accordion:{type:"accordion",defaultCollapsed:!1,radios:!1,spacedAccordionItems:!0,visibleAccordionItemsCount:0},radio:{type:"accordion",defaultCollapsed:!1,radios:!0,spacedAccordionItems:!0,visibleAccordionItemsCount:0}},window.PluginManager.register("StripePaymentsApp",c,"[data-stripe-payments-app]")})()})(); 5 }
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.