document.sezzleButtonVersion = "sezzle-widget22.3.2.js";
document.sezzleCssVersionOverride = "sezzle-styles-global2.0.14.css";
document.widgetServerBaseUrl = "https://widget.sezzle.com";
document.geoIpBaseUrl = "https://geoip.sezzle.com";
document.sezzleDefaultModalVersion = "sezzle-modal-3.0.2.html";
document.sezzleModalAvailableLanguages = "en,fr,de,es";

// Sezzle's merchant widget config override
document.sezzleConfig = {
	"configGroups": [
		{
			"targetXPath": "#ProductPrice",
			"renderToPath": "../FORM-0/::first-child",
			"urlMatch": "product"
		},
		{
			"targetXPath": ".cart__subtotal",
			"urlMatch": "cart"
		}
	],
	"supportedCountryCodes": ["US","IN","CA","GU","PR","VI","AS","MP"]
}

if (document.sezzleConfig){
   document.sezzleConfig.merchantID = '01fdab0b-0d00-4e8f-a77f-8782a6ad43ad';

   // Sezzle's merchant payment settings override

   // Sezzle's merchant local config override
   try {document.sezzleConfig = Object.assign(document.localSezzleConfig, document.sezzleConfig); } catch(e) {}
 }
!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){var o=function(e){"use strict";var t=Object.prototype,n=t.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},r=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,o){var r=t&&t.prototype instanceof d?t:d,i=Object.create(r.prototype),a=new k(o||[]);return i._invoke=function(e,t,n){var o="suspendedStart";return function(r,i){if("executing"===o)throw new Error("Generator is already running");if("completed"===o){if("throw"===r)throw i;return _()}for(n.method=r,n.arg=i;;){var a=n.delegate;if(a){var s=z(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===o)throw o="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o="executing";var l=c(e,t,n);if("normal"===l.type){if(o=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function d(){}function f(){}function m(){}var g={};s(g,r,(function(){return this}));var h=Object.getPrototypeOf,p=h&&h(h(E([])));p&&p!==t&&n.call(p,r)&&(g=p);var y=m.prototype=d.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){var o;this._invoke=function(r,i){function a(){return new t((function(o,a){!function o(r,i,a,s){var l=c(e[r],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return o("throw",e,a,s)}))}s(l.arg)}(r,i,o,a)}))}return o=o?o.then(a,a):a()}}function z(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,z(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var o=c(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,u;var r=o.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function E(e){if(e){var t=e[r];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function t(){for(;++o<e.length;)if(n.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:_}}function _(){return{value:void 0,done:!0}}return f.prototype=m,s(y,"constructor",m),s(m,"constructor",f),f.displayName=s(m,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,s(e,a,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(v.prototype),s(v.prototype,i,(function(){return this})),e.AsyncIterator=v,e.async=function(t,n,o,r,i){void 0===i&&(i=Promise);var a=new v(l(t,n,o,r),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),s(y,a,"Generator"),s(y,r,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var o=t.pop();if(o in e)return n.value=o,n.done=!1,n}return n.done=!0,n}},e.values=E,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function o(n,o){return a.type="throw",a.arg=e,t.next=n,o&&(t.method="next",t.arg=void 0),!!o}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var o=this.tryEntries.length-1;o>=0;--o){var r=this.tryEntries[o];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var r=o.arg;C(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}(e.exports);try{regeneratorRuntime=o}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=o:Function("r","regeneratorRuntime = r")(o)}},function(e,t,n){(function(e,n){var o="[object Arguments]",r="[object Function]",i="[object GeneratorFunction]",a="[object Map]",s="[object Set]",l=/\w*$/,c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,d={};d[o]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object DataView]"]=d["[object Boolean]"]=d["[object Date]"]=d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d[a]=d["[object Number]"]=d["[object Object]"]=d["[object RegExp]"]=d[s]=d["[object String]"]=d["[object Symbol]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d["[object Error]"]=d[r]=d["[object WeakMap]"]=!1;var f="object"==typeof e&&e&&e.Object===Object&&e,m="object"==typeof self&&self&&self.Object===Object&&self,g=f||m||Function("return this")(),h=t&&!t.nodeType&&t,p=h&&"object"==typeof n&&n&&!n.nodeType&&n,y=p&&p.exports===h;function b(e,t){return e.set(t[0],t[1]),e}function v(e,t){return e.add(t),e}function z(e,t,n,o){var r=-1,i=e?e.length:0;for(o&&i&&(n=e[++r]);++r<i;)n=t(n,e[r],r,e);return n}function w(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function C(e){var t=-1,n=Array(e.size);return e.forEach((function(e,o){n[++t]=[o,e]})),n}function k(e,t){return function(n){return e(t(n))}}function E(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var _,P=Array.prototype,x=Function.prototype,L=Object.prototype,S=g["__core-js_shared__"],T=(_=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+_:"",W=x.toString,O=L.hasOwnProperty,A=L.toString,M=RegExp("^"+W.call(O).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=y?g.Buffer:void 0,N=g.Symbol,F=g.Uint8Array,B=k(Object.getPrototypeOf,Object),G=Object.create,I=L.propertyIsEnumerable,R=P.splice,D=Object.getOwnPropertySymbols,H=j?j.isBuffer:void 0,U=k(Object.keys,Object),q=pe(g,"DataView"),V=pe(g,"Map"),X=pe(g,"Promise"),$=pe(g,"Set"),K=pe(g,"WeakMap"),J=pe(Object,"create"),Q=we(q),Z=we(V),Y=we(X),ee=we($),te=we(K),ne=N?N.prototype:void 0,oe=ne?ne.valueOf:void 0;function re(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function ie(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function ae(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}function se(e){this.__data__=new ie(e)}function le(e,t){var n=ke(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ee(e)}(e)&&O.call(e,"callee")&&(!I.call(e,"callee")||A.call(e)==o)}(e)?function(e,t){for(var n=-1,o=Array(e);++n<e;)o[n]=t(n);return o}(e.length,String):[],r=n.length,i=!!r;for(var a in e)!t&&!O.call(e,a)||i&&("length"==a||ve(a,r))||n.push(a);return n}function ce(e,t,n){var o=e[t];O.call(e,t)&&Ce(o,n)&&(void 0!==n||t in e)||(e[t]=n)}function ue(e,t){for(var n=e.length;n--;)if(Ce(e[n][0],t))return n;return-1}function de(e,t,n,c,u,f,m){var g;if(c&&(g=f?c(e,u,f,m):c(e)),void 0!==g)return g;if(!xe(e))return e;var h=ke(e);if(h){if(g=function(e){var t=e.length,n=e.constructor(t);t&&"string"==typeof e[0]&&O.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!t)return function(e,t){var n=-1,o=e.length;t||(t=Array(o));for(;++n<o;)t[n]=e[n];return t}(e,g)}else{var p=be(e),y=p==r||p==i;if(_e(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if("[object Object]"==p||p==o||y&&!f){if(w(e))return f?e:{};if(g=function(e){return"function"!=typeof e.constructor||ze(e)?{}:(t=B(e),xe(t)?G(t):{});var t}(y?{}:e),!t)return function(e,t){return ge(e,ye(e),t)}(e,function(e,t){return e&&ge(t,Le(t),e)}(g,e))}else{if(!d[p])return f?e:{};g=function(e,t,n,o){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return me(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return function(e,t){var n=t?me(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,o);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?me(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,o);case a:return function(e,t,n){return z(t?n(C(e),!0):C(e),b,new e.constructor)}(e,o,n);case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return function(e){var t=new e.constructor(e.source,l.exec(e));return t.lastIndex=e.lastIndex,t}(e);case s:return function(e,t,n){return z(t?n(E(e),!0):E(e),v,new e.constructor)}(e,o,n);case"[object Symbol]":return i=e,oe?Object(oe.call(i)):{}}var i}(e,p,de,t)}}m||(m=new se);var k=m.get(e);if(k)return k;if(m.set(e,g),!h)var _=n?function(e){return function(e,t,n){var o=t(e);return ke(e)?o:function(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}(o,n(e))}(e,Le,ye)}(e):Le(e);return function(e,t){for(var n=-1,o=e?e.length:0;++n<o&&!1!==t(e[n],n,e););}(_||e,(function(o,r){_&&(o=e[r=o]),ce(g,r,de(o,t,n,c,r,e,m))})),g}function fe(e){return!(!xe(e)||(t=e,T&&T in t))&&(Pe(e)||w(e)?M:c).test(we(e));var t}function me(e){var t=new e.constructor(e.byteLength);return new F(t).set(new F(e)),t}function ge(e,t,n,o){n||(n={});for(var r=-1,i=t.length;++r<i;){var a=t[r],s=o?o(n[a],e[a],a,n,e):void 0;ce(n,a,void 0===s?e[a]:s)}return n}function he(e,t){var n,o,r=e.__data__;return("string"==(o=typeof(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function pe(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return fe(n)?n:void 0}re.prototype.clear=function(){this.__data__=J?J(null):{}},re.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},re.prototype.get=function(e){var t=this.__data__;if(J){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return O.call(t,e)?t[e]:void 0},re.prototype.has=function(e){var t=this.__data__;return J?void 0!==t[e]:O.call(t,e)},re.prototype.set=function(e,t){return this.__data__[e]=J&&void 0===t?"__lodash_hash_undefined__":t,this},ie.prototype.clear=function(){this.__data__=[]},ie.prototype.delete=function(e){var t=this.__data__,n=ue(t,e);return!(n<0)&&(n==t.length-1?t.pop():R.call(t,n,1),!0)},ie.prototype.get=function(e){var t=this.__data__,n=ue(t,e);return n<0?void 0:t[n][1]},ie.prototype.has=function(e){return ue(this.__data__,e)>-1},ie.prototype.set=function(e,t){var n=this.__data__,o=ue(n,e);return o<0?n.push([e,t]):n[o][1]=t,this},ae.prototype.clear=function(){this.__data__={hash:new re,map:new(V||ie),string:new re}},ae.prototype.delete=function(e){return he(this,e).delete(e)},ae.prototype.get=function(e){return he(this,e).get(e)},ae.prototype.has=function(e){return he(this,e).has(e)},ae.prototype.set=function(e,t){return he(this,e).set(e,t),this},se.prototype.clear=function(){this.__data__=new ie},se.prototype.delete=function(e){return this.__data__.delete(e)},se.prototype.get=function(e){return this.__data__.get(e)},se.prototype.has=function(e){return this.__data__.has(e)},se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ie){var o=n.__data__;if(!V||o.length<199)return o.push([e,t]),this;n=this.__data__=new ae(o)}return n.set(e,t),this};var ye=D?k(D,Object):function(){return[]},be=function(e){return A.call(e)};function ve(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||u.test(e))&&e>-1&&e%1==0&&e<t}function ze(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||L)}function we(e){if(null!=e){try{return W.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ce(e,t){return e===t||e!=e&&t!=t}(q&&"[object DataView]"!=be(new q(new ArrayBuffer(1)))||V&&be(new V)!=a||X&&"[object Promise]"!=be(X.resolve())||$&&be(new $)!=s||K&&"[object WeakMap]"!=be(new K))&&(be=function(e){var t=A.call(e),n="[object Object]"==t?e.constructor:void 0,o=n?we(n):void 0;if(o)switch(o){case Q:return"[object DataView]";case Z:return a;case Y:return"[object Promise]";case ee:return s;case te:return"[object WeakMap]"}return t});var ke=Array.isArray;function Ee(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}(e.length)&&!Pe(e)}var _e=H||function(){return!1};function Pe(e){var t=xe(e)?A.call(e):"";return t==r||t==i}function xe(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Le(e){return Ee(e)?le(e):function(e){if(!ze(e))return U(e);var t=[];for(var n in Object(e))O.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}n.exports=function(e){return de(e,!0,!0)}}).call(this,n(2),n(3)(e))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";n.r(t);n(0);function o(e,t,n,o,r,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(o,r)}function r(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var i=document.widgetServerBaseUrl?"".concat(document.widgetServerBaseUrl,"/v1/event/log"):"http://widget.sezzle.com/v1/event/log",a=["afterpay-paragraph","affirm-as-low-as","qp-widget-container"],s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,s,l,c;return t=e,n=null,s=[{key:"httpRequestWrapper",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new Promise((function(o,r){var i=new XMLHttpRequest;i.open(e,t,!0),null!==n&&i.setRequestHeader("Content-Type","application/json"),i.onload=function(){this.status>=200&&this.status<300?o(i.response):r(new Error("An error occurred when calling ".concat(t,". Status code: ").concat(this.status,"; Response text: ").concat(i.responseText)))},i.onerror=function(e){var n="";n=e instanceof ErrorEvent?"An error occurred when calling ".concat(t,". Error message: ").concat(e.message,"; Filename: ").concat(e.filename,"; Line#: ").concat(e.lineno):"An error occurred when calling ".concat(t,". Error type: ").concat(e.type),r(new Error(n))},null===n?i.send():i.send(JSON.stringify(n))}))}},{key:"_getCookie",value:function(e){var t=";".concat(document.cookie).split(";".concat(e,"="));if(2===t.length)return t.pop().split(";").shift()}},{key:"isWidgetDuplicateFound",value:function(){return document.getElementsByClassName("sezzle-shopify-info-button").length>1}},{key:"isCompetitorWidgetFound",value:function(){var e=0;return Array.prototype.forEach.call(a,(function(t){document.getElementsByClassName(t).length&&e++})),e>0}},{key:"sendEvents",value:function(e){this.httpRequestWrapper("post",i,e)}},{key:"breakXPath",value:function(e){return e.split("/").filter((function(e){return""!==e}))}},{key:"getWidgetBaseUrl",value:function(){return document.widgetServerBaseUrl||"https://widget.sezzle.com"}},{key:"getGeoIpBaseUrl",value:function(){return document.geoIpBaseUrl||"https://geoip.sezzle.com"}},{key:"getCountryCodeFromIP",value:(l=regeneratorRuntime.mark((function t(){var n,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="".concat(e.getGeoIpBaseUrl(),"/v1/geoip/ipdetails"),t.next=3,e.httpRequestWrapper("GET",n);case 3:return o=t.sent,o=JSON.parse(o),t.abrupt("return",o.country_iso_code?o.country_iso_code:console.log("Cant fetch the country code"));case 6:case"end":return t.stop()}}),t)})),c=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=l.apply(e,t);function a(e){o(i,n,r,a,s,"next",e)}function s(e){o(i,n,r,a,s,"throw",e)}a(void 0)}))},function(){return c.apply(this,arguments)})},{key:"getCurrentDataCenterDefaultSupportedCountries",value:function(){return"https://widget.eu.sezzle.com"===e.getWidgetBaseUrl()?["DE"]:["US","CA","IN","GU","PR","VI","AS","MP"]}},{key:"predictBackgroundtheme",value:function(){var e,t,n,o=window.getComputedStyle(document.body).getPropertyValue("background-color");if("transparent"===o||"rgba(0, 0, 0, 0)"===o)return"light";o.match(/^rgb/)?(e=(o=o.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/))[1],t=o[2],n=o[3]):(e=(o=+"0x".concat(o.slice(1).replace(o.length<5&&/./g,"$&$&")))>>16,t=o>>8&255,n=255&o);var r=.2126*e+.7152*t+.0722*n,i=(Math.max(e,t,n)+Math.min(e,t,n))/2;return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)<=180&&r<=180&&i<=180?"dark":"light"}}],n&&r(t.prototype,n),s&&r(t,s),Object.defineProperty(t,"prototype",{writable:!1}),e}();function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){u(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var m=n(1),g=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.basicWidgetConfig=t,this.compatibleOptions=null,this.propsNotInConfigGroup=["merchantID","minPrice","maxPrice","modalTheme","numberOfPayments","altLightboxHTML","apModalHTML","qpModalHTML","affirmModalHTML","klarnaModalHTML","shopPayModalHTML","shopPayLink","apLink","noGtm","noTracking","testID","language","parseMode"],this.widgetConfig={config:null,configGroups:null,merchantID:null,numberOfPayments:null,minPrice:null,maxPrice:null,altModalHTML:null,apModalHTML:null,qpModalHTML:null,shopPayModalHTML:null,shopPayLink:null,apLink:null,affirmModalHTML:null,klarnaModalHTML:null,modalTheme:"default",noTracking:null,noGtm:null,fingerprint:null,parseMode:null,mutationObserverConfig:{attributes:!0,childList:!0,characterData:!0},apiEndpoints:{sezzleAssetsCDN:"https://media.sezzle.com/shopify-app/assets/",cssForMerchantURL:"".concat(s.getWidgetBaseUrl(),"/v1/css/price-widget?uuid=").concat(t.merchantID)},observeElements:null},this.modifySezzleConfig()}var t,n,o;return t=e,(n=[{key:"getSezzleConfig",get:function(){return this.widgetConfig}},{key:"getCompatibleOptions",get:function(){return this.compatibleOptions}},{key:"modifySezzleConfig",value:function(){this._makeCompatible(),this._validateConfig(),this._urlConfigFilter(),this._configSetters(),this._setConfigGroups()}},{key:"_makeCompatible",value:function(){if(void 0===this.basicWidgetConfig.configGroups){var e=this._factorize();e.configGroups=this._splitConfig(),this.basicWidgetConfig=e,this.compatibleOptions=e}}},{key:"_factorize",value:function(){var e=this,t={};return this.propsNotInConfigGroup.forEach((function(n){void 0!==e.basicWidgetConfig[n]&&(t[n]=e.basicWidgetConfig[n],delete e.basicWidgetConfig[n])})),t}},{key:"_splitConfig",value:function(){var e=this,t=[];if(void 0!==this.basicWidgetConfig.targetXPath)if(Array.isArray(this.basicWidgetConfig.targetXPath)){var n=this._groupCustomClasses(),o=Array.isArray(this.basicWidgetConfig.renderToPath);this.basicWidgetConfig.targetXPath.forEach((function(r,i){var a=m(e.basicWidgetConfig);a.targetXPath=r,o&&void 0!==e.basicWidgetConfig.renderToPath[i]?a.renderToPath=e.basicWidgetConfig.renderToPath[i]?e.basicWidgetConfig.renderToPath[i]:null:a.renderToPath="..",e.basicWidgetConfig.relatedElementActions&&void 0!==e.basicWidgetConfig.relatedElementActions[i]&&Array.isArray(e.basicWidgetConfig.relatedElementActions[i])&&(a.relatedElementActions=e.basicWidgetConfig.relatedElementActions[i]),void 0!==n[i]&&(a.customClasses=n[i]),e.basicWidgetConfig.ignoredPriceElements&&(a.ignoredPriceElements=e.basicWidgetConfig.ignoredPriceElements),t.push(a)}))}else t.push(this.basicWidgetConfig);return t}},{key:"_groupCustomClasses",value:function(){var e=[];return this.basicWidgetConfig.customClasses&&Array.isArray(this.basicWidgetConfig.customClasses)&&this.basicWidgetConfig.customClasses.forEach((function(t){"number"==typeof t.targetXPathIndex&&(void 0===e[t.targetXPathIndex]?e[t.targetXPathIndex]=[t]:e[t.targetXPathIndex].push(t),delete t.targetXPathIndex)})),e}},{key:"_validateConfig",value:function(){var e=this;if(!Array.isArray(this.basicWidgetConfig.configGroups))throw new Error("options.configGroups is not an array");if(!this.basicWidgetConfig.configGroups.length)throw new Error("options.configGroups must have at least one config object");var t=["targetXPath"];this.basicWidgetConfig.configGroups.forEach((function(e){t.forEach((function(t){if(!e.hasOwnProperty(t))throw new Error("".concat(t," must be specified in all configs in options.configGroups"))}))}));var n={targetXPath:"string",renderToPath:"string",urlMatch:"string"};this.basicWidgetConfig.configGroups.forEach((function(e){Object.keys(n).forEach((function(t){if(e.hasOwnProperty(t)&&d(e[t])!==d(n[t]))throw new Error("".concat(t," must be of type ").concat(n[t]))}))})),this.basicWidgetConfig.configGroups.forEach((function(t){Object.keys(t).forEach((function(t){if(e.propsNotInConfigGroup.indexOf(t)>=0)throw new Error("".concat(t," is not a property of a configGroup. Specify this key at the outermost layer"))}))}))}},{key:"_urlConfigFilter",value:function(){this.basicWidgetConfig.configGroups=this.basicWidgetConfig.configGroups.filter((function(e){return!e.urlMatch||RegExp(e.urlMatch).test(window.location.href)}))}},{key:"_configSetters",value:function(){var e={config:this.basicWidgetConfig,merchantID:this.basicWidgetConfig.merchantID||"",numberOfPayments:this.basicWidgetConfig.numberOfPayments||4,minPrice:this.basicWidgetConfig.minPrice||0,maxPrice:this.basicWidgetConfig.maxPrice||25e4,modalTheme:this.basicWidgetConfig.modalTheme||"default",altModalHTML:this.basicWidgetConfig.altLightboxHTML||"",apModalHTML:this.basicWidgetConfig.apModalHTML||"",qpModalHTML:this.basicWidgetConfig.qpModalHTML||"",shopPayLink:this.basicWidgetConfig.shopPayLink||"https://shop.app/shop-pay",apLink:this.basicWidgetConfig.apLink||"https://www.afterpay.com/purchase-payment-agreement",affirmModalHTML:this.basicWidgetConfig.affirmModalHTML||"",shopPayModalHTML:this.basicWidgetConfig.shopPayModalHTML||"",klarnaModalHTML:this.basicWidgetConfig.klarnaModalHTML||"",parseMode:this.basicWidgetConfig.parseMode||"",observeElements:this.basicWidgetConfig.observeElements||[]};this.widgetConfig=c(c({},this.widgetConfig),e),document.sezzleModalTheme=e.modalTheme}},{key:"_mapGroupToDefault",value:function(e){var t={};switch(t.xpath=s.breakXPath(e.targetXPath),t.rendertopath=e.renderToPath||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.renderToPath||"..",t.relatedElementActions=e.relatedElementActions||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.relatedElementActions||[],t.ignoredPriceElements=e.ignoredPriceElements||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.ignoredPriceElements||[],"string"==typeof t.ignoredPriceElements?t.ignoredPriceElements=[s.breakXPath(t.ignoredPriceElements.trim())]:t.ignoredPriceElements=t.ignoredPriceElements.map((function(e){return s.breakXPath(e.trim())})),t.altVersionTemplate=e.altVersionTemplate||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.altVersionTemplate,t.alignment=e.alignment||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.alignment||"auto",t.widgetType=e.widgetType||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.widgetType||"product-page",t.fontWeight=e.fontWeight||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.fontWeight||500,t.lineHeight=e.lineHeight||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.lineHeight||"13px",t.alignmentSwitchMinWidth=e.alignmentSwitchMinWidth||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.alignmentSwitchMinWidth,t.alignmentSwitchType=e.alignmentSwitchType||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.alignmentSwitchType,t.marginTop=e.marginTop||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.marginTop||0,t.marginBottom=e.marginBottom||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.marginBottom||0,t.marginLeft=e.marginLeft||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.marginLeft||0,t.marginRight=e.marginRight||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.marginRight||0,t.scaleFactor=e.scaleFactor||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.scaleFactor,t.logoSize=e.logoSize||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.logoSize||1,t.logoStyle=e.logoStyle||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.logoStyle||{},t.fontFamily=e.fontFamily||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.fontFamily||"inherit",t.textColor=e.color||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.color||"inherit",t.fontSize=e.fontSize||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.fontSize||14,t.maxWidth=e.maxWidth||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.maxWidth||485,t.fixedHeight=e.fixedHeight||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.fixedHeight||0,t.customClasses=Array.isArray(e.customClasses)?e.customClasses:[],t.theme=e.theme||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.theme||"",t.theme){case"dark":t.imageURL=e.imageUrl||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor_WhiteWM.svg",t.imageClassName="szl-dark-image";break;case"light":t.imageURL=e.imageUrl||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",t.imageClassName="szl-light-image";break;case"grayscale":t.imageURL=e.imageUrl||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_Black.svg",t.imageClassName="szl-light-image";break;case"white":t.imageURL=e.imageUrl||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_White.svg",t.imageClassName="szl-dark-image";break;case"white-flat":t.imageURL=e.imageUrl||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_WhiteAlt.svg",t.imageClassName="szl-dark-image";break;case"black-flat":t.imageURL=e.imageUrl||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_BlackAlt.svg",t.imageClassName="szl-light-image";break;case"white-pill":t.imageURL=e.imageUrl||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_WhitePill.svg",t.imageClassName="szl-dark-image";break;case"purple-pill":t.imageURL=e.imageUrl||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_PurplePill.svg",t.imageClassName="szl-light-image";break;case"pride-pill":t.imageURL=e.imageUrl||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_Pride_PurplePill.svg",t.imageClassName="szl-light-image";break;case"pride-whitepill":t.imageURL=e.imageUrl||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_Pride_WhitePill.svg",t.imageClassName="szl-dark-image";break;default:"dark"===s.predictBackgroundtheme()?(t.imageURL=e.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor_WhiteWM.svg",t.imageClassName="szl-dark-image"):(t.imageURL=e.imageUrl||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.imageUrl||"https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",t.imageClassName="szl-light-image")}return t.hideClasses=e.hideClasses||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.hideClasses||[],"string"==typeof t.hideClasses?t.hideClasses=[s.breakXPath(t.hideClasses.trim())]:t.hideClasses=t.hideClasses.map((function(e){return s.breakXPath(e.trim())})),t.ignoredFormattedPriceText=e.ignoredFormattedPriceText||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.ignoredFormattedPriceText||["Subtotal","Total:","Sold Out"],Array.isArray(t.ignoredFormattedPriceText)||(t.ignoredFormattedPriceText=[t.ignoredFormattedPriceText]),t.widgetIsFirstChild=!1,t}},{key:"_setConfigGroups",value:function(){var e=this;this.widgetConfig.configGroups=[],this.basicWidgetConfig.configGroups.forEach((function(t){e.widgetConfig.configGroups.push(e._mapGroupToDefault(t))}))}}])&&f(t.prototype,n),o&&f(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function h(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=t}var t,n,o;return t=e,(n=[{key:"getElementsByXPath",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e===[])return[];if(t===e.length)return n;null===n&&(n=[document]);for(var o=[],r=Array.prototype.slice.call(n),i=0;i<r.length;i++){var a=r[i];if(".."===e[t])o.push(a.parentElement);else if("#"===e[t][0])o.push(a.getElementById(e[t].substr(1)));else if("."===e[t][0])1===e[t].trim().length&&o.push(a),Array.prototype.forEach.call(a.getElementsByClassName(e[t].substr(1)),(function(e){o.push(e)}));else if(0===e[t].indexOf("child")){var s=e[t].split("-")[1],l=a.childNodes[s];if(void 0!==l)if("#text"===l.nodeName){var c=document.createElement("span");c.appendChild(document.createTextNode(l.nodeValue)),a.replaceChild(c,l),o.push(c)}else o.push(l);else o.push(a)}else!function(){var n=0;e[t].split("-").length>1&&e[t].split("-")[1]>=0&&(n=parseInt(e[t].split("-")[1],10)),Array.prototype.forEach.call(a.getElementsByTagName(e[t].split("-")[0]),(function(e,t){t===n&&o.push(e)}))}()}return o=o.filter((function(e){return null!==e})),this.getElementsByXPath(e,t+1,o)}},{key:"getElementToRender",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=null;if(null!==this._config.configGroups[t].rendertopath){var o=s.breakXPath(this._config.configGroups[t].rendertopath);n=e;for(var r=0;r<o.length;r++){var i=o[r];if(null===n)break;if("."!==i)if(".."===i)n=n.parentElement;else if("."===i[0])n=n.getElementsByClassName(i.substr(1)).length?n.getElementsByClassName(i.substr(1))[0]:null;else if("#"===i[0])n=document.getElementById(i.substr(1));else if("::first-child"===i)n=n.children.length>0?n.firstElementChild:null,this._config.configGroups[t].widgetIsFirstChild=!0;else{var a=0;i.split("-").length>1&&i.split("-")[1]>=0&&(a=parseInt(i.split("-")[1],10)),n=n.getElementsByTagName(i.split("-")[0]).length>a?n.getElementsByTagName(i.split("-")[0])[a]:null}}}return n||e.parentElement}},{key:"getPriceText",value:function(e,t){var n=this;if(!t||0===t.length)return e.textContent;if(t.forEach((function(t){n.getElementsByXPath(t,0,[e]).forEach((function(e){e.classList.add("sezzle-ignored-price-element")}))})),!e.getElementsByClassName("sezzle-ignored-price-element").length)return e.textContent;var o=e.cloneNode(!0);return Array.prototype.forEach.call(o.getElementsByTagName("*"),(function(e){-1!==Array.prototype.slice.call(e.classList).indexOf("sezzle-ignored-price-element")&&o.removeChild(e)})),Array.prototype.forEach.call(e.getElementsByClassName("sezzle-ignored-price-element"),(function(e){e.classList.remove("sezzle-ignored-price-element")})),o.textContent}},{key:"startObserve",value:function(e,t){var n=new MutationObserver(t);return n.observe(e,this._config.mutationObserverConfig),n}},{key:"observeRelatedElements",value:function(e,t,n){var o=this;n&&n.forEach((function(n){if("string"==typeof n.relatedPath&&("function"==typeof n.action||"function"==typeof n.initialAction)){var r=o.getElementsByXPath(s.breakXPath(n.relatedPath),0,[e]);r.length>0&&("function"==typeof n.action&&o.startObserve(r[0],(function(e){n.action(e,t)})),"function"==typeof n.initialAction&&n.initialAction(r[0],t))}}))}},{key:"hideSezzleHideElements",value:function(e){var t=this;this._config.configGroups[e].hideClasses.forEach((function(e){t.getElementsByXPath(e).forEach((function(e){e.classList.contains("sezzle-hidden")||e.classList.add("sezzle-hidden")}))}))}}])&&h(t.prototype,n),o&&h(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function y(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function v(e,t,n,o,r,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(o,r)}function z(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var w=function(){function e(t,n,o,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._widgetConfig=t,this._widgetEventLogger=n,this._scrollDistance=0,this._modalNode=null,this._sezzleElement=null,this._vendorsSupportedForDualInstall=["ap","qp","affirm","klarna","shopPay"],this._promotion=o,this._priceProcessor=r,this._isCloseModalListenerAdded=!1,this._languageConfig=i}var t,n,o,r,i;return t=e,(n=[{key:"addClickEventForModal",value:function(e){this._sezzleElement=e.widget,this._sezzleAddClickEvent(e),this._addClickEventForOtherVendors()}},{key:"renderModals",value:function(){this._renderModal(),this._renderOtherVendorModals()}},{key:"_sezzleAddClickEvent",value:function(e){var t=this,n=this._sezzleElement.getElementsByClassName("sezzle-modal-link");Array.prototype.forEach.call(n,(function(n){n.addEventListener("click",(function(n){if(t._processContentForModal(e),n.target.id="sezzle-modal-return",!n.target.classList.contains("no-sezzle-info")){var o,r=document.getElementsByClassName("sezzle-checkout-modal-lightbox");if(Array.prototype.forEach.call(r,(function(e){e.classList.contains("close-sezzle-modal")&&(o=e)})),o){t._disableBodyScroll(!0),o.style.display="block",o.getElementsByClassName("close-sezzle-modal")[0].focus();var i=o.getElementsByClassName("sezzle-modal");i.length&&(i[0].className="sezzle-modal"),t.modalKeyboardNavigation(),t._widgetEventLogger.logEvent("onclick")}}}))}))}},{key:"_addClickEventForOtherVendors",value:function(){var e=this;this._vendorsSupportedForDualInstall.forEach((function(t){var n=e._sezzleElement.getElementsByClassName("".concat(t,"-modal-info-link"));Array.prototype.forEach.call(n,(function(n){n.addEventListener("click",(function(n){n.target.id="sezzle-modal-return",e._disableBodyScroll(!0),document.getElementsByClassName("sezzle-".concat(t,"-modal"))[0].style.display="block",document.getElementsByClassName("sezzle-".concat(t,"-modal"))[0].focus(),e.modalKeyboardNavigation(),e._widgetEventLogger.logEvent("onclick-".concat(t))}))}))}))}},{key:"_disableBodyScroll",value:function(e){var t=document.body;e?(this._scrollDistance=window.pageYOffset||(document.documentElement.clientHeight?document.documentElement.scrollTop:document.body.scrollTop)||0,t.classList.add("sezzle-modal-open"),t.style.top="".concat(-1*this._scrollDistance,"px")):(t.classList.remove("sezzle-modal-open"),window.scrollTo(0,this._scrollDistance),t.style.top=0,document.getElementsByClassName("sezzle-modal")[0].scrollTop=0,this._scrollDistance=0)}},{key:"modalKeyboardNavigation",value:function(){var e=this,t=document.querySelector(".sezzle-checkout-modal-lightbox").querySelectorAll('[tabIndex="0"]'),n=t[0],o=t[t.length-1];document.addEventListener("keydown",(function(t){if("Tab"===t.key)t.shiftKey&&document.activeElement===n?o.focus():document.activeElement===o&&n.focus();else if("Escape"===t.key){for(var r=document.getElementsByClassName("sezzle-checkout-modal-lightbox"),i=0;i<r.length;i++)r[i].style.display="none",e._disableBodyScroll(!1);var a=document.querySelector("#sezzle-modal-return");a?(a.focus(),a.removeAttribute("id")):document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon")?document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon").focus():document.querySelector(".sezzle-checkout-button-wrapper").focus()}}))}},{key:"_renderModal",value:(r=regeneratorRuntime.mark((function e(){var t,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,(t=document.getElementsByClassName("sezzle-checkout-modal-lightbox")).length?this._modalNode=t[0]:(this._modalNode=document.createElement("section"),this._modalNode.className="sezzle-checkout-modal-lightbox close-sezzle-modal",this._modalNode.style.display="none",this._modalNode.tabIndex=0,this._modalNode.role="dialog",this._modalNode.ariaLabel="Sezzle Information",this._modalNode.style.maxHeight="100%",document.getElementsByTagName("html")[0].appendChild(this._modalNode)),!this._widgetConfig.altModalHTML){e.next=7;break}this._modalNode.innerHTML=this._widgetConfig.altModalHTML,e.next=15;break;case 7:if(!document.sezzleDefaultModalVersion||!document.sezzleModalAvailableLanguages){e.next=15;break}return document.sezzleModalAvailableLanguages.split(",").map((function(e){return e.trim()})).indexOf(this._languageConfig._language)>-1?document.modalLanguage=this._languageConfig._language:document.modalLanguage="en",n="".concat(this._widgetConfig.apiEndpoints.sezzleAssetsCDN).concat(document.sezzleDefaultModalVersion),e.next=13,s.httpRequestWrapper("GET",n);case 13:o=e.sent,this._modalNode.innerHTML=o;case 15:this._loadModalScript(),e.next=21;break;case 18:e.prev=18,e.t0=e.catch(0),this._widgetEventLogger.logEvent("error",e.t0.message);case 21:case"end":return e.stop()}}),e,this,[[0,18]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function a(e){v(i,n,o,a,s,"next",e)}function s(e){v(i,n,o,a,s,"throw",e)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"_closeSezzleModalHandler",value:function(){var e=this;Array.prototype.forEach.call(document.getElementsByClassName("close-sezzle-modal"),(function(t){t.addEventListener("click",(function(t){e._disableBodyScroll(!1),e._modalNode.style.display="none",e._modalNode.getElementsByClassName("sezzle-modal")[0].className="sezzle-modal sezzle-checkout-modal-hidden";var n=document.querySelector("#sezzle-modal-return");n?(n.focus(),n.removeAttribute("id")):document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon")?document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon").focus():document.querySelector(".sezzle-checkout-button-wrapper").focus()}))}));var t=document.getElementsByClassName("sezzle-modal")[0];t||(t=document.getElementsByClassName("sezzle-checkout-modal-lightbox")[0]),t.addEventListener("click",(function(e){return e.stopPropagation()})),this._isCloseModalListenerAdded=!0}},{key:"_renderOtherVendorModals",value:function(){var e=this;this._vendorsSupportedForDualInstall.forEach((function(t){if(document.getElementsByClassName("".concat(t,"-modal-info-link")).length>0){var n=document.createElement("section");n.className="sezzle-checkout-modal-lightbox sezzle-".concat(t,"-modal"),n.style="position: center",n.style.display="none",n.tabIndex=0,n.role="dialog",n.ariaLabel="".concat(t," Information"),n.innerHTML=e._widgetConfig["".concat(t,"ModalHTML")]||"",document.getElementsByTagName("html")[0].appendChild(n),n.addEventListener("click",(function(o){e._disableBodyScroll(!1),n.style.display="none";var r=document.querySelector("#sezzle-modal-return");r?(r.focus(),r.removeAttribute("id")):document.querySelector(".".concat(t,"-modal-info-link"))?document.querySelector(".sezzle-checkout-button-wrapper").getElementsByClassName("".concat(t,"-modal-info-link"))[0].focus():document.querySelector(".sezzle-checkout-button-wrapper").focus(),o.stopPropagation()}))}}))}},{key:"_addPromoToModal",value:function(){if(document.sezzlePromotion){var e=document.createElement("div");e.className="promo";var t=this._promotion.getModalPromotionString();if(t.includes(this._promotion.promoInitiative.name)){var n=document.createElement("a");n.href=this._promotion.promoInitiative.link,n.target="_blank",n.rel="noopener",n.textContent=this._promotion.promoInitiative.name;var o=y(t.split(this._promotion.promoInitiative.name)),r=o[0],i=o.slice(1);e.append(r,n,i)}else e.append(t);var a=document.querySelector(".terms");a.parentElement.insertBefore(e,a)}}},{key:"_loadModalScript",value:function(){if(!document.sezzleDefaultModalVersion||!document.sezzleModalAvailableLanguages)return null;var e=document.head,t=document.createElement("script");t.innerHTML=this._modalNode.querySelector("script").innerHTML,e.appendChild(t)}},{key:"_processContentForModal",value:function(e){if(!document.sezzleDefaultModalVersion||!document.sezzleModalAvailableLanguages)return null;var t=this._priceProcessor.getParsedPrice(e.priceElement,e.configGroup.ignoredPriceElements,e.configGroup.ignoredFormattedPriceText);if(!t)return this._widgetEventLogger.logEvent("warning","Cannot render modal. Failed to parse price for the element ".concat(e.id)),null;var n=this._priceProcessor.getProductPriceEligibility(t);n.isLongTermPaymentEligible?document.longTermPayment=this._priceProcessor.getFormattedLongTermPaymentInfo(t,"$"):document.longTermPayment=null,this._executeModalScript(n.isLongTermPaymentEligible)}},{key:"_executeModalScript",value:function(e){ModalUI?ModalUI.load():this._widgetEventLogger.logEvent("error","ModalUI is undefined. Problem adding modal script to the document"),e||this._addPromoToModal(),this._isCloseModalListenerAdded||this._closeSezzleModalHandler()}}])&&z(t.prototype,n),o&&z(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function C(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function k(e,t,n){E(e,t),t.set(e,n)}function E(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _(e,t,n,o){return A(e,t),O(n,"set"),T(e,n,o),o}function P(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function x(e,t){return M(e,S(e,t,"get"))}function L(e,t,n){return T(e,S(e,t,"set"),n),n}function S(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function T(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function W(e,t,n){return A(e,t),O(n,"get"),M(e,n)}function O(e,t){if(void 0===e)throw new TypeError("attempted to "+t+" private static field before its declaration")}function A(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}function M(e,t){return t.get?t.get.call(e):t.value}var j=new WeakMap,N=new WeakMap,F=new WeakMap,B=new WeakSet,G=function(){function e(t,n){var o,r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),E(o=this,r=B),r.add(o),k(this,j,{writable:!0,value:void 0}),k(this,N,{writable:!0,value:void 0}),k(this,F,{writable:!0,value:void 0}),!W(e,e,R))throw new Error("Use static initializer to initialize the logger");L(this,j,t),L(this,N,n),L(this,F,[])}var t,n,o;return t=e,o=[{key:"NewWidgetEventLogger",value:function(t,n){return W(e,e,D)||(_(e,e,R,!0),_(e,e,D,new e(t,n))),W(e,e,D)}},{key:"Destruct",value:function(){_(e,e,D,null)}}],(n=[{key:"logEvent",value:function(e,t){var n={name:e,description:null!=t?t:"",createdAt:(new Date).toJSON()};x(this,N)&&"error"!==n.name&&"warning"!==n.name||!n.name.startsWith("onclick")&&this.isEventLogged(n.name,n.description)||x(this,F).push(n),n.name.startsWith("onclick")&&(P(this,B,I).call(this),L(this,F,[]))}},{key:"isEventLogged",value:function(e,t){return x(this,F).some((function(n){return n.name===e&&n.description===t}))}},{key:"forceSendEvents",value:function(){P(this,B,I).call(this),L(this,F,[])}}])&&C(t.prototype,n),o&&C(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function I(){var e=this;try{var t=[];x(this,F).forEach((function(n){var o;t.push({event_name:n.name,description:n.description,merchant_uuid:null!==(o=x(e,j))&&void 0!==o?o:"",merchant_site:window.location.hostname,created_at:n.createdAt})})),t.length>0&&s.sendEvents(t)}catch(e){console.log(e)}}var R={writable:!0,value:void 0},D={writable:!0,value:void 0},H=G;function U(e){return(U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function q(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var V=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._numberOfPayments=t,this._isEU="https://widget.eu.sezzle.com"===s.getWidgetBaseUrl(),this._defaultLanguage=this._isEU?"en-GB":"en",this._translations={en:"or ".concat(this._numberOfPayments," interest-free payments of %%price%%{promotext} with %%logo%% %%info%%"),fr:"ou ".concat(this._numberOfPayments," paiements de %%price%% sans intérêts{promotext} avec %%logo%% %%info%%"),de:"oder ".concat(this._numberOfPayments," zinslose Zahlungen von je %%price%%{promotext} mit %%logo%% %%info%%"),es:"o ".concat(this._numberOfPayments," pagos sin intereses de %%price%%{promotext} con %%logo%% %%info%%"),"en-GB":"or ".concat(this._numberOfPayments," payments of %%price%%{promotext} with %%logo%% %%info%% - no fee"),"fr-FR":"ou ".concat(this._numberOfPayments," paiements de %%price%%{promotext} avec %%logo%% %%info%% – sans frais"),"de-DE":"oder ".concat(this._numberOfPayments," mal %%price%%{promotext} mit %%logo%% %%info%% - kostenlos"),"es-ES":"o ".concat(this._numberOfPayments," cuotas de %%price%%{promotext} con %%logo%% %%info%% - sin coste"),"it-IT":"o ".concat(this._numberOfPayments," pagamenti di %%price%%{promotext} con %%logo%% %%info%% - nessuna commissione")},this._longTermTranslations={en:"or monthly payments as low as %%price%% with %%logo%% %%info%%",fr:"ou des paiements mensuels aussi bas que %%price%% avec %%logo%% %%info%%",de:"oder monatliche Zahlungen von nur %%price%% mit %%logo%% %%info%%",es:"o pagos mensuales tan bajos como %%price%% con %%logo%% %%info%%"},this._language=null}var t,n,o;return t=e,(n=[{key:"getTranslation",value:function(){return this._translations[this._language]}},{key:"getLongTermWidgetText",value:function(){return this._longTermTranslations[this._language]||this._longTermTranslations[this._defaultLanguage]}},{key:"setLanguage",value:function(e){var t;if((t="function"==typeof e?e():e)&&"string"==typeof t){var n=t.substring(0,2).toLowerCase(),o=t.split("-")[1];this._isEU?o&&this._checkIfLanguageIsValid(t)?this._language=t:this._checkIfLanguageIsValid("".concat(n,"-").concat(n.toUpperCase()))?this._language="".concat(n,"-").concat(n.toUpperCase()):this._language=this._defaultLanguage:this._checkIfLanguageIsValid(n)?this._language=n:this._language=this._defaultLanguage}else this._language=this._defaultLanguage}},{key:"_checkIfLanguageIsValid",value:function(e){var t=0;return Object.getOwnPropertyNames(this._translations).forEach((function(n){n===e&&t++})),t>0}},{key:"constructWidgetTemplate",value:function(e){return"object"===U(e)&&null!=e?e.en||e[this._language]?e[this._language]||e.en:(console.warn("Please specify at least 'en' key in altVersionTemplate, rendering default widget template."),this.getTranslation(this._numberOfPayments)):e}},{key:"getLanguage",value:function(){return this._language}}])&&q(t.prototype,n),o&&q(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function X(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var $=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.promoTranslations={main:{reward:{is_new_user_only:{true:{threshold:{true:{promocode:{true:[{en:". Get {money} back on your first purchase of {threshold} or more using promo code {promocode}"},{fr:". {money} remboursés sur votre premier achat de {threshold} ou plus en utilisant le code promo {promocode}"},{de:". Bekomme {money} zurück bei deinem ersten Einkauf ab {threshold} über dem Aktionscode {promocode}"},{es:". Consigue {money} de vuelta en tu primera compra de {threshold} o más usando el código promocional {promocode}"},{"en-GB":". Get {money} back on your first purchase of {threshold} or more using promo code {promocode}"},{"fr-FR":". Obtenez une remise de {money} sur votre premier achat de {threshold} ou plus en utilisant le code promo {promocode}"},{"de-DE":". Bekomme {money} zurück bei deinem ersten Einkauf ab {threshold} über dem Aktionscode {promocode}"},{"es-ES":". Consigue {money} de vuelta en tu primera compra de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} back on your first purchase of {threshold} or more"},{fr:". {money} remboursés sur votre premier achat de {threshold} ou plus"},{de:". Bekomme {money} zurück bei deinem ersten Einkauf ab {threshold}"},{es:". Recibe {money} de vuelta en tu primera compra de {threshold} o más"},{"en-GB":". Get {money} back on your first purchase of {threshold} or more"},{"fr-FR":". Obtenez {money} de remise sur votre premier achat de {threshold} ou plus"},{"de-DE":". Bekomme {money} zurück bei deinem ersten Einkauf ab {threshold}"},{"es-ES":". Recibe {money} de vuelta en tu primera compra de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} back on your first purchase using promo code {promocode}"},{fr:". {money} remboursés sur votre premier achat en utilisant le code promo {promocode}"},{de:". Bekomme {money} zurück bei deinem ersten Einkauf über den Aktionscode {promocode}"},{es:". Recibe {money} de vuelta en tu primera compra usando el código promocional {promocode}"},{"en-GB":". Get {money} back on your first purchase using promo code {promocode}"},{"fr-FR":". Obtenez une remise de {money} sur votre premier achat en utilisant le code promo {promocode}"},{"de-DE":". Bekomme {money} zurück bei deinem ersten Einkauf über den Aktionscode {promocode}"},{"es-ES":". Recibe {money} de vuelta en tu primera compra usando el código promocional {promocode}"}],false:[{en:". Get {money} back on your first purchase"},{fr:". {money} remboursés sur votre premier achat"},{de:". Bekomme {money} zurück bei deinem ersten Einkauf"},{es:". Recibe {money} de vuelta en tu primera compra"},{"en-GB":". Get {money} back on your first purchase"},{"fr-FR":". Obtenez {money} de remise sur votre premier achat"},{"de-DE":". Bekomme {money} zurück bei deinem ersten Einkauf"},{"es-ES":". Recibe {money} de vuelta en tu primera compra"}]}}}},false:{threshold:{true:{promocode:{true:[{en:". Get {money} back on purchases of {threshold} or more using promo code {promocode}"},{fr:". Recevez {money} de remboursement sur vos achats de {threshold} ou plus en utilisant le code promo {promocode}"},{de:". Bekomme {money} zurück auf Einkäufe ab {threshold} über den Aktionscode {promocode}"},{es:". Obtén {money} de vuelta en compras de {threshold} o más usando el código promocional {promocode}"},{"en-GB":". Get {money} back on purchases of {threshold} or more using promo code {promocode}"},{"fr-FR":". Recevez {money} de remboursement sur vos achats de {threshold} ou plus en utilisant le code promo {promocode}"},{"de-DE":". Bekomme {money} zurück auf Einkäufe ab {threshold} über den Aktionscode {promocode}"},{"es-ES":". Obtén {money} de vuelta en compras de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} back on purchases of {threshold} or more"},{fr:". Obtenez {money} de remboursement sur vos achats de plus de {threshold}"},{de:". Bekomme {money} zurück auf Einkäufe ab {threshold}"},{es:". Obtén {money} de vuelta en tus compras de {threshold} o más"},{"en-GB":". Get {money} back on purchases of {threshold} or more"},{"fr-FR":". Obtenez {money} de remboursement sur vos achats de plus de {threshold}"},{"de-DE":". Bekomme {money} zurück auf Einkäufe ab {threshold}"},{"es-ES":". Obtén {money} de vuelta en tus compras de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} back using promo code {promocode}"},{fr:". {money} remboursés en utilisant le code promo {promocode}"},{de:". Bekomme {money} zurück über den Aktionscode {promocode}"},{es:". Recibe {money} de vuelta usando el código promocional {promocode}"},{"en-GB":". Get {money} back using promo code {promocode}"},{"fr-FR":". Obtenez une remise de {money} en utilisant le code promo {promocode}"},{"de-DE":". Bekomme {money} zurück über den Aktionscode {promocode}"},{"es-ES":". Recibe {money} de vuelta usando el código promocional {promocode}"}],false:[{en:". Get {money} back"},{fr:". {money} remboursés"},{de:". Bekomme {money} zurück"},{es:". Recibe {money} de vuelta"},{"en-GB":". Get {money} back"},{"fr-FR":". Obtenez une remise de {money}"},{"de-DE":". Bekomme {money} zurück"},{"es-ES":". Recibe {money} de vuelta"}]}}}}}},discount:{is_new_user_only:{true:{threshold:{true:{promocode:{true:[{en:". Get {money} off your first purchase of {threshold} or more using promo code {promocode}"},{fr:". Obtenez {money} de remise sur votre premier achat de {threshold} ou plus en utilisant le code promo {promocode}"},{de:". Erhalten {money} Rabatt auf deinen ersten Einkauf von {threshold} oder mehr über den Aktionscode {promocode}"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más usando el código promocional {promocode}"},{"en-GB":". Get {money} off your first purchase of {threshold} or more using promo code {promocode}"},{"fr-FR":". Obtenez {money} de remise sur votre premier achat de {threshold} ou plus en utilisant le code promo {promocode}"},{"de-DE":". Erhalten {money} Rabatt auf deinen ersten Einkauf von {threshold} oder mehr über den Aktionscode {promocode}"},{"es-ES":". Obtén {money} de descuento en tu primera compra de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} off your first purchase of {threshold} or more"},{fr:". Obtenez {money} de remise sur votre premier achat de {threshold} ou plus"},{de:". Erhalte {money} Rabatt auf deinen ersten Einkauf ab {threshold} oder mehr"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más"},{"en-GB":". Get {money} off your first purchase of {threshold} or more"},{"fr-FR":". Obtenez {money} de remise sur votre premier achat de {threshold} ou plus"},{"de-DE":". Erhalte {money} Rabatt auf deinen ersten Einkauf ab {threshold} oder mehr"},{"es-ES":". Obtén {money} de descuento en tu primera compra de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} off your first purchase using promo code {promocode}"},{fr:". Obtenez {money} de remise sur votre premier achat en utilisant le code promo {promocode}"},{de:". Erhalte {money} Rabatt auf deinen ersten Einkauf über den Aktionscode {promocode}"},{es:". Obtén {money} de descuento en tu primera compra usando el código promocional {promocode}"},{"en-GB":". Get {money} off your first purchase using promo code {promocode}"},{"fr-FR":". Obtenez {money} de remise sur votre premier achat en utilisant le code promo {promocode}"},{"de-DE":". Erhalte {money} Rabatt auf deinen ersten Einkauf über den Aktionscode {promocode}"},{"es-ES":". Obtén {money} de descuento en tu primera compra usando el código promocional {promocode}"}],false:[{en:". Get {money} off your first purchase"},{fr:". Obtenez {money} de remise sur votre premier achat"},{de:". Erhalte {money} Rabatt auf deinen ersten Einkauf"},{es:". Obtén {money} de descuento en tu primera compra"},{"en-GB":". Get {money} off your first purchase"},{"fr-FR":". Obtenez {money} de remise sur votre premier achat"},{"de-DE":". Erhalte {money} Rabatt auf deinen ersten Einkauf"},{"es-ES":". Obtén {money} de descuento en tu primera compra"}]}}}},false:{threshold:{true:{promocode:{true:[{en:". Get {money} off on purchases of {threshold} or more using promo code {promocode}"},{fr:". Obtenez {money} de remise sur vos achats de {threshold} ou plus en utilisant le code promo {promocode}"},{de:". Erhalte einen Rabatt von {money} auf Einkäufe ab {threshold} über den Aktionscode {promocode}"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más usando el código promocional {promocode}"},{"en-GB":". Get {money} off on purchases of {threshold} or more using promo code {promocode}"},{"fr-FR":". Obtenez {money} de remise sur vos achats de {threshold} ou plus en utilisant le code promo {promocode}"},{"de-DE":". Erhalte einen Rabatt von {money} auf Einkäufe ab {threshold} über den Aktionscode {promocode}"},{"es-ES":". Obtén {money} de descuento en tu primera compra de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} off on purchases of {threshold} or more"},{fr:". Obtenez {money} de remise sur vos achats de {threshold} ou plus"},{de:". Erhalte einen Rabatt von {money} auf Einkäufe ab {threshold}"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más"},{"en-GB":". Get {money} off on purchases of {threshold} or more"},{"fr-FR":". Obtenez {money} de remise sur vos achats de {threshold} ou plus"},{"de-DE":". Erhalte einen Rabatt von {money} auf Einkäufe ab {threshold}"},{"es-ES":". Obtén {money} de descuento en tu primera compra de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} off using promo code {promocode}"},{fr:". Obtenez {money} de remise en utilisant le code promo {promocode}"},{de:". Erhalte {money} Rabatt mit dem Aktionscode {promocode}"},{es:". Obtén {money} de descuento usando el código promocional {promocode}"},{"en-GB":". Get {money} off using promo code {promocode}"},{"fr-FR":". Obtenez {money} de remise en utilisant le code promo {promocode}"},{"de-DE":". Erhalte {money} Rabatt mit dem Aktionscode {promocode}"},{"es-ES":". Obtén {money} de descuento usando el código promocional {promocode}"}],false:[{en:". Get {money} off"},{fr:". Obtenez {money} de remise"},{de:". Erhalte {money} Rabatt"},{es:". Obtén {money} de descuento"},{"en-GB":". Get {money} off"},{"fr-FR":". Obtenez {money} de remise"},{"de-DE":". Erhalte {money} Rabatt"},{"es-ES":". Obtén {money} de descuento"}]}}}}}}},modal:[{en:"Customer will receive {promoinitiative} award at the time of their purchase."},{fr:"Les clients obtiendront des {promoinitiative} en récompense au moment de leur achat."},{de:"Kunden erhalten zum Zeitpunkt des Kaufs eine {promoinitiative}-Prämie."},{es:"Los clientes recibirán una recompensa {promoinitiative} al realizar la compra."},{"en-GB":"Customer will receive {promoinitiative} award at the time of their purchase."},{"fr-FR":"Les clients recevront une récompense {promoinitiative} au moment de leur achat."},{"de-DE":"Kunden erhalten zum Zeitpunkt des Kaufs eine {promoinitiative}-Prämie."},{"es-ES":"Los clientes recibirán una recompensa {promoinitiative} al realizar la compra."}]}}var t,n,o;return t=e,(n=[{key:"getMainViewTranslationTextByLanguage",value:function(e,t,n,o,r,i){var a=this.promoTranslations.main[e].is_new_user_only[t].threshold[n].promocode[o];if(a){var s=a.find((function(e){return e["".concat(r)]}));return s?s["".concat(r)]:(s=a.find((function(e){return e["".concat(i)]})))["".concat(i)]}return""}},{key:"getModalViewTranslationTextByLanguage",value:function(e,t){var n=this.promoTranslations.modal;if(n){var o=n.find((function(t){return t["".concat(e)]}));return o?o["".concat(e)]:(o=n.find((function(e){return e["".concat(t)]})))["".concat(t)]}return""}}])&&X(t.prototype,n),o&&X(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function K(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var J=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.promoConfig=t,this.promoConfig&&(this.promoInitiative={name:this.promoConfig.promo_initiative_name,link:this.promoConfig.promo_initiative_link}),this.language=n._language,this.defaultLanguage=n._defaultLanguage,this.promoTranslations=new $}var t,n,o;return t=e,o=[{key:"getPromotionString",value:function(t,n,o,r){var i=Q[t.type],a=!!t.spend_award_threshold_in_cents,s=!!t.is_new_user_only&&t.is_new_user_only,l=!!t.promo_code,c=r.getMainViewTranslationTextByLanguage(i,s,a,l,n,o);return c=c.replace("{money}",e.format(n,t.currency_code,t.spend_award_in_cents)),a&&(c=c.replace("{threshold}",e.format(n,t.currency_code,t.spend_award_threshold_in_cents))),l&&(c=c.replace("{promocode}",t.promo_code)),c}},{key:"format",value:function(e,t,n){var o=new Intl.NumberFormat(e,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:0}),r=new Intl.NumberFormat(e,{style:"currency",currency:t,minimumFractionDigits:2}),i=parseInt(n)/100;return i%1==0?o.format(i):r.format(i)}}],(n=[{key:"getModalPromotionString",value:function(){return this.promoConfig?this.promoTranslations.getModalViewTranslationTextByLanguage(this.language,this.defaultLanguage).replace("{promoinitiative}",this.promoInitiative.name):""}},{key:"getPromotionString",value:function(){return this.promoConfig?e.getPromotionString(this.promoConfig,this.language,this.defaultLanguage,this.promoTranslations):""}}])&&K(t.prototype,n),o&&K(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Q={1:"reward",2:"discount"},Z=J;function Y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ee(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function te(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ne(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function oe(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var re=new WeakSet,ie=new WeakSet,ae=new WeakSet,se=new WeakSet;function le(e,t,n){if(n>0){var o=n/100/12,r=Math.pow(1+o,t);return e*o*r/(r-1)}return e/t}function ce(e){return oe(this,ae,ue).call(this,e)[0]}function ue(e){var t,n=Y(this.terms);try{for(n.s();!(t=n.n()).done;){var o=t.value;if(e>o.price)return o.options}}catch(e){n.e(e)}finally{n.f()}return this.terms[this.terms.length-1].options}function de(e){return Math.round(100*e)/100}var fe=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ne(this,se),ne(this,ae),ne(this,ie),ne(this,re),this.terms=t||[{price:1e3,options:[[48,8.99],[36,7.99],[3,0]]},{price:500,options:[[24,7.99],[12,6.99],[3,0]]},{price:250,options:[[12,6.99],[9,5.99],[3,0]]},{price:100,options:[[9,5.99],[6,5.99],[3,0]]}]}var t,n,o;return t=e,(n=[{key:"getPaymentInfo",value:function(e){var t=this;if(!e||e<=0)throw new Error("Unable to calculate Long Term payments: product price is undefined or non-positive");var n=oe(this,ae,ue).call(this,e),o={productPrice:e,paymentTerms:[]};return o.paymentTerms=n.map((function(n){var o=n[0],r=n[1],i=oe(t,re,le).call(t,e,o,r),a=oe(t,se,de).call(t,i*o);return{durationInMonths:o,apr:r,monthlyPayment:i,totalAmount:a,totalInterest:a-e}})),o.paymentTerms.sort((function(e,t){return e.monthlyPayment-t.monthlyPayment})),o}},{key:"calculateLowestAvailablePayment",value:function(e){if(!e||e<=0)throw new Error("Unable to calculate lowest Long Term payment: product price is undefined or non-positive");var t=oe(this,ie,ce).call(this,e);return oe(this,re,le).call(this,e,t[0],t[1])}}])&&te(t.prototype,n),o&&te(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function me(e){return function(e){if(Array.isArray(e))return he(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ge(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(e,t){if(e){if("string"==typeof e)return he(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?he(e,t):void 0}}function he(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function pe(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function ye(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function be(e,t){return function(e,t){if(t.get)return t.get.call(e);return t.value}(e,ze(e,t,"get"))}function ve(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,ze(e,t,"set"),n),n}function ze(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var we=new WeakMap,Ce=new WeakMap,ke=function(){function e(t,n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ye(this,we,{writable:!0,value:void 0}),ye(this,Ce,{writable:!0,value:void 0}),this.sezzleDOMFunctions=o,this.widgetConfig=t,this.longTermPaymentConfig=n,ve(this,we,"{price}"),ve(this,Ce,2),this.thousandDelimiter=/\B(?=(\d{3})+(?!\d))/g,this.naFormat=/^\d{1,3}(,\d{3})+(\.\d+)?$/,this.euFormat=/^\d{1,3}(\.\d{3})+(,\d+)?$/,this.euFormatWithSpace=/^\d{1,3}(\s\d{3})+(,\d+)?$/,this.euDecimalsNoThousandDelimiterFormat=/(^\d+((,\d{1,2})|(,\d{4,}))$)|(^\d{4,},\d+$)/}var t,n,o;return t=e,(n=[{key:"getParsedPrice",value:function(e,t,n){var o=this,r=this.sezzleDOMFunctions.getPriceText(e,t);if(!r)return null;r=r.replace("\n","").trim(),n&&n.forEach((function(e){var t=new RegExp(e,"ig");r=r.replace(t,"")}));var i=/\d+((\.|,|\s)\d+)*/g,a=me(r.matchAll(i));if(0===a.length||a.length>2)return null;var s={formatter:r.replace(i,be(this,we)),prices:[]};return s.prices=a.map((function(e){var t,n=e[0];return o.naFormat.test(e[0])&&(n=e[0].replaceAll(",",""),t=o.naFormat),o.euFormat.test(e[0])&&(n=e[0].replaceAll(".","").replaceAll(",","."),t=o.euFormat),o.euFormatWithSpace.test(e[0])&&(n=e[0].replaceAll(" ","").replaceAll(",","."),t=o.euFormatWithSpace),o.euDecimalsNoThousandDelimiterFormat.test(e[0])&&(n=e[0].replaceAll(",","."),t=o.euDecimalsNoThousandDelimiterFormat),{value:parseFloat(n),format:t}})),s}},{key:"getFormattedWidgetPrice",value:function(e,t){if(!e.prices||0===e.prices.length)throw new Error("Cannot get formatted widget price: no product prices are provided");var n,o=e.formatter,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ge(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(e.prices);try{for(r.s();!(n=r.n()).done;){var i=n.value,a=void 0,s=void 0;switch(a=t?new fe(this.longTermPaymentConfig.paymentTerms).calculateLowestAvailablePayment(i.value).toFixed(be(this,Ce)):(i.value/this.widgetConfig.numberOfPayments).toFixed(be(this,Ce)),i.format){case this.naFormat:s=a.toString().replace(this.thousandDelimiter,",");break;case this.euFormat:s=a.toString().replace(".",",").replace(this.thousandDelimiter,".");break;case this.euFormatWithSpace:s=a.toString().replace(".",",").replace(this.thousandDelimiter," ");break;case this.euDecimalsNoThousandDelimiterFormat:s=a.toString().replace(".",",");break;default:s=a.toString()}o=o.replace(be(this,we),s)}}catch(e){r.e(e)}finally{r.f()}return o}},{key:"getProductPriceEligibility",value:function(e){var t=100*e.prices[0].value;return{isShortTermPaymentEligible:!!(t>=this.widgetConfig.minPrice&&t<=this.widgetConfig.maxPrice),isLongTermPaymentEligible:!!(this.longTermPaymentConfig&&t>=this.longTermPaymentConfig.minPrice&&t<=this.longTermPaymentConfig.maxPrice)}}},{key:"getFormattedLongTermPaymentInfo",value:function(e,t){var n=this;if(!t)throw new Error("Cannot get formatted long term payment info: the currency symbol is not provided");var o=e.prices[0].value,r=new fe(this.longTermPaymentConfig.paymentTerms).getPaymentInfo(o),i={productPrice:t+r.productPrice.toFixed(be(this,Ce)).replace(this.thousandDelimiter,","),paymentTerms:[]};return i.paymentTerms=r.paymentTerms.map((function(e){return{durationInMonths:e.durationInMonths,apr:e.apr+"%",monthlyPayment:t+e.monthlyPayment.toFixed(be(n,Ce)).replace(n.thousandDelimiter,","),totalAmount:t+e.totalAmount.toFixed(be(n,Ce)).replace(n.thousandDelimiter,","),totalInterest:t+e.totalInterest.toFixed(be(n,Ce)).replace(n.thousandDelimiter,",")}})),i}}])&&pe(t.prototype,n),o&&pe(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Ee(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _e(e,t){Pe(e,t),t.add(e)}function Pe(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xe(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function Le(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,Se(e,t,"set"),n),n}function Se(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var Te=new WeakMap,We=new WeakSet,Oe=new WeakSet,Ae=new WeakSet,Me=new WeakSet,je=new WeakSet,Ne=new WeakSet,Fe=new WeakSet,Be=new WeakSet,Ge=new WeakSet,Ie=new WeakSet,Re=new WeakSet,De=new WeakSet,He=new WeakSet,Ue=new WeakSet,qe=new WeakSet,Ve=new WeakSet,Xe=new WeakSet,$e=new WeakSet;function Ke(e){var t,n=this;e=e.filter((function(e){return null!=e.widget})),this.widgetConfig.configGroups.forEach((function(t,o){n.sezzleDOMFunctions.getElementsByXPath(t.xpath).forEach((function(r){if(!r.hasAttribute("data-sezzleindex")){var i=n.render(r,o,t);if(i){n.widgetEventLogger.logEvent("onload");try{var a={priceElement:r,observer:n.sezzleDOMFunctions.startObserve(r,(function(e){n.mutationCallBack(e,t,n.priceProcessor)})),widget:i,configGroup:t};e.push(a),n.modal.addClickEventForModal(a),n.sezzleDOMFunctions.observeRelatedElements(a.priceElement,a.widget,a.configGroup.relatedElementActions)}catch(e){n.widgetEventLogger.logEvent("warning","The widget has been rendered, but an error occurred when running additional instructions: ".concat(e.message))}}}}))})),e.forEach((function(e){document.body.contains(e.priceElement)||(null!==e.observer&&e.observer.disconnect(),e.widget.remove(),e.widget=null)}));for(var o=0,r=this.widgetConfig.configGroups.length;o<r;o++)this.sezzleDOMFunctions.hideSezzleHideElements(o);setTimeout((function(){return xe(n,We,Ke).call(n,e)}),function(e,t){return t.get?t.get.call(e):t.value}(t=this,Se(t,Te,"get")));var i=document.getElementsByClassName("sezzle-")[0];void 0!==i&&(i.classList.contains("sezzle-hidden")||i.classList.add("sezzle-hidden"))}function Je(e,t){var n;n=e.altVersionTemplate?this.language.constructWidgetTemplate(e.altVersionTemplate):t?this.language.getLongTermWidgetText():this.language.getTranslation();var o=this.promotion.getPromotionString();return n=n.replace("{promotext}",o).split("%%")}function Qe(e,t){switch(t.widgetType){case"cart":e.className+=" sezzle-cart-page-widget";break;case"product-page":e.className+=" sezzle-product-page-widget";break;case"product-preview":e.className+=" sezzle-product-preview-widget";break;default:e.className+=" sezzle-product-page-widget"}}function Ze(e){if(!e)return"left";var t=window.getComputedStyle(e).textAlign;return"start"===t||"justify"===t?"left":"end"===t?"right":t}function Ye(e){return e.className+=" sezzle-".concat(this.widgetConfig.merchantID),e}function et(e,t){e.style.marginTop="".concat(t.marginTop,"px"),e.style.marginBottom="".concat(t.marginBottom,"px"),e.style.marginLeft="".concat(t.marginLeft,"px"),e.style.marginRight="".concat(t.marginRight,"px")}function tt(e,t){e.style.transformOrigin="top ".concat(t.alignment),e.style.transform="scale(".concat(t.scaleFactor,")"),t.fixedHeight&&(e.style.height="".concat(t.fixedHeight,"px"),e.style.overflow="hidden")}function nt(e,t){var n="";if(matchMedia&&t.alignmentSwitchMinWidth&&t.alignmentSwitchType){var o="(min-width: ".concat(t.alignmentSwitchMinWidth,"px)");window.matchMedia(o).matches||(n=t.alignmentSwitchType)}var r=n||t.alignment||"auto";e.className+=" sezzle-".concat(r)}function ot(e,t){xe(this,Be,nt).call(this,e,t),xe(this,Ie,rt).call(this,e,t),xe(this,De,at).call(this,e,t),xe(this,He,st).call(this,e,t),xe(this,Re,it).call(this,e,t)}function rt(e,t){t.fontWeight&&(e.style.fontWeight=t.fontWeight),t.fontFamily&&(e.style.fontFamily=t.fontFamily),"inherit"!==t.fontSize&&(e.style.fontSize="".concat(t.fontSize,"px")),e.style.lineHeight=t.lineHeight||"13px"}function it(e,t){t.maxWidth&&(e.style.maxWidth="".concat(t.maxWidth,"px"))}function at(e,t){t.textColor&&(e.style.color=t.textColor)}function st(e,t){switch(t.theme){case"dark":case"white":case"white-flat":case"white-pill":e.className+=" szl-dark";break;default:e.className+=" szl-light"}}function lt(e,t){e.style.transformOrigin="top ".concat(t.alignment),e.style.transform="scale(".concat(t.logoSize,")")}function ct(e,t){Object.keys(t.logoStyle).forEach((function(n){e.style[n]=t.logoStyle[n]}))}function ut(e,t){t.parentNode.insertBefore(e,t.nextSibling)}function dt(e,t){for(t.parentElement.insertBefore(e,t);e.previousSibling;)e.parentElement.insertBefore(e,e.previousSibling)}function ft(e){Array.isArray(e)&&0!=e.length&&e.forEach((function(e){var t=document.querySelectorAll(e.element);t.length>0&&t.forEach((function(t){t.addEventListener(e.eventType,(function(){document.querySelector("[data-sezzleindex]").removeAttribute("data-sezzleindex"),document.querySelector(".sezzle-shopify-info-button").remove();var e=H.NewWidgetEventLogger(document.sezzleConfig.merchantID,document.sezzleConfig.noTracking);new yt(document.sezzleConfig,e).init()}))}))}))}var mt=function(){function e(t,n){var o,r,i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_e(this,$e),_e(this,Xe),_e(this,Ve),_e(this,qe),_e(this,Ue),_e(this,He),_e(this,De),_e(this,Re),_e(this,Ie),_e(this,Ge),_e(this,Be),_e(this,Fe),_e(this,Ne),_e(this,je),_e(this,Me),_e(this,Ae),_e(this,Oe),_e(this,We),i={writable:!0,value:void 0},Pe(o=this,r=Te),r.set(o,i),Le(this,Te,2e3),this.widgetConfig=t,this.widgetEventLogger=n,this.sezzleDOMFunctions=new p(t),this.language=new V(this.widgetConfig.numberOfPayments||4),this.language.setLanguage(this.widgetConfig.config.language),this.promotion=new Z(document.sezzlePromotion,this.language),this.priceProcessor=new ke(t,document.longTermPaymentConfig,this.sezzleDOMFunctions),this.modal=new w(t,n,this.promotion,this.priceProcessor,this.language)}var t,n,o;return t=e,(n=[{key:"initializeRendering",value:function(){xe(this,$e,ft).call(this,this.widgetConfig.observeElements),xe(this,We,Ke).call(this,[]),this.modal.renderModals()}},{key:"mutationCallBack",value:function(e,t,n){var o=this;e.filter((function(e){return"childList"===e.type})).forEach((function(e){var r=e.target.dataset.sezzleindex,i=document.getElementsByClassName("sezzleindex-".concat(r))[0];if(i){var a=i.parentElement,s=a.parentElement.parentElement;try{s.classList.remove("sezzle-hidden");var l=n.getParsedPrice(e.target,t.ignoredPriceElements,t.ignoredFormattedPriceText),c=n.getProductPriceEligibility(l);c.isShortTermPaymentEligible||c.isLongTermPaymentEligible||s.classList.add("sezzle-hidden");var u=o.getWidgetInnerContent(t,r,c,l);a.innerHTML=u.innerHTML}catch(e){s.classList.add("sezzle-hidden"),o.widgetEventLogger.logEvent("warning",e.message)}}}))}},{key:"render",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2?arguments[2]:void 0;try{if(e.classList.contains("sezzle-ignored-price-element"))return null;var r=this.priceProcessor.getParsedPrice(e,o.ignoredPriceElements,o.ignoredFormattedPriceText);if(!r)return this.widgetEventLogger.logEvent("warning","Cannot render widget. Failed to parse price for the element ".concat(e.id)),null;var i=this.priceProcessor.getProductPriceEligibility(r);if(!i.isShortTermPaymentEligible&&!i.isLongTermPaymentEligible)return null;var a=this.sezzleDOMFunctions.getElementToRender(e,n);e.dataset.sezzleindex=n,"auto"===o.alignment&&(o.alignment=xe(this,Me,Ze).call(this,e));var l=document.createElement("div");l.className="sezzle-shopify-info-button sezzlewidgetindex-".concat(n),xe(this,Ae,Qe).call(this,l,o),xe(this,je,Ye).call(this,l),xe(this,Ne,et).call(this,l,o),o.scaleFactor&&xe(this,Fe,tt).call(this,l,o);var c=document.createElement("div");c.className="sezzle-checkout-button-wrapper sezzle-modal-link",c.tabIndex=0,c.style.cursor="pointer",xe(this,je,Ye).call(this,c),xe(this,Be,nt).call(this,c,o);var u=this.getWidgetInnerContent(o,n,i,r);return c.appendChild(u),l.appendChild(c),o.customClasses.forEach((function(e){if(e.xpath&&e.className&&("number"!=typeof e.index&&(e.index=-1),e.index===n||-1===e.index)){var o=s.breakXPath(e.xpath);t.sezzleDOMFunctions.getElementsByXPath(o,0,[l]).forEach((function(t){t.className+=" ".concat(e.className)}))}})),o.widgetIsFirstChild?xe(this,Xe,dt).call(this,l,a):xe(this,Ve,ut).call(this,l,a),l}catch(e){return this.widgetEventLogger.logEvent("error","An exception occurred when rendering a widget: ".concat(e.message)),null}}},{key:"getWidgetInnerContent",value:function(e,t,n,o){var r=this,i=document.createElement("div");return i.className="sezzle-button-text",xe(this,Ge,ot).call(this,i,e),xe(this,Oe,Je).call(this,e,n.isLongTermPaymentEligible).forEach((function(a){switch(a){case"price":var s=document.createElement("span");s.className="sezzle-payment-amount sezzle-button-text sezzleindex-".concat(t);var l=r.priceProcessor.getFormattedWidgetPrice(o,n.isLongTermPaymentEligible),c=document.createTextNode(l);s.appendChild(c),i.appendChild(s);break;case"logo":var u=document.createElement("img");u.className="sezzle-logo ".concat(e.imageClassName),u.src=e.imageURL,u.alt="Sezzle",u.style.height="18px",u.style.verticalAlign="baseline",i.appendChild(u),xe(r,Ue,lt).call(r,u,e),e.logoStyle!=={}&&xe(r,qe,ct).call(r,u,e);break;case"link":var d=document.createElement("button");d.role="button",d.type="button",d.ariaLabel="Learn More about Sezzle",d.className="sezzle-learn-more",d.ariaHasPopup="true";var f=document.createTextNode("Learn more");d.appendChild(f),i.appendChild(d);break;case"info":var m=document.createElement("button");m.role="button",m.type="button",m.ariaLabel="Learn More about Sezzle",m.name="Learn More about Sezzle",m.className="sezzle-info-icon",m.innerHTML="&#9432;",m.ariaHasPopup="true",m.style="display: inline; width: auto; min-height: 9px; max-height: 20px; font-size: ".concat(e.fontSize,"px;"),i.appendChild(m);break;case"question-mark":var g=document.createElement("button");g.role="button",g.type="button",g.ariaLabel="Learn More about Sezzle",g.ariaHasPopup="true";var h=document.createElement("img");h.className="sezzle-question-mark-icon",h.src="https://d2uyik3j5wol98.cloudfront.net/images/question_mark_black.png",h.alt="More Info",g.appendChild(h),i.appendChild(g);break;case"shoppay-logo":var p=document.createElement("img");p.className="sezzle-shopPay-logo shopPay-modal-info-link no-sezzle-info",p.src="https://media.sezzle.com/sezzle-credit-website-assets/shop-pay-logo.svg",p.style.maxHeight="20px",p.style.verticalAlign="middle",p.alt="ShopPay",i.appendChild(p);break;case"shoppay-info-icon":var y=document.createElement("button");y.role="button",y.type="button",y.ariaLabel="Learn More about ShopPay",y.className="shopPay-modal-info-link no-sezzle-info",y.innerHTML="&#9432;",y.ariaHasPopup="true",y.style="display: inline; width: auto; min-height: 9px; max-height: 20px; font-size: ".concat(e.fontSize,"px;"),i.appendChild(y);break;case"shoppay-link-icon":var b=document.createElement("a");b.href=r.widgetConfig.shopPayLink,b.target="_blank";var v=document.createElement("code");v.ariaLabel="Open ShopPay in a new tab",v.className="shopPay-info-link",v.innerHTML="&#9432;",b.appendChild(v),i.appendChild(b);break;case"affirm-logo":var z=document.createElement("img");z.className="sezzle-affirm-logo affirm-modal-info-link no-sezzle-info",z.style.maxHeight="20px",z.style.verticalAlign="middle",z.src="https://cdn-assets.affirm.com/images/black_logo-transparent_bg.png",z.alt="Affirm",i.appendChild(z);break;case"affirm-logo-greyscale":var w=document.createElement("img");w.className="sezzle-affirm-logo affirm-modal-info-link no-sezzle-info",w.style.maxHeight="20px",w.style.verticalAlign="middle",w.src="https://cdn-assets.affirm.com/images/all_black_logo-transparent_bg.png",w.alt="Affirm",i.appendChild(w);break;case"affirm-logo-white":var C=document.createElement("img");C.className="sezzle-affirm-logo affirm-modal-info-link no-sezzle-info",C.style.maxHeight="20px",C.style.verticalAlign="middle",C.src="https://cdn-assets.affirm.com/images/white_logo-transparent_bg.png",C.alt="Affirm",i.appendChild(C);break;case"affirm-info-icon":var k=document.createElement("button");k.role="button",k.type="button",k.ariaLabel="Learn More about Affirm",k.className="affirm-modal-info-link no-sezzle-info",k.innerHTML="&#9432;",k.ariaHasPopup="true",k.style="display: inline; width: auto; min-height: 9px; max-height: 20px; font-size: ".concat(e.fontSize,"px;"),i.appendChild(k);break;case"affirm-link-icon":var E=document.createElement("a");E.href=r.widgetConfig.affirmLink,E.target="_blank";var _=document.createElement("code");_.ariaLabel="Open Affirm in a new tab",_.className="affirm-info-link",_.innerHTML="&#9432;",E.appendChild(_),i.appendChild(E);break;case"afterpay-logo":var P=document.createElement("img");P.className="sezzle-afterpay-logo ap-modal-info-link no-sezzle-info",P.style.maxHeight="50px",P.style.maxWidth="100px",P.style.verticalAlign="middle",P.src="https://media.sezzle.com/sezzle-credit-website-assets/ap-badge-black-on-mint.svg",P.alt="Afterpay",i.appendChild(P);break;case"afterpay-logo-white":var x=document.createElement("img");x.className="sezzle-afterpay-logo ap-modal-info-link no-sezzle-info",x.style.maxHeight="50px",x.style.maxWidth="100px",x.style.verticalAlign="middle",x.src="https://media.sezzle.com/sezzle-credit-website-assets/ap-badge-black-on-white.svg",x.alt="Afterpay",i.appendChild(x);break;case"afterpay-logo-grey":var L=document.createElement("img");L.className="sezzle-afterpay-logo ap-modal-info-link no-sezzle-info",L.style.maxHeight="50px",L.style.maxWidth="100px",L.style.verticalAlign="middle",L.src="https://media.sezzle.com/sezzle-credit-website-assets/ap-badge-white-on-black.svg",L.alt="Afterpay",i.appendChild(L);break;case"afterpay-logo-nopill":var S=document.createElement("img");S.className="sezzle-afterpay-logo ap-modal-info-link no-sezzle-info",S.style.maxHeight="55px",S.style.maxWidth="125px",S.style.verticalAlign="middle",S.style.position="relative",S.style.left="-20px",S.style.marginRight="-30px",S.src="https://media.sezzle.com/sezzle-credit-website-assets/ap-badge-black.svg",S.alt="Afterpay",i.appendChild(S);break;case"afterpay-info-icon":var T=document.createElement("button");T.role="button",T.type="button",T.ariaLabel="Learn More about Afterpay",T.ariaHasPopup="true",T.className="ap-modal-info-link no-sezzle-info",T.innerHTML="&#9432;",T.style="display: inline; width: auto; min-height: 9px; max-height: 20px; font-size: ".concat(e.fontSize,"px;"),i.appendChild(T);break;case"afterpay-link-icon":var W=document.createElement("a");W.href=r.widgetConfig.apLink,W.target="_blank";var O=document.createElement("code");O.ariaLabel="Open Afterpay in a new tab",O.className="ap-info-link",O.innerHTML="&#9432;",W.appendChild(O),i.appendChild(W);break;case"klarna-logo":var A=document.createElement("img");A.className="sezzle-klarna-logo klarna-modal-info-link no-sezzle-info",A.style.height="30px",A.style.verticalAlign="middle",A.src="https://x.klarnacdn.net/payment-method/assets/badges/generic/klarna.svg",A.alt="Klarna",i.appendChild(A);break;case"klarna-logo-white":var M=document.createElement("img");M.className="sezzle-klarna-logo klarna-modal-info-link no-sezzle-info",M.style.height="30px",M.style.verticalAlign="middle",M.src="https://x.klarnacdn.net/payment-method/assets/badges/generic/white/klarna.svg",M.alt="Klarna",i.appendChild(M);break;case"klarna-logo-greyscale":var j=document.createElement("img");j.className="sezzle-klarna-logo klarna-modal-info-link no-sezzle-info",j.style.height="30px",j.style.verticalAlign="middle",j.src="https://x.klarnacdn.net/payment-method/assets/badges/generic/black/klarna.svg",j.alt="Klarna",i.appendChild(j);break;case"klarna-info-icon":var N=document.createElement("button");N.role="button",N.type="button",N.ariaLabel="Learn More about Klarna",N.className="klarna-modal-info-link no-sezzle-info",N.innerHTML="&#9432;",N.ariaHasPopup="true",N.style="display: inline; width: auto; min-height: 9px; max-height: 20px; font-size: ".concat(e.fontSize,"px;"),i.appendChild(N);break;case"quadpay-logo":var F=document.createElement("img");F.className="sezzle-quadpay-logo qp-modal-info-link no-sezzle-info",F.src="https://d34uoa9py2cgca.cloudfront.net/sezzle-credit-website-assets/qp-logo-widget.png",F.alt="Quadpay",F.style.maxHeight="17px",F.style.maxWidth="65px",F.style.verticalAlign="text-bottom",i.appendChild(F);break;case"quadpay-logo-grey":var B=document.createElement("img");B.className="sezzle-quadpay-logo qp-modal-info-link no-sezzle-info",B.src="https://d34uoa9py2cgca.cloudfront.net/sezzle-credit-website-assets/qp-logo-widget-grayscale.png",B.alt="Quadpay",B.style.maxHeight="17px",B.style.maxWidth="65px",B.style.verticalAlign="text-bottom",i.appendChild(B);break;case"quadpay-logo-white":var G=document.createElement("img");G.className="sezzle-quadpay-logo qp-modal-info-link no-sezzle-info",G.src="https://d34uoa9py2cgca.cloudfront.net/sezzle-credit-website-assets/qp-logo-widget-white.png",G.alt="Quadpay",G.style.maxHeight="17px",G.style.maxWidth="65px",G.style.verticalAlign="text-bottom",i.appendChild(G);break;case"quadpay-info-icon":var I=document.createElement("button");I.role="button",I.type="button",I.ariaLabel="Learn More about Quadpay",I.className="qp-modal-info-link no-sezzle-info",I.innerHTML="&#9432;",I.ariaHasPopup="true",I.style="display: inline; width: auto; min-height: 9px; max-height: 20px; font-size: ".concat(e.fontSize,"px;"),i.appendChild(I);break;case"line-break":var R=document.createElement("br");i.appendChild(R);break;default:var D=document.createTextNode(a);i.appendChild(D)}})),i}}])&&Ee(t.prototype,n),o&&Ee(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function gt(e,t,n,o,r,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(o,r)}function ht(e){return function(){var t=this,n=arguments;return new Promise((function(o,r){var i=e.apply(t,n);function a(e){gt(i,o,r,a,s,"next",e)}function s(e){gt(i,o,r,a,s,"throw",e)}a(void 0)}))}}function pt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}var yt=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.basicWidgetConfiguration=t,this.widgetEventLogger=n}var t,n,o,r,i,a;return t=e,(n=[{key:"init",value:(a=ht(regeneratorRuntime.mark((function e(){var t,n,o,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,s.getCountryCodeFromIP();case 3:if(t=e.sent,n=this.basicWidgetConfiguration.supportedCountryCodes||s.getCurrentDataCenterDefaultSupportedCountries(),!this.basicWidgetConfiguration.forcedShow&&!n.includes(t)){e.next=13;break}if(this.widgetEventLogger.logEvent("request"),(o=s._getCookie("shopify_pay_redirect"))&&this.widgetEventLogger.logEvent("shop-checkout-status-".concat(o)),!((r=new g(this.basicWidgetConfiguration).getSezzleConfig).configGroups.length>0)){e.next=13;break}return e.next=13,this.initializeWidget(r);case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),this.widgetEventLogger.logEvent("error",e.t0.message);case 18:this.widgetEventLogger.forceSendEvents();case 19:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(){return a.apply(this,arguments)})},{key:"initializeWidget",value:(i=ht(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loadCSS();case 2:new mt(t,this.widgetEventLogger).initializeRendering(),s.isWidgetDuplicateFound()&&this.widgetEventLogger.logEvent("duplicate-widget"),s.isCompetitorWidgetFound()&&this.widgetEventLogger.logEvent("competitor-widget");case 6:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_loadCSS",value:(r=ht(regeneratorRuntime.mark((function e(){var t,n,o,r,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=document.sezzleCssVersionOverride){e.next=8;break}return n="".concat(s.getWidgetBaseUrl(),"/v1/css/price-widget?uuid=").concat(this.basicWidgetConfiguration.merchantID),e.next=5,s.httpRequestWrapper("GET",n);case 5:o=e.sent,o=JSON.parse(o),t=o.version;case 8:r=document,i=r.head,(a=document.createElement("link")).type="text/css",a.rel="stylesheet",a.href="https://media.sezzle.com/shopify-app/assets/".concat(t),i.appendChild(a);case 14:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}])&&pt(t.prototype,n),o&&pt(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();if(0===document.getElementsByClassName("sezzle-shopify-info-button").length)if(document.sezzleConfig){var bt=H.NewWidgetEventLogger(document.sezzleConfig.merchantID,document.sezzleConfig.noTracking);document.sezzleConfig.merchantID||bt.logEvent("warning","Merchant UUID is not provided"),new yt(document.sezzleConfig,bt).init()}else{var vt=H.NewWidgetEventLogger("",!1);vt.logEvent("request"),vt.logEvent("error","No sezzleConfig is found in the document. Check that at least a default or a custom override config is presented for the merchant")}}]);