Plugin Directory

Changeset 3094827


Ignore:
Timestamp:
05/29/2024 08:36:59 PM (22 months ago)
Author:
sumup
Message:

Update to version 2.5.4 from GitHub

Location:
sumup-payment-gateway-for-woocommerce
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • sumup-payment-gateway-for-woocommerce/tags/2.5.4/assets/js/sumup-gateway.min.js

    r3093472 r3094827  
    1 function initSumUpGateway(){const e={checkoutId:sumup_gateway_params.checkoutId,onResponse:onSumupResponse,showZipCode:"true"===sumup_gateway_params.showZipCode,locale:sumup_gateway_params.locale,showFooter:!1,showInstallments:sumup_gateway_params.showInstallments,maxInstallments:sumup_gateway_params.maxInstallments,onPaymentMethodsLoad:sumUpFilterPaymentMethods,onLoad:sumUpOnLoad};sumup_gateway_params.country&&(e.country=sumup_gateway_params.country),SumUpCard.mount(e);const t=document.getElementById("wc-sumup-payment-modal");if(!0!==t.dataset.sumupListener){t.addEventListener("click",function(){t.classList.contains("no-modal")||(t.classList.toggle("disabled"),t.dataset.sumupListener=!0)});let e=document.getElementById("sumup-card");e&&!0!==e.dataset.sumupListener&&e.addEventListener("click",function(t){t.stopPropagation(),e.dataset.sumupListener=!0});let a=document.getElementById("wc-sumup-payment-modal-close");a&&!0!==a.dataset.sumupListener&&a.addEventListener("click",function(e){a.dataset.sumupListener=!0,t.classList.toggle("disabled")})}}function onSumupResponse(e,t){switch(e){case"sent":break;case"invalid":console.error("Error: ",t);break;case"auth-screen":break;case"error":console.error("Error",t),displayError(t.message||sumup_gateway_params.errors.general_error);break;case"success":if("FAILED"===t.status){displayError(t.message||sumup_gateway_params.errors.general_error);break}"PENDING"===t.status&&("boleto"===sumup_gateway_params.paymentMethod&&(setTimeout(function(){const e=document.querySelector('form[data-testid="boleto-download"]'),t=document.querySelector('div[data-testid="pending_screen_content_to_copy"] h4');e&&t&&(sumup_gateway_params.boletoDownloadLink=e.action,sumup_gateway_params.boletoCodeToPay=t.innerText)},50),setTimeout(function(){onSubmitSumup()},100)),"pix"!==sumup_gateway_params.paymentMethod&&"qr_code_pix"!==sumup_gateway_params.paymentMethod||(setTimeout(function(){const e=document.querySelector('textarea[data-testid="pending_screen_content_to_reveal_value"]'),t=document.querySelector('div[data-testid="scannable-barcode"] > img');e&&(sumup_gateway_params.pixCode=e.value,sumup_gateway_params.qrCodeImage=t.src)},50),setTimeout(function(){onSubmitSumup()},100))),"PAID"===t.status&&void 0!==t.transaction_code&&onSubmitSumup()}}function addMessageToPendingScreenBoleto(e){const t=document.querySelector('div[data-testid="pending-screen"]');if(t){let a=document.createElement("div");a.classList.add("sumup-boleto-pending-screen"),a.innerText=e,t.append(a)}}function sumUpFilterPaymentMethods(e){if("yes"!==sumup_gateway_params.enablePix&&"BR"===sumup_gateway_params.country&&e.eligible&&e.eligible.length>0){const t=[];return e.eligible.forEach(e=>{"pix"!==e.id&&"qr_code_pix"!==e.id&&t.push(e.id)}),t}}function sumUpOnLoad(){const e=document.querySelector("#sumup-card form");e&&!0!==e.dataset.sumupListener&&(e.dataset.sumupListener=!0,e.addEventListener("submit",function(t){let a=e.querySelector('input[name="payment_type"]');a&&(sumup_gateway_params.paymentMethod=a.value)})),window.dispatchEvent(new Event("woo_sumup_loaded"))}function onSubmitSumup(){const e=sumup_gateway_params.redirectUrl;if(null!==e.match(/^(https|http):\/\//)){const t=[];"boleto"===sumup_gateway_params.paymentMethod&&(t.push("boleto-code="+encodeURIComponent(sumup_gateway_params.boletoCodeToPay)),t.push("boleto-link="+encodeURIComponent(sumup_gateway_params.boletoDownloadLink))),"pix"!==sumup_gateway_params.paymentMethod&&"qr_code_pix"!==sumup_gateway_params.paymentMethod||(t.push("pix-code="+encodeURIComponent(sumup_gateway_params.pixCode)),t.push("pix-image="+sumup_gateway_params.qrCodeImage)),window.location=t.length>0?e+"&"+t.join("&"):e}}function showSumupPayment(){if(!isSumUpGatewaySelected())return!0;if("paid"===sumup_gateway_params.status)return!0;const e=document.getElementById("wc-sumup-payment-modal");return e&&e.classList.remove("disabled"),!1}function displayError(e){const t=document.querySelector("form.checkout"),a=document.querySelector(".woocommerce-NoticeGroup.woocommerce-NoticeGroup-checkout.woocommerce-error");a&&a.remove();let o=document.createElement("div");o.classList.add("woocommerce-NoticeGroup","woocommerce-NoticeGroup-checkout","woocommerce-error"),o.innerText=e,t.prepend(o),window.scrollTo({top:0,behavior:"smooth"})}function isSumUpGatewaySelected(){const e=document.getElementById("payment_method_sumup");if(e)return e.checked}jQuery(function(e){e(document.body).on("sumupCardInit",initSumUpGateway),e("form#order_review #place_order").on("click",showSumupPayment)});
     1function initSumUpGateway(){const e={checkoutId:sumup_gateway_params.checkoutId,onResponse:onSumupResponse,showZipCode:"true"===sumup_gateway_params.showZipCode,locale:sumup_gateway_params.locale,showFooter:!1,showInstallments:"true"===sumup_gateway_params.showInstallments,maxInstallments:sumup_gateway_params.maxInstallments,onPaymentMethodsLoad:sumUpFilterPaymentMethods,onLoad:sumUpOnLoad};sumup_gateway_params.country&&(e.country=sumup_gateway_params.country),SumUpCard.mount(e);const t=document.getElementById("wc-sumup-payment-modal");if(!0!==t.dataset.sumupListener){t.addEventListener("click",function(){t.classList.contains("no-modal")||(t.classList.toggle("disabled"),t.dataset.sumupListener=!0)});let e=document.getElementById("sumup-card");e&&!0!==e.dataset.sumupListener&&e.addEventListener("click",function(t){t.stopPropagation(),e.dataset.sumupListener=!0});let a=document.getElementById("wc-sumup-payment-modal-close");a&&!0!==a.dataset.sumupListener&&a.addEventListener("click",function(e){a.dataset.sumupListener=!0,t.classList.toggle("disabled")})}}function onSumupResponse(e,t){switch(e){case"sent":break;case"invalid":console.error("Error: ",t);break;case"auth-screen":break;case"error":console.error("Error",t),displayError(t.message||sumup_gateway_params.errors.general_error);break;case"success":if("FAILED"===t.status){displayError(t.message||sumup_gateway_params.errors.general_error);break}"PENDING"===t.status&&("boleto"===sumup_gateway_params.paymentMethod&&(setTimeout(function(){const e=document.querySelector('form[data-testid="boleto-download"]'),t=document.querySelector('div[data-testid="pending_screen_content_to_copy"] h4');e&&t&&(sumup_gateway_params.boletoDownloadLink=e.action,sumup_gateway_params.boletoCodeToPay=t.innerText)},50),setTimeout(function(){onSubmitSumup()},100)),"pix"!==sumup_gateway_params.paymentMethod&&"qr_code_pix"!==sumup_gateway_params.paymentMethod||(setTimeout(function(){const e=document.querySelector('textarea[data-testid="pending_screen_content_to_reveal_value"]'),t=document.querySelector('div[data-testid="scannable-barcode"] > img');e&&(sumup_gateway_params.pixCode=e.value,sumup_gateway_params.qrCodeImage=t.src)},50),setTimeout(function(){onSubmitSumup()},100))),"PAID"===t.status&&void 0!==t.transaction_code&&onSubmitSumup()}}function addMessageToPendingScreenBoleto(e){const t=document.querySelector('div[data-testid="pending-screen"]');if(t){let a=document.createElement("div");a.classList.add("sumup-boleto-pending-screen"),a.innerText=e,t.append(a)}}function sumUpFilterPaymentMethods(e){if(("yes"!==sumup_gateway_params.enablePix||"BR"!==sumup_gateway_params.country)&&e.eligible&&e.eligible.length>0){const t=[];return e.eligible.forEach(e=>{"pix"!==e.id&&"qr_code_pix"!==e.id&&t.push(e.id)}),t}}function sumUpOnLoad(){const e=document.querySelector("#sumup-card form");e&&!0!==e.dataset.sumupListener&&(e.dataset.sumupListener=!0,e.addEventListener("submit",function(t){let a=e.querySelector('input[name="payment_type"]');a&&(sumup_gateway_params.paymentMethod=a.value)})),window.dispatchEvent(new Event("woo_sumup_loaded"))}function onSubmitSumup(){const e=sumup_gateway_params.redirectUrl;if(null!==e.match(/^(https|http):\/\//)){const t=[];"boleto"===sumup_gateway_params.paymentMethod&&(t.push("boleto-code="+encodeURIComponent(sumup_gateway_params.boletoCodeToPay)),t.push("boleto-link="+encodeURIComponent(sumup_gateway_params.boletoDownloadLink))),"pix"!==sumup_gateway_params.paymentMethod&&"qr_code_pix"!==sumup_gateway_params.paymentMethod||(t.push("pix-code="+encodeURIComponent(sumup_gateway_params.pixCode)),t.push("pix-image="+sumup_gateway_params.qrCodeImage)),window.location=t.length>0?e+"&"+t.join("&"):e}}function showSumupPayment(){if(!isSumUpGatewaySelected())return!0;if("paid"===sumup_gateway_params.status)return!0;const e=document.getElementById("wc-sumup-payment-modal");return e&&e.classList.remove("disabled"),!1}function displayError(e){const t=document.querySelector("form.checkout"),a=document.querySelector(".woocommerce-NoticeGroup.woocommerce-NoticeGroup-checkout.woocommerce-error");a&&a.remove();let o=document.createElement("div");o.classList.add("woocommerce-NoticeGroup","woocommerce-NoticeGroup-checkout","woocommerce-error"),o.innerText=e,t.prepend(o),window.scrollTo({top:0,behavior:"smooth"})}function isSumUpGatewaySelected(){const e=document.getElementById("payment_method_sumup");if(e)return e.checked}jQuery(function(e){e(document.body).on("sumupCardInit",initSumUpGateway),e("form#order_review #place_order").on("click",showSumupPayment)});
  • sumup-payment-gateway-for-woocommerce/tags/2.5.4/build/index.asset.php

    r3093472 r3094827  
    1 <?php return array('dependencies' => array('react', 'wp-data', 'wp-html-entities', 'wp-i18n', 'wp-notices'), 'version' => '585544cbd3eaa8bf5d37');
     1<?php return array('dependencies' => array('react', 'wp-data', 'wp-html-entities', 'wp-i18n', 'wp-notices'), 'version' => 'cde515e6b6da6b324984');
  • sumup-payment-gateway-for-woocommerce/tags/2.5.4/build/index.js

    r3093472 r3094827  
    1 (()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{hasBrowserEnv:()=>oe,hasStandardBrowserEnv:()=>se,hasStandardBrowserWebWorkerEnv:()=>ae});const n=window.React,r=window.wp.htmlEntities,o=(window.wp.i18n,({isOpen:e,onClose:t,isModal:r,description:o})=>{const[s,i]=(0,n.useState)("");return(0,n.useEffect)((()=>{i(e?r?"wc-sumup-modal":"wc-sumup-modal no-modal":"wc-sumup-modal disabled")}),[s,e,r]),(0,n.createElement)("div",null,(0,n.createElement)("p",null,o),(0,n.createElement)("div",{id:"wc-sumup-payment-modal",className:s},(0,n.createElement)("div",{id:"sumup-card"},(0,n.createElement)("div",{id:"wc-sumup-payment-modal-close"},(0,n.createElement)("span",{id:"wc-sumup-payment-modal-close-btn",onClick:t},"X")))))});function s(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,c=(u=Object.create(null),e=>{const t=i.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const l=e=>(e=e.toLowerCase(),t=>c(t)===e),d=e=>t=>typeof t===e,{isArray:f}=Array,p=d("undefined"),h=l("ArrayBuffer"),m=d("string"),y=d("function"),g=d("number"),w=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==c(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},E=l("Date"),S=l("File"),O=l("Blob"),R=l("FileList"),_=l("URLSearchParams");function T(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),f(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function v(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,C=e=>!p(e)&&e!==A,x=(P="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>P&&e instanceof P);var P;const j=l("HTMLFormElement"),N=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),k=l("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};T(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)},U="abcdefghijklmnopqrstuvwxyz",B="0123456789",L={DIGIT:B,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+B},D=l("AsyncFunction"),I={isArray:f,isArrayBuffer:h,isBuffer:function(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||y(e.append)&&("formdata"===(t=c(e))||"object"===t&&y(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer),t},isString:m,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:b,isUndefined:p,isDate:E,isFile:S,isBlob:O,isRegExp:k,isFunction:y,isStream:e=>w(e)&&y(e.pipe),isURLSearchParams:_,isTypedArray:x,isFileList:R,forEach:T,merge:function e(){const{caseless:t}=C(this)&&this||{},n={},r=(r,o)=>{const s=t&&v(n,o)||o;b(n[s])&&b(r)?n[s]=e(n[s],r):b(r)?n[s]=e({},r):f(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&T(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(T(t,((t,r)=>{n&&y(t)?e[r]=s(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||c[i]||(t[i]=e[i],c[i]=!0);e=!1!==n&&a(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(f(e))return e;let t=e.length;if(!g(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:j,hasOwnProperty:N,hasOwnProp:N,reduceDescriptors:F,freezeMethods:e=>{F(e,((t,n)=>{if(y(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];y(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return f(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:v,global:A,isContextDefined:C,ALPHABET:L,generateString:(e=16,t=L.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=f(e)?[]:{};return T(e,((e,t)=>{const s=n(e,r+1);!p(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:D,isThenable:e=>e&&(w(e)||y(e))&&y(e.then)&&y(e.catch)};function q(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}I.inherits(q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const M=q.prototype,z={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{z[e]={value:e}})),Object.defineProperties(q,z),Object.defineProperty(M,"isAxiosError",{value:!0}),q.from=(e,t,n,r,o,s)=>{const i=Object.create(M);return I.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),q.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const H=q;function J(e){return I.isPlainObject(e)||I.isArray(e)}function K(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function W(e,t,n){return e?e.concat(t).map((function(e,t){return e=K(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const V=I.toFlatObject(I,{},null,(function(e){return/^is[A-Z]/.test(e)})),G=function(e,t,n){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=I.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!I.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(I.isDate(e))return e.toISOString();if(!a&&I.isBlob(e))throw new H("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(e)||I.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(I.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(I.isArray(e)&&function(e){return I.isArray(e)&&!e.some(J)}(e)||(I.isFileList(e)||I.endsWith(n,"[]"))&&(a=I.toArray(e)))return n=K(n),a.forEach((function(e,r){!I.isUndefined(e)&&null!==e&&t.append(!0===i?W([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!J(e)||(t.append(W(o,n,s),c(e)),!1)}const l=[],d=Object.assign(V,{defaultVisitor:u,convertValue:c,isVisitable:J});if(!I.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!I.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),I.forEach(n,(function(n,s){!0===(!(I.isUndefined(n)||null===n)&&o.call(t,n,I.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t};function $(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function X(e,t){this._pairs=[],e&&G(e,this,t)}const Z=X.prototype;Z.append=function(e,t){this._pairs.push([e,t])},Z.toString=function(e){const t=e?function(t){return e.call(this,t,$)}:$;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Q=X;function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ee(e,t,n){if(!t)return e;const r=n&&n.encode||Y,o=n&&n.serialize;let s;if(s=o?o(t,n):I.isURLSearchParams(t)?t.toString():new Q(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const te=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){I.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},re={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Q,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},oe="undefined"!=typeof window&&"undefined"!=typeof document,se=(ie="undefined"!=typeof navigator&&navigator.product,oe&&["ReactNative","NativeScript","NS"].indexOf(ie)<0);var ie;const ae="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ce={...t,...re},ue=function(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&I.isArray(r)?r.length:s,a?(I.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i):(r[s]&&I.isObject(r[s])||(r[s]=[]),t(e,n,r[s],o)&&I.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i)}if(I.isFormData(e)&&I.isFunction(e.entries)){const n={};return I.forEachEntry(e,((e,r)=>{t(function(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},le={transitional:ne,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=I.isObject(e);if(o&&I.isHTMLForm(e)&&(e=new FormData(e)),I.isFormData(e))return r?JSON.stringify(ue(e)):e;if(I.isArrayBuffer(e)||I.isBuffer(e)||I.isStream(e)||I.isFile(e)||I.isBlob(e))return e;if(I.isArrayBufferView(e))return e.buffer;if(I.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return G(e,new ce.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ce.isNode&&I.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=I.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return G(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(I.isString(e))try{return(0,JSON.parse)(e),I.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||le.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&I.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw H.from(e,H.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ce.classes.FormData,Blob:ce.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],(e=>{le.headers[e]={}}));const de=le,fe=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pe=Symbol("internals");function he(e){return e&&String(e).trim().toLowerCase()}function me(e){return!1===e||null==e?e:I.isArray(e)?e.map(me):String(e)}function ye(e,t,n,r,o){return I.isFunction(r)?r.call(this,t,n):(o&&(t=n),I.isString(t)?I.isString(r)?-1!==t.indexOf(r):I.isRegExp(r)?r.test(t):void 0:void 0)}class ge{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=he(t);if(!o)throw new Error("header name must be a non-empty string");const s=I.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=me(e))}const s=(e,t)=>I.forEach(e,((e,n)=>o(e,n,t)));return I.isPlainObject(e)||e instanceof this.constructor?s(e,t):I.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&fe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=he(e)){const n=I.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(I.isFunction(t))return t.call(this,e,n);if(I.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=he(e)){const n=I.findKey(this,e);return!(!n||void 0===this[n]||t&&!ye(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=he(e)){const o=I.findKey(n,e);!o||t&&!ye(0,n[o],o,t)||(delete n[o],r=!0)}}return I.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ye(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return I.forEach(this,((r,o)=>{const s=I.findKey(n,o);if(s)return t[s]=me(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=me(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return I.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&I.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[pe]=this[pe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=he(e);t[r]||(function(e,t){const n=I.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return I.isArray(e)?e.forEach(r):r(e),this}}ge.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.reduceDescriptors(ge.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),I.freezeMethods(ge);const we=ge;function be(e,t){const n=this||de,r=t||n,o=we.from(r.headers);let s=r.data;return I.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function Ee(e){return!(!e||!e.__CANCEL__)}function Se(e,t,n){H.call(this,null==e?"canceled":e,H.ERR_CANCELED,t,n),this.name="CanceledError"}I.inherits(Se,H,{__CANCEL__:!0});const Oe=Se,Re=ce.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];I.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),I.isString(r)&&i.push("path="+r),I.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function _e(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Te=ce.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=I.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ve(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,d=0;for(;l!==s;)d+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-n,c=r(a);n=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const Ae={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=we.from(e.headers).normalize();let s,i,{responseType:a,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(I.isFormData(r))if(ce.hasStandardBrowserEnv||ce.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(i=o.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const d=_e(e.baseURL,e.url);function f(){if(!l)return;const r=we.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new H("Request failed with status code "+n.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),u()}),(function(e){n(e),u()}),{data:a&&"text"!==a&&"json"!==a?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),ee(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=f:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(f)},l.onabort=function(){l&&(n(new H("Request aborted",H.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new H("Network Error",H.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||ne;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new H(t,r.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,l)),l=null},ce.hasStandardBrowserEnv&&(c&&I.isFunction(c)&&(c=c(e)),c||!1!==c&&Te(d))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&Re.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in l&&I.forEach(o.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),I.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&"json"!==a&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ve(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ve(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{l&&(n(!t||t.type?new Oe(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);p&&-1===ce.protocols.indexOf(p)?n(new H("Unsupported protocol "+p+":",H.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};I.forEach(Ae,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ce=e=>`- ${e}`,xe=e=>I.isFunction(e)||null===e||!1===e,Pe=e=>{e=I.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!xe(n)&&(r=Ae[(t=String(n)).toLowerCase()],void 0===r))throw new H(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(Ce).join("\n"):" "+Ce(e[0]):"as no adapter specified";throw new H("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function je(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Oe(null,e)}function Ne(e){return je(e),e.headers=we.from(e.headers),e.data=be.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Pe(e.adapter||de.adapter)(e).then((function(t){return je(e),t.data=be.call(e,e.transformResponse,t),t.headers=we.from(t.headers),t}),(function(t){return Ee(t)||(je(e),t&&t.response&&(t.response.data=be.call(e,e.transformResponse,t.response),t.response.headers=we.from(t.response.headers))),Promise.reject(t)}))}const ke=e=>e instanceof we?{...e}:e;function Fe(e,t){t=t||{};const n={};function r(e,t,n){return I.isPlainObject(e)&&I.isPlainObject(t)?I.merge.call({caseless:n},e,t):I.isPlainObject(t)?I.merge({},t):I.isArray(t)?t.slice():t}function o(e,t,n){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!I.isUndefined(t))return r(void 0,t)}function i(e,t){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(ke(e),ke(t),!0)};return I.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);I.isUndefined(i)&&s!==a||(n[r]=i)})),n}const Ue={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ue[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Be={};Ue.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.8] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new H(r(o," has been removed"+(t?" in "+t:"")),H.ERR_DEPRECATED);return t&&!Be[o]&&(Be[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}};const Le={assertOptions:function(e,t,n){if("object"!=typeof e)throw new H("options must be an object",H.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new H("option "+s+" must be "+n,H.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new H("Unknown option "+s,H.ERR_BAD_OPTION)}},validators:Ue},De=Le.validators;class Ie{constructor(e){this.defaults=e,this.interceptors={request:new te,response:new te}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Fe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Le.assertOptions(n,{silentJSONParsing:De.transitional(De.boolean),forcedJSONParsing:De.transitional(De.boolean),clarifyTimeoutError:De.transitional(De.boolean)},!1),null!=r&&(I.isFunction(r)?t.paramsSerializer={serialize:r}:Le.assertOptions(r,{encode:De.function,serialize:De.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&I.merge(o.common,o[t.method]);o&&I.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=we.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,d=0;if(!a){const e=[Ne.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);d<l;)u=u.then(e[d++],e[d++]);return u}l=i.length;let f=t;for(d=0;d<l;){const e=i[d++],t=i[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=Ne.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(e){return ee(_e((e=Fe(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}I.forEach(["delete","get","head","options"],(function(e){Ie.prototype[e]=function(t,n){return this.request(Fe(n||{},{method:e,url:t,data:(n||{}).data}))}})),I.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Fe(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ie.prototype[e]=t(),Ie.prototype[e+"Form"]=t(!0)}));const qe=Ie;class Me{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new Oe(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Me((function(t){e=t})),cancel:e}}}const ze=Me,He={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(He).forEach((([e,t])=>{He[t]=e}));const Je=He,Ke=function e(t){const n=new qe(t),r=s(qe.prototype.request,n);return I.extend(r,qe.prototype,n,{allOwnKeys:!0}),I.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Fe(t,n))},r}(de);Ke.Axios=qe,Ke.CanceledError=Oe,Ke.CancelToken=ze,Ke.isCancel=Ee,Ke.VERSION="1.6.8",Ke.toFormData=G,Ke.AxiosError=H,Ke.Cancel=Ke.CanceledError,Ke.all=function(e){return Promise.all(e)},Ke.spread=function(e){return function(t){return e.apply(null,t)}},Ke.isAxiosError=function(e){return I.isObject(e)&&!0===e.isAxiosError},Ke.mergeConfig=Fe,Ke.AxiosHeaders=we,Ke.formToJSON=e=>ue(I.isHTMLForm(e)?new FormData(e):e),Ke.getAdapter=Pe,Ke.HttpStatusCode=Je,Ke.default=Ke;const We=Ke,Ve=e=>{if("yes"!==sumup_gateway_params.enablePix&&"BR"===sumup_gateway_params.country&&e.eligible&&e.eligible.length>0){const t=[];return e.eligible.forEach((e=>{"pix"!==e.id&&"qr_code_pix"!==e.id&&t.push(e.id)})),t}},Ge=async(e,t)=>{const n=await(async e=>{try{return await We.post(sumup_gateway_params.sumup_handler_url,{order_id:e,isCheckoutBlocks:!0})}catch(e){return console.log(e.response.data),e.response.data}})(e);if("error"==n.result)return n;const r={checkoutId:n.data.result.checkoutId,onResponse:(e,n)=>((e,t,n)=>{switch(localStorage.setItem("pix-content",""),localStorage.setItem("qrcode",""),localStorage.setItem("paymentMethod",t.payment_method),e){case"sent":break;case"invalid":console.error("Error: ",t);break;case"auth-screen":break;case"error":console.error("Error",t),sumup_gateway_params.errors.payment_error=t.message?t.message:"";case"success":"FAILED"===t.status&&(sumup_gateway_params.errors.payment_error=t.message?t.message:""),"PENDING"===t.status&&("boleto"===t.payment_method&&(setTimeout((function(){const e=document.querySelector('form[data-testid="boleto-download"]'),t=document.querySelector('div[data-testid="pending_screen_content_to_copy"] h4');if(e&&t){sumup_gateway_params.boletoDownloadLink=e.action,sumup_gateway_params.boletoCodeToPay=t.innerText;const n=artefacts.filter((e=>"application/pdf"===e.content_type))[0];n&&localStorage.setItem("boleto-pdf",n.location);const r=artefacts.filter((e=>"text/plain"===e.content_type))[0];r&&localStorage.setItem("boleto-barcode",r.content)}}),50),setTimeout((function(){n()}),100)),"pix"!==t.payment_method&&"qr_code_pix"!==t.payment_method||(setTimeout((function(){const e=document.querySelector('textarea[data-testid="pending_screen_content_to_reveal_value"]'),n=document.querySelector('div[data-testid="scannable-barcode"] > img');e&&(localStorage.setItem("pix-content",t.qr_code_pix.artefacts.filter((e=>e.content))[0].content),localStorage.setItem("qrcode",t.qr_code_pix.artefacts.filter((e=>!e.content))[0].location),sumup_gateway_params.pixCode=e.value,sumup_gateway_params.qrCodeImage=n.src)}),50),setTimeout((function(){n()}),100))),"PAID"===t.status&&void 0!==t.transaction_code&&n()}})(e,n,t),showZipCode:"true"===sumup_gateway_params.showZipCode,locale:sumup_gateway_params.locale,showFooter:!1,showInstallments:sumup_gateway_params.showInstallments,maxInstallments:sumup_gateway_params.maxInstallments,onPaymentMethodsLoad:Ve};await SumUpCard.mount(r)},$e=window.wp.data,{registerPaymentMethod:Xe}=(window.wp.notices,window.wc.wcBlocksRegistry),{getSetting:Ze}=window.wc.wcSettings,{CHECKOUT_STORE_KEY:Qe}=window.wc.wcBlocksData,Ye=Ze("sumup_data",{}),et=(0,$e.select)(Qe),tt=(0,r.decodeEntities)(Ye.title),nt=(0,r.decodeEntities)(Ye.description),rt=({eventRegistration:e,checkoutStatus:t,onSubmit:r,emitResponse:s})=>{const{onCheckoutFail:i,onCheckoutSuccess:a,onPaymentProcessing:c}=e,u=et.getOrderId(),[l,d]=(0,n.useState)(!1),[f]=(0,n.useState)("yes"==sumup_gateway_params.openPaymentInModal),p=()=>{const e=new CustomEvent("resolve-checkout",{detail:{result:{type:"success"}}});document.dispatchEvent(e)};return(0,n.useEffect)((()=>{const e=c((async()=>{const e=await Ge(u,p);return e?{type:s.responseTypes.ERROR,message:e.message}:sumup_gateway_params.payment_error?{type:s.responseTypes.ERROR,message:sumup_gateway_params.payment_error}:{type:s.responseTypes.SUCCESS}}));return()=>{e()}}),[c,s.responseTypes.ERROR,s.responseTypes.SUCCESS]),(0,n.useEffect)((()=>{const e=a((async e=>(console.log(e),d(!0),await new Promise((e=>{document.addEventListener("resolve-checkout",(t=>{e(t.detail.result)}))})))));return()=>{e()}}),[a]),(0,n.useEffect)((()=>{i((()=>{const e=setInterval((()=>{const t=document.querySelector(".wc-block-components-notices");t&&(t.style.display="none",clearInterval(e),window.scrollTo(0,window.scrollY))}),10)}))}),[i,s.responseTypes.ERROR]),(0,n.createElement)(o,{isOpen:l,onClose:()=>{d(!1);const e=new CustomEvent("resolve-checkout",{detail:{result:{type:"error"}}});document.dispatchEvent(e)},isModal:f,description:nt})};Xe({name:"sumup",label:(0,n.createElement)((e=>{const{PaymentMethodLabel:t}=e.components;return(0,n.createElement)(t,{text:tt})}),null),content:(0,n.createElement)(rt,null),edit:(0,n.createElement)(rt,null),canMakePayment:()=>!0,ariaLabel:tt,supports:{features:Ye.supports}})})();
     1(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{hasBrowserEnv:()=>oe,hasStandardBrowserEnv:()=>se,hasStandardBrowserWebWorkerEnv:()=>ae});const n=window.React,r=window.wp.htmlEntities,o=(window.wp.i18n,({isOpen:e,onClose:t,isModal:r,description:o})=>{const[s,i]=(0,n.useState)("");return(0,n.useEffect)((()=>{i(e?r?"wc-sumup-modal":"wc-sumup-modal no-modal":"wc-sumup-modal disabled")}),[s,e,r]),(0,n.createElement)("div",null,(0,n.createElement)("p",null,o),(0,n.createElement)("div",{id:"wc-sumup-payment-modal",className:s},(0,n.createElement)("div",{id:"sumup-card"},(0,n.createElement)("div",{id:"wc-sumup-payment-modal-close"},(0,n.createElement)("span",{id:"wc-sumup-payment-modal-close-btn",onClick:t},"X")))))});function s(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,c=(u=Object.create(null),e=>{const t=i.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const l=e=>(e=e.toLowerCase(),t=>c(t)===e),d=e=>t=>typeof t===e,{isArray:f}=Array,p=d("undefined"),h=l("ArrayBuffer"),m=d("string"),y=d("function"),g=d("number"),w=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==c(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},E=l("Date"),S=l("File"),O=l("Blob"),R=l("FileList"),_=l("URLSearchParams");function T(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),f(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function v(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,C=e=>!p(e)&&e!==A,x=(P="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>P&&e instanceof P);var P;const j=l("HTMLFormElement"),N=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),k=l("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};T(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)},U="abcdefghijklmnopqrstuvwxyz",B="0123456789",L={DIGIT:B,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+B},D=l("AsyncFunction"),I={isArray:f,isArrayBuffer:h,isBuffer:function(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||y(e.append)&&("formdata"===(t=c(e))||"object"===t&&y(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer),t},isString:m,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:b,isUndefined:p,isDate:E,isFile:S,isBlob:O,isRegExp:k,isFunction:y,isStream:e=>w(e)&&y(e.pipe),isURLSearchParams:_,isTypedArray:x,isFileList:R,forEach:T,merge:function e(){const{caseless:t}=C(this)&&this||{},n={},r=(r,o)=>{const s=t&&v(n,o)||o;b(n[s])&&b(r)?n[s]=e(n[s],r):b(r)?n[s]=e({},r):f(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&T(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(T(t,((t,r)=>{n&&y(t)?e[r]=s(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||c[i]||(t[i]=e[i],c[i]=!0);e=!1!==n&&a(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(f(e))return e;let t=e.length;if(!g(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:j,hasOwnProperty:N,hasOwnProp:N,reduceDescriptors:F,freezeMethods:e=>{F(e,((t,n)=>{if(y(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];y(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return f(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:v,global:A,isContextDefined:C,ALPHABET:L,generateString:(e=16,t=L.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=f(e)?[]:{};return T(e,((e,t)=>{const s=n(e,r+1);!p(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:D,isThenable:e=>e&&(w(e)||y(e))&&y(e.then)&&y(e.catch)};function q(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}I.inherits(q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const M=q.prototype,z={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{z[e]={value:e}})),Object.defineProperties(q,z),Object.defineProperty(M,"isAxiosError",{value:!0}),q.from=(e,t,n,r,o,s)=>{const i=Object.create(M);return I.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),q.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const H=q;function J(e){return I.isPlainObject(e)||I.isArray(e)}function K(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function W(e,t,n){return e?e.concat(t).map((function(e,t){return e=K(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const V=I.toFlatObject(I,{},null,(function(e){return/^is[A-Z]/.test(e)})),G=function(e,t,n){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=I.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!I.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(I.isDate(e))return e.toISOString();if(!a&&I.isBlob(e))throw new H("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(e)||I.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(I.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(I.isArray(e)&&function(e){return I.isArray(e)&&!e.some(J)}(e)||(I.isFileList(e)||I.endsWith(n,"[]"))&&(a=I.toArray(e)))return n=K(n),a.forEach((function(e,r){!I.isUndefined(e)&&null!==e&&t.append(!0===i?W([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!J(e)||(t.append(W(o,n,s),c(e)),!1)}const l=[],d=Object.assign(V,{defaultVisitor:u,convertValue:c,isVisitable:J});if(!I.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!I.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),I.forEach(n,(function(n,s){!0===(!(I.isUndefined(n)||null===n)&&o.call(t,n,I.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t};function $(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function X(e,t){this._pairs=[],e&&G(e,this,t)}const Z=X.prototype;Z.append=function(e,t){this._pairs.push([e,t])},Z.toString=function(e){const t=e?function(t){return e.call(this,t,$)}:$;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Q=X;function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ee(e,t,n){if(!t)return e;const r=n&&n.encode||Y,o=n&&n.serialize;let s;if(s=o?o(t,n):I.isURLSearchParams(t)?t.toString():new Q(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const te=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){I.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},re={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Q,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},oe="undefined"!=typeof window&&"undefined"!=typeof document,se=(ie="undefined"!=typeof navigator&&navigator.product,oe&&["ReactNative","NativeScript","NS"].indexOf(ie)<0);var ie;const ae="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ce={...t,...re},ue=function(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&I.isArray(r)?r.length:s,a?(I.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i):(r[s]&&I.isObject(r[s])||(r[s]=[]),t(e,n,r[s],o)&&I.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i)}if(I.isFormData(e)&&I.isFunction(e.entries)){const n={};return I.forEachEntry(e,((e,r)=>{t(function(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},le={transitional:ne,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=I.isObject(e);if(o&&I.isHTMLForm(e)&&(e=new FormData(e)),I.isFormData(e))return r?JSON.stringify(ue(e)):e;if(I.isArrayBuffer(e)||I.isBuffer(e)||I.isStream(e)||I.isFile(e)||I.isBlob(e))return e;if(I.isArrayBufferView(e))return e.buffer;if(I.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return G(e,new ce.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ce.isNode&&I.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=I.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return G(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(I.isString(e))try{return(0,JSON.parse)(e),I.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||le.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&I.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw H.from(e,H.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ce.classes.FormData,Blob:ce.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],(e=>{le.headers[e]={}}));const de=le,fe=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pe=Symbol("internals");function he(e){return e&&String(e).trim().toLowerCase()}function me(e){return!1===e||null==e?e:I.isArray(e)?e.map(me):String(e)}function ye(e,t,n,r,o){return I.isFunction(r)?r.call(this,t,n):(o&&(t=n),I.isString(t)?I.isString(r)?-1!==t.indexOf(r):I.isRegExp(r)?r.test(t):void 0:void 0)}class ge{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=he(t);if(!o)throw new Error("header name must be a non-empty string");const s=I.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=me(e))}const s=(e,t)=>I.forEach(e,((e,n)=>o(e,n,t)));return I.isPlainObject(e)||e instanceof this.constructor?s(e,t):I.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&fe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=he(e)){const n=I.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(I.isFunction(t))return t.call(this,e,n);if(I.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=he(e)){const n=I.findKey(this,e);return!(!n||void 0===this[n]||t&&!ye(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=he(e)){const o=I.findKey(n,e);!o||t&&!ye(0,n[o],o,t)||(delete n[o],r=!0)}}return I.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ye(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return I.forEach(this,((r,o)=>{const s=I.findKey(n,o);if(s)return t[s]=me(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=me(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return I.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&I.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[pe]=this[pe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=he(e);t[r]||(function(e,t){const n=I.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return I.isArray(e)?e.forEach(r):r(e),this}}ge.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.reduceDescriptors(ge.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),I.freezeMethods(ge);const we=ge;function be(e,t){const n=this||de,r=t||n,o=we.from(r.headers);let s=r.data;return I.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function Ee(e){return!(!e||!e.__CANCEL__)}function Se(e,t,n){H.call(this,null==e?"canceled":e,H.ERR_CANCELED,t,n),this.name="CanceledError"}I.inherits(Se,H,{__CANCEL__:!0});const Oe=Se,Re=ce.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];I.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),I.isString(r)&&i.push("path="+r),I.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function _e(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Te=ce.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=I.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ve(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,d=0;for(;l!==s;)d+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-n,c=r(a);n=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const Ae={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=we.from(e.headers).normalize();let s,i,{responseType:a,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(I.isFormData(r))if(ce.hasStandardBrowserEnv||ce.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(i=o.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const d=_e(e.baseURL,e.url);function f(){if(!l)return;const r=we.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new H("Request failed with status code "+n.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),u()}),(function(e){n(e),u()}),{data:a&&"text"!==a&&"json"!==a?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),ee(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=f:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(f)},l.onabort=function(){l&&(n(new H("Request aborted",H.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new H("Network Error",H.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||ne;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new H(t,r.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,l)),l=null},ce.hasStandardBrowserEnv&&(c&&I.isFunction(c)&&(c=c(e)),c||!1!==c&&Te(d))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&Re.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in l&&I.forEach(o.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),I.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&"json"!==a&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ve(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ve(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{l&&(n(!t||t.type?new Oe(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);p&&-1===ce.protocols.indexOf(p)?n(new H("Unsupported protocol "+p+":",H.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};I.forEach(Ae,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ce=e=>`- ${e}`,xe=e=>I.isFunction(e)||null===e||!1===e,Pe=e=>{e=I.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!xe(n)&&(r=Ae[(t=String(n)).toLowerCase()],void 0===r))throw new H(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(Ce).join("\n"):" "+Ce(e[0]):"as no adapter specified";throw new H("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function je(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Oe(null,e)}function Ne(e){return je(e),e.headers=we.from(e.headers),e.data=be.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Pe(e.adapter||de.adapter)(e).then((function(t){return je(e),t.data=be.call(e,e.transformResponse,t),t.headers=we.from(t.headers),t}),(function(t){return Ee(t)||(je(e),t&&t.response&&(t.response.data=be.call(e,e.transformResponse,t.response),t.response.headers=we.from(t.response.headers))),Promise.reject(t)}))}const ke=e=>e instanceof we?{...e}:e;function Fe(e,t){t=t||{};const n={};function r(e,t,n){return I.isPlainObject(e)&&I.isPlainObject(t)?I.merge.call({caseless:n},e,t):I.isPlainObject(t)?I.merge({},t):I.isArray(t)?t.slice():t}function o(e,t,n){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!I.isUndefined(t))return r(void 0,t)}function i(e,t){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(ke(e),ke(t),!0)};return I.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);I.isUndefined(i)&&s!==a||(n[r]=i)})),n}const Ue={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ue[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Be={};Ue.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.8] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new H(r(o," has been removed"+(t?" in "+t:"")),H.ERR_DEPRECATED);return t&&!Be[o]&&(Be[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}};const Le={assertOptions:function(e,t,n){if("object"!=typeof e)throw new H("options must be an object",H.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new H("option "+s+" must be "+n,H.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new H("Unknown option "+s,H.ERR_BAD_OPTION)}},validators:Ue},De=Le.validators;class Ie{constructor(e){this.defaults=e,this.interceptors={request:new te,response:new te}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Fe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Le.assertOptions(n,{silentJSONParsing:De.transitional(De.boolean),forcedJSONParsing:De.transitional(De.boolean),clarifyTimeoutError:De.transitional(De.boolean)},!1),null!=r&&(I.isFunction(r)?t.paramsSerializer={serialize:r}:Le.assertOptions(r,{encode:De.function,serialize:De.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&I.merge(o.common,o[t.method]);o&&I.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=we.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,d=0;if(!a){const e=[Ne.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);d<l;)u=u.then(e[d++],e[d++]);return u}l=i.length;let f=t;for(d=0;d<l;){const e=i[d++],t=i[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=Ne.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(e){return ee(_e((e=Fe(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}I.forEach(["delete","get","head","options"],(function(e){Ie.prototype[e]=function(t,n){return this.request(Fe(n||{},{method:e,url:t,data:(n||{}).data}))}})),I.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Fe(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ie.prototype[e]=t(),Ie.prototype[e+"Form"]=t(!0)}));const qe=Ie;class Me{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new Oe(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Me((function(t){e=t})),cancel:e}}}const ze=Me,He={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(He).forEach((([e,t])=>{He[t]=e}));const Je=He,Ke=function e(t){const n=new qe(t),r=s(qe.prototype.request,n);return I.extend(r,qe.prototype,n,{allOwnKeys:!0}),I.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Fe(t,n))},r}(de);Ke.Axios=qe,Ke.CanceledError=Oe,Ke.CancelToken=ze,Ke.isCancel=Ee,Ke.VERSION="1.6.8",Ke.toFormData=G,Ke.AxiosError=H,Ke.Cancel=Ke.CanceledError,Ke.all=function(e){return Promise.all(e)},Ke.spread=function(e){return function(t){return e.apply(null,t)}},Ke.isAxiosError=function(e){return I.isObject(e)&&!0===e.isAxiosError},Ke.mergeConfig=Fe,Ke.AxiosHeaders=we,Ke.formToJSON=e=>ue(I.isHTMLForm(e)?new FormData(e):e),Ke.getAdapter=Pe,Ke.HttpStatusCode=Je,Ke.default=Ke;const We=Ke,Ve=e=>{if(("yes"!==sumup_gateway_params.enablePix||"BR"!==sumup_gateway_params.country)&&e.eligible&&e.eligible.length>0){const t=[];return e.eligible.forEach((e=>{"pix"!==e.id&&"qr_code_pix"!==e.id&&t.push(e.id)})),t}},Ge=async(e,t)=>{const n=await(async e=>{try{return await We.post(sumup_gateway_params.sumup_handler_url,{order_id:e,isCheckoutBlocks:!0})}catch(e){return console.log(e.response.data),e.response.data}})(e);if("error"==n.result)return n;sumup_gateway_params.country=n.data.result.country;const r={checkoutId:n.data.result.checkoutId,onResponse:(e,n)=>((e,t,n)=>{switch(localStorage.setItem("pix-content",""),localStorage.setItem("qrcode",""),localStorage.setItem("paymentMethod",t.payment_method),e){case"sent":break;case"invalid":console.error("Error: ",t);break;case"auth-screen":break;case"error":console.error("Error",t),sumup_gateway_params.errors.payment_error=t.message?t.message:"";case"success":"FAILED"===t.status&&(sumup_gateway_params.errors.payment_error=t.message?t.message:""),"PENDING"===t.status&&("boleto"===t.payment_method&&(setTimeout((function(){const e=document.querySelector('form[data-testid="boleto-download"]'),t=document.querySelector('div[data-testid="pending_screen_content_to_copy"] h4');if(e&&t){sumup_gateway_params.boletoDownloadLink=e.action,sumup_gateway_params.boletoCodeToPay=t.innerText;const n=artefacts.filter((e=>"application/pdf"===e.content_type))[0];n&&localStorage.setItem("boleto-pdf",n.location);const r=artefacts.filter((e=>"text/plain"===e.content_type))[0];r&&localStorage.setItem("boleto-barcode",r.content)}}),50),setTimeout((function(){n()}),100)),"pix"!==t.payment_method&&"qr_code_pix"!==t.payment_method||(setTimeout((function(){const e=document.querySelector('textarea[data-testid="pending_screen_content_to_reveal_value"]'),n=document.querySelector('div[data-testid="scannable-barcode"] > img');e&&(localStorage.setItem("pix-content",t.qr_code_pix.artefacts.filter((e=>e.content))[0].content),localStorage.setItem("qrcode",t.qr_code_pix.artefacts.filter((e=>!e.content))[0].location),sumup_gateway_params.pixCode=e.value,sumup_gateway_params.qrCodeImage=n.src)}),50),setTimeout((function(){n()}),100))),"PAID"===t.status&&void 0!==t.transaction_code&&n()}})(e,n,t),showZipCode:"true"===sumup_gateway_params.showZipCode,locale:sumup_gateway_params.locale,showFooter:!1,showInstallments:"true"===sumup_gateway_params.showInstallments,maxInstallments:sumup_gateway_params.maxInstallments,onPaymentMethodsLoad:Ve};await SumUpCard.mount(r)},$e=window.wp.data,{registerPaymentMethod:Xe}=(window.wp.notices,window.wc.wcBlocksRegistry),{getSetting:Ze}=window.wc.wcSettings,{CHECKOUT_STORE_KEY:Qe}=window.wc.wcBlocksData,Ye=Ze("sumup_data",{}),et=(0,$e.select)(Qe),tt=(0,r.decodeEntities)(Ye.title),nt=(0,r.decodeEntities)(Ye.description),rt=({eventRegistration:e,checkoutStatus:t,onSubmit:r,emitResponse:s})=>{const{onCheckoutFail:i,onCheckoutSuccess:a,onPaymentProcessing:c}=e,u=et.getOrderId(),[l,d]=(0,n.useState)(!1),[f]=(0,n.useState)("yes"==sumup_gateway_params.openPaymentInModal),p=()=>{const e=new CustomEvent("resolve-checkout",{detail:{result:{type:"success"}}});document.dispatchEvent(e)};return(0,n.useEffect)((()=>{const e=c((async()=>{const e=await Ge(u,p);return e?{type:s.responseTypes.ERROR,message:e.message}:sumup_gateway_params.payment_error?{type:s.responseTypes.ERROR,message:sumup_gateway_params.payment_error}:{type:s.responseTypes.SUCCESS}}));return()=>{e()}}),[c,s.responseTypes.ERROR,s.responseTypes.SUCCESS]),(0,n.useEffect)((()=>{const e=a((async e=>(console.log(e),d(!0),await new Promise((e=>{document.addEventListener("resolve-checkout",(t=>{e(t.detail.result)}))})))));return()=>{e()}}),[a]),(0,n.useEffect)((()=>{i((()=>{const e=setInterval((()=>{const t=document.querySelector(".wc-block-components-notices");t&&(t.style.display="none",clearInterval(e),window.scrollTo(0,window.scrollY))}),10)}))}),[i,s.responseTypes.ERROR]),(0,n.createElement)(o,{isOpen:l,onClose:()=>{d(!1);const e=new CustomEvent("resolve-checkout",{detail:{result:{type:"error"}}});document.dispatchEvent(e)},isModal:f,description:nt})};Xe({name:"sumup",label:(0,n.createElement)((e=>{const{PaymentMethodLabel:t}=e.components;return(0,n.createElement)(t,{text:tt})}),null),content:(0,n.createElement)(rt,null),edit:(0,n.createElement)(rt,null),canMakePayment:()=>!0,ariaLabel:tt,supports:{features:Ye.supports}})})();
  • sumup-payment-gateway-for-woocommerce/tags/2.5.4/includes/api/handlers/class-sumup-create-checkout.php

    r3093472 r3094827  
    161161                "amount" => $total,
    162162                "checkoutId" => $sumup_checkout['id'],
    163                 "country" => 'BR'
     163                "country" => $order->get_billing_country()
    164164            );
    165165
  • sumup-payment-gateway-for-woocommerce/tags/2.5.4/includes/class-wc-sumup-block-gateway.php

    r3093472 r3094827  
    113113         * Translators: the following error messages are shown to the end user
    114114         */
    115         $show_installments = "false";
     115        $show_installments = 'false';
    116116        $number_of_installments = null;
    117         if ($card_country === 'BR') {
    118             $show_installments = $this->settings["installments_enabled"] === 'yes' ? "true" : "false";
    119             $number_of_installments = $this->settings["number_of_installments"] !== false && $this->settings["number_of_installments"] !== 'select' ? $this->settings["number_of_installments"] : null;
     117        if ($card_country === "BR") {
     118            $show_installments = isset($this->settings["enable_installments"]) && $this->settings["enable_installments"] === "yes" ? 'true' : 'false';
     119            $number_of_installments = isset($this->settings["number_of_installments"]) && $this->settings["number_of_installments"] !== false && $this->settings["number_of_installments"] !== 'select' ? $this->settings["number_of_installments"] : null;
    120120        }
    121121
     
    141141        wp_localize_script('wc-sumup-blocks-integration', 'sumup_gateway_params', array(
    142142
    143             'showInstallments' => "$show_installments",
     143            'showInstallments' => $show_installments,
    144144            'sumup_handler_url' => add_query_arg(
    145145                array(
     
    150150            ),
    151151            'showZipCode' => "$show_zipcode",
    152             'maxInstallments' => $number_of_installments,
     152            'maxInstallments' => isset($number_of_installments) ? $number_of_installments : 0,
    153153            'locale' => "$card_locale",
    154154            'country' => '',
     
    159159                'payment_error' => ""
    160160            ),
    161             'enablePix' => $this->settings["enable_pix"],
    162             'openPaymentInModal' => $this->settings['open_payment_modal'],
     161            'enablePix' => isset($this->settings["enable_pix"]) ? $this->settings["enable_pix"] : 'no',
     162            'openPaymentInModal' => isset($this->settings["open_payment_modal"]) ? $this->settings['open_payment_modal'] : 'no',
    163163            'redirectUrl' => '',
    164164        ));
  • sumup-payment-gateway-for-woocommerce/tags/2.5.4/includes/class-wc-sumup-gateway.php

    r3093472 r3094827  
    741741        $error_invalid_form = __( 'Fill in all required details.', 'sumup-payment-gateway-for-woocommerce' );
    742742
    743         $installments = false;
     743        $installments = "false";
    744744        $number_of_installments = null;
    745745        if ( $card_country === 'BR' ) {
    746             $installments = $this->installments_enabled === 'yes' ? true : $installments;
     746            $installments = $this->installments_enabled === 'yes' ? "true" : $installments;
    747747            $number_of_installments = $this->number_of_installments !== false && $this->number_of_installments !== 'select' ? $this->number_of_installments : $number_of_installments;
    748748        }
  • sumup-payment-gateway-for-woocommerce/tags/2.5.4/readme.txt

    r3093472 r3094827  
    9797== Changelog ==
    9898
     99=2.5.4=
     100* Fixed: Warning PHP message.
     101* Fixed: Message diff currency appearing before update.
     102
    99103=2.5.3=
    100104* Improvements: Added support for WooCommerce checkout blocks.
     
    169173== Upgrade Notice ==
    170174
    171 =2.5.3=
    172 * Improvements: Added support for WooCommerce checkout blocks.
    173 * Fixed: Warning message when there is a currency mismatch between WooCommerce and the SumUp account.
    174 * Fixed: Pix payment appearing even when disabled in the plugin settings.
     175=2.5.4=
     176* Fixed: Warning PHP message.
     177* Fixed: Message diff currency appearing before update.
  • sumup-payment-gateway-for-woocommerce/tags/2.5.4/sumup-payment-gateway-for-woocommerce.php

    r3093472 r3094827  
    66 * Author: SumUp
    77 * Author URI: https://sumup.com
    8  * Version: 2.5.3
     8 * Version: 2.5.4
    99 * Requires at least: 5.0
    1010 * Requires PHP: 7.2
     
    2020define( 'WC_SUMUP_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
    2121define( 'WC_SUMUP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    22 define( 'WC_SUMUP_VERSION', '2.5.3' );
     22define( 'WC_SUMUP_VERSION', '2.5.4' );
    2323define( 'WC_SUMUP_MINIMUM_PHP_VERSION', '7.2' );
    2424define( 'WC_SUMUP_MINIMUM_WP_VERSION', '5.0' );
     
    9696     */
    9797    function plugin_not_configured_notice() {
     98        add_option('sumup_valid_currency',true);
    9899        $plugin_options          = get_option( 'woocommerce_sumup_settings' );
    99100        $plugin_enabled          = isset( $plugin_options['enabled'] ) && 'yes' === $plugin_options['enabled'];
  • sumup-payment-gateway-for-woocommerce/trunk/assets/js/sumup-gateway.min.js

    r3093472 r3094827  
    1 function initSumUpGateway(){const e={checkoutId:sumup_gateway_params.checkoutId,onResponse:onSumupResponse,showZipCode:"true"===sumup_gateway_params.showZipCode,locale:sumup_gateway_params.locale,showFooter:!1,showInstallments:sumup_gateway_params.showInstallments,maxInstallments:sumup_gateway_params.maxInstallments,onPaymentMethodsLoad:sumUpFilterPaymentMethods,onLoad:sumUpOnLoad};sumup_gateway_params.country&&(e.country=sumup_gateway_params.country),SumUpCard.mount(e);const t=document.getElementById("wc-sumup-payment-modal");if(!0!==t.dataset.sumupListener){t.addEventListener("click",function(){t.classList.contains("no-modal")||(t.classList.toggle("disabled"),t.dataset.sumupListener=!0)});let e=document.getElementById("sumup-card");e&&!0!==e.dataset.sumupListener&&e.addEventListener("click",function(t){t.stopPropagation(),e.dataset.sumupListener=!0});let a=document.getElementById("wc-sumup-payment-modal-close");a&&!0!==a.dataset.sumupListener&&a.addEventListener("click",function(e){a.dataset.sumupListener=!0,t.classList.toggle("disabled")})}}function onSumupResponse(e,t){switch(e){case"sent":break;case"invalid":console.error("Error: ",t);break;case"auth-screen":break;case"error":console.error("Error",t),displayError(t.message||sumup_gateway_params.errors.general_error);break;case"success":if("FAILED"===t.status){displayError(t.message||sumup_gateway_params.errors.general_error);break}"PENDING"===t.status&&("boleto"===sumup_gateway_params.paymentMethod&&(setTimeout(function(){const e=document.querySelector('form[data-testid="boleto-download"]'),t=document.querySelector('div[data-testid="pending_screen_content_to_copy"] h4');e&&t&&(sumup_gateway_params.boletoDownloadLink=e.action,sumup_gateway_params.boletoCodeToPay=t.innerText)},50),setTimeout(function(){onSubmitSumup()},100)),"pix"!==sumup_gateway_params.paymentMethod&&"qr_code_pix"!==sumup_gateway_params.paymentMethod||(setTimeout(function(){const e=document.querySelector('textarea[data-testid="pending_screen_content_to_reveal_value"]'),t=document.querySelector('div[data-testid="scannable-barcode"] > img');e&&(sumup_gateway_params.pixCode=e.value,sumup_gateway_params.qrCodeImage=t.src)},50),setTimeout(function(){onSubmitSumup()},100))),"PAID"===t.status&&void 0!==t.transaction_code&&onSubmitSumup()}}function addMessageToPendingScreenBoleto(e){const t=document.querySelector('div[data-testid="pending-screen"]');if(t){let a=document.createElement("div");a.classList.add("sumup-boleto-pending-screen"),a.innerText=e,t.append(a)}}function sumUpFilterPaymentMethods(e){if("yes"!==sumup_gateway_params.enablePix&&"BR"===sumup_gateway_params.country&&e.eligible&&e.eligible.length>0){const t=[];return e.eligible.forEach(e=>{"pix"!==e.id&&"qr_code_pix"!==e.id&&t.push(e.id)}),t}}function sumUpOnLoad(){const e=document.querySelector("#sumup-card form");e&&!0!==e.dataset.sumupListener&&(e.dataset.sumupListener=!0,e.addEventListener("submit",function(t){let a=e.querySelector('input[name="payment_type"]');a&&(sumup_gateway_params.paymentMethod=a.value)})),window.dispatchEvent(new Event("woo_sumup_loaded"))}function onSubmitSumup(){const e=sumup_gateway_params.redirectUrl;if(null!==e.match(/^(https|http):\/\//)){const t=[];"boleto"===sumup_gateway_params.paymentMethod&&(t.push("boleto-code="+encodeURIComponent(sumup_gateway_params.boletoCodeToPay)),t.push("boleto-link="+encodeURIComponent(sumup_gateway_params.boletoDownloadLink))),"pix"!==sumup_gateway_params.paymentMethod&&"qr_code_pix"!==sumup_gateway_params.paymentMethod||(t.push("pix-code="+encodeURIComponent(sumup_gateway_params.pixCode)),t.push("pix-image="+sumup_gateway_params.qrCodeImage)),window.location=t.length>0?e+"&"+t.join("&"):e}}function showSumupPayment(){if(!isSumUpGatewaySelected())return!0;if("paid"===sumup_gateway_params.status)return!0;const e=document.getElementById("wc-sumup-payment-modal");return e&&e.classList.remove("disabled"),!1}function displayError(e){const t=document.querySelector("form.checkout"),a=document.querySelector(".woocommerce-NoticeGroup.woocommerce-NoticeGroup-checkout.woocommerce-error");a&&a.remove();let o=document.createElement("div");o.classList.add("woocommerce-NoticeGroup","woocommerce-NoticeGroup-checkout","woocommerce-error"),o.innerText=e,t.prepend(o),window.scrollTo({top:0,behavior:"smooth"})}function isSumUpGatewaySelected(){const e=document.getElementById("payment_method_sumup");if(e)return e.checked}jQuery(function(e){e(document.body).on("sumupCardInit",initSumUpGateway),e("form#order_review #place_order").on("click",showSumupPayment)});
     1function initSumUpGateway(){const e={checkoutId:sumup_gateway_params.checkoutId,onResponse:onSumupResponse,showZipCode:"true"===sumup_gateway_params.showZipCode,locale:sumup_gateway_params.locale,showFooter:!1,showInstallments:"true"===sumup_gateway_params.showInstallments,maxInstallments:sumup_gateway_params.maxInstallments,onPaymentMethodsLoad:sumUpFilterPaymentMethods,onLoad:sumUpOnLoad};sumup_gateway_params.country&&(e.country=sumup_gateway_params.country),SumUpCard.mount(e);const t=document.getElementById("wc-sumup-payment-modal");if(!0!==t.dataset.sumupListener){t.addEventListener("click",function(){t.classList.contains("no-modal")||(t.classList.toggle("disabled"),t.dataset.sumupListener=!0)});let e=document.getElementById("sumup-card");e&&!0!==e.dataset.sumupListener&&e.addEventListener("click",function(t){t.stopPropagation(),e.dataset.sumupListener=!0});let a=document.getElementById("wc-sumup-payment-modal-close");a&&!0!==a.dataset.sumupListener&&a.addEventListener("click",function(e){a.dataset.sumupListener=!0,t.classList.toggle("disabled")})}}function onSumupResponse(e,t){switch(e){case"sent":break;case"invalid":console.error("Error: ",t);break;case"auth-screen":break;case"error":console.error("Error",t),displayError(t.message||sumup_gateway_params.errors.general_error);break;case"success":if("FAILED"===t.status){displayError(t.message||sumup_gateway_params.errors.general_error);break}"PENDING"===t.status&&("boleto"===sumup_gateway_params.paymentMethod&&(setTimeout(function(){const e=document.querySelector('form[data-testid="boleto-download"]'),t=document.querySelector('div[data-testid="pending_screen_content_to_copy"] h4');e&&t&&(sumup_gateway_params.boletoDownloadLink=e.action,sumup_gateway_params.boletoCodeToPay=t.innerText)},50),setTimeout(function(){onSubmitSumup()},100)),"pix"!==sumup_gateway_params.paymentMethod&&"qr_code_pix"!==sumup_gateway_params.paymentMethod||(setTimeout(function(){const e=document.querySelector('textarea[data-testid="pending_screen_content_to_reveal_value"]'),t=document.querySelector('div[data-testid="scannable-barcode"] > img');e&&(sumup_gateway_params.pixCode=e.value,sumup_gateway_params.qrCodeImage=t.src)},50),setTimeout(function(){onSubmitSumup()},100))),"PAID"===t.status&&void 0!==t.transaction_code&&onSubmitSumup()}}function addMessageToPendingScreenBoleto(e){const t=document.querySelector('div[data-testid="pending-screen"]');if(t){let a=document.createElement("div");a.classList.add("sumup-boleto-pending-screen"),a.innerText=e,t.append(a)}}function sumUpFilterPaymentMethods(e){if(("yes"!==sumup_gateway_params.enablePix||"BR"!==sumup_gateway_params.country)&&e.eligible&&e.eligible.length>0){const t=[];return e.eligible.forEach(e=>{"pix"!==e.id&&"qr_code_pix"!==e.id&&t.push(e.id)}),t}}function sumUpOnLoad(){const e=document.querySelector("#sumup-card form");e&&!0!==e.dataset.sumupListener&&(e.dataset.sumupListener=!0,e.addEventListener("submit",function(t){let a=e.querySelector('input[name="payment_type"]');a&&(sumup_gateway_params.paymentMethod=a.value)})),window.dispatchEvent(new Event("woo_sumup_loaded"))}function onSubmitSumup(){const e=sumup_gateway_params.redirectUrl;if(null!==e.match(/^(https|http):\/\//)){const t=[];"boleto"===sumup_gateway_params.paymentMethod&&(t.push("boleto-code="+encodeURIComponent(sumup_gateway_params.boletoCodeToPay)),t.push("boleto-link="+encodeURIComponent(sumup_gateway_params.boletoDownloadLink))),"pix"!==sumup_gateway_params.paymentMethod&&"qr_code_pix"!==sumup_gateway_params.paymentMethod||(t.push("pix-code="+encodeURIComponent(sumup_gateway_params.pixCode)),t.push("pix-image="+sumup_gateway_params.qrCodeImage)),window.location=t.length>0?e+"&"+t.join("&"):e}}function showSumupPayment(){if(!isSumUpGatewaySelected())return!0;if("paid"===sumup_gateway_params.status)return!0;const e=document.getElementById("wc-sumup-payment-modal");return e&&e.classList.remove("disabled"),!1}function displayError(e){const t=document.querySelector("form.checkout"),a=document.querySelector(".woocommerce-NoticeGroup.woocommerce-NoticeGroup-checkout.woocommerce-error");a&&a.remove();let o=document.createElement("div");o.classList.add("woocommerce-NoticeGroup","woocommerce-NoticeGroup-checkout","woocommerce-error"),o.innerText=e,t.prepend(o),window.scrollTo({top:0,behavior:"smooth"})}function isSumUpGatewaySelected(){const e=document.getElementById("payment_method_sumup");if(e)return e.checked}jQuery(function(e){e(document.body).on("sumupCardInit",initSumUpGateway),e("form#order_review #place_order").on("click",showSumupPayment)});
  • sumup-payment-gateway-for-woocommerce/trunk/build/index.asset.php

    r3093472 r3094827  
    1 <?php return array('dependencies' => array('react', 'wp-data', 'wp-html-entities', 'wp-i18n', 'wp-notices'), 'version' => '585544cbd3eaa8bf5d37');
     1<?php return array('dependencies' => array('react', 'wp-data', 'wp-html-entities', 'wp-i18n', 'wp-notices'), 'version' => 'cde515e6b6da6b324984');
  • sumup-payment-gateway-for-woocommerce/trunk/build/index.js

    r3093472 r3094827  
    1 (()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{hasBrowserEnv:()=>oe,hasStandardBrowserEnv:()=>se,hasStandardBrowserWebWorkerEnv:()=>ae});const n=window.React,r=window.wp.htmlEntities,o=(window.wp.i18n,({isOpen:e,onClose:t,isModal:r,description:o})=>{const[s,i]=(0,n.useState)("");return(0,n.useEffect)((()=>{i(e?r?"wc-sumup-modal":"wc-sumup-modal no-modal":"wc-sumup-modal disabled")}),[s,e,r]),(0,n.createElement)("div",null,(0,n.createElement)("p",null,o),(0,n.createElement)("div",{id:"wc-sumup-payment-modal",className:s},(0,n.createElement)("div",{id:"sumup-card"},(0,n.createElement)("div",{id:"wc-sumup-payment-modal-close"},(0,n.createElement)("span",{id:"wc-sumup-payment-modal-close-btn",onClick:t},"X")))))});function s(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,c=(u=Object.create(null),e=>{const t=i.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const l=e=>(e=e.toLowerCase(),t=>c(t)===e),d=e=>t=>typeof t===e,{isArray:f}=Array,p=d("undefined"),h=l("ArrayBuffer"),m=d("string"),y=d("function"),g=d("number"),w=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==c(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},E=l("Date"),S=l("File"),O=l("Blob"),R=l("FileList"),_=l("URLSearchParams");function T(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),f(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function v(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,C=e=>!p(e)&&e!==A,x=(P="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>P&&e instanceof P);var P;const j=l("HTMLFormElement"),N=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),k=l("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};T(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)},U="abcdefghijklmnopqrstuvwxyz",B="0123456789",L={DIGIT:B,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+B},D=l("AsyncFunction"),I={isArray:f,isArrayBuffer:h,isBuffer:function(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||y(e.append)&&("formdata"===(t=c(e))||"object"===t&&y(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer),t},isString:m,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:b,isUndefined:p,isDate:E,isFile:S,isBlob:O,isRegExp:k,isFunction:y,isStream:e=>w(e)&&y(e.pipe),isURLSearchParams:_,isTypedArray:x,isFileList:R,forEach:T,merge:function e(){const{caseless:t}=C(this)&&this||{},n={},r=(r,o)=>{const s=t&&v(n,o)||o;b(n[s])&&b(r)?n[s]=e(n[s],r):b(r)?n[s]=e({},r):f(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&T(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(T(t,((t,r)=>{n&&y(t)?e[r]=s(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||c[i]||(t[i]=e[i],c[i]=!0);e=!1!==n&&a(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(f(e))return e;let t=e.length;if(!g(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:j,hasOwnProperty:N,hasOwnProp:N,reduceDescriptors:F,freezeMethods:e=>{F(e,((t,n)=>{if(y(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];y(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return f(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:v,global:A,isContextDefined:C,ALPHABET:L,generateString:(e=16,t=L.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=f(e)?[]:{};return T(e,((e,t)=>{const s=n(e,r+1);!p(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:D,isThenable:e=>e&&(w(e)||y(e))&&y(e.then)&&y(e.catch)};function q(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}I.inherits(q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const M=q.prototype,z={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{z[e]={value:e}})),Object.defineProperties(q,z),Object.defineProperty(M,"isAxiosError",{value:!0}),q.from=(e,t,n,r,o,s)=>{const i=Object.create(M);return I.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),q.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const H=q;function J(e){return I.isPlainObject(e)||I.isArray(e)}function K(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function W(e,t,n){return e?e.concat(t).map((function(e,t){return e=K(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const V=I.toFlatObject(I,{},null,(function(e){return/^is[A-Z]/.test(e)})),G=function(e,t,n){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=I.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!I.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(I.isDate(e))return e.toISOString();if(!a&&I.isBlob(e))throw new H("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(e)||I.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(I.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(I.isArray(e)&&function(e){return I.isArray(e)&&!e.some(J)}(e)||(I.isFileList(e)||I.endsWith(n,"[]"))&&(a=I.toArray(e)))return n=K(n),a.forEach((function(e,r){!I.isUndefined(e)&&null!==e&&t.append(!0===i?W([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!J(e)||(t.append(W(o,n,s),c(e)),!1)}const l=[],d=Object.assign(V,{defaultVisitor:u,convertValue:c,isVisitable:J});if(!I.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!I.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),I.forEach(n,(function(n,s){!0===(!(I.isUndefined(n)||null===n)&&o.call(t,n,I.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t};function $(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function X(e,t){this._pairs=[],e&&G(e,this,t)}const Z=X.prototype;Z.append=function(e,t){this._pairs.push([e,t])},Z.toString=function(e){const t=e?function(t){return e.call(this,t,$)}:$;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Q=X;function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ee(e,t,n){if(!t)return e;const r=n&&n.encode||Y,o=n&&n.serialize;let s;if(s=o?o(t,n):I.isURLSearchParams(t)?t.toString():new Q(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const te=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){I.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},re={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Q,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},oe="undefined"!=typeof window&&"undefined"!=typeof document,se=(ie="undefined"!=typeof navigator&&navigator.product,oe&&["ReactNative","NativeScript","NS"].indexOf(ie)<0);var ie;const ae="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ce={...t,...re},ue=function(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&I.isArray(r)?r.length:s,a?(I.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i):(r[s]&&I.isObject(r[s])||(r[s]=[]),t(e,n,r[s],o)&&I.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i)}if(I.isFormData(e)&&I.isFunction(e.entries)){const n={};return I.forEachEntry(e,((e,r)=>{t(function(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},le={transitional:ne,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=I.isObject(e);if(o&&I.isHTMLForm(e)&&(e=new FormData(e)),I.isFormData(e))return r?JSON.stringify(ue(e)):e;if(I.isArrayBuffer(e)||I.isBuffer(e)||I.isStream(e)||I.isFile(e)||I.isBlob(e))return e;if(I.isArrayBufferView(e))return e.buffer;if(I.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return G(e,new ce.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ce.isNode&&I.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=I.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return G(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(I.isString(e))try{return(0,JSON.parse)(e),I.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||le.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&I.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw H.from(e,H.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ce.classes.FormData,Blob:ce.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],(e=>{le.headers[e]={}}));const de=le,fe=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pe=Symbol("internals");function he(e){return e&&String(e).trim().toLowerCase()}function me(e){return!1===e||null==e?e:I.isArray(e)?e.map(me):String(e)}function ye(e,t,n,r,o){return I.isFunction(r)?r.call(this,t,n):(o&&(t=n),I.isString(t)?I.isString(r)?-1!==t.indexOf(r):I.isRegExp(r)?r.test(t):void 0:void 0)}class ge{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=he(t);if(!o)throw new Error("header name must be a non-empty string");const s=I.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=me(e))}const s=(e,t)=>I.forEach(e,((e,n)=>o(e,n,t)));return I.isPlainObject(e)||e instanceof this.constructor?s(e,t):I.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&fe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=he(e)){const n=I.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(I.isFunction(t))return t.call(this,e,n);if(I.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=he(e)){const n=I.findKey(this,e);return!(!n||void 0===this[n]||t&&!ye(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=he(e)){const o=I.findKey(n,e);!o||t&&!ye(0,n[o],o,t)||(delete n[o],r=!0)}}return I.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ye(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return I.forEach(this,((r,o)=>{const s=I.findKey(n,o);if(s)return t[s]=me(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=me(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return I.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&I.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[pe]=this[pe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=he(e);t[r]||(function(e,t){const n=I.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return I.isArray(e)?e.forEach(r):r(e),this}}ge.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.reduceDescriptors(ge.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),I.freezeMethods(ge);const we=ge;function be(e,t){const n=this||de,r=t||n,o=we.from(r.headers);let s=r.data;return I.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function Ee(e){return!(!e||!e.__CANCEL__)}function Se(e,t,n){H.call(this,null==e?"canceled":e,H.ERR_CANCELED,t,n),this.name="CanceledError"}I.inherits(Se,H,{__CANCEL__:!0});const Oe=Se,Re=ce.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];I.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),I.isString(r)&&i.push("path="+r),I.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function _e(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Te=ce.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=I.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ve(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,d=0;for(;l!==s;)d+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-n,c=r(a);n=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const Ae={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=we.from(e.headers).normalize();let s,i,{responseType:a,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(I.isFormData(r))if(ce.hasStandardBrowserEnv||ce.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(i=o.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const d=_e(e.baseURL,e.url);function f(){if(!l)return;const r=we.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new H("Request failed with status code "+n.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),u()}),(function(e){n(e),u()}),{data:a&&"text"!==a&&"json"!==a?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),ee(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=f:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(f)},l.onabort=function(){l&&(n(new H("Request aborted",H.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new H("Network Error",H.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||ne;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new H(t,r.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,l)),l=null},ce.hasStandardBrowserEnv&&(c&&I.isFunction(c)&&(c=c(e)),c||!1!==c&&Te(d))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&Re.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in l&&I.forEach(o.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),I.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&"json"!==a&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ve(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ve(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{l&&(n(!t||t.type?new Oe(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);p&&-1===ce.protocols.indexOf(p)?n(new H("Unsupported protocol "+p+":",H.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};I.forEach(Ae,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ce=e=>`- ${e}`,xe=e=>I.isFunction(e)||null===e||!1===e,Pe=e=>{e=I.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!xe(n)&&(r=Ae[(t=String(n)).toLowerCase()],void 0===r))throw new H(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(Ce).join("\n"):" "+Ce(e[0]):"as no adapter specified";throw new H("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function je(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Oe(null,e)}function Ne(e){return je(e),e.headers=we.from(e.headers),e.data=be.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Pe(e.adapter||de.adapter)(e).then((function(t){return je(e),t.data=be.call(e,e.transformResponse,t),t.headers=we.from(t.headers),t}),(function(t){return Ee(t)||(je(e),t&&t.response&&(t.response.data=be.call(e,e.transformResponse,t.response),t.response.headers=we.from(t.response.headers))),Promise.reject(t)}))}const ke=e=>e instanceof we?{...e}:e;function Fe(e,t){t=t||{};const n={};function r(e,t,n){return I.isPlainObject(e)&&I.isPlainObject(t)?I.merge.call({caseless:n},e,t):I.isPlainObject(t)?I.merge({},t):I.isArray(t)?t.slice():t}function o(e,t,n){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!I.isUndefined(t))return r(void 0,t)}function i(e,t){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(ke(e),ke(t),!0)};return I.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);I.isUndefined(i)&&s!==a||(n[r]=i)})),n}const Ue={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ue[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Be={};Ue.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.8] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new H(r(o," has been removed"+(t?" in "+t:"")),H.ERR_DEPRECATED);return t&&!Be[o]&&(Be[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}};const Le={assertOptions:function(e,t,n){if("object"!=typeof e)throw new H("options must be an object",H.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new H("option "+s+" must be "+n,H.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new H("Unknown option "+s,H.ERR_BAD_OPTION)}},validators:Ue},De=Le.validators;class Ie{constructor(e){this.defaults=e,this.interceptors={request:new te,response:new te}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Fe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Le.assertOptions(n,{silentJSONParsing:De.transitional(De.boolean),forcedJSONParsing:De.transitional(De.boolean),clarifyTimeoutError:De.transitional(De.boolean)},!1),null!=r&&(I.isFunction(r)?t.paramsSerializer={serialize:r}:Le.assertOptions(r,{encode:De.function,serialize:De.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&I.merge(o.common,o[t.method]);o&&I.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=we.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,d=0;if(!a){const e=[Ne.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);d<l;)u=u.then(e[d++],e[d++]);return u}l=i.length;let f=t;for(d=0;d<l;){const e=i[d++],t=i[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=Ne.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(e){return ee(_e((e=Fe(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}I.forEach(["delete","get","head","options"],(function(e){Ie.prototype[e]=function(t,n){return this.request(Fe(n||{},{method:e,url:t,data:(n||{}).data}))}})),I.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Fe(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ie.prototype[e]=t(),Ie.prototype[e+"Form"]=t(!0)}));const qe=Ie;class Me{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new Oe(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Me((function(t){e=t})),cancel:e}}}const ze=Me,He={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(He).forEach((([e,t])=>{He[t]=e}));const Je=He,Ke=function e(t){const n=new qe(t),r=s(qe.prototype.request,n);return I.extend(r,qe.prototype,n,{allOwnKeys:!0}),I.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Fe(t,n))},r}(de);Ke.Axios=qe,Ke.CanceledError=Oe,Ke.CancelToken=ze,Ke.isCancel=Ee,Ke.VERSION="1.6.8",Ke.toFormData=G,Ke.AxiosError=H,Ke.Cancel=Ke.CanceledError,Ke.all=function(e){return Promise.all(e)},Ke.spread=function(e){return function(t){return e.apply(null,t)}},Ke.isAxiosError=function(e){return I.isObject(e)&&!0===e.isAxiosError},Ke.mergeConfig=Fe,Ke.AxiosHeaders=we,Ke.formToJSON=e=>ue(I.isHTMLForm(e)?new FormData(e):e),Ke.getAdapter=Pe,Ke.HttpStatusCode=Je,Ke.default=Ke;const We=Ke,Ve=e=>{if("yes"!==sumup_gateway_params.enablePix&&"BR"===sumup_gateway_params.country&&e.eligible&&e.eligible.length>0){const t=[];return e.eligible.forEach((e=>{"pix"!==e.id&&"qr_code_pix"!==e.id&&t.push(e.id)})),t}},Ge=async(e,t)=>{const n=await(async e=>{try{return await We.post(sumup_gateway_params.sumup_handler_url,{order_id:e,isCheckoutBlocks:!0})}catch(e){return console.log(e.response.data),e.response.data}})(e);if("error"==n.result)return n;const r={checkoutId:n.data.result.checkoutId,onResponse:(e,n)=>((e,t,n)=>{switch(localStorage.setItem("pix-content",""),localStorage.setItem("qrcode",""),localStorage.setItem("paymentMethod",t.payment_method),e){case"sent":break;case"invalid":console.error("Error: ",t);break;case"auth-screen":break;case"error":console.error("Error",t),sumup_gateway_params.errors.payment_error=t.message?t.message:"";case"success":"FAILED"===t.status&&(sumup_gateway_params.errors.payment_error=t.message?t.message:""),"PENDING"===t.status&&("boleto"===t.payment_method&&(setTimeout((function(){const e=document.querySelector('form[data-testid="boleto-download"]'),t=document.querySelector('div[data-testid="pending_screen_content_to_copy"] h4');if(e&&t){sumup_gateway_params.boletoDownloadLink=e.action,sumup_gateway_params.boletoCodeToPay=t.innerText;const n=artefacts.filter((e=>"application/pdf"===e.content_type))[0];n&&localStorage.setItem("boleto-pdf",n.location);const r=artefacts.filter((e=>"text/plain"===e.content_type))[0];r&&localStorage.setItem("boleto-barcode",r.content)}}),50),setTimeout((function(){n()}),100)),"pix"!==t.payment_method&&"qr_code_pix"!==t.payment_method||(setTimeout((function(){const e=document.querySelector('textarea[data-testid="pending_screen_content_to_reveal_value"]'),n=document.querySelector('div[data-testid="scannable-barcode"] > img');e&&(localStorage.setItem("pix-content",t.qr_code_pix.artefacts.filter((e=>e.content))[0].content),localStorage.setItem("qrcode",t.qr_code_pix.artefacts.filter((e=>!e.content))[0].location),sumup_gateway_params.pixCode=e.value,sumup_gateway_params.qrCodeImage=n.src)}),50),setTimeout((function(){n()}),100))),"PAID"===t.status&&void 0!==t.transaction_code&&n()}})(e,n,t),showZipCode:"true"===sumup_gateway_params.showZipCode,locale:sumup_gateway_params.locale,showFooter:!1,showInstallments:sumup_gateway_params.showInstallments,maxInstallments:sumup_gateway_params.maxInstallments,onPaymentMethodsLoad:Ve};await SumUpCard.mount(r)},$e=window.wp.data,{registerPaymentMethod:Xe}=(window.wp.notices,window.wc.wcBlocksRegistry),{getSetting:Ze}=window.wc.wcSettings,{CHECKOUT_STORE_KEY:Qe}=window.wc.wcBlocksData,Ye=Ze("sumup_data",{}),et=(0,$e.select)(Qe),tt=(0,r.decodeEntities)(Ye.title),nt=(0,r.decodeEntities)(Ye.description),rt=({eventRegistration:e,checkoutStatus:t,onSubmit:r,emitResponse:s})=>{const{onCheckoutFail:i,onCheckoutSuccess:a,onPaymentProcessing:c}=e,u=et.getOrderId(),[l,d]=(0,n.useState)(!1),[f]=(0,n.useState)("yes"==sumup_gateway_params.openPaymentInModal),p=()=>{const e=new CustomEvent("resolve-checkout",{detail:{result:{type:"success"}}});document.dispatchEvent(e)};return(0,n.useEffect)((()=>{const e=c((async()=>{const e=await Ge(u,p);return e?{type:s.responseTypes.ERROR,message:e.message}:sumup_gateway_params.payment_error?{type:s.responseTypes.ERROR,message:sumup_gateway_params.payment_error}:{type:s.responseTypes.SUCCESS}}));return()=>{e()}}),[c,s.responseTypes.ERROR,s.responseTypes.SUCCESS]),(0,n.useEffect)((()=>{const e=a((async e=>(console.log(e),d(!0),await new Promise((e=>{document.addEventListener("resolve-checkout",(t=>{e(t.detail.result)}))})))));return()=>{e()}}),[a]),(0,n.useEffect)((()=>{i((()=>{const e=setInterval((()=>{const t=document.querySelector(".wc-block-components-notices");t&&(t.style.display="none",clearInterval(e),window.scrollTo(0,window.scrollY))}),10)}))}),[i,s.responseTypes.ERROR]),(0,n.createElement)(o,{isOpen:l,onClose:()=>{d(!1);const e=new CustomEvent("resolve-checkout",{detail:{result:{type:"error"}}});document.dispatchEvent(e)},isModal:f,description:nt})};Xe({name:"sumup",label:(0,n.createElement)((e=>{const{PaymentMethodLabel:t}=e.components;return(0,n.createElement)(t,{text:tt})}),null),content:(0,n.createElement)(rt,null),edit:(0,n.createElement)(rt,null),canMakePayment:()=>!0,ariaLabel:tt,supports:{features:Ye.supports}})})();
     1(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{hasBrowserEnv:()=>oe,hasStandardBrowserEnv:()=>se,hasStandardBrowserWebWorkerEnv:()=>ae});const n=window.React,r=window.wp.htmlEntities,o=(window.wp.i18n,({isOpen:e,onClose:t,isModal:r,description:o})=>{const[s,i]=(0,n.useState)("");return(0,n.useEffect)((()=>{i(e?r?"wc-sumup-modal":"wc-sumup-modal no-modal":"wc-sumup-modal disabled")}),[s,e,r]),(0,n.createElement)("div",null,(0,n.createElement)("p",null,o),(0,n.createElement)("div",{id:"wc-sumup-payment-modal",className:s},(0,n.createElement)("div",{id:"sumup-card"},(0,n.createElement)("div",{id:"wc-sumup-payment-modal-close"},(0,n.createElement)("span",{id:"wc-sumup-payment-modal-close-btn",onClick:t},"X")))))});function s(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,c=(u=Object.create(null),e=>{const t=i.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const l=e=>(e=e.toLowerCase(),t=>c(t)===e),d=e=>t=>typeof t===e,{isArray:f}=Array,p=d("undefined"),h=l("ArrayBuffer"),m=d("string"),y=d("function"),g=d("number"),w=e=>null!==e&&"object"==typeof e,b=e=>{if("object"!==c(e))return!1;const t=a(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},E=l("Date"),S=l("File"),O=l("Blob"),R=l("FileList"),_=l("URLSearchParams");function T(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),f(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function v(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,C=e=>!p(e)&&e!==A,x=(P="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>P&&e instanceof P);var P;const j=l("HTMLFormElement"),N=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),k=l("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};T(n,((n,o)=>{let s;!1!==(s=t(n,o,e))&&(r[o]=s||n)})),Object.defineProperties(e,r)},U="abcdefghijklmnopqrstuvwxyz",B="0123456789",L={DIGIT:B,ALPHA:U,ALPHA_DIGIT:U+U.toUpperCase()+B},D=l("AsyncFunction"),I={isArray:f,isArrayBuffer:h,isBuffer:function(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&y(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||y(e.append)&&("formdata"===(t=c(e))||"object"===t&&y(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&h(e.buffer),t},isString:m,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:b,isUndefined:p,isDate:E,isFile:S,isBlob:O,isRegExp:k,isFunction:y,isStream:e=>w(e)&&y(e.pipe),isURLSearchParams:_,isTypedArray:x,isFileList:R,forEach:T,merge:function e(){const{caseless:t}=C(this)&&this||{},n={},r=(r,o)=>{const s=t&&v(n,o)||o;b(n[s])&&b(r)?n[s]=e(n[s],r):b(r)?n[s]=e({},r):f(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&T(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(T(t,((t,r)=>{n&&y(t)?e[r]=s(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||c[i]||(t[i]=e[i],c[i]=!0);e=!1!==n&&a(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(f(e))return e;let t=e.length;if(!g(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:j,hasOwnProperty:N,hasOwnProp:N,reduceDescriptors:F,freezeMethods:e=>{F(e,((t,n)=>{if(y(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];y(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return f(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:v,global:A,isContextDefined:C,ALPHABET:L,generateString:(e=16,t=L.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&y(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=f(e)?[]:{};return T(e,((e,t)=>{const s=n(e,r+1);!p(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:D,isThenable:e=>e&&(w(e)||y(e))&&y(e.then)&&y(e.catch)};function q(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}I.inherits(q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const M=q.prototype,z={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{z[e]={value:e}})),Object.defineProperties(q,z),Object.defineProperty(M,"isAxiosError",{value:!0}),q.from=(e,t,n,r,o,s)=>{const i=Object.create(M);return I.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),q.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const H=q;function J(e){return I.isPlainObject(e)||I.isArray(e)}function K(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function W(e,t,n){return e?e.concat(t).map((function(e,t){return e=K(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const V=I.toFlatObject(I,{},null,(function(e){return/^is[A-Z]/.test(e)})),G=function(e,t,n){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=I.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!I.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(I.isDate(e))return e.toISOString();if(!a&&I.isBlob(e))throw new H("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(e)||I.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(I.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(I.isArray(e)&&function(e){return I.isArray(e)&&!e.some(J)}(e)||(I.isFileList(e)||I.endsWith(n,"[]"))&&(a=I.toArray(e)))return n=K(n),a.forEach((function(e,r){!I.isUndefined(e)&&null!==e&&t.append(!0===i?W([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!J(e)||(t.append(W(o,n,s),c(e)),!1)}const l=[],d=Object.assign(V,{defaultVisitor:u,convertValue:c,isVisitable:J});if(!I.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!I.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),I.forEach(n,(function(n,s){!0===(!(I.isUndefined(n)||null===n)&&o.call(t,n,I.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t};function $(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function X(e,t){this._pairs=[],e&&G(e,this,t)}const Z=X.prototype;Z.append=function(e,t){this._pairs.push([e,t])},Z.toString=function(e){const t=e?function(t){return e.call(this,t,$)}:$;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const Q=X;function Y(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ee(e,t,n){if(!t)return e;const r=n&&n.encode||Y,o=n&&n.serialize;let s;if(s=o?o(t,n):I.isURLSearchParams(t)?t.toString():new Q(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const te=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){I.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},re={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Q,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},oe="undefined"!=typeof window&&"undefined"!=typeof document,se=(ie="undefined"!=typeof navigator&&navigator.product,oe&&["ReactNative","NativeScript","NS"].indexOf(ie)<0);var ie;const ae="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ce={...t,...re},ue=function(e){function t(e,n,r,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&I.isArray(r)?r.length:s,a?(I.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i):(r[s]&&I.isObject(r[s])||(r[s]=[]),t(e,n,r[s],o)&&I.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i)}if(I.isFormData(e)&&I.isFunction(e.entries)){const n={};return I.forEachEntry(e,((e,r)=>{t(function(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},le={transitional:ne,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=I.isObject(e);if(o&&I.isHTMLForm(e)&&(e=new FormData(e)),I.isFormData(e))return r?JSON.stringify(ue(e)):e;if(I.isArrayBuffer(e)||I.isBuffer(e)||I.isStream(e)||I.isFile(e)||I.isBlob(e))return e;if(I.isArrayBufferView(e))return e.buffer;if(I.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return G(e,new ce.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ce.isNode&&I.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=I.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return G(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(I.isString(e))try{return(0,JSON.parse)(e),I.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||le.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&I.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw H.from(e,H.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ce.classes.FormData,Blob:ce.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],(e=>{le.headers[e]={}}));const de=le,fe=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),pe=Symbol("internals");function he(e){return e&&String(e).trim().toLowerCase()}function me(e){return!1===e||null==e?e:I.isArray(e)?e.map(me):String(e)}function ye(e,t,n,r,o){return I.isFunction(r)?r.call(this,t,n):(o&&(t=n),I.isString(t)?I.isString(r)?-1!==t.indexOf(r):I.isRegExp(r)?r.test(t):void 0:void 0)}class ge{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=he(t);if(!o)throw new Error("header name must be a non-empty string");const s=I.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=me(e))}const s=(e,t)=>I.forEach(e,((e,n)=>o(e,n,t)));return I.isPlainObject(e)||e instanceof this.constructor?s(e,t):I.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&fe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=he(e)){const n=I.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(I.isFunction(t))return t.call(this,e,n);if(I.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=he(e)){const n=I.findKey(this,e);return!(!n||void 0===this[n]||t&&!ye(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=he(e)){const o=I.findKey(n,e);!o||t&&!ye(0,n[o],o,t)||(delete n[o],r=!0)}}return I.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!ye(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return I.forEach(this,((r,o)=>{const s=I.findKey(n,o);if(s)return t[s]=me(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=me(r),n[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return I.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&I.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[pe]=this[pe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=he(e);t[r]||(function(e,t){const n=I.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return I.isArray(e)?e.forEach(r):r(e),this}}ge.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.reduceDescriptors(ge.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),I.freezeMethods(ge);const we=ge;function be(e,t){const n=this||de,r=t||n,o=we.from(r.headers);let s=r.data;return I.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function Ee(e){return!(!e||!e.__CANCEL__)}function Se(e,t,n){H.call(this,null==e?"canceled":e,H.ERR_CANCELED,t,n),this.name="CanceledError"}I.inherits(Se,H,{__CANCEL__:!0});const Oe=Se,Re=ce.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];I.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),I.isString(r)&&i.push("path="+r),I.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function _e(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Te=ce.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=I.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ve(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,d=0;for(;l!==s;)d+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-n,c=r(a);n=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const Ae={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=we.from(e.headers).normalize();let s,i,{responseType:a,withXSRFToken:c}=e;function u(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(I.isFormData(r))if(ce.hasStandardBrowserEnv||ce.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(i=o.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const d=_e(e.baseURL,e.url);function f(){if(!l)return;const r=we.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new H("Request failed with status code "+n.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),u()}),(function(e){n(e),u()}),{data:a&&"text"!==a&&"json"!==a?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),ee(d,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=f:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(f)},l.onabort=function(){l&&(n(new H("Request aborted",H.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new H("Network Error",H.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||ne;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new H(t,r.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,e,l)),l=null},ce.hasStandardBrowserEnv&&(c&&I.isFunction(c)&&(c=c(e)),c||!1!==c&&Te(d))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&Re.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===r&&o.setContentType(null),"setRequestHeader"in l&&I.forEach(o.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),I.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),a&&"json"!==a&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ve(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ve(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{l&&(n(!t||t.type?new Oe(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(d);p&&-1===ce.protocols.indexOf(p)?n(new H("Unsupported protocol "+p+":",H.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};I.forEach(Ae,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ce=e=>`- ${e}`,xe=e=>I.isFunction(e)||null===e||!1===e,Pe=e=>{e=I.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!xe(n)&&(r=Ae[(t=String(n)).toLowerCase()],void 0===r))throw new H(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+s]=r}if(!r){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(Ce).join("\n"):" "+Ce(e[0]):"as no adapter specified";throw new H("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function je(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Oe(null,e)}function Ne(e){return je(e),e.headers=we.from(e.headers),e.data=be.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Pe(e.adapter||de.adapter)(e).then((function(t){return je(e),t.data=be.call(e,e.transformResponse,t),t.headers=we.from(t.headers),t}),(function(t){return Ee(t)||(je(e),t&&t.response&&(t.response.data=be.call(e,e.transformResponse,t.response),t.response.headers=we.from(t.response.headers))),Promise.reject(t)}))}const ke=e=>e instanceof we?{...e}:e;function Fe(e,t){t=t||{};const n={};function r(e,t,n){return I.isPlainObject(e)&&I.isPlainObject(t)?I.merge.call({caseless:n},e,t):I.isPlainObject(t)?I.merge({},t):I.isArray(t)?t.slice():t}function o(e,t,n){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!I.isUndefined(t))return r(void 0,t)}function i(e,t){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(ke(e),ke(t),!0)};return I.forEach(Object.keys(Object.assign({},e,t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);I.isUndefined(i)&&s!==a||(n[r]=i)})),n}const Ue={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ue[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Be={};Ue.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.8] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new H(r(o," has been removed"+(t?" in "+t:"")),H.ERR_DEPRECATED);return t&&!Be[o]&&(Be[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}};const Le={assertOptions:function(e,t,n){if("object"!=typeof e)throw new H("options must be an object",H.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new H("option "+s+" must be "+n,H.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new H("Unknown option "+s,H.ERR_BAD_OPTION)}},validators:Ue},De=Le.validators;class Ie{constructor(e){this.defaults=e,this.interceptors={request:new te,response:new te}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Fe(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&Le.assertOptions(n,{silentJSONParsing:De.transitional(De.boolean),forcedJSONParsing:De.transitional(De.boolean),clarifyTimeoutError:De.transitional(De.boolean)},!1),null!=r&&(I.isFunction(r)?t.paramsSerializer={serialize:r}:Le.assertOptions(r,{encode:De.function,serialize:De.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&I.merge(o.common,o[t.method]);o&&I.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=we.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,d=0;if(!a){const e=[Ne.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);d<l;)u=u.then(e[d++],e[d++]);return u}l=i.length;let f=t;for(d=0;d<l;){const e=i[d++],t=i[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=Ne.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(e){return ee(_e((e=Fe(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}I.forEach(["delete","get","head","options"],(function(e){Ie.prototype[e]=function(t,n){return this.request(Fe(n||{},{method:e,url:t,data:(n||{}).data}))}})),I.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Fe(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ie.prototype[e]=t(),Ie.prototype[e+"Form"]=t(!0)}));const qe=Ie;class Me{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new Oe(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Me((function(t){e=t})),cancel:e}}}const ze=Me,He={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(He).forEach((([e,t])=>{He[t]=e}));const Je=He,Ke=function e(t){const n=new qe(t),r=s(qe.prototype.request,n);return I.extend(r,qe.prototype,n,{allOwnKeys:!0}),I.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Fe(t,n))},r}(de);Ke.Axios=qe,Ke.CanceledError=Oe,Ke.CancelToken=ze,Ke.isCancel=Ee,Ke.VERSION="1.6.8",Ke.toFormData=G,Ke.AxiosError=H,Ke.Cancel=Ke.CanceledError,Ke.all=function(e){return Promise.all(e)},Ke.spread=function(e){return function(t){return e.apply(null,t)}},Ke.isAxiosError=function(e){return I.isObject(e)&&!0===e.isAxiosError},Ke.mergeConfig=Fe,Ke.AxiosHeaders=we,Ke.formToJSON=e=>ue(I.isHTMLForm(e)?new FormData(e):e),Ke.getAdapter=Pe,Ke.HttpStatusCode=Je,Ke.default=Ke;const We=Ke,Ve=e=>{if(("yes"!==sumup_gateway_params.enablePix||"BR"!==sumup_gateway_params.country)&&e.eligible&&e.eligible.length>0){const t=[];return e.eligible.forEach((e=>{"pix"!==e.id&&"qr_code_pix"!==e.id&&t.push(e.id)})),t}},Ge=async(e,t)=>{const n=await(async e=>{try{return await We.post(sumup_gateway_params.sumup_handler_url,{order_id:e,isCheckoutBlocks:!0})}catch(e){return console.log(e.response.data),e.response.data}})(e);if("error"==n.result)return n;sumup_gateway_params.country=n.data.result.country;const r={checkoutId:n.data.result.checkoutId,onResponse:(e,n)=>((e,t,n)=>{switch(localStorage.setItem("pix-content",""),localStorage.setItem("qrcode",""),localStorage.setItem("paymentMethod",t.payment_method),e){case"sent":break;case"invalid":console.error("Error: ",t);break;case"auth-screen":break;case"error":console.error("Error",t),sumup_gateway_params.errors.payment_error=t.message?t.message:"";case"success":"FAILED"===t.status&&(sumup_gateway_params.errors.payment_error=t.message?t.message:""),"PENDING"===t.status&&("boleto"===t.payment_method&&(setTimeout((function(){const e=document.querySelector('form[data-testid="boleto-download"]'),t=document.querySelector('div[data-testid="pending_screen_content_to_copy"] h4');if(e&&t){sumup_gateway_params.boletoDownloadLink=e.action,sumup_gateway_params.boletoCodeToPay=t.innerText;const n=artefacts.filter((e=>"application/pdf"===e.content_type))[0];n&&localStorage.setItem("boleto-pdf",n.location);const r=artefacts.filter((e=>"text/plain"===e.content_type))[0];r&&localStorage.setItem("boleto-barcode",r.content)}}),50),setTimeout((function(){n()}),100)),"pix"!==t.payment_method&&"qr_code_pix"!==t.payment_method||(setTimeout((function(){const e=document.querySelector('textarea[data-testid="pending_screen_content_to_reveal_value"]'),n=document.querySelector('div[data-testid="scannable-barcode"] > img');e&&(localStorage.setItem("pix-content",t.qr_code_pix.artefacts.filter((e=>e.content))[0].content),localStorage.setItem("qrcode",t.qr_code_pix.artefacts.filter((e=>!e.content))[0].location),sumup_gateway_params.pixCode=e.value,sumup_gateway_params.qrCodeImage=n.src)}),50),setTimeout((function(){n()}),100))),"PAID"===t.status&&void 0!==t.transaction_code&&n()}})(e,n,t),showZipCode:"true"===sumup_gateway_params.showZipCode,locale:sumup_gateway_params.locale,showFooter:!1,showInstallments:"true"===sumup_gateway_params.showInstallments,maxInstallments:sumup_gateway_params.maxInstallments,onPaymentMethodsLoad:Ve};await SumUpCard.mount(r)},$e=window.wp.data,{registerPaymentMethod:Xe}=(window.wp.notices,window.wc.wcBlocksRegistry),{getSetting:Ze}=window.wc.wcSettings,{CHECKOUT_STORE_KEY:Qe}=window.wc.wcBlocksData,Ye=Ze("sumup_data",{}),et=(0,$e.select)(Qe),tt=(0,r.decodeEntities)(Ye.title),nt=(0,r.decodeEntities)(Ye.description),rt=({eventRegistration:e,checkoutStatus:t,onSubmit:r,emitResponse:s})=>{const{onCheckoutFail:i,onCheckoutSuccess:a,onPaymentProcessing:c}=e,u=et.getOrderId(),[l,d]=(0,n.useState)(!1),[f]=(0,n.useState)("yes"==sumup_gateway_params.openPaymentInModal),p=()=>{const e=new CustomEvent("resolve-checkout",{detail:{result:{type:"success"}}});document.dispatchEvent(e)};return(0,n.useEffect)((()=>{const e=c((async()=>{const e=await Ge(u,p);return e?{type:s.responseTypes.ERROR,message:e.message}:sumup_gateway_params.payment_error?{type:s.responseTypes.ERROR,message:sumup_gateway_params.payment_error}:{type:s.responseTypes.SUCCESS}}));return()=>{e()}}),[c,s.responseTypes.ERROR,s.responseTypes.SUCCESS]),(0,n.useEffect)((()=>{const e=a((async e=>(console.log(e),d(!0),await new Promise((e=>{document.addEventListener("resolve-checkout",(t=>{e(t.detail.result)}))})))));return()=>{e()}}),[a]),(0,n.useEffect)((()=>{i((()=>{const e=setInterval((()=>{const t=document.querySelector(".wc-block-components-notices");t&&(t.style.display="none",clearInterval(e),window.scrollTo(0,window.scrollY))}),10)}))}),[i,s.responseTypes.ERROR]),(0,n.createElement)(o,{isOpen:l,onClose:()=>{d(!1);const e=new CustomEvent("resolve-checkout",{detail:{result:{type:"error"}}});document.dispatchEvent(e)},isModal:f,description:nt})};Xe({name:"sumup",label:(0,n.createElement)((e=>{const{PaymentMethodLabel:t}=e.components;return(0,n.createElement)(t,{text:tt})}),null),content:(0,n.createElement)(rt,null),edit:(0,n.createElement)(rt,null),canMakePayment:()=>!0,ariaLabel:tt,supports:{features:Ye.supports}})})();
  • sumup-payment-gateway-for-woocommerce/trunk/includes/api/handlers/class-sumup-create-checkout.php

    r3093472 r3094827  
    161161                "amount" => $total,
    162162                "checkoutId" => $sumup_checkout['id'],
    163                 "country" => 'BR'
     163                "country" => $order->get_billing_country()
    164164            );
    165165
  • sumup-payment-gateway-for-woocommerce/trunk/includes/class-wc-sumup-block-gateway.php

    r3093472 r3094827  
    113113         * Translators: the following error messages are shown to the end user
    114114         */
    115         $show_installments = "false";
     115        $show_installments = 'false';
    116116        $number_of_installments = null;
    117         if ($card_country === 'BR') {
    118             $show_installments = $this->settings["installments_enabled"] === 'yes' ? "true" : "false";
    119             $number_of_installments = $this->settings["number_of_installments"] !== false && $this->settings["number_of_installments"] !== 'select' ? $this->settings["number_of_installments"] : null;
     117        if ($card_country === "BR") {
     118            $show_installments = isset($this->settings["enable_installments"]) && $this->settings["enable_installments"] === "yes" ? 'true' : 'false';
     119            $number_of_installments = isset($this->settings["number_of_installments"]) && $this->settings["number_of_installments"] !== false && $this->settings["number_of_installments"] !== 'select' ? $this->settings["number_of_installments"] : null;
    120120        }
    121121
     
    141141        wp_localize_script('wc-sumup-blocks-integration', 'sumup_gateway_params', array(
    142142
    143             'showInstallments' => "$show_installments",
     143            'showInstallments' => $show_installments,
    144144            'sumup_handler_url' => add_query_arg(
    145145                array(
     
    150150            ),
    151151            'showZipCode' => "$show_zipcode",
    152             'maxInstallments' => $number_of_installments,
     152            'maxInstallments' => isset($number_of_installments) ? $number_of_installments : 0,
    153153            'locale' => "$card_locale",
    154154            'country' => '',
     
    159159                'payment_error' => ""
    160160            ),
    161             'enablePix' => $this->settings["enable_pix"],
    162             'openPaymentInModal' => $this->settings['open_payment_modal'],
     161            'enablePix' => isset($this->settings["enable_pix"]) ? $this->settings["enable_pix"] : 'no',
     162            'openPaymentInModal' => isset($this->settings["open_payment_modal"]) ? $this->settings['open_payment_modal'] : 'no',
    163163            'redirectUrl' => '',
    164164        ));
  • sumup-payment-gateway-for-woocommerce/trunk/includes/class-wc-sumup-gateway.php

    r3093472 r3094827  
    741741        $error_invalid_form = __( 'Fill in all required details.', 'sumup-payment-gateway-for-woocommerce' );
    742742
    743         $installments = false;
     743        $installments = "false";
    744744        $number_of_installments = null;
    745745        if ( $card_country === 'BR' ) {
    746             $installments = $this->installments_enabled === 'yes' ? true : $installments;
     746            $installments = $this->installments_enabled === 'yes' ? "true" : $installments;
    747747            $number_of_installments = $this->number_of_installments !== false && $this->number_of_installments !== 'select' ? $this->number_of_installments : $number_of_installments;
    748748        }
  • sumup-payment-gateway-for-woocommerce/trunk/readme.txt

    r3093472 r3094827  
    9797== Changelog ==
    9898
     99=2.5.4=
     100* Fixed: Warning PHP message.
     101* Fixed: Message diff currency appearing before update.
     102
    99103=2.5.3=
    100104* Improvements: Added support for WooCommerce checkout blocks.
     
    169173== Upgrade Notice ==
    170174
    171 =2.5.3=
    172 * Improvements: Added support for WooCommerce checkout blocks.
    173 * Fixed: Warning message when there is a currency mismatch between WooCommerce and the SumUp account.
    174 * Fixed: Pix payment appearing even when disabled in the plugin settings.
     175=2.5.4=
     176* Fixed: Warning PHP message.
     177* Fixed: Message diff currency appearing before update.
  • sumup-payment-gateway-for-woocommerce/trunk/sumup-payment-gateway-for-woocommerce.php

    r3093472 r3094827  
    66 * Author: SumUp
    77 * Author URI: https://sumup.com
    8  * Version: 2.5.3
     8 * Version: 2.5.4
    99 * Requires at least: 5.0
    1010 * Requires PHP: 7.2
     
    2020define( 'WC_SUMUP_PLUGIN_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
    2121define( 'WC_SUMUP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    22 define( 'WC_SUMUP_VERSION', '2.5.3' );
     22define( 'WC_SUMUP_VERSION', '2.5.4' );
    2323define( 'WC_SUMUP_MINIMUM_PHP_VERSION', '7.2' );
    2424define( 'WC_SUMUP_MINIMUM_WP_VERSION', '5.0' );
     
    9696     */
    9797    function plugin_not_configured_notice() {
     98        add_option('sumup_valid_currency',true);
    9899        $plugin_options          = get_option( 'woocommerce_sumup_settings' );
    99100        $plugin_enabled          = isset( $plugin_options['enabled'] ) && 'yes' === $plugin_options['enabled'];
Note: See TracChangeset for help on using the changeset viewer.