@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.
@@ -1,2 +1,2 @@
1
- var t={9818:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsApi=void 0;var i=o(2915),a=o(3028),c=o(7111),u=o(7034),p=function(){function t(e){t.validateConfig(e),this.config=e,this.auth=new i.CommercetoolsAuth(e),this.endpoints=c.REGION_URLS[this.config.region],this.requestExecutor=(0,u.getRequestExecutor)({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}return t.prototype.getStoreById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/".concat(t.id),method:"GET"}))},t.prototype.getStoreByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/key=".concat(t.key),method:"GET"}))},t.prototype.queryStores=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores",method:"GET"}))},t.prototype.createStore=function(t){return this.request({path:"/stores",method:"POST",data:t.data})},t.prototype.updateStoreById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/".concat(t.id),method:"POST",data:t.data}))},t.prototype.updateStoreByKey=function(t){return this.request({path:"/stores/key=".concat(t.key),method:"POST",data:t.data})},t.prototype.deleteStoreById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteStoreByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/stores/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.getCategoryById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"GET"}))},t.prototype.getCategoryByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/key=".concat(t.key),method:"GET"}))},t.prototype.queryChannels=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/channels",method:"GET"}))},t.prototype.importOrder=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/orders/import",method:"POST",data:t.data}))]}))}))},t.prototype.getChannelById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/channels/".concat(t.id),method:"GET"}))},t.prototype.getChannelByKey=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/channels",method:"GET",params:{where:'key="'.concat(t.key,'"'),limit:1}}))];case 1:if(!(null==(e=o.sent())?void 0:e.count))throw new a.CommercetoolsError("No channel found with key [".concat(t.key,"]"),null,404);return[2,e.results[0]]}}))}))},t.prototype.getCategory=function(t){if(!t.id&&!t.key)throw new a.CommercetoolsError("Either an id, key or slug must be provided");return t.id?this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"GET"})):this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/key=".concat(t.key),method:"GET"}))},t.prototype.getCategoryBySlug=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:if(!t.languageCode&&!t.languageCodes)throw new a.CommercetoolsError("Either the `languageCode` or `languageCodes` property must be provided");return e=[],t.languageCodes?e.push.apply(e,t.languageCodes):t.languageCode&&e.push(t.languageCode),[4,this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{where:"slug(".concat(e.map((function(e){return"".concat(e,'="').concat(t.slug,'"')})).join(" or "),")")})}))),{path:"/categories",method:"GET"}))];case 1:if(!(o=n.sent()).count)throw new a.CommercetoolsError("No category found with slug [".concat(t.slug,"] and language code [").concat(t.languageCode,"]"),{options:t},404);return[2,o.results[0]]}}))}))},t.prototype.queryCategories=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories",method:"GET"}))},t.prototype.getCategoryParents=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:return[4,this.getCategory(r(r({},t),{params:r(r({},t.params),{expand:"ancestors[*]"})}))];case 1:return e=n.sent(),(o=e.ancestors.map((function(t){return t.obj}))).push(r(r({},e),{ancestors:e.ancestors.map((function(t){return{id:t.id,typeId:t.typeId}}))})),[2,o]}}))}))},t.prototype.getProductById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"GET"}))},t.prototype.getProductByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"GET"}))},t.prototype.getProductProjectionById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-projections/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getProductProjectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-projections/key=".concat(t.key),t.storeKey),method:"GET"}))},t.prototype.getProductProjectionBySlug=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:if(!t.languageCode&&!t.languageCodes)throw new a.CommercetoolsError("Either the `languageCode` or `languageCodes` property must be provided");return e=[],t.languageCodes?e.push.apply(e,t.languageCodes):t.languageCode&&e.push(t.languageCode),[4,this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{where:"slug(".concat(e.map((function(e){return"".concat(e,'="').concat(t.slug,'"')})).join(" or "),")")})}))),{path:"/product-projections",method:"GET"}))];case 1:if(!(o=n.sent()).count)throw new a.CommercetoolsError("No product projection found with slug [".concat(t.slug,"] and language code [").concat(t.languageCode,"]"),{options:t},404);return[2,o.results[0]]}}))}))},t.prototype.queryProductProjections=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-projections",method:"GET"}))},t.prototype.searchProductProjections=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-projections/search",method:"GET"}))},t.prototype.getProductSelectionById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-selections/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getProductSelectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/product-selections/key=".concat(t.key),t.storeKey),method:"GET"}))},t.prototype.queryProductSelections=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections",method:"GET"}))},t.prototype.createProductSelection=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections",method:"POST",data:t.data}))},t.prototype.updateProductSelectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections/key=".concat(t.key),method:"POST",data:{version:t.version,actions:t.actions}}))},t.prototype.deleteProductSelectionByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-selections/key=".concat(t.key,"&version=").concat(t.version),method:"DELETE"}))},t.prototype.queryProductsInStore=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/in-store/key=".concat(t.storeKey,"/product-selection-assignments"),method:"GET"}))},t.prototype.getCartById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.queryCarts=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts",null==t?void 0:t.storeKey),method:"GET"}))]}))}))},t.prototype.queryMyCarts=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts",t.storeKey),method:"GET",accessToken:t.accessToken}))]}))}))},t.prototype.createCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts",t.storeKey),method:"POST",data:t.data}))]}))}))},t.prototype.updateCartById=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts/".concat(t.id),t.storeKey),method:"POST",data:{version:t.version,actions:t.actions}}))]}))}))},t.prototype.getMyActiveCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/active-cart",t.storeKey),method:"GET",accessToken:t.accessToken}))]}))}))},t.prototype.getMyCartById=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(t.cartId),t.storeKey),method:"GET",accessToken:t.accessToken}))]}))}))},t.prototype.createMyCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken}))]}))}))},t.prototype.updateMyCart=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(t.cartId),t.storeKey),method:"POST",data:{version:t.cartVersion,actions:t.actions},accessToken:t.accessToken}))]}))}))},t.prototype.deleteMyActiveCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(t)];case 1:return e=o.sent(),[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(e.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:e.version}),accessToken:t.accessToken}))];case 2:return[2,o.sent()]}}))}))},t.prototype.deleteMyCartById=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyCartById(t)];case 1:return e=o.sent(),[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(t.cartId),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:e.version}),accessToken:t.accessToken}))];case 2:return[2,o.sent()]}}))}))},t.prototype.updateMyActiveCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(t)];case 1:return e=o.sent(),[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/carts/".concat(e.id),t.storeKey),method:"POST",data:{version:e.version,actions:t.actions},accessToken:t.accessToken}))]}}))}))},t.prototype.createMyOrderFromActiveCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(t)];case 1:return e=o.sent(),[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/orders",t.storeKey),method:"POST",data:{version:e.version,id:e.id},accessToken:t.accessToken}))]}}))}))},t.prototype.createOrderFromCart=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getCartById(t)];case 1:return e=o.sent(),[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders",t.storeKey),method:"POST",data:{version:e.version,id:e.id}}))]}}))}))},t.prototype.deleteCartById=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/carts/".concat(t.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version})}))];case 1:return[2,e.sent()]}}))}))},t.prototype.createPayment=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments",method:"POST",data:t.data}))},t.prototype.deletePaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.updatePaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments/".concat(t.id),method:"POST",data:t.data}))},t.prototype.getPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments/".concat(t.id),method:"GET"}))},t.prototype.queryPayments=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/payments",method:"GET"}))},t.prototype.createMyPayment=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments",method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.updateMyPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments/".concat(t.id),method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.getMyPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments/".concat(t.id),method:"GET",accessToken:t.accessToken}))},t.prototype.queryMyPayments=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments",method:"GET",accessToken:t.accessToken}))},t.prototype.deleteMyPaymentById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/me/payments/".concat(t.id),method:"DELETE",params:{version:t.version},accessToken:t.accessToken}))},t.prototype.getMyOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/orders/".concat(t.id),t.storeKey),method:"GET",accessToken:t.accessToken}))},t.prototype.queryMyOrders=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/orders",t.storeKey),method:"GET",accessToken:t.accessToken}))},t.prototype.updateOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/".concat(t.id),t.storeKey),method:"POST",data:t.data}))},t.prototype.updateOrderByOrderNumber=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/order-number=".concat(t.orderNumber),t.storeKey),method:"POST",data:t.data}))},t.prototype.getOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getOrderByOrderNumber=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/order-number=".concat(t.orderNumber),t.storeKey),method:"GET"}))},t.prototype.deleteOrderById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/".concat(t.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.deleteOrderByOrderNumber=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders/order-number=".concat(t.orderNo),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.queryOrders=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/orders",t.storeKey),method:"GET"}))},t.prototype.createProduct=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products",method:"POST",data:t.data}))},t.prototype.updateProductByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"POST",data:t.data}))},t.prototype.updateProductById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"POST",data:t.data}))},t.prototype.deleteProductById=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:return e=t.version,t.unpublish?[4,this.unpublishProductById({id:t.id,version:t.version})]:[3,2];case 1:o=n.sent(),e=o.version,n.label=2;case 2:return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:e})}))]}}))}))},t.prototype.deleteProductByKey=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:return e=t.version,t.unpublish?[4,this.unpublishProductByKey({key:t.key,version:t.version})]:[3,2];case 1:o=n.sent(),e=o.version,n.label=2;case 2:return[2,this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:e})}))]}}))}))},t.prototype.unpublishProductByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/key=".concat(t.key),method:"POST",params:t.params,data:{version:t.version,actions:[{action:"unpublish"}]}}))},t.prototype.unpublishProductById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/products/".concat(t.id),method:"POST",params:t.params,data:{version:t.version,actions:[{action:"unpublish"}]}}))},t.prototype.createCategory=function(t){return this.request({path:"/categories",method:"POST",data:t.data})},t.prototype.updateCategoryByKey=function(t){return this.request({path:"/categories/key=".concat(t.key),method:"POST",data:t.data})},t.prototype.updateCategoryById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"POST",data:t.data}))},t.prototype.deleteCategoryById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteCategoryByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/categories/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.createAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers",t.storeKey),method:"POST",data:t.data}))},t.prototype.deleteCustomerById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/".concat(t.id),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.deleteCustomerByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/key=".concat(t.key),t.storeKey),method:"DELETE",params:r(r({},t.params),{version:t.version,dataErasure:t.dataErasure})}))},t.prototype.createMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/signup",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.loginMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/login",t.storeKey),method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.login=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/login",t.storeKey),method:"POST",data:t.data}))},t.prototype.getMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me",t.storeKey),method:"GET",accessToken:t.accessToken}))},t.prototype.updateMyAccount=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data}))},t.prototype.changeMyPassword=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/password",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data}))},t.prototype.resetMyPassword=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/me/password/reset",t.storeKey),method:"POST",accessToken:t.accessToken,data:t.data}))},t.prototype.getPasswordResetToken=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/password-token",t.storeKey),method:"POST",data:t.data}))},t.prototype.getCustomerById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/".concat(t.id),t.storeKey),method:"GET"}))},t.prototype.getCustomerByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/key=".concat(t.key),t.storeKey),method:"GET"}))},t.prototype.getCustomerByPasswordToken=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers/password-token=".concat(t.token),t.storeKey),method:"GET"}))},t.prototype.queryCustomers=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:this.applyStore("/customers",t.storeKey),method:"GET"}))},t.prototype.updateCustomerById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customers/".concat(t.id),method:"POST",data:t.data}))},t.prototype.updateCustomerByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customers/key=".concat(t.key),method:"POST",data:t.data}))},t.prototype.getProductTypeById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-types/".concat(t.id),method:"GET"}))},t.prototype.getProductTypeByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-types/key=".concat(t.key),method:"GET"}))},t.prototype.queryProductTypes=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/product-types",method:"GET"}))},t.prototype.getTypeById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/types/".concat(t.id),method:"GET"}))},t.prototype.getTypeByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/types/key=".concat(t.key),method:"GET"}))},t.prototype.queryTypes=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/types",method:"GET"}))},t.prototype.getDiscountCodeById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/discount-codes/".concat(t.id),method:"GET"}))},t.prototype.getCartDiscountById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/cart-discounts/".concat(t.id),method:"GET"}))},t.prototype.getCartDiscountByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/cart-discounts/key=".concat(t.key),method:"GET"}))},t.prototype.queryCartDiscounts=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/cart-discounts",method:"GET"}))},t.prototype.getCustomObject=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects/".concat(t.container,"/").concat(t.key),method:"GET"}))},t.prototype.getCustomObjectById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects/".concat(t.id),method:"GET"}))},t.prototype.saveCustomObject=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects",method:"POST",data:t.data}))},t.prototype.deleteCustomObject=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/custom-objects/".concat(t.container,"/").concat(t.key),method:"DELETE"}))},t.prototype.getShippingMethodById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/shipping-methods/".concat(t.id),method:"GET"}))},t.prototype.getShippingMethodByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/shipping-methods/key=".concat(t.key),method:"GET"}))},t.prototype.getShippingMethodsForLocation=function(t){return this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{country:t.country,state:t.state,currency:t.currency})}))),{path:"/shipping-methods/matching-location",method:"GET",accessToken:t.accessToken}))},t.prototype.getShippingMethodsForCart=function(t){return this.request(r(r({},this.extractCommonRequestOptions(r(r({},t),{params:r(r({},null==t?void 0:t.params),{cartId:t.cartId})}))),{path:"/shipping-methods/matching-cart",method:"GET",accessToken:t.accessToken}))},t.prototype.queryShippingMethods=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/shipping-methods",method:"GET"}))},t.prototype.getCustomerGroupById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/".concat(t.id),method:"GET"}))},t.prototype.getCustomerGroupByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/key=".concat(t.key),method:"GET"}))},t.prototype.queryCustomerGroups=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups",method:"GET"}))},t.prototype.createCustomerGroup=function(t){return this.request({path:"/customer-groups",method:"POST",data:t.data})},t.prototype.updateCustomerGroupByKey=function(t){return this.request({path:"/customer-groups/key=".concat(t.key),method:"POST",data:t.data})},t.prototype.updateCustomerGroupById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/".concat(t.id),method:"POST",data:t.data}))},t.prototype.deleteCustomerGroupById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteCustomerGroupByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/customer-groups/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.getStateById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/states/".concat(t.id),method:"GET"}))},t.prototype.getStateByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/states/key=".concat(t.key),method:"GET"}))},t.prototype.queryStates=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/states",method:"GET"}))},t.prototype.getStandalonePriceById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/".concat(t.id),method:"GET"}))},t.prototype.getStandalonePriceByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/key=".concat(t.key),method:"GET"}))},t.prototype.queryStandalonePrices=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices",method:"GET"}))},t.prototype.createStandalonePrice=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices",method:"POST",data:t.data}))},t.prototype.updateStandalonePriceById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/".concat(t.id),method:"POST",data:t.data}))},t.prototype.updateStandalonePriceByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/key=".concat(t.key),method:"POST",data:t.data}))},t.prototype.deleteStandalonePriceById=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/".concat(t.id),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.deleteStandalonePriceByKey=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/standalone-prices/key=".concat(t.key),method:"DELETE",params:r(r({},t.params),{version:t.version})}))},t.prototype.graphql=function(t){return this.request(r(r({},this.extractCommonRequestOptions(t)),{path:"/graphql",method:"POST",data:t.data,accessToken:t.accessToken}))},t.prototype.request=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.getRequestOptions(t)];case 1:return e=o.sent(),[4,this.requestExecutor(e)];case 2:return[2,o.sent()]}}))}))},t.prototype.getRequestOptions=function(t){return n(this,void 0,void 0,(function(){var e,o,n,i,a;return s(this,(function(s){switch(s.label){case 0:return o=t.accessToken,n="".concat(this.endpoints.api,"/").concat(this.config.projectKey).concat(t.path),o?[3,2]:[4,this.auth.getClientGrant()];case 1:i=s.sent(),o=i.accessToken,s.label=2;case 2:return a=r(r({},t.headers),{Authorization:"Bearer ".concat(o)}),"string"==typeof t.correlationId&&""!==t.correlationId&&(a["X-Correlation-ID"]=t.correlationId,delete t.correlationId),t.params&&Object.keys(t.params).length&&(e=t.params),[2,{method:t.method,data:t.data,url:n,headers:a,params:e}]}}))}))},t.prototype.extractCommonRequestOptions=function(t){return t?{correlationId:t.correlationId,params:t.params,retry:t.retry}:{}},t.prototype.applyStore=function(t,e){return"string"==typeof e&&""!==e?"/in-store/key=".concat(e).concat(t):this.config.storeKey?"/in-store/key=".concat(this.config.storeKey).concat(t):t},t.validateConfig=function(t){var 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 a.CommercetoolsError("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+e.map((function(t){return"• ".concat(t)})).join("\n"))},t}();e.CommercetoolsApi=p},3713:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(9818),e),n(o(7013),e)},7013:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2442:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsAuth=void 0;var i=o(2915),a=o(8003),c=o(3032),u={refreshIfWithinSecs:1800,timeoutMs:5e3},p=function(){function t(t){if(this.grantPromise=null,this.config=r(r({},u),t),!this.config.clientScopes.length)throw new i.CommercetoolsError("`config.clientScopes` must contain at least one scope");this.api=new c.CommercetoolsAuthApi(t)}return t.prototype.getClientGrant=function(){return n(this,void 0,void 0,(function(){var t=this;return s(this,(function(e){return this.grantPromise?[2,this.grantPromise]:this.grant&&!this.grant.expiresWithin(this.config.refreshIfWithinSecs)?[2,this.grant]:(this.grantPromise=this.api.getClientGrant(this.config.clientScopes).then((function(e){return t.grant=new a.CommercetoolsGrant(e),t.grant})).finally((function(){t.grantPromise=null})),[2,this.grantPromise])}))}))},t.prototype.refreshCustomerGrant=function(t){return n(this,void 0,void 0,(function(){var e;return s(this,(function(o){switch(o.label){case 0:return[4,this.api.refreshGrant(t)];case 1:return e=o.sent(),[2,new a.CommercetoolsGrant(r(r({},e),{refresh_token:t}))]}}))}))},t.prototype.login=function(t){return n(this,void 0,void 0,(function(){var e,o;return s(this,(function(n){switch(n.label){case 0:if(!(e=t.scopes||this.config.customerScopes))throw new i.CommercetoolsError("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");return[4,this.getClientGrant()];case 1:return n.sent(),[4,this.api.login(r(r({},t),{scopes:e}))];case 2:return o=n.sent(),[2,new a.CommercetoolsGrant(o)]}}))}))},t.prototype.getAnonymousGrant=function(t){return n(this,void 0,void 0,(function(){var e,o,r;return s(this,(function(n){switch(n.label){case 0:if(e=(null==t?void 0:t.scopes)||this.config.customerScopes,o=null==t?void 0:t.anonymousId,!e)throw new i.CommercetoolsError("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");return[4,this.getClientGrant()];case 1:return n.sent(),[4,this.api.getAnonymousGrant({scopes:e,anonymousId:o})];case 2:return r=n.sent(),[2,new a.CommercetoolsGrant(r)]}}))}))},t.prototype.logout=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.api.logout(t)];case 1:return e.sent(),[2]}}))}))},t.prototype.revokeToken=function(t){return n(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,this.api.revokeToken(t)];case 1:return e.sent(),[2]}}))}))},t}();e.CommercetoolsAuth=p},3032:function(t,e,o){var r=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsAuthApi=void 0;var s=o(2849),i=o(2915),a=o(7530),c=o(7111),u=o(9017),p=o(7034),l=function(){function t(t){this.config=t,this.endpoints=c.REGION_URLS[this.config.region],this.requestExecutor=(0,p.getRequestExecutor)({timeoutMs:t.timeoutMs,httpsAgent:t.httpsAgent,systemIdentifier:t.systemIdentifier,onBeforeRequest:t.onBeforeRequest,onAfterResponse:t.onAfterResponse,retry:t.retry})}return t.prototype.getClientGrant=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.post("/token",{grant_type:s.GrantType.CLIENT_CREDENTIALS,scope:(0,a.scopeArrayToRequestString)(t,this.config.projectKey)})]}))}))},t.prototype.refreshGrant=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.post("/token",{grant_type:s.GrantType.REFRESH_TOKEN,refresh_token:t})];case 1:return[2,e.sent()]}}))}))},t.prototype.login=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){return[2,this.post("/".concat(this.config.projectKey).concat(this.applyStore("/customers/token",t.storeKey)),{username:t.username,password:t.password,grant_type:s.GrantType.PASSWORD,scope:(0,a.scopeArrayToRequestString)(t.scopes,this.config.projectKey)})]}))}))},t.prototype.revokeToken=function(t){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,this.post("/token/revoke",{token:t.tokenValue,token_type_hint:t.tokenType})];case 1:return e.sent(),[2]}}))}))},t.prototype.logout=function(t){return r(this,void 0,void 0,(function(){var e,o;return n(this,(function(r){switch(r.label){case 0:return[4,Promise.allSettled([this.revokeToken({tokenType:"access_token",tokenValue:t.accessToken}),this.revokeToken({tokenType:"refresh_token",tokenValue:t.refreshToken})])];case 1:if(e=r.sent(),(o=e.reduce((function(t,e){return"rejected"===e.status&&t.push(e.reason),t}),[])).length)throw new i.CommercetoolsError("Logout failed in one or more calls to the token revocation endpoint",o);return[2]}}))}))},t.prototype.getAnonymousGrant=function(t){var e;return r(this,void 0,void 0,(function(){var o;return n(this,(function(r){return o={grant_type:s.GrantType.CLIENT_CREDENTIALS},(null===(e=null==t?void 0:t.scopes)||void 0===e?void 0:e.length)&&(o.scope=(0,a.scopeArrayToRequestString)(t.scopes,this.config.projectKey)),(null==t?void 0:t.anonymousId)&&(o.anonymous_id=t.anonymousId),[2,this.post("/".concat(this.config.projectKey,"/anonymous/token"),o)]}))}))},t.prototype.post=function(t,e){return r(this,void 0,void 0,(function(){return n(this,(function(o){switch(o.label){case 0:return[4,this.requestExecutor(this.getRequestOptions({path:t,body:e}))];case 1:return[2,o.sent()]}}))}))},t.prototype.getRequestOptions=function(t){var e,o="".concat(this.endpoints.auth,"/oauth").concat(t.path),r={Authorization:"Basic ".concat((0,u.base64EncodeForBasicAuth)(this.config.clientId,this.config.clientSecret)),"Content-Type":"application/x-www-form-urlencoded"};return t.correlationId&&""!==t.correlationId&&(r["X-Correlation-ID"]=t.correlationId,delete t.correlationId),t.body&&(e=new URLSearchParams(t.body).toString()),{method:"POST",data:e,url:o,headers:r}},t.prototype.applyStore=function(t,e){return"string"==typeof e&&""!==e?"/in-store/key=".concat(e).concat(t):this.config.storeKey?"/in-store/key=".concat(this.config.storeKey).concat(t):t},t}();e.CommercetoolsAuthApi=l},8003:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsGrant=void 0;var r=o(7530),n=function(){function t(t){this.accessToken="",this.expiresIn=0,this.expiresAt=new Date,this.scopes=[],this.accessToken=t.access_token,this.expiresIn=t.expires_in,this.scopes=(0,r.scopeRequestStringToArray)(t.scope),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)}return t.prototype.expiresWithin=function(t){var e=(new Date).getTime()+1e3*t;return this.expiresAt.getTime()<e},t.prototype.extractKeyFromScope=function(t,e){if(e&&t){var o=null==e?void 0:e.split(" ");if(Array.isArray(o)&&0!==o.length){var r=o.find((function(e){return e.slice(0,t.length+1)==="".concat(t,":")}));return r?r.slice(t.length+1):void 0}}},t}();e.CommercetoolsGrant=n},7111:(t,e,o)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.INVALID_SCOPES=e.REGION_URLS=void 0;var n=o(9291);e.REGION_URLS=((r={})[n.Region.EUROPE_GCP]={auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},r[n.Region.EUROPE_AWS]={auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},r[n.Region.NORTH_AMERICA_GCP]={auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},r[n.Region.NORTH_AMERICA_AWS]={auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},r[n.Region.AUSTRALIA_GCP]={auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"},r),e.INVALID_SCOPES=["anonymous_id","customer_id"]},7443:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(2442),e),n(o(8003),e)},7530:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.scopeRequestStringToArray=e.scopeArrayToRequestString=void 0;var r=o(7111);e.scopeArrayToRequestString=function(t,e){return t?t.map((function(t){return"".concat(t,":").concat(e)})).join(" "):""},e.scopeRequestStringToArray=function(t){return t?t.split(" ").map((function(t){return t.split(":")[0]})).filter((function(t){return!r.INVALID_SCOPES.includes(t)})):[]}},2849:(t,e)=>{var o;Object.defineProperty(e,"__esModule",{value:!0}),e.GrantType=void 0,(o=e.GrantType||(e.GrantType={})).CLIENT_CREDENTIALS="client_credentials",o.REFRESH_TOKEN="refresh_token",o.PASSWORD="password"},9017:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.base64EncodeForBasicAuth=void 0,e.base64EncodeForBasicAuth=function(t,e){var o="".concat(t,":").concat(e);return btoa(o)}},4060:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_HTTPS_AGENT_CONFIG=e.RETRYABLE_STATUS_CODES=e.DEFAULT_RETRY_CONFIG=e.MAX_ITEMS_PER_QUERY=e.DEFAULT_REQUEST_TIMEOUT_MS=e.USER_AGENT_PREFIX=void 0;var r=o(8842);e.USER_AGENT_PREFIX="@gradientedge/commercetools-utils",e.DEFAULT_REQUEST_TIMEOUT_MS=5e3,e.MAX_ITEMS_PER_QUERY=500,e.DEFAULT_RETRY_CONFIG={maxRetries:3,delayMs:50,jitter:!0},e.RETRYABLE_STATUS_CODES=[r.Status.InternalServerError,r.Status.NotImplemented,r.Status.BadGateway,r.Status.ServiceUnavailable,r.Status.GatewayTimeout],e.DEFAULT_HTTPS_AGENT_CONFIG={keepAlive:!0,maxSockets:32,maxFreeSockets:10,timeout:e.DEFAULT_REQUEST_TIMEOUT_MS}},6781:function(t,e,o){var r,n=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),s=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.CommercetoolsError=void 0;var i=s(o(4530)),a=o(893),c=function(t){function e(o,r,n){var s=t.call(this,o)||this;return s.isCommercetoolsError=!0,s.data=r,s.status=n,Object.setPrototypeOf(s,e.prototype),s}return n(e,t),e.fromAxiosError=function(t){var o,r,n,s,i,c,u,p;return new e(t.message,{code:t.code,request:{url:null===(o=t.config)||void 0===o?void 0:o.url,method:null===(r=t.config)||void 0===r?void 0:r.method,headers:(0,a.maskSensitiveHeaders)((0,a.extractAxiosHeaders)(null===(n=t.config)||void 0===n?void 0:n.headers)),params:(0,a.maskSensitiveInput)(null===(s=t.config)||void 0===s?void 0:s.params),data:(0,a.maskSensitiveInput)(this.parseRequestData(t.config))},response:{status:null===(i=t.response)||void 0===i?void 0:i.status,data:(0,a.maskSensitiveInput)(null===(c=t.response)||void 0===c?void 0:c.data),headers:(0,a.extractAxiosHeaders)(null===(u=t.response)||void 0===u?void 0:u.headers)}},null===(p=t.response)||void 0===p?void 0:p.status)},e.parseRequestData=function(t){var e,o;if(!t)return null;var r=null==t?void 0:t.data;if("string"==typeof r&&r){var n="";if("string"==typeof(null===(e=null==t?void 0:t.headers)||void 0===e?void 0:e["Content-Type"])&&(n=null===(o=null==t?void 0:t.headers)||void 0===o?void 0:o["Content-Type"]),"application/json"===n.substring(0,16))try{r=JSON.parse(t.data)}catch(t){}else if("application/x-www-form-urlencoded"===n.substring(0,33))try{var s=new URLSearchParams(t.data),i={};s.forEach((function(t,e,o){var r=o.getAll(e);0===r.length?i[e]="":1===r.length?i[e]=r[0]:i[e]=r})),r=i}catch(t){}}return r},e.prototype.toJSON=function(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}},e.prototype.toString=function(){return(0,i.default)(this.toJSON())},e}(Error);e.CommercetoolsError=c},3028:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(6781),e)},2915:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.MAX_ITEMS_PER_QUERY=e.Region=void 0,n(o(3028),e),n(o(7443),e),n(o(3713),e);var s=o(9291);Object.defineProperty(e,"Region",{enumerable:!0,get:function(){return s.Region}}),n(o(893),e),n(o(6249),e);var i=o(4060);Object.defineProperty(e,"MAX_ITEMS_PER_QUERY",{enumerable:!0,get:function(){return i.MAX_ITEMS_PER_QUERY}})},625:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9605:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5554:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4294:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5991:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5714:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7942:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},9906:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4241:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},146:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5167:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4236:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6249:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(9605),e),n(o(625),e),n(o(5554),e),n(o(4294),e),n(o(5991),e),n(o(5714),e),n(o(9906),e),n(o(7942),e),n(o(4241),e),n(o(146),e),n(o(5167),e),n(o(4236),e),n(o(2949),e),n(o(492),e),n(o(6871),e),n(o(6487),e),n(o(8386),e),n(o(4946),e),n(o(6313),e),n(o(5285),e),n(o(5283),e),n(o(3708),e),n(o(6883),e),n(o(2246),e),n(o(4089),e),n(o(6614),e),n(o(7607),e),n(o(310),e),n(o(7183),e),n(o(2569),e),n(o(1027),e),n(o(6080),e),n(o(1613),e),n(o(721),e)},2949:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},492:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6871:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},8386:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6487:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4946:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5285:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},5283:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},3708:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6313:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6883:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2246:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4089:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6614:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7607:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},310:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},7183:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},2569:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1027:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},6080:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},1613:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},721:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0})},4474:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(7261),e),n(o(884),e)},884:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isRetryableError=void 0;var r=o(4060);e.isRetryableError=function(t){return!t.isAxiosError||!t.request||!t.response||r.RETRYABLE_STATUS_CODES.includes(t.response.status)}},7034:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.getRequestExecutor=void 0;var n=o(4474),s=o(893),i=o(4060);e.getRequestExecutor=function(t){var e=(0,s.createAxiosInstance)({httpsAgent:t.httpsAgent}),o={"User-Agent":(0,s.buildUserAgent)(t.systemIdentifier)};return function(s){var a=r(r({},o),s.headers);return(0,n.request)({axiosInstance:e,onBeforeRequest:t.onBeforeRequest,onAfterResponse:t.onAfterResponse,request:r(r({},s),{headers:a}),retry:r(r({},i.DEFAULT_RETRY_CONFIG),t.retry),timeoutMs:t.timeoutMs})}}},7261:function(t,e,o){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)},n=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.request=void 0;var i=o(893),a=o(884),c=o(1100),u=o(4060),p=o(2003);e.request=function(t){var e,o,l;return n(this,void 0,void 0,(function(){var n,d,h,f,m,y,v,g,O,b,E,S,_,T;return s(this,(function(R){switch(R.label){case 0:n=t.retry,d=t.onBeforeRequest,h=t.onAfterResponse,f=t.axiosInstance,m=null!==(e=t.timeoutMs)&&void 0!==e?e:u.DEFAULT_REQUEST_TIMEOUT_MS,y={},v=(0,p.plainClone)(t.request),g=0,Object.keys(null!==(o=v.headers)&&void 0!==o?o:{}).map((function(t){return t.toLowerCase()})).includes("user-agent")||(null!==(l=v.headers)&&void 0!==l||(v.headers={}),v.headers["User-Agent"]=(0,i.buildUserAgent)()),b=0,_=function(){var t,e,o,u,p;return s(this,(function(s){switch(s.label){case 0:return E=null,S=null,g>0?(y["X-Retry-Count"]="".concat(g),t=(0,i.calculateDelay)(g,n),[4,new Promise((function(e){return setTimeout(e,t)}))]):[3,2];case 1:s.sent(),s.label=2;case 2:return s.trys.push([2,6,,7]),d?[4,d(v)]:[3,4];case 3:(e=s.sent())&&(v=e),s.label=4;case 4:return E=Date.now(),[4,f(r(r({},v),{headers:r(r({},v.headers),y),timeout:m}))];case 5:return o=s.sent(),S=Date.now(),b+=S-E,h&&h((0,i.convertAxiosResponse)(o,{accumulativeDurationMs:b,durationMs:S-E,retries:g})),[2,{value:o.data}];case 6:if(u=s.sent(),S=Date.now(),b+=E?S-E:0,h&&(p=(0,i.convertAxiosError)(u,{accumulativeDurationMs:b,durationMs:E?S-E:0,retries:g}))&&h(p),!(0,a.isRetryableError)(u))throw(0,c.transformError)(u);return O=u,[3,7];case 7:return g++,[2]}}))},R.label=1;case 1:return[5,_()];case 2:if("object"==typeof(T=R.sent()))return[2,T.value];R.label=3;case 3:if(g<=n.maxRetries)return[3,1];R.label=4;case 4:throw(0,c.transformError)(O)}}))}))}},1100:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.transformError=void 0;var r=o(3028);e.transformError=function(t){return t.isAxiosError?r.CommercetoolsError.fromAxiosError(t):t}},9291:(t,e)=>{var o;Object.defineProperty(e,"__esModule",{value:!0}),e.Region=void 0,(o=e.Region||(e.Region={})).NORTH_AMERICA_GCP="north_america_gcp",o.NORTH_AMERICA_AWS="north_america_aws",o.EUROPE_GCP="europe_gcp",o.EUROPE_AWS="europe_aws",o.AUSTRALIA_GCP="australia_gcp"},2519:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertAxiosError=void 0;var r=o(7271);e.convertAxiosError=function(t,e){var o,n,s,i,a,c,u,p,l,d;return"isAxiosError"in t?{request:{url:null!==(n=null===(o=t.config)||void 0===o?void 0:o.url)&&void 0!==n?n:"",method:null===(s=t.config)||void 0===s?void 0:s.method,params:null===(i=t.config)||void 0===i?void 0:i.params,headers:(0,r.extractAxiosHeaders)(null===(a=t.config)||void 0===a?void 0:a.headers),data:null===(c=t.config)||void 0===c?void 0:c.data},response:{code:t.code,message:(null===(u=t.response)||void 0===u?void 0:u.status)?void 0:t.message,status:null===(p=t.response)||void 0===p?void 0:p.status,headers:(0,r.extractAxiosHeaders)(null===(l=t.response)||void 0===l?void 0:l.headers),data:null===(d=t.response)||void 0===d?void 0:d.data},stats:e}:null}},4059:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertAxiosResponse=void 0;var r=o(7271);e.convertAxiosResponse=function(t,e){var o,n,s,i,a,c;return{request:{url:null!==(n=null===(o=t.config)||void 0===o?void 0:o.url)&&void 0!==n?n:"",method:null===(s=t.config)||void 0===s?void 0:s.method,params:null===(i=t.config)||void 0===i?void 0:i.params,headers:(0,r.extractAxiosHeaders)(null===(a=t.config)||void 0===a?void 0:a.headers),data:null===(c=t.config)||void 0===c?void 0:c.data},response:{status:t.status,headers:(0,r.extractAxiosHeaders)(t.headers),data:t.data},stats:e}}},4070:function(t,e,o){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createAxiosInstance=void 0,o(4060);var n=r(o(7218));e.createAxiosInstance=function(t){return n.default.create({httpsAgent:void 0})}},7271:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extractAxiosHeaders=void 0;var r=o(7218);e.extractAxiosHeaders=function(t){var e={};if(t instanceof r.AxiosHeaders){var o=t.toJSON();e={},Object.entries(o).forEach((function(t){var o=t[0],r=t[1],n=o.toLowerCase();"boolean"==typeof r||"number"==typeof r||"string"==typeof r?e[n]=r.toString():Array.isArray(r)&&(e[n]=r.join(", "))}))}return Object.keys(e).length?e:void 0}},4747:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(2519),e),n(o(4059),e),n(o(4070),e),n(o(7271),e)},3720:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.calculateDelay=void 0,e.calculateDelay=function(t,e){if(!e||0===t)return 0;var o=e.delayMs*Math.pow(2,t-1);if(e.jitter){var r=o*(1+1/(t+1));return Math.floor(Math.random()*r)}return o}},3930:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatAsKey=void 0;var r=o(3028);e.formatAsKey=function(t){var e="";if("string"!=typeof t)throw new r.CommercetoolsError("The [input] parameter must be a string");if((e=(e=(e=(e=(e=(e=t.trim().toLowerCase()).replace(/ {2,}/g,"")).replace(/&/g,"and")).replace(/[ _]/g,"-")).replace(/[^0-9a-z-]+/g,"")).replace(/-{2,}/g,"-")).length&&"-"===e[0]&&(e=e.slice(1)),e.length&&"-"===e[e.length-1]&&(e=e.slice(0,-1)),e.length<2)throw new r.CommercetoolsError("Formatted key did not meet minimum length of 2 characters: ".concat(e));if(e.length>256)throw new r.CommercetoolsError("Formatted key exceeds the maximum length of 256 characters: ".concat(e));return e}},6640:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getAttributeValue=void 0,e.getAttributeValue=function(t){var e,o;if(null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.length){var r=null===(o=t.attributes)||void 0===o?void 0:o.find((function(e){return e.name===t.name}));if(r)return r.value}return null}},893:function(t,e,o){var r=this&&this.__createBinding||(Object.create?function(t,e,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(e,o);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(t,r,n)}:function(t,e,o,r){void 0===r&&(r=o),t[r]=e[o]}),n=this&&this.__exportStar||function(t,e){for(var o in t)"default"===o||Object.prototype.hasOwnProperty.call(e,o)||r(e,t,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(o(4747),e),n(o(3720),e),n(o(3930),e),n(o(6640),e),n(o(9998),e),n(o(9989),e),n(o(3190),e)},9998:function(t,e,o){var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.maskSensitiveData=e.maskSensitiveHeaders=e.maskSensitiveInput=e.DEFAULT_MASKING_STRING=e.SENSITIVE_HEADER_NAMES=e.SENSITIVE_PROPERTY_NAMES=void 0;var n=r(o(3692)),s=o(7218),i=o(2003);function a(t,o,r){if(void 0===r&&(r=e.DEFAULT_MASKING_STRING),"object"==typeof t&&null!=t){var a;return a=t instanceof s.AxiosHeaders?(0,i.plainClone)(t.toJSON()):(0,i.plainClone)(t),(0,n.default)(a).forEach((function(){var t,e;o.includes(null!==(e=null===(t=this.key)||void 0===t?void 0:t.toLowerCase())&&void 0!==e?e:"")&&this.update(r)})),a}return t}e.SENSITIVE_PROPERTY_NAMES=["password","refresh_token"],e.SENSITIVE_HEADER_NAMES=["authorization"],e.DEFAULT_MASKING_STRING="********",e.maskSensitiveInput=function(t){return a(t,e.SENSITIVE_PROPERTY_NAMES)},e.maskSensitiveHeaders=function(t){return a(t,e.SENSITIVE_HEADER_NAMES)},e.maskSensitiveData=a},2003:(t,e)=>{function o(t,e){if(e&&t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&("object"==typeof t[r]?(Array.isArray(t[r])?e[r]=[]:e[r]={},e[r]=o(t[r],e[r])):e[r]=t[r]);return e}Object.defineProperty(e,"__esModule",{value:!0}),e.plainClone=void 0,e.plainClone=function(t){return o(t,{})}},9989:function(t,e,o){var r=this&&this.__awaiter||function(t,e,o,r){return new(o||(o=Promise))((function(n,s){function i(t){try{c(r.next(t))}catch(t){s(t)}}function a(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var o,r,n,s,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){i.label=a[1];break}if(6===a[0]&&i.label<n[1]){i.label=n[1],n=a;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(a);break}n[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{o=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.retryOnConflict=void 0;var s=o(3720),i=o(8842);e.retryOnConflict=function(t){return r(this,void 0,void 0,(function(){var e,o,r,a,c,u;return n(this,(function(p){switch(p.label){case 0:e=(null==t?void 0:t.maxRetries)||3,o=(null==t?void 0:t.delayMs)||100,r=!!(null==t?void 0:t.jitter),a=function(a){var c,u,p;return n(this,(function(n){switch(n.label){case 0:return a>1?(c=(0,s.calculateDelay)(a-1,{delayMs:o,maxRetries:e,jitter:r}),[4,new Promise((function(t){return setTimeout(t,c)}))]):[3,2];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,4,,5]),u={},[4,t.executeFn(a)];case 3:return[2,(u.value=n.sent(),u)];case 4:if(!(p=n.sent()).isCommercetoolsError||p.status!==i.Status.Conflict||a===e)throw p;return[3,5];case 5:return[2]}}))},c=1,p.label=1;case 1:return c<=e?[5,a(c)]:[3,4];case 2:if("object"==typeof(u=p.sent()))return[2,u.value];p.label=3;case 3:return c++,[3,1];case 4:return[2,void 0]}}))}))}},3190:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.buildUserAgent=void 0;var r=o(4060);e.buildUserAgent=function(t){var e=r.USER_AGENT_PREFIX;return t&&(e="".concat(e," (").concat(t,")")),e}},8842:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reason=e.ErrorStatus=e.RedirectionStatus=e.SuccessStatus=e.InformationStatus=e.Status=void 0;var r=o(7536);Object.defineProperty(e,"Status",{enumerable:!0,get:function(){return r.Status}}),Object.defineProperty(e,"InformationStatus",{enumerable:!0,get:function(){return r.InformationStatus}}),Object.defineProperty(e,"SuccessStatus",{enumerable:!0,get:function(){return r.SuccessStatus}}),Object.defineProperty(e,"RedirectionStatus",{enumerable:!0,get:function(){return r.RedirectionStatus}}),Object.defineProperty(e,"ErrorStatus",{enumerable:!0,get:function(){return r.ErrorStatus}});var n=o(7890);Object.defineProperty(e,"reason",{enumerable:!0,get:function(){return n.reason}})},7890:(t,e,o)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reason=void 0;const r=o(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(r.Status).find((e=>r.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 o(t,e){var o=[],r=[];return null==e&&(e=function(t,e){return o[0]===e?"[Circular ~]":"[Circular ~."+r.slice(0,o.indexOf(e)).join(".")+"]"}),function(n,s){if(o.length>0){var i=o.indexOf(this);~i?o.splice(i+1):o.push(this),~i?r.splice(i,1/0,n):r.push(n),~o.indexOf(s)&&(s=e.call(this,n,s))}else o.push(s);return null==t?s:t.call(this,n,s)}}(t.exports=function(t,e,r,n){return JSON.stringify(t,o(e,n),r)}).getSerialize=o},3692:t=>{function e(t){return Object.prototype.toString.call(t)}var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function r(t,e){if(t.forEach)return t.forEach(e);for(var o=0;o<t.length;o++)e(t[o],o,t)}var n=Object.keys||function(t){var e=[];for(var o in t)e.push(o);return e},s=Object.prototype.hasOwnProperty||function(t,e){return e in t};function i(t){if("object"==typeof t&&null!==t){var s;if(o(t))s=[];else if("[object Date]"===e(t))s=new Date(t.getTime?t.getTime():t);else if("[object RegExp]"===e(t))s=new RegExp(t);else if(function(t){return"[object Error]"===e(t)}(t))s={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))s=Object(t);else if(Object.create&&Object.getPrototypeOf)s=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)s={};else{var i=t.constructor&&t.constructor.prototype||t.__proto__||{},a=function(){};a.prototype=i,s=new a}return r(n(t),(function(e){s[e]=t[e]})),s}return t}function a(t,e,a){var c=[],u=[],p=!0;return function t(l){var d=a?i(l):l,h={},f=!0,m={node:d,node_:l,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){m.isRoot||(m.parent.node[m.key]=t),m.node=t,e&&(f=!1)},delete:function(t){delete m.parent.node[m.key],t&&(f=!1)},remove:function(t){o(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],t&&(f=!1)},keys:null,before:function(t){h.before=t},after:function(t){h.after=t},pre:function(t){h.pre=t},post:function(t){h.post=t},stop:function(){p=!1},block:function(){f=!1}};if(!p)return m;function y(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=n(m.node)),m.isLeaf=0===m.keys.length;for(var t=0;t<u.length;t++)if(u[t].node_===l){m.circular=u[t];break}}else m.isLeaf=!0,m.keys=null;m.notLeaf=!m.isLeaf,m.notRoot=!m.isRoot}y();var v=e.call(m,m.node);return void 0!==v&&m.update&&m.update(v),h.before&&h.before.call(m,m.node),f?("object"!=typeof m.node||null===m.node||m.circular||(u.push(m),y(),r(m.keys,(function(e,o){c.push(e),h.pre&&h.pre.call(m,m.node[e],e);var r=t(m.node[e]);a&&s.call(m.node,e)&&(m.node[e]=r.node),r.isLast=o===m.keys.length-1,r.isFirst=0===o,h.post&&h.post.call(m,r),c.pop()})),u.pop()),h.after&&h.after.call(m,m.node),m):m}(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,o=0;o<t.length;o++){var r=t[o];if(!e||!s.call(e,r))return;e=e[r]}return e},c.prototype.has=function(t){for(var e=this.value,o=0;o<t.length;o++){var r=t[o];if(!e||!s.call(e,r))return!1;e=e[r]}return!0},c.prototype.set=function(t,e){for(var o=this.value,r=0;r<t.length-1;r++){var n=t[r];s.call(o,n)||(o[n]={}),o=o[n]}return o[t[r]]=e,e},c.prototype.map=function(t){return a(this.value,t,!0)},c.prototype.forEach=function(t){return this.value=a(this.value,t,!1),this.value},c.prototype.reduce=function(t,e){var o=1===arguments.length,r=o?this.value:e;return this.forEach((function(e){this.isRoot&&o||(r=t.call(this,r,e))})),r},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 o(s){for(var a=0;a<t.length;a++)if(t[a]===s)return e[a];if("object"==typeof s&&null!==s){var c=i(s);return t.push(s),e.push(c),r(n(s),(function(t){c[t]=o(s[t])})),t.pop(),e.pop(),c}return s}(this.value)},r(n(c.prototype),(function(t){u[t]=function(e){var o=[].slice.call(arguments,1),r=new c(e);return r[t].apply(r,o)}})),t.exports=u},7218:(t,e,o)=>{function r(t,e){return function(){return t.apply(e,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:s}=Object,i=(a=Object.create(null),t=>{const e=n.call(t);return a[e]||(a[e]=e.slice(8,-1).toLowerCase())});var a;const c=t=>(t=t.toLowerCase(),e=>i(e)===t),u=t=>e=>typeof e===t,{isArray:p}=Array,l=u("undefined"),d=c("ArrayBuffer"),h=u("string"),f=u("function"),m=u("number"),y=t=>null!==t&&"object"==typeof t,v=t=>{if("object"!==i(t))return!1;const e=s(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},g=c("Date"),O=c("File"),b=c("Blob"),E=c("FileList"),S=c("URLSearchParams");function _(t,e,{allOwnKeys:o=!1}={}){if(null==t)return;let r,n;if("object"!=typeof t&&(t=[t]),p(t))for(r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else{const n=o?Object.getOwnPropertyNames(t):Object.keys(t),s=n.length;let i;for(r=0;r<s;r++)i=n[r],e.call(null,t[i],i,t)}}function T(t,e){e=e.toLowerCase();const o=Object.keys(t);let r,n=o.length;for(;n-- >0;)if(r=o[n],e===r.toLowerCase())return r;return null}const R="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:o.g,C=t=>!l(t)&&t!==R,w=(q="undefined"!=typeof Uint8Array&&s(Uint8Array),t=>q&&t instanceof q);var q;const P=c("HTMLFormElement"),x=(({hasOwnProperty:t})=>(e,o)=>t.call(e,o))(Object.prototype),A=c("RegExp"),j=(t,e)=>{const o=Object.getOwnPropertyDescriptors(t),r={};_(o,((o,n)=>{!1!==e(o,n,t)&&(r[n]=o)})),Object.defineProperties(t,r)},k="abcdefghijklmnopqrstuvwxyz",M="0123456789",I={DIGIT:M,ALPHA:k,ALPHA_DIGIT:k+k.toUpperCase()+M};var B={isArray:p,isArrayBuffer:d,isBuffer:function(t){return null!==t&&!l(t)&&null!==t.constructor&&!l(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&&d(t.buffer),e},isString:h,isNumber:m,isBoolean:t=>!0===t||!1===t,isObject:y,isPlainObject:v,isUndefined:l,isDate:g,isFile:O,isBlob:b,isRegExp:A,isFunction:f,isStream:t=>y(t)&&f(t.pipe),isURLSearchParams:S,isTypedArray:w,isFileList:E,forEach:_,merge:function t(){const{caseless:e}=C(this)&&this||{},o={},r=(r,n)=>{const s=e&&T(o,n)||n;v(o[s])&&v(r)?o[s]=t(o[s],r):v(r)?o[s]=t({},r):p(r)?o[s]=r.slice():o[s]=r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&_(arguments[t],r);return o},extend:(t,e,o,{allOwnKeys:n}={})=>(_(e,((e,n)=>{o&&f(e)?t[n]=r(e,o):t[n]=e}),{allOwnKeys:n}),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,o,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),o&&Object.assign(t.prototype,o)},toFlatObject:(t,e,o,r)=>{let n,i,a;const c={};if(e=e||{},null==t)return e;do{for(n=Object.getOwnPropertyNames(t),i=n.length;i-- >0;)a=n[i],r&&!r(a,t,e)||c[a]||(e[a]=t[a],c[a]=!0);t=!1!==o&&s(t)}while(t&&(!o||o(t,e))&&t!==Object.prototype);return e},kindOf:i,kindOfTest:c,endsWith:(t,e,o)=>{t=String(t),(void 0===o||o>t.length)&&(o=t.length),o-=e.length;const r=t.indexOf(e,o);return-1!==r&&r===o},toArray:t=>{if(!t)return null;if(p(t))return t;let e=t.length;if(!m(e))return null;const o=new Array(e);for(;e-- >0;)o[e]=t[e];return o},forEachEntry:(t,e)=>{const o=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=o.next())&&!r.done;){const o=r.value;e.call(t,o[0],o[1])}},matchAll:(t,e)=>{let o;const r=[];for(;null!==(o=t.exec(e));)r.push(o);return r},isHTMLForm:P,hasOwnProperty:x,hasOwnProp:x,reduceDescriptors:j,freezeMethods:t=>{j(t,((e,o)=>{if(f(t)&&-1!==["arguments","caller","callee"].indexOf(o))return!1;const r=t[o];f(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")}))}))},toObjectSet:(t,e)=>{const o={},r=t=>{t.forEach((t=>{o[t]=!0}))};return p(t)?r(t):r(String(t).split(e)),o},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,o){return e.toUpperCase()+o})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:T,global:R,isContextDefined:C,ALPHABET:I,generateString:(t=16,e=I.ALPHA_DIGIT)=>{let o="";const{length:r}=e;for(;t--;)o+=e[Math.random()*r|0];return o},isSpecCompliantForm:function(t){return!!(t&&f(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),o=(t,r)=>{if(y(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const n=p(t)?[]:{};return _(t,((t,e)=>{const s=o(t,r+1);!l(s)&&(n[e]=s)})),e[r]=void 0,n}}return t};return o(t,0)}};function N(t,e,o,r,n){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),o&&(this.config=o),r&&(this.request=r),n&&(this.response=n)}B.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:B.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const G=N.prototype,D={};function L(t){return B.isPlainObject(t)||B.isArray(t)}function U(t){return B.endsWith(t,"[]")?t.slice(0,-2):t}function K(t,e,o){return t?t.concat(e).map((function(t,e){return t=U(t),!o&&e?"["+t+"]":t})).join(o?".":""):e}["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=>{D[t]={value:t}})),Object.defineProperties(N,D),Object.defineProperty(G,"isAxiosError",{value:!0}),N.from=(t,e,o,r,n,s)=>{const i=Object.create(G);return B.toFlatObject(t,i,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),N.call(i,t.message,e,o,r,n),i.cause=t,i.name=t.name,s&&Object.assign(i,s),i};const F=B.toFlatObject(B,{},null,(function(t){return/^is[A-Z]/.test(t)}));function H(t,e,o){if(!B.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(o=B.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!B.isUndefined(e[t])}))).metaTokens,n=o.visitor||u,s=o.dots,i=o.indexes,a=(o.Blob||"undefined"!=typeof Blob&&Blob)&&B.isSpecCompliantForm(e);if(!B.isFunction(n))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(B.isDate(t))return t.toISOString();if(!a&&B.isBlob(t))throw new N("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(t)||B.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,o,n){let a=t;if(t&&!n&&"object"==typeof t)if(B.endsWith(o,"{}"))o=r?o:o.slice(0,-2),t=JSON.stringify(t);else if(B.isArray(t)&&function(t){return B.isArray(t)&&!t.some(L)}(t)||(B.isFileList(t)||B.endsWith(o,"[]"))&&(a=B.toArray(t)))return o=U(o),a.forEach((function(t,r){!B.isUndefined(t)&&null!==t&&e.append(!0===i?K([o],r,s):null===i?o:o+"[]",c(t))})),!1;return!!L(t)||(e.append(K(n,o,s),c(t)),!1)}const p=[],l=Object.assign(F,{defaultVisitor:u,convertValue:c,isVisitable:L});if(!B.isObject(t))throw new TypeError("data must be an object");return function t(o,r){if(!B.isUndefined(o)){if(-1!==p.indexOf(o))throw Error("Circular reference detected in "+r.join("."));p.push(o),B.forEach(o,(function(o,s){!0===(!(B.isUndefined(o)||null===o)&&n.call(e,o,B.isString(s)?s.trim():s,r,l))&&t(o,r?r.concat(s):[s])})),p.pop()}}(t),e}function V(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function z(t,e){this._pairs=[],t&&H(t,this,e)}const J=z.prototype;function W(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function X(t,e,o){if(!e)return t;const r=o&&o.encode||W,n=o&&o.serialize;let s;if(s=n?n(e,o):B.isURLSearchParams(e)?e.toString():new z(e,o).toString(r),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}J.append=function(t,e){this._pairs.push([t,e])},J.toString=function(t){const e=t?function(e){return t.call(this,e,V)}:V;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var Y=class{constructor(){this.handlers=[]}use(t,e,o){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!o&&o.synchronous,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){B.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Q={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:z,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"]};function Z(t){function e(t,o,r,n){let s=t[n++];const i=Number.isFinite(+s),a=n>=t.length;return s=!s&&B.isArray(r)?r.length:s,a?(B.hasOwnProp(r,s)?r[s]=[r[s],o]:r[s]=o,!i):(r[s]&&B.isObject(r[s])||(r[s]=[]),e(t,o,r[s],n)&&B.isArray(r[s])&&(r[s]=function(t){const e={},o=Object.keys(t);let r;const n=o.length;let s;for(r=0;r<n;r++)s=o[r],e[s]=t[s];return e}(r[s])),!i)}if(B.isFormData(t)&&B.isFunction(t.entries)){const o={};return B.forEachEntry(t,((t,r)=>{e(function(t){return B.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,o,0)})),o}return null}const tt={"Content-Type":void 0},et={transitional:Q,adapter:["xhr","http"],transformRequest:[function(t,e){const o=e.getContentType()||"",r=o.indexOf("application/json")>-1,n=B.isObject(t);if(n&&B.isHTMLForm(t)&&(t=new FormData(t)),B.isFormData(t))return r&&r?JSON.stringify(Z(t)):t;if(B.isArrayBuffer(t)||B.isBuffer(t)||B.isStream(t)||B.isFile(t)||B.isBlob(t))return t;if(B.isArrayBufferView(t))return t.buffer;if(B.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(n){if(o.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return H(t,new $.classes.URLSearchParams,Object.assign({visitor:function(t,e,o,r){return $.isNode&&B.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((s=B.isFileList(t))||o.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return H(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return n||r?(e.setContentType("application/json",!1),function(t,e,o){if(B.isString(t))try{return(0,JSON.parse)(t),B.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||et.transitional,o=e&&e.forcedJSONParsing,r="json"===this.responseType;if(t&&B.isString(t)&&(o&&!this.responseType||r)){const o=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(o){if("SyntaxError"===t.name)throw N.from(t,N.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:$.classes.FormData,Blob:$.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};B.forEach(["delete","get","head"],(function(t){et.headers[t]={}})),B.forEach(["post","put","patch"],(function(t){et.headers[t]=B.merge(tt)}));var ot=et;const rt=B.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"]),nt=Symbol("internals");function st(t){return t&&String(t).trim().toLowerCase()}function it(t){return!1===t||null==t?t:B.isArray(t)?t.map(it):String(t)}function at(t,e,o,r,n){return B.isFunction(r)?r.call(this,e,o):(n&&(e=o),B.isString(e)?B.isString(r)?-1!==e.indexOf(r):B.isRegExp(r)?r.test(e):void 0:void 0)}class ct{constructor(t){t&&this.set(t)}set(t,e,o){const r=this;function n(t,e,o){const n=st(e);if(!n)throw new Error("header name must be a non-empty string");const s=B.findKey(r,n);(!s||void 0===r[s]||!0===o||void 0===o&&!1!==r[s])&&(r[s||e]=it(t))}const s=(t,e)=>B.forEach(t,((t,o)=>n(t,o,e)));return B.isPlainObject(t)||t instanceof this.constructor?s(t,e):B.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z]+$/.test(t.trim())?s((t=>{const e={};let o,r,n;return t&&t.split("\n").forEach((function(t){n=t.indexOf(":"),o=t.substring(0,n).trim().toLowerCase(),r=t.substring(n+1).trim(),!o||e[o]&&rt[o]||("set-cookie"===o?e[o]?e[o].push(r):e[o]=[r]:e[o]=e[o]?e[o]+", "+r:r)})),e})(t),e):null!=t&&n(e,t,o),this}get(t,e){if(t=st(t)){const o=B.findKey(this,t);if(o){const t=this[o];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(t);)e[r[1]]=r[2];return e}(t);if(B.isFunction(e))return e.call(this,t,o);if(B.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=st(t)){const o=B.findKey(this,t);return!(!o||void 0===this[o]||e&&!at(0,this[o],o,e))}return!1}delete(t,e){const o=this;let r=!1;function n(t){if(t=st(t)){const n=B.findKey(o,t);!n||e&&!at(0,o[n],n,e)||(delete o[n],r=!0)}}return B.isArray(t)?t.forEach(n):n(t),r}clear(t){const e=Object.keys(this);let o=e.length,r=!1;for(;o--;){const n=e[o];t&&!at(0,this[n],n,t,!0)||(delete this[n],r=!0)}return r}normalize(t){const e=this,o={};return B.forEach(this,((r,n)=>{const s=B.findKey(o,n);if(s)return e[s]=it(r),void delete e[n];const i=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,o)=>e.toUpperCase()+o))}(n):String(n).trim();i!==n&&delete e[n],e[i]=it(r),o[i]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return B.forEach(this,((o,r)=>{null!=o&&!1!==o&&(e[r]=t&&B.isArray(o)?o.join(", "):o)})),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 o=new this(t);return e.forEach((t=>o.set(t))),o}static accessor(t){const e=(this[nt]=this[nt]={accessors:{}}).accessors,o=this.prototype;function r(t){const r=st(t);e[r]||(function(t,e){const o=B.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+o,{value:function(t,o,n){return this[r].call(this,e,t,o,n)},configurable:!0})}))}(o,t),e[r]=!0)}return B.isArray(t)?t.forEach(r):r(t),this}}ct.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),B.freezeMethods(ct.prototype),B.freezeMethods(ct);var ut=ct;function pt(t,e){const o=this||ot,r=e||o,n=ut.from(r.headers);let s=r.data;return B.forEach(t,(function(t){s=t.call(o,s,n.normalize(),e?e.status:void 0)})),n.normalize(),s}function lt(t){return!(!t||!t.__CANCEL__)}function dt(t,e,o){N.call(this,null==t?"canceled":t,N.ERR_CANCELED,e,o),this.name="CanceledError"}B.inherits(dt,N,{__CANCEL__:!0});var ht=$.isStandardBrowserEnv?{write:function(t,e,o,r,n,s){const i=[];i.push(t+"="+encodeURIComponent(e)),B.isNumber(o)&&i.push("expires="+new Date(o).toGMTString()),B.isString(r)&&i.push("path="+r),B.isString(n)&&i.push("domain="+n),!0===s&&i.push("secure"),document.cookie=i.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 ft(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}var mt=$.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let o;function r(o){let r=o;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{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 o=r(window.location.href),function(t){const e=B.isString(t)?r(t):t;return e.protocol===o.protocol&&e.host===o.host}}():function(){return!0};function yt(t,e){let o=0;const r=function(t,e){t=t||10;const o=new Array(t),r=new Array(t);let n,s=0,i=0;return e=void 0!==e?e:1e3,function(a){const c=Date.now(),u=r[i];n||(n=c),o[s]=a,r[s]=c;let p=i,l=0;for(;p!==s;)l+=o[p++],p%=t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),c-n<e)return;const d=u&&c-u;return d?Math.round(1e3*l/d):void 0}}(50,250);return n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,a=s-o,c=r(a);o=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:n};u[e?"download":"upload"]=!0,t(u)}}const vt={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,o){let r=t.data;const n=ut.from(t.headers).normalize(),s=t.responseType;let i;function a(){t.cancelToken&&t.cancelToken.unsubscribe(i),t.signal&&t.signal.removeEventListener("abort",i)}B.isFormData(r)&&($.isStandardBrowserEnv||$.isStandardBrowserWebWorkerEnv)&&n.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",o=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";n.set("Authorization","Basic "+btoa(e+":"+o))}const u=ft(t.baseURL,t.url);function p(){if(!c)return;const r=ut.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(t,e,o){const r=o.config.validateStatus;o.status&&r&&!r(o.status)?e(new N("Request failed with status code "+o.status,[N.ERR_BAD_REQUEST,N.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o)):t(o)}((function(t){e(t),a()}),(function(t){o(t),a()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:t,request:c}),c=null}if(c.open(t.method.toUpperCase(),X(u,t.params,t.paramsSerializer),!0),c.timeout=t.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 N("Request aborted",N.ECONNABORTED,t,c)),c=null)},c.onerror=function(){o(new N("Network Error",N.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||Q;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),o(new N(e,r.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,t,c)),c=null},$.isStandardBrowserEnv){const e=(t.withCredentials||mt(u))&&t.xsrfCookieName&&ht.read(t.xsrfCookieName);e&&n.set(t.xsrfHeaderName,e)}void 0===r&&n.setContentType(null),"setRequestHeader"in c&&B.forEach(n.toJSON(),(function(t,e){c.setRequestHeader(e,t)})),B.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),s&&"json"!==s&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",yt(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",yt(t.onUploadProgress)),(t.cancelToken||t.signal)&&(i=e=>{c&&(o(!e||e.type?new dt(null,t,c):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(i),t.signal&&(t.signal.aborted?i():t.signal.addEventListener("abort",i)));const l=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(u);l&&-1===$.protocols.indexOf(l)?o(new N("Unsupported protocol "+l+":",N.ERR_BAD_REQUEST,t)):c.send(r||null)}))}};B.forEach(vt,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));function gt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new dt(null,t)}function Ot(t){return gt(t),t.headers=ut.from(t.headers),t.data=pt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),(t=>{t=B.isArray(t)?t:[t];const{length:e}=t;let o,r;for(let n=0;n<e&&(o=t[n],!(r=B.isString(o)?vt[o.toLowerCase()]:o));n++);if(!r){if(!1===r)throw new N(`Adapter ${o} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(B.hasOwnProp(vt,o)?`Adapter '${o}' is not available in the build`:`Unknown adapter '${o}'`)}if(!B.isFunction(r))throw new TypeError("adapter is not a function");return r})(t.adapter||ot.adapter)(t).then((function(e){return gt(t),e.data=pt.call(t,t.transformResponse,e),e.headers=ut.from(e.headers),e}),(function(e){return lt(e)||(gt(t),e&&e.response&&(e.response.data=pt.call(t,t.transformResponse,e.response),e.response.headers=ut.from(e.response.headers))),Promise.reject(e)}))}const bt=t=>t instanceof ut?t.toJSON():t;function Et(t,e){e=e||{};const o={};function r(t,e,o){return B.isPlainObject(t)&&B.isPlainObject(e)?B.merge.call({caseless:o},t,e):B.isPlainObject(e)?B.merge({},e):B.isArray(e)?e.slice():e}function n(t,e,o){return B.isUndefined(e)?B.isUndefined(t)?void 0:r(void 0,t,o):r(t,e,o)}function s(t,e){if(!B.isUndefined(e))return r(void 0,e)}function i(t,e){return B.isUndefined(e)?B.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(o,n,s){return s in e?r(o,n):s in t?r(void 0,o):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(t,e)=>n(bt(t),bt(e),!0)};return B.forEach(Object.keys(t).concat(Object.keys(e)),(function(r){const s=c[r]||n,i=s(t[r],e[r],r);B.isUndefined(i)&&s!==a||(o[r]=i)})),o}const St={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{St[t]=function(o){return typeof o===t||"a"+(e<1?"n ":" ")+t}}));const _t={};St.transitional=function(t,e,o){function r(t,e){return"[Axios v1.3.4] Transitional option '"+t+"'"+e+(o?". "+o:"")}return(o,n,s)=>{if(!1===t)throw new N(r(n," has been removed"+(e?" in "+e:"")),N.ERR_DEPRECATED);return e&&!_t[n]&&(_t[n]=!0,console.warn(r(n," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(o,n,s)}};var Tt={assertOptions:function(t,e,o){if("object"!=typeof t)throw new N("options must be an object",N.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let n=r.length;for(;n-- >0;){const s=r[n],i=e[s];if(i){const e=t[s],o=void 0===e||i(e,s,t);if(!0!==o)throw new N("option "+s+" must be "+o,N.ERR_BAD_OPTION_VALUE)}else if(!0!==o)throw new N("Unknown option "+s,N.ERR_BAD_OPTION)}},validators:St};const Rt=Tt.validators;class Ct{constructor(t){this.defaults=t,this.interceptors={request:new Y,response:new Y}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Et(this.defaults,e);const{transitional:o,paramsSerializer:r,headers:n}=e;let s;void 0!==o&&Tt.assertOptions(o,{silentJSONParsing:Rt.transitional(Rt.boolean),forcedJSONParsing:Rt.transitional(Rt.boolean),clarifyTimeoutError:Rt.transitional(Rt.boolean)},!1),void 0!==r&&Tt.assertOptions(r,{encode:Rt.function,serialize:Rt.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),s=n&&B.merge(n.common,n[e.method]),s&&B.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete n[t]})),e.headers=ut.concat(s,n);const i=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,i.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let p,l=0;if(!a){const t=[Ot.bind(this),void 0];for(t.unshift.apply(t,i),t.push.apply(t,c),p=t.length,u=Promise.resolve(e);l<p;)u=u.then(t[l++],t[l++]);return u}p=i.length;let d=e;for(l=0;l<p;){const t=i[l++],e=i[l++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=Ot.call(this,d)}catch(t){return Promise.reject(t)}for(l=0,p=c.length;l<p;)u=u.then(c[l++],c[l++]);return u}getUri(t){return X(ft((t=Et(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}B.forEach(["delete","get","head","options"],(function(t){Ct.prototype[t]=function(e,o){return this.request(Et(o||{},{method:t,url:e,data:(o||{}).data}))}})),B.forEach(["post","put","patch"],(function(t){function e(e){return function(o,r,n){return this.request(Et(n||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}Ct.prototype[t]=e(),Ct.prototype[t+"Form"]=e(!0)}));var wt=Ct;class qt{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 o=this;this.promise.then((t=>{if(!o._listeners)return;let e=o._listeners.length;for(;e-- >0;)o._listeners[e](t);o._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{o.subscribe(t),e=t})).then(t);return r.cancel=function(){o.unsubscribe(e)},r},t((function(t,r,n){o.reason||(o.reason=new dt(t,r,n),e(o.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 qt((function(e){t=e})),cancel:t}}}var Pt=qt;const xt={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(xt).forEach((([t,e])=>{xt[e]=t}));var At=xt;const jt=function t(e){const o=new wt(e),n=r(wt.prototype.request,o);return B.extend(n,wt.prototype,o,{allOwnKeys:!0}),B.extend(n,o,null,{allOwnKeys:!0}),n.create=function(o){return t(Et(e,o))},n}(ot);jt.Axios=wt,jt.CanceledError=dt,jt.CancelToken=Pt,jt.isCancel=lt,jt.VERSION="1.3.4",jt.toFormData=H,jt.AxiosError=N,jt.Cancel=jt.CanceledError,jt.all=function(t){return Promise.all(t)},jt.spread=function(t){return function(e){return t.apply(null,e)}},jt.isAxiosError=function(t){return B.isObject(t)&&!0===t.isAxiosError},jt.mergeConfig=Et,jt.AxiosHeaders=ut,jt.formToJSON=t=>Z(B.isHTMLForm(t)?new FormData(t):t),jt.HttpStatusCode=At,jt.default=jt,t.exports=jt}},e={};function o(r){var n=e[r];if(void 0!==n)return n.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,o),s.exports}o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var r=o(2915),n=exports;for(var s in r)n[s]=r[s];r.__esModule&&Object.defineProperty(n,"__esModule",{value:!0});
1
+ var e={9818:function(e,t,o){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},r=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var o,n,r,s,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((r=(r=i.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{o=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CommercetoolsApi=void 0;var i=o(2915),a=o(3028),c=o(7111),u=o(893),p=o(7034),d=function(){function e(t){e.validateConfig(t),this.config=t,this.auth=new i.CommercetoolsAuth(t),this.endpoints=c.REGION_URLS[this.config.region],this.requestExecutor=(0,p.getRequestExecutor)({timeoutMs:t.timeoutMs,httpsAgent:t.httpsAgent,systemIdentifier:t.systemIdentifier,onBeforeRequest:t.onBeforeRequest,onAfterResponse:t.onAfterResponse,retry:t.retry})}return e.prototype.getStoreById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/stores/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getStoreByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/stores/key=".concat(encodeURIComponent(e.key)),method:"GET"}))},e.prototype.queryStores=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/stores",method:"GET"}))},e.prototype.createStore=function(e){return this.request({path:"/stores",method:"POST",data:e.data})},e.prototype.updateStoreById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/stores/".concat(encodeURIComponent(e.id)),method:"POST",data:e.data}))},e.prototype.updateStoreByKey=function(e){return this.request({path:"/stores/key=".concat(encodeURIComponent(e.key)),method:"POST",data:e.data})},e.prototype.deleteStoreById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/stores/".concat(encodeURIComponent(e.id)),method:"DELETE",params:n(n({},e.params),{version:e.version})}))},e.prototype.deleteStoreByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/stores/key=".concat(encodeURIComponent(e.key)),method:"DELETE",params:n(n({},e.params),{version:e.version})}))},e.prototype.getCategoryById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/categories/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getCategoryByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/categories/key=".concat(encodeURIComponent(e.key)),method:"GET"}))},e.prototype.queryChannels=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/channels",method:"GET"}))},e.prototype.importOrder=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/orders/import",method:"POST",data:e.data}))]}))}))},e.prototype.getChannelById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/channels/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getChannelByKey=function(e){return r(this,void 0,void 0,(function(){var t;return s(this,(function(o){switch(o.label){case 0:return[4,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/channels",method:"GET",params:{where:'key="'.concat(encodeURIComponent(e.key),'"'),limit:1}}))];case 1:if(!(null==(t=o.sent())?void 0:t.count))throw new a.CommercetoolsError("No channel found with key [".concat(e.key,"]"),null,404);return[2,t.results[0]]}}))}))},e.prototype.getCategory=function(e){var t;if(!e.id&&!e.key)throw new a.CommercetoolsError("Either an id, key or slug must be provided");return e.id?((0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/categories/".concat(encodeURIComponent(e.id)),method:"GET"}))):this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/categories/key=".concat(encodeURIComponent(null!==(t=e.key)&&void 0!==t?t:"")),method:"GET"}))},e.prototype.getCategoryBySlug=function(e){return r(this,void 0,void 0,(function(){var t,o;return s(this,(function(r){switch(r.label){case 0:if(!e.languageCode&&!e.languageCodes)throw new a.CommercetoolsError("Either the `languageCode` or `languageCodes` property must be provided");return t=[],e.languageCodes?t.push.apply(t,e.languageCodes):e.languageCode&&t.push(e.languageCode),[4,this.request(n(n({},this.extractCommonRequestOptions(n(n({},e),{params:n(n({},null==e?void 0:e.params),{where:"slug(".concat(t.map((function(t){return"".concat(t,'="').concat(e.slug,'"')})).join(" or "),")")})}))),{path:"/categories",method:"GET"}))];case 1:if(!(o=r.sent()).count)throw new a.CommercetoolsError("No category found with slug [".concat(e.slug,"] and language code [").concat(e.languageCode,"]"),{options:e},404);return[2,o.results[0]]}}))}))},e.prototype.queryCategories=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/categories",method:"GET"}))},e.prototype.getCategoryParents=function(e){return r(this,void 0,void 0,(function(){var t,o;return s(this,(function(r){switch(r.label){case 0:return[4,this.getCategory(n(n({},e),{params:n(n({},e.params),{expand:"ancestors[*]"})}))];case 1:return t=r.sent(),(o=t.ancestors.map((function(e){return e.obj}))).push(n(n({},t),{ancestors:t.ancestors.map((function(e){return{id:e.id,typeId:e.typeId}}))})),[2,o]}}))}))},e.prototype.getProductById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/products/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getProductByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/products/key=".concat(encodeURIComponent(e.key)),method:"GET"}))},e.prototype.getProductProjectionById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/product-projections/".concat(encodeURIComponent(e.id)),e.storeKey),method:"GET"}))},e.prototype.getProductProjectionByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/product-projections/key=".concat(encodeURIComponent(e.key)),e.storeKey),method:"GET"}))},e.prototype.getProductProjectionBySlug=function(e){return r(this,void 0,void 0,(function(){var t,o;return s(this,(function(r){switch(r.label){case 0:if(!e.languageCode&&!e.languageCodes)throw new a.CommercetoolsError("Either the `languageCode` or `languageCodes` property must be provided");return t=[],e.languageCodes?t.push.apply(t,e.languageCodes):e.languageCode&&t.push(e.languageCode),[4,this.request(n(n({},this.extractCommonRequestOptions(n(n({},e),{params:n(n({},null==e?void 0:e.params),{where:"slug(".concat(t.map((function(t){return"".concat(t,'="').concat(e.slug,'"')})).join(" or "),")")})}))),{path:"/product-projections",method:"GET"}))];case 1:if(!(o=r.sent()).count)throw new a.CommercetoolsError("No product projection found with slug [".concat(e.slug,"] and language code [").concat(e.languageCode,"]"),{options:e},404);return[2,o.results[0]]}}))}))},e.prototype.queryProductProjections=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/product-projections",method:"GET"}))},e.prototype.searchProductProjections=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/product-projections/search",method:"GET"}))},e.prototype.getProductSelectionById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/product-selections/".concat(encodeURIComponent(e.id)),e.storeKey),method:"GET"}))},e.prototype.getProductSelectionByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/product-selections/key=".concat(encodeURIComponent(e.key)),e.storeKey),method:"GET"}))},e.prototype.queryProductSelections=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/product-selections",method:"GET"}))},e.prototype.createProductSelection=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/product-selections",method:"POST",data:e.data}))},e.prototype.updateProductSelectionByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/product-selections/key=".concat(encodeURIComponent(e.key)),method:"POST",data:{version:e.version,actions:e.actions}}))},e.prototype.deleteProductSelectionByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/product-selections/key=".concat(encodeURIComponent(e.key),"&version=").concat(encodeURIComponent(e.version)),method:"DELETE"}))},e.prototype.queryProductsInStore=function(e){var t;return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/in-store/key=".concat(encodeURIComponent(null!==(t=e.storeKey)&&void 0!==t?t:""),"/product-selection-assignments"),method:"GET"}))},e.prototype.getCartById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/carts/".concat(encodeURIComponent(e.id)),e.storeKey),method:"GET"}))},e.prototype.queryCarts=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/carts",null==e?void 0:e.storeKey),method:"GET"}))]}))}))},e.prototype.queryMyCarts=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/carts",e.storeKey),method:"GET",accessToken:e.accessToken}))]}))}))},e.prototype.createCart=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/carts",e.storeKey),method:"POST",data:e.data}))]}))}))},e.prototype.updateCartById=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/carts/".concat(encodeURIComponent(e.id)),e.storeKey),method:"POST",data:{version:e.version,actions:e.actions}}))]}))}))},e.prototype.getMyActiveCart=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/active-cart",e.storeKey),method:"GET",accessToken:e.accessToken}))]}))}))},e.prototype.getMyCartById=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){return(0,u.ensureNonEmptyString)({value:e.cartId,name:"cartId"}),[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/carts/".concat(encodeURIComponent(e.cartId)),e.storeKey),method:"GET",accessToken:e.accessToken}))]}))}))},e.prototype.createMyCart=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){return[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/carts",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken}))]}))}))},e.prototype.updateMyCart=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){return(0,u.ensureNonEmptyString)({value:e.cartId,name:"cartId"}),[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/carts/".concat(encodeURIComponent(e.cartId)),e.storeKey),method:"POST",data:{version:e.cartVersion,actions:e.actions},accessToken:e.accessToken}))]}))}))},e.prototype.deleteMyActiveCart=function(e){return r(this,void 0,void 0,(function(){var t;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(e)];case 1:return t=o.sent(),[4,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/carts/".concat(encodeURIComponent(t.id)),e.storeKey),method:"DELETE",params:n(n({},e.params),{version:t.version}),accessToken:e.accessToken}))];case 2:return[2,o.sent()]}}))}))},e.prototype.deleteMyCartById=function(e){return r(this,void 0,void 0,(function(){var t;return s(this,(function(o){switch(o.label){case 0:return(0,u.ensureNonEmptyString)({value:e.cartId,name:"cartId"}),[4,this.getMyCartById(e)];case 1:return t=o.sent(),[4,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/carts/".concat(encodeURIComponent(e.cartId)),e.storeKey),method:"DELETE",params:n(n({},e.params),{version:t.version}),accessToken:e.accessToken}))];case 2:return[2,o.sent()]}}))}))},e.prototype.updateMyActiveCart=function(e){return r(this,void 0,void 0,(function(){var t;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(e)];case 1:return t=o.sent(),[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/carts/".concat(encodeURIComponent(t.id)),e.storeKey),method:"POST",data:{version:t.version,actions:e.actions},accessToken:e.accessToken}))]}}))}))},e.prototype.createMyOrderFromActiveCart=function(e){return r(this,void 0,void 0,(function(){var t;return s(this,(function(o){switch(o.label){case 0:return[4,this.getMyActiveCart(e)];case 1:return t=o.sent(),[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/orders",e.storeKey),method:"POST",data:{version:t.version,id:t.id},accessToken:e.accessToken}))]}}))}))},e.prototype.createOrderFromCart=function(e){return r(this,void 0,void 0,(function(){var t;return s(this,(function(o){switch(o.label){case 0:return[4,this.getCartById(e)];case 1:return t=o.sent(),[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/orders",e.storeKey),method:"POST",data:{version:t.version,id:t.id}}))]}}))}))},e.prototype.deleteCartById=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),[4,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/carts/".concat(encodeURIComponent(e.id)),e.storeKey),method:"DELETE",params:n(n({},e.params),{version:e.version})}))];case 1:return[2,t.sent()]}}))}))},e.prototype.createPayment=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/payments",method:"POST",data:e.data}))},e.prototype.deletePaymentById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/payments/".concat(encodeURIComponent(e.id)),method:"DELETE",params:n(n({},e.params),{version:e.version})}))},e.prototype.updatePaymentById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/payments/".concat(encodeURIComponent(e.id)),method:"POST",data:e.data}))},e.prototype.getPaymentById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/payments/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.queryPayments=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/payments",method:"GET"}))},e.prototype.createMyPayment=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/me/payments",method:"POST",data:e.data,accessToken:e.accessToken}))},e.prototype.updateMyPaymentById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/me/payments/".concat(encodeURIComponent(e.id)),method:"POST",data:e.data,accessToken:e.accessToken}))},e.prototype.getMyPaymentById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/me/payments/".concat(encodeURIComponent(e.id)),method:"GET",accessToken:e.accessToken}))},e.prototype.queryMyPayments=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/me/payments",method:"GET",accessToken:e.accessToken}))},e.prototype.deleteMyPaymentById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/me/payments/".concat(encodeURIComponent(e.id)),method:"DELETE",params:{version:e.version},accessToken:e.accessToken}))},e.prototype.getMyOrderById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/orders/".concat(encodeURIComponent(e.id)),e.storeKey),method:"GET",accessToken:e.accessToken}))},e.prototype.queryMyOrders=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/orders",e.storeKey),method:"GET",accessToken:e.accessToken}))},e.prototype.updateOrderById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/orders/".concat(encodeURIComponent(e.id)),e.storeKey),method:"POST",data:e.data}))},e.prototype.updateOrderByOrderNumber=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/orders/order-number=".concat(encodeURIComponent(e.orderNumber)),e.storeKey),method:"POST",data:e.data}))},e.prototype.getOrderById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/orders/".concat(encodeURIComponent(e.id)),e.storeKey),method:"GET"}))},e.prototype.getOrderByOrderNumber=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/orders/order-number=".concat(encodeURIComponent(e.orderNumber)),e.storeKey),method:"GET"}))},e.prototype.deleteOrderById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/orders/".concat(encodeURIComponent(e.id)),e.storeKey),method:"DELETE",params:n(n({},e.params),{version:e.version,dataErasure:e.dataErasure})}))},e.prototype.deleteOrderByOrderNumber=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/orders/order-number=".concat(encodeURIComponent(e.orderNo)),e.storeKey),method:"DELETE",params:n(n({},e.params),{version:e.version,dataErasure:e.dataErasure})}))},e.prototype.queryOrders=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/orders",e.storeKey),method:"GET"}))},e.prototype.createProduct=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/products",method:"POST",data:e.data}))},e.prototype.updateProductByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/products/key=".concat(encodeURIComponent(e.key)),method:"POST",data:e.data}))},e.prototype.updateProductById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/products/".concat(encodeURIComponent(e.id)),method:"POST",data:e.data}))},e.prototype.deleteProductById=function(e){return r(this,void 0,void 0,(function(){var t,o;return s(this,(function(r){switch(r.label){case 0:return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),t=e.version,e.unpublish?[4,this.unpublishProductById({id:e.id,version:e.version})]:[3,2];case 1:o=r.sent(),t=o.version,r.label=2;case 2:return[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/products/".concat(encodeURIComponent(e.id)),method:"DELETE",params:n(n({},e.params),{version:t})}))]}}))}))},e.prototype.deleteProductByKey=function(e){return r(this,void 0,void 0,(function(){var t,o;return s(this,(function(r){switch(r.label){case 0:return t=e.version,e.unpublish?[4,this.unpublishProductByKey({key:e.key,version:e.version})]:[3,2];case 1:o=r.sent(),t=o.version,r.label=2;case 2:return[2,this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/products/key=".concat(encodeURIComponent(e.key)),method:"DELETE",params:n(n({},e.params),{version:t})}))]}}))}))},e.prototype.unpublishProductByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/products/key=".concat(encodeURIComponent(e.key)),method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}}))},e.prototype.unpublishProductById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/products/".concat(encodeURIComponent(e.id)),method:"POST",params:e.params,data:{version:e.version,actions:[{action:"unpublish"}]}}))},e.prototype.createCategory=function(e){return this.request({path:"/categories",method:"POST",data:e.data})},e.prototype.updateCategoryByKey=function(e){return this.request({path:"/categories/key=".concat(encodeURIComponent(e.key)),method:"POST",data:e.data})},e.prototype.updateCategoryById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/categories/".concat(encodeURIComponent(e.id)),method:"POST",data:e.data}))},e.prototype.deleteCategoryById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/categories/".concat(encodeURIComponent(e.id)),method:"DELETE",params:n(n({},e.params),{version:e.version})}))},e.prototype.deleteCategoryByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/categories/key=".concat(encodeURIComponent(e.key)),method:"DELETE",params:n(n({},e.params),{version:e.version})}))},e.prototype.createAccount=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/customers",e.storeKey),method:"POST",data:e.data}))},e.prototype.deleteCustomerById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/customers/".concat(encodeURIComponent(e.id)),e.storeKey),method:"DELETE",params:n(n({},e.params),{version:e.version,dataErasure:e.dataErasure})}))},e.prototype.deleteCustomerByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/customers/key=".concat(encodeURIComponent(e.key)),e.storeKey),method:"DELETE",params:n(n({},e.params),{version:e.version,dataErasure:e.dataErasure})}))},e.prototype.createMyAccount=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/signup",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken}))},e.prototype.loginMyAccount=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/login",e.storeKey),method:"POST",data:e.data,accessToken:e.accessToken}))},e.prototype.login=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/login",e.storeKey),method:"POST",data:e.data}))},e.prototype.getMyAccount=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me",e.storeKey),method:"GET",accessToken:e.accessToken}))},e.prototype.updateMyAccount=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data}))},e.prototype.changeMyPassword=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/password",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data}))},e.prototype.resetMyPassword=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/me/password/reset",e.storeKey),method:"POST",accessToken:e.accessToken,data:e.data}))},e.prototype.getPasswordResetToken=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/customers/password-token",e.storeKey),method:"POST",data:e.data}))},e.prototype.getCustomerById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/customers/".concat(encodeURIComponent(e.id)),e.storeKey),method:"GET"}))},e.prototype.getCustomerByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/customers/key=".concat(encodeURIComponent(e.key)),e.storeKey),method:"GET"}))},e.prototype.getCustomerByPasswordToken=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/customers/password-token=".concat(encodeURIComponent(e.token)),e.storeKey),method:"GET"}))},e.prototype.queryCustomers=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:this.applyStore("/customers",e.storeKey),method:"GET"}))},e.prototype.updateCustomerById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/customers/".concat(encodeURIComponent(e.id)),method:"POST",data:e.data}))},e.prototype.updateCustomerByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/customers/key=".concat(encodeURIComponent(e.key)),method:"POST",data:e.data}))},e.prototype.getProductTypeById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/product-types/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getProductTypeByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/product-types/key=".concat(encodeURIComponent(e.key)),method:"GET"}))},e.prototype.queryProductTypes=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/product-types",method:"GET"}))},e.prototype.getTypeById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/types/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getTypeByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/types/key=".concat(encodeURIComponent(e.key)),method:"GET"}))},e.prototype.queryTypes=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/types",method:"GET"}))},e.prototype.getDiscountCodeById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/discount-codes/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getCartDiscountById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/cart-discounts/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getCartDiscountByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/cart-discounts/key=".concat(encodeURIComponent(e.key)),method:"GET"}))},e.prototype.queryCartDiscounts=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/cart-discounts",method:"GET"}))},e.prototype.getCustomObject=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/custom-objects/".concat(encodeURIComponent(e.container),"/").concat(encodeURIComponent(e.key)),method:"GET"}))},e.prototype.getCustomObjectById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/custom-objects/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.saveCustomObject=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/custom-objects",method:"POST",data:e.data}))},e.prototype.deleteCustomObject=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/custom-objects/".concat(encodeURIComponent(e.container),"/").concat(encodeURIComponent(e.key)),method:"DELETE"}))},e.prototype.getShippingMethodById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/shipping-methods/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getShippingMethodByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/shipping-methods/key=".concat(encodeURIComponent(e.key)),method:"GET"}))},e.prototype.getShippingMethodsForLocation=function(e){return this.request(n(n({},this.extractCommonRequestOptions(n(n({},e),{params:n(n({},null==e?void 0:e.params),{country:e.country,state:e.state,currency:e.currency})}))),{path:"/shipping-methods/matching-location",method:"GET",accessToken:e.accessToken}))},e.prototype.getShippingMethodsForCart=function(e){return this.request(n(n({},this.extractCommonRequestOptions(n(n({},e),{params:n(n({},null==e?void 0:e.params),{cartId:e.cartId})}))),{path:"/shipping-methods/matching-cart",method:"GET",accessToken:e.accessToken}))},e.prototype.queryShippingMethods=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/shipping-methods",method:"GET"}))},e.prototype.getCustomerGroupById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/customer-groups/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getCustomerGroupByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/customer-groups/key=".concat(encodeURIComponent(e.key)),method:"GET"}))},e.prototype.queryCustomerGroups=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/customer-groups",method:"GET"}))},e.prototype.createCustomerGroup=function(e){return this.request({path:"/customer-groups",method:"POST",data:e.data})},e.prototype.updateCustomerGroupByKey=function(e){return this.request({path:"/customer-groups/key=".concat(encodeURIComponent(e.key)),method:"POST",data:e.data})},e.prototype.updateCustomerGroupById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/customer-groups/".concat(encodeURIComponent(e.id)),method:"POST",data:e.data}))},e.prototype.deleteCustomerGroupById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/customer-groups/".concat(encodeURIComponent(e.id)),method:"DELETE",params:n(n({},e.params),{version:e.version})}))},e.prototype.deleteCustomerGroupByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/customer-groups/key=".concat(encodeURIComponent(e.key)),method:"DELETE",params:n(n({},e.params),{version:e.version})}))},e.prototype.getStateById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/states/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getStateByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/states/key=".concat(encodeURIComponent(e.key)),method:"GET"}))},e.prototype.queryStates=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/states",method:"GET"}))},e.prototype.getStandalonePriceById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/standalone-prices/".concat(encodeURIComponent(e.id)),method:"GET"}))},e.prototype.getStandalonePriceByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/standalone-prices/key=".concat(encodeURIComponent(e.key)),method:"GET"}))},e.prototype.queryStandalonePrices=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/standalone-prices",method:"GET"}))},e.prototype.createStandalonePrice=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/standalone-prices",method:"POST",data:e.data}))},e.prototype.updateStandalonePriceById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/standalone-prices/".concat(encodeURIComponent(e.id)),method:"POST",data:e.data}))},e.prototype.updateStandalonePriceByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/standalone-prices/key=".concat(encodeURIComponent(e.key)),method:"POST",data:e.data}))},e.prototype.deleteStandalonePriceById=function(e){return(0,u.ensureNonEmptyString)({value:e.id,name:"id"}),this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/standalone-prices/".concat(encodeURIComponent(e.id)),method:"DELETE",params:n(n({},e.params),{version:e.version})}))},e.prototype.deleteStandalonePriceByKey=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/standalone-prices/key=".concat(encodeURIComponent(e.key)),method:"DELETE",params:n(n({},e.params),{version:e.version})}))},e.prototype.graphql=function(e){return this.request(n(n({},this.extractCommonRequestOptions(e)),{path:"/graphql",method:"POST",data:e.data,accessToken:e.accessToken}))},e.prototype.request=function(e){return r(this,void 0,void 0,(function(){var t;return s(this,(function(o){switch(o.label){case 0:return[4,this.getRequestOptions(e)];case 1:return t=o.sent(),[4,this.requestExecutor(t)];case 2:return[2,o.sent()]}}))}))},e.prototype.getRequestOptions=function(e){return r(this,void 0,void 0,(function(){var t,o,r,i,a;return s(this,(function(s){switch(s.label){case 0:return o=e.accessToken,r="".concat(this.endpoints.api,"/").concat(this.config.projectKey).concat(e.path),o?[3,2]:[4,this.auth.getClientGrant()];case 1:i=s.sent(),o=i.accessToken,s.label=2;case 2:return a=n(n({},e.headers),{Authorization:"Bearer ".concat(o)}),"string"==typeof e.correlationId&&""!==e.correlationId&&(a["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.params&&Object.keys(e.params).length&&(t=e.params),[2,{method:e.method,data:e.data,url:r,headers:a,params:t}]}}))}))},e.prototype.extractCommonRequestOptions=function(e){return e?{correlationId:e.correlationId,params:e.params,retry:e.retry}:{}},e.prototype.applyStore=function(e,t){return"string"==typeof t&&""!==t?"/in-store/key=".concat(t).concat(e):this.config.storeKey?"/in-store/key=".concat(this.config.storeKey).concat(e):e},e.validateConfig=function(e){var 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 a.CommercetoolsError("The configuration object passed in to the `CommercetoolsApi` constructor is not valid: \n"+t.map((function(e){return"• ".concat(e)})).join("\n"))},e}();t.CommercetoolsApi=d},3713:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(o(9818),t),r(o(7013),t)},7013:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2442:function(e,t,o){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},r=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var o,n,r,s,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((r=(r=i.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{o=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CommercetoolsAuth=void 0;var i=o(2915),a=o(8003),c=o(3032),u={refreshIfWithinSecs:1800,timeoutMs:5e3},p=function(){function e(e){if(this.grantPromise=null,this.config=n(n({},u),e),!this.config.clientScopes.length)throw new i.CommercetoolsError("`config.clientScopes` must contain at least one scope");this.api=new c.CommercetoolsAuthApi(e)}return e.prototype.getClientGrant=function(){return r(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){return this.grantPromise?[2,this.grantPromise]:this.grant&&!this.grant.expiresWithin(this.config.refreshIfWithinSecs)?[2,this.grant]:(this.grantPromise=this.api.getClientGrant(this.config.clientScopes).then((function(t){return e.grant=new a.CommercetoolsGrant(t),e.grant})).finally((function(){e.grantPromise=null})),[2,this.grantPromise])}))}))},e.prototype.refreshCustomerGrant=function(e){return r(this,void 0,void 0,(function(){var t;return s(this,(function(o){switch(o.label){case 0:return[4,this.api.refreshGrant(e)];case 1:return t=o.sent(),[2,new a.CommercetoolsGrant(n(n({},t),{refresh_token:e}))]}}))}))},e.prototype.login=function(e){return r(this,void 0,void 0,(function(){var t,o;return s(this,(function(r){switch(r.label){case 0:if(!(t=e.scopes||this.config.customerScopes))throw new i.CommercetoolsError("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");return[4,this.getClientGrant()];case 1:return r.sent(),[4,this.api.login(n(n({},e),{scopes:t}))];case 2:return o=r.sent(),[2,new a.CommercetoolsGrant(o)]}}))}))},e.prototype.getAnonymousGrant=function(e){return r(this,void 0,void 0,(function(){var t,o,n;return s(this,(function(r){switch(r.label){case 0:if(t=(null==e?void 0:e.scopes)||this.config.customerScopes,o=null==e?void 0:e.anonymousId,!t)throw new i.CommercetoolsError("Customer scopes must be set on either the `options` parameter of this `login` method, or on the `customerScopes` property of the `CommercetoolsAuth` constructor");return[4,this.getClientGrant()];case 1:return r.sent(),[4,this.api.getAnonymousGrant({scopes:t,anonymousId:o})];case 2:return n=r.sent(),[2,new a.CommercetoolsGrant(n)]}}))}))},e.prototype.logout=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.api.logout(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.revokeToken=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,this.api.revokeToken(e)];case 1:return t.sent(),[2]}}))}))},e}();t.CommercetoolsAuth=p},3032:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var o,n,r,s,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((r=(r=i.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{o=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CommercetoolsAuthApi=void 0;var s=o(2849),i=o(2915),a=o(7530),c=o(7111),u=o(9017),p=o(7034),d=function(){function e(e){this.config=e,this.endpoints=c.REGION_URLS[this.config.region],this.requestExecutor=(0,p.getRequestExecutor)({timeoutMs:e.timeoutMs,httpsAgent:e.httpsAgent,systemIdentifier:e.systemIdentifier,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,retry:e.retry})}return e.prototype.getClientGrant=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.post("/token",{grant_type:s.GrantType.CLIENT_CREDENTIALS,scope:(0,a.scopeArrayToRequestString)(e,this.config.projectKey)})]}))}))},e.prototype.refreshGrant=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.post("/token",{grant_type:s.GrantType.REFRESH_TOKEN,refresh_token:e})];case 1:return[2,t.sent()]}}))}))},e.prototype.login=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.post("/".concat(this.config.projectKey).concat(this.applyStore("/customers/token",e.storeKey)),{username:e.username,password:e.password,grant_type:s.GrantType.PASSWORD,scope:(0,a.scopeArrayToRequestString)(e.scopes,this.config.projectKey)})]}))}))},e.prototype.revokeToken=function(e){return n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.post("/token/revoke",{token:e.tokenValue,token_type_hint:e.tokenType})];case 1:return t.sent(),[2]}}))}))},e.prototype.logout=function(e){return n(this,void 0,void 0,(function(){var t,o;return r(this,(function(n){switch(n.label){case 0:return[4,Promise.allSettled([this.revokeToken({tokenType:"access_token",tokenValue:e.accessToken}),this.revokeToken({tokenType:"refresh_token",tokenValue:e.refreshToken})])];case 1:if(t=n.sent(),(o=t.reduce((function(e,t){return"rejected"===t.status&&e.push(t.reason),e}),[])).length)throw new i.CommercetoolsError("Logout failed in one or more calls to the token revocation endpoint",o);return[2]}}))}))},e.prototype.getAnonymousGrant=function(e){var t;return n(this,void 0,void 0,(function(){var o;return r(this,(function(n){return o={grant_type:s.GrantType.CLIENT_CREDENTIALS},(null===(t=null==e?void 0:e.scopes)||void 0===t?void 0:t.length)&&(o.scope=(0,a.scopeArrayToRequestString)(e.scopes,this.config.projectKey)),(null==e?void 0:e.anonymousId)&&(o.anonymous_id=e.anonymousId),[2,this.post("/".concat(this.config.projectKey,"/anonymous/token"),o)]}))}))},e.prototype.post=function(e,t){return n(this,void 0,void 0,(function(){return r(this,(function(o){switch(o.label){case 0:return[4,this.requestExecutor(this.getRequestOptions({path:e,body:t}))];case 1:return[2,o.sent()]}}))}))},e.prototype.getRequestOptions=function(e){var t,o="".concat(this.endpoints.auth,"/oauth").concat(e.path),n={Authorization:"Basic ".concat((0,u.base64EncodeForBasicAuth)(this.config.clientId,this.config.clientSecret)),"Content-Type":"application/x-www-form-urlencoded"};return e.correlationId&&""!==e.correlationId&&(n["X-Correlation-ID"]=e.correlationId,delete e.correlationId),e.body&&(t=new URLSearchParams(e.body).toString()),{method:"POST",data:t,url:o,headers:n}},e.prototype.applyStore=function(e,t){return"string"==typeof t&&""!==t?"/in-store/key=".concat(t).concat(e):this.config.storeKey?"/in-store/key=".concat(this.config.storeKey).concat(e):e},e}();t.CommercetoolsAuthApi=d},8003:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CommercetoolsGrant=void 0;var n=o(7530),r=function(){function e(e){this.accessToken="",this.expiresIn=0,this.expiresAt=new Date,this.scopes=[],this.accessToken=e.access_token,this.expiresIn=e.expires_in,this.scopes=(0,n.scopeRequestStringToArray)(e.scope),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)}return e.prototype.expiresWithin=function(e){var t=(new Date).getTime()+1e3*e;return this.expiresAt.getTime()<t},e.prototype.extractKeyFromScope=function(e,t){if(t&&e){var o=null==t?void 0:t.split(" ");if(Array.isArray(o)&&0!==o.length){var n=o.find((function(t){return t.slice(0,e.length+1)==="".concat(e,":")}));return n?n.slice(e.length+1):void 0}}},e}();t.CommercetoolsGrant=r},7111:(e,t,o)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_SCOPES=t.REGION_URLS=void 0;var r=o(9291);t.REGION_URLS=((n={})[r.Region.EUROPE_GCP]={auth:"https://auth.europe-west1.gcp.commercetools.com",api:"https://api.europe-west1.gcp.commercetools.com"},n[r.Region.EUROPE_AWS]={auth:"https://auth.eu-central-1.aws.commercetools.com",api:"https://api.eu-central-1.aws.commercetools.com"},n[r.Region.NORTH_AMERICA_GCP]={auth:"https://auth.us-central1.gcp.commercetools.com",api:"https://api.us-central1.gcp.commercetools.com"},n[r.Region.NORTH_AMERICA_AWS]={auth:"https://auth.us-east-2.aws.commercetools.com",api:"https://api.us-east-2.aws.commercetools.com"},n[r.Region.AUSTRALIA_GCP]={auth:"https://auth.australia-southeast1.gcp.commercetools.com",api:"https://api.australia-southeast1.gcp.commercetools.com"},n),t.INVALID_SCOPES=["anonymous_id","customer_id"]},7443:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(o(2442),t),r(o(8003),t)},7530:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.scopeRequestStringToArray=t.scopeArrayToRequestString=void 0;var n=o(7111);t.scopeArrayToRequestString=function(e,t){return e.length?e.map((function(e){return"".concat(e,":").concat(t)})).join(" "):""},t.scopeRequestStringToArray=function(e){return e?e.split(" ").map((function(e){return e.split(":")[0]})).filter((function(e){return!n.INVALID_SCOPES.includes(e)})):[]}},2849:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.GrantType=void 0,(o=t.GrantType||(t.GrantType={})).CLIENT_CREDENTIALS="client_credentials",o.REFRESH_TOKEN="refresh_token",o.PASSWORD="password"},9017:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.base64EncodeForBasicAuth=void 0,t.base64EncodeForBasicAuth=function(e,t){var o="".concat(e,":").concat(t);return btoa(o)}},4060:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_HTTPS_AGENT_CONFIG=t.RETRYABLE_STATUS_CODES=t.DEFAULT_RETRY_CONFIG=t.MAX_ITEMS_PER_QUERY=t.DEFAULT_REQUEST_TIMEOUT_MS=t.USER_AGENT_PREFIX=void 0;var n=o(8842);t.USER_AGENT_PREFIX="@gradientedge/commercetools-utils",t.DEFAULT_REQUEST_TIMEOUT_MS=5e3,t.MAX_ITEMS_PER_QUERY=500,t.DEFAULT_RETRY_CONFIG={maxRetries:3,delayMs:50,jitter:!0},t.RETRYABLE_STATUS_CODES=[n.Status.InternalServerError,n.Status.NotImplemented,n.Status.BadGateway,n.Status.ServiceUnavailable,n.Status.GatewayTimeout],t.DEFAULT_HTTPS_AGENT_CONFIG={keepAlive:!0,maxSockets:32,maxFreeSockets:10,timeout:t.DEFAULT_REQUEST_TIMEOUT_MS}},6781:function(e,t,o){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)}),s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CommercetoolsError=void 0;var i=s(o(4530)),a=o(893),c=function(e){function t(o,n,r){var s=e.call(this,o)||this;return s.isCommercetoolsError=!0,s.data=n,s.status=r,Object.setPrototypeOf(s,t.prototype),s}return r(t,e),t.fromAxiosError=function(e){var o,n,r,s,i,c,u,p;return new t(e.message,{code:e.code,request:{url:null===(o=e.config)||void 0===o?void 0:o.url,method:null===(n=e.config)||void 0===n?void 0:n.method,headers:(0,a.maskSensitiveHeaders)((0,a.extractAxiosHeaders)(null===(r=e.config)||void 0===r?void 0:r.headers)),params:(0,a.maskSensitiveInput)(null===(s=e.config)||void 0===s?void 0:s.params),data:(0,a.maskSensitiveInput)(this.parseRequestData(e.config))},response:{status:null===(i=e.response)||void 0===i?void 0:i.status,data:(0,a.maskSensitiveInput)(null===(c=e.response)||void 0===c?void 0:c.data),headers:(0,a.extractAxiosHeaders)(null===(u=e.response)||void 0===u?void 0:u.headers)}},null===(p=e.response)||void 0===p?void 0:p.status)},t.parseRequestData=function(e){var t,o;if(!e)return null;var n=null==e?void 0:e.data;if("string"==typeof n&&n){var r="";if("string"==typeof(null===(t=null==e?void 0:e.headers)||void 0===t?void 0:t["Content-Type"])&&(r=null===(o=null==e?void 0:e.headers)||void 0===o?void 0:o["Content-Type"]),"application/json"===r.substring(0,16))try{n=JSON.parse(e.data)}catch(e){}else if("application/x-www-form-urlencoded"===r.substring(0,33))try{var s=new URLSearchParams(e.data),i={};s.forEach((function(e,t,o){var n=o.getAll(t);0===n.length?i[t]="":1===n.length?i[t]=n[0]:i[t]=n})),n=i}catch(e){}}return n},t.prototype.toJSON=function(){return{status:this.status,message:this.message,data:this.data,isCommercetoolsError:!0}},t.prototype.toString=function(){return(0,i.default)(this.toJSON())},t}(Error);t.CommercetoolsError=c},3028:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(o(6781),t)},2915:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_ITEMS_PER_QUERY=t.Region=void 0,r(o(3028),t),r(o(7443),t),r(o(3713),t);var s=o(9291);Object.defineProperty(t,"Region",{enumerable:!0,get:function(){return s.Region}}),r(o(893),t),r(o(6249),t);var i=o(4060);Object.defineProperty(t,"MAX_ITEMS_PER_QUERY",{enumerable:!0,get:function(){return i.MAX_ITEMS_PER_QUERY}})},625:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9605:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5554:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4294:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5991:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5714:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7942:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9906:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4241:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},146:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5167:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4236:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6249:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(o(9605),t),r(o(625),t),r(o(5554),t),r(o(4294),t),r(o(5991),t),r(o(5714),t),r(o(9906),t),r(o(7942),t),r(o(4241),t),r(o(146),t),r(o(5167),t),r(o(4236),t),r(o(2949),t),r(o(492),t),r(o(6871),t),r(o(6487),t),r(o(8386),t),r(o(4946),t),r(o(6313),t),r(o(5285),t),r(o(5283),t),r(o(3708),t),r(o(6883),t),r(o(2246),t),r(o(4089),t),r(o(6614),t),r(o(7607),t),r(o(310),t),r(o(7183),t),r(o(2569),t),r(o(1027),t),r(o(6080),t),r(o(1613),t),r(o(721),t)},2949:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},492:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8386:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6487:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4946:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5285:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5283:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3708:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6313:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6883:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2246:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4089:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6614:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7607:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},310:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7183:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2569:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1027:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6080:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1613:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},721:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},4474:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(o(7261),t),r(o(884),t)},884:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isRetryableError=void 0;var n=o(4060);t.isRetryableError=function(e){return!e.isAxiosError||!e.request||!e.response||n.RETRYABLE_STATUS_CODES.includes(e.response.status)}},7034:function(e,t,o){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getRequestExecutor=void 0;var r=o(4474),s=o(893),i=o(4060);t.getRequestExecutor=function(e){var t=(0,s.createAxiosInstance)({httpsAgent:e.httpsAgent}),o={"User-Agent":(0,s.buildUserAgent)(e.systemIdentifier)};return function(s){var a=n(n({},o),s.headers);return(0,r.request)({axiosInstance:t,onBeforeRequest:e.onBeforeRequest,onAfterResponse:e.onAfterResponse,request:n(n({},s),{headers:a}),retry:n(n({},i.DEFAULT_RETRY_CONFIG),e.retry),timeoutMs:e.timeoutMs})}}},7261:function(e,t,o){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)},r=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var o,n,r,s,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((r=(r=i.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{o=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.request=void 0;var i=o(893),a=o(884),c=o(1100),u=o(4060),p=o(2003);t.request=function(e){var t,o,d;return r(this,void 0,void 0,(function(){var r,l,h,f,m,y,v,g,O,b,E,S,R,C;return s(this,(function(_){switch(_.label){case 0:r=e.retry,l=e.onBeforeRequest,h=e.onAfterResponse,f=e.axiosInstance,m=null!==(t=e.timeoutMs)&&void 0!==t?t:u.DEFAULT_REQUEST_TIMEOUT_MS,y={},v=(0,p.plainClone)(e.request),g=0,Object.keys(null!==(o=v.headers)&&void 0!==o?o:{}).map((function(e){return e.toLowerCase()})).includes("user-agent")||(null!==(d=v.headers)&&void 0!==d||(v.headers={}),v.headers["User-Agent"]=(0,i.buildUserAgent)()),b=0,R=function(){var e,t,o,u,p;return s(this,(function(s){switch(s.label){case 0:return E=null,S=null,g>0?(y["X-Retry-Count"]="".concat(g),e=(0,i.calculateDelay)(g,r),[4,new Promise((function(t){return setTimeout(t,e)}))]):[3,2];case 1:s.sent(),s.label=2;case 2:return s.trys.push([2,6,,7]),l?[4,l(v)]:[3,4];case 3:(t=s.sent())&&(v=t),s.label=4;case 4:return E=Date.now(),[4,f(n(n({},v),{headers:n(n({},v.headers),y),timeout:m}))];case 5:return o=s.sent(),S=Date.now(),b+=S-E,h&&h((0,i.convertAxiosResponse)(o,{accumulativeDurationMs:b,durationMs:S-E,retries:g})),[2,{value:o.data}];case 6:if(u=s.sent(),S=Date.now(),b+=E?S-E:0,h&&(p=(0,i.convertAxiosError)(u,{accumulativeDurationMs:b,durationMs:E?S-E:0,retries:g}))&&h(p),!(0,a.isRetryableError)(u))throw(0,c.transformError)(u);return O=u,[3,7];case 7:return g++,[2]}}))},_.label=1;case 1:return[5,R()];case 2:if("object"==typeof(C=_.sent()))return[2,C.value];_.label=3;case 3:if(g<=r.maxRetries)return[3,1];_.label=4;case 4:throw(0,c.transformError)(O)}}))}))}},1100:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.transformError=void 0;var n=o(3028);t.transformError=function(e){return e.isAxiosError?n.CommercetoolsError.fromAxiosError(e):e}},9291:(e,t)=>{var o;Object.defineProperty(t,"__esModule",{value:!0}),t.Region=void 0,(o=t.Region||(t.Region={})).NORTH_AMERICA_GCP="north_america_gcp",o.NORTH_AMERICA_AWS="north_america_aws",o.EUROPE_GCP="europe_gcp",o.EUROPE_AWS="europe_aws",o.AUSTRALIA_GCP="australia_gcp"},2519:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertAxiosError=void 0;var n=o(7271);t.convertAxiosError=function(e,t){var o,r,s,i,a,c,u,p,d,l;return"isAxiosError"in e?{request:{url:null!==(r=null===(o=e.config)||void 0===o?void 0:o.url)&&void 0!==r?r:"",method:null===(s=e.config)||void 0===s?void 0:s.method,params:null===(i=e.config)||void 0===i?void 0:i.params,headers:(0,n.extractAxiosHeaders)(null===(a=e.config)||void 0===a?void 0:a.headers),data:null===(c=e.config)||void 0===c?void 0:c.data},response:{code:e.code,message:(null===(u=e.response)||void 0===u?void 0:u.status)?void 0:e.message,status:null===(p=e.response)||void 0===p?void 0:p.status,headers:(0,n.extractAxiosHeaders)(null===(d=e.response)||void 0===d?void 0:d.headers),data:null===(l=e.response)||void 0===l?void 0:l.data},stats:t}:null}},4059:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertAxiosResponse=void 0;var n=o(7271);t.convertAxiosResponse=function(e,t){var o,r,s,i,a,c;return{request:{url:null!==(r=null===(o=e.config)||void 0===o?void 0:o.url)&&void 0!==r?r:"",method:null===(s=e.config)||void 0===s?void 0:s.method,params:null===(i=e.config)||void 0===i?void 0:i.params,headers:(0,n.extractAxiosHeaders)(null===(a=e.config)||void 0===a?void 0:a.headers),data:null===(c=e.config)||void 0===c?void 0:c.data},response:{status:e.status,headers:(0,n.extractAxiosHeaders)(e.headers),data:e.data},stats:t}}},4070:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createAxiosInstance=void 0,o(4060);var r=n(o(7218));t.createAxiosInstance=function(e){return r.default.create({httpsAgent:void 0})}},7271:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.extractAxiosHeaders=void 0;var n=o(7218);t.extractAxiosHeaders=function(e){var t={};if(e instanceof n.AxiosHeaders){var o=e.toJSON();t={},Object.entries(o).forEach((function(e){var o=e[0],n=e[1],r=o.toLowerCase();"boolean"==typeof n||"number"==typeof n||"string"==typeof n?t[r]=n.toString():Array.isArray(n)&&(t[r]=n.join(", "))}))}return Object.keys(t).length?t:void 0}},4747:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(o(2519),t),r(o(4059),t),r(o(4070),t),r(o(7271),t)},3720:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.calculateDelay=void 0,t.calculateDelay=function(e,t){if(!t||0===e)return 0;var o=t.delayMs*Math.pow(2,e-1);if(t.jitter){var n=o*(1+1/(e+1));return Math.floor(Math.random()*n)}return o}},1834:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ensureNonEmptyString=void 0;var n=o(3028);t.ensureNonEmptyString=function(e){if(!e.value.trim())throw new n.CommercetoolsError("The string parameter '".concat(e.name,"' cannot be empty"))}},3930:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatAsKey=void 0;var n=o(3028);t.formatAsKey=function(e){var t="";if("string"!=typeof e)throw new n.CommercetoolsError("The [input] parameter must be a string");if((t=(t=(t=(t=(t=(t=e.trim().toLowerCase()).replace(/ {2,}/g,"")).replace(/&/g,"and")).replace(/[ _]/g,"-")).replace(/[^0-9a-z-]+/g,"")).replace(/-{2,}/g,"-")).length&&"-"===t[0]&&(t=t.slice(1)),t.length&&"-"===t[t.length-1]&&(t=t.slice(0,-1)),t.length<2)throw new n.CommercetoolsError("Formatted key did not meet minimum length of 2 characters: ".concat(t));if(t.length>256)throw new n.CommercetoolsError("Formatted key exceeds the maximum length of 256 characters: ".concat(t));return t}},6640:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getAttributeValue=void 0,t.getAttributeValue=function(e){var t,o;if(null===(t=null==e?void 0:e.attributes)||void 0===t?void 0:t.length){var n=null===(o=e.attributes)||void 0===o?void 0:o.find((function(t){return t.name===e.name}));if(n)return n.value}return null}},893:function(e,t,o){var n=this&&this.__createBinding||(Object.create?function(e,t,o,n){void 0===n&&(n=o);var r=Object.getOwnPropertyDescriptor(t,o);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,n,r)}:function(e,t,o,n){void 0===n&&(n=o),e[n]=t[o]}),r=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||n(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(o(4747),t),r(o(3720),t),r(o(1834),t),r(o(3930),t),r(o(6640),t),r(o(9998),t),r(o(9989),t),r(o(3190),t)},9998:function(e,t,o){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.maskSensitiveData=t.maskSensitiveHeaders=t.maskSensitiveInput=t.DEFAULT_MASKING_STRING=t.SENSITIVE_HEADER_NAMES=t.SENSITIVE_PROPERTY_NAMES=void 0;var r=n(o(3692)),s=o(7218),i=o(2003);function a(e,o,n){if(void 0===n&&(n=t.DEFAULT_MASKING_STRING),"object"==typeof e&&null!=e){var a;return a=e instanceof s.AxiosHeaders?(0,i.plainClone)(e.toJSON()):(0,i.plainClone)(e),(0,r.default)(a).forEach((function(){var e,t;o.includes(null!==(t=null===(e=this.key)||void 0===e?void 0:e.toLowerCase())&&void 0!==t?t:"")&&this.update(n)})),a}return e}t.SENSITIVE_PROPERTY_NAMES=["password","refresh_token"],t.SENSITIVE_HEADER_NAMES=["authorization"],t.DEFAULT_MASKING_STRING="********",t.maskSensitiveInput=function(e){return a(e,t.SENSITIVE_PROPERTY_NAMES)},t.maskSensitiveHeaders=function(e){return a(e,t.SENSITIVE_HEADER_NAMES)},t.maskSensitiveData=a},2003:(e,t)=>{function o(e,t){if(t&&e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&("object"==typeof e[n]?(Array.isArray(e[n])?t[n]=[]:t[n]={},t[n]=o(e[n],t[n])):t[n]=e[n]);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.plainClone=void 0,t.plainClone=function(e){return o(e,{})}},9989:function(e,t,o){var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,s){function i(e){try{c(n.next(e))}catch(e){s(e)}}function a(e){try{c(n.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var o,n,r,s,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(o=1,n&&(r=2&a[0]?n.return:a[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;switch(n=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((r=(r=i.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{o=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.retryOnConflict=void 0;var s=o(3720),i=o(8842);t.retryOnConflict=function(e){return n(this,void 0,void 0,(function(){var t,o,n,a,c,u;return r(this,(function(p){switch(p.label){case 0:t=((null==e?void 0:e.maxRetries)||3)+1,o=(null==e?void 0:e.delayMs)||100,n=!!(null==e?void 0:e.jitter),a=function(a){var c,u,p;return r(this,(function(r){switch(r.label){case 0:return a>1?(c=(0,s.calculateDelay)(a-1,{delayMs:o,jitter:n}),[4,new Promise((function(e){return setTimeout(e,c)}))]):[3,2];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,4,,5]),u={},[4,e.executeFn(a)];case 3:return[2,(u.value=r.sent(),u)];case 4:if(!(p=r.sent()).isCommercetoolsError||p.status!==i.Status.Conflict||a===t)throw p;return[3,5];case 5:return[2]}}))},c=1,p.label=1;case 1:return c<=t?[5,a(c)]:[3,4];case 2:if("object"==typeof(u=p.sent()))return[2,u.value];p.label=3;case 3:return c++,[3,1];case 4:return[2,void 0]}}))}))}},3190:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.buildUserAgent=void 0;var n=o(4060);t.buildUserAgent=function(e){var t=n.USER_AGENT_PREFIX;return e&&(t="".concat(t," (").concat(e,")")),t}},8842:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reason=t.ErrorStatus=t.RedirectionStatus=t.SuccessStatus=t.InformationStatus=t.Status=void 0;var n=o(7536);Object.defineProperty(t,"Status",{enumerable:!0,get:function(){return n.Status}}),Object.defineProperty(t,"InformationStatus",{enumerable:!0,get:function(){return n.InformationStatus}}),Object.defineProperty(t,"SuccessStatus",{enumerable:!0,get:function(){return n.SuccessStatus}}),Object.defineProperty(t,"RedirectionStatus",{enumerable:!0,get:function(){return n.RedirectionStatus}}),Object.defineProperty(t,"ErrorStatus",{enumerable:!0,get:function(){return n.ErrorStatus}});var r=o(7890);Object.defineProperty(t,"reason",{enumerable:!0,get:function(){return r.reason}})},7890:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.reason=void 0;const n=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(n.Status).find((t=>n.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=[],n=[];return null==t&&(t=function(e,t){return o[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,o.indexOf(t)).join(".")+"]"}),function(r,s){if(o.length>0){var i=o.indexOf(this);~i?o.splice(i+1):o.push(this),~i?n.splice(i,1/0,r):n.push(r),~o.indexOf(s)&&(s=t.call(this,r,s))}else o.push(s);return null==e?s:e.call(this,r,s)}}(e.exports=function(e,t,n,r){return JSON.stringify(e,o(t,r),n)}).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 n(e,t){if(e.forEach)return e.forEach(t);for(var o=0;o<e.length;o++)t(e[o],o,e)}var r=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 i(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 i=e.constructor&&e.constructor.prototype||e.__proto__||{},a=function(){};a.prototype=i,s=new a}return n(r(e),(function(t){s[t]=e[t]})),s}return e}function a(e,t,a){var c=[],u=[],p=!0;return function e(d){var l=a?i(d):d,h={},f=!0,m={node:l,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){m.isRoot||(m.parent.node[m.key]=e),m.node=e,t&&(f=!1)},delete:function(e){delete m.parent.node[m.key],e&&(f=!1)},remove:function(e){o(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],e&&(f=!1)},keys:null,before:function(e){h.before=e},after:function(e){h.after=e},pre:function(e){h.pre=e},post:function(e){h.post=e},stop:function(){p=!1},block:function(){f=!1}};if(!p)return m;function y(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=r(m.node)),m.isLeaf=0===m.keys.length;for(var e=0;e<u.length;e++)if(u[e].node_===d){m.circular=u[e];break}}else m.isLeaf=!0,m.keys=null;m.notLeaf=!m.isLeaf,m.notRoot=!m.isRoot}y();var v=t.call(m,m.node);return void 0!==v&&m.update&&m.update(v),h.before&&h.before.call(m,m.node),f?("object"!=typeof m.node||null===m.node||m.circular||(u.push(m),y(),n(m.keys,(function(t,o){c.push(t),h.pre&&h.pre.call(m,m.node[t],t);var n=e(m.node[t]);a&&s.call(m.node,t)&&(m.node[t]=n.node),n.isLast=o===m.keys.length-1,n.isFirst=0===o,h.post&&h.post.call(m,n),c.pop()})),u.pop()),h.after&&h.after.call(m,m.node),m):m}(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 n=e[o];if(!t||!s.call(t,n))return;t=t[n]}return t},c.prototype.has=function(e){for(var t=this.value,o=0;o<e.length;o++){var n=e[o];if(!t||!s.call(t,n))return!1;t=t[n]}return!0},c.prototype.set=function(e,t){for(var o=this.value,n=0;n<e.length-1;n++){var r=e[n];s.call(o,r)||(o[r]={}),o=o[r]}return o[e[n]]=t,t},c.prototype.map=function(e){return a(this.value,e,!0)},c.prototype.forEach=function(e){return this.value=a(this.value,e,!1),this.value},c.prototype.reduce=function(e,t){var o=1===arguments.length,n=o?this.value:t;return this.forEach((function(t){this.isRoot&&o||(n=e.call(this,n,t))})),n},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 a=0;a<e.length;a++)if(e[a]===s)return t[a];if("object"==typeof s&&null!==s){var c=i(s);return e.push(s),t.push(c),n(r(s),(function(e){c[e]=o(s[e])})),e.pop(),t.pop(),c}return s}(this.value)},n(r(c.prototype),(function(e){u[e]=function(t){var o=[].slice.call(arguments,1),n=new c(t);return n[e].apply(n,o)}})),e.exports=u},7218:(e,t,o)=>{function n(e,t){return function(){return e.apply(t,arguments)}}const{toString:r}=Object.prototype,{getPrototypeOf:s}=Object,i=(a=Object.create(null),e=>{const t=r.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const c=e=>(e=e.toLowerCase(),t=>i(t)===e),u=e=>t=>typeof t===e,{isArray:p}=Array,d=u("undefined"),l=c("ArrayBuffer"),h=u("string"),f=u("function"),m=u("number"),y=e=>null!==e&&"object"==typeof e,v=e=>{if("object"!==i(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},g=c("Date"),O=c("File"),b=c("Blob"),E=c("FileList"),S=c("URLSearchParams");function R(e,t,{allOwnKeys:o=!1}={}){if(null==e)return;let n,r;if("object"!=typeof e&&(e=[e]),p(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{const r=o?Object.getOwnPropertyNames(e):Object.keys(e),s=r.length;let i;for(n=0;n<s;n++)i=r[n],t.call(null,e[i],i,e)}}function C(e,t){t=t.toLowerCase();const o=Object.keys(e);let n,r=o.length;for(;r-- >0;)if(n=o[r],t===n.toLowerCase())return n;return null}const _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:o.g,T=e=>!d(e)&&e!==_,w=(q="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>q&&e instanceof q);var q;const P=c("HTMLFormElement"),x=(({hasOwnProperty:e})=>(t,o)=>e.call(t,o))(Object.prototype),I=c("RegExp"),A=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e),n={};R(o,((o,r)=>{!1!==t(o,r,e)&&(n[r]=o)})),Object.defineProperties(e,n)},j="abcdefghijklmnopqrstuvwxyz",k="0123456789",U={DIGIT:k,ALPHA:j,ALPHA_DIGIT:j+j.toUpperCase()+k};var N={isArray:p,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&f(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||r.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&&l(e.buffer),t},isString:h,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:v,isUndefined:d,isDate:g,isFile:O,isBlob:b,isRegExp:I,isFunction:f,isStream:e=>y(e)&&f(e.pipe),isURLSearchParams:S,isTypedArray:w,isFileList:E,forEach:R,merge:function e(){const{caseless:t}=T(this)&&this||{},o={},n=(n,r)=>{const s=t&&C(o,r)||r;v(o[s])&&v(n)?o[s]=e(o[s],n):v(n)?o[s]=e({},n):p(n)?o[s]=n.slice():o[s]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&R(arguments[e],n);return o},extend:(e,t,o,{allOwnKeys:r}={})=>(R(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,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),o&&Object.assign(e.prototype,o)},toFlatObject:(e,t,o,n)=>{let r,i,a;const c={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)a=r[i],n&&!n(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==o&&s(e)}while(e&&(!o||o(e,t))&&e!==Object.prototype);return t},kindOf:i,kindOfTest:c,endsWith:(e,t,o)=>{e=String(e),(void 0===o||o>e.length)&&(o=e.length),o-=t.length;const n=e.indexOf(t,o);return-1!==n&&n===o},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!m(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 n;for(;(n=o.next())&&!n.done;){const o=n.value;t.call(e,o[0],o[1])}},matchAll:(e,t)=>{let o;const n=[];for(;null!==(o=e.exec(t));)n.push(o);return n},isHTMLForm:P,hasOwnProperty:x,hasOwnProp:x,reduceDescriptors:A,freezeMethods:e=>{A(e,((t,o)=>{if(f(e)&&-1!==["arguments","caller","callee"].indexOf(o))return!1;const n=e[o];f(n)&&(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={},n=e=>{e.forEach((e=>{o[e]=!0}))};return p(e)?n(e):n(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:C,global:_,isContextDefined:T,ALPHABET:U,generateString:(e=16,t=U.ALPHA_DIGIT)=>{let o="";const{length:n}=t;for(;e--;)o+=t[Math.random()*n|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,n)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const r=p(e)?[]:{};return R(e,((e,t)=>{const s=o(e,n+1);!d(s)&&(r[t]=s)})),t[n]=void 0,r}}return e};return o(e,0)}};function M(e,t,o,n,r){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),n&&(this.request=n),r&&(this.response=r)}N.inherits(M,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:N.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const B=M.prototype,G={};function D(e){return N.isPlainObject(e)||N.isArray(e)}function L(e){return N.endsWith(e,"[]")?e.slice(0,-2):e}function K(e,t,o){return e?e.concat(t).map((function(e,t){return e=L(e),!o&&t?"["+e+"]":e})).join(o?".":""):t}["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=>{G[e]={value:e}})),Object.defineProperties(M,G),Object.defineProperty(B,"isAxiosError",{value:!0}),M.from=(e,t,o,n,r,s)=>{const i=Object.create(B);return N.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),M.call(i,e.message,t,o,n,r),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const F=N.toFlatObject(N,{},null,(function(e){return/^is[A-Z]/.test(e)}));function H(e,t,o){if(!N.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(o=N.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!N.isUndefined(t[e])}))).metaTokens,r=o.visitor||u,s=o.dots,i=o.indexes,a=(o.Blob||"undefined"!=typeof Blob&&Blob)&&N.isSpecCompliantForm(t);if(!N.isFunction(r))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(N.isDate(e))return e.toISOString();if(!a&&N.isBlob(e))throw new M("Blob is not supported. Use a Buffer instead.");return N.isArrayBuffer(e)||N.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,o,r){let a=e;if(e&&!r&&"object"==typeof e)if(N.endsWith(o,"{}"))o=n?o:o.slice(0,-2),e=JSON.stringify(e);else if(N.isArray(e)&&function(e){return N.isArray(e)&&!e.some(D)}(e)||(N.isFileList(e)||N.endsWith(o,"[]"))&&(a=N.toArray(e)))return o=L(o),a.forEach((function(e,n){!N.isUndefined(e)&&null!==e&&t.append(!0===i?K([o],n,s):null===i?o:o+"[]",c(e))})),!1;return!!D(e)||(t.append(K(r,o,s),c(e)),!1)}const p=[],d=Object.assign(F,{defaultVisitor:u,convertValue:c,isVisitable:D});if(!N.isObject(e))throw new TypeError("data must be an object");return function e(o,n){if(!N.isUndefined(o)){if(-1!==p.indexOf(o))throw Error("Circular reference detected in "+n.join("."));p.push(o),N.forEach(o,(function(o,s){!0===(!(N.isUndefined(o)||null===o)&&r.call(t,o,N.isString(s)?s.trim():s,n,d))&&e(o,n?n.concat(s):[s])})),p.pop()}}(e),t}function z(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&&H(e,this,t)}const J=V.prototype;function W(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function X(e,t,o){if(!t)return e;const n=o&&o.encode||W,r=o&&o.serialize;let s;if(s=r?r(t,o):N.isURLSearchParams(t)?t.toString():new V(t,o).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}J.append=function(e,t){this._pairs.push([e,t])},J.toString=function(e){const t=e?function(t){return e.call(this,t,z)}:z;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Y=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){N.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Q={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:V,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"]};function Z(e){function t(e,o,n,r){let s=e[r++];const i=Number.isFinite(+s),a=r>=e.length;return s=!s&&N.isArray(n)?n.length:s,a?(N.hasOwnProp(n,s)?n[s]=[n[s],o]:n[s]=o,!i):(n[s]&&N.isObject(n[s])||(n[s]=[]),t(e,o,n[s],r)&&N.isArray(n[s])&&(n[s]=function(e){const t={},o=Object.keys(e);let n;const r=o.length;let s;for(n=0;n<r;n++)s=o[n],t[s]=e[s];return t}(n[s])),!i)}if(N.isFormData(e)&&N.isFunction(e.entries)){const o={};return N.forEachEntry(e,((e,n)=>{t(function(e){return N.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,o,0)})),o}return null}const ee={"Content-Type":void 0},te={transitional:Q,adapter:["xhr","http"],transformRequest:[function(e,t){const o=t.getContentType()||"",n=o.indexOf("application/json")>-1,r=N.isObject(e);if(r&&N.isHTMLForm(e)&&(e=new FormData(e)),N.isFormData(e))return n&&n?JSON.stringify(Z(e)):e;if(N.isArrayBuffer(e)||N.isBuffer(e)||N.isStream(e)||N.isFile(e)||N.isBlob(e))return e;if(N.isArrayBufferView(e))return e.buffer;if(N.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(r){if(o.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return H(e,new $.classes.URLSearchParams,Object.assign({visitor:function(e,t,o,n){return $.isNode&&N.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=N.isFileList(e))||o.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return H(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||n?(t.setContentType("application/json",!1),function(e,t,o){if(N.isString(e))try{return(0,JSON.parse)(e),N.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||te.transitional,o=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&N.isString(e)&&(o&&!this.responseType||n)){const o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw M.from(e,M.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:$.classes.FormData,Blob:$.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};N.forEach(["delete","get","head"],(function(e){te.headers[e]={}})),N.forEach(["post","put","patch"],(function(e){te.headers[e]=N.merge(ee)}));var oe=te;const ne=N.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"]),re=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ie(e){return!1===e||null==e?e:N.isArray(e)?e.map(ie):String(e)}function ae(e,t,o,n,r){return N.isFunction(n)?n.call(this,t,o):(r&&(t=o),N.isString(t)?N.isString(n)?-1!==t.indexOf(n):N.isRegExp(n)?n.test(t):void 0:void 0)}class ce{constructor(e){e&&this.set(e)}set(e,t,o){const n=this;function r(e,t,o){const r=se(t);if(!r)throw new Error("header name must be a non-empty string");const s=N.findKey(n,r);(!s||void 0===n[s]||!0===o||void 0===o&&!1!==n[s])&&(n[s||t]=ie(e))}const s=(e,t)=>N.forEach(e,((e,o)=>r(e,o,t)));return N.isPlainObject(e)||e instanceof this.constructor?s(e,t):N.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let o,n,r;return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),o=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim(),!o||t[o]&&ne[o]||("set-cookie"===o?t[o]?t[o].push(n):t[o]=[n]:t[o]=t[o]?t[o]+", "+n:n)})),t})(e),t):null!=e&&r(t,e,o),this}get(e,t){if(e=se(e)){const o=N.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 n;for(;n=o.exec(e);)t[n[1]]=n[2];return t}(e);if(N.isFunction(t))return t.call(this,e,o);if(N.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const o=N.findKey(this,e);return!(!o||void 0===this[o]||t&&!ae(0,this[o],o,t))}return!1}delete(e,t){const o=this;let n=!1;function r(e){if(e=se(e)){const r=N.findKey(o,e);!r||t&&!ae(0,o[r],r,t)||(delete o[r],n=!0)}}return N.isArray(e)?e.forEach(r):r(e),n}clear(e){const t=Object.keys(this);let o=t.length,n=!1;for(;o--;){const r=t[o];e&&!ae(0,this[r],r,e,!0)||(delete this[r],n=!0)}return n}normalize(e){const t=this,o={};return N.forEach(this,((n,r)=>{const s=N.findKey(o,r);if(s)return t[s]=ie(n),void delete t[r];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,o)=>t.toUpperCase()+o))}(r):String(r).trim();i!==r&&delete t[r],t[i]=ie(n),o[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return N.forEach(this,((o,n)=>{null!=o&&!1!==o&&(t[n]=e&&N.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[re]=this[re]={accessors:{}}).accessors,o=this.prototype;function n(e){const n=se(e);t[n]||(function(e,t){const o=N.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+o,{value:function(e,o,r){return this[n].call(this,t,e,o,r)},configurable:!0})}))}(o,e),t[n]=!0)}return N.isArray(e)?e.forEach(n):n(e),this}}ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),N.freezeMethods(ce.prototype),N.freezeMethods(ce);var ue=ce;function pe(e,t){const o=this||oe,n=t||o,r=ue.from(n.headers);let s=n.data;return N.forEach(e,(function(e){s=e.call(o,s,r.normalize(),t?t.status:void 0)})),r.normalize(),s}function de(e){return!(!e||!e.__CANCEL__)}function le(e,t,o){M.call(this,null==e?"canceled":e,M.ERR_CANCELED,t,o),this.name="CanceledError"}N.inherits(le,M,{__CANCEL__:!0});var he=$.isStandardBrowserEnv?{write:function(e,t,o,n,r,s){const i=[];i.push(e+"="+encodeURIComponent(t)),N.isNumber(o)&&i.push("expires="+new Date(o).toGMTString()),N.isString(n)&&i.push("path="+n),N.isString(r)&&i.push("domain="+r),!0===s&&i.push("secure"),document.cookie=i.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 fe(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}var me=$.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let o;function n(o){let n=o;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{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=n(window.location.href),function(e){const t=N.isString(e)?n(e):e;return t.protocol===o.protocol&&t.host===o.host}}():function(){return!0};function ye(e,t){let o=0;const n=function(e,t){e=e||10;const o=new Array(e),n=new Array(e);let r,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=n[i];r||(r=c),o[s]=a,n[s]=c;let p=i,d=0;for(;p!==s;)d+=o[p++],p%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-r<t)return;const l=u&&c-u;return l?Math.round(1e3*d/l):void 0}}(50,250);return r=>{const s=r.loaded,i=r.lengthComputable?r.total:void 0,a=s-o,c=n(a);o=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:r};u[t?"download":"upload"]=!0,e(u)}}const ve={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,o){let n=e.data;const r=ue.from(e.headers).normalize(),s=e.responseType;let i;function a(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}N.isFormData(n)&&($.isStandardBrowserEnv||$.isStandardBrowserWebWorkerEnv)&&r.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",o=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";r.set("Authorization","Basic "+btoa(t+":"+o))}const u=fe(e.baseURL,e.url);function p(){if(!c)return;const n=ue.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,o){const n=o.config.validateStatus;o.status&&n&&!n(o.status)?t(new M("Request failed with status code "+o.status,[M.ERR_BAD_REQUEST,M.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o)):e(o)}((function(e){t(e),a()}),(function(e){o(e),a()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:n,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),X(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 M("Request aborted",M.ECONNABORTED,e,c)),c=null)},c.onerror=function(){o(new M("Network Error",M.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Q;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),o(new M(t,n.clarifyTimeoutError?M.ETIMEDOUT:M.ECONNABORTED,e,c)),c=null},$.isStandardBrowserEnv){const t=(e.withCredentials||me(u))&&e.xsrfCookieName&&he.read(e.xsrfCookieName);t&&r.set(e.xsrfHeaderName,t)}void 0===n&&r.setContentType(null),"setRequestHeader"in c&&N.forEach(r.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),N.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&"json"!==s&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ye(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ye(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{c&&(o(!t||t.type?new le(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);d&&-1===$.protocols.indexOf(d)?o(new M("Unsupported protocol "+d+":",M.ERR_BAD_REQUEST,e)):c.send(n||null)}))}};N.forEach(ve,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function ge(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new le(null,e)}function Oe(e){return ge(e),e.headers=ue.from(e.headers),e.data=pe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=N.isArray(e)?e:[e];const{length:t}=e;let o,n;for(let r=0;r<t&&(o=e[r],!(n=N.isString(o)?ve[o.toLowerCase()]:o));r++);if(!n){if(!1===n)throw new M(`Adapter ${o} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(N.hasOwnProp(ve,o)?`Adapter '${o}' is not available in the build`:`Unknown adapter '${o}'`)}if(!N.isFunction(n))throw new TypeError("adapter is not a function");return n})(e.adapter||oe.adapter)(e).then((function(t){return ge(e),t.data=pe.call(e,e.transformResponse,t),t.headers=ue.from(t.headers),t}),(function(t){return de(t)||(ge(e),t&&t.response&&(t.response.data=pe.call(e,e.transformResponse,t.response),t.response.headers=ue.from(t.response.headers))),Promise.reject(t)}))}const be=e=>e instanceof ue?e.toJSON():e;function Ee(e,t){t=t||{};const o={};function n(e,t,o){return N.isPlainObject(e)&&N.isPlainObject(t)?N.merge.call({caseless:o},e,t):N.isPlainObject(t)?N.merge({},t):N.isArray(t)?t.slice():t}function r(e,t,o){return N.isUndefined(t)?N.isUndefined(e)?void 0:n(void 0,e,o):n(e,t,o)}function s(e,t){if(!N.isUndefined(t))return n(void 0,t)}function i(e,t){return N.isUndefined(t)?N.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(o,r,s){return s in t?n(o,r):s in e?n(void 0,o):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>r(be(e),be(t),!0)};return N.forEach(Object.keys(e).concat(Object.keys(t)),(function(n){const s=c[n]||r,i=s(e[n],t[n],n);N.isUndefined(i)&&s!==a||(o[n]=i)})),o}const Se={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Se[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}}));const Re={};Se.transitional=function(e,t,o){function n(e,t){return"[Axios v1.3.5] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(o,r,s)=>{if(!1===e)throw new M(n(r," has been removed"+(t?" in "+t:"")),M.ERR_DEPRECATED);return t&&!Re[r]&&(Re[r]=!0,console.warn(n(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(o,r,s)}};var Ce={assertOptions:function(e,t,o){if("object"!=typeof e)throw new M("options must be an object",M.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let r=n.length;for(;r-- >0;){const s=n[r],i=t[s];if(i){const t=e[s],o=void 0===t||i(t,s,e);if(!0!==o)throw new M("option "+s+" must be "+o,M.ERR_BAD_OPTION_VALUE)}else if(!0!==o)throw new M("Unknown option "+s,M.ERR_BAD_OPTION)}},validators:Se};const _e=Ce.validators;class Te{constructor(e){this.defaults=e,this.interceptors={request:new Y,response:new Y}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ee(this.defaults,t);const{transitional:o,paramsSerializer:n,headers:r}=t;let s;void 0!==o&&Ce.assertOptions(o,{silentJSONParsing:_e.transitional(_e.boolean),forcedJSONParsing:_e.transitional(_e.boolean),clarifyTimeoutError:_e.transitional(_e.boolean)},!1),null!=n&&(N.isFunction(n)?t.paramsSerializer={serialize:n}:Ce.assertOptions(n,{encode:_e.function,serialize:_e.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),s=r&&N.merge(r.common,r[t.method]),s&&N.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete r[e]})),t.headers=ue.concat(s,r);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let p,d=0;if(!a){const e=[Oe.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),p=e.length,u=Promise.resolve(t);d<p;)u=u.then(e[d++],e[d++]);return u}p=i.length;let l=t;for(d=0;d<p;){const e=i[d++],t=i[d++];try{l=e(l)}catch(e){t.call(this,e);break}}try{u=Oe.call(this,l)}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 X(fe((e=Ee(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}N.forEach(["delete","get","head","options"],(function(e){Te.prototype[e]=function(t,o){return this.request(Ee(o||{},{method:e,url:t,data:(o||{}).data}))}})),N.forEach(["post","put","patch"],(function(e){function t(t){return function(o,n,r){return this.request(Ee(r||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:o,data:n}))}}Te.prototype[e]=t(),Te.prototype[e+"Form"]=t(!0)}));var we=Te;class qe{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 n=new Promise((e=>{o.subscribe(e),t=e})).then(e);return n.cancel=function(){o.unsubscribe(t)},n},e((function(e,n,r){o.reason||(o.reason=new le(e,n,r),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 qe((function(t){e=t})),cancel:e}}}var Pe=qe;const xe={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(xe).forEach((([e,t])=>{xe[t]=e}));var Ie=xe;const Ae=function e(t){const o=new we(t),r=n(we.prototype.request,o);return N.extend(r,we.prototype,o,{allOwnKeys:!0}),N.extend(r,o,null,{allOwnKeys:!0}),r.create=function(o){return e(Ee(t,o))},r}(oe);Ae.Axios=we,Ae.CanceledError=le,Ae.CancelToken=Pe,Ae.isCancel=de,Ae.VERSION="1.3.5",Ae.toFormData=H,Ae.AxiosError=M,Ae.Cancel=Ae.CanceledError,Ae.all=function(e){return Promise.all(e)},Ae.spread=function(e){return function(t){return e.apply(null,t)}},Ae.isAxiosError=function(e){return N.isObject(e)&&!0===e.isAxiosError},Ae.mergeConfig=Ee,Ae.AxiosHeaders=ue,Ae.formToJSON=e=>Z(N.isHTMLForm(e)?new FormData(e):e),Ae.HttpStatusCode=Ie,Ae.default=Ae,e.exports=Ae}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,o),s.exports}o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var n=o(2915),r=exports;for(var s in n)r[s]=n[s];n.__esModule&&Object.defineProperty(r,"__esModule",{value:!0});
2
2
  //# sourceMappingURL=ge-commercetools-utils-browser.cjs.js.map