Viewing File: /home/rtsgrob/ww6/wp-content/plugins/woocommerce-payments/dist/cart-block.js

/*! For license information please see cart-block.js.LICENSE.txt */
(()=>{var e={2694(e,t,r){"use strict";var o=r(6925);function n(){}function a(){}a.resetWarningCache=n,e.exports=function(){function e(e,t,r,n,a,i){if(i!==o){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:n};return r.PropTypes=r,r}},5556(e,t,r){e.exports=r(2694)()},6925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},1020(e,t,r){"use strict";var o=r(1609),n=Symbol.for("react.element"),a=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,r){var o,s={},l=null,u=null;for(o in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)a.call(t,o)&&!c.hasOwnProperty(o)&&(s[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===s[o]&&(s[o]=t[o]);return{$$typeof:n,type:e,key:l,ref:u,props:s,_owner:i.current}}},4848(e,t,r){"use strict";e.exports=r(1020)},1609(e){"use strict";e.exports=window.React}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var n=o.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=o[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.p=window.wcpayAssets.url,(()=>{"use strict";const e=window.wp.plugins;var t=r(1609),o=r(5556);function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){c(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e){return i="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},i(e)}function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=r){var o,n,a=[],i=!0,c=!1;try{for(r=r.call(e);!(i=(o=r.next()).done)&&(a.push(o.value),!t||a.length!==t);i=!0);}catch(e){c=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(c)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var u=function(e,r,o){var n=!!o,a=t.useRef(o);t.useEffect(function(){a.current=o},[o]),t.useEffect(function(){if(!n||!e)return function(){};var t=function(){a.current&&a.current.apply(a,arguments)};return e.on(r,t),function(){e.off(r,t)}},[n,r,e,a])},p=function(e){var r=t.useRef(e);return t.useEffect(function(){r.current=e},[e]),r.current},h=function(e){return null!==e&&"object"===i(e)},d="[object Object]",f=function e(t,r){if(!h(t)||!h(r))return t===r;var o=Array.isArray(t);if(o!==Array.isArray(r))return!1;var n=Object.prototype.toString.call(t)===d;if(n!==(Object.prototype.toString.call(r)===d))return!1;if(!n&&!o)return t===r;var a=Object.keys(t),i=Object.keys(r);if(a.length!==i.length)return!1;for(var c={},s=0;s<a.length;s+=1)c[a[s]]=!0;for(var l=0;l<i.length;l+=1)c[i[l]]=!0;var u=Object.keys(c);if(u.length!==a.length)return!1;var p=t,f=r;return u.every(function(t){return e(p[t],f[t])})},m=function(e,t,r){return h(e)?Object.keys(e).reduce(function(o,n){var i=!h(t)||!f(e[n],t[n]);return r.includes(n)?(i&&console.warn("Unsupported prop change: options.".concat(n," is not a mutable property.")),o):i?a(a({},o||{}),{},c({},n,e[n])):o},null):null},b="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",g=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b;if(null===e||h(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;throw new Error(r)},y=t.createContext(null);y.displayName="ElementsContext";var w=function(e){var r=e.stripe,o=e.options,n=e.children,a=t.useMemo(function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b;if(function(e){return h(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return g(e,t)})};var r=g(e,t);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}}(r)},[r]),i=s(t.useState(function(){return{stripe:"sync"===a.tag?a.stripe:null,elements:"sync"===a.tag?a.stripe.elements(o):null}}),2),c=i[0],l=i[1];t.useEffect(function(){var e=!0,t=function(e){l(function(t){return t.stripe?t:{stripe:e,elements:e.elements(o)}})};return"async"!==a.tag||c.stripe?"sync"!==a.tag||c.stripe||t(a.stripe):a.stripePromise.then(function(r){r&&e&&t(r)}),function(){e=!1}},[a,c,o]);var u=p(r);t.useEffect(function(){null!==u&&u!==r&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[u,r]);var d=p(o);return t.useEffect(function(){if(c.elements){var e=m(o,d,["clientSecret","fonts"]);e&&c.elements.update(e)}},[o,d,c.elements]),t.useEffect(function(){var e;(e=c.stripe)&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"6.3.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.3.0",url:"https://stripe.com/docs/stripe-js/react"}))},[c.stripe]),t.createElement(y.Provider,{value:c},n)};w.propTypes={stripe:o.any,options:o.object},o.func.isRequired;var _=t.createContext(null);_.displayName="CheckoutContext";var k=function(e){var r=t.useContext(_),o=t.useContext(y);if(r){if(o)throw new Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."));return r}return function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e}(o,e)},S=["mode"],v=function(e,r,n){var a,i="".concat((a=e).charAt(0).toUpperCase()+a.slice(1),"Element"),c=r?function(e){k("mounts <".concat(i,">"));var r=e.id,o=e.className;return t.createElement("div",{id:r,className:o})}:function(r){var o,n=r.id,a=r.className,c=r.options,l=void 0===c?{}:c,h=r.onBlur,d=r.onFocus,f=r.onReady,b=r.onChange,g=r.onEscape,y=r.onClick,w=r.onLoadError,_=r.onLoaderStart,v=r.onNetworksChange,x=r.onConfirm,C=r.onCancel,T=r.onShippingAddressChange,A=r.onShippingRateChange,M=r.onSavedPaymentMethodRemove,I=r.onSavedPaymentMethodUpdate,E=k("mounts <".concat(i,">")),R="elements"in E?E.elements:null,L="checkoutState"in E?E.checkoutState:null,P="success"===(null==L?void 0:L.type)||"loading"===(null==L?void 0:L.type)?L.sdk:null,O=s(t.useState(null),2),j=O[0],q=O[1],F=t.useRef(null),N=t.useRef(null);u(j,"blur",h),u(j,"focus",d),u(j,"escape",g),u(j,"click",y),u(j,"loaderror",w),u(j,"loaderstart",_),u(j,"networkschange",v),u(j,"confirm",x),u(j,"cancel",C),u(j,"shippingaddresschange",T),u(j,"shippingratechange",A),u(j,"savedpaymentmethodremove",M),u(j,"savedpaymentmethodupdate",I),u(j,"change",b),f&&(o="expressCheckout"===e?f:function(){f(j)}),u(j,"ready",o),t.useLayoutEffect(function(){if(null===F.current&&null!==N.current&&(R||P)){var t=null;if(P){var r=P,o=P;switch(e){case"paymentForm":t=o.createForm(l);break;case"payment":t=r.createPaymentElement(l);break;case"address":if(!("mode"in l))throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");var n=l.mode,a=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(l,S);if("shipping"===n)t=r.createShippingAddressElement(a);else{if("billing"!==n)throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");t=r.createBillingAddressElement(a)}break;case"expressCheckout":t=r.createExpressCheckoutElement(l);break;case"currencySelector":t=P.createCurrencySelectorElement();break;case"taxId":t=r.createTaxIdElement(l);break;case"contactDetails":t=r.createContactDetailsElement();break;default:throw new Error("<".concat(i,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else R&&(t=R.create(e,l));F.current=t,q(t),t&&t.mount(N.current)}},[R,P,l]);var H=p(l);return t.useEffect(function(){if(F.current){var e=m(l,H,["paymentRequest"]);e&&"update"in F.current&&F.current.update(e)}},[l,H]),t.useLayoutEffect(function(){return function(){if(F.current&&"function"==typeof F.current.destroy)try{F.current.destroy(),F.current=null}catch(e){}}},[]),t.createElement("div",{id:n,className:a,ref:N})};return c.propTypes={id:o.string,className:o.string,onChange:o.func,onBlur:o.func,onFocus:o.func,onReady:o.func,onEscape:o.func,onClick:o.func,onLoadError:o.func,onLoaderStart:o.func,onNetworksChange:o.func,onConfirm:o.func,onCancel:o.func,onShippingAddressChange:o.func,onShippingRateChange:o.func,onSavedPaymentMethodRemove:o.func,onSavedPaymentMethodUpdate:o.func,options:o.object},c.displayName=i,c.__elementType=e,c},x="undefined"==typeof window;t.createContext(null).displayName="EmbeddedCheckoutProviderContext",v("auBankAccount",x),v("card",x),v("cardNumber",x),v("cardExpiry",x),v("cardCvc",x),v("iban",x),v("payment",x),v("expressCheckout",x),v("paymentRequestButton",x),v("linkAuthentication",x),v("contactDetails",x),v("address",x),v("shippingAddress",x);var C=v("paymentMethodMessaging",x);v("taxId",x),v("issuingCardNumberDisplay",x),v("issuingCardCvcDisplay",x),v("issuingCardExpiryDisplay",x),v("issuingCardPinDisplay",x),v("issuingCardCopyButton",x);const T=window.wp.data,A=window.wc.blocksCheckout;function M(e){return M="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},M(e)}var I=/^\s+/,E=/\s+$/;function R(e,t){if(t=t||{},(e=e||"")instanceof R)return e;if(!(this instanceof R))return new R(e,t);var r=function(e){var t,r,o,n={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(I,"").replace(E,"").toLowerCase();var t,r=!1;if(J[e])e=J[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=ce.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=ce.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ce.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=ce.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ce.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=ce.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ce.hex8.exec(e))?{r:Q(t[1]),g:Q(t[2]),b:Q(t[3]),a:oe(t[4]),format:r?"name":"hex8"}:(t=ce.hex6.exec(e))?{r:Q(t[1]),g:Q(t[2]),b:Q(t[3]),format:r?"name":"hex"}:(t=ce.hex4.exec(e))?{r:Q(t[1]+""+t[1]),g:Q(t[2]+""+t[2]),b:Q(t[3]+""+t[3]),a:oe(t[4]+""+t[4]),format:r?"name":"hex8"}:!!(t=ce.hex3.exec(e))&&{r:Q(t[1]+""+t[1]),g:Q(t[2]+""+t[2]),b:Q(t[3]+""+t[3]),format:r?"name":"hex"}}(e)),"object"==M(e)&&(se(e.r)&&se(e.g)&&se(e.b)?(t=e.r,r=e.g,o=e.b,n={r:255*X(t,255),g:255*X(r,255),b:255*X(o,255)},l=!0,u="%"===String(e.r).substr(-1)?"prgb":"rgb"):se(e.h)&&se(e.s)&&se(e.v)?(i=te(e.s),c=te(e.v),n=function(e,t,r){e=6*X(e,360),t=X(t,100),r=X(r,100);var o=Math.floor(e),n=e-o,a=r*(1-t),i=r*(1-n*t),c=r*(1-(1-n)*t),s=o%6;return{r:255*[r,i,a,a,c,r][s],g:255*[c,r,r,i,a,a][s],b:255*[a,a,c,r,r,i][s]}}(e.h,i,c),l=!0,u="hsv"):se(e.h)&&se(e.s)&&se(e.l)&&(i=te(e.s),s=te(e.l),n=function(e,t,r){var o,n,a;function i(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=X(e,360),t=X(t,100),r=X(r,100),0===t)o=n=a=r;else{var c=r<.5?r*(1+t):r+t-r*t,s=2*r-c;o=i(s,c,e+1/3),n=i(s,c,e),a=i(s,c,e-1/3)}return{r:255*o,g:255*n,b:255*a}}(e.h,i,s),l=!0,u="hsl"),e.hasOwnProperty("a")&&(a=e.a)),a=G(a),{ok:l,format:e.format||u,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=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.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=r.ok}function L(e,t,r){e=X(e,255),t=X(t,255),r=X(r,255);var o,n,a=Math.max(e,t,r),i=Math.min(e,t,r),c=(a+i)/2;if(a==i)o=n=0;else{var s=a-i;switch(n=c>.5?s/(2-a-i):s/(a+i),a){case e:o=(t-r)/s+(t<r?6:0);break;case t:o=(r-e)/s+2;break;case r:o=(e-t)/s+4}o/=6}return{h:o,s:n,l:c}}function P(e,t,r){e=X(e,255),t=X(t,255),r=X(r,255);var o,n,a=Math.max(e,t,r),i=Math.min(e,t,r),c=a,s=a-i;if(n=0===a?0:s/a,a==i)o=0;else{switch(a){case e:o=(t-r)/s+(t<r?6:0);break;case t:o=(r-e)/s+2;break;case r:o=(e-t)/s+4}o/=6}return{h:o,s:n,v:c}}function O(e,t,r,o){var n=[ee(Math.round(e).toString(16)),ee(Math.round(t).toString(16)),ee(Math.round(r).toString(16))];return o&&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 j(e,t,r,o){return[ee(re(o)),ee(Math.round(e).toString(16)),ee(Math.round(t).toString(16)),ee(Math.round(r).toString(16))].join("")}function q(e,t){t=0===t?0:t||10;var r=R(e).toHsl();return r.s-=t/100,r.s=Z(r.s),R(r)}function F(e,t){t=0===t?0:t||10;var r=R(e).toHsl();return r.s+=t/100,r.s=Z(r.s),R(r)}function N(e){return R(e).desaturate(100)}function H(e,t){t=0===t?0:t||10;var r=R(e).toHsl();return r.l+=t/100,r.l=Z(r.l),R(r)}function B(e,t){t=0===t?0:t||10;var r=R(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(-t/100*255))),r.g=Math.max(0,Math.min(255,r.g-Math.round(-t/100*255))),r.b=Math.max(0,Math.min(255,r.b-Math.round(-t/100*255))),R(r)}function W(e,t){t=0===t?0:t||10;var r=R(e).toHsl();return r.l-=t/100,r.l=Z(r.l),R(r)}function D(e,t){var r=R(e).toHsl(),o=(r.h+t)%360;return r.h=o<0?360+o:o,R(r)}function z(e){var t=R(e).toHsl();return t.h=(t.h+180)%360,R(t)}function U(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=R(e).toHsl(),o=[R(e)],n=360/t,a=1;a<t;a++)o.push(R({h:(r.h+a*n)%360,s:r.s,l:r.l}));return o}function $(e){var t=R(e).toHsl(),r=t.h;return[R(e),R({h:(r+72)%360,s:t.s,l:t.l}),R({h:(r+216)%360,s:t.s,l:t.l})]}function V(e,t,r){t=t||6,r=r||30;var o=R(e).toHsl(),n=360/r,a=[R(e)];for(o.h=(o.h-(n*t>>1)+720)%360;--t;)o.h=(o.h+n)%360,a.push(R(o));return a}function Y(e,t){t=t||6;for(var r=R(e).toHsv(),o=r.h,n=r.s,a=r.v,i=[],c=1/t;t--;)i.push(R({h:o,s:n,v:a})),a=(a+c)%1;return i}R.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,r,o=this.toRgb();return e=o.r/255,t=o.g/255,r=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*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=G(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),r=Math.round(100*e.s),o=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+o+"%)":"hsva("+t+", "+r+"%, "+o+"%, "+this._roundA+")"},toHsl:function(){var e=L(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=L(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),o=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+o+"%)":"hsla("+t+", "+r+"%, "+o+"%, "+this._roundA+")"},toHex:function(e){return O(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,o,n){var a=[ee(Math.round(e).toString(16)),ee(Math.round(t).toString(16)),ee(Math.round(r).toString(16)),ee(re(o))];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*X(this._r,255))+"%",g:Math.round(100*X(this._g,255))+"%",b:Math.round(100*X(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*X(this._r,255))+"%, "+Math.round(100*X(this._g,255))+"%, "+Math.round(100*X(this._b,255))+"%)":"rgba("+Math.round(100*X(this._r,255))+"%, "+Math.round(100*X(this._g,255))+"%, "+Math.round(100*X(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(K[O(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+j(this._r,this._g,this._b,this._a),r=t,o=this._gradientType?"GradientType = 1, ":"";if(e){var n=R(e);r="#"+j(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+o+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!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&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return R(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(H,arguments)},brighten:function(){return this._applyModification(B,arguments)},darken:function(){return this._applyModification(W,arguments)},desaturate:function(){return this._applyModification(q,arguments)},saturate:function(){return this._applyModification(F,arguments)},greyscale:function(){return this._applyModification(N,arguments)},spin:function(){return this._applyModification(D,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(z,arguments)},monochromatic:function(){return this._applyCombination(Y,arguments)},splitcomplement:function(){return this._applyCombination($,arguments)},triad:function(){return this._applyCombination(U,[3])},tetrad:function(){return this._applyCombination(U,[4])}},R.fromRatio=function(e,t){if("object"==M(e)){var r={};for(var o in e)e.hasOwnProperty(o)&&(r[o]="a"===o?e[o]:te(e[o]));e=r}return R(e,t)},R.equals=function(e,t){return!(!e||!t)&&R(e).toRgbString()==R(t).toRgbString()},R.random=function(){return R.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},R.mix=function(e,t,r){r=0===r?0:r||50;var o=R(e).toRgb(),n=R(t).toRgb(),a=r/100;return R({r:(n.r-o.r)*a+o.r,g:(n.g-o.g)*a+o.g,b:(n.b-o.b)*a+o.b,a:(n.a-o.a)*a+o.a})},R.readability=function(e,t){var r=R(e),o=R(t);return(Math.max(r.getLuminance(),o.getLuminance())+.05)/(Math.min(r.getLuminance(),o.getLuminance())+.05)},R.isReadable=function(e,t,r){var o,n,a,i,c,s=R.readability(e,t);switch(n=!1,(a=r,"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":n=s>=4.5;break;case"AAlarge":n=s>=3;break;case"AAAsmall":n=s>=7}return n},R.mostReadable=function(e,t,r){var o,n,a,i,c=null,s=0;n=(r=r||{}).includeFallbackColors,a=r.level,i=r.size;for(var l=0;l<t.length;l++)(o=R.readability(e,t[l]))>s&&(s=o,c=R(t[l]));return R.isReadable(e,c,{level:a,size:i})||!n?c:(r.includeFallbackColors=!1,R.mostReadable(e,["#fff","#000"],r))};var J=R.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"},K=R.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(J);function G(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function X(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Z(e){return Math.min(1,Math.max(0,e))}function Q(e){return parseInt(e,16)}function ee(e){return 1==e.length?"0"+e:""+e}function te(e){return e<=1&&(e=100*e+"%"),e}function re(e){return Math.round(255*parseFloat(e)).toString(16)}function oe(e){return Q(e)/255}var ne,ae,ie,ce=(ae="[\\s|\\(]+("+(ne="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+ne+")[,|\\s]+("+ne+")\\s*\\)?",ie="[\\s|\\(]+("+ne+")[,|\\s]+("+ne+")[,|\\s]+("+ne+")[,|\\s]+("+ne+")\\s*\\)?",{CSS_UNIT:new RegExp(ne),rgb:new RegExp("rgb"+ae),rgba:new RegExp("rgba"+ie),hsl:new RegExp("hsl"+ae),hsla:new RegExp("hsla"+ie),hsv:new RegExp("hsv"+ae),hsva:new RegExp("hsva"+ie),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 se(e){return!!ce.CSS_UNIT.exec(e)}const le=["color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"],ue=["fontFamily","fontSize","lineHeight","letterSpacing","fontWeight","fontVariation","textDecoration","textShadow","textTransform","-webkit-font-smoothing","-moz-osx-font-smoothing","transition"],pe=["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"],he={".Label":[...le,...ue],".Text":[...le,...ue],".Input":[...le,...ue,...pe],".Error":[...le,...ue,...pe],".Tab":[...le,...ue,...pe],".TabIcon":[...le],".TabLabel":[...le,...ue],".Block":[...le.slice(1),...pe.slice(1)],".Container":[...pe],".Header":[...le,...pe,...ue],".Footer":[...le,...pe,...ue]},de={".Label":he[".Label"],".Label--floating":[...he[".Label"],"transform"],".Input":[...he[".Input"],"outlineColor","outlineWidth","outlineStyle"],".Error":he[".Error"],".Tab":["backgroundColor","color","fontFamily"],".Tab--selected":["outlineColor","outlineWidth","outlineStyle","backgroundColor","color",...pe],".TabIcon":he[".TabIcon"],".TabIcon--selected":["color"],".TabLabel":he[".TabLabel"],".Block":he[".Block"],".Container":he[".Container"],".Header":he[".Header"],".Footer":he[".Footer"],".Footer--link":he[".Text"],".Text":he[".Text"],".Text--redirect":he[".Text"]},fe=(e,t=document)=>{let r=null,o=0;for(;!r&&o<e.length;){let n;try{n=t.querySelector(e[o])}catch(e){o++;continue}if(!n){o++;continue}const a=(t.defaultView||window).getComputedStyle(n).backgroundColor;a&&R(a).getAlpha()>=.5&&(r=a),o++}return r||"#ffffff"},me=e=>{const t=R(e),r=t.getAlpha();if(r<1){const e=t.toRgb();return R({r:Math.round(e.r*r+255*(1-r)),g:Math.round(e.g*r+255*(1-r)),b:Math.round(e.b*r+255*(1-r))}).getBrightness()>125}return t.getBrightness()>125},be={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(r=>{const[o,n]=r,a=e[o];if(Array.isArray(a))a.some(e=>{try{return t.querySelector(e)}catch(e){return!1}})||(e[o]=n);else try{t.querySelector(e[o])||(e[o]=n)}catch(t){e[o]=n}}),delete e.alternateSelectors),e},getSelectors:function(e,t){let r=this.blocksCheckout;switch(e){case"blocks_checkout":r=this.blocksCheckout;break;case"shortcode_checkout":r=this.classicCheckout;break;case"bnpl_product_page":r=this.bnplProductPage;break;case"bnpl_classic_cart":r=this.bnplClassicCart;break;case"bnpl_cart_block":r=this.bnplCartBlock;break;case"woopay_shortcode_checkout":r=this.wooPayClassicCheckout;break;case"woopay_blocks_checkout":r=this.wooPayBlocksCheckout}return{...this.default,...this.updateSelectors(r,t)}}},ge={getHiddenContainer:function(e,t){const r=t.createElement("div");return r.setAttribute("id",this.getIDFromSelector(e)),r.style.border=0,r.style.clip="rect(0 0 0 0)",r.style.height="1px",r.style.margin="-1px",r.style.overflow="hidden",r.style.padding="0",r.style.position="absolute",r.style.width="1px",r},createRow:function(e,t=[],r){const o=r.createElement(e);return t.length&&o.classList.add(...t),o},appendClone:function(e,t,r,o){const n=o.querySelector(t);if(n){const t=n.cloneNode(!0);t.id=this.getIDFromSelector(r),t.value="",e.appendChild(t)}},getIDFromSelector:function(e){return e.startsWith("#")||e.startsWith(".")?e.slice(1):e},init:function(e,t){const r=be.getSelectors(e),o=t.querySelector(r.appendTarget),n=t.querySelector(r.upeThemeInputSelector);if(!o||!n)return;t.querySelector(r.hiddenContainer)&&this.cleanup(t);const a=this.getHiddenContainer(r.hiddenContainer,t);o.appendChild(a);const i=this.createRow(r.rowElement,r.validClasses,t);a.appendChild(i);const c=this.createRow(r.rowElement,r.invalidClasses,t);a.appendChild(c),this.appendClone(i,r.upeThemeInputSelector,r.hiddenInput,t),this.appendClone(i,r.upeThemeLabelSelector,r.hiddenValidActiveLabel,t),this.appendClone(c,r.upeThemeInputSelector,r.hiddenInvalidInput,t),this.appendClone(c,r.upeThemeLabelSelector,r.hiddenInvalidInput,t),t.querySelector(r.hiddenInput).style.transition="none"},cleanup:function(e){const t=e.querySelector(be.default.hiddenContainer);t&&t.remove()}},ye=(e,t,r=null,o)=>{const n=(Array.isArray(e)?e:[e]).map(e=>{try{return o.querySelector(e)}catch(e){return null}}).filter(Boolean);if(!n.length)return{};const a=o.defaultView||window,i=de[t],c=n[0],s=a.getComputedStyle(c),l={};if(i.forEach(e=>{const t=e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),r=s.getPropertyValue(t);if(r)if("color"!==e)if("lineHeight"!==e||"0"!==r&&"0px"!==r)l[e]=r;else for(let t=1;t<n.length;t++){const r=a.getComputedStyle(n[t]).getPropertyValue("line-height");if("0"!==r&&"0px"!==r){l[e]=r;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 r=t[4]||1;e=`rgb(${t.slice(1,4).map(e=>Math.round(e*r+255*(1-r))).join(", ")})`}return e})(r)}),".Input"===t||".Tab--selected"===t){const e=((e,t="solid",r)=>e&&r?[e,t,r].join(" "):"")(l.outlineWidth,l.outlineStyle,l.outlineColor);""!==e&&(l.outline=e),delete l.outlineWidth,delete l.outlineColor,delete l.outlineStyle}const u=s.getPropertyValue("text-indent");return"0px"!==u&&"0px"===l.paddingLeft&&"0px"===l.paddingRight&&(l.paddingLeft=u,l.paddingRight=u),".Block"===t&&(l.backgroundColor=r),l},we=(e=document)=>{const t=[],r=e.styleSheets,o=["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","fonts.bunny.net","fonts.wp.com"];for(let e=0;e<r.length;e++){if(!r[e].href)continue;const n=new URL(r[e].href);-1!==o.indexOf(n.hostname)&&t.push({cssSrc:r[e].href})}return t},_e={blocks_checkout:"woopay_blocks_checkout",shortcode_checkout:"woopay_shortcode_checkout"},ke=(e,t=!1,r=document)=>{const o=t?_e[e]??e:e,n=be.getSelectors(o,r);ge.init(o,r);const a=ye(n.hiddenInput,".Input",null,r),i=ye(n.hiddenInvalidInput,".Input",null,r),c=ye(n.upeThemeLabelSelector,".Label",null,r),s={fontSize:c.fontSize},l=ye(n.upeThemeTextSelectors,".Text",null,r),u=ye(n.upeThemeInputSelector,".Tab",null,r),p=ye(n.hiddenInput,".Tab--selected",null,r),h=(e=>{const t=Object.assign({},e);if(!e.backgroundColor||!e.color)return e;const r=((e,t)=>{const r={backgroundColor:e,color:t},o=R(e),n=R(t);if(!o.isValid()||!n.isValid())return{backgroundColor:"",color:""};const a=o.getBrightness()>50?R(o).darken(7):R(o).lighten(7),i=R.mostReadable(a,[n],{includeFallbackColors:!0});return r.backgroundColor=a.toRgbString(),r.color=i.toRgbString(),r})(e.backgroundColor,e.color);return t.backgroundColor=r.backgroundColor,t.color=r.color,t})(u),d={color:h.color},f={color:p.color},m=fe(n.backgroundSelectors,r),b=ye(n.upeThemeLabelSelector,".Block",m,r),g={colorBackground:m,colorText:l.color,fontFamily:l.fontFamily,fontSizeBase:l.fontSize};n.pmmeRelativeTextSizeSelector&&g.fontSizeBase&&(g.fontSizeBase=function(e,t,r=.875,o){const n=parseFloat(t);if(isNaN(n))return t;const a=o.querySelector(e);if(!a)return n*r+"px";const i=window.getComputedStyle(a).getPropertyValue("font-size"),c=parseFloat(i)*r;return isNaN(c)?t:n>c?`${c}px`:`${n}px`}(n.pmmeRelativeTextSizeSelector,l.fontSize,.875,r));const y="blocks_checkout"===e||"woopay_blocks_checkout"===o;let w={variables:g,theme:me(m)?"stripe":"night",labels:y?"floating":"above",rules:JSON.parse(JSON.stringify({".Input":a,".Input--invalid":i,".Label":c,".Label--resting":s,".Block":b,".Tab":u,".Tab:hover":h,".Tab--selected":p,".TabIcon:hover":d,".TabIcon--selected":f,".Text":l,".Text--redirect":l}))};if(y&&(w=((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 r=t[1].split(", "),o=(parseFloat(r[0])+parseFloat(r[3]))/2,n=parseFloat(e.rules[".Label--floating"].lineHeight),a=Math.floor(n*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){const t=parseFloat(e.rules[".Input"].paddingBottom);e.rules[".Input"].paddingBottom=t-1+"px";const r=e.rules[".Label"].marginTop??"0";e.rules[".Label"].marginTop=`${Math.floor((t-1)/3)}px`,e.rules[".Label--floating"].marginTop=r}return e})(w,ye(n.hiddenValidActiveLabel,".Label--floating",null,r))),t){const e=ye(n.headerSelectors,".Header",null,r),t=ye(n.footerSelectors,".Footer",null,r);(!e.backgroundColor||R(e.backgroundColor).getAlpha()<.5)&&(e.backgroundColor=fe([...n.headerSelectors??[],"body"],r)),(!t.backgroundColor||R(t.backgroundColor).getAlpha()<.5)&&(t.backgroundColor=fe([...n.footerSelectors??[],"body"],r)),w.rules={...w.rules,".Heading":ye(n.headingSelectors,".Label",null,r),".Header":e,".Footer":t,".Footer-link":ye(n.footerLink,".Footer--link",null,r),".Button":ye(n.buttonSelectors,".Input",null,r),".Link":ye(n.linkSelectors,".Label",null,r),".Container":ye(n.containerSelectors,".Container",null,r)}}return ge.cleanup(r),w};function Se(e){return"wcpay_appearance_"+e}const ve=e=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[e]?wcpayConfig[e]:xe(e),xe=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},Ce=(e,t,r="wcpay_")=>e.toString().replace("%%endpoint%%",r+t);function Te(e,t="",r){for(const o in e){const n=e[o],a=t?t+"["+o+"]":o;"string"==typeof n||"number"==typeof n?r.append(a,n):"object"==typeof n&&Te(n,a,r)}return r}var Ae=r(4848);const Me=new class{constructor(e,t){this.options=e,this.stripe=null,this.stripePlatform=null,this.request=t,this.isWooPayRequesting=!1}createStripe(e,t,r="",o=[]){const n={locale:t};return r&&(n.stripeAccount=r),o&&(n.betas=o),new Stripe(e,n)}async getStripeForUPE(e){return this.options.forceNetworkSavedCards=xe("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:r,forceNetworkSavedCards:o,locale:n,isStripeLinkEnabled:a}=this.options;if(o&&!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,r,e)}return this.stripe}async loadStripeForExpressCheckout(){try{return this.getStripe(!0)}catch(e){return{error:e}}}confirmIntent(e,t=!1){const r=e.match(/#wcpay-confirm-(pi|si):([^:]+):([^:]+):([^:]+)(?::(.+))?$/);if(!r)return!0;const o="si"===r[1];let n=r[2];const a=r[3],i=r[4],c=r[5]||null,s=e.indexOf("order-pay"),l=s>-1&&e.substring(s).match(/\d+/);return l&&(n=l[0]),(async()=>{const{locale:e,publishableKey:t}=this.options,r=ve("accountIdForIntentConfirmation");if(o){const e=await this.getStripe(!0);return c?e.confirmSetup({clientSecret:a,confirmParams:{confirmation_token:c},redirect:"if_required"}):e.handleNextAction({clientSecret:a})}return r?this.createStripe(t,e,r).confirmCardPayment(a):(await this.getStripe(!0)).handleNextAction({clientSecret:a})})().then(e=>{let r=null;e.paymentIntent?.last_payment_error&&(r={message:e.paymentIntent.last_payment_error.message}),"requires_action"===e.paymentIntent?.status&&(r={message:"Payment requires additional action."});const o=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,a=(c="ajax_url",("object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(c)?wcpayExpressCheckoutParams[c]:null)??ve("ajaxUrl"));var c;const s=ve("isChangingPayment");return[this.request(a,{action:"update_order_status",order_id:n,_ajax_nonce:i,intent_id:o,should_save_payment_method:t?"true":"false",is_changing_payment:s?"true":"false"}),r,e.error]}).then(([e,t,r])=>{if(r)throw r;return e.then(e=>{const r="string"==typeof e?JSON.parse(e):e;if(r.error)throw r.error;if(t)throw t;return r.return_url})})}async setupIntent(e){const t=await this.request(ve("ajaxUrl"),{action:"create_setup_intent","wcpay-payment-method":e,_ajax_nonce:ve("createSetupIntentNonce")});if(!t.success)throw t.data.error;if("succeeded"===t.data.status)return t.data;const r=await this.getStripe(),o=await r.confirmCardSetup(t.data.client_secret),{setupIntent:n,error:a}=o;if(a)throw a;return n}initWooPay(e,t){if(!this.isWooPayRequesting){this.isWooPayRequesting=!0;const r=ve("wcAjaxUrl"),o=ve("initWooPayNonce");let n=null,a=null;if(ve("isWooPayGlobalThemeSupportEnabled"))if(ve("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;n=ke(e,!0),a=we()}else n=ve("woopayAppearance"),a=ve("woopayFontRules");return this.request(Ce(r,"init_woopay"),{_wpnonce:o,appearance:n,font_rules:a,email:e,user_session:t,order_id:ve("order_id"),key:ve("key"),billing_email:ve("billing_email")}).finally(()=>{this.isWooPayRequesting=!1})}}expressCheckoutAddToCart(e){const t=ve("wcAjaxUrl"),r=ve("addToCartNonce");return this.request(Ce(t,"add_to_cart"),{security:r,...e})}}({publishableKey:xe("publishableKey"),accountId:xe("accountId"),forceNetworkSavedCards:xe("forceNetworkSavedCards"),locale:xe("locale")},async function(e,t,r){const o=Te(t,"",new FormData),n=await fetch(e,{method:"POST",body:o,...r});return await n.json()}),Ie=({cart:e,context:r})=>{const[o,n]=(0,t.useState)(()=>function(e,t){try{const r=localStorage.getItem(Se(e));if(!r)return null;const o=JSON.parse(r);if(o?.version===t)return o.appearance}catch{}return null}("bnpl_cart_block",xe("stylesCacheVersion"))),[a]=(0,t.useState)(we());(0,t.useEffect)(()=>{if(!o){const e=ke("bnpl_cart_block");!function(e){document.dispatchEvent(new CustomEvent("wcpay_elements_appearance",{detail:{appearance:e,elementsLocation:"bnpl_cart_block"}}))}(e),function(e,t,r){try{localStorage.setItem(Se("bnpl_cart_block"),JSON.stringify({version:t,appearance:r}))}catch{}}(0,xe("stylesCacheVersion"),e),n(e)}},[o]);const i=function(e,r=!1){const[o,n]=(0,t.useState)(null);return(0,t.useEffect)(()=>{(async()=>{const t=await e.getStripe(r);n(t)})()},[e,r]),o}(Me);if(!i)return null;if(0===Object.keys(o).length)return null;if("woocommerce/cart"!==r)return null;const c=((e,t=2)=>e*Math.pow(10,2-t))(e.cartTotals.total_price,wcSettings.currency.precision);if(!window.wcpayStripeSiteMessaging)return null;const{country:s,paymentMethods:l,currencyCode:u,shouldInitializePMME:p}=window.wcpayStripeSiteMessaging;if(!p)return null;const h={amount:parseInt(c,10)||0,currency:u||"USD",paymentMethodTypes:l||[],countryCode:s};return(0,Ae.jsx)("div",{className:"wc-block-components-bnpl-wrapper",children:(0,Ae.jsx)(w,{stripe:i,options:{appearance:o,fonts:a},children:(0,Ae.jsx)(C,{options:h})})})};(0,e.registerPlugin)("bnpl-site-messaging",{render:()=>(0,T.select)("core/editor")?null:(0,Ae.jsx)(A.ExperimentalOrderMeta,{children:(0,Ae.jsx)(Ie,{})}),scope:"woocommerce-checkout"})})()})();
Back to Directory File Manager