New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sdk.srenvios

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sdk.srenvios - npm Package Compare versions

Comparing version 0.14.1 to 0.15.0

4

build/bundles/bundle.cjs.js
/**
*
* sdk.srenvios with version 0.14.1
* sdk.srenvios with version 0.15.0
* @author Rodrigo Maldonado Gasca (Elaine)

@@ -10,3 +10,3 @@ * @copyright 2020-2021

"use strict";function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};for(var r,n={},o=Object.keys(e),i=0;i<o.length;i++)r=o[i],0<=t.indexOf(r)||(n[r]=e[r]);return n}function _objectWithoutProperties(e,t){if(null==e)return{};var r,n=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)r=o[i],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r]);return n}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _arrayLikeToArray$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _unsupportedIterableToArray$1(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray$1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray$1(e,t):void 0}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray$1(e,t)||_nonIterableRest()}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(exports,"__esModule",{value:!0});var viewClasses,isArrayBufferView,global="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==global&&global,support={searchParams:"URLSearchParams"in global,iterable:"Symbol"in global&&"iterator"in Symbol,blob:"FileReader"in global&&"Blob"in global&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in global,arrayBuffer:"ArrayBuffer"in global};function isDataView(e){return e&&DataView.prototype.isPrototypeOf(e)}function normalizeName(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function normalizeValue(e){return e="string"!=typeof e?String(e):e}function iteratorFor(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return support.iterable&&(e[Symbol.iterator]=function(){return e}),e}function Headers$1(t){this.map={},t instanceof Headers$1?t.forEach(function(e,t){this.append(t,e)},this):Array.isArray(t)?t.forEach(function(e){this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function consumed(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function fileReaderReady(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function readBlobAsArrayBuffer(e){var t=new FileReader,r=fileReaderReady(t);return t.readAsArrayBuffer(e),r}function readBlobAsText(e){var t=new FileReader,r=fileReaderReady(t);return t.readAsText(e),r}function readArrayBufferAsText(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function bufferClone(e){var t;return e.slice?e.slice(0):((t=new Uint8Array(e.byteLength)).set(new Uint8Array(e)),t.buffer)}function Body(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,(this._bodyInit=e)?"string"==typeof e?this._bodyText=e:support.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:support.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():support.arrayBuffer&&support.blob&&isDataView(e)?(this._bodyArrayBuffer=bufferClone(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):support.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||isArrayBufferView(e))?this._bodyArrayBuffer=bufferClone(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},support.blob&&(this.blob=function(){var e=consumed(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?consumed(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(readBlobAsArrayBuffer)}),this.text=function(){var e=consumed(this);if(e)return e;if(this._bodyBlob)return readBlobAsText(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},support.formData&&(this.formData=function(){return this.text().then(decode)}),this.json=function(){return this.text().then(JSON.parse)},this}support.arrayBuffer&&(viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],isArrayBufferView=ArrayBuffer.isView||function(e){return e&&-1<viewClasses.indexOf(Object.prototype.toString.call(e))}),Headers$1.prototype.append=function(e,t){e=normalizeName(e),t=normalizeValue(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},Headers$1.prototype.delete=function(e){delete this.map[normalizeName(e)]},Headers$1.prototype.get=function(e){return e=normalizeName(e),this.has(e)?this.map[e]:null},Headers$1.prototype.has=function(e){return this.map.hasOwnProperty(normalizeName(e))},Headers$1.prototype.set=function(e,t){this.map[normalizeName(e)]=normalizeValue(t)},Headers$1.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},Headers$1.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),iteratorFor(r)},Headers$1.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),iteratorFor(t)},Headers$1.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),iteratorFor(r)},support.iterable&&(Headers$1.prototype[Symbol.iterator]=Headers$1.prototype.entries);var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function normalizeMethod(e){var t=e.toUpperCase();return-1<methods.indexOf(t)?t:e}function Request$1(e,t){if(!(this instanceof Request$1))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r=(t=t||{}).body;if(e instanceof Request$1){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Headers$1(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Headers$1(t.headers)),this.method=normalizeMethod(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r),"GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache||((e=/([?&])_=[^&]*/).test(this.url)?this.url=this.url.replace(e,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime())}function decode(e){var r=new FormData;return e.trim().split("&").forEach(function(e){var t;e&&(t=(e=e.split("=")).shift().replace(/\+/g," "),e=e.join("=").replace(/\+/g," "),r.append(decodeURIComponent(t),decodeURIComponent(e)))}),r}function parseHeaders(e){var r=new Headers$1;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var e=e.split(":"),t=e.shift().trim();t&&(e=e.join(":").trim(),r.append(t,e))}),r}function Response(e,t){if(!(this instanceof Response))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{},this.type="default",this.status=void 0===t.status?200:t.status,this.ok=200<=this.status&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Headers$1(t.headers),this.url=t.url||"",this._initBody(e)}Request$1.prototype.clone=function(){return new Request$1(this,{body:this._bodyInit})},Body.call(Request$1.prototype),Body.call(Response.prototype),Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers$1(this.headers),url:this.url})},Response.error=function(){var e=new Response(null,{status:0,statusText:""});return e.type="error",e};var redirectStatuses=[301,302,303,307,308],DOMException=(Response.redirect=function(e,t){if(-1===redirectStatuses.indexOf(t))throw new RangeError("Invalid status code");return new Response(null,{status:t,headers:{location:e}})},global.DOMException);try{new DOMException}catch(e){(DOMException=function(e,t){this.message=e,this.name=t;t=Error(e);this.stack=t.stack}).prototype=Object.create(Error.prototype),DOMException.prototype.constructor=DOMException}function fetch$1(i,a){return new Promise(function(r,e){var t=new Request$1(i,a);if(t.signal&&t.signal.aborted)return e(new DOMException("Aborted","AbortError"));var n=new XMLHttpRequest;function o(){n.abort()}n.onload=function(){var e={status:n.status,statusText:n.statusText,headers:parseHeaders(n.getAllResponseHeaders()||"")},t=(e.url="responseURL"in n?n.responseURL:e.headers.get("X-Request-URL"),"response"in n?n.response:n.responseText);setTimeout(function(){r(new Response(t,e))},0)},n.onerror=function(){setTimeout(function(){e(new TypeError("Network request failed"))},0)},n.ontimeout=function(){setTimeout(function(){e(new TypeError("Network request failed"))},0)},n.onabort=function(){setTimeout(function(){e(new DOMException("Aborted","AbortError"))},0)},n.open(t.method,function(t){try{return""===t&&global.location.href?global.location.href:t}catch(e){return t}}(t.url),!0),"include"===t.credentials?n.withCredentials=!0:"omit"===t.credentials&&(n.withCredentials=!1),"responseType"in n&&(support.blob?n.responseType="blob":support.arrayBuffer&&t.headers.get("Content-Type")&&-1!==t.headers.get("Content-Type").indexOf("application/octet-stream")&&(n.responseType="arraybuffer")),!a||"object"!=typeof a.headers||a.headers instanceof Headers$1?t.headers.forEach(function(e,t){n.setRequestHeader(t,e)}):Object.getOwnPropertyNames(a.headers).forEach(function(e){n.setRequestHeader(e,normalizeValue(a.headers[e]))}),t.signal&&(t.signal.addEventListener("abort",o),n.onreadystatechange=function(){4===n.readyState&&t.signal.removeEventListener("abort",o)}),n.send(void 0===t._bodyInit?null:t._bodyInit)})}function _createForOfIteratorHelper(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}fetch$1.polyfill=!0,global.fetch||(global.fetch=fetch$1,global.Headers=Headers$1,global.Request=Request$1,global.Response=Response),self.fetch.bind(self);var Bound=_createClass(function e(){_classCallCheck(this,e);var t,r=_createForOfIteratorHelper(Object.getOwnPropertyNames(this.constructor.prototype));try{for(r.s();!(t=r.n()).done;){var n=t.value,o=this[n];"constructor"!==n&&"function"==typeof o&&(this[n]=o.bind(this))}}catch(e){r.e(e)}finally{r.f()}}),PRIMITIVE_VALUES=["string","number","function","array","object","boolean","undefined","null"];function checkType(e,t){if("string"!=typeof t)throw new TypeError("expectedType parameter must be String");if(-1===PRIMITIVE_VALUES.indexOf(t))throw new TypeError("expectedType must be one of : [".concat(PRIMITIVE_VALUES.join(","),"] but instead receive ").concat(t));switch(t){case"null":return null===e;case"array":return Array.isArray(e);case"object":return null!==e&&_typeof(e)===t;default:return _typeof(e)===t}}var HTTP_METHODS={GET:"GET",POST:"POST",UPDATE:"UPDATE",PATCH:"PATCH",DELETE:"DELETE",PUT:"PUT"};function asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}var runtime={exports:{}},regenerator=(!function(){var t=function(a){var c,e=Object.prototype,u=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",o=t.toStringTag||"@@toStringTag";function i(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(e){i=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var o,i,a,s,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype),n=new O(n||[]);return t._invoke=(o=e,i=r,a=n,s=f,function(e,t){if(s===h)throw new Error("Generator is already running");if(s===y){if("throw"===e)throw t;return k()}for(a.method=e,a.arg=t;;){var r=a.delegate;if(r){r=function e(t,r){var n=t.iterator[r.method];if(n===c){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=c,e(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}n=l(n,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,d;n=n.arg;if(!n)return r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d;{if(!n.done)return n;r[t.resultName]=n.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=c)}r.delegate=null;return d}(r,a);if(r){if(r===d)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===f)throw s=y,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=h;r=l(o,i,a);if("normal"===r.type){if(s=a.done?y:p,r.arg!==d)return{value:r.arg,done:a.done}}else"throw"===r.type&&(s=y,a.method="throw",a.arg=r.arg)}}),t}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=s;var f="suspendedStart",p="suspendedYield",h="executing",y="completed",d={};function b(){}function m(){}function v(){}var t={},g=(i(t,n,function(){return this}),Object.getPrototypeOf),g=g&&g(g(P([]))),T=(g&&g!==e&&u.call(g,n)&&(t=g),v.prototype=b.prototype=Object.create(t));function w(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function _(a,s){var t;this._invoke=function(r,n){function e(){return new s(function(e,t){!function t(e,r,n,o){var i,e=l(a[e],a,r);if("throw"!==e.type)return(r=(i=e.arg).value)&&"object"==typeof r&&u.call(r,"__await")?s.resolve(r.__await).then(function(e){t("next",e,n,o)},function(e){t("throw",e,n,o)}):s.resolve(r).then(function(e){i.value=e,n(i)},function(e){return t("throw",e,n,o)});o(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function P(t){if(t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(u.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=c,e.done=!0,e}).next=e}return{next:k}}function k(){return{value:c,done:!0}}return i(T,"constructor",m.prototype=v),i(v,"constructor",m),m.displayName=i(v,o,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,i(e,o,"GeneratorFunction")),e.prototype=Object.create(T),e},a.awrap=function(e){return{__await:e}},w(_.prototype),i(_.prototype,r,function(){return this}),a.AsyncIterator=_,a.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var i=new _(s(e,t,r,n),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},w(T),i(T,o,"Generator"),i(T,n,function(){return this}),i(T,"toString",function(){return"[object Generator]"}),a.keys=function(r){var e,n=[];for(e in r)n.push(e);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=P,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=c)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return i.type="throw",i.arg=r,n.next=e,t&&(n.method="next",n.arg=c),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=u.call(o,"catchLoc"),s=u.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(r=o.completion).type&&(n=r.arg,E(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:P(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=c),d}},a}(runtime.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(),runtime.exports),CachedTokenProvider=function(){function t(e){_classCallCheck(this,t),this.tokenProvider=e}var e;return _createClass(t,[{key:"getToken",value:(e=_asyncToGenerator(regenerator.mark(function e(){var t;return regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((t=this.token)&&t.expiresAt&&t.expiresAt>Date.now())return e.abrupt("return",t.accessToken);e.next=3;break;case 3:return e.next=5,this.tokenProvider.getToken();case 5:return t=e.sent,this.token=t,e.abrupt("return",t&&t.accessToken);case 8:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]),t}();function abstractMethod(e,t){throw new TypeError("subclasses of ".concat(e," must override ").concat(t))}var TokenProvider=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"getToken",value:function(){abstractMethod(this.constructor.name,"getToken")}}]),e}();function _createSuper$1(r){var n=_isNativeReflectConstruct$1();return function(){var e,t=_getPrototypeOf(r);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _isNativeReflectConstruct$1(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var NoOpTokenProvider=function(){_inherits(t,TokenProvider);var e=_createSuper$1(t);function t(){return _classCallCheck(this,t),e.apply(this,arguments)}return _createClass(t,[{key:"getToken",value:function(){return Promise.resolve(null)}}]),t}();function omit(t,r){var n={};return Object.keys(t).forEach(function(e){-1===r.indexOf(e)&&(n[e]=t[e])}),n}function objectToURLparams(e){return Object.entries(e).map(function(e){return e[0].concat("=",e[1])}).join("&")}function isId(e){var t=parseInt(e,10);return"number"==typeof e?e===t:!isNaN(t)}function invariant(e,t){for(var r,n=arguments.length,o=new Array(2<n?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];if(!e)throw r=0,e=t.replace(/%s/g,function(){return o[r++]}),(t=new Error(e)).name="Invariant violation",t}function warn(e,t){if(e){for(var r=arguments.length,n=new Array(2<r?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];console.warn(t,n)}}var _excluded=["params"];function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _createSuper(r){var n=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(r);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var SrEnvios=function(){_inherits(n,Bound);var r=_createSuper(n);function n(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(_classCallCheck(this,n),e=r.call(this),!Object.prototype.hasOwnProperty.call(t,"baseURL"))throw new TypeError("You must put `baseURL` option");if(!1===checkType(t.baseURL,"string"))throw new TypeError("baseURL argument must be string but got ".concat(_typeof(t.baseURL)));if(!t.baseURL.startsWith("http")&&!t.baseURL.startsWith("https"))throw new TypeError("baseURL option must begin with http or https protocol");if(t.tokenProvider&&""!==t.tokenProvider)e.tokenProvider=new CachedTokenProvider(t.tokenProvider);else{if(""===t.tokenProvider)throw new TypeError("tokenProvider option must be a function");e.tokenProvider=new NoOpTokenProvider}return e.originBaseURL=t.baseURL,e.baseURL=t.baseURL,e.headers=new Headers({Accept:"application/json","Content-Type":"application/json"}),e}return _createClass(n,[{key:"request",value:function(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=r.body;if(!e)throw new TypeError("URL is required");var o=new Headers(r.headers||{}),i=(this.headers.forEach(function(e,t){o.append(t,e)}),r.method.toUpperCase());switch(i){case HTTP_METHODS.POST:case HTTP_METHODS.PUT:case HTTP_METHODS.PATCH:r.body instanceof FormData?o.delete("Content-Type"):n=n&&JSON.stringify(r.body);break;default:o.set("Content-Type","application/json")}var a=/^(http|https)/.test(e)?e:this.baseURL.concat(e);return this.tokenProvider.getToken().then(function(e){console.log("---accessToken",e),e&&o.set("Authorization","Bearer ".concat(e));var e=new Request(a,_objectSpread({body:n,method:i,headers:o},omit(r,["body","method","headers","url"]))),e=fetch(e),t=e.then(function(e){return e.json()}).catch(function(e){if("SyntaxError"!==e.name)throw e});return Promise.all([e,t]).then(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];if(200<=t.status&&t.status<300)return e;var r=new Error(e.message);throw r.statusCode=t.status,r.name=e.code,r})})}},{key:"get",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=t.params,r=void 0===r?{}:r,t=_objectWithoutProperties(t,_excluded),r=0<Object.keys(r).length?e.concat("?",objectToURLparams(r)):e;return this.request(r,_objectSpread(_objectSpread({},t),{},{method:HTTP_METHODS.GET}))}},{key:"post",value:function(e){return this.request(e,_objectSpread(_objectSpread({},1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}),{},{method:HTTP_METHODS.POST}))}},{key:"patch",value:function(e,t){return this.request(e,_objectSpread(_objectSpread({},t),{},{method:HTTP_METHODS.PATCH}))}},{key:"checkArgumentType",value:function(t,e,r){var n;if(Array.isArray(r)){if(!r.some(function(e){return checkType(t,e)}))throw n=r.join(" or "),new TypeError("".concat(e," argument must be a ").concat(n,", got ").concat(_typeof(t)))}else if(!checkType(t,r))throw new TypeError("".concat(e," argument must be a ").concat(r,", got ").concat(_typeof(t)))}},{key:"getStatics",value:function(e){return this.checkArgumentType(e,"sections",["array","string"]),e=Array.isArray(e)?e.join(","):e,this.get("/statics",{params:{sections:e}})}},{key:"checkOrder",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.addressA,r=e.addressB,n=e.placeIdAddressA,o=e.placeIdAddressB,i=e.orderType,e=e.vehicleId;return warn(!0,"checkOrder() has been deprecated in favor of quote({ orderType: 'express', vehicleId: 3, points: [{ address: '', placeId:''}]}) and will be removed in next major version"),this.checkArgumentType(t,"addressA","string"),this.checkArgumentType(r,"addressB","string"),this.checkArgumentType(i,"orderType","string"),this.checkArgumentType(e,"vehicleId",["string","number"]),n&&this.checkArgumentType(n,"placeIdAddressA","string"),o&&this.checkArgumentType(o,"placeIdAddressB","string"),this.post("/by-address",{body:{payload:{addressA:t,addressB:r,placeIdAddressA:n,placeIdAddressB:o,orderType:i,vehicleId:e}}})}},{key:"quote",value:function(e){var t=e.orderType,r=e.vehicleId,e=e.points,e=void 0===e?[]:e;return this.checkArgumentType(t,"orderType",["string","number"]),this.checkArgumentType(e,"points","array"),invariant(isId(r),"Invalid id ".concat(r,", id must be an integer")),this.post("/quote/points",{body:{payload:{orderType:t,vehicleId:r,points:e}}})}},{key:"verifyEmailWithKey",value:function(e){return this.checkArgumentType(e,"verifyEmailKey","string"),this.post("/email/verify",{body:{payload:{verifyKey:e}}})}},{key:"registerUserWithEmailAndPassword",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.email,r=e.password,n=e.name,e=e.lastname;return this.checkArgumentType(t,"email","string"),this.checkArgumentType(r,"password","string"),this.checkArgumentType(n,"name","string"),this.checkArgumentType(e,"lastname","string"),this.post("/register",{body:{payload:{email:t,password:r,name:n,lastname:e}}})}},{key:"signin",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.email,r=e.password,e=e.persistSession;return e&&this.checkArgumentType(e,"persistSession",["boolean"]),this.checkArgumentType(t,"email","string"),this.checkArgumentType(r,"password","string"),this.post("/login",{body:{payload:{email:t,password:r}}})}},{key:"getQuoteTypes",value:function(){return this.get("/quote/types")}},{key:"getQuoteMethods",value:function(){return this.get("/quote/methods")}},{key:"getPaymentMethods",value:function(){return this.get("/payment_methods")}},{key:"createPayment",value:function(e){var t=e.points,r=e.paymentMethodId,n=e.orderTypeTransportId,o=e.orderTypeId,i=e.sessionId,a=e.redirectURLs,s=e.currency,e=e.saveCard;return this.checkArgumentType(t,"points","array"),this.checkArgumentType(r,"paymentMethodId",["number","string"]),this.checkArgumentType(n,"orderTypeTransportId",["number","string"]),this.checkArgumentType(o,"orderTypeId",["number","string"]),this.checkArgumentType(i,"sessionId","string"),this.checkArgumentType(a,"redirectURLs","object"),this.checkArgumentType(s,"currency","string"),e&&this.checkArgumentType(e,"saveCard","boolean"),this.post("/payments",{body:{payload:{points:t,paymentMethodId:r,orderTypeTransportId:n,orderTypeId:o,sessionId:i,redirectURLs:a,currency:s,saveCard:e}}})}},{key:"updatePoint",value:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return this.checkArgumentType(e,"quoteId","string"),this.checkArgumentType(t,"pointId","string"),this.patch("/quote/".concat(e,"/point/").concat(t),{body:{payload:r}})}},{key:"getStats",value:function(e,t){var r;return e&&this.checkArgumentType(e,"startDate","string"),t&&this.checkArgumentType(t,"endDate","string"),e&&(r={start_date:e,end_date:t}),this.get("/stats",{params:r=e||t?r:{}})}}],[{key:"getVersion",value:function(){return"1.0"}}]),n}();SrEnvios.prototype.API_BASE_URL="",SrEnvios.prototype.INVALID_GEOMETRY_CALC_REQUEST="InvalidGeometryCalcRequest",SrEnvios.prototype.QUOTE_POINTS_REQUEST_LIMIT_EXCEEDED="QuotePointsRequestLimitExceeded",SrEnvios.prototype.PAYMENTS={},SrEnvios.prototype.PAYMENTS.STRIPE={},SrEnvios.prototype.PAYMENTS.STRIPE.INCORRECT_CVC="incorrect_cvc",exports.default=SrEnvios;
"use strict";function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};for(var r,n={},o=Object.keys(e),i=0;i<o.length;i++)r=o[i],0<=t.indexOf(r)||(n[r]=e[r]);return n}function _objectWithoutProperties(e,t){if(null==e)return{};var r,n=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols)for(var o=Object.getOwnPropertySymbols(e),i=0;i<o.length;i++)r=o[i],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r]);return n}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw o}}return i}}function _arrayLikeToArray$1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _unsupportedIterableToArray$1(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray$1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray$1(e,t):void 0}}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray$1(e,t)||_nonIterableRest()}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(exports,"__esModule",{value:!0});var viewClasses,isArrayBufferView,global="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==global&&global,support={searchParams:"URLSearchParams"in global,iterable:"Symbol"in global&&"iterator"in Symbol,blob:"FileReader"in global&&"Blob"in global&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in global,arrayBuffer:"ArrayBuffer"in global};function isDataView(e){return e&&DataView.prototype.isPrototypeOf(e)}function normalizeName(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function normalizeValue(e){return e="string"!=typeof e?String(e):e}function iteratorFor(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return support.iterable&&(e[Symbol.iterator]=function(){return e}),e}function Headers$1(t){this.map={},t instanceof Headers$1?t.forEach(function(e,t){this.append(t,e)},this):Array.isArray(t)?t.forEach(function(e){this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function consumed(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function fileReaderReady(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function readBlobAsArrayBuffer(e){var t=new FileReader,r=fileReaderReady(t);return t.readAsArrayBuffer(e),r}function readBlobAsText(e){var t=new FileReader,r=fileReaderReady(t);return t.readAsText(e),r}function readArrayBufferAsText(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function bufferClone(e){var t;return e.slice?e.slice(0):((t=new Uint8Array(e.byteLength)).set(new Uint8Array(e)),t.buffer)}function Body(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,(this._bodyInit=e)?"string"==typeof e?this._bodyText=e:support.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:support.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():support.arrayBuffer&&support.blob&&isDataView(e)?(this._bodyArrayBuffer=bufferClone(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):support.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||isArrayBufferView(e))?this._bodyArrayBuffer=bufferClone(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):support.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},support.blob&&(this.blob=function(){var e=consumed(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?consumed(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(readBlobAsArrayBuffer)}),this.text=function(){var e=consumed(this);if(e)return e;if(this._bodyBlob)return readBlobAsText(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},support.formData&&(this.formData=function(){return this.text().then(decode)}),this.json=function(){return this.text().then(JSON.parse)},this}support.arrayBuffer&&(viewClasses=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],isArrayBufferView=ArrayBuffer.isView||function(e){return e&&-1<viewClasses.indexOf(Object.prototype.toString.call(e))}),Headers$1.prototype.append=function(e,t){e=normalizeName(e),t=normalizeValue(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},Headers$1.prototype.delete=function(e){delete this.map[normalizeName(e)]},Headers$1.prototype.get=function(e){return e=normalizeName(e),this.has(e)?this.map[e]:null},Headers$1.prototype.has=function(e){return this.map.hasOwnProperty(normalizeName(e))},Headers$1.prototype.set=function(e,t){this.map[normalizeName(e)]=normalizeValue(t)},Headers$1.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},Headers$1.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),iteratorFor(r)},Headers$1.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),iteratorFor(t)},Headers$1.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),iteratorFor(r)},support.iterable&&(Headers$1.prototype[Symbol.iterator]=Headers$1.prototype.entries);var methods=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function normalizeMethod(e){var t=e.toUpperCase();return-1<methods.indexOf(t)?t:e}function Request$1(e,t){if(!(this instanceof Request$1))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r=(t=t||{}).body;if(e instanceof Request$1){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new Headers$1(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new Headers$1(t.headers)),this.method=normalizeMethod(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r),"GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache||((e=/([?&])_=[^&]*/).test(this.url)?this.url=this.url.replace(e,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime())}function decode(e){var r=new FormData;return e.trim().split("&").forEach(function(e){var t;e&&(t=(e=e.split("=")).shift().replace(/\+/g," "),e=e.join("=").replace(/\+/g," "),r.append(decodeURIComponent(t),decodeURIComponent(e)))}),r}function parseHeaders(e){var r=new Headers$1;return e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var e=e.split(":"),t=e.shift().trim();t&&(e=e.join(":").trim(),r.append(t,e))}),r}function Response(e,t){if(!(this instanceof Response))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{},this.type="default",this.status=void 0===t.status?200:t.status,this.ok=200<=this.status&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new Headers$1(t.headers),this.url=t.url||"",this._initBody(e)}Request$1.prototype.clone=function(){return new Request$1(this,{body:this._bodyInit})},Body.call(Request$1.prototype),Body.call(Response.prototype),Response.prototype.clone=function(){return new Response(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Headers$1(this.headers),url:this.url})},Response.error=function(){var e=new Response(null,{status:0,statusText:""});return e.type="error",e};var redirectStatuses=[301,302,303,307,308],DOMException=(Response.redirect=function(e,t){if(-1===redirectStatuses.indexOf(t))throw new RangeError("Invalid status code");return new Response(null,{status:t,headers:{location:e}})},global.DOMException);try{new DOMException}catch(e){(DOMException=function(e,t){this.message=e,this.name=t;t=Error(e);this.stack=t.stack}).prototype=Object.create(Error.prototype),DOMException.prototype.constructor=DOMException}function fetch$1(i,a){return new Promise(function(r,e){var t=new Request$1(i,a);if(t.signal&&t.signal.aborted)return e(new DOMException("Aborted","AbortError"));var n=new XMLHttpRequest;function o(){n.abort()}n.onload=function(){var e={status:n.status,statusText:n.statusText,headers:parseHeaders(n.getAllResponseHeaders()||"")},t=(e.url="responseURL"in n?n.responseURL:e.headers.get("X-Request-URL"),"response"in n?n.response:n.responseText);setTimeout(function(){r(new Response(t,e))},0)},n.onerror=function(){setTimeout(function(){e(new TypeError("Network request failed"))},0)},n.ontimeout=function(){setTimeout(function(){e(new TypeError("Network request failed"))},0)},n.onabort=function(){setTimeout(function(){e(new DOMException("Aborted","AbortError"))},0)},n.open(t.method,function(t){try{return""===t&&global.location.href?global.location.href:t}catch(e){return t}}(t.url),!0),"include"===t.credentials?n.withCredentials=!0:"omit"===t.credentials&&(n.withCredentials=!1),"responseType"in n&&(support.blob?n.responseType="blob":support.arrayBuffer&&t.headers.get("Content-Type")&&-1!==t.headers.get("Content-Type").indexOf("application/octet-stream")&&(n.responseType="arraybuffer")),!a||"object"!=typeof a.headers||a.headers instanceof Headers$1?t.headers.forEach(function(e,t){n.setRequestHeader(t,e)}):Object.getOwnPropertyNames(a.headers).forEach(function(e){n.setRequestHeader(e,normalizeValue(a.headers[e]))}),t.signal&&(t.signal.addEventListener("abort",o),n.onreadystatechange=function(){4===n.readyState&&t.signal.removeEventListener("abort",o)}),n.send(void 0===t._bodyInit?null:t._bodyInit)})}function _createForOfIteratorHelper(e,t){var r,n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return n&&(e=n),r=0,{s:t=function(){},n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}fetch$1.polyfill=!0,global.fetch||(global.fetch=fetch$1,global.Headers=Headers$1,global.Request=Request$1,global.Response=Response),self.fetch.bind(self);var Bound=_createClass(function e(){_classCallCheck(this,e);var t,r=_createForOfIteratorHelper(Object.getOwnPropertyNames(this.constructor.prototype));try{for(r.s();!(t=r.n()).done;){var n=t.value,o=this[n];"constructor"!==n&&"function"==typeof o&&(this[n]=o.bind(this))}}catch(e){r.e(e)}finally{r.f()}}),PRIMITIVE_VALUES=["string","number","function","array","object","boolean","undefined","null"];function checkType(e,t){if("string"!=typeof t)throw new TypeError("expectedType parameter must be String");if(-1===PRIMITIVE_VALUES.indexOf(t))throw new TypeError("expectedType must be one of : [".concat(PRIMITIVE_VALUES.join(","),"] but instead receive ").concat(t));switch(t){case"null":return null===e;case"array":return Array.isArray(e);case"object":return null!==e&&_typeof(e)===t;default:return _typeof(e)===t}}var HTTP_METHODS={GET:"GET",POST:"POST",UPDATE:"UPDATE",PATCH:"PATCH",DELETE:"DELETE",PUT:"PUT"};function asyncGeneratorStep(e,t,r,n,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(s){return function(){var e=this,a=arguments;return new Promise(function(t,r){var n=s.apply(e,a);function o(e){asyncGeneratorStep(n,t,r,o,i,"next",e)}function i(e){asyncGeneratorStep(n,t,r,o,i,"throw",e)}o(void 0)})}}var runtime={exports:{}},regenerator=(!function(){var t=function(a){var c,e=Object.prototype,u=e.hasOwnProperty,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",o=t.toStringTag||"@@toStringTag";function i(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(e){i=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var o,i,a,s,t=t&&t.prototype instanceof b?t:b,t=Object.create(t.prototype),n=new O(n||[]);return t._invoke=(o=e,i=r,a=n,s=f,function(e,t){if(s===h)throw new Error("Generator is already running");if(s===y){if("throw"===e)throw t;return k()}for(a.method=e,a.arg=t;;){var r=a.delegate;if(r){r=function e(t,r){var n=t.iterator[r.method];if(n===c){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=c,e(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}n=l(n,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,d;n=n.arg;if(!n)return r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d;{if(!n.done)return n;r[t.resultName]=n.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=c)}r.delegate=null;return d}(r,a);if(r){if(r===d)continue;return r}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===f)throw s=y,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=h;r=l(o,i,a);if("normal"===r.type){if(s=a.done?y:p,r.arg!==d)return{value:r.arg,done:a.done}}else"throw"===r.type&&(s=y,a.method="throw",a.arg=r.arg)}}),t}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}a.wrap=s;var f="suspendedStart",p="suspendedYield",h="executing",y="completed",d={};function b(){}function m(){}function g(){}var t={},v=(i(t,n,function(){return this}),Object.getPrototypeOf),v=v&&v(v(P([]))),T=(v&&v!==e&&u.call(v,n)&&(t=v),g.prototype=b.prototype=Object.create(t));function w(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function _(a,s){var t;this._invoke=function(r,n){function e(){return new s(function(e,t){!function t(e,r,n,o){var i,e=l(a[e],a,r);if("throw"!==e.type)return(r=(i=e.arg).value)&&"object"==typeof r&&u.call(r,"__await")?s.resolve(r.__await).then(function(e){t("next",e,n,o)},function(e){t("throw",e,n,o)}):s.resolve(r).then(function(e){i.value=e,n(i)},function(e){return t("throw",e,n,o)});o(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function P(t){if(t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(u.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=c,e.done=!0,e}).next=e}return{next:k}}function k(){return{value:c,done:!0}}return i(T,"constructor",m.prototype=g),i(g,"constructor",m),m.displayName=i(g,o,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,i(e,o,"GeneratorFunction")),e.prototype=Object.create(T),e},a.awrap=function(e){return{__await:e}},w(_.prototype),i(_.prototype,r,function(){return this}),a.AsyncIterator=_,a.async=function(e,t,r,n,o){void 0===o&&(o=Promise);var i=new _(s(e,t,r,n),o);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},w(T),i(T,o,"Generator"),i(T,n,function(){return this}),i(T,"toString",function(){return"[object Generator]"}),a.keys=function(r){var e,n=[];for(e in r)n.push(e);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=P,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(E),!e)for(var t in this)"t"===t.charAt(0)&&u.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=c)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return i.type="throw",i.arg=r,n.next=e,t&&(n.method="next",n.arg=c),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var o=this.tryEntries[t],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=u.call(o,"catchLoc"),s=u.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&u.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}var i=(o=o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc?null:o)?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,o=this.tryEntries[t];if(o.tryLoc===e)return"throw"===(r=o.completion).type&&(n=r.arg,E(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:P(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=c),d}},a}(runtime.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(),runtime.exports),CachedTokenProvider=function(){function t(e){_classCallCheck(this,t),this.tokenProvider=e}var e;return _createClass(t,[{key:"getToken",value:(e=_asyncToGenerator(regenerator.mark(function e(){var t;return regenerator.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((t=this.token)&&t.expiresAt&&t.expiresAt>Date.now())return e.abrupt("return",t.accessToken);e.next=3;break;case 3:return e.next=5,this.tokenProvider.getToken();case 5:return t=e.sent,this.token=t,e.abrupt("return",t&&t.accessToken);case 8:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]),t}();function abstractMethod(e,t){throw new TypeError("subclasses of ".concat(e," must override ").concat(t))}var TokenProvider=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"getToken",value:function(){abstractMethod(this.constructor.name,"getToken")}}]),e}();function _createSuper$1(r){var n=_isNativeReflectConstruct$1();return function(){var e,t=_getPrototypeOf(r);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _isNativeReflectConstruct$1(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var NoOpTokenProvider=function(){_inherits(t,TokenProvider);var e=_createSuper$1(t);function t(){return _classCallCheck(this,t),e.apply(this,arguments)}return _createClass(t,[{key:"getToken",value:function(){return Promise.resolve(null)}}]),t}();function omit(t,r){var n={};return Object.keys(t).forEach(function(e){-1===r.indexOf(e)&&(n[e]=t[e])}),n}function objectToURLparams(e){return Object.entries(e).map(function(e){return e[0].concat("=",e[1])}).join("&")}function isId(e){var t=parseInt(e,10);return"number"==typeof e?e===t:!isNaN(t)}function invariant(e,t){for(var r,n=arguments.length,o=new Array(2<n?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];if(!e)throw r=0,e=t.replace(/%s/g,function(){return o[r++]}),(t=new Error(e)).name="Invariant violation",t}function warn(e,t){if(e){for(var r=arguments.length,n=new Array(2<r?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];console.warn(t,n)}}var _excluded=["params"];function ownKeys(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(r),!0).forEach(function(e){_defineProperty(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _createSuper(r){var n=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(r);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}var SrEnvios=function(){_inherits(n,Bound);var r=_createSuper(n);function n(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(_classCallCheck(this,n),e=r.call(this),!Object.prototype.hasOwnProperty.call(t,"baseURL"))throw new TypeError("You must put `baseURL` option");if(!1===checkType(t.baseURL,"string"))throw new TypeError("baseURL argument must be string but got ".concat(_typeof(t.baseURL)));if(!t.baseURL.startsWith("http")&&!t.baseURL.startsWith("https"))throw new TypeError("baseURL option must begin with http or https protocol");if(t.tokenProvider&&""!==t.tokenProvider)e.tokenProvider=new CachedTokenProvider(t.tokenProvider);else{if(""===t.tokenProvider)throw new TypeError("tokenProvider option must be a function");e.tokenProvider=new NoOpTokenProvider}return e.originBaseURL=t.baseURL,e.baseURL=t.baseURL,e.headers=new Headers({Accept:"application/json","Content-Type":"application/json"}),e}return _createClass(n,[{key:"request",value:function(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=r.body;if(!e)throw new TypeError("URL is required");var o=new Headers(r.headers||{}),i=(this.headers.forEach(function(e,t){o.append(t,e)}),r.method.toUpperCase());switch(i){case HTTP_METHODS.POST:case HTTP_METHODS.PUT:case HTTP_METHODS.PATCH:r.body instanceof FormData?o.delete("Content-Type"):n=n&&JSON.stringify(r.body);break;default:o.set("Content-Type","application/json")}var a=/^(http|https)/.test(e)?e:this.baseURL.concat(e);return this.tokenProvider.getToken().then(function(e){console.log("---accessToken",e),e&&o.set("Authorization","Bearer ".concat(e));var e=new Request(a,_objectSpread({body:n,method:i,headers:o},omit(r,["body","method","headers","url"]))),e=fetch(e),t=e.then(function(e){return e.json()}).catch(function(e){if("SyntaxError"!==e.name)throw e});return Promise.all([e,t]).then(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];if(200<=t.status&&t.status<300)return e;var r=new Error(e.message);throw r.statusCode=t.status,r.name=e.code,r})})}},{key:"get",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=t.params,r=void 0===r?{}:r,t=_objectWithoutProperties(t,_excluded),r=0<Object.keys(r).length?e.concat("?",objectToURLparams(r)):e;return this.request(r,_objectSpread(_objectSpread({},t),{},{method:HTTP_METHODS.GET}))}},{key:"post",value:function(e){return this.request(e,_objectSpread(_objectSpread({},1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}),{},{method:HTTP_METHODS.POST}))}},{key:"patch",value:function(e,t){return this.request(e,_objectSpread(_objectSpread({},t),{},{method:HTTP_METHODS.PATCH}))}},{key:"checkArgumentType",value:function(t,e,r){var n;if(Array.isArray(r)){if(!r.some(function(e){return checkType(t,e)}))throw n=r.join(" or "),new TypeError("".concat(e," argument must be a ").concat(n,", got ").concat(_typeof(t)))}else if(!checkType(t,r))throw new TypeError("".concat(e," argument must be a ").concat(r,", got ").concat(_typeof(t)))}},{key:"getStatics",value:function(e){return this.checkArgumentType(e,"sections",["array","string"]),e=Array.isArray(e)?e.join(","):e,this.get("/statics",{params:{sections:e}})}},{key:"checkOrder",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.addressA,r=e.addressB,n=e.placeIdAddressA,o=e.placeIdAddressB,i=e.orderType,e=e.vehicleId;return warn(!0,"checkOrder() has been deprecated in favor of quote({ orderType: 'express', vehicleId: 3, points: [{ address: '', placeId:''}]}) and will be removed in next major version"),this.checkArgumentType(t,"addressA","string"),this.checkArgumentType(r,"addressB","string"),this.checkArgumentType(i,"orderType","string"),this.checkArgumentType(e,"vehicleId",["string","number"]),n&&this.checkArgumentType(n,"placeIdAddressA","string"),o&&this.checkArgumentType(o,"placeIdAddressB","string"),this.post("/by-address",{body:{payload:{addressA:t,addressB:r,placeIdAddressA:n,placeIdAddressB:o,orderType:i,vehicleId:e}}})}},{key:"quote",value:function(e){var t=e.orderType,r=e.vehicleId,e=e.points,e=void 0===e?[]:e;return this.checkArgumentType(t,"orderType",["string","number"]),this.checkArgumentType(e,"points","array"),invariant(isId(r),"Invalid id ".concat(r,", id must be an integer")),this.post("/quote/points",{body:{payload:{orderType:t,vehicleId:r,points:e}}})}},{key:"verifyEmailWithKey",value:function(e){return this.checkArgumentType(e,"verifyEmailKey","string"),this.post("/email/verify",{body:{payload:{verifyKey:e}}})}},{key:"registerUserWithEmailAndPassword",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.email,r=e.password,n=e.name,e=e.lastname;return this.checkArgumentType(t,"email","string"),this.checkArgumentType(r,"password","string"),this.checkArgumentType(n,"name","string"),this.checkArgumentType(e,"lastname","string"),this.post("/register",{body:{payload:{email:t,password:r,name:n,lastname:e}}})}},{key:"signin",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=e.email,r=e.password,e=e.persistSession;return e&&this.checkArgumentType(e,"persistSession",["boolean"]),this.checkArgumentType(t,"email","string"),this.checkArgumentType(r,"password","string"),this.post("/login",{body:{payload:{email:t,password:r}}})}},{key:"getQuoteTypes",value:function(){return this.get("/quote/types")}},{key:"getQuoteMethods",value:function(){return this.get("/quote/methods")}},{key:"getPaymentMethods",value:function(){return this.get("/payment_methods")}},{key:"createPayment",value:function(e){var t=e.points,r=e.paymentMethodId,n=e.orderTypeTransportId,o=e.orderTypeId,i=e.sessionId,a=e.redirectURLs,s=e.currency,e=e.saveCard;return this.checkArgumentType(t,"points","array"),this.checkArgumentType(r,"paymentMethodId",["number","string"]),this.checkArgumentType(n,"orderTypeTransportId",["number","string"]),this.checkArgumentType(o,"orderTypeId",["number","string"]),this.checkArgumentType(i,"sessionId","string"),this.checkArgumentType(a,"redirectURLs","object"),this.checkArgumentType(s,"currency","string"),e&&this.checkArgumentType(e,"saveCard","boolean"),this.post("/payments",{body:{payload:{points:t,paymentMethodId:r,orderTypeTransportId:n,orderTypeId:o,sessionId:i,redirectURLs:a,currency:s,saveCard:e}}})}},{key:"updatePoint",value:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return this.checkArgumentType(e,"quoteId","string"),this.checkArgumentType(t,"pointId","string"),this.patch("/quote/".concat(e,"/point/").concat(t),{body:{payload:r}})}},{key:"getStats",value:function(e,t,r){var n;return e&&this.checkArgumentType(e,"startDate","string"),t&&this.checkArgumentType(t,"endDate","string"),e&&(n={startDate:e,endDate:t}),e||t||(n={}),r&&(this.checkArgumentType(r,"aggregatedBy","string"),n=_objectSpread(_objectSpread({},n),{},{aggregatedBy:r})),this.get("/stats",{params:n})}}],[{key:"getVersion",value:function(){return"1.0"}}]),n}();SrEnvios.prototype.API_BASE_URL="",SrEnvios.prototype.INVALID_GEOMETRY_CALC_REQUEST="InvalidGeometryCalcRequest",SrEnvios.prototype.QUOTE_POINTS_REQUEST_LIMIT_EXCEEDED="QuotePointsRequestLimitExceeded",SrEnvios.prototype.PAYMENTS={},SrEnvios.prototype.PAYMENTS.STRIPE={},SrEnvios.prototype.PAYMENTS.STRIPE.INCORRECT_CVC="incorrect_cvc",exports.default=SrEnvios;
//# sourceMappingURL=bundle.cjs.js.map

@@ -0,1 +1,7 @@

### 0.15.0 (2022-05-03)
##### New Features
* **aggregatedBy:** add new field used to filter by day,week,month or custom range of date (99eab708)
#### 0.14.1 (2022-04-28)

@@ -2,0 +8,0 @@

{
"name": "sdk.srenvios",
"version": "0.14.1",
"version": "0.15.0",
"main": "build/bundles/bundle.cjs",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc