UNPKG

@spree/storefront-api-v2-sdk

Version:

Node module to easily integrate your JavaScript or TypeScript application with Spree API V2. You can create an entirely custom Storefront in JS/TS with this package including one page checkout, Single Page Apps, PWAs and so on

2 lines 74.9 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SpreeSDK=e():t.SpreeSDK=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=39)}([function(t,e,r){t.exports=r(40)},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(e)}t.exports=r},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,r){var n=r(15);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t,e,r){var n=r(21),o=r(8);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?o(t):e}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return g}));var n=r(21),o=r.n(n),i=r(0),c=r.n(i),u=r(2),a=r.n(u),s=r(5),f=r.n(s),p=r(35),l=r.n(p),h=r(36),d=r(9),v=r(11),y=r(10),m=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function c(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(c,u)}a((n=n.apply(t,e||[])).next())}))},g=function(){function e(r){a()(this,e),this.host=r||t.env.SPREE_HOST||"http://localhost:3000/",this.axios=l.a.create({baseURL:this.host,headers:{"Content-Type":"application/json"},paramsSerializer:function(t){return h.stringify(t,{arrayFormat:"brackets"})}})}return f()(e,[{key:"spreeResponse",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return m(this,void 0,void 0,c.a.mark((function o(){var i,u,a;return c.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,i=this.spreeOrderHeaders(r),u={url:e,params:n,method:t,headers:i},o.next=5,this.axios(u);case 5:return a=o.sent,o.abrupt("return",v.a.success(a.data));case 9:return o.prev=9,o.t0=o.catch(0),o.abrupt("return",v.a.fail(this.processError(o.t0)));case 12:case"end":return o.stop()}}),o,this,[[0,9]])})))}},{key:"classifyError",value:function(t){var e=t.response.data,r=e.error,n=e.errors;return"string"==typeof r?"object"===o()(n)?y.a.FULL:y.a.BASIC:y.a.LIMITED}},{key:"processError",value:function(t){return t.response?this.processSpreeError(t):t.request?new d.NoResponseError:new d.MisconfigurationError(t.message)}},{key:"processSpreeError",value:function(t){var e=t.response.data,r=e.error,n=e.errors,o=this.classifyError(t);return o===y.a.FULL?new d.ExpandedSpreeError(t.response,r,n):o===y.a.BASIC?new d.BasicSpreeError(t.response,r):new d.SpreeError(t.response)}},{key:"spreeOrderHeaders",value:function(t){var e={};return t.orderToken&&(e["X-Spree-Order-Token"]=t.orderToken),t.bearerToken&&(e.Authorization="Bearer ".concat(t.bearerToken)),e}}]),e}()}).call(this,r(22))},function(t,e,r){"use strict";var n=r(23),o=Object.prototype.toString;function i(t){return"[object Array]"===o.call(t)}function c(t){return void 0===t}function u(t){return null!==t&&"object"==typeof t}function a(t){if("[object Object]"!==o.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function s(t){return"[object Function]"===o.call(t)}function f(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),i(t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:function(t){return null!==t&&!c(t)&&null!==t.constructor&&!c(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:u,isPlainObject:a,isUndefined:c,isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:s,isStream:function(t){return u(t)&&s(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:f,merge:function t(){var e={};function r(r,n){a(e[n])&&a(r)?e[n]=t(e[n],r):a(r)?e[n]=t({},r):i(r)?e[n]=r.slice():e[n]=r}for(var n=0,o=arguments.length;n<o;n++)f(arguments[n],r);return e},extend:function(t,e,r){return f(e,(function(e,o){t[o]=r&&"function"==typeof e?n(e,r):e})),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,r){"use strict";r.r(e),r.d(e,"BasicSpreeError",(function(){return x})),r.d(e,"ExpandedSpreeError",(function(){return O})),r.d(e,"MisconfigurationError",(function(){return j})),r.d(e,"NoResponseError",(function(){return _})),r.d(e,"SpreeError",(function(){return m})),r.d(e,"SpreeSDKError",(function(){return v}));var n=r(2),o=r.n(n),i=r(8),c=r.n(i),u=r(3),a=r.n(u),s=r(4),f=r.n(s),p=r(1),l=r.n(p),h=r(37);function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l()(t);if(e){var o=l()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var v=function(t){a()(r,t);var e=d(r);function r(t){var n;return o()(this,r),n=e.call(this,t),Object.setPrototypeOf(c()(n),r.prototype),n}return r}(r.n(h)()(Error));function y(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l()(t);if(e){var o=l()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var m=function(t){a()(r,t);var e=y(r);function r(t){var n;o()(this,r),n=e.call(this,"Spree returned a HTTP ".concat(t.status," error code")),Object.setPrototypeOf(c()(n),r.prototype),n.name="SpreeError";var i=Object.assign({},t);return Object.defineProperties(i,{config:{enumerable:!1},data:{enumerable:!1},headers:{enumerable:!1},request:{enumerable:!1}}),n.serverResponse=i,n}return r}(v);function g(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l()(t);if(e){var o=l()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var x=function(t){a()(r,t);var e=g(r);function r(t,n){var i;return o()(this,r),i=e.call(this,t),Object.setPrototypeOf(c()(i),r.prototype),i.name="BasicSpreeError",i.summary=n,i}return r}(m),w=r(5),b=r.n(w),k=r(38),R=r.n(k);function P(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l()(t);if(e){var o=l()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var O=function(t){a()(r,t);var e=P(r);function r(t,n,i){var u;return o()(this,r),u=e.call(this,t,n),Object.setPrototypeOf(c()(u),r.prototype),u.name="ExpandedSpreeError",u.errors=Object.keys(i).reduce((function(t,e){for(var r=e.split("."),n=r.shift(),o=t;n;)o[n]||(0===r.length?o[n]=i[e]:o[n]={}),o=o[n],n=r.shift();return t}),{}),u}return b()(r,[{key:"getErrors",value:function(t){return R()(this.errors,t,null)}}]),r}(x);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l()(t);if(e){var o=l()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var j=function(t){a()(r,t);var e=S(r);function r(t){var n;return o()(this,r),n=e.call(this,"Incorrect request setup: ".concat(t)),Object.setPrototypeOf(c()(n),r.prototype),n.name="MisconfigurationError",n}return r}(v);function E(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=l()(t);if(e){var o=l()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return f()(this,r)}}var _=function(t){a()(r,t);var e=E(r);function r(){var t;return o()(this,r),t=e.call(this,"No response received from Spree"),Object.setPrototypeOf(c()(t),r.prototype),t.name="NoResponseError",t}return r}(v)},function(t,e,r){"use strict";var n;r.d(e,"a",(function(){return n})),function(t){t[t.BASIC=0]="BASIC",t[t.FULL=1]="FULL",t[t.LIMITED=2]="LIMITED"}(n||(n={}))},function(t,e,r){"use strict";e.a={success:function(t){return function(t){return{isSuccess:function(){return!0},isFail:function(){return!1},success:function(){return t},fail:function(){throw new Error("Cannot call fail() on success.")}}}(t)},fail:function(t){return function(t){return{isSuccess:function(){return!1},isFail:function(){return!0},success:function(){throw new Error("Cannot call success() on fail.")},fail:function(){return t}}}(t)}}},function(t,e,r){var n=r(33)(Object,"create");t.exports=n},function(t,e,r){var n=r(91);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},function(t,e,r){var n=r(97);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,o=Array.isArray,i=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),c=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r};t.exports={arrayToObject:c,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var i=e[n],c=i.obj[i.prop],u=Object.keys(c),a=0;a<u.length;++a){var s=u[a],f=c[s];"object"==typeof f&&null!==f&&-1===r.indexOf(f)&&(e.push({obj:c,prop:s}),r.push(f))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r){if(0===t.length)return t;var n=t;if("symbol"==typeof t?n=Symbol.prototype.toString.call(t):"string"!=typeof t&&(n=String(t)),"iso-8859-1"===r)return escape(n).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var o="",c=0;c<n.length;++c){var u=n.charCodeAt(c);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122?o+=n.charAt(c):u<128?o+=i[u]:u<2048?o+=i[192|u>>6]+i[128|63&u]:u<55296||u>=57344?o+=i[224|u>>12]+i[128|u>>6&63]+i[128|63&u]:(c+=1,u=65536+((1023&u)<<10|1023&n.charCodeAt(c)),o+=i[240|u>>18]+i[128|u>>12&63]+i[128|u>>6&63]+i[128|63&u])}return o},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(o(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,i){if(!r)return e;if("object"!=typeof r){if(o(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(i&&(i.plainObjects||i.allowPrototypes)||!n.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var u=e;return o(e)&&!o(r)&&(u=c(e,i)),o(e)&&o(r)?(r.forEach((function(r,o){if(n.call(e,o)){var c=e[o];c&&"object"==typeof c&&r&&"object"==typeof r?e[o]=t(c,r,i):e.push(r)}else e[o]=r})),e):Object.keys(r).reduce((function(e,o){var c=r[o];return n.call(e,o)?e[o]=t(e[o],c,i):e[o]=c,e}),u)}}},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){var n=r(32),o=r(70);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==n(t)}},function(t,e,r){var n=r(20).Symbol;t.exports=n},function(t,e,r){var n=r(66),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(t){n=c}}();var a,s=[],f=!1,p=-1;function l(){f&&a&&(f=!1,a.length?s=a.concat(s):p=-1,s.length&&h())}function h(){if(!f){var t=u(l);f=!0;for(var e=s.length;e;){for(a=s,s=[];++p<e;)a&&a[p].run();p=-1,e=s.length}a=null,f=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===c||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function v(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];s.push(new d(t,e)),1!==s.length||f||u(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return t.apply(e,r)}}},function(t,e,r){"use strict";var n=r(7);function o(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){if(!e)return t;var i;if(r)i=r(e);else if(n.isURLSearchParams(e))i=e.toString();else{var c=[];n.forEach(e,(function(t,e){null!=t&&(n.isArray(t)?e+="[]":t=[t],n.forEach(t,(function(t){n.isDate(t)?t=t.toISOString():n.isObject(t)&&(t=JSON.stringify(t)),c.push(o(e)+"="+o(t))})))})),i=c.join("&")}if(i){var u=t.indexOf("#");-1!==u&&(t=t.slice(0,u)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},function(t,e,r){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,r){"use strict";(function(e){var n=r(7),o=r(46),i={"Content-Type":"application/x-www-form-urlencoded"};function c(t,e){!n.isUndefined(t)&&n.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var u,a={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(u=r(27)),u),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),n.isFormData(t)||n.isArrayBuffer(t)||n.isBuffer(t)||n.isStream(t)||n.isFile(t)||n.isBlob(t)?t:n.isArrayBufferView(t)?t.buffer:n.isURLSearchParams(t)?(c(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):n.isObject(t)?(c(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};a.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(t){a.headers[t]={}})),n.forEach(["post","put","patch"],(function(t){a.headers[t]=n.merge(i)})),t.exports=a}).call(this,r(22))},function(t,e,r){"use strict";var n=r(7),o=r(47),i=r(49),c=r(24),u=r(50),a=r(53),s=r(54),f=r(28);t.exports=function(t){return new Promise((function(e,r){var p=t.data,l=t.headers;n.isFormData(p)&&delete l["Content-Type"];var h=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",v=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";l.Authorization="Basic "+btoa(d+":"+v)}var y=u(t.baseURL,t.url);if(h.open(t.method.toUpperCase(),c(y,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?a(h.getAllResponseHeaders()):null,i={data:t.responseType&&"text"!==t.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:t,request:h};o(e,r,i),h=null}},h.onabort=function(){h&&(r(f("Request aborted",t,"ECONNABORTED",h)),h=null)},h.onerror=function(){r(f("Network Error",t,null,h)),h=null},h.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),r(f(e,t,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var m=(t.withCredentials||s(y))&&t.xsrfCookieName?i.read(t.xsrfCookieName):void 0;m&&(l[t.xsrfHeaderName]=m)}if("setRequestHeader"in h&&n.forEach(l,(function(t,e){void 0===p&&"content-type"===e.toLowerCase()?delete l[e]:h.setRequestHeader(e,t)})),n.isUndefined(t.withCredentials)||(h.withCredentials=!!t.withCredentials),t.responseType)try{h.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){h&&(h.abort(),r(t),h=null)})),p||(p=null),h.send(p)}))}},function(t,e,r){"use strict";var n=r(48);t.exports=function(t,e,r,o,i){var c=new Error(t);return n(c,e,r,o,i)}},function(t,e,r){"use strict";var n=r(7);t.exports=function(t,e){e=e||{};var r={},o=["url","method","data"],i=["headers","auth","proxy","params"],c=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function a(t,e){return n.isPlainObject(t)&&n.isPlainObject(e)?n.merge(t,e):n.isPlainObject(e)?n.merge({},e):n.isArray(e)?e.slice():e}function s(o){n.isUndefined(e[o])?n.isUndefined(t[o])||(r[o]=a(void 0,t[o])):r[o]=a(t[o],e[o])}n.forEach(o,(function(t){n.isUndefined(e[t])||(r[t]=a(void 0,e[t]))})),n.forEach(i,s),n.forEach(c,(function(o){n.isUndefined(e[o])?n.isUndefined(t[o])||(r[o]=a(void 0,t[o])):r[o]=a(void 0,e[o])})),n.forEach(u,(function(n){n in e?r[n]=a(t[n],e[n]):n in t&&(r[n]=a(void 0,t[n]))}));var f=o.concat(i).concat(c).concat(u),p=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===f.indexOf(t)}));return n.forEach(p,s),r}},function(t,e,r){"use strict";function n(t){this.message=t}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,t.exports=n},function(t,e,r){"use strict";var n=String.prototype.replace,o=/%20/g,i=r(16),c={RFC1738:"RFC1738",RFC3986:"RFC3986"};t.exports=i.assign({default:c.RFC3986,formatters:{RFC1738:function(t){return n.call(t,o,"+")},RFC3986:function(t){return String(t)}}},c)},function(t,e,r){var n=r(19),o=r(68),i=r(69),c=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":c&&c in Object(t)?o(t):i(t)}},function(t,e,r){var n=r(78),o=r(83);t.exports=function(t,e){var r=o(t,e);return n(r)?r:void 0}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,r){t.exports=r(41)},function(t,e,r){"use strict";var n=r(58),o=r(59),i=r(31);t.exports={formats:i,parse:o,stringify:n}},function(t,e,r){var n=r(1),o=r(15),i=r(60),c=r(61);function u(e){var r="function"==typeof Map?new Map:void 0;return t.exports=u=function(t){if(null===t||!i(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return c(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)},u(e)}t.exports=u},function(t,e,r){var n=r(63);t.exports=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}},function(t,e,r){t.exports=r(105)},function(t,e,r){var n=function(t){"use strict";var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",c=n.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function a(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,i=Object.create(o.prototype),c=new R(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var c=r.delegate;if(c){var u=w(c,r);if(u){if(u===f)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var a=s(t,e,r);if("normal"===a.type){if(n=r.done?"completed":"suspendedYield",a.arg===f)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(n="completed",r.method="throw",r.arg=a.arg)}}}(t,r,c),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var f={};function p(){}function l(){}function h(){}var d={};d[o]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(P([])));y&&y!==e&&r.call(y,o)&&(d=y);var m=h.prototype=p.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){var n;this._invoke=function(o,i){function c(){return new e((function(n,c){!function n(o,i,c,u){var a=s(t[o],t,i);if("throw"!==a.type){var f=a.arg,p=f.value;return p&&"object"==typeof p&&r.call(p,"__await")?e.resolve(p.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):e.resolve(p).then((function(t){f.value=t,c(f)}),(function(t){return n("throw",t,c,u)}))}u(a.arg)}(o,i,n,c)}))}return n=n?n.then(c,c):c()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=s(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function R(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function P(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return l.prototype=m.constructor=h,h.constructor=l,l.displayName=u(h,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===l||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,u(t,c,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},g(x.prototype),x.prototype[i]=function(){return this},t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var c=new x(a(e,r,n,o),i);return t.isGeneratorFunction(r)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},g(m),u(m,c,"Generator"),m[o]=function(){return this},m.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=P,R.prototype={constructor:R,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return c.type="throw",c.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),a=r.call(i,"finallyLoc");if(u&&a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var c=i?i.completion:{};return c.type=t,c.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(c)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}},function(t,e,r){"use strict";var n=r(7),o=r(23),i=r(42),c=r(29);function u(t){var e=new i(t),r=o(i.prototype.request,e);return n.extend(r,i.prototype,e),n.extend(r,e),r}var a=u(r(26));a.Axios=i,a.create=function(t){return u(c(a.defaults,t))},a.Cancel=r(30),a.CancelToken=r(55),a.isCancel=r(25),a.all=function(t){return Promise.all(t)},a.spread=r(56),a.isAxiosError=r(57),t.exports=a,t.exports.default=a},function(t,e,r){"use strict";var n=r(7),o=r(24),i=r(43),c=r(44),u=r(29);function a(t){this.defaults=t,this.interceptors={request:new i,response:new i}}a.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=u(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=[c,void 0],r=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)r=r.then(e.shift(),e.shift());return r},a.prototype.getUri=function(t){return t=u(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(t){a.prototype[t]=function(e,r){return this.request(u(r||{},{method:t,url:e,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(t){a.prototype[t]=function(e,r,n){return this.request(u(n||{},{method:t,url:e,data:r}))}})),t.exports=a},function(t,e,r){"use strict";var n=r(7);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){n.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=o},function(t,e,r){"use strict";var n=r(7),o=r(45),i=r(25),c=r(26);function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return u(t),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=n.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||c.adapter)(t).then((function(e){return u(t),e.data=o(e.data,e.headers,t.transformResponse),e}),(function(e){return i(e)||(u(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,r){"use strict";var n=r(7);t.exports=function(t,e,r){return n.forEach(r,(function(r){t=r(t,e)})),t}},function(t,e,r){"use strict";var n=r(7);t.exports=function(t,e){n.forEach(t,(function(r,n){n!==e&&n.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[n])}))}},function(t,e,r){"use strict";var n=r(28);t.exports=function(t,e,r){var o=r.config.validateStatus;r.status&&o&&!o(r.status)?e(n("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)}},function(t,e,r){"use strict";t.exports=function(t,e,r,n,o){return t.config=e,r&&(t.code=r),t.request=n,t.response=o,t.isAxiosError=!0,t.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:this.config,code:this.code}},t}},function(t,e,r){"use strict";var n=r(7);t.exports=n.isStandardBrowserEnv()?{write:function(t,e,r,o,i,c){var u=[];u.push(t+"="+encodeURIComponent(e)),n.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),n.isString(o)&&u.push("path="+o),n.isString(i)&&u.push("domain="+i),!0===c&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var 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(t,e,r){"use strict";var n=r(51),o=r(52);t.exports=function(t,e){return t&&!n(e)?o(t,e):e}},function(t,e,r){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,r){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,r){"use strict";var n=r(7),o=["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"];t.exports=function(t){var e,r,i,c={};return t?(n.forEach(t.split("\n"),(function(t){if(i=t.indexOf(":"),e=n.trim(t.substr(0,i)).toLowerCase(),r=n.trim(t.substr(i+1)),e){if(c[e]&&o.indexOf(e)>=0)return;c[e]="set-cookie"===e?(c[e]?c[e]:[]).concat([r]):c[e]?c[e]+", "+r:r}})),c):c}},function(t,e,r){"use strict";var n=r(7);t.exports=n.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(t){var n=t;return e&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return t=o(window.location.href),function(e){var r=n.isString(e)?o(e):e;return r.protocol===t.protocol&&r.host===t.host}}():function(){return!0}},function(t,e,r){"use strict";var n=r(30);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new n(t),e(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o((function(e){t=e})),cancel:t}},t.exports=o},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){"use strict";t.exports=function(t){return"object"==typeof t&&!0===t.isAxiosError}},function(t,e,r){"use strict";var n=r(16),o=r(31),i=Object.prototype.hasOwnProperty,c={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},u=Array.isArray,a=Array.prototype.push,s=function(t,e){a.apply(t,u(e)?e:[e])},f=Date.prototype.toISOString,p=o.default,l={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:p,formatter:o.formatters[p],indices:!1,serializeDate:function(t){return f.call(t)},skipNulls:!1,strictNullHandling:!1},h=function t(e,r,o,i,c,a,f,p,h,d,v,y,m){var g,x=e;if("function"==typeof f?x=f(r,x):x instanceof Date?x=d(x):"comma"===o&&u(x)&&(x=n.maybeMap(x,(function(t){return t instanceof Date?d(t):t})).join(",")),null===x){if(i)return a&&!y?a(r,l.encoder,m,"key"):r;x=""}if("string"==typeof(g=x)||"number"==typeof g||"boolean"==typeof g||"symbol"==typeof g||"bigint"==typeof g||n.isBuffer(x))return a?[v(y?r:a(r,l.encoder,m,"key"))+"="+v(a(x,l.encoder,m,"value"))]:[v(r)+"="+v(String(x))];var w,b=[];if(void 0===x)return b;if(u(f))w=f;else{var k=Object.keys(x);w=p?k.sort(p):k}for(var R=0;R<w.length;++R){var P=w[R],O=x[P];if(!c||null!==O){var S=u(x)?"function"==typeof o?o(r,P):r:r+(h?"."+P:"["+P+"]");s(b,t(O,S,o,i,c,a,f,p,h,d,v,y,m))}}return b};t.exports=function(t,e){var r,n=t,a=function(t){if(!t)return l;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||l.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=o.default;if(void 0!==t.format){if(!i.call(o.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=o.formatters[r],c=l.filter;return("function"==typeof t.filter||u(t.filter))&&(c=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:l.addQueryPrefix,allowDots:void 0===t.allowDots?l.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:l.charsetSentinel,delimiter:void 0===t.delimiter?l.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:l.encode,encoder:"function"==typeof t.encoder?t.encoder:l.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:l.encodeValuesOnly,filter:c,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:l.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:l.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:l.strictNullHandling}}(e);"function"==typeof a.filter?n=(0,a.filter)("",n):u(a.filter)&&(r=a.filter);var f,p=[];if("object"!=typeof n||null===n)return"";f=e&&e.arrayFormat in c?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var d=c[f];r||(r=Object.keys(n)),a.sort&&r.sort(a.sort);for(var v=0;v<r.length;++v){var y=r[v];a.skipNulls&&null===n[y]||s(p,h(n[y],y,d,a.strictNullHandling,a.skipNulls,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.formatter,a.encodeValuesOnly,a.charset))}var m=p.join(a.delimiter),g=!0===a.addQueryPrefix?"?":"";return a.charsetSentinel&&("iso-8859-1"===a.charset?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),m.length>0?g+m:""}},function(t,e,r){"use strict";var n=r(16),o=Object.prototype.hasOwnProperty,i=Array.isArray,c={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},u=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},a=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},s=function(t,e,r,n){if(t){var i=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,c=/(\[[^[\]]*])/g,u=r.depth>0&&/(\[[^[\]]*])/.exec(i),s=u?i.slice(0,u.index):i,f=[];if(s){if(!r.plainObjects&&o.call(Object.prototype,s)&&!r.allowPrototypes)return;f.push(s)}for(var p=0;r.depth>0&&null!==(u=c.exec(i))&&p<r.depth;){if(p+=1,!r.plainObjects&&o.call(Object.prototype,u[1].slice(1,-1))&&!r.allowPrototypes)return;f.push(u[1])}return u&&f.push("["+i.slice(u.index)+"]"),function(t,e,r,n){for(var o=n?e:a(e,r),i=t.length-1;i>=0;--i){var c,u=t[i];if("[]"===u&&r.parseArrays)c=[].concat(o);else{c=r.plainObjects?Object.create(null):{};var s="["===u.charAt(0)&&"]"===u.charAt(u.length-1)?u.slice(1,-1):u,f=parseInt(s,10);r.parseArrays||""!==s?!isNaN(f)&&u!==s&&String(f)===s&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(c=[])[f]=o:c[s]=o:c={0:o}}o=c}return o}(f,e,r,n)}};t.exports=function(t,e){var r=function(t){if(!t)return c;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?c.charset:t.charset;return{allowDots:void 0===t.allowDots?c.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:c.allowPrototypes,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:c.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:c.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:c.comma,decoder:"function"==typeof t.decoder?t.decoder:c.decoder,delimiter:"string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:c.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:c.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:c.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:c.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:c.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:c.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var f="string"==typeof t?function(t,e){var r,s={},f=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,p=e.parameterLimit===1/0?void 0:e.parameterLimit,l=f.split(e.delimiter,p),h=-1,d=e.charset;if(e.charsetSentinel)for(r=0;r<l.length;++r)0===l[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===l[r]?d="utf-8":"utf8=%26%2310003%3B"===l[r]&&(d="iso-8859-1"),h=r,r=l.length);for(r=0;r<l.length;++r)if(r!==h){var v,y,m=l[r],g=m.indexOf("]="),x=-1===g?m.indexOf("="):g+1;-1===x?(v=e.decoder(m,c.decoder,d,"key"),y=e.strictNullHandling?null:""):(v=e.decoder(m.slice(0,x),c.decoder,d,"key"),y=n.maybeMap(a(m.slice(x+1),e),(function(t){return e.decoder(t,c.decoder,d,"value")}))),y&&e.interpretNumericEntities&&"iso-8859-1"===d&&(y=u(y)),m.indexOf("[]=")>-1&&(y=i(y)?[y]:y),o.call(s,v)?s[v]=n.combine(s[v],y):s[v]=y}return s}(t,r):t,p=r.plainObjects?Object.create(null):{},l=Object.keys(f),h=0;h<l.length;++h){var d=l[h],v=s(d,f[d],r,"string"==typeof t);p=n.merge(p,v,r)}return n.compact(p)}},function(t,e){t.exports=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}},function(t,e,r){var n=r(15),o=r(62);function i(e,r,c){return o()?t.exports=i=Reflect.construct:t.exports=i=function(t,e,r){var o=[null];o.push.apply(o,e);var i=new(Function.bind.apply(t,o));return r&&n(i,r.prototype),i},i.apply(null,arguments)}t.exports=i},function(t,e){t.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}},function(t,e,r){var n=r(64),o=r(104);t.exports=function(t,e){for(var r=0,i=(e=n(e,t)).length;null!=t&&r<i;)t=t[o(e[r++])];return r&&r==i?t:void 0}},function(t,e,r){var n=r(17),o=r(65),i=r(71),c=r(101);t.exports=function(t,e){return n(t)?t:o(t,e)?[t]:i(c(t))}},function(t,e,r){var n=r(17),o=r(18),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/;t.exports=function(t,e){if(n(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!o(t))||(c.test(t)||!i.test(t)||null!=e&&t in Object(e))}},function(t,e,r){(function(e){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(this,r(67))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(19),o=Object.prototype,i=o.hasOwnProperty,c=o.toString,u=n?n.toStringTag:void 0;t.exports=function(t){var e=i.call(t,u),r=t[u];try{t[u]=void 0;var n=!0}catch(t){}var o=c.call(t);return n&&(e?t[u]=r:delete t[u]),o}},function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,r){var n=r(72),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,c=n((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,r,n,o){e.push(n?o.replace(i,"$1"):r||t)})),e}));t.exports=c},function(t,e,r){var n=r(73);t.exports=function(t){var e=n(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}},function(t,e,r){var n=r(74);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var c=t.apply(this,n);return r.cache=i.set(o,c)||i,c};return r.cache=new(o.Cache||n),r}o.Cache=n,t.exports=o},function(t,e,r){var n=r(75),o=r(96),i=r(98),c=r(99),u=r(100);function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=c,a.prototype.set=u,t.exports=a},function(t,e,r){var n=r(76),o=r(88),i=r(95);t.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},function(t,e,r){var n=r(77),o=r(84),i=r(85),c=r(86),u=r(87);function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=c,a.prototype.set=u,t.exports=a},function(t,e,r){var n=r(12);t.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(t,e,r){var n=r(79),o=r(80),i=r(34),c=r(82),u=/^\[object .+?Constructor\]$/,a=Function.prototype,s=Object.prototype,f=a.toString,p=s.hasOwnProperty,l=RegExp("^"+f.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(n(t)?l:u).test(c(t))}},function(t,e,r){var n=r(32),o=r(34);t.exports=function(t){if(!o(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,r){var n,o=r(81),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";t.exports=function(t){return!!i&&i in t}},function(t,e,r){var n=r(20)["__core-js_shared__"];t.exports=n},function(t,e){var r=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return r.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,r){var n=r(12),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(n){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(e,t)?e[t]:void 0}},function(t,e,r){var n=r(12),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:o.call(e,t)}},function(t,e,r){var n=r(12);t.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,r){var n=r(89),o=r(90),i=r(92),c=r(93),u=r(94);function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=c,a.prototype.set=u,t.exports=a},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,r){var n=r(13),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0)&&(r==e.length-1?e.pop():o.call(e,r,1),--this.size,!0)}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,r){var n=r(13);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},function(t,e,r){var n=r(13);t.exports=function(t){return n(this.__data__,t)>-1}},function(t,e,r){var n=r(13);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},function(t,e,r){var n=r(33)(r(20),"Map");t.exports=n},function(t,e,r){var n=r(14);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,r){var n=r(14);t.exports=function(t){return n(this,t).get(t)}},function(t,e,r){var n=r(14);t.exports=function(t){return n(this,t).has(t)}},function(t,e,r){var n=r(14);t.exports=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}},function(t,e,r){var n=r(102);t.exports=function(t){return null==t?"":n(t)}},function(t,e,r){var n=r(19),o=r(103),i=r(17),c=r(18),u=n?n.prototype:void 0,a=u?u.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(c(e))return a?a.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}},function(t,e,r){var n=r(18);t.exports=function(t){if("string"==typeof t||n(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,r){"use strict";r.r(e),r.d(e,"Client",(function(){return $})),r.d(e,"Http",(function(){return m.a})),r.d(e,"Result",(function(){return G.a})),r.d(e,"errors",(function(){return Q})),r.d(e,"makeClient",(function(){return V})),r.d(e,"endpoints",(function(){return o})),r.d(e,"routes",(function(){return n}));var n={};r.r(n),r.d(n,"storefrontPath",(function(){return g})),r.d(n,"Routes",(function(){return x}));var o={};r.r(o),r.d(o,"Account",(function(){return k})),r.d(o,"Authentication",(function(){return O})),r.d(o,"Cart",(function(){return E})),r.d(o,"Checkout",(function(){return A})),r.d(o,"Countries",(function(){return D})),r.d(o,"Order",(function(){return B})),r.d(o,"Products",(function(){return M})),r.d(o,"Taxons",(function(){return q}));var i=r(2),c=r.n(i),u=r(5),a=r.n(u),s=r(0),f=r.n(s),p=r(3),l=r.n(p),h=r(4),d=r.n(h),v=r(1),y=r.n(v),m=r(6),g="api/v2/storefront",x={productsPath:function(){return"".concat(g,"/products")},productPath:function(t){return"".concat(g,"/products/").concat(t)},taxonsPath:function(){return"".concat(g,"/taxons")},taxonPath:function(t){return"".concat(g,"/taxons/").concat(t)},countriesPath:function(){return"".concat(g,"/countries")},countryPath:function(t){return"".concat(g,"/countries/").concat(t)},cartPath:function(){return"".concat(g,"/cart")},cartAddItemPath:function(){return"".concat(g,"/cart/add_item")},cartRemoveItemPath:function(t){return"".concat(g,"/cart/remove_line_item/").concat(t)},cartEmptyPath:function(){return"".concat(g,"/cart/empty")},cartSetItemQuantity:function(){return"".concat(g,"/cart/set_quantity")},cartApplyCodePath:function(){return"".concat(g,"/cart/apply_coupon_code")},cartRemoveCodePath:function(t){return"".concat(g,"/cart/remove_coupon_code/").concat(t)},cartEstimateShippingMethodsPath:function(){return"".concat(g,"/cart/estimate_shipping_rates")},checkoutPath:function(){return"".concat(g,"/checkout")},checkoutNextPath:function(){return"".concat(g,"/checkout/next")},checkoutAdvancePath:function(){return"".concat(g,"/checkout/advance")},checkoutCompletePath:function(){return"".concat(g,"/checkout/complete")},checkoutAddStoreCreditsPath:function(){return"".concat(g,"/checkout/add_store_credit")},checkoutRemoveStoreCreditsPath:function(){return"".concat(g,"/checkout/remove_store_credit")},checkoutPaymentMethodsPath:function(){return"".concat(g,"/checkout/payment_methods")},checkoutShippingMethodsPath:function(){return"".concat(g,"/checkout/shipping_rates")},oauthTokenPath:function(){return"spree_oauth/token"},accountPath:function(){return"".concat(g,"/account")},accountAddressPath:function(t){return"".concat(g,"/account/addresses/").concat(t)},accountAddressesPath:function(){return"".concat(g,"/account/addresses")},accountConfirmPath:function(t){return"".concat(g,"/account_confirmations/").concat(t)},accountCreditCardsPath:function(){return"".concat(g,"/account/credit_cards")},accountDefaultCreditCardPath:function(){return"".concat(g,"/account/credit_cards/default")},accountCompletedOrdersPath:function(){return"".concat(g,"/account/orders")},accountCompletedOrderPath:function(t){return"".concat(g,"/account/orders/").concat(t)},orderStatusPath:function(t){return"".concat(g,"/order_status/").concat(t)}};function w(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=y()(t);if(e){var o=y()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}var b=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function c(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(c,u)}a((n=n.apply(t,e||[])).next())}))},k=function(t){l()(r,t);var e=w(r);function r(){return c()(this,r),e.apply(this,arguments)}return a()(r,[{key:"accountInfo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("get",x.accountPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"creditCardsList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("get",x.accountCreditCardsPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"defaultCreditCard",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("get",x.accountDefaultCreditCardPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"completedOrdersList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("get",x.accountCompletedOrdersPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"completedOrder",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b(this,void 0,void 0,f.a.mark((function n(){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.spreeResponse("get",x.accountCompletedOrderPath(e),t,r);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n,this)})))}},{key:"create",value:function(t){return b(this,void 0,void 0,f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.spreeResponse("post",x.accountPath(),{},t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"confirm",value:function(t){return b(this,void 0,void 0,f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.spreeResponse("get",x.accountConfirmPath(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"update",value:function(t,e){return b(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("patch",x.accountPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"addressesList",value:function(t){return b(this,void 0,void 0,f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.spreeResponse("get",x.accountAddressesPath(),t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"createAddress",value:function(t,e){return b(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("post",x.accountAddressesPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"updateAddress",value:function(t,e,r){return b(this,void 0,void 0,f.a.mark((function n(){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.spreeResponse("patch",x.accountAddressPath(e),t,r);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n,this)})))}}]),r}(m.a);function R(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=y()(t);if(e){var o=y()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}var P=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function c(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(c,u)}a((n=n.apply(t,e||[])).next())}))},O=function(t){l()(r,t);var e=R(r);function r(){return c()(this,r),e.apply(this,arguments)}return a()(r,[{key:"getToken",value:function(t){return P(this,void 0,void 0,f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.spreeResponse("post",x.oauthTokenPath(),{},{username:(r=t).username,password:r.password,grant_type:"password"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}var r}),e,this)})))}},{key:"refreshToken",value:function(t){return P(this,void 0,void 0,f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.spreeResponse("post",x.oauthTokenPath(),{},{refresh_token:t.refresh_token,grant_type:"refresh_token"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}}]),r}(m.a);function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=y()(t);if(e){var o=y()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}var j=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function c(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(c,u)}a((n=n.apply(t,e||[])).next())}))},E=function(t){l()(r,t);var e=S(r);function r(){return c()(this,r),e.apply(this,arguments)}return a()(r,[{key:"show",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return j(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("get",x.cartPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"create",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return j(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("post",x.cartPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"addItem",value:function(t,e){return j(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("post",x.cartAddItemPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"removeItem",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return j(this,void 0,void 0,f.a.mark((function n(){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.spreeResponse("delete",x.cartRemoveItemPath(e),t,r);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n,this)})))}},{key:"emptyCart",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return j(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("patch",x.cartEmptyPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"setQuantity",value:function(t,e){return j(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("patch",x.cartSetItemQuantity(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"applyCouponCode",value:function(t,e){return j(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("patch",x.cartApplyCodePath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"removeCouponCode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return j(this,void 0,void 0,f.a.mark((function n(){var o;return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o="",o=null!==e?x.cartRemoveCodePath(e):x.cartRemoveCodePath(""),n.next=4,this.spreeResponse("delete",o,t,r);case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),n,this)})))}},{key:"estimateShippingMethods",value:function(t,e){return j(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("get",x.cartEstimateShippingMethodsPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}}]),r}(m.a);function _(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=y()(t);if(e){var o=y()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}var C=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function c(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(c,u)}a((n=n.apply(t,e||[])).next())}))},A=function(t){l()(r,t);var e=_(r);function r(){return c()(this,r),e.apply(this,arguments)}return a()(r,[{key:"orderNext",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("patch",x.checkoutNextPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"orderUpdate",value:function(t,e){return C(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("patch",x.checkoutPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"advance",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("patch",x.checkoutAdvancePath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"complete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("patch",x.checkoutCompletePath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"addStoreCredits",value:function(t,e){return C(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("post",x.checkoutAddStoreCreditsPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"removeStoreCredits",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("post",x.checkoutRemoveStoreCreditsPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}},{key:"paymentMethods",value:function(t){return C(this,void 0,void 0,f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.spreeResponse("get",x.checkoutPaymentMethodsPath(),t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"shippingMethods",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return C(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("get",x.checkoutShippingMethodsPath(),t,e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}}]),r}(m.a);function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=y()(t);if(e){var o=y()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}var L=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function c(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(c,u)}a((n=n.apply(t,e||[])).next())}))},D=function(t){l()(r,t);var e=T(r);function r(){return c()(this,r),e.apply(this,arguments)}return a()(r,[{key:"list",value:function(){return L(this,void 0,void 0,f.a.mark((function t(){return f.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.spreeResponse("get",x.countriesPath());case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"show",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return L(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("get",x.countryPath(t),{},e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}}]),r}(m.a);function N(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=y()(t);if(e){var o=y()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}var F=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function c(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(c,u)}a((n=n.apply(t,e||[])).next())}))},B=function(t){l()(r,t);var e=N(r);function r(){return c()(this,r),e.apply(this,arguments)}return a()(r,[{key:"status",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return F(this,void 0,void 0,f.a.mark((function n(){return f.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.spreeResponse("get",x.orderStatusPath(e),t,r);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n,this)})))}}]),r}(m.a);function U(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=y()(t);if(e){var o=y()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}var I=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function c(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(c,u)}a((n=n.apply(t,e||[])).next())}))},M=function(t){l()(r,t);var e=U(r);function r(){return c()(this,r),e.apply(this,arguments)}return a()(r,[{key:"list",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return I(this,void 0,void 0,f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.spreeResponse("get",x.productsPath(),{},t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"show",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return I(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("get",x.productPath(t),{},e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}}]),r}(m.a);function z(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=y()(t);if(e){var o=y()(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return d()(this,r)}}var H=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function c(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(c,u)}a((n=n.apply(t,e||[])).next())}))},q=function(t){l()(r,t);var e=z(r);function r(){return c()(this,r),e.apply(this,arguments)}return a()(r,[{key:"list",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return H(this,void 0,void 0,f.a.mark((function e(){return f.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.spreeResponse("get",x.taxonsPath(),{},t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"show",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return H(this,void 0,void 0,f.a.mark((function r(){return f.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.spreeResponse("get",x.taxonPath(t),{},e);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)})))}}]),r}(m.a),$=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};c()(this,t),this.host=e.host||null,this.addEndpoints()}return a()(t,[{key:"addEndpoints",value:function(){this.account=this.makeAccount(),this.authentication=this.makeAuthentication(),this.cart=this.makeCart(),this.checkout=this.makeCheckout(),this.countries=this.makeCountries(),this.order=this.makeOrder(),this.products=this.makeProducts(),this.taxons=this.makeTaxons()}},{key:"makeAccount",value:function(){return new k(this.host)}},{key:"makeAuthentication",value:function(){return new O(this.host)}},{key:"makeCart",value:function(){return new E(this.host)}},{key:"makeCheckout",value:function(){return new A(this.host)}},{key:"makeCountries",value:function(){return new D(this.host)}},{key:"makeOrder",value:function(){return new B(this.host)}},{key:"makeProducts",value:function(){return new M(this.host)}},{key:"makeTaxons",value:function(){return new q(this.host)}}]),t}(),Q=r(9),G=r(11),V=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new $(t)}}])}));
//# sourceMappingURL=index.js.map