(()=>{"use strict";var e={20:(e,t,r)=>{var n=r(609),o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,r){var n,s={},l=null,u=null;for(n in void 0!==r&&(l=""+r),void 0!==t.key&&(l=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,n)&&!c.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:o,type:e,key:l,ref:u,props:s,_owner:a.current}}t.Fragment=s,t.jsx=l,t.jsxs=l},609:e=>{e.exports=window.React},848:(e,t,r)=>{e.exports=r(20)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{hasBrowserEnv:()=>Ee,hasStandardBrowserEnv:()=>Oe,hasStandardBrowserWebWorkerEnv:()=>_e,navigator:()=>Se,origin:()=>ve});const o=window.wc.blocksCheckout,s=window.wp.element,i=window.wp.components,a=window.wp.data,c=window.wc.wcBlocksData,l=window.wp.i18n,u=window.lodash;function d(e,t){return function(){return e.apply(t,arguments)}}const{toString:f}=Object.prototype,{getPrototypeOf:p}=Object,{iterator:h,toStringTag:m}=Symbol,y=(b=Object.create(null),e=>{const t=f.call(e);return b[t]||(b[t]=t.slice(8,-1).toLowerCase())});var b;const g=e=>(e=e.toLowerCase(),t=>y(t)===e),w=e=>t=>typeof t===e,{isArray:E}=Array,S=w("undefined");function O(e){return null!==e&&!S(e)&&null!==e.constructor&&!S(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _=g("ArrayBuffer"),v=w("string"),R=w("function"),x=w("number"),j=e=>null!==e&&"object"==typeof e,T=e=>{if("object"!==y(e))return!1;const t=p(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||m in e||h in e)},N=g("Date"),A=g("File"),D=g("Blob"),C=g("FileList"),k=g("URLSearchParams"),[P,L,U,F]=["ReadableStream","Request","Response","Headers"].map(g);function B(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),E(e))for(n=0,o=e.length;n0;)if(n=r[o],t===n.toLowerCase())return n;return null}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,M=e=>!S(e)&&e!==I,H=(z="undefined"!=typeof Uint8Array&&p(Uint8Array),e=>z&&e instanceof z);var z;const $=g("HTMLFormElement"),J=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),W=g("RegExp"),K=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};B(r,(r,o)=>{let s;!1!==(s=t(r,o,e))&&(n[o]=s||r)}),Object.defineProperties(e,n)},V=g("AsyncFunction"),G=(X="function"==typeof setImmediate,Y=R(I.postMessage),X?setImmediate:Y?(Q=`axios@${Math.random()}`,Z=[],I.addEventListener("message",({source:e,data:t})=>{e===I&&t===Q&&Z.length&&Z.shift()()},!1),e=>{Z.push(e),I.postMessage(Q,"*")}):e=>setTimeout(e));var X,Y,Q,Z;const ee="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):"undefined"!=typeof process&&process.nextTick||G,te={isArray:E,isArrayBuffer:_,isBuffer:O,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||R(e.append)&&("formdata"===(t=y(e))||"object"===t&&R(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&_(e.buffer),t},isString:v,isNumber:x,isBoolean:e=>!0===e||!1===e,isObject:j,isPlainObject:T,isEmptyObject:e=>{if(!j(e)||O(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:P,isRequest:L,isResponse:U,isHeaders:F,isUndefined:S,isDate:N,isFile:A,isBlob:D,isRegExp:W,isFunction:R,isStream:e=>j(e)&&R(e.pipe),isURLSearchParams:k,isTypedArray:H,isFileList:C,forEach:B,merge:function e(){const{caseless:t,skipUndefined:r}=M(this)&&this||{},n={},o=(o,s)=>{const i=t&&q(n,s)||s;T(n[i])&&T(o)?n[i]=e(n[i],o):T(o)?n[i]=e({},o):E(o)?n[i]=o.slice():r&&S(o)||(n[i]=o)};for(let e=0,t=arguments.length;e(B(t,(t,n)=>{r&&R(t)?e[n]=d(t,r):e[n]=t},{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&p(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:y,kindOfTest:g,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(E(e))return e;let t=e.length;if(!x(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[h]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:$,hasOwnProperty:J,hasOwnProp:J,reduceDescriptors:K,freezeMethods:e=>{K(e,(t,r)=>{if(R(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];R(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return E(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:q,global:I,isContextDefined:M,isSpecCompliantForm:function(e){return!!(e&&R(e.append)&&"FormData"===e[m]&&e[h])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(j(e)){if(t.indexOf(e)>=0)return;if(O(e))return e;if(!("toJSON"in e)){t[n]=e;const o=E(e)?[]:{};return B(e,(e,t)=>{const s=r(e,n+1);!S(s)&&(o[t]=s)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:V,isThenable:e=>e&&(j(e)||R(e))&&R(e.then)&&R(e.catch),setImmediate:G,asap:ee,isIterable:e=>null!=e&&R(e[h])};function re(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}te.inherits(re,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:te.toJSONObject(this.config),code:this.code,status:this.status}}});const ne=re.prototype,oe={};["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=>{oe[e]={value:e}}),Object.defineProperties(re,oe),Object.defineProperty(ne,"isAxiosError",{value:!0}),re.from=(e,t,r,n,o,s)=>{const i=Object.create(ne);te.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return re.call(i,a,c,r,n,o),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",s&&Object.assign(i,s),i};const se=re;function ie(e){return te.isPlainObject(e)||te.isArray(e)}function ae(e){return te.endsWith(e,"[]")?e.slice(0,-2):e}function ce(e,t,r){return e?e.concat(t).map(function(e,t){return e=ae(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const le=te.toFlatObject(te,{},null,function(e){return/^is[A-Z]/.test(e)}),ue=function(e,t,r){if(!te.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=te.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!te.isUndefined(t[e])})).metaTokens,o=r.visitor||l,s=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&te.isSpecCompliantForm(t);if(!te.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(te.isDate(e))return e.toISOString();if(te.isBoolean(e))return e.toString();if(!a&&te.isBlob(e))throw new se("Blob is not supported. Use a Buffer instead.");return te.isArrayBuffer(e)||te.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,r,o){let a=e;if(e&&!o&&"object"==typeof e)if(te.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(te.isArray(e)&&function(e){return te.isArray(e)&&!e.some(ie)}(e)||(te.isFileList(e)||te.endsWith(r,"[]"))&&(a=te.toArray(e)))return r=ae(r),a.forEach(function(e,n){!te.isUndefined(e)&&null!==e&&t.append(!0===i?ce([r],n,s):null===i?r:r+"[]",c(e))}),!1;return!!ie(e)||(t.append(ce(o,r,s),c(e)),!1)}const u=[],d=Object.assign(le,{defaultVisitor:l,convertValue:c,isVisitable:ie});if(!te.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!te.isUndefined(r)){if(-1!==u.indexOf(r))throw Error("Circular reference detected in "+n.join("."));u.push(r),te.forEach(r,function(r,s){!0===(!(te.isUndefined(r)||null===r)&&o.call(t,r,te.isString(s)?s.trim():s,n,d))&&e(r,n?n.concat(s):[s])}),u.pop()}}(e),t};function de(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function fe(e,t){this._pairs=[],e&&ue(e,this,t)}const pe=fe.prototype;pe.append=function(e,t){this._pairs.push([e,t])},pe.toString=function(e){const t=e?function(t){return e.call(this,t,de)}:de;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const he=fe;function me(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ye(e,t,r){if(!t)return e;const n=r&&r.encode||me;te.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let s;if(s=o?o(t,r):te.isURLSearchParams(t)?t.toString():new he(t,r).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const be=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){te.forEach(this.handlers,function(t){null!==t&&e(t)})}},ge={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},we={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:he,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ee="undefined"!=typeof window&&"undefined"!=typeof document,Se="object"==typeof navigator&&navigator||void 0,Oe=Ee&&(!Se||["ReactNative","NativeScript","NS"].indexOf(Se.product)<0),_e="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ve=Ee&&window.location.href||"http://localhost",Re={...n,...we},xe=function(e){function t(e,r,n,o){let s=e[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),a=o>=e.length;return s=!s&&te.isArray(n)?n.length:s,a?(te.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!i):(n[s]&&te.isObject(n[s])||(n[s]=[]),t(e,r,n[s],o)&&te.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n{t(function(e){return te.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null},je={transitional:ge,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=te.isObject(e);if(o&&te.isHTMLForm(e)&&(e=new FormData(e)),te.isFormData(e))return n?JSON.stringify(xe(e)):e;if(te.isArrayBuffer(e)||te.isBuffer(e)||te.isStream(e)||te.isFile(e)||te.isBlob(e)||te.isReadableStream(e))return e;if(te.isArrayBufferView(e))return e.buffer;if(te.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ue(e,new Re.classes.URLSearchParams,{visitor:function(e,t,r,n){return Re.isNode&&te.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=te.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ue(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e){if(te.isString(e))try{return(0,JSON.parse)(e),te.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||je.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(te.isResponse(e)||te.isReadableStream(e))return e;if(e&&te.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw se.from(e,se.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:Re.classes.FormData,Blob:Re.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};te.forEach(["delete","get","head","post","put","patch"],e=>{je.headers[e]={}});const Te=je,Ne=te.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"]),Ae=Symbol("internals");function De(e){return e&&String(e).trim().toLowerCase()}function Ce(e){return!1===e||null==e?e:te.isArray(e)?e.map(Ce):String(e)}function ke(e,t,r,n,o){return te.isFunction(n)?n.call(this,t,r):(o&&(t=r),te.isString(t)?te.isString(n)?-1!==t.indexOf(n):te.isRegExp(n)?n.test(t):void 0:void 0)}class Pe{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=De(t);if(!o)throw new Error("header name must be a non-empty string");const s=te.findKey(n,o);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||t]=Ce(e))}const s=(e,t)=>te.forEach(e,(e,r)=>o(e,r,t));if(te.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(te.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&Ne[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(te.isObject(e)&&te.isIterable(e)){let r,n,o={};for(const t of e){if(!te.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[n=t[0]]=(r=o[n])?te.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}s(o,t)}else null!=e&&o(t,e,r);return this}get(e,t){if(e=De(e)){const r=te.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(te.isFunction(t))return t.call(this,e,r);if(te.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=De(e)){const r=te.findKey(this,e);return!(!r||void 0===this[r]||t&&!ke(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=De(e)){const o=te.findKey(r,e);!o||t&&!ke(0,r[o],o,t)||(delete r[o],n=!0)}}return te.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!ke(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return te.forEach(this,(n,o)=>{const s=te.findKey(r,o);if(s)return t[s]=Ce(n),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(o):String(o).trim();i!==o&&delete t[o],t[i]=Ce(n),r[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return te.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&te.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Ae]=this[Ae]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=De(e);t[n]||(function(e,t){const r=te.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})})}(r,e),t[n]=!0)}return te.isArray(e)?e.forEach(n):n(e),this}}Pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),te.reduceDescriptors(Pe.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),te.freezeMethods(Pe);const Le=Pe;function Ue(e,t){const r=this||Te,n=t||r,o=Le.from(n.headers);let s=n.data;return te.forEach(e,function(e){s=e.call(r,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function Fe(e){return!(!e||!e.__CANCEL__)}function Be(e,t,r){se.call(this,null==e?"canceled":e,se.ERR_CANCELED,t,r),this.name="CanceledError"}te.inherits(Be,se,{__CANCEL__:!0});const qe=Be;function Ie(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new se("Request failed with status code "+r.status,[se.ERR_BAD_REQUEST,se.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}const Me=(e,t,r=3)=>{let n=0;const o=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),l=n[i];o||(o=c),r[s]=a,n[s]=c;let u=i,d=0;for(;u!==s;)d+=r[u++],u%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o{o=s,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=s?i(e,t):(r=e,n||(n=setTimeout(()=>{n=null,i(r)},s-a)))},()=>r&&i(r)]}(r=>{const s=r.loaded,i=r.lengthComputable?r.total:void 0,a=s-n,c=o(a);n=s,e({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:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})},r)},He=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},ze=e=>(...t)=>te.asap(()=>e(...t)),$e=Re.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Re.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Re.origin),Re.navigator&&/(msie|trident)/i.test(Re.navigator.userAgent)):()=>!0,Je=Re.hasStandardBrowserEnv?{write(e,t,r,n,o,s,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];te.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),te.isString(n)&&a.push(`path=${n}`),te.isString(o)&&a.push(`domain=${o}`),!0===s&&a.push("secure"),te.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function We(e,t,r){let n=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ke=e=>e instanceof Le?{...e}:e;function Ve(e,t){t=t||{};const r={};function n(e,t,r,n){return te.isPlainObject(e)&&te.isPlainObject(t)?te.merge.call({caseless:n},e,t):te.isPlainObject(t)?te.merge({},t):te.isArray(t)?t.slice():t}function o(e,t,r,o){return te.isUndefined(t)?te.isUndefined(e)?void 0:n(void 0,e,0,o):n(e,t,0,o)}function s(e,t){if(!te.isUndefined(t))return n(void 0,t)}function i(e,t){return te.isUndefined(t)?te.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,o,s){return s in t?n(r,o):s in e?n(void 0,r):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,r)=>o(Ke(e),Ke(t),0,!0)};return te.forEach(Object.keys({...e,...t}),function(n){const s=c[n]||o,i=s(e[n],t[n],n);te.isUndefined(i)&&s!==a||(r[n]=i)}),r}const Ge=e=>{const t=Ve({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;if(t.headers=i=Le.from(i),t.url=ye(We(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),te.isFormData(r))if(Re.hasStandardBrowserEnv||Re.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(te.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&i.set(e,r)})}if(Re.hasStandardBrowserEnv&&(n&&te.isFunction(n)&&(n=n(t)),n||!1!==n&&$e(t.url))){const e=o&&s&&Je.read(s);e&&i.set(o,e)}return t},Xe="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=Ge(e);let o=n.data;const s=Le.from(n.headers).normalize();let i,a,c,l,u,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=n;function h(){l&&l(),u&&u(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function y(){if(!m)return;const n=Le.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Ie(function(e){t(e),h()},function(e){r(e),h()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m}),m=null}m.open(n.method.toUpperCase(),n.url,!0),m.timeout=n.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(y)},m.onabort=function(){m&&(r(new se("Request aborted",se.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const n=t&&t.message?t.message:"Network Error",o=new se(n,se.ERR_NETWORK,e,m);o.event=t||null,r(o),m=null},m.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||ge;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new se(t,o.clarifyTimeoutError?se.ETIMEDOUT:se.ECONNABORTED,e,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&te.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),te.isUndefined(n.withCredentials)||(m.withCredentials=!!n.withCredentials),d&&"json"!==d&&(m.responseType=n.responseType),p&&([c,u]=Me(p,!0),m.addEventListener("progress",c)),f&&m.upload&&([a,l]=Me(f),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",l)),(n.cancelToken||n.signal)&&(i=t=>{m&&(r(!t||t.type?new qe(null,e,m):t),m.abort(),m=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);b&&-1===Re.protocols.indexOf(b)?r(new se("Unsupported protocol "+b+":",se.ERR_BAD_REQUEST,e)):m.send(o||null)})},Ye=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const o=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof se?t:new qe(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,o(new se(`timeout ${t} of ms exceeded`,se.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:a}=n;return a.unsubscribe=()=>te.asap(i),a}},Qe=function*(e,t){let r=e.byteLength;if(!t||r{const o=async function*(e,t){for await(const r of async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}}(e))yield*Qe(r,t)}(e,t);let s,i=0,a=e=>{s||(s=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await o.next();if(t)return a(),void e.close();let s=n.byteLength;if(r){let e=i+=s;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:et}=te,tt=(({Request:e,Response:t})=>({Request:e,Response:t}))(te.global),{ReadableStream:rt,TextEncoder:nt}=te.global,ot=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},st=e=>{e=te.merge.call({skipUndefined:!0},tt,e);const{fetch:t,Request:r,Response:n}=e,o=t?et(t):"function"==typeof fetch,s=et(r),i=et(n);if(!o)return!1;const a=o&&et(rt),c=o&&("function"==typeof nt?(l=new nt,e=>l.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var l;const u=s&&a&&ot(()=>{let e=!1;const t=new r(Re.origin,{body:new rt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=i&&a&&ot(()=>te.isReadableStream(new n("").body)),f={stream:d&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!f[e]&&(f[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new se(`Response type '${e}' is not supported`,se.ERR_NOT_SUPPORT,r)})});return async e=>{let{url:o,method:i,data:a,signal:l,cancelToken:p,timeout:h,onDownloadProgress:m,onUploadProgress:y,responseType:b,headers:g,withCredentials:w="same-origin",fetchOptions:E}=Ge(e),S=t||fetch;b=b?(b+"").toLowerCase():"text";let O=Ye([l,p&&p.toAbortSignal()],h),_=null;const v=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let R;try{if(y&&u&&"get"!==i&&"head"!==i&&0!==(R=await(async(e,t)=>{const n=te.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(te.isBlob(e))return e.size;if(te.isSpecCompliantForm(e)){const t=new r(Re.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return te.isArrayBufferView(e)||te.isArrayBuffer(e)?e.byteLength:(te.isURLSearchParams(e)&&(e+=""),te.isString(e)?(await c(e)).byteLength:void 0)})(t):n})(g,a))){let e,t=new r(o,{method:"POST",body:a,duplex:"half"});if(te.isFormData(a)&&(e=t.headers.get("content-type"))&&g.setContentType(e),t.body){const[e,r]=He(R,Me(ze(y)));a=Ze(t.body,65536,e,r)}}te.isString(w)||(w=w?"include":"omit");const t=s&&"credentials"in r.prototype,l={...E,signal:O,method:i.toUpperCase(),headers:g.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};_=s&&new r(o,l);let p=await(s?S(_,E):S(o,l));const h=d&&("stream"===b||"response"===b);if(d&&(m||h&&v)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=p[t]});const t=te.toFiniteNumber(p.headers.get("content-length")),[r,o]=m&&He(t,Me(ze(m),!0))||[];p=new n(Ze(p.body,65536,r,()=>{o&&o(),v&&v()}),e)}b=b||"text";let x=await f[te.findKey(f,b)||"text"](p,e);return!h&&v&&v(),await new Promise((t,r)=>{Ie(t,r,{data:x,headers:Le.from(p.headers),status:p.status,statusText:p.statusText,config:e,request:_})})}catch(t){if(v&&v(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new se("Network Error",se.ERR_NETWORK,e,_),{cause:t.cause||t});throw se.from(t,t&&t.code,e,_)}}},it=new Map,at=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,s=[n,o,r];let i,a,c=s.length,l=it;for(;c--;)i=s[c],a=l.get(i),void 0===a&&l.set(i,a=c?new Map:st(t)),l=a;return a},ct=(at(),{http:null,xhr:Xe,fetch:{get:at}});te.forEach(ct,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const lt=e=>`- ${e}`,ut=e=>te.isFunction(e)||null===e||!1===e,dt=function(e,t){e=te.isArray(e)?e:[e];const{length:r}=e;let n,o;const s={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=r?e.length>1?"since :\n"+e.map(lt).join("\n"):" "+lt(e[0]):"as no adapter specified";throw new se("There is no suitable adapter to dispatch the request "+t,"ERR_NOT_SUPPORT")}return o};function ft(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new qe(null,e)}function pt(e){return ft(e),e.headers=Le.from(e.headers),e.data=Ue.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),dt(e.adapter||Te.adapter,e)(e).then(function(t){return ft(e),t.data=Ue.call(e,e.transformResponse,t),t.headers=Le.from(t.headers),t},function(t){return Fe(t)||(ft(e),t&&t.response&&(t.response.data=Ue.call(e,e.transformResponse,t.response),t.response.headers=Le.from(t.response.headers))),Promise.reject(t)})}const ht="1.13.2",mt={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{mt[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const yt={};mt.transitional=function(e,t,r){function n(e,t){return"[Axios v"+ht+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,s)=>{if(!1===e)throw new se(n(o," has been removed"+(t?" in "+t:"")),se.ERR_DEPRECATED);return t&&!yt[o]&&(yt[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,s)}},mt.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};const bt={assertOptions:function(e,t,r){if("object"!=typeof e)throw new se("options must be an object",se.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const t=e[s],r=void 0===t||i(t,s,e);if(!0!==r)throw new se("option "+s+" must be "+r,se.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new se("Unknown option "+s,se.ERR_BAD_OPTION)}},validators:mt},gt=bt.validators;class wt{constructor(e){this.defaults=e||{},this.interceptors={request:new be,response:new be}}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 r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ve(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&bt.assertOptions(r,{silentJSONParsing:gt.transitional(gt.boolean),forcedJSONParsing:gt.transitional(gt.boolean),clarifyTimeoutError:gt.transitional(gt.boolean)},!1),null!=n&&(te.isFunction(n)?t.paramsSerializer={serialize:n}:bt.assertOptions(n,{encode:gt.function,serialize:gt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),bt.assertOptions(t,{baseUrl:gt.spelling("baseURL"),withXsrfToken:gt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&te.merge(o.common,o[t.method]);o&&te.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=Le.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 l;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[pt.bind(this),void 0];for(e.unshift(...i),e.push(...c),u=e.length,l=Promise.resolve(t);d{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new qe(e,n,o),t(r.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)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new St(function(t){e=t}),cancel:e}}}const Ot=St,_t={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(_t).forEach(([e,t])=>{_t[t]=e});const vt=_t,Rt=function e(t){const r=new Et(t),n=d(Et.prototype.request,r);return te.extend(n,Et.prototype,r,{allOwnKeys:!0}),te.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(Ve(t,r))},n}(Te);Rt.Axios=Et,Rt.CanceledError=qe,Rt.CancelToken=Ot,Rt.isCancel=Fe,Rt.VERSION=ht,Rt.toFormData=ue,Rt.AxiosError=se,Rt.Cancel=Rt.CanceledError,Rt.all=function(e){return Promise.all(e)},Rt.spread=function(e){return function(t){return e.apply(null,t)}},Rt.isAxiosError=function(e){return te.isObject(e)&&!0===e.isAxiosError},Rt.mergeConfig=Ve,Rt.AxiosHeaders=Le,Rt.formToJSON=e=>xe(te.isHTMLForm(e)?new FormData(e):e),Rt.getAdapter=dt,Rt.HttpStatusCode=vt,Rt.default=Rt;const xt=Rt;var jt=r(848);function Tt(e){const t=prDhlGlobals.currencySymbol||"€",r=prDhlGlobals.currencyPosition||"left",n=prDhlGlobals.currencyDecimals||2,o=prDhlGlobals.currencyDecimalSeparator||".",s=prDhlGlobals.currencyThousandSeparator||",",i=(e=parseFloat(e).toFixed(n)).toString().split(".");i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,s);const a=i.join(o);return"left"===r?t+a:a+t}const Nt=JSON.parse('{"apiVersion":3,"name":"pr-dhl/dhl-preferred-services","version":"1.0.0","title":"DHL Order Block","category":"woocommerce","description":"Adds DHL block to checkout.","supports":{"html":false,"align":true,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-order-summary-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}},"preferredDay":{"type":"string","default":""},"preferredLocationNeighbor":{"type":"string","default":""},"preferredLocation":{"type":"string","default":""},"preferredNeighborName":{"type":"string","default":""},"preferredNeighborAddress":{"type":"string","default":""},"mainTitle":{"type":"string","default":"DHL Preferred Delivery. Delivered just as you wish."},"infoText":{"type":"string","default":"Thanks to the flexible recipient services of DHL Preferred Delivery, you decide when and where you want to receive your parcels. Please choose your preferred delivery option."},"deliveryDayLabel":{"type":"string","default":"Delivery day: Delivery at your preferred day ?"},"dropOffOrNeighborLabel":{"type":"string","default":"Drop-off location or neighbor"},"dropOffLocationLabel":{"type":"string","default":"Drop-off location: Delivery to your preferred drop-off location"},"neighborLabel":{"type":"string","default":"Neighbour: Delivery to a neighbour of your choice"}},"textdomain":"dhl-for-woocommerce","editorStyle":"file:../../../build/style-dhl-preferred-services.css"}');(0,o.registerCheckoutBlock)({metadata:Nt,component:({checkoutExtensionData:e})=>{const{setExtensionData:t}=e,r=prDhlGlobals.pluginUrl+"/assets/img/dhl-official.png",n=prDhlGlobals.dhlSettings,[o,d]=(0,s.useState)(!0),{updateCustomerData:f}=(0,a.useDispatch)(c.CART_STORE_KEY),p=(0,s.useCallback)((0,u.debounce)((e,r,n)=>{t(e,r,n)},500),[t]),h=(0,s.useState)(null),m=(0,a.useSelect)(e=>e(c.CART_STORE_KEY).getCustomerData(),[]),y=m?m.shippingAddress:null,b=(y?.address_1||"").toLowerCase(),g=/\bpackstation\s+\d{3}\b/i.test(b),w=/\bpostfiliale\s+\d{3,5}\b/i.test(b),E=g||w;(0,s.useEffect)(()=>{E&&(L("none"),F(""),q(""),M(""))},[E]);const S=n?.preferred_location,O=n?.preferred_neighbour,_=!E,v=_&&S&&O,R=v?"none":S?"location":O?"neighbor":"none",[x,j]=(0,s.useState)(""),[T,N]=(0,s.useState)([]),[A,D]=(0,s.useState)(!0),[C,k]=(0,s.useState)(""),[P,L]=(0,s.useState)(R),[U,F]=(0,s.useState)(""),[B,q]=(0,s.useState)(""),[I,M]=(0,s.useState)(""),H=(0,a.useSelect)(e=>e(c.CART_STORE_KEY).getCartData(),[]),z=H?H.selectedShippingMethods:[],$=H?H.selectedPaymentMethod:"",[J,W]=(0,s.useState)(!1);(0,s.useEffect)(()=>(h.current&&clearTimeout(h.current),y&&"DE"===y.country&&y.city&&y.postcode?(h.current=setTimeout(()=>{if(y){const e={shipping_country:y.country||"",shipping_postcode:y.postcode||"",shipping_address_1:y.address_1||"",shipping_address_2:y.address_2||"",shipping_city:y.city||"",shipping_state:y.state||"",shipping_email:y.email||"",shipping_phone:y.phone||"",shipping_company:y.company||"",shipping_methods:z,payment_method:$},t=new URLSearchParams;t.append("action","pr_dhl_set_checkout_post_data"),t.append("nonce",prDhlGlobals.nonce),Object.keys(e).forEach(r=>{Array.isArray(e[r])?e[r].forEach((e,n)=>{t.append(`data[${r}][${n}]`,e)}):t.append(`data[${r}]`,e[r])}),xt.post(prDhlGlobals.ajax_url,t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(e=>{e.data.success?K():(d(!1),D(!1))}).catch(e=>{d(!1),D(!1)})}},750),()=>clearTimeout(h.current)):(d(!1),void D(!1))),[y,z,$]);const K=()=>{D(!0),k("");const e=new URLSearchParams;e.append("action","pr_dhl_get_preferred_days"),e.append("nonce",prDhlGlobals.nonce),xt.post(prDhlGlobals.ajax_url,e,{headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(e=>{e.data.success?(N(e.data.data.preferredDays),d(!0),D(!1)):(d(!1),D(!1))}).catch(e=>{d(!1),k("Error fetching preferred days."),D(!1)})};(0,s.useEffect)(()=>{t("pr-dhl","preferredDay",x),p("pr-dhl","preferredDay",x),f();const e=parseFloat(n?.preferred_day_cost||0),r=async(e,t)=>{try{const{extensionCartUpdate:r}=window.wc.blocksCheckout||{};"function"==typeof r&&await r({namespace:"pr-dhl",data:{action:"update_preferred_day_fee",price:e,label:t}})}catch(e){console.error("Error updating cart fee:",e)}};x&&"0"!==x&&e>0?J||(r(e,(0,l.__)("DHL Delivery Day","dhl-for-woocommerce")),W(!0)):J&&(r(0,""),W(!1))},[x]),(0,s.useEffect)(()=>{t("pr-dhl","preferredLocationNeighbor",P),p("pr-dhl","preferredLocationNeighbor",P)},[P]),(0,s.useEffect)(()=>{t("pr-dhl","preferredLocation",U),p("pr-dhl","preferredLocation",U)},[U]),(0,s.useEffect)(()=>{t("pr-dhl","preferredNeighborName",B),p("pr-dhl","preferredNeighborName",B)},[B]),(0,s.useEffect)(()=>{t("pr-dhl","preferredNeighborAddress",I),p("pr-dhl","preferredNeighborAddress",I)},[I]);const V=_&&(v&&"location"===P||!v&&S),G=_&&(v&&"neighbor"===P||!v&&O);let X=[];return T&&Object.keys(T).length>0&&(X=Object.entries(T).map(([e,t])=>{let r="";if("0"===e||"none"===e)r="-";else{const t=new Date(e);r=isNaN(t.getTime())?"-":t.getDate().toString()}return{weekDayNum:r,dayName:t,key:e}})),A?(0,jt.jsx)(i.Spinner,{}):o?C?(0,jt.jsx)(i.Notice,{status:"error",isDismissible:!1,children:(0,l.__)(C,"dhl-for-woocommerce")}):y&&"DE"!==y.country?null:(0,jt.jsxs)("table",{className:"dhl-co-table",children:[(0,jt.jsx)("tr",{className:"dhl-co-tr dhl-co-tr-first",children:(0,jt.jsx)("td",{colSpan:"2",children:(0,jt.jsx)("img",{src:r,alt:"DHL logo",className:"dhl-co-logo"})})}),(0,jt.jsx)("tr",{className:"dhl-co-tr",children:(0,jt.jsxs)("th",{colSpan:"2",children:[(0,l.__)("DHL Preferred Delivery. Delivered just as you wish.","dhl-for-woocommerce"),(0,jt.jsx)("hr",{})]})}),(0,jt.jsx)("tr",{className:"dhl-co-tr",children:(0,jt.jsx)("td",{colSpan:"2",children:(0,l.__)("Thanks to the flexible recipient services of DHL Preferred Delivery, you decide when and where you want to receive your parcels. Please choose your preferred delivery option.","dhl-for-woocommerce")})}),n?.preferred_day&&(0,jt.jsxs)(jt.Fragment,{children:[(0,jt.jsx)("tr",{className:"dhl-co-tr",children:(0,jt.jsxs)("th",{colSpan:"2",className:"dhl-pt",children:[(0,l.__)("Delivery day: Delivery at your preferred day","dhl-for-woocommerce"),(0,jt.jsx)("span",{className:"dhl-tooltip",title:(0,l.__)("Choose one of the displayed days as your preferred day for your parcel delivery. Other days are not possible due to delivery processes.","dhl-for-woocommerce"),children:"?"})]})}),(0,jt.jsx)("tr",{className:"dhl-co-tr",children:(0,jt.jsx)("td",{colSpan:"2",children:n?.preferred_day_cost&&parseFloat(n.preferred_day_cost)>0?(0,jt.jsx)(jt.Fragment,{children:(0,l.sprintf)((0,l.__)("There is a surcharge of %s incl. VAT for this service.*","dhl-for-woocommerce"),Tt(parseFloat(n.preferred_day_cost)))}):(0,l.__)("There is a surcharge for this service.","dhl-for-woocommerce")})}),(0,jt.jsx)("tr",{className:"dhl-co-tr",children:(0,jt.jsx)("td",{colSpan:"2",children:X.length>0?(0,jt.jsx)("ul",{className:"dhl-co-times",children:X.map((e,t)=>(0,jt.jsxs)("li",{children:[(0,jt.jsx)("input",{type:"radio",name:"pr_dhl_preferred_day",className:"pr_dhl_preferred_day","data-index":"0",id:`pr_dhl_preferred_day_${e.key}`,value:e.key,checked:x===e.key,onChange:e=>j(e.target.value)}),(0,jt.jsxs)("label",{htmlFor:`pr_dhl_preferred_day_${e.key}`,children:[e.weekDayNum,(0,jt.jsx)("br",{}),e.dayName]})]},t))}):(0,jt.jsx)("i",{children:(0,l.__)("Unfortunately, for the selected delivery address the service Delivery Day is not available","dhl-for-woocommerce")})})})]}),v&&(0,jt.jsx)(jt.Fragment,{children:(0,jt.jsxs)("tr",{className:"dhl-co-tr",children:[(0,jt.jsx)("th",{className:"dhl-pt",children:(0,l.__)("Drop-off location or neighbor","dhl-for-woocommerce")}),(0,jt.jsx)("td",{className:"dhl-pt",children:(0,jt.jsx)(i.RadioControl,{selected:P,options:[{label:(0,l.__)("None","dhl-for-woocommerce"),value:"none"},{label:(0,l.__)("Location","dhl-for-woocommerce"),value:"location"},{label:(0,l.__)("Neighbor","dhl-for-woocommerce"),value:"neighbor"}],onChange:e=>L(e)})})]})}),V&&(0,jt.jsxs)(jt.Fragment,{children:[(0,jt.jsx)("tr",{className:"dhl-co-tr",children:(0,jt.jsx)("th",{colSpan:"2",className:"dhl-pt",children:(0,l.__)("Drop-off location: Delivery to your preferred drop-off location","dhl-for-woocommerce")})}),(0,jt.jsx)("tr",{className:"dhl-co-tr",children:(0,jt.jsx)("td",{colSpan:"2",children:(0,jt.jsx)("div",{className:"wc-block-components-text-input",children:(0,jt.jsx)(i.TextControl,{placeholder:(0,l.__)("e.g. Garage, Terrace","dhl-for-woocommerce"),value:U,onChange:e=>F(e)})})})})]}),G&&(0,jt.jsxs)(jt.Fragment,{children:[(0,jt.jsx)("tr",{className:"dhl-co-tr",children:(0,jt.jsx)("th",{colSpan:"2",className:"dhl-pt",children:(0,l.__)("Neighbour: Delivery to a neighbour of your choice","dhl-for-woocommerce")})}),(0,jt.jsx)("tr",{className:"dhl-co-tr",children:(0,jt.jsx)("td",{colSpan:"2",children:(0,jt.jsx)("div",{className:"wc-block-components-text-input",children:(0,jt.jsx)(i.TextControl,{className:"pr-dhl-other-textarea",placeholder:(0,l.__)("First name, last name of neighbour","dhl-for-woocommerce"),value:B,onChange:e=>q(e)})})})}),(0,jt.jsx)("tr",{className:"dhl-co-tr",children:(0,jt.jsx)("td",{colSpan:"2",className:"",children:(0,jt.jsx)("div",{className:"wc-block-components-text-input",children:(0,jt.jsx)(i.TextControl,{placeholder:(0,l.__)("Street, number, postal code, city","dhl-for-woocommerce"),value:I,onChange:e=>M(e)})})})})]})]}):null}})})();