(()=>{var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var t;e.g.importScripts&&(t=e.g.location+"");var o=e.g.document;if(!t&&o&&(o.currentScript&&(t=o.currentScript.src),!t)){var r=o.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].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 t=window.wp.i18n,o=window.wp.hooks,r=e=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[e]?wcpayConfig[e]:n(e),n=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},a=e=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(e)?wcpayExpressCheckoutParams[e]:null,i=(e,t,o="wcpay_")=>e.toString().replace("%%endpoint%%",o+t);function s(e){return s="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},s(e)}var c=/^\s+/,l=/\s+$/;function u(e,t){if(t=t||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,t);var o=function(e){var t,o,r,n={r:0,g:0,b:0},a=1,i=null,u=null,d=null,p=!1,h=!1;return"string"==typeof e&&(e=function(e){e=e.replace(c,"").replace(l,"").toLowerCase();var t,o=!1;if(I[e])e=I[e],o=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=N.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=N.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=N.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=N.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=N.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=N.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=N.hex8.exec(e))?{r:R(t[1]),g:R(t[2]),b:R(t[3]),a:j(t[4]),format:o?"name":"hex8"}:(t=N.hex6.exec(e))?{r:R(t[1]),g:R(t[2]),b:R(t[3]),format:o?"name":"hex"}:(t=N.hex4.exec(e))?{r:R(t[1]+""+t[1]),g:R(t[2]+""+t[2]),b:R(t[3]+""+t[3]),a:j(t[4]+""+t[4]),format:o?"name":"hex8"}:!!(t=N.hex3.exec(e))&&{r:R(t[1]+""+t[1]),g:R(t[2]+""+t[2]),b:R(t[3]+""+t[3]),format:o?"name":"hex"}}(e)),"object"==s(e)&&(z(e.r)&&z(e.g)&&z(e.b)?(t=e.r,o=e.g,r=e.b,n={r:255*P(t,255),g:255*P(o,255),b:255*P(r,255)},p=!0,h="%"===String(e.r).substr(-1)?"prgb":"rgb"):z(e.h)&&z(e.s)&&z(e.v)?(i=L(e.s),u=L(e.v),n=function(e,t,o){e=6*P(e,360),t=P(t,100),o=P(o,100);var r=Math.floor(e),n=e-r,a=o*(1-t),i=o*(1-n*t),s=o*(1-(1-n)*t),c=r%6;return{r:255*[o,i,a,a,s,o][c],g:255*[s,o,o,i,a,a][c],b:255*[a,a,s,o,o,i][c]}}(e.h,i,u),p=!0,h="hsv"):z(e.h)&&z(e.s)&&z(e.l)&&(i=L(e.s),d=L(e.l),n=function(e,t,o){var r,n,a;function i(e,t,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e}if(e=P(e,360),t=P(t,100),o=P(o,100),0===t)r=n=a=o;else{var s=o<.5?o*(1+t):o+t-o*t,c=2*o-s;r=i(c,s,e+1/3),n=i(c,s,e),a=i(c,s,e-1/3)}return{r:255*r,g:255*n,b:255*a}}(e.h,i,d),p=!0,h="hsl"),e.hasOwnProperty("a")&&(a=e.a)),a=M(a),{ok:p,format:e.format||h,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a}}(e);this._originalInput=e,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||o.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=o.ok}function d(e,t,o){e=P(e,255),t=P(t,255),o=P(o,255);var r,n,a=Math.max(e,t,o),i=Math.min(e,t,o),s=(a+i)/2;if(a==i)r=n=0;else{var c=a-i;switch(n=s>.5?c/(2-a-i):c/(a+i),a){case e:r=(t-o)/c+(t<o?6:0);break;case t:r=(o-e)/c+2;break;case o:r=(e-t)/c+4}r/=6}return{h:r,s:n,l:s}}function p(e,t,o){e=P(e,255),t=P(t,255),o=P(o,255);var r,n,a=Math.max(e,t,o),i=Math.min(e,t,o),s=a,c=a-i;if(n=0===a?0:c/a,a==i)r=0;else{switch(a){case e:r=(t-o)/c+(t<o?6:0);break;case t:r=(o-e)/c+2;break;case o:r=(e-t)/c+4}r/=6}return{h:r,s:n,v:s}}function h(e,t,o,r){var n=[E(Math.round(e).toString(16)),E(Math.round(t).toString(16)),E(Math.round(o).toString(16))];return r&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function m(e,t,o,r){return[E(F(r)),E(Math.round(e).toString(16)),E(Math.round(t).toString(16)),E(Math.round(o).toString(16))].join("")}function f(e,t){t=0===t?0:t||10;var o=u(e).toHsl();return o.s-=t/100,o.s=q(o.s),u(o)}function y(e,t){t=0===t?0:t||10;var o=u(e).toHsl();return o.s+=t/100,o.s=q(o.s),u(o)}function b(e){return u(e).desaturate(100)}function g(e,t){t=0===t?0:t||10;var o=u(e).toHsl();return o.l+=t/100,o.l=q(o.l),u(o)}function _(e,t){t=0===t?0:t||10;var o=u(e).toRgb();return o.r=Math.max(0,Math.min(255,o.r-Math.round(-t/100*255))),o.g=Math.max(0,Math.min(255,o.g-Math.round(-t/100*255))),o.b=Math.max(0,Math.min(255,o.b-Math.round(-t/100*255))),u(o)}function w(e,t){t=0===t?0:t||10;var o=u(e).toHsl();return o.l-=t/100,o.l=q(o.l),u(o)}function k(e,t){var o=u(e).toHsl(),r=(o.h+t)%360;return o.h=r<0?360+r:r,u(o)}function v(e){var t=u(e).toHsl();return t.h=(t.h+180)%360,u(t)}function S(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var o=u(e).toHsl(),r=[u(e)],n=360/t,a=1;a<t;a++)r.push(u({h:(o.h+a*n)%360,s:o.s,l:o.l}));return r}function x(e){var t=u(e).toHsl(),o=t.h;return[u(e),u({h:(o+72)%360,s:t.s,l:t.l}),u({h:(o+216)%360,s:t.s,l:t.l})]}function C(e,t,o){t=t||6,o=o||30;var r=u(e).toHsl(),n=360/o,a=[u(e)];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,a.push(u(r));return a}function T(e,t){t=t||6;for(var o=u(e).toHsv(),r=o.h,n=o.s,a=o.v,i=[],s=1/t;t--;)i.push(u({h:r,s:n,v:a})),a=(a+s)%1;return i}u.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,o,r=this.toRgb();return e=r.r/255,t=r.g/255,o=r.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*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))},setAlpha:function(e){return this._a=M(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=p(this._r,this._g,this._b),t=Math.round(360*e.h),o=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+o+"%, "+r+"%)":"hsva("+t+", "+o+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=d(this._r,this._g,this._b),t=Math.round(360*e.h),o=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+o+"%, "+r+"%)":"hsla("+t+", "+o+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return h(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,o,r,n){var a=[E(Math.round(e).toString(16)),E(Math.round(t).toString(16)),E(Math.round(o).toString(16)),E(F(r))];return n&&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*P(this._r,255))+"%",g:Math.round(100*P(this._g,255))+"%",b:Math.round(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*P(this._r,255))+"%, "+Math.round(100*P(this._g,255))+"%, "+Math.round(100*P(this._b,255))+"%)":"rgba("+Math.round(100*P(this._r,255))+"%, "+Math.round(100*P(this._g,255))+"%, "+Math.round(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(A[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+m(this._r,this._g,this._b,this._a),o=t,r=this._gradientType?"GradientType=1, ":"";if(e){var n=u(e);o="#"+m(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+o+")"},toString:function(e){var t=!!e;e=e||this._format;var o=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(o=this.toRgbString()),"prgb"===e&&(o=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(o=this.toHexString()),"hex3"===e&&(o=this.toHexString(!0)),"hex4"===e&&(o=this.toHex8String(!0)),"hex8"===e&&(o=this.toHex8String()),"name"===e&&(o=this.toName()),"hsl"===e&&(o=this.toHslString()),"hsv"===e&&(o=this.toHsvString()),o||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return u(this.toString())},_applyModification:function(e,t){var o=e.apply(null,[this].concat([].slice.call(t)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(g,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(k,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(C,arguments)},complement:function(){return this._applyCombination(v,arguments)},monochromatic:function(){return this._applyCombination(T,arguments)},splitcomplement:function(){return this._applyCombination(x,arguments)},triad:function(){return this._applyCombination(S,[3])},tetrad:function(){return this._applyCombination(S,[4])}},u.fromRatio=function(e,t){if("object"==s(e)){var o={};for(var r in e)e.hasOwnProperty(r)&&(o[r]="a"===r?e[r]:L(e[r]));e=o}return u(e,t)},u.equals=function(e,t){return!(!e||!t)&&u(e).toRgbString()==u(t).toRgbString()},u.random=function(){return u.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},u.mix=function(e,t,o){o=0===o?0:o||50;var r=u(e).toRgb(),n=u(t).toRgb(),a=o/100;return u({r:(n.r-r.r)*a+r.r,g:(n.g-r.g)*a+r.g,b:(n.b-r.b)*a+r.b,a:(n.a-r.a)*a+r.a})},u.readability=function(e,t){var o=u(e),r=u(t);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},u.isReadable=function(e,t,o){var r,n,a,i,s,c=u.readability(e,t);switch(n=!1,(a=o,"AA"!==(i=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==i&&(i="AA"),"small"!==(s=(a.size||"small").toLowerCase())&&"large"!==s&&(s="small"),r={level:i,size:s}).level+r.size){case"AAsmall":case"AAAlarge":n=c>=4.5;break;case"AAlarge":n=c>=3;break;case"AAAsmall":n=c>=7}return n},u.mostReadable=function(e,t,o){var r,n,a,i,s=null,c=0;n=(o=o||{}).includeFallbackColors,a=o.level,i=o.size;for(var l=0;l<t.length;l++)(r=u.readability(e,t[l]))>c&&(c=r,s=u(t[l]));return u.isReadable(e,s,{level:a,size:i})||!n?s:(o.includeFallbackColors=!1,u.mostReadable(e,["#fff","#000"],o))};var I=u.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"},A=u.hexNames=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[e[o]]=o);return t}(I);function M(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function P(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var o=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),o&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function q(e){return Math.min(1,Math.max(0,e))}function R(e){return parseInt(e,16)}function E(e){return 1==e.length?"0"+e:""+e}function L(e){return e<=1&&(e=100*e+"%"),e}function F(e){return Math.round(255*parseFloat(e)).toString(16)}function j(e){return R(e)/255}var B,H,$,N=(H="[\\s|\\(]+("+(B="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?",$="[\\s|\\(]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")[,|\\s]+("+B+")\\s*\\)?",{CSS_UNIT:new RegExp(B),rgb:new RegExp("rgb"+H),rgba:new RegExp("rgba"+$),hsl:new RegExp("hsl"+H),hsla:new RegExp("hsla"+$),hsv:new RegExp("hsv"+H),hsva:new RegExp("hsva"+$),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 z(e){return!!N.CSS_UNIT.exec(e)}const O=["color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"],W=["fontFamily","fontSize","lineHeight","letterSpacing","fontWeight","fontVariation","textDecoration","textShadow","textTransform","-webkit-font-smoothing","-moz-osx-font-smoothing","transition"],Q=["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"],U={".Label":[...O,...W],".Text":[...O,...W],".Input":[...O,...W,...Q],".Error":[...O,...W,...Q],".Tab":[...O,...W,...Q],".TabIcon":[...O],".TabLabel":[...O,...W],".Block":[...O.slice(1),...Q.slice(1)],".Container":[...Q],".Header":[...O,...Q,...W],".Footer":[...O,...Q,...W]},D={".Label":U[".Label"],".Label--floating":[...U[".Label"],"transform"],".Input":[...U[".Input"],"outlineColor","outlineWidth","outlineStyle"],".Error":U[".Error"],".Tab":["backgroundColor","color","fontFamily"],".Tab--selected":["outlineColor","outlineWidth","outlineStyle","backgroundColor","color",...Q],".TabIcon":U[".TabIcon"],".TabIcon--selected":["color"],".TabLabel":U[".TabLabel"],".Block":U[".Block"],".Container":U[".Container"],".Header":U[".Header"],".Footer":U[".Footer"],".Footer--link":U[".Text"],".Text":U[".Text"],".Text--redirect":U[".Text"]},V=(e,t=document)=>{let o=null,r=0;for(;!o&&r<e.length;){let n;try{n=t.querySelector(e[r])}catch(e){r++;continue}if(!n){r++;continue}const a=(t.defaultView||window).getComputedStyle(n).backgroundColor;a&&u(a).getAlpha()>=.5&&(o=a),r++}return o||"#ffffff"},X=e=>{const t=u(e),o=t.getAlpha();if(o<1){const e=t.toRgb();return u({r:Math.round(e.r*o+255*(1-o)),g:Math.round(e.g*o+255*(1-o)),b:Math.round(e.b*o+255*(1-o))}).getBrightness()>125}return t.getBrightness()>125},G={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"],alternateSelectors:{appendTarget:"form.checkout",upeThemeInputSelector:'form.checkout input[type="text"]',upeThemeLabelSelector:"form.checkout label",upeThemeTextSelectors:["form.checkout",".woocommerce"]},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"],pmmeRelativeTextSizeSelector:".wc_payment_method > label"},blocksCheckout:{appendTarget:".wc-block-checkout__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",".wc-block-components-radio-control__label",".wc-block-checkout__terms"],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"],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"]},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"],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"],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"],alternateSelectors:{appendTarget:"form.checkout",upeThemeInputSelector:'form.checkout input[type="text"]',upeThemeLabelSelector:"form.checkout label",upeThemeTextSelectors:["form.checkout",".woocommerce"]},backgroundSelectors:["#customer_details","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"],linkSelectors:["form.checkout a",".woocommerce a","main a",".entry-content a",".site-content a","#content a","#primary a","a"],containerSelectors:[".woocommerce-checkout-review-order-table"],headerSelectors:["header > div:has(nav)","header > div:has(.site-logo)","header > div:has(.custom-logo)",".site-header","#masthead","header > div:last-of-type","header"],footerSelectors:[".site-footer","#colophon","footer > div","footer"],footerLink:[".site-footer a","footer a"]},wooPayBlocksCheckout:{appendTarget:".wc-block-checkout__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",".wc-block-components-radio-control__label",".wc-block-checkout__terms"],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:[".wc-block-checkout a",".wc-block-components-main a","main a",".entry-content a",".site-content a","#content a","#primary a","a"],containerSelectors:[".wp-block-woocommerce-checkout-order-summary-block"],headerSelectors:["header > div:has(nav)","header > div:has(.site-logo)","header > div:has(.custom-logo)",".site-header","#masthead","header > div:last-of-type","header"],footerSelectors:[".site-footer","#colophon","footer > div","footer"],footerLink:[".site-footer a","footer a"]},updateSelectors:function(e,t){return e.hasOwnProperty("alternateSelectors")&&(Object.entries(e.alternateSelectors).forEach((o=>{const[r,n]=o,a=e[r];if(Array.isArray(a))a.some((e=>{try{return t.querySelector(e)}catch(e){return!1}}))||(e[r]=n);else try{t.querySelector(e[r])||(e[r]=n)}catch(t){e[r]=n}})),delete e.alternateSelectors),e},getSelectors:function(e,t){let o=this.blocksCheckout;switch(e){case"blocks_checkout":o=this.blocksCheckout;break;case"shortcode_checkout":o=this.classicCheckout;break;case"bnpl_product_page":o=this.bnplProductPage;break;case"bnpl_classic_cart":o=this.bnplClassicCart;break;case"bnpl_cart_block":o=this.bnplCartBlock;break;case"woopay_shortcode_checkout":o=this.wooPayClassicCheckout;break;case"woopay_blocks_checkout":o=this.wooPayBlocksCheckout}return{...this.default,...this.updateSelectors(o,t)}}},J={getHiddenContainer:function(e,t){const o=t.createElement("div");return o.setAttribute("id",this.getIDFromSelector(e)),o.style.border=0,o.style.clip="rect(0 0 0 0)",o.style.height="1px",o.style.margin="-1px",o.style.overflow="hidden",o.style.padding="0",o.style.position="absolute",o.style.width="1px",o},createRow:function(e,t=[],o){const r=o.createElement(e);return t.length&&r.classList.add(...t),r},appendClone:function(e,t,o,r){const n=r.querySelector(t);if(n){const t=n.cloneNode(!0);t.id=this.getIDFromSelector(o),t.value="",e.appendChild(t)}},getIDFromSelector:function(e){return e.startsWith("#")||e.startsWith(".")?e.slice(1):e},init:function(e,t){const o=G.getSelectors(e),r=t.querySelector(o.appendTarget),n=t.querySelector(o.upeThemeInputSelector);if(!r||!n)return;t.querySelector(o.hiddenContainer)&&this.cleanup(t);const a=this.getHiddenContainer(o.hiddenContainer,t);r.appendChild(a);const i=this.createRow(o.rowElement,o.validClasses,t);a.appendChild(i);const s=this.createRow(o.rowElement,o.invalidClasses,t);a.appendChild(s),this.appendClone(i,o.upeThemeInputSelector,o.hiddenInput,t),this.appendClone(i,o.upeThemeLabelSelector,o.hiddenValidActiveLabel,t),this.appendClone(s,o.upeThemeInputSelector,o.hiddenInvalidInput,t),this.appendClone(s,o.upeThemeLabelSelector,o.hiddenInvalidInput,t),t.querySelector(o.hiddenInput).style.transition="none"},cleanup:function(e){const t=e.querySelector(G.default.hiddenContainer);t&&t.remove()}},K=(e,t,o=null,r)=>{const n=(Array.isArray(e)?e:[e]).map((e=>{try{return r.querySelector(e)}catch(e){return null}})).filter(Boolean);if(!n.length)return{};const a=r.defaultView||window,i=D[t],s=n[0],c=a.getComputedStyle(s),l={};if(i.forEach((e=>{const t=e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`)),o=c.getPropertyValue(t);if(o)if("color"!==e)if("lineHeight"!==e||"0"!==o&&"0px"!==o)l[e]=o;else for(let t=1;t<n.length;t++){const o=a.getComputedStyle(n[t]).getPropertyValue("line-height");if("0"!==o&&"0px"!==o){l[e]=o;break}}else l[e]=(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 o=t[4]||1;e=`rgb(${t.slice(1,4).map((e=>Math.round(e*o+255*(1-o)))).join(", ")})`}return e})(o)})),".Input"===t||".Tab--selected"===t){const e=((e,t="solid",o)=>e&&o?[e,t,o].join(" "):"")(l.outlineWidth,l.outlineStyle,l.outlineColor);""!==e&&(l.outline=e),delete l.outlineWidth,delete l.outlineColor,delete l.outlineStyle}const u=c.getPropertyValue("text-indent");return"0px"!==u&&"0px"===l.paddingLeft&&"0px"===l.paddingRight&&(l.paddingLeft=u,l.paddingRight=u),".Block"===t&&(l.backgroundColor=o),l},Z={blocks_checkout:"woopay_blocks_checkout",shortcode_checkout:"woopay_shortcode_checkout"},Y=(e,t=!1,o=document)=>{var r;const n=t&&null!==(r=Z[e])&&void 0!==r?r:e,a=G.getSelectors(n,o);J.init(n,o);const i=K(a.hiddenInput,".Input",null,o),s=K(a.hiddenInvalidInput,".Input",null,o),c=K(a.upeThemeLabelSelector,".Label",null,o),l={fontSize:c.fontSize},d=K(a.upeThemeTextSelectors,".Text",null,o),p=K(a.upeThemeInputSelector,".Tab",null,o),h=K(a.hiddenInput,".Tab--selected",null,o),m=(e=>{const t=Object.assign({},e);if(!e.backgroundColor||!e.color)return e;const o=((e,t)=>{const o={backgroundColor:e,color:t},r=u(e),n=u(t);if(!r.isValid()||!n.isValid())return{backgroundColor:"",color:""};const a=r.getBrightness()>50?u(r).darken(7):u(r).lighten(7),i=u.mostReadable(a,[n],{includeFallbackColors:!0});return o.backgroundColor=a.toRgbString(),o.color=i.toRgbString(),o})(e.backgroundColor,e.color);return t.backgroundColor=o.backgroundColor,t.color=o.color,t})(p),f={color:m.color},y={color:h.color},b=V(a.backgroundSelectors,o),g=K(a.upeThemeLabelSelector,".Block",b,o),_={colorBackground:b,colorText:d.color,fontFamily:d.fontFamily,fontSizeBase:d.fontSize};a.pmmeRelativeTextSizeSelector&&_.fontSizeBase&&(_.fontSizeBase=function(e,t,o=.875,r){const n=parseFloat(t);if(isNaN(n))return t;const a=r.querySelector(e);if(!a)return n*o+"px";const i=window.getComputedStyle(a).getPropertyValue("font-size"),s=parseFloat(i)*o;return isNaN(s)?t:n>s?`${s}px`:`${n}px`}(a.pmmeRelativeTextSizeSelector,d.fontSize,.875,o));const w="blocks_checkout"===e||"woopay_blocks_checkout"===n;let k={variables:_,theme:X(b)?"stripe":"night",labels:w?"floating":"above",rules:JSON.parse(JSON.stringify({".Input":i,".Input--invalid":s,".Label":c,".Label--resting":l,".Block":g,".Tab":p,".Tab:hover":m,".Tab--selected":h,".TabIcon:hover":f,".TabIcon--selected":y,".Text":d,".Text--redirect":d}))};if(w&&(k=((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 o=t[1].split(", "),r=(parseFloat(o[0])+parseFloat(o[3]))/2,n=parseFloat(e.rules[".Label--floating"].lineHeight),a=Math.floor(n*r);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 o;const t=parseFloat(e.rules[".Input"].paddingBottom);e.rules[".Input"].paddingBottom=t-1+"px";const r=null!==(o=e.rules[".Label"].marginTop)&&void 0!==o?o:"0";e.rules[".Label"].marginTop=`${Math.floor((t-1)/3)}px`,e.rules[".Label--floating"].marginTop=r}return e})(k,K(a.hiddenValidActiveLabel,".Label--floating",null,o))),t){const e=K(a.headerSelectors,".Header",null,o),t=K(a.footerSelectors,".Footer",null,o);var v,S;(!e.backgroundColor||u(e.backgroundColor).getAlpha()<.5)&&(e.backgroundColor=V([...null!==(v=a.headerSelectors)&&void 0!==v?v:[],"body"],o)),(!t.backgroundColor||u(t.backgroundColor).getAlpha()<.5)&&(t.backgroundColor=V([...null!==(S=a.footerSelectors)&&void 0!==S?S:[],"body"],o)),k.rules={...k.rules,".Heading":K(a.headingSelectors,".Label",null,o),".Header":e,".Footer":t,".Footer-link":K(a.footerLink,".Footer--link",null,o),".Button":K(a.buttonSelectors,".Input",null,o),".Link":K(a.linkSelectors,".Label",null,o),".Container":K(a.containerSelectors,".Container",null,o)}}return J.cleanup(o),k};class ee{constructor(e,t){this.options=e,this.stripe=null,this.stripePlatform=null,this.request=t,this.isWooPayRequesting=!1}createStripe(e,t,o="",r=[]){const n={locale:t};return o&&(n.stripeAccount=o),r&&(n.betas=r),new Stripe(e,n)}async getStripeForUPE(e){return this.options.forceNetworkSavedCards=n("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:o,forceNetworkSavedCards:r,locale:n,isStripeLinkEnabled:a}=this.options;if(r&&!e)return this.stripePlatform||(this.stripePlatform=this.createStripe(t,n)),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,n,o,e)}return this.stripe}async loadStripeForExpressCheckout(){try{return this.getStripe(!0)}catch(e){return{error:e}}}confirmIntent(e,t=!1){const o=e.match(/#wcpay-confirm-(pi|si):([^:]+):([^:]+):([^:]+)(?::(.+))?$/);if(!o)return!0;const n="si"===o[1];let i=o[2];const s=o[3],c=o[4],l=o[5]||null,u=e.indexOf("order-pay"),d=u>-1&&e.substring(u).match(/\d+/);return d&&(i=d[0]),(async()=>{const{locale:e,publishableKey:t}=this.options,o=r("accountIdForIntentConfirmation");if(n){const e=await this.getStripe(!0);return l?e.confirmSetup({clientSecret:s,confirmParams:{confirmation_token:l},redirect:"if_required"}):e.handleNextAction({clientSecret:s})}return o?this.createStripe(t,e,o).confirmCardPayment(s):(await this.getStripe(!0)).handleNextAction({clientSecret:s})})().then((e=>{var o;let n=null;e.paymentIntent?.last_payment_error&&(n={message:e.paymentIntent.last_payment_error.message}),"requires_action"===e.paymentIntent?.status&&(n={message:"Payment requires additional action."});const s=e.paymentIntent&&e.paymentIntent.id||e.setupIntent&&e.setupIntent.id||e.error&&e.error.payment_intent&&e.error.payment_intent.id||e.error.setup_intent&&e.error.setup_intent.id,l=null!==(o=a("ajax_url"))&&void 0!==o?o:r("ajaxUrl"),u=r("isChangingPayment");return[this.request(l,{action:"update_order_status",order_id:i,_ajax_nonce:c,intent_id:s,should_save_payment_method:t?"true":"false",is_changing_payment:u?"true":"false"}),n,e.error]})).then((([e,t,o])=>{if(o)throw o;return e.then((e=>{const o="string"==typeof e?JSON.parse(e):e;if(o.error)throw o.error;if(t)throw t;return o.return_url}))}))}async setupIntent(e){const t=await this.request(r("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":e,_ajax_nonce:r("createSetupIntentNonce")});if(!t.success)throw t.data.error;if("succeeded"===t.data.status)return t.data;const o=await this.getStripe(),n=await o.confirmCardSetup(t.data.client_secret),{setupIntent:a,error:i}=n;if(i)throw i;return a}initWooPay(e,t){if(!this.isWooPayRequesting){this.isWooPayRequesting=!0;const o=r("wcAjaxUrl"),n=r("initWooPayNonce");let a=null,s=null;if(r("isWooPayGlobalThemeSupportEnabled"))if(r("isShortcodeCheckout")){const e=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;a=Y(e,!0),s=((e=document)=>{const t=[],o=e.styleSheets,r=["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","fonts.bunny.net","fonts.wp.com"];for(let e=0;e<o.length;e++){if(!o[e].href)continue;const n=new URL(o[e].href);-1!==r.indexOf(n.hostname)&&t.push({cssSrc:o[e].href})}return t})()}else a=r("woopayAppearance"),s=r("woopayFontRules");return this.request(i(o,"init_woopay"),{_wpnonce:n,appearance:a,font_rules:s,email:e,user_session:t,order_id:r("order_id"),key:r("key"),billing_email:r("billing_email")}).finally((()=>{this.isWooPayRequesting=!1}))}}expressCheckoutAddToCart(e){const t=r("wcAjaxUrl"),o=r("addToCartNonce");return this.request(i(t,"add_to_cart"),{security:o,...e})}}jQuery((e=>{e("input[name=wc_deposit_option],input[name=wc_deposit_payment_plan]").on("change",(()=>{(0,o.doAction)("wcpay.express-checkout.update-button-data")}))})),(0,o.addFilter)("wcpay.express-checkout.cart-add-item","automattic/wcpay/express-checkout",(e=>{const t={};return jQuery("input[name=wc_deposit_option]").length&&(t.wc_deposit_option=jQuery("input[name=wc_deposit_option]:checked").val()),jQuery("input[name=wc_deposit_payment_plan]").length&&(t.wc_deposit_payment_plan=jQuery("input[name=wc_deposit_payment_plan]:checked").val()),{...e,...t}}));const te="wcpay-express-checkout__order-attribution-inputs",oe=()=>{(()=>{if(document.getElementById(te))return;const e=document.createElement("wc-order-attribution-inputs");e.id=te,document.body.appendChild(e)})(),window?.wc_order_attribution?.setOrderTracking(window?.wc_order_attribution?.params?.allowTracking)};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",oe):oe(),(0,o.addFilter)("wcpay.express-checkout.cart-place-order-extension-data","automattic/wcpay/express-checkout",(e=>{const t=jQuery("#wcpay-express-checkout__order-attribution-inputs input");if(!t.length)return e;const o={};return t.each((function(){const e=jQuery(this).attr("name").replace("wc_order_attribution_",""),t=jQuery(this).val();e&&t&&(o[e]=t)})),{...e,"woocommerce/order-attribution":o}}));let re=null,ne=null;const ae=()=>jQuery(ne),ie={init:({elementId:e,$separator:t})=>{ne=e,re=t},getButtonSeparator:()=>re,blockButton:()=>{ae().data("blockUI.isBlocked")||ae().block({message:null})},unblockButton:()=>{ie.showContainer(),ae().unblock()},renderButton:e=>{ae()?.length&&e.mount(ne)},hideContainer:()=>{ae().removeClass("is-ready").hide()},showContainer:()=>{ae().addClass("is-ready").show()}},se=ie,ce=(e,t,o=!1)=>{let r;return function(){const n=this,a=arguments,i=o&&!r;clearTimeout(r),r=setTimeout((()=>{r=null,o||t.apply(n,a)}),e),i&&t.apply(n,a)}},le=e=>{var t,o;return void 0!==window.wcpayExpressCheckoutParams?null!==(t=window.wcpayExpressCheckoutParams[e])&&void 0!==t?t:null:void 0!==window.wc?.wcSettings&&null!==(o=window.wc.wcSettings.getSetting("ece_data")?.[e])&&void 0!==o?o:null};jQuery((e=>{e(document.body).on("woocommerce_variation_has_changed",(async()=>{(0,o.doAction)("wcpay.express-checkout.update-button-data")}))})),jQuery((e=>{if("product"!==le("button_context"))return;const t=e(".quantity");t.on("input",".qty",(()=>{se.blockButton()})),t.on("input",".qty",ce(250,(async()=>{(0,o.doAction)("wcpay.express-checkout.update-button-data")})))})),(0,o.addFilter)("wcpay.express-checkout.cart-add-item","automattic/wcpay/express-checkout",(e=>{const t=document.querySelector(".single_variation_wrap");if(!t)return e;const o=t.querySelector('input[name="product_id"]').value;return{...e,id:parseInt(o,10)}})),(0,o.addFilter)("wcpay.express-checkout.cart-add-item","automattic/wcpay/express-checkout",(e=>{const t=document.querySelector(".variations_form");if(!t)return e;const o=[],r=t.querySelectorAll(".variations select");return Array.from(r).forEach((function(e){const t=e.dataset.attribute_name||e.dataset.name;o.push({attribute:Array.from(document.querySelector(`label[for="${t.replace("attribute_","")}"]`).childNodes)[0].textContent,value:e.value||""}),o.push({attribute:t,value:e.value||""})})),{...e,variation:[...e.variation,...o]}})),(0,o.addFilter)("wcpay.express-checkout.map-line-items","automattic/wcpay/express-checkout",(e=>({...e,items:e.items.filter((e=>!e.extensions?.bundles?.bundled_by))})));const ue=window.wp.htmlEntities,de=(e,t)=>{var o;return e*10**((null!==(o=le("checkout")?.currency_decimals)&&void 0!==o?o:2)-t.currency_minor_unit)},pe=e=>{const r=le("checkout").display_prices_with_tax,n=(0,o.applyFilters)("wcpay.express-checkout.map-line-items",e),a=n.items.map((e=>({amount:de(r&&e.totals?parseInt(e.totals.line_subtotal,10)+parseInt(e.totals.line_subtotal_tax,10):parseInt(e.totals?.line_subtotal||e.prices.price,10),e.totals||e.prices),name:[e.name,e.quantity>1&&`(x${e.quantity})`,e.variation&&e.variation.length>0&&"-",e.variation&&e.variation.map((e=>`${e.attribute}: ${e.value}`)).join(", "),e.item_data&&e.item_data.length>0&&"-",e.item_data&&e.item_data.map((e=>`${e.name||e.key}: ${e.value}`)).join(", ")].filter(Boolean).map(ue.decodeEntities).join(" ")}))),i=parseInt(n.totals.total_shipping||"0",10);i&&a.push({amount:de(r?i+parseInt(n.totals.total_shipping_tax||"0",10):i,n.totals),name:(0,t.__)("Shipping","woocommerce-payments")});const s=parseInt(n.totals.total_discount||"0",10);s&&a.push({amount:-de(r?s+parseInt(n.totals.total_discount_tax||"0",10):s,n.totals),name:(0,t.__)("Discount","woocommerce-payments")});const c=parseInt(n.totals.total_fees||"0",10);c&&a.push({amount:de(r?c+parseInt(n.totals.total_fees_tax||"0",10):c,n.totals),name:(0,t.__)("Fees","woocommerce-payments")});const l=parseInt(n.totals.total_tax||"0",10);l&&!r&&a.push({amount:de(l,n.totals),name:(0,t.__)("Tax","woocommerce-payments")});const u=parseInt(n.totals.total_refund||"0",10);return u&&a.push({amount:-de(u,n.totals),name:(0,t.__)("Refund","woocommerce-payments")}),de(parseInt(n.totals.total_price,10)-parseInt(n.totals.total_refund||0,10),n.totals)<a.reduce(((e,{amount:t})=>e+t),0)?[]:a},he=e=>{const t=le("checkout").display_prices_with_tax,r=e.shipping_rates?.[0]?.shipping_rates||[],n=(0,o.applyFilters)("wcpay.express-checkout.shipping-rates",r,e);return n&&0!==n.length?n.sort(((e,t)=>e.selected===t.selected?0:e.selected?-1:1)).slice(0,9).map((e=>({id:e.rate_id,displayName:(0,ue.decodeEntities)(e.name),amount:de(t?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10),e),deliveryEstimate:[e.meta_data.find((e=>"pickup_address"===e.key))?.value,e.meta_data.find((e=>"pickup_details"===e.key))?.value].filter(Boolean).map(ue.decodeEntities).join(" - ")}))):[]},me=e=>{const t=e?.extensions?.subscriptions;return!!t&&t.trial_length>0},fe=e=>{const t=e?.extensions?.subscriptions;if(!t||!Array.isArray(t))return null;for(const e of t){const t=e.shipping_rates?.[0]?.shipping_rates;if(t?.length>0)return t}return null},ye=e=>!(!e?.items||!e?.extensions?.subscriptions)&&(!!e.items.some(me)&&(!(e.shipping_rates?.[0]?.shipping_rates?.length>0)&&null!==fe(e))),be=e=>!(!e?.items||!e?.extensions?.subscriptions)&&e.items.some(me),ge=e=>!!be(e)&&0===parseInt(e.totals?.total_price||"0",10),_e=e=>{const t=e?.extensions?.subscriptions;if(!t||!Array.isArray(t))return null;let o=0,r=0,n=0,a=0,i=0,s=2;const c=[];if(t.forEach((e=>{var t;if(!e.totals?.total_price)return;o+=parseInt(e.totals.total_price,10),r+=parseInt(e.totals.total_items||"0",10),n+=parseInt(e.totals.total_tax||"0",10);const l=e.shipping_rates?.[0]?.shipping_rates?.find((e=>e.selected));l?(a+=parseInt(l.price||"0",10),i+=parseInt(l.taxes||"0",10)):(a+=parseInt(e.totals.total_shipping||"0",10),i+=parseInt(e.totals.total_shipping_tax||"0",10)),s=null!==(t=e.totals.currency_minor_unit)&&void 0!==t?t:s,e.totals.tax_lines&&c.push(...e.totals.tax_lines)})),0===o)return null;const l=t[0]?.totals||e.totals;return{amount:o,currencyMinorUnit:s,totals:{...l,total_price:String(o),total_items:String(r),total_tax:String(n),total_shipping:String(a),total_shipping_tax:String(i),tax_lines:c}}},we=e=>{var o,r,n,a,i,s;const c=e.totals,l=parseInt(c.total_price,10),u=null!==(o=c.currency_minor_unit)&&void 0!==o?o:2,d=null!==(r=c.currency_prefix)&&void 0!==r?r:"",p=null!==(n=c.currency_suffix)&&void 0!==n?n:"",h=null!==(a=c.currency_decimal_separator)&&void 0!==a?a:".",m=null!==(i=c.currency_thousand_separator)&&void 0!==i?i:",",f=(l/Math.pow(10,u)).toFixed(u).split("."),y=f[0].replace(/\B(?=(\d{3})+(?!\d))/g,m),b=`${d}${f[1]?`${y}${h}${f[1]}`:y}${p}`,g=(_=e.billing_period,(w=null!==(s=e.billing_interval)&&void 0!==s?s:1)>1?{day:(0,t.sprintf)((0,t._n)("%d day","%d days",w,"woocommerce-payments"),w),week:(0,t.sprintf)((0,t._n)("%d week","%d weeks",w,"woocommerce-payments"),w),month:(0,t.sprintf)((0,t._n)("%d month","%d months",w,"woocommerce-payments"),w),year:(0,t.sprintf)((0,t._n)("%d year","%d years",w,"woocommerce-payments"),w)}[_]||`${w} ${_}s`:{day:(0,t.__)("day","woocommerce-payments"),week:(0,t.__)("week","woocommerce-payments"),month:(0,t.__)("month","woocommerce-payments"),year:(0,t.__)("year","woocommerce-payments")}[_]||_);var _,w;return(0,t.sprintf)((0,t.__)("%1$s / %2$s","woocommerce-payments"),b,g)};(0,o.addFilter)("wcpay.express-checkout.total-amount","automattic/wcpay/express-checkout/wc-subscriptions",((e,t)=>{if(!ge(t))return e;const o=_e(t);return o?de(o.amount,o.totals):e})),(0,o.addFilter)("wcpay.express-checkout.is-cart-eligible","automattic/wcpay/express-checkout/wc-subscriptions",((e,t)=>{if(e)return!0;if(ge(t)){const e=_e(t);return null!==e&&e.amount>0}return e})),(0,o.addFilter)("wcpay.express-checkout.shipping-rates","automattic/wcpay/express-checkout/wc-subscriptions",((e,t)=>e&&e.length>0?e:ye(t)&&fe(t)||e)),(0,o.addFilter)("wcpay.express-checkout.shipping-package-id","automattic/wcpay/express-checkout/wc-subscriptions",((e,t,o)=>{if(!ye(t))return e;const r=t?.extensions?.subscriptions;if(!r||!Array.isArray(r))return e;for(const e of r){const t=e.shipping_rates;if(t&&Array.isArray(t))for(const e of t){const t=e?.shipping_rates?.some((e=>e.rate_id===o));if(t&&e.package_id)return e.package_id}}return e})),(0,o.addFilter)("wcpay.express-checkout.map-line-items","automattic/wcpay/express-checkout/wc-subscriptions",(e=>{if(!be(e))return e;const o=e?.extensions?.subscriptions;if(!o||!Array.isArray(o))return e;const r=0===parseInt(e.totals?.total_price||"0",10),n=[...e.items],a=(0,t.__)("Recurring total","woocommerce-payments");if(o.forEach((o=>{const i=e.items.filter((e=>e.extensions?.subscriptions?.billing_period===o.billing_period)).length;if(0===i)return;const s=Math.round(parseInt(o.totals?.total_items||"0",10)/i);n.forEach(((e,i)=>{const c=e.extensions?.subscriptions;c&&c.trial_length>0&&c.billing_period===o.billing_period&&((e.item_data||[]).some((e=>e.name===a))||(n[i]={...e,name:`${e.name} (${(0,t.__)("recurring","woocommerce-payments")})`,...r&&{totals:{...e.totals,line_subtotal:String(s),line_total:String(s)}},item_data:[...e.item_data||[],{name:(0,t.__)("Recurring total","woocommerce-payments"),value:(0,t.sprintf)((0,t.__)("%1$s on %2$s","woocommerce-payments"),we(o),o.next_payment_date)}]}))}))})),!r)return{...e,items:n};const i=_e(e);return i?{...e,items:n,totals:{...e.totals,total_price:String(i.amount),total_items:i.totals.total_items||"0",total_tax:i.totals.total_tax||"0",total_shipping:i.totals.total_shipping||"0",total_shipping_tax:i.totals.total_shipping_tax||"0",tax_lines:i.totals.tax_lines||[]}}:{...e,items:n}}));const ke=e=>{var t;let o="undefined"==typeof wcpaySettings?4:parseInt(window?.wcpaySettings?.defaultExpressCheckoutBorderRadius||4,10);const r=le("button");var n;return o=null!==(t=r?.radius)&&void 0!==t?t:o,void 0!==e&&(o=null!==(n=Number(e?.borderRadius))&&void 0!==n?n:o),{variables:{borderRadius:`${o}px`,spacingUnit:"6px"}}},ve=e=>{if(!e)return"";const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstChild?t.firstChild.textContent:""},Se=(e,t,o)=>{const r=document.querySelector(`${e} [name="${t}"]`);if(r)if("SELECT"===r.tagName&&/country|state/.test(t)){const e=Array.from(r.options).find((e=>e.value===o||e.textContent.trim().toLowerCase()===o.toLowerCase()));e&&(r.value=e.value,jQuery(r).trigger("change").trigger("close"))}else r.value=o,jQuery(r).trigger("change")},xe=window.lodash,Ce=(window.wp.domReady,(e,t={})=>{var o,n,i;if(!1===(null!==(o=r("isShopperTrackingEnabled"))&&void 0!==o?o:a("is_shopper_tracking_enabled")))return;const s=null!==(n=r("platformTrackerNonce"))&&void 0!==n?n:a("nonce")?.platform_tracker,c=null!==(i=r("ajaxUrl"))&&void 0!==i?i:a("ajax_url"),l=new FormData;l.append("tracksNonce",s),l.append("action","platform_tracks"),l.append("tracksEventName",e),l.append("tracksEventProp",JSON.stringify(t)),fetch(c,{method:"post",body:l}).then((e=>e.json()))}),Te=(0,xe.debounce)((({source:e})=>{Ce("applepay_button_load",{source:e})}),1e3),Ie=(0,xe.debounce)((({source:e})=>{Ce("gpay_button_load",{source:e})}),1e3),Ae=window.wp.apiFetch;var Me=e.n(Ae);const Pe=window.wp.url,qe=()=>document.querySelector(".single_add_to_cart_button")||document.querySelector('.wp-block-add-to-cart-with-options button[type="submit"]'),Re=()=>{const e=document.querySelector(".single_add_to_cart_button");if(e)return e.value;const t=document.querySelector('.wp-block-add-to-cart-with-options input[name="add-to-cart"]');return t?.value},Ee=()=>{const e=document.querySelector(".quantity .qty");return e&&parseInt(e.value,10)||1};class Le{cartRequestHeaders={};async _request(e){const t=await Me()({...e,parse:!1,path:(0,Pe.addQueryArgs)(e.path,{currency:le("checkout").currency_code.toUpperCase()}),headers:{Nonce:le("nonce").store_api_nonce,"X-WooPayments-Tokenized-Cart-Nonce":le("nonce").tokenized_cart_nonce||void 0,"X-WooPayments-Tokenized-Cart-Session-Nonce":"product"===le("button_context")?le("nonce").tokenized_cart_session_nonce:void 0,...this.cartRequestHeaders,...e.headers}});return this.cartRequestHeaders={Nonce:t.headers.get("Nonce"),"X-WooPayments-Tokenized-Cart-Session":t.headers.get("X-WooPayments-Tokenized-Cart-Session")},t.json()}async placeOrder(e){return await this._request({method:"POST",path:"/wc/store/v1/checkout",headers:{"X-WooPayments-Tokenized-Cart":!0,...this.cartRequestHeaders},data:e})}async getCart(){return await this._request({method:"GET",path:"/wc/store/v1/cart"})}useSeparateCart(){this.cartRequestHeaders={"X-WooPayments-Tokenized-Cart-Session":""}}deleteAfterRequest(){this.cartRequestHeaders={"X-WooPayments-Tokenized-Cart-Is-Ephemeral-Cart":"1"}}async updateCustomer(e){return await this._request({method:"POST",path:"/wc/store/v1/cart/update-customer",headers:{"X-WooPayments-Tokenized-Cart":!0,...this.cartRequestHeaders},data:e})}async selectShippingRate(e){return await this._request({method:"POST",path:"/wc/store/v1/cart/select-shipping-rate",data:e})}async addProductToCart(){const e={id:Re(),quantity:Ee(),variation:[]};return await this._request({method:"POST",path:"/wc/store/v1/cart/add-item",data:(0,o.applyFilters)("wcpay.express-checkout.cart-add-item",e)})}async emptyCart(){try{let e=await this._request({method:"GET",path:"/wc/store/v1/cart"});for(;e.items.length>0;)e=await this._request({method:"POST",path:"/wc/store/v1/cart/remove-item",data:{key:e.items[0].key}})}catch(e){}}}const Fe=(e,t)=>{var o,r,n,a,i,s,c,l,u;return{first_name:null!==(o=e?.split(" ")?.slice(0,1)?.join(" "))&&void 0!==o?o:"",last_name:null!==(r=e?.split(" ")?.slice(1)?.join(" "))&&void 0!==r?r:"",company:null!==(n=t.organization)&&void 0!==n?n:"",address_1:null!==(a=t.line1)&&void 0!==a?a:"",address_2:null!==(i=t.line2)&&void 0!==i?i:"",city:null!==(s=t.city)&&void 0!==s?s:"",state:null!==(c=t.state)&&void 0!==c?c:"",postcode:null!==(l=t.postal_code?.replace(" ",""))&&void 0!==l?l:"",country:null!==(u=t.country)&&void 0!==u?u:""}},je=(e,t,o=!0,r=[])=>{var n,a,i,s,c,l,u,d,p,h,m,f,y;const b=e.billingDetails?.name||"",g=null!==(n=e.billingDetails?.address)&&void 0!==n?n:{},_=null!==(a=null!==(i=e.billingDetails?.phone?.replace(/[() -]/g,""))&&void 0!==i?i:e.payerPhone?.replace(/[() -]/g,""))&&void 0!==a?a:"";return{customer_note:e.order_comments,billing_address:{first_name:null!==(s=b.split(" ")?.slice(0,1)?.join(" "))&&void 0!==s?s:"",last_name:b.split(" ")?.slice(1)?.join(" ")||"-",company:null!==(c=g.organization)&&void 0!==c?c:"",address_1:null!==(l=g.line1)&&void 0!==l?l:"",address_2:null!==(u=g.line2)&&void 0!==u?u:"",city:null!==(d=g.city)&&void 0!==d?d:"",state:null!==(p=g.state)&&void 0!==p?p:"",postcode:null!==(h=g.postal_code)&&void 0!==h?h:"",country:null!==(m=g.country)&&void 0!==m?m:"",email:null!==(f=e.billingDetails?.email)&&void 0!==f?f:"",phone:_},shipping_address:e.shippingAddress?{...Fe(e.shippingAddress.name||"",e.shippingAddress.address),phone:_}:void 0,payment_method:"woocommerce_payments",payment_data:[{key:"payment_method",value:"card"},{key:"wcpay-fraud-prevention-token",value:null!==(y=window.wcpayFraudPreventionToken)&&void 0!==y?y:""},{key:o?"wcpay-confirmation-token":"wcpay-payment-method",value:t},{key:"express_payment_type",value:e.expressPaymentType},{key:"wcpay-express-payment-method-types",value:JSON.stringify(r)}]}};let Be=null,He=null,$e=new Le;const Ne=()=>$e,ze=()=>{jQuery.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},Oe=()=>{jQuery.unblockUI()};class We{orderId;key;billingEmail="";cachedCartData={};constructor({orderId:e,key:t,billingEmail:o=""}){this.orderId=e,this.key=t,this.billingEmail=o}async placeOrder(e){return await Me()({method:"POST",path:`/wc/store/v1/checkout/${this.orderId}`,headers:{Nonce:le("nonce").store_api_nonce},data:{...e,key:this.key,billing_email:this.billingEmail,billing_address:this.cachedCartData.billing_address,shipping_address:this.cachedCartData.shipping_address}})}async getCart(){return this.cachedCartData=await Me()({method:"GET",path:(0,Pe.addQueryArgs)(`/wc/store/v1/order/${this.orderId}`,{key:this.key,billing_email:this.billingEmail})})}}let Qe=null;const Ue=async()=>{if("product"!==le("button_context"))return await Ne().getCart();const e=new Le;return e.useSeparateCart(),e.deleteAfterRequest(),await e.addProductToCart()},De=()=>Qe?(0,o.applyFilters)("wcpay.express-checkout.total-amount",de(parseInt(Qe.totals.total_price,10)-parseInt(Qe.totals.total_refund||0,10),Qe.totals),Qe):"product"===le("button_context")&&le("product")?le("product")?.total.amount:void 0;let Ve;jQuery((e=>{if(le("has_block")&&"pay_for_order"!==le("button_context"))return;const n=le("stripe").publishableKey;if(!n)return;const a=new ee({publishableKey:n,accountId:le("stripe").accountId,locale:le("stripe").locale},((e,t)=>new Promise(((o,r)=>{jQuery.post(e,t).then(o).fail(r)}))));var i;"pay_for_order"===le("button_context")&&(i=new We({orderId:r("order_id"),key:r("key"),billingEmail:r("billing_email")}),$e=i),se.init({elementId:"#wcpay-express-checkout-element",$separator:jQuery("#wcpay-express-checkout-button-separator")});const s={abortPayment:t=>{Oe(),e(".woocommerce-error").remove();const o=e(".woocommerce-notices-wrapper").first();o.length&&(o.append(e('<div class="woocommerce-error" />').text(t)),e("html, body").animate({scrollTop:o.find(".woocommerce-error").offset().top},600))},completePayment:e=>{ze(),window.location=e},startExpressCheckoutElement:async e=>{var r,n,i,c,l;let u="",d=Promise.resolve();const p=await a.getStripe(),h=null===(r=le("flags")?.isEceUsingConfirmationTokens)||void 0===r||r,m=null!==(n=le("is_manual_capture"))&&void 0!==n&&n,f=null!==(i=le("has_subscription"))&&void 0!==i&&i,y=null!==(c=le("enabled_methods"))&&void 0!==c?c:[],b=[y.includes("payment_request")&&"card",y.includes("amazon_pay")&&"amazon_pay"].filter(Boolean);Ve=p.elements({mode:"payment",amount:e.total,currency:e.currency,...h?{paymentMethodTypes:b}:{paymentMethodCreation:"manual"},...h&&m?{captureMethod:"manual"}:{},...h&&f?{setupFutureUsage:"off_session"}:{},appearance:ke(),locale:null!==(l=le("stripe")?.locale)&&void 0!==l?l:"en"});const g=Ve.create("expressCheckout",(()=>{var e,t,o,r,n,a;const i=le("button"),s=null!==(e=le("enabled_methods"))&&void 0!==e?e:[],c=(e,t)=>{switch(t){case"dark":default:return"black";case"light":return"white";case"light-outline":return"googlePay"===e?"white":"white-outline"}},l="default"===i?.type?"plain":null!==(t=i?.type)&&void 0!==t?t:"buy",u="default"===i?.type?"plain":null!==(o=i?.type)&&void 0!==o?o:"plain",d=s.includes("payment_request");return{paymentMethods:{applePay:d?"always":"never",googlePay:d?"always":"never",amazonPay:s.includes("amazon_pay")?"auto":"never",link:"never",paypal:"never",klarna:"never"},layout:{overflow:"never"},buttonTheme:{googlePay:c("googlePay",null!==(r=i?.theme)&&void 0!==r?r:"black"),applePay:c("applePay",null!==(n=i?.theme)&&void 0!==n?n:"black")},buttonType:{googlePay:l,applePay:u},buttonHeight:Math.min(Math.max(parseInt(null!==(a=i?.height)&&void 0!==a?a:"48",10),40),55)}})());se.renderButton(g),g.on("loaderror",(()=>{document.getElementById("wcpay-woopay-button")||se.getButtonSeparator().hide()})),g.on("click",(function(e){if(u="",le("login_confirmation"))return void(e=>{const t=le("login_confirmation");if(!t)return;let o=t.message;o=o.replace(/\*\*.*?\*\*/,{apple_pay:"Apple Pay",google_pay:"Google Pay",amazon_pay:"Amazon Pay",paypal:"PayPal",link:"Link"}[e]),o=o.replace(/\*\*/g,""),confirm(o)&&(window.location.href=t.redirect_url)})(e.expressPaymentType);if("product"===le("button_context")){const e=jQuery(qe());if(e.is(".disabled"))return void(e.is(".wc-variation-is-unavailable")?window.alert(window?.wc_add_to_cart_variation_params?.i18n_unavailable_text||(0,t.__)("Sorry, this product is unavailable. Please choose a different combination.","woocommerce-payments")):window.alert((0,t.__)("Please select your product options before proceeding.","woocommerce-payments")));Ne().useSeparateCart(),d=Ne().addProductToCart(),d.catch((()=>{u=(0,t.__)("There was an error processing the product with this payment method. Please add the product to the cart, instead.","woocommerce-payments"),Ne().emptyCart(),g.unmount(),Ve=null,s.abortPayment(u),se.hideContainer(),se.getButtonSeparator().hide()})).finally((()=>{d=Promise.resolve()}))}const o=Qe?{shippingAddressRequired:"pay_for_order"!==le("button_context")&&Qe.needs_shipping,shippingRates:he(Qe),phoneNumberRequired:null!==(r=le("checkout")?.needs_payer_phone)&&void 0!==r&&r,lineItems:pe(Qe)}:"product"===le("button_context")&&le("product")?{shippingAddressRequired:null!==(n=le("product")?.needs_shipping)&&void 0!==n&&n,phoneNumberRequired:null!==(a=le("checkout")?.needs_payer_phone)&&void 0!==a&&a,lineItems:(null!==(i=le("product")?.displayItems)&&void 0!==i?i:[]).map((({label:e,amount:t})=>({name:e,amount:t})))}:void 0;var r,n,a,i;const c=o.shippingRates&&0!==o.shippingRates.length?o.shippingRates:[{id:"pending",displayName:(0,t.__)("Pending","woocommerce-payments"),amount:0}];(async function({expressPaymentType:e}){ze(),((e,t)=>{const o={google_pay:"gpay_button_click",apple_pay:"applepay_button_click"}[e];o&&Ce(o,{source:t})})(e,le("button_context"))})(e),e.resolve({business:{name:le("store_name")},emailRequired:!0,...o,shippingRates:o.shippingAddressRequired?c:void 0,allowedShippingCountries:le("checkout").allowed_shipping_countries})})),g.on("shippingaddresschange",(async e=>(await d,u?e.resolve():(async(e,t)=>{Be=e.address;try{const r=await $e.updateCustomer({shipping_address:Fe(e.name,e.address)}),n=he(r);if(0===n.length)return void e.reject();t.update({amount:(0,o.applyFilters)("wcpay.express-checkout.total-amount",de(parseInt(r.totals.total_price,10)-parseInt(r.totals.total_refund||0,10),r.totals),r)}),He=r,e.resolve({shippingRates:n,lineItems:pe(r)})}catch(t){e.reject()}})(e,Ve)))),g.on("shippingratechange",(async e=>(async(e,t,r=null)=>{const n=He||r;try{const r=await $e.selectShippingRate({package_id:(0,o.applyFilters)("wcpay.express-checkout.shipping-package-id",0,n,e.shippingRate.id),rate_id:e.shippingRate.id});He=r,t.update({amount:(0,o.applyFilters)("wcpay.express-checkout.total-amount",de(parseInt(r.totals.total_price,10)-parseInt(r.totals.total_refund||0,10),r.totals),r)}),e.resolve({lineItems:pe(r)})}catch(t){e.reject()}})(e,Ve,Qe))),g.on("confirm",(async e=>{if(!u)return(async(e,r,n,a,i,s,c=[])=>{const{error:l}=await n.submit();if(l)return i(l.message);const u=null===(d=le("flags")?.isEceUsingConfirmationTokens)||void 0===d||d;var d;let p;try{p=await async function(e,t,o){if(o){const{confirmationToken:o,error:r}=await e.createConfirmationToken({elements:t});if(r)throw r;return o.id}const{paymentMethod:r,error:n}=await e.createPaymentMethod({elements:t});if(n)throw n;return r.id}(r,n,u)}catch(e){return i(e.message)}try{const t=await $e.placeOrder({...je(s,p,u,c),extensions:(0,o.applyFilters)("wcpay.express-checkout.cart-place-order-extension-data",{})});var h,m;if("success"!==t.payment_result.payment_status)return i(ve(null!==(h=null!==(m=t.message)&&void 0!==m?m:t.payment_result?.payment_details.find((e=>"errorMessage"===e.key))?.value)&&void 0!==h?h:""));let r=t.payment_result.redirect_url;if(!r){const e=t.payment_result.payment_details?.find((e=>"redirect"===e.key));r=e?.value||""}const n=e.confirmIntent(r);a(!0===n?r:await n)}catch(e){return e.json&&(e=await Promise.resolve(e.json())),i(ve(e.message||e.payment_result?.payment_details.find((e=>"errorMessage"===e.key))?.value||(0,t.__)("There was a problem processing the order.","woocommerce-payments")))}})(a,p,Ve,s.completePayment,s.abortPayment,e,b);s.abortPayment(u)})),g.on("cancel",(()=>{"product"===le("button_context")&&d.finally((()=>{Ne().emptyCart()})),Be&&(e=>{const t=le("button_context"),o=le("has_block");var r;["cart","checkout"].includes(t)&&(o?wc?.blocksCheckout?.extensionCartUpdate({namespace:"woopayments/express-checkout/refresh-ui",data:{}}):(r=e.country,["CA","GB"].includes(r)||(e=>{const t=le("button_context"),o=(r=e,{first_name:null!==(n=r?.recipient?.split(" ")?.slice(0,1)?.join(" "))&&void 0!==n?n:"",last_name:null!==(a=r?.recipient?.split(" ")?.slice(1)?.join(" "))&&void 0!==a?a:"",company:"",address_1:null!==(i=r?.addressLine?.[0])&&void 0!==i?i:"",address_2:null!==(s=r?.addressLine?.[1])&&void 0!==s?s:"",city:null!==(c=r?.city)&&void 0!==c?c:"",state:null!==(l=r?.state)&&void 0!==l?l:"",country:null!==(u=r?.country)&&void 0!==u?u:"",postcode:null!==(d=r?.postal_code)&&void 0!==d?d:""});var r,n,a,i,s,c,l,u,d;const p=["country","state","city","postcode"];"cart"===t?(p.forEach((e=>{o[e]&&Se("form.woocommerce-shipping-calculator",`calc_shipping_${e}`,o[e])})),document.querySelector('form.woocommerce-shipping-calculator [name="calc_shipping"]')?.click()):"checkout"===t&&p.forEach((e=>{o[e]&&Se("form.woocommerce-checkout",`billing_${e}`,o[e])}))})(e)))})(Be),Be=null,Oe()})),g.on("ready",(e=>{(async function({availablePaymentMethods:e}){e&&(({paymentMethods:e,source:t})=>{const o={googlePay:Ie,applePay:Te};for(const r of e){const e=o[r];e&&e({source:t})}})({paymentMethods:Object.entries(e).filter((([e,t])=>t)).map((([e,t])=>e)),source:le("button_context")})})(e),e?.availablePaymentMethods&&Object.values(e.availablePaymentMethods).filter(Boolean).length&&(se.showContainer(),se.getButtonSeparator().show())}))},init:async()=>{if((0,o.removeAction)("wcpay.express-checkout.update-button-data","automattic/wcpay/express-checkout"),"product"===le("button_context")&&"bundle"===le("product")?.product_type&&(wcpayExpressCheckoutParams.product=void 0),!le("product")&&!Qe)try{Qe=await Ue()}catch(e){}Qe&&(wcpayExpressCheckoutParams.product=void 0);const t=De();(0,o.applyFilters)("wcpay.express-checkout.is-cart-eligible",t>0,Qe)?Qe?await s.startExpressCheckoutElement({total:t,currency:Qe.totals.currency_code.toLowerCase()}):"product"===le("button_context")&&le("product")?await s.startExpressCheckoutElement({total:t,currency:le("product")?.currency}):(se.hideContainer(),se.getButtonSeparator().hide()):(se.hideContainer(),se.getButtonSeparator().hide()),(0,o.addAction)("wcpay.express-checkout.update-button-data","automattic/wcpay/express-checkout",(async()=>{if("product"===le("button_context")&&jQuery(qe()).is(".disabled"))se.unblockButton();else{e(".woocommerce-error").remove();try{se.blockButton();const e=De();Qe=await Ue(),wcpayExpressCheckoutParams.product=null,se.unblockButton();const t=De();Ve?t!==e&&t>0&&Ve.update({amount:t}):s.init(),(0,o.applyFilters)("wcpay.express-checkout.is-cart-eligible",t>0,Qe)?(se.showContainer(),se.getButtonSeparator().show()):(se.hideContainer(),se.getButtonSeparator().hide())}catch(e){se.hideContainer()}}}))}};"checkout"===le("button_context")&&"pay_for_order"!==le("button_context")||s.init(),e(document.body).on("updated_cart_totals",(()=>{Qe=null,s.init()})),e(document.body).on("updated_checkout",(()=>{Qe=null,s.init()}))}))})()})();