(()=>{var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{var t;e.g.importScripts&&(t=e.g.location+"");var n=e.g.document;if(!t&&n&&(n.currentScript&&(t=n.currentScript.src),!t)){var o=n.getElementsByTagName("script");if(o.length)for(var r=o.length-1;r>-1&&(!t||!/^http(s?):/.test(t));)t=o[r--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=t})(),e.p=window.wcpayAssets.url,(()=>{"use strict";const e=e=>"undefined"!=typeof wcpayConfig?wcpayConfig[e]:t(e),t=e=>{let t=null;if("undefined"!=typeof wcpay_upe_config)t=wcpay_upe_config;else{if("object"!=typeof wc||void 0===wc.wcSettings)return null;t=wc.wcSettings.getSetting("woocommerce_payments_data")||{}}return t[e]||null},n={address_1:"shipping_address_1",address_2:"shipping_address_2",city:"shipping_city",state:"shipping_state",postcode:"shipping_postcode",country:"shipping_country",first_name:"shipping_first_name",last_name:"shipping_last_name"},o={address_1:"billing_address_1",address_2:"billing_address_2",city:"billing_city",state:"billing_state",postcode:"billing_postcode",country:"billing_country",first_name:"billing_first_name",last_name:"billing_last_name"},r=(e,t="always")=>Object.keys(e).filter((t=>"link"!==t&&e[t].isReusable)).reduce(((e,n)=>(e[n]=t,e)),{}),a=()=>{const e=document.querySelector('input[name="payment_method"][value*="woocommerce_payments"]:checked');return e?e.value.replace("woocommerce_payments_","").replace("woocommerce_payments","")||"card":null},i=e=>{const n={},o=function(e){if(t("cartContainsSubscription"))return!0;const n=document.querySelector(`.wcpay-upe-form[data-payment-method-type="${e}"]`);if(!n)return!1;const o=n.querySelector(`#wc-${c(e)}-new-payment-method`);return o?.checked||!1}(e)?"always":"never";var a;return n.terms=r(t("paymentMethodsConfig"),o),!t("isCheckout")||t("isOrderPay")||t("isChangingPayment")||(n.fields={billingDetails:(a=t("enabledBillingFields"),{name:a.billing_first_name||a.billing_last_name?"never":"auto",email:a.billing_email?"never":"auto",phone:a.billing_phone?"never":"auto",address:{country:a.billing_country?"never":"auto",line1:a.billing_address_1?"never":"auto",line2:a.billing_address_2?"never":"auto",city:a.billing_city?"never":"auto",state:a.billing_state?"never":"auto",postalCode:a.billing_postcode?"never":"auto"}})}),window.wcpayCustomerData&&(n.defaultValues={billingDetails:{name:window.wcpayCustomerData.name,email:window.wcpayCustomerData.email,address:{country:window.wcpayCustomerData.billing_country}}}),n};function c(e){const t="woocommerce_payments";return"card"===e?t:`${t}_${e}`}const s=(e,t)=>{e.append(``)},l=e=>void 0!==e.link&&void 0!==e.card,u=e=>{const n=t("paymentMethodsConfig"),o=e.dataset.paymentMethodType,r=n[o].countries,i=a();let c=e?.closest("form.checkout, form#add_payment_method")?.querySelector('[name="billing_country"]');c||(c=document.querySelector("#billing_country"));const s=c?.value||window?.wcpayCustomerData?.billing_country||"",l=e?.closest(".wc_payment_method");if(r.includes(s))l.style.removeProperty("display");else if(l.style.display="none",o===i){const e=document.querySelector('input[name="payment_method"][value="woocommerce_payments"]');e?.click()}},d=window.wp.i18n,m=["color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"],p=["fontFamily","fontSize","lineHeight","letterSpacing","fontWeight","fontVariation","textDecoration","textShadow","textTransform","-webkit-font-smoothing","-moz-osx-font-smoothing","transition"],h=["backgroundColor","border","borderTop","borderRight","borderBottom","borderLeft","borderRadius","borderWidth","borderColor","borderStyle","borderTopWidth","borderTopColor","borderTopStyle","borderRightWidth","borderRightColor","borderRightStyle","borderBottomWidth","borderBottomColor","borderBottomStyle","borderLeftWidth","borderLeftColor","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","outline","outlineOffset","boxShadow"],f={".Label":[...m,...p],".Text":[...m,...p],".Input":[...m,...p,...h],".Error":[...m,...p,...h],".Tab":[...m,...p,...h],".TabIcon":[...m],".TabLabel":[...m,...p],".Block":[...m.slice(1),...h.slice(1)],".Container":[...h],".Header":[...m,...h,...p],".Footer":[...m,...h,...p]},y={".Label":f[".Label"],".Label--floating":[...f[".Label"],"transform"],".Input":[...f[".Input"],"outlineColor","outlineWidth","outlineStyle"],".Error":f[".Error"],".Tab":["backgroundColor","color","fontFamily"],".Tab--selected":["outlineColor","outlineWidth","outlineStyle","backgroundColor","color",h],".TabIcon":f[".TabIcon"],".TabIcon--selected":["color"],".TabLabel":f[".TabLabel"],".Block":f[".Block"],".Container":f[".Container"],".Header":f[".Header"],".Footer":f[".Footer"],".Footer--link":f[".Text"],".Text":f[".Text"],".Text--redirect":f[".Text"]};function b(e){return b="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},b(e)}var g=/^\s+/,w=/\s+$/;function v(e,t){if(t=t||{},(e=e||"")instanceof v)return e;if(!(this instanceof v))return new v(e,t);var n=function(e){var t,n,o,r={r:0,g:0,b:0},a=1,i=null,c=null,s=null,l=!1,u=!1;return"string"==typeof e&&(e=function(e){e=e.replace(g,"").replace(w,"").toLowerCase();var t,n=!1;if(j[e])e=j[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=$.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=$.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=$.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=$.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=$.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=$.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=$.hex8.exec(e))?{r:q(t[1]),g:q(t[2]),b:q(t[3]),a:Y(t[4]),format:n?"name":"hex8"}:(t=$.hex6.exec(e))?{r:q(t[1]),g:q(t[2]),b:q(t[3]),format:n?"name":"hex"}:(t=$.hex4.exec(e))?{r:q(t[1]+""+t[1]),g:q(t[2]+""+t[2]),b:q(t[3]+""+t[3]),a:Y(t[4]+""+t[4]),format:n?"name":"hex8"}:!!(t=$.hex3.exec(e))&&{r:q(t[1]+""+t[1]),g:q(t[2]+""+t[2]),b:q(t[3]+""+t[3]),format:n?"name":"hex"}}(e)),"object"==b(e)&&(U(e.r)&&U(e.g)&&U(e.b)?(t=e.r,n=e.g,o=e.b,r={r:255*D(t,255),g:255*D(n,255),b:255*D(o,255)},l=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):U(e.h)&&U(e.s)&&U(e.v)?(i=G(e.s),c=G(e.v),r=function(e,t,n){e=6*D(e,360),t=D(t,100),n=D(n,100);var o=Math.floor(e),r=e-o,a=n*(1-t),i=n*(1-r*t),c=n*(1-(1-r)*t),s=o%6;return{r:255*[n,i,a,a,c,n][s],g:255*[c,n,n,i,a,a][s],b:255*[a,a,c,n,n,i][s]}}(e.h,i,c),l=!0,u="hsv"):U(e.h)&&U(e.s)&&U(e.l)&&(i=G(e.s),s=G(e.l),r=function(e,t,n){var o,r,a;function i(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=D(e,360),t=D(t,100),n=D(n,100),0===t)o=r=a=n;else{var c=n<.5?n*(1+t):n+t-n*t,s=2*n-c;o=i(s,c,e+1/3),r=i(s,c,e),a=i(s,c,e-1/3)}return{r:255*o,g:255*r,b:255*a}}(e.h,i,s),l=!0,u="hsl"),e.hasOwnProperty("a")&&(a=e.a)),a=H(a),{ok:l,format:e.format||u,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function _(e,t,n){e=D(e,255),t=D(t,255),n=D(n,255);var o,r,a=Math.max(e,t,n),i=Math.min(e,t,n),c=(a+i)/2;if(a==i)o=r=0;else{var s=a-i;switch(r=c>.5?s/(2-a-i):s/(a+i),a){case e:o=(t-n)/s+(t>1)+720)%360;--t;)o.h=(o.h+r)%360,a.push(v(o));return a}function P(e,t){t=t||6;for(var n=v(e).toHsv(),o=n.h,r=n.s,a=n.v,i=[],c=1/t;t--;)i.push(v({h:o,s:r,v:a})),a=(a+c)%1;return i}v.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,o=this.toRgb();return e=o.r/255,t=o.g/255,n=o.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=H(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=k(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=k(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),o=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+o+"%)":"hsva("+t+", "+n+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var e=_(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=_(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),o=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+o+"%)":"hsla("+t+", "+n+"%, "+o+"%, "+this._roundA+")"},toHex:function(e){return S(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,o,r){var a=[X(Math.round(e).toString(16)),X(Math.round(t).toString(16)),X(Math.round(n).toString(16)),X(B(o))];return r&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*D(this._r,255))+"%",g:Math.round(100*D(this._g,255))+"%",b:Math.round(100*D(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*D(this._r,255))+"%, "+Math.round(100*D(this._g,255))+"%, "+Math.round(100*D(this._b,255))+"%)":"rgba("+Math.round(100*D(this._r,255))+"%, "+Math.round(100*D(this._g,255))+"%, "+Math.round(100*D(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Z[S(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+x(this._r,this._g,this._b,this._a),n=t,o=this._gradientType?"GradientType = 1, ":"";if(e){var r=v(e);n="#"+x(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,o=this._a<1&&this._a>=0;return t||!o||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return v(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(A,arguments)},darken:function(){return this._applyModification(E,arguments)},desaturate:function(){return this._applyModification(C,arguments)},saturate:function(){return this._applyModification(F,arguments)},greyscale:function(){return this._applyModification(L,arguments)},spin:function(){return this._applyModification(T,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(V,arguments)},complement:function(){return this._applyCombination(I,arguments)},monochromatic:function(){return this._applyCombination(P,arguments)},splitcomplement:function(){return this._applyCombination(W,arguments)},triad:function(){return this._applyCombination(R,[3])},tetrad:function(){return this._applyCombination(R,[4])}},v.fromRatio=function(e,t){if("object"==b(e)){var n={};for(var o in e)e.hasOwnProperty(o)&&(n[o]="a"===o?e[o]:G(e[o]));e=n}return v(e,t)},v.equals=function(e,t){return!(!e||!t)&&v(e).toRgbString()==v(t).toRgbString()},v.random=function(){return v.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},v.mix=function(e,t,n){n=0===n?0:n||50;var o=v(e).toRgb(),r=v(t).toRgb(),a=n/100;return v({r:(r.r-o.r)*a+o.r,g:(r.g-o.g)*a+o.g,b:(r.b-o.b)*a+o.b,a:(r.a-o.a)*a+o.a})},v.readability=function(e,t){var n=v(e),o=v(t);return(Math.max(n.getLuminance(),o.getLuminance())+.05)/(Math.min(n.getLuminance(),o.getLuminance())+.05)},v.isReadable=function(e,t,n){var o,r,a,i,c,s=v.readability(e,t);switch(r=!1,(a=n,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(c=(a.size||"small").toLowerCase())&&"large"!==c&&(c="small"),o={level:i,size:c}).level+o.size){case"AAsmall":case"AAAlarge":r=s>=4.5;break;case"AAlarge":r=s>=3;break;case"AAAsmall":r=s>=7}return r},v.mostReadable=function(e,t,n){var o,r,a,i,c=null,s=0;r=(n=n||{}).includeFallbackColors,a=n.level,i=n.size;for(var l=0;ls&&(s=o,c=v(t[l]));return v.isReadable(e,c,{level:a,size:i})||!r?c:(n.includeFallbackColors=!1,v.mostReadable(e,["#fff","#000"],n))};var j=v.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Z=v.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(j);function H(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function D(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function N(e){return Math.min(1,Math.max(0,e))}function q(e){return parseInt(e,16)}function X(e){return 1==e.length?"0"+e:""+e}function G(e){return e<=1&&(e=100*e+"%"),e}function B(e){return Math.round(255*parseFloat(e)).toString(16)}function Y(e){return q(e)/255}var z,J,O,$=(J="[\\s|\\(]+("+(z="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",O="[\\s|\\(]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")[,|\\s]+("+z+")\\s*\\)?",{CSS_UNIT:new RegExp(z),rgb:new RegExp("rgb"+J),rgba:new RegExp("rgba"+O),hsl:new RegExp("hsl"+J),hsla:new RegExp("hsla"+O),hsv:new RegExp("hsv"+J),hsva:new RegExp("hsva"+O),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function U(e){return!!$.CSS_UNIT.exec(e)}const Q=e=>{const t=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0?(\.\d+)?|1?(\.0+)?)\s*\)$/);if(t){const n=t[4]||1;e=`rgb(${t.slice(1,4).map((e=>Math.round(e*n+255*(1-n)))).join(", ")})`}return e},K={default:{hiddenContainer:"#wcpay-hidden-div",hiddenInput:"#wcpay-hidden-input",hiddenInvalidInput:"#wcpay-hidden-invalid-input",hiddenValidActiveLabel:"#wcpay-hidden-valid-active-label"},classicCheckout:{appendTarget:".woocommerce-billing-fields__field-wrapper",upeThemeInputSelector:"#billing_first_name",upeThemeLabelSelector:".woocommerce-checkout .form-row label",upeThemeTextSelectors:["#payment .payment_methods li .payment_box fieldset",".woocommerce-checkout .form-row"],rowElement:"p",validClasses:["form-row"],invalidClasses:["form-row","woocommerce-invalid","woocommerce-invalid-required-field"],backgroundSelectors:["li.wc_payment_method .wc-payment-form","li.wc_payment_method .payment_box","#payment","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"],linkSelectors:["a"],pmmeRelativeTextSizeSelector:".wc_payment_method > label"},blocksCheckout:{appendTarget:"#contact-fields",upeThemeInputSelector:".wc-block-components-text-input #email",upeThemeLabelSelector:".wc-block-components-text-input label",upeThemeTextSelectors:[".wc-block-components-checkout-step__description",".wc-block-components-text-input"],rowElement:"div",validClasses:["wc-block-components-text-input","is-active"],invalidClasses:["wc-block-components-text-input","has-error"],alternateSelectors:{appendTarget:"#billing.wc-block-components-address-form",upeThemeInputSelector:"#billing-first_name",upeThemeLabelSelector:".wc-block-components-checkout-step__description"},backgroundSelectors:["#payment-method .wc-block-components-radio-control-accordion-option","#payment-method","form.wc-block-checkout__form",".wc-block-checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-components-checkout-place-order-button"],linkSelectors:["a"],containerSelectors:[".wp-block-woocommerce-checkout-order-summary-block"],pmmeRelativeTextSizeSelector:".wc-block-components-radio-control__label-group"},bnplProductPage:{appendTarget:".product .cart .quantity",upeThemeInputSelector:".product .cart .quantity .qty",upeThemeLabelSelector:".product .cart .quantity label",upeThemeTextSelectors:[".product .cart .quantity"],rowElement:"div",validClasses:["input-text"],invalidClasses:["input-text","has-error"],backgroundSelectors:["#payment-method-message","#main > .product > div.summary.entry-summary","#main > .product","#main","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".single_add_to_cart_button"],linkSelectors:["a"]},bnplClassicCart:{appendTarget:".cart .quantity",upeThemeInputSelector:".cart .quantity .qty",upeThemeLabelSelector:".cart .quantity label",upeThemeTextSelectors:[".cart .quantity"],rowElement:"div",validClasses:["input-text"],invalidClasses:["input-text","has-error"],backgroundSelectors:["#payment-method-message","#main .entry-content .cart_totals","#main .entry-content","#main","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".checkout-button"],linkSelectors:["a"],containerSelectors:[".shop_table"]},bnplCartBlock:{appendTarget:".wc-block-cart .wc-block-components-quantity-selector",upeThemeInputSelector:".wc-block-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input",upeThemeLabelSelector:".wc-block-components-text-input",upeThemeTextSelectors:[".wc-block-components-text-input"],rowElement:"div",validClasses:["wc-block-components-text-input"],invalidClasses:["wc-block-components-text-input","has-error"],backgroundSelectors:[".wc-block-components-bnpl-wrapper",".wc-block-components-order-meta",".wc-block-components-totals-wrapper",".wp-block-woocommerce-cart-order-summary-block",".wp-block-woocommerce-cart-totals-block",".wp-block-woocommerce-cart .wc-block-cart",".wp-block-woocommerce-cart","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-cart__submit-button"],linkSelectors:["a"],containerSelectors:[".wp-block-woocommerce-cart-line-items-block"]},wooPayClassicCheckout:{appendTarget:".woocommerce-billing-fields__field-wrapper",upeThemeInputSelector:"#billing_first_name",upeThemeLabelSelector:".woocommerce-checkout .form-row label",upeThemeTextSelectors:[".woocommerce-checkout .form-row"],rowElement:"p",validClasses:["form-row"],invalidClasses:["form-row","woocommerce-invalid","woocommerce-invalid-required-field"],backgroundSelectors:["#customer_details","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"],linkSelectors:["a"],containerSelectors:[".woocommerce-checkout-review-order-table"],headerSelectors:[".site-header","header > div"],footerSelectors:[".site-footer","footer > div"],footerLink:[".site-footer a","footer a"]},updateSelectors:function(e){return e.hasOwnProperty("alternateSelectors")&&(Object.entries(e.alternateSelectors).forEach((t=>{const[n,o]=t;document.querySelector(e[n])||(e[n]=o)})),delete e.alternateSelectors),e},getSelectors:function(e){let t=this.blocksCheckout;switch(e){case"blocks_checkout":t=this.blocksCheckout;break;case"shortcode_checkout":t=this.classicCheckout;break;case"bnpl_product_page":t=this.bnplProductPage;break;case"bnpl_classic_cart":t=this.bnplClassicCart;break;case"bnpl_cart_block":t=this.bnplCartBlock;break;case"woopay_shortcode_checkout":t=this.wooPayClassicCheckout}return{...this.default,...this.updateSelectors(t)}}},ee={getHiddenContainer:function(e){const t=document.createElement("div");return t.setAttribute("id",this.getIDFromSelector(e)),t.style.border=0,t.style.clip="rect(0 0 0 0)",t.style.height="1px",t.style.margin="-1px",t.style.overflow="hidden",t.style.padding="0",t.style.position="absolute",t.style.width="1px",t},createRow:function(e,t=[]){const n=document.createElement(e);return t.length&&n.classList.add(...t),n},appendClone:function(e,t,n){const o=document.querySelector(t);if(o){const t=o.cloneNode(!0);t.id=this.getIDFromSelector(n),t.value="",e.appendChild(t)}},getIDFromSelector:function(e){return e.startsWith("#")||e.startsWith(".")?e.slice(1):e},init:function(e){const t=K.getSelectors(e),n=document.querySelector(t.appendTarget),o=document.querySelector(t.upeThemeInputSelector);if(!n||!o)return;document.querySelector(t.hiddenContainer)&&this.cleanup();const r=this.getHiddenContainer(t.hiddenContainer);n.appendChild(r);const a=this.createRow(t.rowElement,t.validClasses);r.appendChild(a);const i=this.createRow(t.rowElement,t.invalidClasses);r.appendChild(i),this.appendClone(a,t.upeThemeInputSelector,t.hiddenInput),this.appendClone(a,t.upeThemeLabelSelector,t.hiddenValidActiveLabel),this.appendClone(i,t.upeThemeInputSelector,t.hiddenInvalidInput),this.appendClone(i,t.upeThemeLabelSelector,t.hiddenInvalidInput),document.querySelector(t.hiddenInput).style.transition="none"},cleanup:function(){const e=document.querySelector(K.default.hiddenContainer);e&&e.remove()}},te=(e,t,n=null)=>{if(!document.querySelector(e))return{};const o=y[t],r=document.querySelector(e),a=window.getComputedStyle(r),i={};for(let e=0;ee&&n?[e,t,n].join(" "):"")(i.outlineWidth,i.outlineStyle,i.outlineColor);""!==e&&(i.outline=e),delete i.outlineWidth,delete i.outlineColor,delete i.outlineStyle}const c=a.getPropertyValue("text-indent");return"0px"!==c&&"0px"===i.paddingLeft&&"0px"===i.paddingRight&&(i.paddingLeft=c,i.paddingRight=c),".Block"===t&&(i.backgroundColor=n),i},ne=()=>{const e=[],t=document.styleSheets,n=["fonts.googleapis.com","fonts.gstatic.com","fast.fonts.com","use.typekit.net"];for(let o=0;o{const n=K.getSelectors(e);ee.init(e);const o=te(n.hiddenInput,".Input"),r=te(n.hiddenInvalidInput,".Input"),a=te(n.upeThemeLabelSelector,".Label"),i={fontSize:a.fontSize},c=te(n.upeThemeTextSelectors,".Text"),s=te(n.upeThemeInputSelector,".Tab"),l=te(n.hiddenInput,".Tab--selected"),u=(e=>{const t=Object.assign({},e);if(!e.backgroundColor||!e.color)return e;const n=((e,t)=>{const n={backgroundColor:e,color:t},o=v(e),r=v(t);if(!o.isValid()||!r.isValid())return{backgroundColor:"",color:""};const a=o.getBrightness()>50?v(o).darken(7):v(o).lighten(7),i=v.mostReadable(a,[r],{includeFallbackColors:!0});return n.backgroundColor=a.toRgbString(),n.color=i.toRgbString(),n})(e.backgroundColor,e.color);return t.backgroundColor=n.backgroundColor,t.color=n.color,t})(s),d={color:u.color},m={color:l.color},p=(e=>{let t=null,n=0;for(;!t&&n0&&(t=r),n++}return t||"#ffffff"})(n.backgroundSelectors),h=te(n.headingSelectors,".Label"),f=te(n.upeThemeLabelSelector,".Block",p),y=te(n.buttonSelectors,".Input"),b=te(n.linkSelectors,".Label"),g=te(n.containerSelectors,".Container"),w=te(n.headerSelectors,".Header"),_=te(n.footerSelectors,".Footer"),k=te(n.footerLink,".Footer--link"),S={colorBackground:p,colorText:c.color,fontFamily:c.fontFamily,fontSizeBase:c.fontSize};n.pmmeRelativeTextSizeSelector&&S.fontSizeBase&&(S.fontSizeBase=function(e,t,n=.875){const o=parseFloat(t);if(isNaN(o))return t;const r=document.querySelector(e);if(!r)return o*n+"px";const a=window.getComputedStyle(r).getPropertyValue("font-size"),i=parseFloat(a)*n;return isNaN(i)?t:o>i?`${i}px`:`${o}px`}(n.pmmeRelativeTextSizeSelector,c.fontSize));const x="blocks_checkout"===e;let C={variables:S,theme:(F=p,v(F).getBrightness()>125?"stripe":"night"),labels:x?"floating":"above",rules:JSON.parse(JSON.stringify({".Input":o,".Input--invalid":r,".Label":a,".Label--resting":i,".Block":f,".Tab":s,".Tab:hover":u,".Tab--selected":l,".TabIcon:hover":d,".TabIcon--selected":m,".Text":c,".Text--redirect":c}))};var F;return x&&(C=((e,t)=>{if(e.rules[".Label--floating"]=t,e.rules[".Label--floating"].transform&&"none"!==e.rules[".Label--floating"].transform){const t=e.rules[".Label--floating"].transform.match(/matrix\((.+)\)/);if(t&&t[1]){const n=t[1].split(", "),o=(parseFloat(n[0])+parseFloat(n[3]))/2,r=parseFloat(e.rules[".Label--floating"].lineHeight),a=Math.floor(r*o);e.rules[".Label--floating"].lineHeight=`${a}px`,e.rules[".Label--floating"].fontSize=`${a}px`}delete e.rules[".Label--floating"].transform}if(e.rules[".Input"].paddingTop&&(e.rules[".Input"].paddingTop=`calc(${e.rules[".Input"].paddingTop} - ${e.rules[".Label--floating"].lineHeight} - 4px - 1px)`),e.rules[".Input"].paddingBottom){var n;const t=parseFloat(e.rules[".Input"].paddingBottom);e.rules[".Input"].paddingBottom=t-1+"px";const o=null!==(n=e.rules[".Label"].marginTop)&&void 0!==n?n:"0";e.rules[".Label"].marginTop=`${Math.floor((t-1)/3)}px`,e.rules[".Label--floating"].marginTop=o}return e})(C,te(n.hiddenValidActiveLabel,".Label--floating"))),t&&(C.rules={...C.rules,".Heading":h,".Header":w,".Footer":_,".Footer-link":k,".Button":y,".Link":b,".Container":g}),ee.cleanup(),C},re=(e,t=2,n=2)=>parseInt(e*Math.pow(10,n-t),10),ae=()=>document.querySelector(".wp-block-woocommerce-checkout")?"blocks_checkout":document.querySelector(".woocommerce-billing-fields")?"woopay_shortcode_checkout":document.querySelector(".wp-block-woocommerce-cart")?"bnpl_cart_block":document.querySelector(".woocommerce-cart-form")?"bnpl_classic_cart":document.querySelector(".single-product")?"bnpl_product_page":void 0,ie=(e,t=!1,n=!0,o=null)=>{let r="";r=e.includes("woocommerce-error")?e:'";let a=jQuery(".woocommerce-notices-wrapper, form.checkout");if(a=t?a.first():a.last(),!a.length)return;jQuery(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),a.prepend('
'+r+"
"),n&&a.find(".input-text, select, input:checkbox").trigger("validate").blur();let i=jQuery(".woocommerce-NoticeGroup-checkout");i.length||(i=a),jQuery.scroll_to_notices(i),jQuery(document.body).trigger("checkout_error")};var ce=function(){return ce=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&r[r.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]=o+n?(o=a,[4,me(0)]):[3,3]):[3,4];case 2:i.sent(),i.label=3;case 3:return++r,[3,1];case 4:return[2]}}))}))}function ye(e){e.then(void 0,(function(){}))}function be(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function ge(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function we(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<>>32-t,e[1]<>>32-t]:(t-=32,[e[1]<>>32-t,e[0]<>>32-t])}function ve(e,t){return 0==(t%=64)?e:t<32?[e[0]<>>32-t,e[1]<>>1]),e=_e(e=ge(e,[4283543511,3981806797]),[0,e[0]>>>1]),_e(e=ge(e,[3301882366,444984403]),[0,e[0]>>>1])}function Se(e){return parseInt(e)}function xe(e){return parseFloat(e)}function Ce(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Fe(e){return e.reduce((function(e,t){return e+(t?1:0)}),0)}function Le(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function Me(e){return e&&"object"==typeof e&&"message"in e?e:{message:e}}function Ae(e,t,n){var o=Object.keys(e).filter((function(e){return!function(e,t){for(var n=0,o=e.length;n=4}function Te(){var e=window,t=navigator;return Fe(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Ie(){var e=window,t=navigator;return Fe(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function Re(){var e=window;return Fe(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function We(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Ve(){var e=Te(),t=function(){var e,t,n=window;return Fe(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}();if(!e&&!t)return!1;var n=window;return Fe(["onorientationchange"in n,"orientation"in n,e&&!("SharedWorker"in n),t&&/android/i.test(navigator.appVersion)])>=2}function Pe(e){var t=new Error(e);return t.name=e,t}function je(e,t,n){var o,r,a;return void 0===n&&(n=50),se(this,void 0,void 0,(function(){var i,c;return le(this,(function(s){switch(s.label){case 0:i=document,s.label=1;case 1:return i.body?[3,3]:[4,me(n)];case 2:return s.sent(),[3,1];case 3:c=i.createElement("iframe"),s.label=4;case 4:return s.trys.push([4,,10,11]),[4,new Promise((function(e,n){var o=!1,r=function(){o=!0,e()};c.onload=r,c.onerror=function(e){o=!0,n(e)};var a=c.style;a.setProperty("display","block","important"),a.position="absolute",a.top="0",a.left="0",a.visibility="hidden",t&&"srcdoc"in c?c.srcdoc=t:c.src="about:blank",i.body.appendChild(c);var s=function(){var e,t;o||("complete"===(null===(t=null===(e=c.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?r():setTimeout(s,10))};s()}))];case 5:s.sent(),s.label=6;case 6:return(null===(r=null===(o=c.contentWindow)||void 0===o?void 0:o.document)||void 0===r?void 0:r.body)?[3,8]:[4,me(n)];case 7:return s.sent(),[3,6];case 8:return[4,e(c,c.contentWindow)];case 9:return[2,s.sent()];case 10:return null===(a=c.parentNode)||void 0===a||a.removeChild(c),[7];case 11:return[2]}}))}))}function Ze(e){for(var t=function(e){for(var t,n,o="Unexpected syntax '".concat(e,"'"),r=/^\s*([a-z-]*)(.*)$/i.exec(e),a=r[1]||void 0,i={},c=/([.:#][\w-]+|\[.+?\])/gi,s=function(e,t){i[e]=i[e]||[],i[e].push(t)};;){var l=c.exec(r[2]);if(!l)break;var u=l[0];switch(u[0]){case".":s("class",u.slice(1));break;case"#":s("id",u.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(!d)throw new Error(o);s(d[1],null!==(n=null!==(t=d[4])&&void 0!==t?t:d[5])&&void 0!==n?n:"");break;default:throw new Error(o)}}return[a,i]}(e),n=t[0],o=t[1],r=document.createElement(null!=n?n:"div"),a=0,i=Object.keys(o);a.6*n.length}))).sort(),[2,r]}var c}))}))},fontPreferences:function(){return void 0===e&&(e=4e3),je((function(t,n){var o=n.document,r=o.body,a=r.style;a.width="".concat(e,"px"),a.webkitTextSizeAdjust=a.textSizeAdjust="none",Te()?r.style.zoom="".concat(1/n.devicePixelRatio):Ie()&&(r.style.zoom="reset");var i=o.createElement("div");return i.textContent=ue([],Array(e/20|0),!0).map((function(){return"word"})).join(" "),r.appendChild(i),function(e,t){for(var n={},o={},r=0,a=Object.keys(nt);r');var e},audio:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Ie()&&!Re()&&!function(){var e=window;return Fe(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var n=new t(1,5e3,44100),o=n.createOscillator();o.type="triangle",o.frequency.value=1e4;var r=n.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,o.connect(r),r.connect(n.destination),o.start(0);var a=function(e){var t=function(){};return[new Promise((function(n,o){var r=!1,a=0,i=0;e.oncomplete=function(e){return n(e.renderedBuffer)};var c=function(){setTimeout((function(){return o(Pe("timeout"))}),Math.min(500,i+5e3-Date.now()))},s=function(){try{var t=e.startRendering();switch(pe(t)&&ye(t),e.state){case"running":i=Date.now(),r&&c();break;case"suspended":document.hidden||a++,r&&a>=3?o(Pe("suspended")):setTimeout(s,500)}}catch(e){o(e)}};s(),t=function(){r||(r=!0,i>0&&c())}})),t]}(n),i=a[0],c=a[1],s=i.then((function(e){return function(e){for(var t=0,n=0;n=3||n.push(t.languages);else if("string"==typeof t.languages){var r=t.languages;r&&n.push(r.split(","))}return n},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Ce(xe(navigator.deviceMemory),void 0)},screenResolution:function(){var e=screen,t=function(e){return Ce(Se(e),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n},hardwareConcurrency:function(){return Ce(Se(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var n=(new t).resolvedOptions().timeZone;if(n)return n}var o,r=(o=(new Date).getFullYear(),-Math.max(xe(new Date(o,0,1).getTimezoneOffset()),xe(new Date(o,6,1).getTimezoneOffset())));return"UTC".concat(r>=0?"+":"").concat(Math.abs(r))},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){var e,t;if(!(Ee()||(e=window,t=navigator,Fe(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Ee())))try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&Ie()&&!Re()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return Fe(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],n=0;n>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)}(function(e){for(var t="",n=0,o=Object.keys(e).sort();n=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(de,"/npm-monitoring"),!0),e.send()}catch(e){console.error(e)}}(),[4,ct(n)];case 1:return e.sent(),[2,st(Ae(ot,{debug:o},[]),o)]}}))}))},hashComponents:it,componentsToDebugString:at};const ut=(0,d.__)("An error was encountered when preparing the payment form. Please try again later.","woocommerce-payments"),dt=()=>{document.querySelector('input[name="payment_method"][value="woocommerce_payments"]')?.click();const e=document.getElementById("wc-woocommerce_payments-payment-token-new");e&&!e.checked&&(e.checked=!0,function(e){const t=new Event("change",{bubbles:!0});e.dispatchEvent(t)}(e))},mt=e=>{if(!e)return null;const[t,n]=e.name.split(/ (.*)/s,2);return{first_name:t||"",last_name:n||"",address_1:e.address.line1||"",address_2:e.address.line2||"",city:e.address.city||"",country:e.address.country||"",postcode:e.address.postal_code||"",state:e.address.state||""}},pt={};let ht=null;for(const e in t("paymentMethodsConfig"))pt[e]={elements:null,upeElement:null,hasLoadError:!1};async function ft(e,n){var o;const r=null!==(o={shortcode_checkout:"upeAppearance",add_payment_method:"upeAddPaymentMethodAppearance"}[n])&&void 0!==o?o:"upeAppearance",a=t(r);return a?Promise.resolve(a):await e.saveUPEAppearance(oe(n),n)}async function yt(e){await e.addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function bt(e){e.removeClass("processing").unblock()}function gt(e){l(t("paymentMethodsConfig"))&&(async e=>{const t=document.getElementById(e.emailId);if(!t)return Promise.resolve((()=>null));const n=(await e.api.getStripe()).linkAutofillModal(e.elements),o=e=>{n.launch({email:e.target.value})};t.addEventListener("keyup",o),e.onButtonShow(n),n.on("autofill",(t=>{const{billingAddress:n,shippingAddress:o}=t.value;e.onAutofill(mt(n),mt(o)),dt()}))})({api:e,elements:pt.card.elements,emailId:"billing_email",onAutofill:(e,t)=>{const r=(e,t)=>{if(!e)return;const n=document.getElementById(t.country);n&&(n.value=e.country,n.dispatchEvent(new Event("change"))),Object.entries(e).forEach((([e,n])=>{const o=document.getElementById(t[e]);o&&(o.value=n)}))};(()=>{const e=document.getElementById("ship-to-different-address-checkbox");e&&!0!==e.checked&&(e.checked=!0,window.jQuery)&&window.jQuery(e).prop("checked",!0).change()})(),r(e,o),r(t,n),document.querySelectorAll(`#${o.country}, #${o.state}, #${n.country}, #${n.state}`).forEach((e=>{if(!window.jQuery)return;const t=window.jQuery(e);t.data("select2")&&t.trigger("change")}))},onButtonShow:e=>{const t=document.getElementById("billing_email");if(""!==t.value){const e=t.offsetTop+(t.offsetHeight-40)/2,n=document.querySelector(".wcpay-stripelink-modal-trigger");n.style.display="block",n.style.top=`${e}px`}document.querySelector(".wcpay-stripelink-modal-trigger").addEventListener("click",(n=>{n.preventDefault(),e.launch({email:t.value}),dt()}))}})}async function wt(e,n,o){try{if(!ht){const{visitorId:e}=await(async()=>{const e=await lt.load({monitoring:!1});if(!e)throw new Error(ut);return await e.get()})();ht=e}}catch(e){return void ie(e.message)}const r=new Event("wc-credit-card-form-init");document.body.dispatchEvent(r);const a=n.dataset.paymentMethodType;if(!pt[a])return;const c=pt[a].upeElement||await async function(e,n,o){const r=Number(t("cartTotal")),a=(e=>{const n=[e];return"card"===e&&l(t("paymentMethodsConfig"))&&n.push("link"),n})(n),c=await ft(e,o);document.querySelector(`.wcpay-upe-element[data-payment-method-type="${n}"]`)?.closest(".wc_payment_method")?.classList.add(`theme--${c.theme||"stripe"}`);const s={mode:r<1?"setup":"payment",currency:t("currency").toLowerCase(),amount:r,paymentMethodCreation:"manual",paymentMethodTypes:a,appearance:c,fonts:ne()},u=(await e.getStripeForUPE(n)).elements(s),d=u.create("payment",{...i(n),wallets:{applePay:"never",googlePay:"never"}});return pt[n].elements=u,pt[n].upeElement=d,d}(e,a,o);c.mount(n),c.on("loaderror",(e=>{pt[a].hasLoadError=!0,n.style.padding="0";const t=document.createElement("div");t.classList.add("woocommerce-error"),t.innerHTML=e.error.message,t.style.margin="0",n.appendChild(t);const o=n.closest(".payment_box")?.querySelector(".woocommerce-SavedPaymentMethods-saveNew");o&&(o.style.display="none")}))}async function vt(e,t,n,o){const r=t.dataset.paymentMethodType,a=await ft(e,o);try{return(await e.getStripe()).elements({appearance:a,fonts:ne()}).create("paymentMethodMessaging",{currency:n.currency,amount:re(n.amount,n.decimalPlaces),countryCode:n.country,paymentMethodTypes:[r],displayType:"promotional_text"}).mount(t)}finally{return Promise.resolve()}}const _t=({id:e},t,n)=>n.setupIntent(e).then((function(e){!function(e,t){const n=document.createElement("input");n.type="hidden",n.id="wcpay-setup-intent",n.name="wcpay-setup-intent",n.value=t.id,e.append(n)}(t,e)}));let kt;const St=(e,n,r,a=()=>Promise.resolve())=>{if(!kt)return(async()=>{try{await yt(n);const{elements:i,hasLoadError:c}=pt[r];if(c)throw new Error((0,d.__)("Invalid or missing payment details. Please ensure the provided payment method is correctly entered.","woocommerce-payments"));await function(e){return e.submit().then((e=>{if(e.error)throw new Error(e.error.message)}))}(i);const l=await async function(e,n,r,a){let i={};return window.wcpayCustomerData&&(i={billing_details:{name:wcpayCustomerData.name||void 0,email:wcpayCustomerData.email,address:wcpayCustomerData.address||{country:wcpayCustomerData.billing_country}}}),"checkout"===r.attr("name")&&(i={billing_details:{...i.billing_details,name:`${document.querySelector(`#${o.first_name}`)?.value||""} ${document.querySelector(`#${o.last_name}`)?.value||""}`.trim()||void 0,email:document.querySelector("#billing_email")?.value,phone:document.querySelector("#billing_phone")?.value,address:{...i.billing_details?.address,city:document.querySelector(`#${o.city}`)?.value,country:document.querySelector(`#${o.country}`)?.value,line1:document.querySelector(`#${o.address_1}`)?.value,line2:document.querySelector(`#${o.address_2}`)?.value,postal_code:document.querySelector(`#${o.postcode}`)?.value,state:document.querySelector(`#${o.state}`)?.value}}}),t("isOrderPay")&&function(e,t){if(["afterpay_clearpay","affirm"].includes(t))return!1;const n=e?.billing_details?.address;if(!n)return!1;const o="affirm"===t?["line1","state","city","postal_code","country"]:["line1","postal_code","country"];for(const e of o)if(""===n[e]||null===n[e]||void 0===n[e])return!0;return!1}(i,a)&&delete i.billing_details.address,(await e.getStripeForUPE(a)).createPaymentMethod({elements:n,params:i})}(e,i,n,r);l.error?(s(n,"woocommerce_payments_payment_method_error"),((e,t)=>{[["wcpay-payment-method-error-code",t.code],["wcpay-payment-method-error-decline-code",t.decline_code],["wcpay-payment-method-error-message",t.message],["wcpay-payment-method-error-type",t.type]].forEach((([t,n])=>{e.append(``)}))})(n,l.error)):s(n,l.paymentMethod.id),((e,t="")=>{e.find('input[name="wcpay-fingerprint"]').remove();const n=``;e.append(n)})(n,ht),(e=>{var t;const n=null!==(t=window.wcpayFraudPreventionToken)&&void 0!==t?t:"";e.append(``)})(n),await a(l.paymentMethod,n,e),kt=!0,n.removeClass("processing").submit()}catch(e){kt=!1,bt(n),ie(e.message)}})(),!1;kt=!1},xt="https://cdn.sift.com/s.js",Ct="https://js.stripe.com/v3",Ft={sift:({beacon_key:e,session_id:t,user_id:n})=>{const o=window._sift=window._sift||[];if(o.push(["_setAccount",e]),o.push(["_setUserId",n]),o.push(["_setSessionId",t]),o.push(["_trackPageview"]),!document.querySelector(`[src="${xt}"]`)){const e=document.createElement("script");e.src=xt,e.async=!0,document.body.appendChild(e)}},stripe:()=>{if(!document.querySelector(`[src^="${Ct}"]`)){const e=document.createElement("script");e.src=Ct,e.async=!0,document.body.appendChild(e)}}},Lt=t=>{const n=t.confirmIntent(window.location.href,null!==(o=document.querySelector("#wc-woocommerce_payments-new-payment-method")?.checked)&&void 0!==o&&o);var o;return!0===n?Promise.resolve():(history.replaceState("",document.title,window.location.pathname+window.location.search),n.then((e=>{window.location=e})).catch((t=>{let n=t.message;t instanceof Error&&(n=e("genericErrorMessage")),ie(n)})))},Mt=e=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(e)?wcpayExpressCheckoutParams[e]:"object"==typeof wcpayPaymentRequestParams&&wcpayPaymentRequestParams.hasOwnProperty(e)?wcpayPaymentRequestParams[e]:null,At=e=>Mt("wc_ajax_url").toString().replace("%%endpoint%%","wcpay_"+e),Et=(e,t,n="wcpay_")=>e.toString().replace("%%endpoint%%",n+t);class Tt{constructor(e,t){this.options=e,this.stripe=null,this.stripePlatform=null,this.request=t,this.isWooPayRequesting=!1}createStripe(e,t,n="",o=[]){const r={locale:t};return n&&(r.stripeAccount=n),o&&(r.betas=o),new Stripe(e,r)}async getStripeForUPE(e){return this.options.forceNetworkSavedCards=t("paymentMethodsConfig")[e].forceNetworkSavedCards,this.getStripe()}async getStripe(e=!1){let t=0;for(;!window.Stripe;)if(await new Promise((e=>setTimeout(e,100))),t+=100,t>6e5)throw new Error("Stripe object not found");return this.__getStripe(e)}__getStripe(e=!1){const{publishableKey:t,accountId:n,forceNetworkSavedCards:o,locale:r,isStripeLinkEnabled:a}=this.options;if(o&&!e)return this.stripePlatform||(this.stripePlatform=this.createStripe(t,r)),this.stripePlatform;if(!this.stripe){let e=["card_country_event_beta_1"];a&&(e=e.concat(["link_autofill_modal_beta_1"])),this.stripe=this.createStripe(t,r,n,e)}return this.stripe}async loadStripeForExpressCheckout(){try{return this.getStripe(!0)}catch(e){return{error:e}}}confirmIntent(t,n=!1){const o=t.match(/#wcpay-confirm-(pi|si):(.+):(.+):(.+)$/);if(!o)return!0;const r="si"===o[1];let a=o[2];const i=o[3],c=o[4],s=t.indexOf("order-pay"),l=s>-1&&t.substring(s).match(/\d+/);return l&&(a=l[0]),(async()=>{const{locale:t,publishableKey:n}=this.options,o=e("accountIdForIntentConfirmation"),a=await this.getStripe();return r?a.handleNextAction({clientSecret:i}):o?this.createStripe(n,t,o).confirmCardPayment(i):(await this.getStripe(!0)).handleNextAction({clientSecret:i})})().then((t=>{var o;const r=t.paymentIntent&&t.paymentIntent.id||t.setupIntent&&t.setupIntent.id||t.error&&t.error.payment_intent&&t.error.payment_intent.id||t.error.setup_intent&&t.error.setup_intent.id,i=null!==(o=Mt("ajax_url"))&&void 0!==o?o:e("ajaxUrl");return[this.request(i,{action:"update_order_status",order_id:a,_ajax_nonce:c,intent_id:r,should_save_payment_method:n?"true":"false"}),t.error]})).then((([e,t])=>{if(t)throw t;return e.then((e=>{const t="string"==typeof e?JSON.parse(e):e;if(t.error)throw t.error;return t.return_url}))}))}async setupIntent(t){const n=await this.request(e("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":t,_ajax_nonce:e("createSetupIntentNonce")});if(!n.success)throw n.data.error;if("succeeded"===n.data.status)return n.data;const o=await this.getStripe(),r=await o.confirmCardSetup(n.data.client_secret),{setupIntent:a,error:i}=r;if(i)throw i;return a}saveUPEAppearance(t,n){return this.request(e("ajaxUrl"),{elements_location:n,appearance:JSON.stringify(t),action:"save_upe_appearance",_ajax_nonce:e("saveUPEAppearanceNonce")}).then((e=>e.data)).catch((e=>{throw e.message?e:new Error(e.statusText)}))}expressCheckoutECEUpdateShippingDetails(e){return this.request(At("ece_update_shipping_method"),{security:Mt("nonce")?.update_shipping,shipping_method:[e.id],is_product_page:"product"===Mt("button_context")})}expressCheckoutECEGetCartDetails(){return this.request(At("ece_get_cart_details"),{security:Mt("nonce")?.get_cart_details})}expressCheckoutECEAddToCart(e){return this.request(At("add_to_cart"),{security:Mt("nonce")?.add_to_cart,...e})}expressCheckoutECEGetSelectedProductData(e){return this.request(At("ece_get_selected_product_data"),{security:Mt("nonce")?.get_selected_product_data,...e})}expressCheckoutECECalculateShippingOptions(e){return this.request(At("ece_get_shipping_options"),{security:Mt("nonce")?.shipping,is_product_page:"product"===Mt("button_context"),...e})}expressCheckoutECECreateOrder(e){return this.request(At("ece_create_order"),{_wpnonce:Mt("nonce")?.checkout,...e})}expressCheckoutECEPayForOrder(e,t){return this.request(At("ece_pay_for_order"),{_wpnonce:Mt("nonce")?.pay_for_order,order:e,...t})}initWooPay(t,n){if(!this.isWooPayRequesting){this.isWooPayRequesting=!0;const o=e("wcAjaxUrl"),r=e("initWooPayNonce"),a=ae();return this.request(Et(o,"init_woopay"),{_wpnonce:r,appearance:e("isWooPayGlobalThemeSupportEnabled")?oe(a,!0):null,email:t,user_session:n,order_id:e("order_id"),key:e("key"),billing_email:e("billing_email")}).finally((()=>{this.isWooPayRequesting=!1}))}}expressCheckoutAddToCart(t){const n=e("wcAjaxUrl"),o=e("addToCartNonce");return this.request(Et(n,"add_to_cart"),{security:o,...t})}pmmeGetCartData(){return fetch(`${t("storeApiURL")}/cart`,{method:"GET",credentials:"same-origin",headers:{"Content-Type":"application/json"}}).then((e=>{if(!e.ok)throw new Error(e.statusText);return e.json()}))}}function It(e,t="",n){for(const o in e){const r=e[o],a=t?t+"["+o+"]":o;"string"==typeof r||"number"==typeof r?n.append(a,r):"object"==typeof r&&It(r,a,n)}return n}async function Rt(e,t,n){const o=It(t,"",new FormData),r=await fetch(e,{method:"POST",body:o,...n});return await r.json()}window.wp.domReady;const Wt=(t,n={})=>{var o,r,a;const i=null!==(o=e("platformTrackerNonce"))&&void 0!==o?o:null===(r=Mt("nonce"))||void 0===r?void 0:r.platform_tracker,c=null!==(a=e("ajaxUrl"))&&void 0!==a?a:Mt("ajax_url"),s=new FormData;s.append("tracksNonce",i),s.append("action","platform_tracks"),s.append("tracksEventName",t),s.append("tracksEventProp",JSON.stringify(n)),fetch(c,{method:"post",body:s}).then((e=>e.json()))},Vt=()=>{return t=void 0,n=void 0,r=function*(){var t,n,o;let r=(()=>{const e=document.cookie.split(";");for(let t=0;te?new Promise((t=>{if(document.querySelector(e))return t(document.querySelector(e));const n=document.querySelector('[data-block-name="woocommerce/checkout"]');if(!n)return t(null);new MutationObserver(((n,o)=>{document.querySelector(e)&&(t(document.querySelector(e)),o.disconnect())})).observe(n,{childList:!0,subtree:!0})})):null,jt=e=>new RegExp(/^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,}\.?$/i).test(e),Zt=()=>{const e=document.cookie.split(";").find((e=>e.includes("skip_woopay")));if(!e)return!1;const t=e?.split("=");return"skip_woopay"===t[0].trim()&&"1"===t[1].trim()},Ht=()=>{Zt()&&(document.cookie="skip_woopay=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC;")};let Dt=null;document.addEventListener("click",(function(e){const t=e.target?.closest(".js-woopayments-copy-test-number");if(!t)return;e.preventDefault();const n=t.querySelector("span").innerText;navigator.clipboard?(navigator.clipboard.writeText(n),window.wp?.data?.dispatch("core/notices")?.createInfoNotice((0,d.__)("Test number copied to your clipboard!","woocommerce-payments"),{id:"woopayments/test-number-copied",type:"snackbar",context:"wc/checkout/payments"}),t.classList.add("state--success"),clearTimeout(Dt),Dt=setTimeout((()=>{t.classList.remove("state--success")}),2e3)):prompt((0,d.__)("Copy the test number:","woocommerce-payments"),n)}),!1),jQuery((function(n){(e=>{for(const t in e){const n=Ft[t];n&&e[t]&&n(e[t])}})(t("fraudServices"));const i=t("publishableKey");if(!i)return;const s=n("form.checkout"),m=n("form#add_payment_method"),p=n("form#order_review"),h=jQuery(s).add(m).add(p),f=new Tt({publishableKey:i,accountId:t("accountId"),forceNetworkSavedCards:t("forceNetworkSavedCards"),locale:t("locale"),isStripeLinkEnabled:l(t("paymentMethodsConfig"))},Rt);function y(e){const t=a();if(!function(e){const t=document.querySelector(`.wcpay-upe-form[data-payment-method-type="${e}"]`);if(!t)return!1;const n=`wc-${c(e)}-payment-token-new`,o=t.querySelector(`input#${n}`);return!!o&&!o.checked}(t))return St(f,e,t)}async function b(e){const t=n(".wcpay-upe-form").find(".wcpay-upe-element");if(t.length&&!t.children().length){for(const n of t.toArray())await wt(f,n,e),g(n);gt(f)}}function g(e){if((e=>!!t("paymentMethodsConfig")[e.dataset.paymentMethodType].countries.length)(e)){u(e);const t=e?.closest("form.checkout")?.querySelector(`[name="${o.country}"]`);t&&n(t).on("change",(function(){u(e)}))}}yt(h),Lt(f).finally((()=>{bt(h)})),n(document.body).on("updated_checkout",(()=>{b("shortcode_checkout"),async function(){const e=["affirm","afterpay_clearpay","klarna"],n=t("paymentMethodsConfig"),o=Object.keys(n),r=await f.pmmeGetCartData();for(const a of o)if(e.includes(a)){const e=document.querySelector(`label[for="payment_method_woocommerce_payments_${a}"]`),o=`stripe-pmme-container-${a}`;if(document.getElementById(o)&&(document.getElementById(o).innerHTML=""),e){let i=e.querySelector("span.woopayments-inner-label");if(!i){const t=e.innerHTML;e.innerHTML="",i=document.createElement("span"),i.classList.add("woopayments-inner-label"),i.innerHTML=t,e.appendChild(i)}let c=e.querySelector("span.spacer");c||(c=document.createElement("span"),c.classList.add("spacer"),c.innerHTML=" ",e.insertBefore(c,i));let s=document.getElementById(o);s||(s=document.createElement("span"),s.id=o,s.dataset.paymentMethodType=a,s.classList.add("stripe-pmme-container"),i.appendChild(s));const l=r?.billing_address?.country||t("storeCountry");(0===n[a]?.countries.length||n[a]?.countries?.includes(l))&&await vt(f,s,{amount:r?.totals?.total_price,currency:r?.totals?.currency_code,decimalPlaces:r?.totals?.currency_minor_unit,country:l},"shortcode_checkout")}}}()})),s.on(["woocommerce_payments_bancontact","woocommerce_payments_au_becs_debit","woocommerce_payments_eps","woocommerce_payments_giropay","woocommerce_payments_ideal","woocommerce_payments_p24","woocommerce_payments_sepa_debit","woocommerce_payments_sofort","woocommerce_payments_affirm","woocommerce_payments_afterpay_clearpay","woocommerce_payments","woocommerce_payments_klarna"].map((e=>`checkout_place_order_${e}`)).join(" "),(function(){if(!(()=>{const e=t("enabledBillingFields");if(!`${document.querySelector(`#${o.first_name}`)?.value||""} ${document.querySelector(`#${o.last_name}`)?.value||""}`.trim()&&(e[o.first_name]||e[o.last_name]))return!0;const n=["billing_email",o.country,o.address_1,o.city,o.postcode].filter((t=>e[t])),r=n.includes(o.country)?document.querySelector(`#${o.country}`)?.value:null;return Boolean(n.find((t=>{const n=document.querySelector(`#${t}`);let o=e[t]?.required;const a=function(){try{return JSON.parse(wc_address_i18n_params.locale.replace(/"/g,'"'))}catch(e){return null}}();if(r&&a&&"billing_email"!==t){var i;const e=t.replace("billing_","");o=null!==(i=a[r]?.[e]?.required)&&void 0!==i?i:a.default?.[e]?.required}const c=n?.value;return o&&!c})))})())return y(n(this))})),s.on("click","#place_order",(function(){a()&&Wt("checkout_place_order_button_click")})),window.addEventListener("hashchange",(()=>{window.location.hash.startsWith("#wcpay-confirm-")&&(yt(h),Lt(f).finally((()=>{bt(h)})))})),document.addEventListener("change",(function(e){e.target&&"wc-woocommerce_payments-new-payment-method"===e.target.id&&function(e){const n=e.target.checked?"always":"never",o=a();if(!o)return;const i=pt[o].upeElement;i&&i.update({terms:r(t("paymentMethodsConfig"),n)})}(e)})),m.length&&b("add_payment_method"),p.length&&b("shortcode_checkout"),m.on("submit",(function(){if("woocommerce_payments"===m.find("input:checked[name='payment_method']").val())return n.blockUI.defaults.ignoreIfBlocked=!0,St(f,m,a(),_t)})),p.on("submit",(function(){if(null!==a())return y(p)})),t("isWooPayEnabled")&&t("isWooPayEmailInputEnabled")&&null===new URLSearchParams(window.location.search).get("customize_messenger_channel")&&!e("isPreview")&&(async(t,n,o=!1)=>{let r;const a=await Pt(t),i=await Vt();if(!a)return;const c=document.createElement("div"),s=a.parentNode;c.classList.add("wc-block-components-spinner");const l=document.createElement("div");l.setAttribute("role","dialog"),l.setAttribute("aria-modal","true"),l.classList.add("woopay-otp-iframe-wrapper");const u=document.createElement("iframe");u.title=(0,d.__)("WooPay SMS code verification","woocommerce-payments"),u.classList.add("woopay-otp-iframe"),u.classList.add("intrinsic-ignore");const m=document.createElement("span");m.setAttribute("aria-hidden","true"),m.classList.add("arrow");const p=768,h=new URLSearchParams(window.location.search),f=Zt(),y="undefined"!=typeof performance&&"back_forward"===performance.getEntriesByType("navigation")[0].type||"true"===h.get("skip_woopay")||f;if(y&&!f){const e=new Date,t=new Date(e.getTime()+864e5);document.cookie=`skip_woopay=1; path=/; expires=${t.toUTCString()}`}let b=!0;const g=()=>{(p<=window.innerWidth&&b||p>window.innerWidth&&!b)&&(b=!b,u.contentWindow.postMessage({action:"setHeader",value:b},e("woopayHost"))),document.body.style.overflow="hidden"},w=()=>{if(!u)return;if(p>window.innerWidth)return u.style.left="0",void(u.style.right="");if(u.getBoundingClientRect().top<=0||window.innerHeight-(u.getBoundingClientRect().height+u.getBoundingClientRect().top)<=0){const e=50,t=document.documentElement.scrollTop+a.getBoundingClientRect().top-u.getBoundingClientRect().height/2-e;window.scrollTo({top:t})}const e=a.getBoundingClientRect(),t=u.getBoundingClientRect();u.style.top=Math.floor(e.top-t.height/2)+"px",m.style.top=Math.floor(e.top+e.height/2-parseFloat(window.getComputedStyle(m)["border-right-width"]))+"px",window.innerWidth-(e.right+t.width)<=50?(u.style.left="auto",m.style.left="auto",u.style.right="50px",m.style.right=`${t.width+50}px`):(u.style.left=`${e.right+5}px`,u.style.right="",m.style.left=e.right-10+"px",m.style.right="")};u.addEventListener("load",(()=>{b=!0;const t=ae(),n=(e=>"woopay_shortcode_checkout"===e)(t)&&e("isWooPayGlobalThemeSupportEnabled")?oe(t,!0):null;e("isWoopayFirstPartyAuthEnabled")&&Rt(Et(e("wcAjaxUrl"),"get_woopay_session"),{_ajax_nonce:e("woopaySessionNonce"),order_id:e("order_id"),key:e("key"),billing_email:e("billing_email"),appearance:n}).then((t=>{t?.data?.session&&u.contentWindow.postMessage({action:"setSessionData",value:t},e("woopayHost"))})),g(),window.addEventListener("resize",g),w(),window.addEventListener("resize",w),u.classList.add("open")})),l.insertBefore(m,null),l.insertBefore(u,null);const v=document.createElement("div");v.style["white-space"]="normal",v.textContent=(0,d.__)("WooPay is unavailable at this time. Please complete your checkout below. Sorry for the inconvenience.","woocommerce-payments");const _=(e=!0)=>{window.removeEventListener("resize",g),window.removeEventListener("resize",w),l.remove(),u.classList.remove("open"),e&&a.focus(),document.body.style.overflow=""};l.addEventListener("click",_);const k=()=>{s.insertBefore(v,a.nextSibling)};document.addEventListener("keyup",(e=>{"Escape"===e.key&&_()&&e.stopPropagation()}));const S=new AbortController,{signal:x}=S;x.addEventListener("abort",(()=>{c.remove(),_(!1)})),o?(await Pt("button.wc-block-components-checkout-place-order-button")).addEventListener("click",(()=>{S.abort()})):document.querySelector('form[name="checkout"]').addEventListener("submit",(()=>{S.abort()}));const C=e=>{const t=new CustomEvent("woopayUserCheck",{detail:{isRegisteredUser:e}});window.dispatchEvent(t)},F=async(t,n=!0)=>{s.insertBefore(c,a),s.contains(v)&&s.removeChild(v),Wt("checkout_email_address_woopay_check"),Rt(Et(e("wcAjaxUrl"),"get_woopay_signature"),{_ajax_nonce:e("woopaySignatureNonce")}).then((e=>{if(e.success)return e.data;throw new Error((0,d.__)("Request for signature failed.","woocommerce-payments"))})).then((e=>{if(e.signature)return e.signature;throw new Error((0,d.__)("Signature not found.","woocommerce-payments"))})).then((n=>{const o=new URLSearchParams;return o.append("email",t),o.append("test_mode",!!e("testMode")),o.append("wcpay_version",e("wcpayVersionNumber")),o.append("blog_id",e("woopayMerchantId")),o.append("request_signature",n),fetch(`${e("woopayHost")}/wp-json/platform-checkout/v1/user/exists?${o.toString()}`,{signal:x})})).then((e=>(200!==e.status&&k(),e.json()))).then((r=>{C(r["user-exists"]),r["user-exists"]?n&&(t=>{if(document.querySelector(".woopay-otp-iframe"))return;const n=window.document.documentElement.clientWidth,r=window.document.documentElement.clientHeight,a=new URLSearchParams;a.append("email",t),a.append("testMode",e("testMode")),a.append("needsHeader",p>window.innerWidth),a.append("wcpayVersion",e("wcpayVersionNumber")),a.append("is_blocks",o?"true":"false"),a.append("source_url",wcSettings?.storePages?.checkout?.permalink),a.append("viewport",`${n}x${r}`),i&&a.append("tracksUserIdentity",i),u.src=`${e("woopayHost")}/otp/?${a.toString()}`,s.insertBefore(l,null),w(),u.focus()})(t):"rest_invalid_param"!==r.code&&(Wt("checkout_woopay_save_my_info_offered"),window.woopayCheckout?.PRE_CHECK_SAVE_MY_INFO&&Wt("checkout_save_my_info_click",{status:"checked"}))})).catch((e=>{"AbortError"!==e.name&&k()})).finally((()=>{c.remove()}))};if(a.addEventListener("input",(e=>{const t=e.currentTarget.value;clearTimeout(r),c.remove(),r=setTimeout((()=>{C(!1),jt(t)&&F(t)}),500)})),window.addEventListener("message",(t=>{if(e("woopayHost").startsWith(t.origin))switch(t.data.action){case"redirect_to_woopay_skip_session_init":t.data.redirectUrl&&(Ht(),window.location=(e=>{const t=window.wcpayConfig.pay_for_order,n=window.wcpayConfig.order_id,o=window.wcpayConfig.key,r=window.wcpayConfig.billing_email;if(!t||!n||!o)return e;const a=new URL(e);return a.searchParams.append("pay_for_order",t),a.searchParams.append("order_id",n),a.searchParams.append("key",o),a.searchParams.append("billing_email",r),a.href})(t.data.redirectUrl));break;case"redirect_to_platform_checkout":case"redirect_to_woopay":const e=n.initWooPay(a.value,t.data.platformCheckoutUserSession);if(!e)break;e.then((e=>{document.querySelector(".woopay-otp-iframe")&&("success"===e.result?(Ht(),window.location=e.url):(k(),_(!1)))})).catch((()=>{k(),_(!1)}));break;case"otp_validation_failed":break;case"close_modal":_();break;case"iframe_height":if(t.data.height>300)if(p<=window.innerWidth){u.style.height=t.data.height+"px";const e=a.getBoundingClientRect();u.style.top=Math.floor(e.top-t.data.height/2)+"px",m.style.top=Math.floor(e.top+e.height/2-parseFloat(window.getComputedStyle(m)["border-right-width"]))+"px"}else u.style.height="",u.style.top=""}})),window.addEventListener("pageshow",(function(e){e.persisted&&_(!1)})),a.value){const e=a.value;jt(e)&&F(e,!1)}if(y){setTimeout((()=>{C(!0)}),2e3),Wt("woopay_skipped",{}),h.delete("skip_woopay");let{pathname:e}=window.location;""!==h.toString()&&(e+="?"+h.toString()),history.replaceState(null,null,e),_(!1)}})("#billing_email",f)}))})()})();