@gradientedge/commercetools-utils 5.2.0 → 5.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ge-commercetools-utils-browser.cjs.js +1 -1
- package/dist/ge-commercetools-utils-browser.cjs.js.map +1 -1
- package/dist/ge-commercetools-utils-browser.esm.js +1 -1
- package/dist/ge-commercetools-utils-browser.esm.js.map +1 -1
- package/dist/ge-commercetools-utils-node.cjs.js +1 -1
- package/dist/ge-commercetools-utils-node.cjs.js.map +1 -1
- package/dist/ge-commercetools-utils-node.esm.js +1 -1
- package/dist/typings/utils/calculate-delay.d.ts +1 -1
- package/dist/typings/utils/ensure-non-empty-string.d.ts +5 -0
- package/dist/typings/utils/index.d.ts +1 -0
- package/package.json +19 -19
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t={8842:(t,e,r)=>{e.Status=void 0;var o=r(7536);Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return o.Status}});r(7890)},7890:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reason=void 0;const o=r(7536);e.reason=function(t){switch(t){case 200:return"OK";case 203:return"Non-Authoritative Information";case 207:return"Multi-Status";case 226:return"IM Used";case 414:return"URI Too Long";case 418:return"I'm a teapot";case 505:return"HTTP Version Not Supported";default:return(Object.keys(o.Status).find((e=>o.Status[e]===t))||"").replace(/(?!^)([A-Z])/gm," $1")}}},7536:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Status=e.ErrorStatus=e.RedirectionStatus=e.SuccessStatus=e.InformationStatus=void 0,e.InformationStatus={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103},e.SuccessStatus={Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226},e.RedirectionStatus={MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},e.ErrorStatus={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,RequestedRangeNotSatisfiable: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},e.Status=Object.assign(Object.assign(Object.assign(Object.assign({},e.InformationStatus),e.SuccessStatus),e.RedirectionStatus),e.ErrorStatus)},4530:(t,e)=>{function r(t,e){var r=[],o=[];return null==e&&(e=function(t,e){return r[0]===e?"[Circular ~]":"[Circular ~."+o.slice(0,r.indexOf(e)).join(".")+"]"}),function(s,n){if(r.length>0){var a=r.indexOf(this);~a?r.splice(a+1):r.push(this),~a?o.splice(a,1/0,s):o.push(s),~r.indexOf(n)&&(n=e.call(this,s,n))}else r.push(n);return null==t?n:t.call(this,s,n)}}(t.exports=function(t,e,o,s){return JSON.stringify(t,r(e,s),o)}).getSerialize=r},3692:t=>{function e(t){return Object.prototype.toString.call(t)}var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r<t.length;r++)e(t[r],r,t)}var s=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e},n=Object.prototype.hasOwnProperty||function(t,e){return e in t};function a(t){if("object"==typeof t&&null!==t){var n;if(r(t))n=[];else if("[object Date]"===e(t))n=new Date(t.getTime?t.getTime():t);else if("[object RegExp]"===e(t))n=new RegExp(t);else if(function(t){return"[object Error]"===e(t)}(t))n={message:t.message};else if(function(t){return"[object Boolean]"===e(t)}(t)||function(t){return"[object Number]"===e(t)}(t)||function(t){return"[object String]"===e(t)}(t))n=Object(t);else if(Object.create&&Object.getPrototypeOf)n=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)n={};else{var a=t.constructor&&t.constructor.prototype||t.__proto__||{},i=function(){};i.prototype=a,n=new i}return o(s(t),(function(e){n[e]=t[e]})),n}return t}function i(t,e,i){var c=[],u=[],h=!0;return function t(p){var d=i?a(p):p,l={},m=!0,f={node:d,node_:p,path:[].concat(c),parent:u[u.length-1],parents:u,key:c[c.length-1],isRoot:0===c.length,level:c.length,circular:null,update:function(t,e){f.isRoot||(f.parent.node[f.key]=t),f.node=t,e&&(m=!1)},delete:function(t){delete f.parent.node[f.key],t&&(m=!1)},remove:function(t){r(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],t&&(m=!1)},keys:null,before:function(t){l.before=t},after:function(t){l.after=t},pre:function(t){l.pre=t},post:function(t){l.post=t},stop:function(){h=!1},block:function(){m=!1}};if(!h)return f;function y(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=s(f.node)),f.isLeaf=0===f.keys.length;for(var t=0;t<u.length;t++)if(u[t].node_===p){f.circular=u[t];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}y();var g=e.call(f,f.node);return void 0!==g&&f.update&&f.update(g),l.before&&l.before.call(f,f.node),m?("object"!=typeof f.node||null===f.node||f.circular||(u.push(f),y(),o(f.keys,(function(e,r){c.push(e),l.pre&&l.pre.call(f,f.node[e],e);var o=t(f.node[e]);i&&n.call(f.node,e)&&(f.node[e]=o.node),o.isLast=r===f.keys.length-1,o.isFirst=0===r,l.post&&l.post.call(f,o),c.pop()})),u.pop()),l.after&&l.after.call(f,f.node),f):f}(t).node}function c(t){this.value=t}function u(t){return new c(t)}c.prototype.get=function(t){for(var e=this.value,r=0;r<t.length;r++){var o=t[r];if(!e||!n.call(e,o))return;e=e[o]}return e},c.prototype.has=function(t){for(var e=this.value,r=0;r<t.length;r++){var o=t[r];if(!e||!n.call(e,o))return!1;e=e[o]}return!0},c.prototype.set=function(t,e){for(var r=this.value,o=0;o<t.length-1;o++){var s=t[o];n.call(r,s)||(r[s]={}),r=r[s]}return r[t[o]]=e,e},c.prototype.map=function(t){return i(this.value,t,!0)},c.prototype.forEach=function(t){return this.value=i(this.value,t,!1),this.value},c.prototype.reduce=function(t,e){var r=1===arguments.length,o=r?this.value:e;return this.forEach((function(e){this.isRoot&&r||(o=t.call(this,o,e))})),o},c.prototype.paths=function(){var t=[];return this.forEach((function(){t.push(this.path)})),t},c.prototype.nodes=function(){var t=[];return this.forEach((function(){t.push(this.node)})),t},c.prototype.clone=function(){var t=[],e=[];return function r(n){for(var i=0;i<t.length;i++)if(t[i]===n)return e[i];if("object"==typeof n&&null!==n){var c=a(n);return t.push(n),e.push(c),o(s(n),(function(t){c[t]=r(n[t])})),t.pop(),e.pop(),c}return n}(this.value)},o(s(c.prototype),(function(t){u[t]=function(e){var r=[].slice.call(arguments,1),o=new c(e);return o[t].apply(o,r)}})),t.exports=u}},e={};function r(o){var s=e[o];if(void 0!==s)return s.exports;var n=e[o]={exports:{}};return t[o](n,n.exports,r),n.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var o={};(()=>{r.d(o,{A9:()=>_e,M_:()=>Be,Mq:()=>qe,h4:()=>xe,Eh:()=>ye,eJ:()=>oe,yp:()=>Ce,hw:()=>fe,Xp:()=>me,dI:()=>Se,gO:()=>ie,qX:()=>te,jF:()=>ee,as:()=>ae,cY:()=>Zt,Vl:()=>ce,kD:()=>ue,KD:()=>Ee,Jy:()=>Oe,s9:()=>ge,iS:()=>Te});var t=r(4530),e=r.n(t);function s(t,e){return function(){return t.apply(e,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:a}=Object,i=(c=Object.create(null),t=>{const e=n.call(t);return c[e]||(c[e]=e.slice(8,-1).toLowerCase())});var c;const u=t=>(t=t.toLowerCase(),e=>i(e)===t),h=t=>e=>typeof e===t,{isArray:p}=Array,d=h("undefined"),l=u("ArrayBuffer"),m=h("string"),f=h("function"),y=h("number"),g=t=>null!==t&&"object"==typeof t,O=t=>{if("object"!==i(t))return!1;const e=a(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},E=u("Date"),T=u("File"),S=u("Blob"),q=u("FileList"),C=u("URLSearchParams");function R(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let o,s;if("object"!=typeof t&&(t=[t]),p(t))for(o=0,s=t.length;o<s;o++)e.call(null,t[o],o,t);else{const s=r?Object.getOwnPropertyNames(t):Object.keys(t),n=s.length;let a;for(o=0;o<n;o++)a=s[o],e.call(null,t[a],a,t)}}function w(t,e){e=e.toLowerCase();const r=Object.keys(t);let o,s=r.length;for(;s-- >0;)if(o=r[s],e===o.toLowerCase())return o;return null}const b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,x=t=>!d(t)&&t!==b,v=(k="undefined"!=typeof Uint8Array&&a(Uint8Array),t=>k&&t instanceof k);var k;const P=u("HTMLFormElement"),A=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),j=u("RegExp"),I=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),o={};R(r,((r,s)=>{!1!==e(r,s,t)&&(o[s]=r)})),Object.defineProperties(t,o)},B="abcdefghijklmnopqrstuvwxyz",_="0123456789",N={DIGIT:_,ALPHA:B,ALPHA_DIGIT:B+B.toUpperCase()+_},$={isArray:p,isArrayBuffer:l,isBuffer:function(t){return null!==t&&!d(t)&&null!==t.constructor&&!d(t.constructor)&&f(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||n.call(t)===e||f(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&l(t.buffer),e},isString:m,isNumber:y,isBoolean:t=>!0===t||!1===t,isObject:g,isPlainObject:O,isUndefined:d,isDate:E,isFile:T,isBlob:S,isRegExp:j,isFunction:f,isStream:t=>g(t)&&f(t.pipe),isURLSearchParams:C,isTypedArray:v,isFileList:q,forEach:R,merge:function t(){const{caseless:e}=x(this)&&this||{},r={},o=(o,s)=>{const n=e&&w(r,s)||s;O(r[n])&&O(o)?r[n]=t(r[n],o):O(o)?r[n]=t({},o):p(o)?r[n]=o.slice():r[n]=o};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&R(arguments[t],o);return r},extend:(t,e,r,{allOwnKeys:o}={})=>(R(e,((e,o)=>{r&&f(e)?t[o]=s(e,r):t[o]=e}),{allOwnKeys:o}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,o)=>{t.prototype=Object.create(e.prototype,o),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,o)=>{let s,n,i;const c={};if(e=e||{},null==t)return e;do{for(s=Object.getOwnPropertyNames(t),n=s.length;n-- >0;)i=s[n],o&&!o(i,t,e)||c[i]||(e[i]=t[i],c[i]=!0);t=!1!==r&&a(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:i,kindOfTest:u,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const o=t.indexOf(e,r);return-1!==o&&o===r},toArray:t=>{if(!t)return null;if(p(t))return t;let e=t.length;if(!y(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=r.next())&&!o.done;){const r=o.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const o=[];for(;null!==(r=t.exec(e));)o.push(r);return o},isHTMLForm:P,hasOwnProperty:A,hasOwnProp:A,reduceDescriptors:I,freezeMethods:t=>{I(t,((e,r)=>{if(f(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const o=t[r];f(o)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},o=t=>{t.forEach((t=>{r[t]=!0}))};return p(t)?o(t):o(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:w,global:b,isContextDefined:x,ALPHABET:N,generateString:(t=16,e=N.ALPHA_DIGIT)=>{let r="";const{length:o}=e;for(;t--;)r+=e[Math.random()*o|0];return r},isSpecCompliantForm:function(t){return!!(t&&f(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,o)=>{if(g(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[o]=t;const s=p(t)?[]:{};return R(t,((t,e)=>{const n=r(t,o+1);!d(n)&&(s[e]=n)})),e[o]=void 0,s}}return t};return r(t,0)}};function D(t,e,r,o,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),o&&(this.request=o),s&&(this.response=s)}$.inherits(D,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:$.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const K=D.prototype,L={};["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((t=>{L[t]={value:t}})),Object.defineProperties(D,L),Object.defineProperty(K,"isAxiosError",{value:!0}),D.from=(t,e,r,o,s,n)=>{const a=Object.create(K);return $.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),D.call(a,t.message,e,r,o,s),a.cause=t,a.name=t.name,n&&Object.assign(a,n),a};const G=D;function M(t){return $.isPlainObject(t)||$.isArray(t)}function U(t){return $.endsWith(t,"[]")?t.slice(0,-2):t}function F(t,e,r){return t?t.concat(e).map((function(t,e){return t=U(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const H=$.toFlatObject($,{},null,(function(t){return/^is[A-Z]/.test(t)})),z=function(t,e,r){if(!$.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const o=(r=$.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!$.isUndefined(e[t])}))).metaTokens,s=r.visitor||u,n=r.dots,a=r.indexes,i=(r.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(e);if(!$.isFunction(s))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if($.isDate(t))return t.toISOString();if(!i&&$.isBlob(t))throw new G("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(t)||$.isTypedArray(t)?i&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,r,s){let i=t;if(t&&!s&&"object"==typeof t)if($.endsWith(r,"{}"))r=o?r:r.slice(0,-2),t=JSON.stringify(t);else if($.isArray(t)&&function(t){return $.isArray(t)&&!t.some(M)}(t)||($.isFileList(t)||$.endsWith(r,"[]"))&&(i=$.toArray(t)))return r=U(r),i.forEach((function(t,o){!$.isUndefined(t)&&null!==t&&e.append(!0===a?F([r],o,n):null===a?r:r+"[]",c(t))})),!1;return!!M(t)||(e.append(F(s,r,n),c(t)),!1)}const h=[],p=Object.assign(H,{defaultVisitor:u,convertValue:c,isVisitable:M});if(!$.isObject(t))throw new TypeError("data must be an object");return function t(r,o){if(!$.isUndefined(r)){if(-1!==h.indexOf(r))throw Error("Circular reference detected in "+o.join("."));h.push(r),$.forEach(r,(function(r,n){!0===(!($.isUndefined(r)||null===r)&&s.call(e,r,$.isString(n)?n.trim():n,o,p))&&t(r,o?o.concat(n):[n])})),h.pop()}}(t),e};function J(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function V(t,e){this._pairs=[],t&&z(t,this,e)}const W=V.prototype;W.append=function(t,e){this._pairs.push([t,e])},W.toString=function(t){const e=t?function(e){return t.call(this,e,J)}:J;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const X=V;function Y(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Q(t,e,r){if(!e)return t;const o=r&&r.encode||Y,s=r&&r.serialize;let n;if(n=s?s(e,r):$.isURLSearchParams(e)?e.toString():new X(e,r).toString(o),n){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+n}return t}const Z=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){$.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},tt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},et={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},rt=function(t){function e(t,r,o,s){let n=t[s++];const a=Number.isFinite(+n),i=s>=t.length;return n=!n&&$.isArray(o)?o.length:n,i?($.hasOwnProp(o,n)?o[n]=[o[n],r]:o[n]=r,!a):(o[n]&&$.isObject(o[n])||(o[n]=[]),e(t,r,o[n],s)&&$.isArray(o[n])&&(o[n]=function(t){const e={},r=Object.keys(t);let o;const s=r.length;let n;for(o=0;o<s;o++)n=r[o],e[n]=t[n];return e}(o[n])),!a)}if($.isFormData(t)&&$.isFunction(t.entries)){const r={};return $.forEachEntry(t,((t,o)=>{e(function(t){return $.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),o,r,0)})),r}return null},ot={"Content-Type":void 0},st={transitional:tt,adapter:["xhr","http"],transformRequest:[function(t,e){const r=e.getContentType()||"",o=r.indexOf("application/json")>-1,s=$.isObject(t);if(s&&$.isHTMLForm(t)&&(t=new FormData(t)),$.isFormData(t))return o&&o?JSON.stringify(rt(t)):t;if($.isArrayBuffer(t)||$.isBuffer(t)||$.isStream(t)||$.isFile(t)||$.isBlob(t))return t;if($.isArrayBufferView(t))return t.buffer;if($.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let n;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return z(t,new et.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,o){return et.isNode&&$.isBuffer(t)?(this.append(e,t.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((n=$.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return z(n?{"files[]":t}:t,e&&new e,this.formSerializer)}}return s||o?(e.setContentType("application/json",!1),function(t,e,r){if($.isString(t))try{return(0,JSON.parse)(t),$.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||st.transitional,r=e&&e.forcedJSONParsing,o="json"===this.responseType;if(t&&$.isString(t)&&(r&&!this.responseType||o)){const r=!(e&&e.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw G.from(t,G.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:et.classes.FormData,Blob:et.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};$.forEach(["delete","get","head"],(function(t){st.headers[t]={}})),$.forEach(["post","put","patch"],(function(t){st.headers[t]=$.merge(ot)}));const nt=st,at=$.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"]),it=Symbol("internals");function ct(t){return t&&String(t).trim().toLowerCase()}function ut(t){return!1===t||null==t?t:$.isArray(t)?t.map(ut):String(t)}function ht(t,e,r,o,s){return $.isFunction(o)?o.call(this,e,r):(s&&(e=r),$.isString(e)?$.isString(o)?-1!==e.indexOf(o):$.isRegExp(o)?o.test(e):void 0:void 0)}class pt{constructor(t){t&&this.set(t)}set(t,e,r){const o=this;function s(t,e,r){const s=ct(e);if(!s)throw new Error("header name must be a non-empty string");const n=$.findKey(o,s);(!n||void 0===o[n]||!0===r||void 0===r&&!1!==o[n])&&(o[n||e]=ut(t))}const n=(t,e)=>$.forEach(t,((t,r)=>s(t,r,e)));return $.isPlainObject(t)||t instanceof this.constructor?n(t,e):$.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z]+$/.test(t.trim())?n((t=>{const e={};let r,o,s;return t&&t.split("\n").forEach((function(t){s=t.indexOf(":"),r=t.substring(0,s).trim().toLowerCase(),o=t.substring(s+1).trim(),!r||e[r]&&at[r]||("set-cookie"===r?e[r]?e[r].push(o):e[r]=[o]:e[r]=e[r]?e[r]+", "+o:o)})),e})(t),e):null!=t&&s(e,t,r),this}get(t,e){if(t=ct(t)){const r=$.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=r.exec(t);)e[o[1]]=o[2];return e}(t);if($.isFunction(e))return e.call(this,t,r);if($.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ct(t)){const r=$.findKey(this,t);return!(!r||void 0===this[r]||e&&!ht(0,this[r],r,e))}return!1}delete(t,e){const r=this;let o=!1;function s(t){if(t=ct(t)){const s=$.findKey(r,t);!s||e&&!ht(0,r[s],s,e)||(delete r[s],o=!0)}}return $.isArray(t)?t.forEach(s):s(t),o}clear(t){const e=Object.keys(this);let r=e.length,o=!1;for(;r--;){const s=e[r];t&&!ht(0,this[s],s,t,!0)||(delete this[s],o=!0)}return o}normalize(t){const e=this,r={};return $.forEach(this,((o,s)=>{const n=$.findKey(r,s);if(n)return e[n]=ut(o),void delete e[s];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(s):String(s).trim();a!==s&&delete e[s],e[a]=ut(o),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return $.forEach(this,((r,o)=>{null!=r&&!1!==r&&(e[o]=t&&$.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[it]=this[it]={accessors:{}}).accessors,r=this.prototype;function o(t){const o=ct(t);e[o]||(function(t,e){const r=$.toCamelCase(" "+e);["get","set","has"].forEach((o=>{Object.defineProperty(t,o+r,{value:function(t,r,s){return this[o].call(this,e,t,r,s)},configurable:!0})}))}(r,t),e[o]=!0)}return $.isArray(t)?t.forEach(o):o(t),this}}pt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.freezeMethods(pt.prototype),$.freezeMethods(pt);const dt=pt;function lt(t,e){const r=this||nt,o=e||r,s=dt.from(o.headers);let n=o.data;return $.forEach(t,(function(t){n=t.call(r,n,s.normalize(),e?e.status:void 0)})),s.normalize(),n}function mt(t){return!(!t||!t.__CANCEL__)}function ft(t,e,r){G.call(this,null==t?"canceled":t,G.ERR_CANCELED,e,r),this.name="CanceledError"}$.inherits(ft,G,{__CANCEL__:!0});const yt=ft,gt=et.isStandardBrowserEnv?{write:function(t,e,r,o,s,n){const a=[];a.push(t+"="+encodeURIComponent(e)),$.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),$.isString(o)&&a.push("path="+o),$.isString(s)&&a.push("domain="+s),!0===n&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Ot(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Et=et.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let r;function o(r){let o=r;return t&&(e.setAttribute("href",o),o=e.href),e.setAttribute("href",o),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return r=o(window.location.href),function(t){const e=$.isString(t)?o(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0};function Tt(t,e){let r=0;const o=function(t,e){t=t||10;const r=new Array(t),o=new Array(t);let s,n=0,a=0;return e=void 0!==e?e:1e3,function(i){const c=Date.now(),u=o[a];s||(s=c),r[n]=i,o[n]=c;let h=a,p=0;for(;h!==n;)p+=r[h++],h%=t;if(n=(n+1)%t,n===a&&(a=(a+1)%t),c-s<e)return;const d=u&&c-u;return d?Math.round(1e3*p/d):void 0}}(50,250);return s=>{const n=s.loaded,a=s.lengthComputable?s.total:void 0,i=n-r,c=o(i);r=n;const u={loaded:n,total:a,progress:a?n/a:void 0,bytes:i,rate:c||void 0,estimated:c&&a&&n<=a?(a-n)/c:void 0,event:s};u[e?"download":"upload"]=!0,t(u)}}const St={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){let o=t.data;const s=dt.from(t.headers).normalize(),n=t.responseType;let a;function i(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}$.isFormData(o)&&(et.isStandardBrowserEnv||et.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",r=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.set("Authorization","Basic "+btoa(e+":"+r))}const u=Ot(t.baseURL,t.url);function h(){if(!c)return;const o=dt.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(t,e,r){const o=r.config.validateStatus;r.status&&o&&!o(r.status)?e(new G("Request failed with status code "+r.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}((function(t){e(t),i()}),(function(t){r(t),i()}),{data:n&&"text"!==n&&"json"!==n?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:o,config:t,request:c}),c=null}if(c.open(t.method.toUpperCase(),Q(u,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=h:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(h)},c.onabort=function(){c&&(r(new G("Request aborted",G.ECONNABORTED,t,c)),c=null)},c.onerror=function(){r(new G("Network Error",G.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const o=t.transitional||tt;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(new G(e,o.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,t,c)),c=null},et.isStandardBrowserEnv){const e=(t.withCredentials||Et(u))&&t.xsrfCookieName&>.read(t.xsrfCookieName);e&&s.set(t.xsrfHeaderName,e)}void 0===o&&s.setContentType(null),"setRequestHeader"in c&&$.forEach(s.toJSON(),(function(t,e){c.setRequestHeader(e,t)})),$.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),n&&"json"!==n&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",Tt(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Tt(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=e=>{c&&(r(!e||e.type?new yt(null,t,c):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const p=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(u);p&&-1===et.protocols.indexOf(p)?r(new G("Unsupported protocol "+p+":",G.ERR_BAD_REQUEST,t)):c.send(o||null)}))}};$.forEach(St,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));function qt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new yt(null,t)}function Ct(t){return qt(t),t.headers=dt.from(t.headers),t.data=lt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),(t=>{t=$.isArray(t)?t:[t];const{length:e}=t;let r,o;for(let s=0;s<e&&(r=t[s],!(o=$.isString(r)?St[r.toLowerCase()]:r));s++);if(!o){if(!1===o)throw new G(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error($.hasOwnProp(St,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!$.isFunction(o))throw new TypeError("adapter is not a function");return o})(t.adapter||nt.adapter)(t).then((function(e){return qt(t),e.data=lt.call(t,t.transformResponse,e),e.headers=dt.from(e.headers),e}),(function(e){return mt(e)||(qt(t),e&&e.response&&(e.response.data=lt.call(t,t.transformResponse,e.response),e.response.headers=dt.from(e.response.headers))),Promise.reject(e)}))}const Rt=t=>t instanceof dt?t.toJSON():t;function wt(t,e){e=e||{};const r={};function o(t,e,r){return $.isPlainObject(t)&&$.isPlainObject(e)?$.merge.call({caseless:r},t,e):$.isPlainObject(e)?$.merge({},e):$.isArray(e)?e.slice():e}function s(t,e,r){return $.isUndefined(e)?$.isUndefined(t)?void 0:o(void 0,t,r):o(t,e,r)}function n(t,e){if(!$.isUndefined(e))return o(void 0,e)}function a(t,e){return $.isUndefined(e)?$.isUndefined(t)?void 0:o(void 0,t):o(void 0,e)}function i(r,s,n){return n in e?o(r,s):n in t?o(void 0,r):void 0}const c={url:n,method:n,data:n,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:i,headers:(t,e)=>s(Rt(t),Rt(e),!0)};return $.forEach(Object.keys(t).concat(Object.keys(e)),(function(o){const n=c[o]||s,a=n(t[o],e[o],o);$.isUndefined(a)&&n!==i||(r[o]=a)})),r}const bt={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{bt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const xt={};bt.transitional=function(t,e,r){function o(t,e){return"[Axios v1.3.4] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,s,n)=>{if(!1===t)throw new G(o(s," has been removed"+(e?" in "+e:"")),G.ERR_DEPRECATED);return e&&!xt[s]&&(xt[s]=!0,console.warn(o(s," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,s,n)}};const vt={assertOptions:function(t,e,r){if("object"!=typeof t)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const o=Object.keys(t);let s=o.length;for(;s-- >0;){const n=o[s],a=e[n];if(a){const e=t[n],r=void 0===e||a(e,n,t);if(!0!==r)throw new G("option "+n+" must be "+r,G.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new G("Unknown option "+n,G.ERR_BAD_OPTION)}},validators:bt},kt=vt.validators;class Pt{constructor(t){this.defaults=t,this.interceptors={request:new Z,response:new Z}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=wt(this.defaults,e);const{transitional:r,paramsSerializer:o,headers:s}=e;let n;void 0!==r&&vt.assertOptions(r,{silentJSONParsing:kt.transitional(kt.boolean),forcedJSONParsing:kt.transitional(kt.boolean),clarifyTimeoutError:kt.transitional(kt.boolean)},!1),void 0!==o&&vt.assertOptions(o,{encode:kt.function,serialize:kt.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),n=s&&$.merge(s.common,s[e.method]),n&&$.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete s[t]})),e.headers=dt.concat(n,s);const a=[];let i=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(i=i&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let h,p=0;if(!i){const t=[Ct.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),h=t.length,u=Promise.resolve(e);p<h;)u=u.then(t[p++],t[p++]);return u}h=a.length;let d=e;for(p=0;p<h;){const t=a[p++],e=a[p++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=Ct.call(this,d)}catch(t){return Promise.reject(t)}for(p=0,h=c.length;p<h;)u=u.then(c[p++],c[p++]);return u}getUri(t){return Q(Ot((t=wt(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}$.forEach(["delete","get","head","options"],(function(t){Pt.prototype[t]=function(e,r){return this.request(wt(r||{},{method:t,url:e,data:(r||{}).data}))}})),$.forEach(["post","put","patch"],(function(t){function e(e){return function(r,o,s){return this.request(wt(s||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Pt.prototype[t]=e(),Pt.prototype[t+"Form"]=e(!0)}));const At=Pt;class jt{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const r=this;this.promise.then((t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const o=new Promise((t=>{r.subscribe(t),e=t})).then(t);return o.cancel=function(){r.unsubscribe(e)},o},t((function(t,o,s){r.reason||(r.reason=new yt(t,o,s),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new jt((function(e){t=e})),cancel:t}}}const It=jt,Bt={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(Bt).forEach((([t,e])=>{Bt[e]=t}));const _t=Bt,Nt=function t(e){const r=new At(e),o=s(At.prototype.request,r);return $.extend(o,At.prototype,r,{allOwnKeys:!0}),$.extend(o,r,null,{allOwnKeys:!0}),o.create=function(r){return t(wt(e,r))},o}(nt);Nt.Axios=At,Nt.CanceledError=yt,Nt.CancelToken=It,Nt.isCancel=mt,Nt.VERSION="1.3.4",Nt.toFormData=z,Nt.AxiosError=G,Nt.Cancel=Nt.CanceledError,Nt.all=function(t){return Promise.all(t)},Nt.spread=function(t){return function(e){return t.apply(null,e)}},Nt.isAxiosError=function(t){return $.isObject(t)&&!0===t.isAxiosError},Nt.mergeConfig=wt,Nt.AxiosHeaders=dt,Nt.formToJSON=t=>rt($.isHTMLForm(t)?new FormData(t):t),Nt.HttpStatusCode=_t,Nt.default=Nt;const $t=Nt,{Axios:Dt,AxiosError:Kt,CanceledError:Lt,isCancel:Gt,CancelToken:Mt,VERSION:Ut,all:Ft,Cancel:Ht,isAxiosError:zt,spread:Jt,toFormData:Vt,AxiosHeaders:Wt,HttpStatusCode:Xt,formToJSON:Yt,mergeConfig:Qt}=$t;function Zt(t){let e={};if(t instanceof Wt){const r=t.toJSON();e={},Object.entries(r).forEach((([t,r])=>{const o=t.toLowerCase();"boolean"==typeof r||"number"==typeof r||"string"==typeof r?e[o]=r.toString():Array.isArray(r)&&(e[o]=r.join(", "))}))}return Object.keys(e).length?e:void 0}function te(t,e){return"isAxiosError"in t?{request:{url:t.config?.url??"",method:t.config?.method,params:t.config?.params,headers:Zt(t.config?.headers),data:t.config?.data},response:{code:t.code,message:t.response?.status?void 0:t.message,status:t.response?.status,headers:Zt(t.response?.headers),data:t.response?.data},stats:e}:null}function ee(t,e){return{request:{url:t.config?.url??"",method:t.config?.method,params:t.config?.params,headers:Zt(t.config?.headers),data:t.config?.data},response:{status:t.status,headers:Zt(t.headers),data:t.data},stats:e}}var re=r(8842);const oe=500,se={maxRetries:3,delayMs:50,jitter:!0},ne=[re.Status.InternalServerError,re.Status.NotImplemented,re.Status.BadGateway,re.Status.ServiceUnavailable,re.Status.GatewayTimeout];function ae(t){return $t.create({httpsAgent:void 0})}function ie(t,e){if(!e||0===t)return 0;const r=e.delayMs*2**(t-1);if(e.jitter){const e=r*(1+1/(t+1));return Math.floor(Math.random()*e)}return r}function ce(t){let e="";if("string"!=typeof t)throw new qe("The [input] parameter must be a string");if(e=t.trim().toLowerCase(),e=e.replace(/ {2,}/g,""),e=e.replace(/&/g,"and"),e=e.replace(/[ _]/g,"-"),e=e.replace(/[^0-9a-z-]+/g,""),e=e.replace(/-{2,}/g,"-"),e.length&&"-"===e[0]&&(e=e.slice(1)),e.length&&"-"===e[e.length-1]&&(e=e.slice(0,-1)),e.length<2)throw new qe(`Formatted key did not meet minimum length of 2 characters: ${e}`);if(e.length>256)throw new qe(`Formatted key exceeds the maximum length of 256 characters: ${e}`);return e}function ue(t){if(t?.attributes?.length){const e=t.attributes?.find((e=>e.name===t.name));if(e)return e.value}return null}var he=r(3692),pe=r.n(he);function de(t){return le(t,{})}function le(t,e){if(e&&t)for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&("object"==typeof t[r]?(Array.isArray(t[r])?e[r]=[]:e[r]={},e[r]=le(t[r],e[r])):e[r]=t[r]);return e}const me=["password","refresh_token"],fe=["authorization"],ye="********";function ge(t){return Ee(t,me)}function Oe(t){return Ee(t,fe)}function Ee(t,e,r=ye){if("object"==typeof t&&null!=t){let o={};return o=de(t instanceof Wt?t.toJSON():t),pe()(o).forEach((function(){e.includes(this.key?.toLowerCase()??"")&&this.update(r)})),o}return t}async function Te(t){const e=t?.maxRetries||3,r=t?.delayMs||100,o=!!t?.jitter;for(let s=1;s<=e;s++){if(s>1){const t=ie(s-1,{delayMs:r,maxRetries:e,jitter:o});await new Promise((e=>setTimeout(e,t)))}try{return await t.executeFn(s)}catch(t){if(!t.isCommercetoolsError||t.status!==re.Status.Conflict||s===e)throw t}}}function Se(t){let e="@gradientedge/commercetools-utils";return t&&(e=`${e} (${t})`),e}class qe extends Error{constructor(t,e,r){super(t),this.isCommercetoolsError=!0,this.data=e,this.status=r,Object.setPrototypeOf(this,qe.prototype)}static fromAxiosError(t){return new qe(t.message,{code:t.code,request:{url:t.config?.url,method:t.config?.method,headers:Oe(Zt(t.config?.headers)),params:ge(t.config?.params),data:ge(this.parseRequestData(t.config))},response:{status:t.response?.status,data:ge(t.response?.data),headers:Zt(t.response?.headers)}},t.response?.status)}static parseRequestData(t){if(!t)return null;let e=t?.data;if("string"==typeof e&&e){let r="";if("string"==typeof t?.headers?.["Content-Type"]&&(r=t?.headers?.["Content-Type"]),"application/json"===r.substring(0,16))try{e=JSON.parse(t.data)}catch(t){}else if("application/x-www-form-urlencoded"===r.substring(0,33))try{const r=new URLSearchParams(t.data),o={};r.forEach(((t,e,r)=>{const s=r.getAll(e);0===s.length?o[e]="":1===s.length?o[e]=s[0]:o[e]=s})),e=o}catch(t){}}return e}toJSON(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}}toString(){return e()(this.toJSON())}}var Ce;!function(t){t.NORTH_AMERICA_GCP="north_america_gcp",t.NORTH_AMERICA_AWS="north_america_aws",t.EUROPE_GCP="europe_gcp",t.EUROPE_AWS="europe_aws",t.AUSTRALIA_GCP="australia_gcp"}(Ce||(Ce={}));const Re={[Ce.EUROPE_GCP]:{auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},[Ce.EUROPE_AWS]:{auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},[Ce.NORTH_AMERICA_GCP]:{auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},[Ce.NORTH_AMERICA_AWS]:{auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},[Ce.AUSTRALIA_GCP]:{auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"}},we=["anonymous_id","customer_id"];function be(t,e){return t?t.map((t=>`${t}:${e}`)).join(" "):""}class xe{constructor(t){var e;this.accessToken="",this.expiresIn=0,this.expiresAt=new Date,this.scopes=[],this.accessToken=t.access_token,this.expiresIn=t.expires_in,this.scopes=(e=t.scope)?e.split(" ").map((t=>t.split(":")[0])).filter((t=>!we.includes(t))):[],this.anonymousId=this.extractKeyFromScope("anonymous_id",t.scope),this.customerId=this.extractKeyFromScope("customer_id",t.scope),this.expiresAt=new Date((new Date).getTime()+1e3*t.expires_in),"refresh_token"in t&&t.refresh_token&&(this.refreshToken=t.refresh_token)}expiresWithin(t){const e=(new Date).getTime()+1e3*t;return this.expiresAt.getTime()<e}extractKeyFromScope(t,e){if(!e||!t)return;const r=e?.split(" ");if(!Array.isArray(r)||0===r.length)return;const o=r.find((e=>e.slice(0,t.length+1)===`${t}:`));return o?o.slice(t.length+1):void 0}}var ve;function ke(t){return!t.isAxiosError||!t.request||!t.response||ne.includes(t.response.status)}function Pe(t){return t.isAxiosError?qe.fromAxiosError(t):t}function Ae(t){const e=ae(t.httpsAgent),r={"User-Agent":Se(t.systemIdentifier)};return o=>{const s={...r,...o.headers};return async function(t){const{retry:e,onBeforeRequest:r,onAfterResponse:o,axiosInstance:s}=t,n=t.timeoutMs??5e3,a={};let i,c=de(t.request),u=0;Object.keys(c.headers??{}).map((t=>t.toLowerCase())).includes("user-agent")||(c.headers??(c.headers={}),c.headers["User-Agent"]=Se());let h,p,d=0;do{if(h=null,p=null,u>0){a["X-Retry-Count"]=`${u}`;const t=ie(u,e);await new Promise((e=>setTimeout(e,t)))}try{if(r){const t=await r(c);t&&(c=t)}h=Date.now();const t=await s({...c,headers:{...c.headers,...a},timeout:n});return p=Date.now(),d+=p-h,o&&o(ee(t,{accumulativeDurationMs:d,durationMs:p-h,retries:u})),t.data}catch(t){if(p=Date.now(),d+=h?p-h:0,o){const e=te(t,{accumulativeDurationMs:d,durationMs:h?p-h:0,retries:u});e&&o(e)}if(!ke(t))throw Pe(t);i=t}u++}while(u<=e.maxRetries);throw Pe(i)}({axiosInstance:e,onBeforeRequest:t.onBeforeRequest,onAfterResponse:t.onAfterResponse,request:{...o,headers:s},retry:{...se,...t.retry},timeoutMs:t.timeoutMs})}}!function(t){t.CLIENT_CREDENTIALS="client_credentials",t.REFRESH_TOKEN="refresh_token",t.PASSWORD="password"}(ve||(ve={}));class je{constructor(t){this.config=t,this.endpoints=Re[this.config.region],this.requestExecutor=Ae({timeoutMs:t.timeoutMs,httpsAgent:t.httpsAgent,systemIdentifier:t.systemIdentifier,onBeforeRequest:t.onBeforeRequest,onAfterResponse:t.onAfterResponse,retry:t.retry})}async getClientGrant(t){return this.post("/token",{grant_type:ve.CLIENT_CREDENTIALS,scope:be(t,this.config.projectKey)})}async refreshGrant(t){return await this.post("/token",{grant_type:ve.REFRESH_TOKEN,refresh_token:t})}async login(t){return this.post(`/${this.config.projectKey}${this.applyStore("/customers/token",t.storeKey)}`,{username:t.username,password:t.password,grant_type:ve.PASSWORD,scope:be(t.scopes,this.config.projectKey)})}async revokeToken(t){await this.post("/token/revoke",{token:t.tokenValue,token_type_hint:t.tokenType})}async logout(t){const e=(await Promise.allSettled([this.revokeToken({tokenType:"access_token",tokenValue:t.accessToken}),this.revokeToken({tokenType:"refresh_token",tokenValue:t.refreshToken})])).reduce(((t,e)=>("rejected"===e.status&&t.push(e.reason),t)),[]);if(e.length)throw new qe("Logout failed in one or more calls to the token revocation endpoint",e)}async getAnonymousGrant(t){const e={grant_type:ve.CLIENT_CREDENTIALS};return t?.scopes?.length&&(e.scope=be(t.scopes,this.config.projectKey)),t?.anonymousId&&(e.anonymous_id=t.anonymousId),this.post(`/${this.config.projectKey}/anonymous/token`,e)}async post(t,e){return await this.requestExecutor(this.getRequestOptions({path:t,body:e}))}getRequestOptions(t){const e=`${this.endpoints.auth}/oauth${t.path}`;let r;const o={Authorization:`Basic ${s=this.config.clientId,n=this.config.clientSecret,btoa(`${s}:${n}`)}`,"Content-Type":"application/x-www-form-urlencoded"};var s,n;return t.correlationId&&""!==t.correlationId&&(o["X-Correlation-ID"]=t.correlationId,delete t.correlationId),t.body&&(r=new URLSearchParams(t.body).toString()),{method:"POST",data:r,url:e,headers:o}}applyStore(t,e){return"string"==typeof e&&""!==e?`/in-store/key=${e}${t}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${t}`:t}}const Ie={refreshIfWithinSecs:1800,timeoutMs:5e3};class Be{constructor(t){if(this.grantPromise=null,this.config={...Ie,...t},!this.config.clientScopes.length)throw new qe("`config.clientScopes` must contain at least one scope");this.api=new je(t)}async getClientGrant(){return this.grantPromise?this.grantPromise:this.grant&&!this.grant.expiresWithin(this.config.refreshIfWithinSecs)?this.grant:(this.grantPromise=this.api.getClientGrant(this.config.clientScopes).then((t=>(this.grant=new xe(t),this.grant))).finally((()=>{this.grantPromise=null})),this.grantPromise)}async refreshCustomerGrant(t){const e=await this.api.refreshGrant(t);return new xe({...e,refresh_token:t})}async login(t){const e=t.scopes||this.config.customerScopes;if(!e)throw new qe("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const r=await this.api.login({...t,scopes:e});return new xe(r)}async getAnonymousGrant(t){const e=t?.scopes||this.config.customerScopes,r=t?.anonymousId;if(!e)throw new qe("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const o=await this.api.getAnonymousGrant({scopes:e,anonymousId:r});return new xe(o)}async logout(t){await this.api.logout(t)}async revokeToken(t){await this.api.revokeToken(t)}}class _e{constructor(t){_e.validateConfig(t),this.config=t,this.auth=new Be(t),this.endpoints=Re[this.config.region],this.requestExecutor=Ae({timeoutMs:t.timeoutMs,httpsAgent:t.httpsAgent,systemIdentifier:t.systemIdentifier,onBeforeRequest:t.onBeforeRequest,onAfterResponse:t.onAfterResponse,retry:t.retry})}getStoreById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/stores/${t.id}`,method:"GET"})}getStoreByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/stores/key=${t.key}`,method:"GET"})}queryStores(t){return this.request({...this.extractCommonRequestOptions(t),path:"/stores",method:"GET"})}createStore(t){return this.request({path:"/stores",method:"POST",data:t.data})}updateStoreById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/stores/${t.id}`,method:"POST",data:t.data})}updateStoreByKey(t){return this.request({path:`/stores/key=${t.key}`,method:"POST",data:t.data})}deleteStoreById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/stores/${t.id}`,method:"DELETE",params:{...t.params,version:t.version}})}deleteStoreByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/stores/key=${t.key}`,method:"DELETE",params:{...t.params,version:t.version}})}getCategoryById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/categories/${t.id}`,method:"GET"})}getCategoryByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/categories/key=${t.key}`,method:"GET"})}queryChannels(t){return this.request({...this.extractCommonRequestOptions(t),path:"/channels",method:"GET"})}async importOrder(t){return this.request({...this.extractCommonRequestOptions(t),path:"/orders/import",method:"POST",data:t.data})}getChannelById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/channels/${t.id}`,method:"GET"})}async getChannelByKey(t){const e=await this.request({...this.extractCommonRequestOptions(t),path:"/channels",method:"GET",params:{where:`key="${t.key}"`,limit:1}});if(!e?.count)throw new qe(`No channel found with key [${t.key}]`,null,404);return e.results[0]}getCategory(t){if(!t.id&&!t.key)throw new qe("Either an id, key or slug must be provided");return t.id?this.request({...this.extractCommonRequestOptions(t),path:`/categories/${t.id}`,method:"GET"}):this.request({...this.extractCommonRequestOptions(t),path:`/categories/key=${t.key}`,method:"GET"})}async getCategoryBySlug(t){if(!t.languageCode&&!t.languageCodes)throw new qe("Either the `languageCode` or `languageCodes` property must be provided");const e=[];t.languageCodes?e.push(...t.languageCodes):t.languageCode&&e.push(t.languageCode);const r=await this.request({...this.extractCommonRequestOptions({...t,params:{...t?.params,where:`slug(${e.map((e=>`${e}="${t.slug}"`)).join(" or ")})`}}),path:"/categories",method:"GET"});if(!r.count)throw new qe(`No category found with slug [${t.slug}] and language code [${t.languageCode}]`,{options:t},404);return r.results[0]}queryCategories(t){return this.request({...this.extractCommonRequestOptions(t),path:"/categories",method:"GET"})}async getCategoryParents(t){const e=await this.getCategory({...t,params:{...t.params,expand:"ancestors[*]"}}),r=e.ancestors.map((t=>t.obj));return r.push({...e,ancestors:e.ancestors.map((t=>({id:t.id,typeId:t.typeId})))}),r}getProductById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/${t.id}`,method:"GET"})}getProductByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/key=${t.key}`,method:"GET"})}getProductProjectionById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/product-projections/${t.id}`,t.storeKey),method:"GET"})}getProductProjectionByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/product-projections/key=${t.key}`,t.storeKey),method:"GET"})}async getProductProjectionBySlug(t){if(!t.languageCode&&!t.languageCodes)throw new qe("Either the `languageCode` or `languageCodes` property must be provided");const e=[];t.languageCodes?e.push(...t.languageCodes):t.languageCode&&e.push(t.languageCode);const r=await this.request({...this.extractCommonRequestOptions({...t,params:{...t?.params,where:`slug(${e.map((e=>`${e}="${t.slug}"`)).join(" or ")})`}}),path:"/product-projections",method:"GET"});if(!r.count)throw new qe(`No product projection found with slug [${t.slug}] and language code [${t.languageCode}]`,{options:t},404);return r.results[0]}queryProductProjections(t){return this.request({...this.extractCommonRequestOptions(t),path:"/product-projections",method:"GET"})}searchProductProjections(t){return this.request({...this.extractCommonRequestOptions(t),path:"/product-projections/search",method:"GET"})}getProductSelectionById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/product-selections/${t.id}`,t.storeKey),method:"GET"})}getProductSelectionByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/product-selections/key=${t.key}`,t.storeKey),method:"GET"})}queryProductSelections(t){return this.request({...this.extractCommonRequestOptions(t),path:"/product-selections",method:"GET"})}createProductSelection(t){return this.request({...this.extractCommonRequestOptions(t),path:"/product-selections",method:"POST",data:t.data})}updateProductSelectionByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/product-selections/key=${t.key}`,method:"POST",data:{version:t.version,actions:t.actions}})}deleteProductSelectionByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/product-selections/key=${t.key}&version=${t.version}`,method:"DELETE"})}queryProductsInStore(t){return this.request({...this.extractCommonRequestOptions(t),path:`/in-store/key=${t.storeKey}/product-selection-assignments`,method:"GET"})}getCartById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/carts/${t.id}`,t.storeKey),method:"GET"})}async queryCarts(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/carts",t?.storeKey),method:"GET"})}async queryMyCarts(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/carts",t.storeKey),method:"GET",accessToken:t.accessToken})}async createCart(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/carts",t.storeKey),method:"POST",data:t.data})}async updateCartById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/carts/${t.id}`,t.storeKey),method:"POST",data:{version:t.version,actions:t.actions}})}async getMyActiveCart(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/active-cart",t.storeKey),method:"GET",accessToken:t.accessToken})}async getMyCartById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/me/carts/${t.cartId}`,t.storeKey),method:"GET",accessToken:t.accessToken})}async createMyCart(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/carts",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken})}async updateMyCart(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/me/carts/${t.cartId}`,t.storeKey),method:"POST",data:{version:t.cartVersion,actions:t.actions},accessToken:t.accessToken})}async deleteMyActiveCart(t){const e=await this.getMyActiveCart(t);return await this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/me/carts/${e.id}`,t.storeKey),method:"DELETE",params:{...t.params,version:e.version},accessToken:t.accessToken})}async deleteMyCartById(t){const e=await this.getMyCartById(t);return await this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/me/carts/${t.cartId}`,t.storeKey),method:"DELETE",params:{...t.params,version:e.version},accessToken:t.accessToken})}async updateMyActiveCart(t){const e=await this.getMyActiveCart(t);return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/me/carts/${e.id}`,t.storeKey),method:"POST",data:{version:e.version,actions:t.actions},accessToken:t.accessToken})}async createMyOrderFromActiveCart(t){const e=await this.getMyActiveCart(t);return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/orders",t.storeKey),method:"POST",data:{version:e.version,id:e.id},accessToken:t.accessToken})}async createOrderFromCart(t){const e=await this.getCartById(t);return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/orders",t.storeKey),method:"POST",data:{version:e.version,id:e.id}})}async deleteCartById(t){return await this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/carts/${t.id}`,t.storeKey),method:"DELETE",params:{...t.params,version:t.version}})}createPayment(t){return this.request({...this.extractCommonRequestOptions(t),path:"/payments",method:"POST",data:t.data})}deletePaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/payments/${t.id}`,method:"DELETE",params:{...t.params,version:t.version}})}updatePaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/payments/${t.id}`,method:"POST",data:t.data})}getPaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/payments/${t.id}`,method:"GET"})}queryPayments(t){return this.request({...this.extractCommonRequestOptions(t),path:"/payments",method:"GET"})}createMyPayment(t){return this.request({...this.extractCommonRequestOptions(t),path:"/me/payments",method:"POST",data:t.data,accessToken:t.accessToken})}updateMyPaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/me/payments/${t.id}`,method:"POST",data:t.data,accessToken:t.accessToken})}getMyPaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/me/payments/${t.id}`,method:"GET",accessToken:t.accessToken})}queryMyPayments(t){return this.request({...this.extractCommonRequestOptions(t),path:"/me/payments",method:"GET",accessToken:t.accessToken})}deleteMyPaymentById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/me/payments/${t.id}`,method:"DELETE",params:{version:t.version},accessToken:t.accessToken})}getMyOrderById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/me/orders/${t.id}`,t.storeKey),method:"GET",accessToken:t.accessToken})}queryMyOrders(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/orders",t.storeKey),method:"GET",accessToken:t.accessToken})}updateOrderById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/${t.id}`,t.storeKey),method:"POST",data:t.data})}updateOrderByOrderNumber(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/order-number=${t.orderNumber}`,t.storeKey),method:"POST",data:t.data})}getOrderById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/${t.id}`,t.storeKey),method:"GET"})}getOrderByOrderNumber(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/order-number=${t.orderNumber}`,t.storeKey),method:"GET"})}deleteOrderById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/${t.id}`,t.storeKey),method:"DELETE",params:{...t.params,version:t.version,dataErasure:t.dataErasure}})}deleteOrderByOrderNumber(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/orders/order-number=${t.orderNo}`,t.storeKey),method:"DELETE",params:{...t.params,version:t.version,dataErasure:t.dataErasure}})}queryOrders(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/orders",t.storeKey),method:"GET"})}createProduct(t){return this.request({...this.extractCommonRequestOptions(t),path:"/products",method:"POST",data:t.data})}updateProductByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/key=${t.key}`,method:"POST",data:t.data})}updateProductById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/${t.id}`,method:"POST",data:t.data})}async deleteProductById(t){let e=t.version;return t.unpublish&&(e=(await this.unpublishProductById({id:t.id,version:t.version})).version),this.request({...this.extractCommonRequestOptions(t),path:`/products/${t.id}`,method:"DELETE",params:{...t.params,version:e}})}async deleteProductByKey(t){let e=t.version;return t.unpublish&&(e=(await this.unpublishProductByKey({key:t.key,version:t.version})).version),this.request({...this.extractCommonRequestOptions(t),path:`/products/key=${t.key}`,method:"DELETE",params:{...t.params,version:e}})}unpublishProductByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/key=${t.key}`,method:"POST",params:t.params,data:{version:t.version,actions:[{action:"unpublish"}]}})}unpublishProductById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/products/${t.id}`,method:"POST",params:t.params,data:{version:t.version,actions:[{action:"unpublish"}]}})}createCategory(t){return this.request({path:"/categories",method:"POST",data:t.data})}updateCategoryByKey(t){return this.request({path:`/categories/key=${t.key}`,method:"POST",data:t.data})}updateCategoryById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/categories/${t.id}`,method:"POST",data:t.data})}deleteCategoryById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/categories/${t.id}`,method:"DELETE",params:{...t.params,version:t.version}})}deleteCategoryByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/categories/key=${t.key}`,method:"DELETE",params:{...t.params,version:t.version}})}createAccount(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/customers",t.storeKey),method:"POST",data:t.data})}deleteCustomerById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/customers/${t.id}`,t.storeKey),method:"DELETE",params:{...t.params,version:t.version,dataErasure:t.dataErasure}})}deleteCustomerByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/customers/key=${t.key}`,t.storeKey),method:"DELETE",params:{...t.params,version:t.version,dataErasure:t.dataErasure}})}createMyAccount(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/signup",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken})}loginMyAccount(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/login",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken})}login(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/login",t.storeKey),method:"POST",data:t.data})}getMyAccount(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me",t.storeKey),method:"GET",accessToken:t.accessToken})}updateMyAccount(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data})}changeMyPassword(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/password",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data})}resetMyPassword(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/me/password/reset",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data})}getPasswordResetToken(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/customers/password-token",t.storeKey),method:"POST",data:t.data})}getCustomerById(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/customers/${t.id}`,t.storeKey),method:"GET"})}getCustomerByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/customers/key=${t.key}`,t.storeKey),method:"GET"})}getCustomerByPasswordToken(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore(`/customers/password-token=${t.token}`,t.storeKey),method:"GET"})}queryCustomers(t){return this.request({...this.extractCommonRequestOptions(t),path:this.applyStore("/customers",t.storeKey),method:"GET"})}updateCustomerById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customers/${t.id}`,method:"POST",data:t.data})}updateCustomerByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customers/key=${t.key}`,method:"POST",data:t.data})}getProductTypeById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/product-types/${t.id}`,method:"GET"})}getProductTypeByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/product-types/key=${t.key}`,method:"GET"})}queryProductTypes(t){return this.request({...this.extractCommonRequestOptions(t),path:"/product-types",method:"GET"})}getTypeById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/types/${t.id}`,method:"GET"})}getTypeByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/types/key=${t.key}`,method:"GET"})}queryTypes(t){return this.request({...this.extractCommonRequestOptions(t),path:"/types",method:"GET"})}getDiscountCodeById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/discount-codes/${t.id}`,method:"GET"})}getCartDiscountById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/cart-discounts/${t.id}`,method:"GET"})}getCartDiscountByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/cart-discounts/key=${t.key}`,method:"GET"})}queryCartDiscounts(t){return this.request({...this.extractCommonRequestOptions(t),path:"/cart-discounts",method:"GET"})}getCustomObject(t){return this.request({...this.extractCommonRequestOptions(t),path:`/custom-objects/${t.container}/${t.key}`,method:"GET"})}getCustomObjectById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/custom-objects/${t.id}`,method:"GET"})}saveCustomObject(t){return this.request({...this.extractCommonRequestOptions(t),path:"/custom-objects",method:"POST",data:t.data})}deleteCustomObject(t){return this.request({...this.extractCommonRequestOptions(t),path:`/custom-objects/${t.container}/${t.key}`,method:"DELETE"})}getShippingMethodById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/shipping-methods/${t.id}`,method:"GET"})}getShippingMethodByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/shipping-methods/key=${t.key}`,method:"GET"})}getShippingMethodsForLocation(t){return this.request({...this.extractCommonRequestOptions({...t,params:{...t?.params,country:t.country,state:t.state,currency:t.currency}}),path:"/shipping-methods/matching-location",method:"GET",accessToken:t.accessToken})}getShippingMethodsForCart(t){return this.request({...this.extractCommonRequestOptions({...t,params:{...t?.params,cartId:t.cartId}}),path:"/shipping-methods/matching-cart",method:"GET",accessToken:t.accessToken})}queryShippingMethods(t){return this.request({...this.extractCommonRequestOptions(t),path:"/shipping-methods",method:"GET"})}getCustomerGroupById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customer-groups/${t.id}`,method:"GET"})}getCustomerGroupByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customer-groups/key=${t.key}`,method:"GET"})}queryCustomerGroups(t){return this.request({...this.extractCommonRequestOptions(t),path:"/customer-groups",method:"GET"})}createCustomerGroup(t){return this.request({path:"/customer-groups",method:"POST",data:t.data})}updateCustomerGroupByKey(t){return this.request({path:`/customer-groups/key=${t.key}`,method:"POST",data:t.data})}updateCustomerGroupById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customer-groups/${t.id}`,method:"POST",data:t.data})}deleteCustomerGroupById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customer-groups/${t.id}`,method:"DELETE",params:{...t.params,version:t.version}})}deleteCustomerGroupByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/customer-groups/key=${t.key}`,method:"DELETE",params:{...t.params,version:t.version}})}getStateById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/states/${t.id}`,method:"GET"})}getStateByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/states/key=${t.key}`,method:"GET"})}queryStates(t){return this.request({...this.extractCommonRequestOptions(t),path:"/states",method:"GET"})}getStandalonePriceById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/${t.id}`,method:"GET"})}getStandalonePriceByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/key=${t.key}`,method:"GET"})}queryStandalonePrices(t){return this.request({...this.extractCommonRequestOptions(t),path:"/standalone-prices",method:"GET"})}createStandalonePrice(t){return this.request({...this.extractCommonRequestOptions(t),path:"/standalone-prices",method:"POST",data:t.data})}updateStandalonePriceById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/${t.id}`,method:"POST",data:t.data})}updateStandalonePriceByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/key=${t.key}`,method:"POST",data:t.data})}deleteStandalonePriceById(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/${t.id}`,method:"DELETE",params:{...t.params,version:t.version}})}deleteStandalonePriceByKey(t){return this.request({...this.extractCommonRequestOptions(t),path:`/standalone-prices/key=${t.key}`,method:"DELETE",params:{...t.params,version:t.version}})}graphql(t){return this.request({...this.extractCommonRequestOptions(t),path:"/graphql",method:"POST",data:t.data,accessToken:t.accessToken})}async request(t){const e=await this.getRequestOptions(t);return await this.requestExecutor(e)}async getRequestOptions(t){let e,r=t.accessToken;const o=`${this.endpoints.api}/${this.config.projectKey}${t.path}`;r||(r=(await this.auth.getClientGrant()).accessToken);const s={...t.headers,Authorization:`Bearer ${r}`};return"string"==typeof t.correlationId&&""!==t.correlationId&&(s["X-Correlation-ID"]=t.correlationId,delete t.correlationId),t.params&&Object.keys(t.params).length&&(e=t.params),{method:t.method,data:t.data,url:o,headers:s,params:e}}extractCommonRequestOptions(t){return t?{correlationId:t.correlationId,params:t.params,retry:t.retry}:{}}applyStore(t,e){return"string"==typeof e&&""!==e?`/in-store/key=${e}${t}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${t}`:t}static validateConfig(t){const e=[];if(t?(t.projectKey?"string"!=typeof t.projectKey&&e.push("The `projectKey` property must be a string"):e.push("The `projectKey` property is empty"),t.clientId?"string"!=typeof t.clientId&&e.push("The `clientId` property must be a string"):e.push("The `clientId` property is empty"),t.clientSecret?"string"!=typeof t.clientSecret&&e.push("The `clientSecret` property must be a string"):e.push("The `clientSecret` property is empty"),Array.isArray(t.clientScopes)?0===t.clientScopes.length&&e.push("The `clientScopes` property must have at least 1 scope defined"):e.push("The `clientScopes` property must be an array")):e.push("The config object missing or empty"),e.length)throw new qe("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+e.map((t=>`• ${t}`)).join("\n"))}}})();var s=o.A9,n=o.M_,a=o.Mq,i=o.h4,c=o.Eh,u=o.eJ,h=o.yp,p=o.hw,d=o.Xp,l=o.dI,m=o.gO,f=o.qX,y=o.jF,g=o.as,O=o.cY,E=o.Vl,T=o.kD,S=o.KD,q=o.Jy,C=o.s9,R=o.iS;export{s as CommercetoolsApi,n as CommercetoolsAuth,a as CommercetoolsError,i as CommercetoolsGrant,c as DEFAULT_MASKING_STRING,u as MAX_ITEMS_PER_QUERY,h as Region,p as SENSITIVE_HEADER_NAMES,d as SENSITIVE_PROPERTY_NAMES,l as buildUserAgent,m as calculateDelay,f as convertAxiosError,y as convertAxiosResponse,g as createAxiosInstance,O as extractAxiosHeaders,E as formatAsKey,T as getAttributeValue,S as maskSensitiveData,q as maskSensitiveHeaders,C as maskSensitiveInput,R as retryOnConflict};
|
|
1
|
+
var e={8842:(e,t,o)=>{t.Status=void 0;var r=o(7536);Object.defineProperty(t,"Status",{enumerable:!0,get:function(){return r.Status}});o(7890)},7890:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reason=void 0;const r=o(7536);t.reason=function(e){switch(e){case 200:return"OK";case 203:return"Non-Authoritative Information";case 207:return"Multi-Status";case 226:return"IM Used";case 414:return"URI Too Long";case 418:return"I'm a teapot";case 505:return"HTTP Version Not Supported";default:return(Object.keys(r.Status).find((t=>r.Status[t]===e))||"").replace(/(?!^)([A-Z])/gm," $1")}}},7536:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Status=t.ErrorStatus=t.RedirectionStatus=t.SuccessStatus=t.InformationStatus=void 0,t.InformationStatus={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103},t.SuccessStatus={Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226},t.RedirectionStatus={MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308},t.ErrorStatus={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,RequestedRangeNotSatisfiable: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},t.Status=Object.assign(Object.assign(Object.assign(Object.assign({},t.InformationStatus),t.SuccessStatus),t.RedirectionStatus),t.ErrorStatus)},4530:(e,t)=>{function o(e,t){var o=[],r=[];return null==t&&(t=function(e,t){return o[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,o.indexOf(t)).join(".")+"]"}),function(n,s){if(o.length>0){var a=o.indexOf(this);~a?o.splice(a+1):o.push(this),~a?r.splice(a,1/0,n):r.push(n),~o.indexOf(s)&&(s=t.call(this,n,s))}else o.push(s);return null==e?s:e.call(this,n,s)}}(e.exports=function(e,t,r,n){return JSON.stringify(e,o(t,n),r)}).getSerialize=o},3692:e=>{function t(e){return Object.prototype.toString.call(e)}var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function r(e,t){if(e.forEach)return e.forEach(t);for(var o=0;o<e.length;o++)t(e[o],o,e)}var n=Object.keys||function(e){var t=[];for(var o in e)t.push(o);return t},s=Object.prototype.hasOwnProperty||function(e,t){return t in e};function a(e){if("object"==typeof e&&null!==e){var s;if(o(e))s=[];else if("[object Date]"===t(e))s=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===t(e))s=new RegExp(e);else if(function(e){return"[object Error]"===t(e)}(e))s={message:e.message};else if(function(e){return"[object Boolean]"===t(e)}(e)||function(e){return"[object Number]"===t(e)}(e)||function(e){return"[object String]"===t(e)}(e))s=Object(e);else if(Object.create&&Object.getPrototypeOf)s=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)s={};else{var a=e.constructor&&e.constructor.prototype||e.__proto__||{},i=function(){};i.prototype=a,s=new i}return r(n(e),(function(t){s[t]=e[t]})),s}return e}function i(e,t,i){var c=[],u=[],p=!0;return function e(d){var h=i?a(d):d,m={},l=!0,f={node:h,node_:d,path:[].concat(c),parent:u[u.length-1],parents:u,key:c[c.length-1],isRoot:0===c.length,level:c.length,circular:null,update:function(e,t){f.isRoot||(f.parent.node[f.key]=e),f.node=e,t&&(l=!1)},delete:function(e){delete f.parent.node[f.key],e&&(l=!1)},remove:function(e){o(f.parent.node)?f.parent.node.splice(f.key,1):delete f.parent.node[f.key],e&&(l=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){p=!1},block:function(){l=!1}};if(!p)return f;function y(){if("object"==typeof f.node&&null!==f.node){f.keys&&f.node_===f.node||(f.keys=n(f.node)),f.isLeaf=0===f.keys.length;for(var e=0;e<u.length;e++)if(u[e].node_===d){f.circular=u[e];break}}else f.isLeaf=!0,f.keys=null;f.notLeaf=!f.isLeaf,f.notRoot=!f.isRoot}y();var g=t.call(f,f.node);return void 0!==g&&f.update&&f.update(g),m.before&&m.before.call(f,f.node),l?("object"!=typeof f.node||null===f.node||f.circular||(u.push(f),y(),r(f.keys,(function(t,o){c.push(t),m.pre&&m.pre.call(f,f.node[t],t);var r=e(f.node[t]);i&&s.call(f.node,t)&&(f.node[t]=r.node),r.isLast=o===f.keys.length-1,r.isFirst=0===o,m.post&&m.post.call(f,r),c.pop()})),u.pop()),m.after&&m.after.call(f,f.node),f):f}(e).node}function c(e){this.value=e}function u(e){return new c(e)}c.prototype.get=function(e){for(var t=this.value,o=0;o<e.length;o++){var r=e[o];if(!t||!s.call(t,r))return;t=t[r]}return t},c.prototype.has=function(e){for(var t=this.value,o=0;o<e.length;o++){var r=e[o];if(!t||!s.call(t,r))return!1;t=t[r]}return!0},c.prototype.set=function(e,t){for(var o=this.value,r=0;r<e.length-1;r++){var n=e[r];s.call(o,n)||(o[n]={}),o=o[n]}return o[e[r]]=t,t},c.prototype.map=function(e){return i(this.value,e,!0)},c.prototype.forEach=function(e){return this.value=i(this.value,e,!1),this.value},c.prototype.reduce=function(e,t){var o=1===arguments.length,r=o?this.value:t;return this.forEach((function(t){this.isRoot&&o||(r=e.call(this,r,t))})),r},c.prototype.paths=function(){var e=[];return this.forEach((function(){e.push(this.path)})),e},c.prototype.nodes=function(){var e=[];return this.forEach((function(){e.push(this.node)})),e},c.prototype.clone=function(){var e=[],t=[];return function o(s){for(var i=0;i<e.length;i++)if(e[i]===s)return t[i];if("object"==typeof s&&null!==s){var c=a(s);return e.push(s),t.push(c),r(n(s),(function(e){c[e]=o(s[e])})),e.pop(),t.pop(),c}return s}(this.value)},r(n(c.prototype),(function(e){u[e]=function(t){var o=[].slice.call(arguments,1),r=new c(t);return r[e].apply(r,o)}})),e.exports=u}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var s=t[r]={exports:{}};return e[r](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};(()=>{o.d(r,{A9:()=>_t,M_:()=>Bt,Mq:()=>Tt,h4:()=>xt,Eh:()=>gt,eJ:()=>rt,yp:()=>qt,hw:()=>yt,Xp:()=>ft,dI:()=>St,gO:()=>it,qX:()=>et,jF:()=>tt,as:()=>at,e1:()=>ct,cY:()=>Ze,Vl:()=>ut,kD:()=>pt,KD:()=>Ot,Jy:()=>Rt,s9:()=>Ct,iS:()=>Et});var e=o(4530),t=o.n(e);function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:s}=Object.prototype,{getPrototypeOf:a}=Object,i=(c=Object.create(null),e=>{const t=s.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const u=e=>(e=e.toLowerCase(),t=>i(t)===e),p=e=>t=>typeof t===e,{isArray:d}=Array,h=p("undefined"),m=u("ArrayBuffer"),l=p("string"),f=p("function"),y=p("number"),g=e=>null!==e&&"object"==typeof e,C=e=>{if("object"!==i(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)},R=u("Date"),O=u("File"),E=u("Blob"),S=u("FileList"),T=u("URLSearchParams");function q(e,t,{allOwnKeys:o=!1}={}){if(null==e)return;let r,n;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else{const n=o?Object.getOwnPropertyNames(e):Object.keys(e),s=n.length;let a;for(r=0;r<s;r++)a=n[r],t.call(null,e[a],a,e)}}function w(e,t){t=t.toLowerCase();const o=Object.keys(e);let r,n=o.length;for(;n-- >0;)if(r=o[n],t===r.toLowerCase())return r;return null}const v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,b=e=>!h(e)&&e!==v,x=(I="undefined"!=typeof Uint8Array&&a(Uint8Array),e=>I&&e instanceof I);var I;const k=u("HTMLFormElement"),P=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),A=u("RegExp"),U=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e),r={};q(o,((o,n)=>{!1!==t(o,n,e)&&(r[n]=o)})),Object.defineProperties(e,r)},j="abcdefghijklmnopqrstuvwxyz",B="0123456789",_={DIGIT:B,ALPHA:j,ALPHA_DIGIT:j+j.toUpperCase()+B},$={isArray:d,isArrayBuffer:m,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||s.call(e)===t||f(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t},isString:l,isNumber:y,isBoolean:e=>!0===e||!1===e,isObject:g,isPlainObject:C,isUndefined:h,isDate:R,isFile:O,isBlob:E,isRegExp:A,isFunction:f,isStream:e=>g(e)&&f(e.pipe),isURLSearchParams:T,isTypedArray:x,isFileList:S,forEach:q,merge:function e(){const{caseless:t}=b(this)&&this||{},o={},r=(r,n)=>{const s=t&&w(o,n)||n;C(o[s])&&C(r)?o[s]=e(o[s],r):C(r)?o[s]=e({},r):d(r)?o[s]=r.slice():o[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&q(arguments[e],r);return o},extend:(e,t,o,{allOwnKeys:r}={})=>(q(t,((t,r)=>{o&&f(t)?e[r]=n(t,o):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,o,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),o&&Object.assign(e.prototype,o)},toFlatObject:(e,t,o,r)=>{let n,s,i;const c={};if(t=t||{},null==e)return t;do{for(n=Object.getOwnPropertyNames(e),s=n.length;s-- >0;)i=n[s],r&&!r(i,e,t)||c[i]||(t[i]=e[i],c[i]=!0);e=!1!==o&&a(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:u,endsWith:(e,t,o)=>{e=String(e),(void 0===o||o>e.length)&&(o=e.length),o-=t.length;const r=e.indexOf(t,o);return-1!==r&&r===o},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!y(t))return null;const o=new Array(t);for(;t-- >0;)o[t]=e[t];return o},forEachEntry:(e,t)=>{const o=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=o.next())&&!r.done;){const o=r.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let o;const r=[];for(;null!==(o=e.exec(t));)r.push(o);return r},isHTMLForm:k,hasOwnProperty:P,hasOwnProp:P,reduceDescriptors:U,freezeMethods:e=>{U(e,((t,o)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(o))return!1;const r=e[o];f(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")}))}))},toObjectSet:(e,t)=>{const o={},r=e=>{e.forEach((e=>{o[e]=!0}))};return d(e)?r(e):r(String(e).split(t)),o},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,o){return t.toUpperCase()+o})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:w,global:v,isContextDefined:b,ALPHABET:_,generateString:(e=16,t=_.ALPHA_DIGIT)=>{let o="";const{length:r}=t;for(;e--;)o+=t[Math.random()*r|0];return o},isSpecCompliantForm:function(e){return!!(e&&f(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),o=(e,r)=>{if(g(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const n=d(e)?[]:{};return q(e,((e,t)=>{const s=o(e,r+1);!h(s)&&(n[t]=s)})),t[r]=void 0,n}}return e};return o(e,0)}};function N(e,t,o,r,n){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),o&&(this.config=o),r&&(this.request=r),n&&(this.response=n)}$.inherits(N,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:$.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const D=N.prototype,K={};["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=>{K[e]={value:e}})),Object.defineProperties(N,K),Object.defineProperty(D,"isAxiosError",{value:!0}),N.from=(e,t,o,r,n,s)=>{const a=Object.create(D);return $.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),N.call(a,e.message,t,o,r,n),a.cause=e,a.name=e.name,s&&Object.assign(a,s),a};const L=N;function G(e){return $.isPlainObject(e)||$.isArray(e)}function M(e){return $.endsWith(e,"[]")?e.slice(0,-2):e}function F(e,t,o){return e?e.concat(t).map((function(e,t){return e=M(e),!o&&t?"["+e+"]":e})).join(o?".":""):t}const H=$.toFlatObject($,{},null,(function(e){return/^is[A-Z]/.test(e)})),z=function(e,t,o){if(!$.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(o=$.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!$.isUndefined(t[e])}))).metaTokens,n=o.visitor||u,s=o.dots,a=o.indexes,i=(o.Blob||"undefined"!=typeof Blob&&Blob)&&$.isSpecCompliantForm(t);if(!$.isFunction(n))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if($.isDate(e))return e.toISOString();if(!i&&$.isBlob(e))throw new L("Blob is not supported. Use a Buffer instead.");return $.isArrayBuffer(e)||$.isTypedArray(e)?i&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,o,n){let i=e;if(e&&!n&&"object"==typeof e)if($.endsWith(o,"{}"))o=r?o:o.slice(0,-2),e=JSON.stringify(e);else if($.isArray(e)&&function(e){return $.isArray(e)&&!e.some(G)}(e)||($.isFileList(e)||$.endsWith(o,"[]"))&&(i=$.toArray(e)))return o=M(o),i.forEach((function(e,r){!$.isUndefined(e)&&null!==e&&t.append(!0===a?F([o],r,s):null===a?o:o+"[]",c(e))})),!1;return!!G(e)||(t.append(F(n,o,s),c(e)),!1)}const p=[],d=Object.assign(H,{defaultVisitor:u,convertValue:c,isVisitable:G});if(!$.isObject(e))throw new TypeError("data must be an object");return function e(o,r){if(!$.isUndefined(o)){if(-1!==p.indexOf(o))throw Error("Circular reference detected in "+r.join("."));p.push(o),$.forEach(o,(function(o,s){!0===(!($.isUndefined(o)||null===o)&&n.call(t,o,$.isString(s)?s.trim():s,r,d))&&e(o,r?r.concat(s):[s])})),p.pop()}}(e),t};function J(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function V(e,t){this._pairs=[],e&&z(e,this,t)}const W=V.prototype;W.append=function(e,t){this._pairs.push([e,t])},W.toString=function(e){const t=e?function(t){return e.call(this,t,J)}:J;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const X=V;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 Q(e,t,o){if(!t)return e;const r=o&&o.encode||Y,n=o&&o.serialize;let s;if(s=n?n(t,o):$.isURLSearchParams(t)?t.toString():new X(t,o).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Z=class{constructor(){this.handlers=[]}use(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){$.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},te={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},oe=function(e){function t(e,o,r,n){let s=e[n++];const a=Number.isFinite(+s),i=n>=e.length;return s=!s&&$.isArray(r)?r.length:s,i?($.hasOwnProp(r,s)?r[s]=[r[s],o]:r[s]=o,!a):(r[s]&&$.isObject(r[s])||(r[s]=[]),t(e,o,r[s],n)&&$.isArray(r[s])&&(r[s]=function(e){const t={},o=Object.keys(e);let r;const n=o.length;let s;for(r=0;r<n;r++)s=o[r],t[s]=e[s];return t}(r[s])),!a)}if($.isFormData(e)&&$.isFunction(e.entries)){const o={};return $.forEachEntry(e,((e,r)=>{t(function(e){return $.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,o,0)})),o}return null},re={"Content-Type":void 0},ne={transitional:ee,adapter:["xhr","http"],transformRequest:[function(e,t){const o=t.getContentType()||"",r=o.indexOf("application/json")>-1,n=$.isObject(e);if(n&&$.isHTMLForm(e)&&(e=new FormData(e)),$.isFormData(e))return r&&r?JSON.stringify(oe(e)):e;if($.isArrayBuffer(e)||$.isBuffer(e)||$.isStream(e)||$.isFile(e)||$.isBlob(e))return e;if($.isArrayBufferView(e))return e.buffer;if($.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(n){if(o.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return z(e,new te.classes.URLSearchParams,Object.assign({visitor:function(e,t,o,r){return te.isNode&&$.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=$.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return z(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return n||r?(t.setContentType("application/json",!1),function(e,t,o){if($.isString(e))try{return(0,JSON.parse)(e),$.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ne.transitional,o=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&$.isString(e)&&(o&&!this.responseType||r)){const o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw L.from(e,L.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:te.classes.FormData,Blob:te.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};$.forEach(["delete","get","head"],(function(e){ne.headers[e]={}})),$.forEach(["post","put","patch"],(function(e){ne.headers[e]=$.merge(re)}));const se=ne,ae=$.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"]),ie=Symbol("internals");function ce(e){return e&&String(e).trim().toLowerCase()}function ue(e){return!1===e||null==e?e:$.isArray(e)?e.map(ue):String(e)}function pe(e,t,o,r,n){return $.isFunction(r)?r.call(this,t,o):(n&&(t=o),$.isString(t)?$.isString(r)?-1!==t.indexOf(r):$.isRegExp(r)?r.test(t):void 0:void 0)}class de{constructor(e){e&&this.set(e)}set(e,t,o){const r=this;function n(e,t,o){const n=ce(t);if(!n)throw new Error("header name must be a non-empty string");const s=$.findKey(r,n);(!s||void 0===r[s]||!0===o||void 0===o&&!1!==r[s])&&(r[s||t]=ue(e))}const s=(e,t)=>$.forEach(e,((e,o)=>n(e,o,t)));return $.isPlainObject(e)||e instanceof this.constructor?s(e,t):$.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let o,r,n;return e&&e.split("\n").forEach((function(e){n=e.indexOf(":"),o=e.substring(0,n).trim().toLowerCase(),r=e.substring(n+1).trim(),!o||t[o]&&ae[o]||("set-cookie"===o?t[o]?t[o].push(r):t[o]=[r]:t[o]=t[o]?t[o]+", "+r:r)})),t})(e),t):null!=e&&n(t,e,o),this}get(e,t){if(e=ce(e)){const o=$.findKey(this,e);if(o){const e=this[o];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(e);)t[r[1]]=r[2];return t}(e);if($.isFunction(t))return t.call(this,e,o);if($.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ce(e)){const o=$.findKey(this,e);return!(!o||void 0===this[o]||t&&!pe(0,this[o],o,t))}return!1}delete(e,t){const o=this;let r=!1;function n(e){if(e=ce(e)){const n=$.findKey(o,e);!n||t&&!pe(0,o[n],n,t)||(delete o[n],r=!0)}}return $.isArray(e)?e.forEach(n):n(e),r}clear(e){const t=Object.keys(this);let o=t.length,r=!1;for(;o--;){const n=t[o];e&&!pe(0,this[n],n,e,!0)||(delete this[n],r=!0)}return r}normalize(e){const t=this,o={};return $.forEach(this,((r,n)=>{const s=$.findKey(o,n);if(s)return t[s]=ue(r),void delete t[n];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,o)=>t.toUpperCase()+o))}(n):String(n).trim();a!==n&&delete t[n],t[a]=ue(r),o[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return $.forEach(this,((o,r)=>{null!=o&&!1!==o&&(t[r]=e&&$.isArray(o)?o.join(", "):o)})),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 o=new this(e);return t.forEach((e=>o.set(e))),o}static accessor(e){const t=(this[ie]=this[ie]={accessors:{}}).accessors,o=this.prototype;function r(e){const r=ce(e);t[r]||(function(e,t){const o=$.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+o,{value:function(e,o,n){return this[r].call(this,t,e,o,n)},configurable:!0})}))}(o,e),t[r]=!0)}return $.isArray(e)?e.forEach(r):r(e),this}}de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$.freezeMethods(de.prototype),$.freezeMethods(de);const he=de;function me(e,t){const o=this||se,r=t||o,n=he.from(r.headers);let s=r.data;return $.forEach(e,(function(e){s=e.call(o,s,n.normalize(),t?t.status:void 0)})),n.normalize(),s}function le(e){return!(!e||!e.__CANCEL__)}function fe(e,t,o){L.call(this,null==e?"canceled":e,L.ERR_CANCELED,t,o),this.name="CanceledError"}$.inherits(fe,L,{__CANCEL__:!0});const ye=fe,ge=te.isStandardBrowserEnv?{write:function(e,t,o,r,n,s){const a=[];a.push(e+"="+encodeURIComponent(t)),$.isNumber(o)&&a.push("expires="+new Date(o).toGMTString()),$.isString(r)&&a.push("path="+r),$.isString(n)&&a.push("domain="+n),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Ce(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 Re=te.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let o;function r(o){let r=o;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 o=r(window.location.href),function(e){const t=$.isString(e)?r(e):e;return t.protocol===o.protocol&&t.host===o.host}}():function(){return!0};function Oe(e,t){let o=0;const r=function(e,t){e=e||10;const o=new Array(e),r=new Array(e);let n,s=0,a=0;return t=void 0!==t?t:1e3,function(i){const c=Date.now(),u=r[a];n||(n=c),o[s]=i,r[s]=c;let p=a,d=0;for(;p!==s;)d+=o[p++],p%=e;if(s=(s+1)%e,s===a&&(a=(a+1)%e),c-n<t)return;const h=u&&c-u;return h?Math.round(1e3*d/h):void 0}}(50,250);return n=>{const s=n.loaded,a=n.lengthComputable?n.total:void 0,i=s-o,c=r(i);o=s;const u={loaded:s,total:a,progress:a?s/a:void 0,bytes:i,rate:c||void 0,estimated:c&&a&&s<=a?(a-s)/c:void 0,event:n};u[t?"download":"upload"]=!0,e(u)}}const Ee={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,o){let r=e.data;const n=he.from(e.headers).normalize(),s=e.responseType;let a;function i(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}$.isFormData(r)&&(te.isStandardBrowserEnv||te.isStandardBrowserWebWorkerEnv)&&n.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",o=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";n.set("Authorization","Basic "+btoa(t+":"+o))}const u=Ce(e.baseURL,e.url);function p(){if(!c)return;const r=he.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,o){const r=o.config.validateStatus;o.status&&r&&!r(o.status)?t(new L("Request failed with status code "+o.status,[L.ERR_BAD_REQUEST,L.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o)):e(o)}((function(e){t(e),i()}),(function(e){o(e),i()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Q(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=p:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(p)},c.onabort=function(){c&&(o(new L("Request aborted",L.ECONNABORTED,e,c)),c=null)},c.onerror=function(){o(new L("Network Error",L.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||ee;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),o(new L(t,r.clarifyTimeoutError?L.ETIMEDOUT:L.ECONNABORTED,e,c)),c=null},te.isStandardBrowserEnv){const t=(e.withCredentials||Re(u))&&e.xsrfCookieName&&ge.read(e.xsrfCookieName);t&&n.set(e.xsrfHeaderName,t)}void 0===r&&n.setContentType(null),"setRequestHeader"in c&&$.forEach(n.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),$.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&"json"!==s&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Oe(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Oe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{c&&(o(!t||t.type?new ye(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);d&&-1===te.protocols.indexOf(d)?o(new L("Unsupported protocol "+d+":",L.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};$.forEach(Ee,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function Se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ye(null,e)}function Te(e){return Se(e),e.headers=he.from(e.headers),e.data=me.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=$.isArray(e)?e:[e];const{length:t}=e;let o,r;for(let n=0;n<t&&(o=e[n],!(r=$.isString(o)?Ee[o.toLowerCase()]:o));n++);if(!r){if(!1===r)throw new L(`Adapter ${o} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error($.hasOwnProp(Ee,o)?`Adapter '${o}' is not available in the build`:`Unknown adapter '${o}'`)}if(!$.isFunction(r))throw new TypeError("adapter is not a function");return r})(e.adapter||se.adapter)(e).then((function(t){return Se(e),t.data=me.call(e,e.transformResponse,t),t.headers=he.from(t.headers),t}),(function(t){return le(t)||(Se(e),t&&t.response&&(t.response.data=me.call(e,e.transformResponse,t.response),t.response.headers=he.from(t.response.headers))),Promise.reject(t)}))}const qe=e=>e instanceof he?e.toJSON():e;function we(e,t){t=t||{};const o={};function r(e,t,o){return $.isPlainObject(e)&&$.isPlainObject(t)?$.merge.call({caseless:o},e,t):$.isPlainObject(t)?$.merge({},t):$.isArray(t)?t.slice():t}function n(e,t,o){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e,o):r(e,t,o)}function s(e,t){if(!$.isUndefined(t))return r(void 0,t)}function a(e,t){return $.isUndefined(t)?$.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function i(o,n,s){return s in t?r(o,n):s in e?r(void 0,o):void 0}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:i,headers:(e,t)=>n(qe(e),qe(t),!0)};return $.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){const s=c[r]||n,a=s(e[r],t[r],r);$.isUndefined(a)&&s!==i||(o[r]=a)})),o}const ve={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ve[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}}));const be={};ve.transitional=function(e,t,o){function r(e,t){return"[Axios v1.3.5] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(o,n,s)=>{if(!1===e)throw new L(r(n," has been removed"+(t?" in "+t:"")),L.ERR_DEPRECATED);return t&&!be[n]&&(be[n]=!0,console.warn(r(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(o,n,s)}};const xe={assertOptions:function(e,t,o){if("object"!=typeof e)throw new L("options must be an object",L.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let n=r.length;for(;n-- >0;){const s=r[n],a=t[s];if(a){const t=e[s],o=void 0===t||a(t,s,e);if(!0!==o)throw new L("option "+s+" must be "+o,L.ERR_BAD_OPTION_VALUE)}else if(!0!==o)throw new L("Unknown option "+s,L.ERR_BAD_OPTION)}},validators:ve},Ie=xe.validators;class ke{constructor(e){this.defaults=e,this.interceptors={request:new Z,response:new Z}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=we(this.defaults,t);const{transitional:o,paramsSerializer:r,headers:n}=t;let s;void 0!==o&&xe.assertOptions(o,{silentJSONParsing:Ie.transitional(Ie.boolean),forcedJSONParsing:Ie.transitional(Ie.boolean),clarifyTimeoutError:Ie.transitional(Ie.boolean)},!1),null!=r&&($.isFunction(r)?t.paramsSerializer={serialize:r}:xe.assertOptions(r,{encode:Ie.function,serialize:Ie.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),s=n&&$.merge(n.common,n[t.method]),s&&$.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete n[e]})),t.headers=he.concat(s,n);const a=[];let i=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(i=i&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let p,d=0;if(!i){const e=[Te.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),p=e.length,u=Promise.resolve(t);d<p;)u=u.then(e[d++],e[d++]);return u}p=a.length;let h=t;for(d=0;d<p;){const e=a[d++],t=a[d++];try{h=e(h)}catch(e){t.call(this,e);break}}try{u=Te.call(this,h)}catch(e){return Promise.reject(e)}for(d=0,p=c.length;d<p;)u=u.then(c[d++],c[d++]);return u}getUri(e){return Q(Ce((e=we(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}$.forEach(["delete","get","head","options"],(function(e){ke.prototype[e]=function(t,o){return this.request(we(o||{},{method:e,url:t,data:(o||{}).data}))}})),$.forEach(["post","put","patch"],(function(e){function t(t){return function(o,r,n){return this.request(we(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}ke.prototype[e]=t(),ke.prototype[e+"Form"]=t(!0)}));const Pe=ke;class Ae{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 o=this;this.promise.then((e=>{if(!o._listeners)return;let t=o._listeners.length;for(;t-- >0;)o._listeners[t](e);o._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{o.subscribe(e),t=e})).then(e);return r.cancel=function(){o.unsubscribe(t)},r},e((function(e,r,n){o.reason||(o.reason=new ye(e,r,n),t(o.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 Ae((function(t){e=t})),cancel:e}}}const Ue=Ae,je={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(je).forEach((([e,t])=>{je[t]=e}));const Be=je,_e=function e(t){const o=new Pe(t),r=n(Pe.prototype.request,o);return $.extend(r,Pe.prototype,o,{allOwnKeys:!0}),$.extend(r,o,null,{allOwnKeys:!0}),r.create=function(o){return e(we(t,o))},r}(se);_e.Axios=Pe,_e.CanceledError=ye,_e.CancelToken=Ue,_e.isCancel=le,_e.VERSION="1.3.5",_e.toFormData=z,_e.AxiosError=L,_e.Cancel=_e.CanceledError,_e.all=function(e){return Promise.all(e)},_e.spread=function(e){return function(t){return e.apply(null,t)}},_e.isAxiosError=function(e){return $.isObject(e)&&!0===e.isAxiosError},_e.mergeConfig=we,_e.AxiosHeaders=he,_e.formToJSON=e=>oe($.isHTMLForm(e)?new FormData(e):e),_e.HttpStatusCode=Be,_e.default=_e;const $e=_e,{Axios:Ne,AxiosError:De,CanceledError:Ke,isCancel:Le,CancelToken:Ge,VERSION:Me,all:Fe,Cancel:He,isAxiosError:ze,spread:Je,toFormData:Ve,AxiosHeaders:We,HttpStatusCode:Xe,formToJSON:Ye,mergeConfig:Qe}=$e;function Ze(e){let t={};if(e instanceof We){const o=e.toJSON();t={},Object.entries(o).forEach((([e,o])=>{const r=e.toLowerCase();"boolean"==typeof o||"number"==typeof o||"string"==typeof o?t[r]=o.toString():Array.isArray(o)&&(t[r]=o.join(", "))}))}return Object.keys(t).length?t:void 0}function et(e,t){return"isAxiosError"in e?{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:Ze(e.config?.headers),data:e.config?.data},response:{code:e.code,message:e.response?.status?void 0:e.message,status:e.response?.status,headers:Ze(e.response?.headers),data:e.response?.data},stats:t}:null}function tt(e,t){return{request:{url:e.config?.url??"",method:e.config?.method,params:e.config?.params,headers:Ze(e.config?.headers),data:e.config?.data},response:{status:e.status,headers:Ze(e.headers),data:e.data},stats:t}}var ot=o(8842);const rt=500,nt={maxRetries:3,delayMs:50,jitter:!0},st=[ot.Status.InternalServerError,ot.Status.NotImplemented,ot.Status.BadGateway,ot.Status.ServiceUnavailable,ot.Status.GatewayTimeout];function at(e){return $e.create({httpsAgent:void 0})}function it(e,t){if(!t||0===e)return 0;const o=t.delayMs*2**(e-1);if(t.jitter){const t=o*(1+1/(e+1));return Math.floor(Math.random()*t)}return o}function ct(e){if(!e.value.trim())throw new Tt(`The string parameter '${e.name}' cannot be empty`)}function ut(e){let t="";if("string"!=typeof e)throw new Tt("The [input] parameter must be a string");if(t=e.trim().toLowerCase(),t=t.replace(/ {2,}/g,""),t=t.replace(/&/g,"and"),t=t.replace(/[ _]/g,"-"),t=t.replace(/[^0-9a-z-]+/g,""),t=t.replace(/-{2,}/g,"-"),t.length&&"-"===t[0]&&(t=t.slice(1)),t.length&&"-"===t[t.length-1]&&(t=t.slice(0,-1)),t.length<2)throw new Tt(`Formatted key did not meet minimum length of 2 characters: ${t}`);if(t.length>256)throw new Tt(`Formatted key exceeds the maximum length of 256 characters: ${t}`);return t}function pt(e){if(e?.attributes?.length){const t=e.attributes?.find((t=>t.name===e.name));if(t)return t.value}return null}var dt=o(3692),ht=o.n(dt);function mt(e){return lt(e,{})}function lt(e,t){if(t&&e)for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&("object"==typeof e[o]?(Array.isArray(e[o])?t[o]=[]:t[o]={},t[o]=lt(e[o],t[o])):t[o]=e[o]);return t}const ft=["password","refresh_token"],yt=["authorization"],gt="********";function Ct(e){return Ot(e,ft)}function Rt(e){return Ot(e,yt)}function Ot(e,t,o=gt){if("object"==typeof e&&null!=e){let r={};return r=mt(e instanceof We?e.toJSON():e),ht()(r).forEach((function(){t.includes(this.key?.toLowerCase()??"")&&this.update(o)})),r}return e}async function Et(e){const t=(e?.maxRetries||3)+1,o=e?.delayMs||100,r=!!e?.jitter;for(let n=1;n<=t;n++){if(n>1){const e=it(n-1,{delayMs:o,jitter:r});await new Promise((t=>setTimeout(t,e)))}try{return await e.executeFn(n)}catch(e){if(!e.isCommercetoolsError||e.status!==ot.Status.Conflict||n===t)throw e}}}function St(e){let t="@gradientedge/commercetools-utils";return e&&(t=`${t} (${e})`),t}class Tt extends Error{constructor(e,t,o){super(e),this.isCommercetoolsError=!0,this.data=t,this.status=o,Object.setPrototypeOf(this,Tt.prototype)}static fromAxiosError(e){return new Tt(e.message,{code:e.code,request:{url:e.config?.url,method:e.config?.method,headers:Rt(Ze(e.config?.headers)),params:Ct(e.config?.params),data:Ct(this.parseRequestData(e.config))},response:{status:e.response?.status,data:Ct(e.response?.data),headers:Ze(e.response?.headers)}},e.response?.status)}static parseRequestData(e){if(!e)return null;let t=e?.data;if("string"==typeof t&&t){let o="";if("string"==typeof e?.headers?.["Content-Type"]&&(o=e?.headers?.["Content-Type"]),"application/json"===o.substring(0,16))try{t=JSON.parse(e.data)}catch(e){}else if("application/x-www-form-urlencoded"===o.substring(0,33))try{const o=new URLSearchParams(e.data),r={};o.forEach(((e,t,o)=>{const n=o.getAll(t);0===n.length?r[t]="":1===n.length?r[t]=n[0]:r[t]=n})),t=r}catch(e){}}return t}toJSON(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}}toString(){return t()(this.toJSON())}}var qt;!function(e){e.NORTH_AMERICA_GCP="north_america_gcp",e.NORTH_AMERICA_AWS="north_america_aws",e.EUROPE_GCP="europe_gcp",e.EUROPE_AWS="europe_aws",e.AUSTRALIA_GCP="australia_gcp"}(qt||(qt={}));const wt={[qt.EUROPE_GCP]:{auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},[qt.EUROPE_AWS]:{auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},[qt.NORTH_AMERICA_GCP]:{auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},[qt.NORTH_AMERICA_AWS]:{auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},[qt.AUSTRALIA_GCP]:{auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"}},vt=["anonymous_id","customer_id"];function bt(e,t){return e.length?e.map((e=>`${e}:${t}`)).join(" "):""}class xt{constructor(e){var t;this.accessToken="",this.expiresIn=0,this.expiresAt=new Date,this.scopes=[],this.accessToken=e.access_token,this.expiresIn=e.expires_in,this.scopes=(t=e.scope)?t.split(" ").map((e=>e.split(":")[0])).filter((e=>!vt.includes(e))):[],this.anonymousId=this.extractKeyFromScope("anonymous_id",e.scope),this.customerId=this.extractKeyFromScope("customer_id",e.scope),this.expiresAt=new Date((new Date).getTime()+1e3*e.expires_in),"refresh_token"in e&&e.refresh_token&&(this.refreshToken=e.refresh_token)}expiresWithin(e){const t=(new Date).getTime()+1e3*e;return this.expiresAt.getTime()<t}extractKeyFromScope(e,t){if(!t||!e)return;const o=t?.split(" ");if(!Array.isArray(o)||0===o.length)return;const r=o.find((t=>t.slice(0,e.length+1)===`${e}:`));return r?r.slice(e.length+1):void 0}}var It;function kt(e){return!e.isAxiosError||!e.request||!e.response||st.includes(e.response.status)}function Pt(e){return e.isAxiosError?Tt.fromAxiosError(e):e}function At(e){const t=at(e.httpsAgent),o={"User-Agent":St(e.systemIdentifier)};return r=>{const n={...o,...r.headers};return async function(e){const{retry:t,onBeforeRequest:o,onAfterResponse:r,axiosInstance:n}=e,s=e.timeoutMs??5e3,a={};let i,c=mt(e.request),u=0;Object.keys(c.headers??{}).map((e=>e.toLowerCase())).includes("user-agent")||(c.headers??(c.headers={}),c.headers["User-Agent"]=St());let p,d,h=0;do{if(p=null,d=null,u>0){a["X-Retry-Count"]=`${u}`;const e=it(u,t);await new Promise((t=>setTimeout(t,e)))}try{if(o){const e=await o(c);e&&(c=e)}p=Date.now();const e=await n({...c,headers:{...c.headers,...a},timeout:s});return d=Date.now(),h+=d-p,r&&r(tt(e,{accumulativeDurationMs:h,durationMs:d-p,retries:u})),e.data}catch(e){if(d=Date.now(),h+=p?d-p:0,r){const t=et(e,{accumulativeDurationMs:h,durationMs:p?d-p:0,retries:u});t&&r(t)}if(!kt(e))throw Pt(e);i=e}u++}while(u<=t.maxRetries);throw Pt(i)}({axiosInstance:t,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,request:{...r,headers:n},retry:{...nt,...e.retry},timeoutMs:e.timeoutMs})}}!function(e){e.CLIENT_CREDENTIALS="client_credentials",e.REFRESH_TOKEN="refresh_token",e.PASSWORD="password"}(It||(It={}));class Ut{constructor(e){this.config=e,this.endpoints=wt[this.config.region],this.requestExecutor=At({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}async getClientGrant(e){return this.post("/token",{grant_type:It.CLIENT_CREDENTIALS,scope:bt(e,this.config.projectKey)})}async refreshGrant(e){return await this.post("/token",{grant_type:It.REFRESH_TOKEN,refresh_token:e})}async login(e){return this.post(`/${this.config.projectKey}${this.applyStore("/customers/token",e.storeKey)}`,{username:e.username,password:e.password,grant_type:It.PASSWORD,scope:bt(e.scopes,this.config.projectKey)})}async revokeToken(e){await this.post("/token/revoke",{token:e.tokenValue,token_type_hint:e.tokenType})}async logout(e){const t=(await Promise.allSettled([this.revokeToken({tokenType:"access_token",tokenValue:e.accessToken}),this.revokeToken({tokenType:"refresh_token",tokenValue:e.refreshToken})])).reduce(((e,t)=>("rejected"===t.status&&e.push(t.reason),e)),[]);if(t.length)throw new Tt("Logout failed in one or more calls to the token revocation endpoint",t)}async getAnonymousGrant(e){const t={grant_type:It.CLIENT_CREDENTIALS};return e?.scopes?.length&&(t.scope=bt(e.scopes,this.config.projectKey)),e?.anonymousId&&(t.anonymous_id=e.anonymousId),this.post(`/${this.config.projectKey}/anonymous/token`,t)}async post(e,t){return await this.requestExecutor(this.getRequestOptions({path:e,body:t}))}getRequestOptions(e){const t=`${this.endpoints.auth}/oauth${e.path}`;let o;const r={Authorization:`Basic ${n=this.config.clientId,s=this.config.clientSecret,btoa(`${n}:${s}`)}`,"Content-Type":"application/x-www-form-urlencoded"};var n,s;return e.correlationId&&""!==e.correlationId&&(r["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.body&&(o=new URLSearchParams(e.body).toString()),{method:"POST",data:o,url:t,headers:r}}applyStore(e,t){return"string"==typeof t&&""!==t?`/in-store/key=${t}${e}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${e}`:e}}const jt={refreshIfWithinSecs:1800,timeoutMs:5e3};class Bt{constructor(e){if(this.grantPromise=null,this.config={...jt,...e},!this.config.clientScopes.length)throw new Tt("`config.clientScopes` must contain at least one scope");this.api=new Ut(e)}async getClientGrant(){return this.grantPromise?this.grantPromise:this.grant&&!this.grant.expiresWithin(this.config.refreshIfWithinSecs)?this.grant:(this.grantPromise=this.api.getClientGrant(this.config.clientScopes).then((e=>(this.grant=new xt(e),this.grant))).finally((()=>{this.grantPromise=null})),this.grantPromise)}async refreshCustomerGrant(e){const t=await this.api.refreshGrant(e);return new xt({...t,refresh_token:e})}async login(e){const t=e.scopes||this.config.customerScopes;if(!t)throw new Tt("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const o=await this.api.login({...e,scopes:t});return new xt(o)}async getAnonymousGrant(e){const t=e?.scopes||this.config.customerScopes,o=e?.anonymousId;if(!t)throw new Tt("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");await this.getClientGrant();const r=await this.api.getAnonymousGrant({scopes:t,anonymousId:o});return new xt(r)}async logout(e){await this.api.logout(e)}async revokeToken(e){await this.api.revokeToken(e)}}class _t{constructor(e){_t.validateConfig(e),this.config=e,this.auth=new Bt(e),this.endpoints=wt[this.config.region],this.requestExecutor=At({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}getStoreById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/stores/${encodeURIComponent(e.id)}`,method:"GET"})}getStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryStores(e){return this.request({...this.extractCommonRequestOptions(e),path:"/stores",method:"GET"})}createStore(e){return this.request({path:"/stores",method:"POST",data:e.data})}updateStoreById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/stores/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}updateStoreByKey(e){return this.request({path:`/stores/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}deleteStoreById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/stores/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStoreByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/stores/key=${encodeURIComponent(e.key)}`,method:"DELETE",params:{...e.params,version:e.version}})}getCategoryById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"GET"})}getCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryChannels(e){return this.request({...this.extractCommonRequestOptions(e),path:"/channels",method:"GET"})}async importOrder(e){return this.request({...this.extractCommonRequestOptions(e),path:"/orders/import",method:"POST",data:e.data})}getChannelById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/channels/${encodeURIComponent(e.id)}`,method:"GET"})}async getChannelByKey(e){const t=await this.request({...this.extractCommonRequestOptions(e),path:"/channels",method:"GET",params:{where:`key="${encodeURIComponent(e.key)}"`,limit:1}});if(!t?.count)throw new Tt(`No channel found with key [${e.key}]`,null,404);return t.results[0]}getCategory(e){if(!e.id&&!e.key)throw new Tt("Either an id, key or slug must be provided");return e.id?(ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"GET"})):this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${encodeURIComponent(e.key??"")}`,method:"GET"})}async getCategoryBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new Tt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const o=await this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,where:`slug(${t.map((t=>`${t}="${e.slug}"`)).join(" or ")})`}}),path:"/categories",method:"GET"});if(!o.count)throw new Tt(`No category found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return o.results[0]}queryCategories(e){return this.request({...this.extractCommonRequestOptions(e),path:"/categories",method:"GET"})}async getCategoryParents(e){const t=await this.getCategory({...e,params:{...e.params,expand:"ancestors[*]"}}),o=t.ancestors.map((e=>e.obj));return o.push({...t,ancestors:t.ancestors.map((e=>({id:e.id,typeId:e.typeId})))}),o}getProductById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/products/${encodeURIComponent(e.id)}`,method:"GET"})}getProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${encodeURIComponent(e.key)}`,method:"GET"})}getProductProjectionById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getProductProjectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-projections/key=${encodeURIComponent(e.key)}`,e.storeKey),method:"GET"})}async getProductProjectionBySlug(e){if(!e.languageCode&&!e.languageCodes)throw new Tt("Either the `languageCode` or `languageCodes` property must be provided");const t=[];e.languageCodes?t.push(...e.languageCodes):e.languageCode&&t.push(e.languageCode);const o=await this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,where:`slug(${t.map((t=>`${t}="${e.slug}"`)).join(" or ")})`}}),path:"/product-projections",method:"GET"});if(!o.count)throw new Tt(`No product projection found with slug [${e.slug}] and language code [${e.languageCode}]`,{options:e},404);return o.results[0]}queryProductProjections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-projections",method:"GET"})}searchProductProjections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-projections/search",method:"GET"})}getProductSelectionById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/product-selections/key=${encodeURIComponent(e.key)}`,e.storeKey),method:"GET"})}queryProductSelections(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-selections",method:"GET"})}createProductSelection(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-selections",method:"POST",data:e.data})}updateProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-selections/key=${encodeURIComponent(e.key)}`,method:"POST",data:{version:e.version,actions:e.actions}})}deleteProductSelectionByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-selections/key=${encodeURIComponent(e.key)}&version=${encodeURIComponent(e.version)}`,method:"DELETE"})}queryProductsInStore(e){return this.request({...this.extractCommonRequestOptions(e),path:`/in-store/key=${encodeURIComponent(e.storeKey??"")}/product-selection-assignments`,method:"GET"})}getCartById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}async queryCarts(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/carts",e?.storeKey),method:"GET"})}async queryMyCarts(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/carts",e.storeKey),method:"GET",accessToken:e.accessToken})}async createCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/carts",e.storeKey),method:"POST",data:e.data})}async updateCartById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${encodeURIComponent(e.id)}`,e.storeKey),method:"POST",data:{version:e.version,actions:e.actions}})}async getMyActiveCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/active-cart",e.storeKey),method:"GET",accessToken:e.accessToken})}async getMyCartById(e){return ct({value:e.cartId,name:"cartId"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(e.cartId)}`,e.storeKey),method:"GET",accessToken:e.accessToken})}async createMyCart(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/carts",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}async updateMyCart(e){return ct({value:e.cartId,name:"cartId"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(e.cartId)}`,e.storeKey),method:"POST",data:{version:e.cartVersion,actions:e.actions},accessToken:e.accessToken})}async deleteMyActiveCart(e){const t=await this.getMyActiveCart(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(t.id)}`,e.storeKey),method:"DELETE",params:{...e.params,version:t.version},accessToken:e.accessToken})}async deleteMyCartById(e){ct({value:e.cartId,name:"cartId"});const t=await this.getMyCartById(e);return await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(e.cartId)}`,e.storeKey),method:"DELETE",params:{...e.params,version:t.version},accessToken:e.accessToken})}async updateMyActiveCart(e){const t=await this.getMyActiveCart(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/carts/${encodeURIComponent(t.id)}`,e.storeKey),method:"POST",data:{version:t.version,actions:e.actions},accessToken:e.accessToken})}async createMyOrderFromActiveCart(e){const t=await this.getMyActiveCart(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/orders",e.storeKey),method:"POST",data:{version:t.version,id:t.id},accessToken:e.accessToken})}async createOrderFromCart(e){const t=await this.getCartById(e);return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/orders",e.storeKey),method:"POST",data:{version:t.version,id:t.id}})}async deleteCartById(e){return ct({value:e.id,name:"id"}),await this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/carts/${encodeURIComponent(e.id)}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version}})}createPayment(e){return this.request({...this.extractCommonRequestOptions(e),path:"/payments",method:"POST",data:e.data})}deletePaymentById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/payments/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}updatePaymentById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/payments/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}getPaymentById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/payments/${encodeURIComponent(e.id)}`,method:"GET"})}queryPayments(e){return this.request({...this.extractCommonRequestOptions(e),path:"/payments",method:"GET"})}createMyPayment(e){return this.request({...this.extractCommonRequestOptions(e),path:"/me/payments",method:"POST",data:e.data,accessToken:e.accessToken})}updateMyPaymentById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${encodeURIComponent(e.id)}`,method:"POST",data:e.data,accessToken:e.accessToken})}getMyPaymentById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${encodeURIComponent(e.id)}`,method:"GET",accessToken:e.accessToken})}queryMyPayments(e){return this.request({...this.extractCommonRequestOptions(e),path:"/me/payments",method:"GET",accessToken:e.accessToken})}deleteMyPaymentById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/me/payments/${encodeURIComponent(e.id)}`,method:"DELETE",params:{version:e.version},accessToken:e.accessToken})}getMyOrderById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/me/orders/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET",accessToken:e.accessToken})}queryMyOrders(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/orders",e.storeKey),method:"GET",accessToken:e.accessToken})}updateOrderById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${encodeURIComponent(e.id)}`,e.storeKey),method:"POST",data:e.data})}updateOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${encodeURIComponent(e.orderNumber)}`,e.storeKey),method:"POST",data:e.data})}getOrderById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${encodeURIComponent(e.orderNumber)}`,e.storeKey),method:"GET"})}deleteOrderById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/${encodeURIComponent(e.id)}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}deleteOrderByOrderNumber(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/orders/order-number=${encodeURIComponent(e.orderNo)}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}queryOrders(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/orders",e.storeKey),method:"GET"})}createProduct(e){return this.request({...this.extractCommonRequestOptions(e),path:"/products",method:"POST",data:e.data})}updateProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}updateProductById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/products/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}async deleteProductById(e){ct({value:e.id,name:"id"});let t=e.version;return e.unpublish&&(t=(await this.unpublishProductById({id:e.id,version:e.version})).version),this.request({...this.extractCommonRequestOptions(e),path:`/products/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:t}})}async deleteProductByKey(e){let t=e.version;return e.unpublish&&(t=(await this.unpublishProductByKey({key:e.key,version:e.version})).version),this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${encodeURIComponent(e.key)}`,method:"DELETE",params:{...e.params,version:t}})}unpublishProductByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/products/key=${encodeURIComponent(e.key)}`,method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}})}unpublishProductById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/products/${encodeURIComponent(e.id)}`,method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}})}createCategory(e){return this.request({path:"/categories",method:"POST",data:e.data})}updateCategoryByKey(e){return this.request({path:`/categories/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}updateCategoryById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}deleteCategoryById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/categories/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCategoryByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/categories/key=${encodeURIComponent(e.key)}`,method:"DELETE",params:{...e.params,version:e.version}})}createAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers",e.storeKey),method:"POST",data:e.data})}deleteCustomerById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${encodeURIComponent(e.id)}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}deleteCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/key=${encodeURIComponent(e.key)}`,e.storeKey),method:"DELETE",params:{...e.params,version:e.version,dataErasure:e.dataErasure}})}createMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/signup",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}loginMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/login",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken})}login(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/login",e.storeKey),method:"POST",data:e.data})}getMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me",e.storeKey),method:"GET",accessToken:e.accessToken})}updateMyAccount(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}changeMyPassword(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/password",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}resetMyPassword(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/me/password/reset",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data})}getPasswordResetToken(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers/password-token",e.storeKey),method:"POST",data:e.data})}getCustomerById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/${encodeURIComponent(e.id)}`,e.storeKey),method:"GET"})}getCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/key=${encodeURIComponent(e.key)}`,e.storeKey),method:"GET"})}getCustomerByPasswordToken(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore(`/customers/password-token=${encodeURIComponent(e.token)}`,e.storeKey),method:"GET"})}queryCustomers(e){return this.request({...this.extractCommonRequestOptions(e),path:this.applyStore("/customers",e.storeKey),method:"GET"})}updateCustomerById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customers/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}updateCustomerByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customers/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}getProductTypeById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/product-types/${encodeURIComponent(e.id)}`,method:"GET"})}getProductTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/product-types/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryProductTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/product-types",method:"GET"})}getTypeById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/types/${encodeURIComponent(e.id)}`,method:"GET"})}getTypeByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/types/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryTypes(e){return this.request({...this.extractCommonRequestOptions(e),path:"/types",method:"GET"})}getDiscountCodeById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/discount-codes/${encodeURIComponent(e.id)}`,method:"GET"})}getCartDiscountById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/${encodeURIComponent(e.id)}`,method:"GET"})}getCartDiscountByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/cart-discounts/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryCartDiscounts(e){return this.request({...this.extractCommonRequestOptions(e),path:"/cart-discounts",method:"GET"})}getCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${encodeURIComponent(e.container)}/${encodeURIComponent(e.key)}`,method:"GET"})}getCustomObjectById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${encodeURIComponent(e.id)}`,method:"GET"})}saveCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:"/custom-objects",method:"POST",data:e.data})}deleteCustomObject(e){return this.request({...this.extractCommonRequestOptions(e),path:`/custom-objects/${encodeURIComponent(e.container)}/${encodeURIComponent(e.key)}`,method:"DELETE"})}getShippingMethodById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/${encodeURIComponent(e.id)}`,method:"GET"})}getShippingMethodByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/shipping-methods/key=${encodeURIComponent(e.key)}`,method:"GET"})}getShippingMethodsForLocation(e){return this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,country:e.country,state:e.state,currency:e.currency}}),path:"/shipping-methods/matching-location",method:"GET",accessToken:e.accessToken})}getShippingMethodsForCart(e){return this.request({...this.extractCommonRequestOptions({...e,params:{...e?.params,cartId:e.cartId}}),path:"/shipping-methods/matching-cart",method:"GET",accessToken:e.accessToken})}queryShippingMethods(e){return this.request({...this.extractCommonRequestOptions(e),path:"/shipping-methods",method:"GET"})}getCustomerGroupById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${encodeURIComponent(e.id)}`,method:"GET"})}getCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryCustomerGroups(e){return this.request({...this.extractCommonRequestOptions(e),path:"/customer-groups",method:"GET"})}createCustomerGroup(e){return this.request({path:"/customer-groups",method:"POST",data:e.data})}updateCustomerGroupByKey(e){return this.request({path:`/customer-groups/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}updateCustomerGroupById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}deleteCustomerGroupById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteCustomerGroupByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/customer-groups/key=${encodeURIComponent(e.key)}`,method:"DELETE",params:{...e.params,version:e.version}})}getStateById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/states/${encodeURIComponent(e.id)}`,method:"GET"})}getStateByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/states/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryStates(e){return this.request({...this.extractCommonRequestOptions(e),path:"/states",method:"GET"})}getStandalonePriceById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${encodeURIComponent(e.id)}`,method:"GET"})}getStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${encodeURIComponent(e.key)}`,method:"GET"})}queryStandalonePrices(e){return this.request({...this.extractCommonRequestOptions(e),path:"/standalone-prices",method:"GET"})}createStandalonePrice(e){return this.request({...this.extractCommonRequestOptions(e),path:"/standalone-prices",method:"POST",data:e.data})}updateStandalonePriceById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${encodeURIComponent(e.id)}`,method:"POST",data:e.data})}updateStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${encodeURIComponent(e.key)}`,method:"POST",data:e.data})}deleteStandalonePriceById(e){return ct({value:e.id,name:"id"}),this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/${encodeURIComponent(e.id)}`,method:"DELETE",params:{...e.params,version:e.version}})}deleteStandalonePriceByKey(e){return this.request({...this.extractCommonRequestOptions(e),path:`/standalone-prices/key=${encodeURIComponent(e.key)}`,method:"DELETE",params:{...e.params,version:e.version}})}graphql(e){return this.request({...this.extractCommonRequestOptions(e),path:"/graphql",method:"POST",data:e.data,accessToken:e.accessToken})}async request(e){const t=await this.getRequestOptions(e);return await this.requestExecutor(t)}async getRequestOptions(e){let t,o=e.accessToken;const r=`${this.endpoints.api}/${this.config.projectKey}${e.path}`;o||(o=(await this.auth.getClientGrant()).accessToken);const n={...e.headers,Authorization:`Bearer ${o}`};return"string"==typeof e.correlationId&&""!==e.correlationId&&(n["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.params&&Object.keys(e.params).length&&(t=e.params),{method:e.method,data:e.data,url:r,headers:n,params:t}}extractCommonRequestOptions(e){return e?{correlationId:e.correlationId,params:e.params,retry:e.retry}:{}}applyStore(e,t){return"string"==typeof t&&""!==t?`/in-store/key=${t}${e}`:this.config.storeKey?`/in-store/key=${this.config.storeKey}${e}`:e}static validateConfig(e){const t=[];if(e?(e.projectKey?"string"!=typeof e.projectKey&&t.push("The `projectKey` property must be a string"):t.push("The `projectKey` property is empty"),e.clientId?"string"!=typeof e.clientId&&t.push("The `clientId` property must be a string"):t.push("The `clientId` property is empty"),e.clientSecret?"string"!=typeof e.clientSecret&&t.push("The `clientSecret` property must be a string"):t.push("The `clientSecret` property is empty"),Array.isArray(e.clientScopes)?0===e.clientScopes.length&&t.push("The `clientScopes` property must have at least 1 scope defined"):t.push("The `clientScopes` property must be an array")):t.push("The config object missing or empty"),t.length)throw new Tt("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+t.map((e=>`• ${e}`)).join("\n"))}}})();var n=r.A9,s=r.M_,a=r.Mq,i=r.h4,c=r.Eh,u=r.eJ,p=r.yp,d=r.hw,h=r.Xp,m=r.dI,l=r.gO,f=r.qX,y=r.jF,g=r.as,C=r.e1,R=r.cY,O=r.Vl,E=r.kD,S=r.KD,T=r.Jy,q=r.s9,w=r.iS;export{n as CommercetoolsApi,s as CommercetoolsAuth,a as CommercetoolsError,i as CommercetoolsGrant,c as DEFAULT_MASKING_STRING,u as MAX_ITEMS_PER_QUERY,p as Region,d as SENSITIVE_HEADER_NAMES,h as SENSITIVE_PROPERTY_NAMES,m as buildUserAgent,l as calculateDelay,f as convertAxiosError,y as convertAxiosResponse,g as createAxiosInstance,C as ensureNonEmptyString,R as extractAxiosHeaders,O as formatAsKey,E as getAttributeValue,S as maskSensitiveData,T as maskSensitiveHeaders,q as maskSensitiveInput,w as retryOnConflict};
|
|
2
2
|
//# sourceMappingURL=ge-commercetools-utils-browser.esm.js.map
|