-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathfleetbase.min.js
More file actions
2 lines (2 loc) · 209 KB
/
Copy pathfleetbase.min.js
File metadata and controls
2 lines (2 loc) · 209 KB
1
2
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@fleetbase/sdk"]={})}(this,(function(t){"use strict";function e(t,e){this.v=t,this.k=e}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function r(t){if(Array.isArray(t))return t}function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t){var n={},r=!1;function i(n,i){return r=!0,i=new Promise((function(e){e(t[n](i))})),{done:!1,value:new e(i,1)}}return n["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},n.next=function(t){return r?(r=!1,t):i("next",t)},"function"==typeof t.throw&&(n.throw=function(t){if(r)throw r=!1,t;return i("throw",t)}),"function"==typeof t.return&&(n.return=function(t){return r?(r=!1,t):i("return",t)}),n}function a(t){var e,n,r,i=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&null!=(e=t[n]))return e.call(t);if(r&&null!=(e=t[r]))return new s(e.call(t));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function s(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then((function(t){return{value:t,done:e}}))}return s=function(t){this.s=t,this.n=t.next},s.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var n=this.s.return;return void 0===n?Promise.resolve({value:t,done:!0}):e(n.apply(this.s,arguments))},throw:function(t){var n=this.s.return;return void 0===n?Promise.reject(t):e(n.apply(this.s,arguments))}},new s(t)}function u(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){u(o,r,i,a,s,"next",t)}function s(t){u(o,r,i,a,s,"throw",t)}a(void 0)}))}}function l(t){return new e(t,0)}function h(t,e,n){return e=b(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return i(t)}(t,w()?Reflect.construct(e,n||[],b(t).constructor):e.apply(t,n))}function f(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e,n){if(w())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&R(i,n.prototype),i}function v(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,T(r.key),r)}}function p(t,e,n){return e&&v(t.prototype,e),n&&v(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function g(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=P(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function y(t,e,n){return(e=T(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function b(t){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},b(t)}function m(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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&R(t,e)}function w(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(w=function(){return!!t})()}function k(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function A(){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 E(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function x(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?E(Object(n),!0).forEach((function(e){y(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function O(){O=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new P(r||[]);return i(a,"_invoke",{value:S(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f="suspendedStart",d="suspendedYield",v="executing",p="completed",g={};function y(){}function b(){}function m(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,A=k&&k(k(L([])));A&&A!==n&&r.call(A,a)&&(w=A);var E=m.prototype=y.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function R(t,e){function n(i,o,a,s){var u=h(t[i],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function S(e,n,r){var i=f;return function(o,a){if(i===v)throw Error("Generator is already running");if(i===p){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=j(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=v;var c=h(e,n,r);if("normal"===c.type){if(i=r.done?p:d,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=p,r.method="throw",r.arg=c.arg)}}}function j(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=m,i(E,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:b,configurable:!0}),b.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},x(R.prototype),c(R.prototype,s,(function(){return this})),e.AsyncIterator=R,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new R(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function R(t,e){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},R(t,e)}function S(t,e){return r(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||P(t,e)||A()}function j(t){return function(t){if(Array.isArray(t))return n(t)}(t)||k(t)||P(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function P(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}function L(t){return function(){return new C(t.apply(this,arguments))}}function C(t){var n,r;function i(n,r){try{var a=t[n](r),s=a.value,u=s instanceof e;Promise.resolve(u?s.v:s).then((function(e){if(u){var r="return"===n?"return":"next";if(!s.k||e.done)return i(r,e);e=t[r](e).value}o(a.done?"return":"normal",e)}),(function(t){i("throw",t)}))}catch(t){o("throw",t)}}function o(t,e){switch(t){case"return":n.resolve({value:e,done:!0});break;case"throw":n.reject(e);break;default:n.resolve({value:e,done:!1})}(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(t,e){return new Promise((function(o,a){var s={key:t,arg:e,resolve:o,reject:a,next:null};r?r=r.next=s:(n=r=s,i(t,e))}))},"function"!=typeof t.return&&(this.return=void 0)}function N(t){var e="function"==typeof Map?new Map:void 0;return N=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return d(t,arguments,b(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),R(n,t)},N(t)}C.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},C.prototype.next=function(t){return this._invoke("next",t)},C.prototype.throw=function(t){return this._invoke("throw",t)},C.prototype.return=function(t){return this._invoke("return",t)};var F=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];f(this,t),y(this,"uncountableWords",["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"]),y(this,"pluralRules",[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]),y(this,"singularRules",[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]]),y(this,"nonTitlecasedWords",["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"]),y(this,"idSuffix",new RegExp("(_ids|_id)$","g")),y(this,"underbar",new RegExp("_","g")),y(this,"spaceOrUnderbar",new RegExp("[ _]","g")),y(this,"uppercase",new RegExp("([A-Z])","g")),y(this,"underbarPrefix",new RegExp("^_")),this.str=e,this.chain=n}return p(t,[{key:"get",value:function(){return this.str}},{key:"applyRules",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i<e.length;i++)if(t.match(e[i][0])){t=t.replace(e[i][0],e[i][1]);break}return this.str=t,!0===this.chain?this:t}},{key:"pluralize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:"singularize",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:"camelize",value:function(t,e){for(var n=(t=t||this.str).split("/"),r=0;r<n.length;r++){for(var i=n[r].split("_"),o=e&&r+1===n.length?1:0;o<i.length;o++)i[o]=i[o].charAt(0).toUpperCase()+i[o].substring(1);n[r]=i.join("")}if(t=n.join("::"),!0===e){var a=t.charAt(0).toLowerCase(),s=t.slice(1);t=a+s}return this.str=t,!0===this.chain?this:t}},{key:"underscore",value:function(t){for(var e=(t=t||this.str).split("::"),n=0;n<e.length;n++)e[n]=e[n].replace(this.uppercase,"_$1"),e[n]=e[n].replace(this.underbarPrefix,"");return t=e.join("/").toLowerCase(),this.str=t,!0===this.chain?this:t}},{key:"humanize",value:function(t,e){return t=(t=(t=(t=t||this.str).toLowerCase()).replace(this.idSuffix,"")).replace(this.underbar," "),e||(t=this.capitalize(t)),this.str=t,!0===this.chain?this:t}},{key:"capitalize",value:function(t){return t=(t=(t=t||this.str).toLowerCase()).substring(0,1).toUpperCase()+t.substring(1),this.str=t,!0===this.chain?this:t}},{key:"dasherize",value:function(t){return t=(t=(t=t||this.str).replace(this.spaceOrUnderbar,"-")).toLowerCase(),this.str=t,!0===this.chain?this:t}},{key:"normify",value:function(t,e){t=t||this.str,!0===e?(t=this.camelize(t),t=this.underscore(t)):t=t.toLowerCase();for(var n=(t=t.replace(this.underbar," ")).split(" "),r=0;r<n.length;r++){for(var i=n[r].split("-"),o=0;o<i.length;o++)this.nonTitlecasedWords.indexOf(i[o].toLowerCase())<0&&(i[o]=this.capitalize(i[o]));n[r]=i.join("-")}return t=(t=n.join(" ")).substring(0,1).toUpperCase()+t.substring(1),this.str=t,!0===this.chain?this:t}},{key:"demodulize",value:function(t){var e=(t=t||this.str).split("::");return t=e[e.length-1],this.str=t,!0===this.chain?this:t}},{key:"tableize",value:function(t){t=t||this.str;var e=this.chain;return this.chain=!1,t=this.pluralize(this.underscore(t)),this.chain=e,this.str=t,!0===this.chain?this:t}},{key:"classify",value:function(t){t=t||this.str,t=(t="".concat(t).trim()).replace(/[\s\-_]+/g,"_");var e=this.chain;return this.chain=!1,t=this.singularize(t),t=this.camelize(t,!1),this.chain=e,this.str=t,this.chain?this:t}},{key:"foreignKey",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?"":"_")+"id",this.str=t,!0===this.chain?this:t}},{key:"ordinalize",value:function(t){for(var e=(t=t||this.str).split(" "),n=0;n<e.length;n++){var r=parseInt(e[n]);if(isNaN(r)){var i=e[n].substring(e[n].length-2),o=e[n].substring(e[n].length-1),a="th";"11"!=i&&"12"!=i&&"13"!=i&&("1"===o?a="st":"2"===o?a="nd":"3"===o&&(a="rd")),e[n]+=a}}return t=e.join(" "),this.str=t,!0===this.chain?this:t}}],[{key:"invoke",value:function(){var e=Object.values(arguments),n=new t(null,!1),r=arguments[0];return e.shift(),"function"==typeof n[r]?n[r].apply(n,e):null}}])}(),D=function(){var t=["pluralize"].concat(Array.prototype.slice.call(arguments));return F.invoke.apply(F,j(t))},$=function(){var t=["singularize"].concat(Array.prototype.slice.call(arguments));return F.invoke.apply(F,j(t))},U=function(){var t=["classify"].concat(Array.prototype.slice.call(arguments));return F.invoke.apply(F,j(t))},z={resources:{},adapters:{},storse:{},actions:{}};function B(t,e,n){var r=D(t);z[r]||(z[r]={}),z[r][e]=n}function q(t,e){var n=D(t);if(!z[n])throw new Error("Unknown type: ".concat($(t)));if(!z[n][e])throw new Error("No ".concat($(t)," named '").concat(e,"' registered."));for(var r=z[n][e],i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];return d(r,o)}function I(){return q.apply(void 0,["store","Store"].concat(Array.prototype.slice.call(arguments)))}var M=function(){return p((function t(){return f(this,t),this.lookup.apply(this,arguments)}),[{key:"lookup",value:function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return q.apply(void 0,[t,e].concat(r))}}])}();function H(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return q.apply(void 0,[t,U(e)].concat(r))}function J(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return H.apply(void 0,["resource",U(t)].concat(n))}var W=Array.isArray,K=6e4;function G(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(W(t))if(r.length<=K)t.splice.apply(t,[e,n].concat(j(r)));else{t.splice(e,n);for(var i=0;i<r.length;i+=K){var o=r.slice(i,i+K);t.splice.apply(t,[e+i,0].concat(j(o)))}}else X(t)&&t.replace(e,n,r)}function V(t){return t}function X(t){return t instanceof rt}function Q(t,e){return W(t)?t[e]:X(t)?t.objectAt(e):null}function Y(t,e){return 2===arguments.length?function(n){return e===n[t]}:function(e){return Boolean(e[t])}}function Z(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i<r;i++){if(e(Q(t,i),i,t))return i}return-1}function tt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;return n<0&&(n+=i),Z(t,r&&e!=e?function(t){return t!=t}:function(t){return t===e},n)}function et(t,e,n){return G(t,e,0,[n]),n}function nt(){return d(rt,Array.prototype.slice.call(arguments))}var rt=function(t){function e(){return f(this,e),i(W(arguments[0])?h(this,e,j(arguments[0])):h(this,e,arguments))}return m(e,t),p(e,[{key:"notEmpty",get:function(){return this.length>0}},{key:"empty",get:function(){return 0===this.length}},{key:"first",get:function(){return Q(this,0)}},{key:"last",get:function(){return Q(this,this.length-1)}},{key:"replace",value:function(t,e){return G(this,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]),this}},{key:"objectsAt",value:function(t){var e=this;return t.map((function(t){return Q(e,t)}))}},{key:"objectAt",value:function(t){return Q(this,t)}},{key:"indexOf",value:function(t,e){return tt(this,t,e,!1)}},{key:"lastIndexOf",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(Q(this,r)===t)return r;return-1}},{key:"includes",value:function(t,e){return-1!==tt(this,t,e,!0)}},{key:"findBy",value:function(){return t=this,e=Y.apply(void 0,arguments),-1===(r=Z(t,e.bind(n),0))?void 0:Q(t,r);var t,e,n,r}},{key:"findIndexBy",value:function(){return Z(this,Y.apply(void 0,arguments))}},{key:"isEvery",value:function(){return t=this,e=Y.apply(void 0,arguments),r=e.bind(n),-1===Z(t,(function(t,e,n){return!r(t,e,n)}),0);var t,e,n,r}},{key:"isAny",value:function(){return t=this,e=Y.apply(void 0,arguments),-1!==Z(t,e.bind(n),0);var t,e,n}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=[];return this.forEach((function(e){var r;return i.push(null===(r=e[t])||void 0===r?void 0:r.call.apply(r,[e].concat(n)))})),i}},{key:"toArray",value:function(){return this.map((function(t){return t}))}},{key:"compact",value:function(){return this.filter((function(t){return null!=t}))}},{key:"sortBy",value:function(){var t=arguments;return this.sort((function(e,n){var r,i=g(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=e[o],s=n[o],u=compare(a,s);if(u)return u}}catch(t){i.e(t)}finally{i.f()}return 0}))}},{key:"uniqBy",value:function(t){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V,n=[],r=new Set,i="function"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:"without",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:"clear",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:"insertAt",value:function(t,e){return et(this,t,e),this}},{key:"replaceAt",value:function(t,e){return this.replace(t,1,[e])}},{key:"removeAt",value:function(t,e){return function(t,e){return G(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:"pushObject",value:function(t){return this.insertAt(this.length,t)}},{key:"pushObjects",value:function(t){return this.replace(this.length,0,t),this}},{key:"popObject",value:function(){var t=this.length;if(0===t)return null;var e=Q(this,t-1);return this.removeAt(t-1,1),e}},{key:"shiftObject",value:function(){if(0===this.length)return null;var t=Q(this,0);return this.removeAt(0),t}},{key:"unshiftObject",value:function(t){return et(this,0,t)}},{key:"unshiftObjects",value:function(t){return this.replace(0,0,t),this}},{key:"reverseObjects",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:"setObjects",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:"removeObject",value:function(t){for(var e=this.length||0;--e>=0;){Q(this,e)===t&&this.removeAt(e)}return this}},{key:"removeObjects",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:"addObject",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:"addObjects",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}])}(N(Array));function it(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=_(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var i=t.length;if("number"==typeof i)return!i}return!1}function ot(){var t,e,n;return!("undefined"==typeof process||"object"!==_(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(e=e.name)||void 0===e?void 0:e.search(/node|io.js/))||"undefined"!=typeof window&&"ReactNative"!==(null===(n=window)||void 0===n||null===(n=n.navigator)||void 0===n?void 0:n.product))}function at(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ot()?H("adapter","NodeAdapter",t):H("adapter","BrowserAdapter",t)}var st=function(){return p((function t(e){f(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}),[{key:"parse",value:function(){this.parseComponents(),this.parseProperties()}},{key:"parseComponents",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:"parseProperties",value:function(){var t,e={streetNumber:this.get("street_number"),streetName:this.get("route"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or(["locality","sublocality","sublocality_level_1","neighborhood","administrative_area_level_3","administrative_area_level_2"]),county:this.get("administrative_area_level_2"),stateShort:this.get("administrative_area_level_1",!0),stateLong:this.get("administrative_area_level_1"),countryShort:this.get("country",!0),country:this.get("country",!0),countryLong:this.get("country"),postalCode:this.get("postal_code")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(" "),e}},{key:"all",value:function(){return this.attributes}},{key:"or",value:function(){var t,e=g(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(e.s();!(t=e.n()).done;){var n=t.value;if(W(n)){var r=n[0],i=n[1];if(this.has(r))return this.get(r,i)}else if(this.has(n))return this.get(n)}}catch(t){e.e(t)}finally{e.f()}return null}},{key:"has",value:function(t){return t in this.components}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=x(x({},this.attributes),t),this}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"getAttribute",value:function(t){return this.attributes[t]||null}}])}(),ut=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;f(this,t),this.type="Point",this.coordinates=[n,e]}return p(t,[{key:"latitude",get:function(){return this.coordinates[1]}},{key:"longitude",get:function(){return this.coordinates[0]}},{key:"lat",value:function(){return this.latitude}},{key:"lng",value:function(){return this.longitude}},{key:"serialize",value:function(){return{type:"Point",coorindates:[this.lat(),this.lng()]}}},{key:"toJson",value:function(){return this.serialize()}},{key:"toString",value:function(){return"(".concat(this.latitude,", ").concat(this.longitude,")")}}],[{key:"fromGeoJson",value:function(e){var n=S(e.coordinates,2),r=n[0];return new t(n[1],r)}}])}();function ct(t,e){var n=t();return Array.isArray(n)||"object"===_(n)?lt(n,e):null}function lt(t,e){var n,r=t,i=_(t),o="object"===i,a="function"===i,s=Array.isArray(t),u="string"===_(e)&&e.includes(".")?e.split("."):[e];if(s||o){for(var c=0;c<u.length;c++){if(r&&void 0===r[u[c]])return null;if(r){if(r=r[u[c]],"object"===_(n=r)&&!it(null==n?void 0:n.attributes)&&"object"===_(null==n?void 0:n.attributes)&&void 0!==u[c+1]){var l=u.slice(c+1).join(".");return lt(r.attributes,l)}if("function"==typeof r)return ct(r,u.slice(c+1).join("."))}}return r}if(a)return ct(t,e)}function ht(t,e,n){var r=t,i="object"===_(t),o=Array.isArray(t),a="string"===_(e)&&e.includes(".")?e.split("."):[e],s=a.length;if(o||i){for(var u=0;u<s-1;u++)r[a[u]]||(r[a[u]]={}),r=r[a[u]];r[a[s-1]]=n}return n}function ft(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=W(e)?e:[e],!W(e))return e instanceof dt&&e.extend(t),t;var n,r=g(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.extendActions(i)}}catch(t){r.e(t)}finally{r.f()}}var dt=function(){return p((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;f(this,t),this.actions=e,this.bind=n}),[{key:"extend",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||this.bind;if(!t)return this;if(null!=this&&this.actions&&"object"===_(this.actions))for(var e in this.actions){var n=this.actions[e];"function"==typeof n?ht(t,e,n.bind(t)):ht(t,e,n)}return this}}])}();function vt(t){return t instanceof pt}var pt=function(){return p((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};f(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||"v1",this.setAdapter(n)}),[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=I(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"id",get:function(){return this.getAttribute("id")}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags(["isLoading","isSaving"]),this.store.create(n).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags(["isLoading","isSaving"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"destroy",value:function(){var t=this;return this.setFlags(["isLoading","isDestroying"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags(["isLoading","isDestroying"],!1),e}))}},{key:"reload",value:function(){var t=this;return this.setFlags(["isLoading","isReloading"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:"setFlags",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=["isLoading","isSaving","isReloading","isDestroying"],r=0;r<t.length;r++){var i=t[r];if("string"!=typeof i||!n.includes(i))throw new Error("".concat(i," is not a valid flag!"));this[i]=e}return this}},{key:"reset",value:function(){return this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isReloading=!1,this}},{key:"empty",value:function(){return this.reset(),this.attribues={},this}},{key:"save",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return it(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:"saveDirty",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n<t.length;n++){var r=t[n];e[r]=this.getAttribute(r)}return this.update(e)}},{key:"meta",get:function(){return this.getAttribute("meta",{})}},{key:"createdAt",get:function(){return this.isAttributeFilled("created_at")?new Date(this.getAttribute("created_at")):null}},{key:"updatedAt",get:function(){return this.isAttributeFilled("updated_at")?new Date(this.getAttribute("updated_at")):null}},{key:"isLoaded",get:function(){return this.hasAttributes(["created_at","id"])}},{key:"isEmpty",get:function(){return 0===Object.values(null==this?void 0:this.attributes).length}},{key:"isNew",get:function(){return!this.id}},{key:"isSaved",get:function(){return!this.isNew&&this.isLoaded}},{key:"isDeleted",get:function(){return this.hasAttributes(["deleted","time"])}},{key:"eachAttribute",value:function(t){var e,n=this;return"function"!=typeof t||Object.keys(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{}).forEach((function(e){var r=n.getAttribute(e);t.call(n,r,e)})),this}},{key:"changes",value:function(){return this.changes}},{key:"getDirtyAttributes",value:function(){return this.dirtyAttributes}},{key:"isDirty",value:function(t){return t in this.dirtyAttributes}},{key:"hasDirtyAttributes",value:function(){var t;return Object.keys(null!==(t=null==this?void 0:this.dirtyAttributes)&&void 0!==t?t:{}).length>0}},{key:"mutate",value:function(t,e){this.attributes[t]=e}},{key:"setAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&"object"===_(t))return this.setAttributes(t);var r=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return ht(this.attributes,t,n),ht(this.dirtyAttributes,t,r),W(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:r,value:n,changedAt:new Date}),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:"getAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=lt(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:"hasAttribute",value:function(t){if(W(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:"hasAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:"isAttributeFilled",value:function(t){var e=this;return W(t)?this.hasAttribute(t)&&t.every((function(t){return!it(e.getAttribute(t))})):this.hasAttribute(t)&&!it(this.getAttribute(t))}},{key:"getAttributes",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if("string"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!W(t))throw new Error("No attribute properties provided!");var n,r=g(t);try{for(r.s();!(n=r.n()).done;){var i,o,a=n.value;if("string"==typeof a){var s=this.getAttribute(a);"object"!==_(null===(i=s)||void 0===i?void 0:i.attributes)||W(null===(o=s)||void 0===o?void 0:o.attributes)||(s=s.attributes),e[a]=s}}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"serialize",value:function(){return this.getAttributes()}},{key:"mergeAttributes",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=x(x({},n),e),this.attributes}},{key:"syncAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}])}();B("resource","Resource",pt);var gt=function(){return p((function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};f(this,t),this.resource=e,this.adapter=n||at(),this.namespace=D(e),this.storage=nt(),this.options=r,this.extendActions(r.actions)}),[{key:"extendActions",value:function(){return ft(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}},{key:"deposit",value:function(t){return t}},{key:"serialize",value:function(t){return H("resource",U(this.resource),t,this.adapter)}},{key:"afterFetch",value:function(t){return function(t,e){if("function"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),W(e)){var n,r=[],i=g(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.push(t.afterFetch(o))}}catch(t){i.e(t)}finally{i.f()}return nt.apply(void 0,r)}var a=t.serialize(e);return t.deposit(a)}(this,t)}},{key:"create",value:(a=c(O().mark((function t(){var e,n,r,i=arguments;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=4,this.adapter.post("".concat(this.namespace),e,n);case 4:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 6:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"update",value:(o=c(O().mark((function t(e){var n,r,i,o=arguments;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2&&void 0!==o[2]?o[2]:{},t.next=4,this.adapter.put("".concat(this.namespace,"/").concat(e),n,r);case 4:return i=t.sent,t.abrupt("return",this.afterFetch(i));case 6:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"findRecord",value:(i=c(O().mark((function t(e){var n,r,i=arguments;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=3,this.adapter.get("".concat(this.namespace,"/").concat(e),{},n);case 3:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"findAll",value:(r=c(O().mark((function t(){var e,n,r=arguments;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.adapter.get("".concat(this.namespace),{},e);case 3:return n=t.sent,t.abrupt("return",this.afterFetch(n));case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"query",value:(n=c(O().mark((function t(){var e,n,r,i=arguments;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=4,this.adapter.get("".concat(this.namespace),e,n);case 4:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"queryRecord",value:(e=c(O().mark((function t(){var e,n,r,i=arguments;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},(e=i.length>0&&void 0!==i[0]?i[0]:{}).single=!0,t.next=5,this.adapter.get("".concat(this.namespace),e,n);case 5:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"destroy",value:(t=c(O().mark((function t(e){var n,r,i,o=arguments;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=vt(e)?e.getAttribute("id"):e,t.next=4,this.adapter.delete("".concat(this.namespace,"/").concat(r),{},n);case 4:return i=t.sent,t.abrupt("return",this.afterFetch(i));case 6:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})}]);var t,e,n,r,i,o,a}();B("store","Store",gt);var yt=new dt({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/distance-and-time"),e,n)},getNextActivity:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/next-activity"),e,n)},dispatch:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/dispatch"),e,n).then(this.afterFetch.bind(this))},start:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/start"),e,n).then(this.afterFetch.bind(this))},updateActivity:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/update-activity"),e,n).then(this.afterFetch.bind(this))},setDestination:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return vt(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/set-destination/").concat(e),n,r).then(this.afterFetch.bind(this))},captureQrCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return vt(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/capture-qr").concat(e?"/"+e:""),n,r)},captureSignature:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return vt(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/capture-signature").concat(e?"/"+e:""),n,r)},complete:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/complete"),e,n).then(this.afterFetch.bind(this))},cancel:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/cancel"),e,n).then(this.afterFetch.bind(this))}}),bt=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"order",x({actions:yt},r)])}return m(e,t),p(e,[{key:"getDistanceAndTime",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.getDistanceAndTime(this.id,t,e)}},{key:"dispatch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.dispatch(this.id,t,e)}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.start(this.id,t,e)}},{key:"setDestination",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.setDestination(this.id,t,e,n)}},{key:"captureQrCode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.captureQrCode(this.id,t,e,n)}},{key:"captureSignature",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.captureSignature(this.id,t,e,n)}},{key:"getNextActivity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.getNextActivity(this.id,t,e)}},{key:"updateActivity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.updateActivity(this.id,t,e)}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.cancel(this.id,t,e)}},{key:"complete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.complete(this.id,t,e)}},{key:"isDispatched",get:function(){return null!==this.getAttribute("dispatched_at")}},{key:"isNotDispatched",get:function(){return null==this.getAttribute("dispatched_at")}},{key:"isStarted",get:function(){return null!==this.getAttribute("started_at")}},{key:"isNotStarted",get:function(){return null==this.getAttribute("started_at")}},{key:"isCompleted",get:function(){return"completed"==this.getAttribute("status")}},{key:"isCanceled",get:function(){return"canceled"==this.getAttribute("status")}},{key:"isEnroute",get:function(){return"driver_enroute"==this.getAttribute("status")||"enroute"===this.getAttribute("status")}},{key:"isInProgress",get:function(){return this.isStarted&&!this.isCanceled&&!this.isCompleted}},{key:"scheduledAt",get:function(){return this.isAttributeFilled("scheduled_at")?new Date(this.getAttribute("scheduled_at")):null}},{key:"startedAt",get:function(){return this.isAttributeFilled("started_at")?new Date(this.getAttribute("started_at")):null}},{key:"dispatchedAt",get:function(){return this.isAttributeFilled("dispatched_at")?new Date(this.getAttribute("dispatched_at")):null}},{key:"status",get:function(){return this.getAttribute("status")}}])}(pt);B("resource","Order",bt);var mt=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"payload",r])}return m(e,t),p(e,[{key:"attach",value:function(t){}},{key:"entities",get:function(){var t=this;return nt(this.entities.map((function(e){return J("Entity",e,t.adapter)})))}},{key:"dropoff",get:function(){return this.dropoff?J("Place",this.dropoff,this.adapter):null}},{key:"pickup",get:function(){return this.pickup?J("Place",this.pickup,this.adapter):null}},{key:"waypoints",get:function(){var t=this;return nt(this.waypoints.map((function(e){return J("Waypoint",e,t.adapter)})))}}])}(pt);B("resource","Payload",mt);var wt=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"entity",r])}return m(e,t),p(e)}(pt);B("resource","Entity",wt);var kt=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"place",r])}return m(e,t),p(e,[{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new ut))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new ut))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"setOwner",value:function(t){return vt(t)&&this.setAttribute("owner",t.id),"string"==typeof t&&this.setAttribute("owner",t),this}}],[{key:"fromGoogleAddress",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=S(t.getAttribute("coordinates"),2),o=i[0],a=i[1];return new e({name:null,address:t.getAttribute("address"),location:new ut(o,a),street1:t.getAttribute("address"),street2:null,city:t.getAttribute("city"),province:t.getAttribute("stateLong"),postal_code:t.getAttribute("postalCode"),neighborhood:t.get("neighborhood"),district:t.getAttribute("county"),building:t.get("building"),country:t.getAttribute("countryShort"),phone:null,security_access_code:null},n,r)}}])}(pt);B("resource","Place",kt);var At=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"waypoint",r])}return m(e,t),p(e)}(kt);B("resource","Waypoint",At);var Et=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"tracking-status",r])}return m(e,t),p(e)}(pt);function xt(t,e){this.v=t,this.k=e}function Ot(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Rt(t){if(Array.isArray(t))return t}function St(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function jt(t){var e={},n=!1;function r(e,r){return n=!0,r=new Promise((function(n){n(t[e](r))})),{done:!1,value:new xt(r,1)}}return e["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},e.next=function(t){return n?(n=!1,t):r("next",t)},"function"==typeof t.throw&&(e.throw=function(t){if(n)throw n=!1,t;return r("throw",t)}),"function"==typeof t.return&&(e.return=function(t){return n?(n=!1,t):r("return",t)}),e}function Tt(t){var e,n,r,i=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&null!=(e=t[n]))return e.call(t);if(r&&null!=(e=t[r]))return new _t(e.call(t));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function _t(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then((function(t){return{value:t,done:e}}))}return _t=function(t){this.s=t,this.n=t.next},_t.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var n=this.s.return;return void 0===n?Promise.resolve({value:t,done:!0}):e(n.apply(this.s,arguments))},throw:function(t){var n=this.s.return;return void 0===n?Promise.reject(t):e(n.apply(this.s,arguments))}},new _t(t)}function Pt(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Lt(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Pt(o,r,i,a,s,"next",t)}function s(t){Pt(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Ct(t){return new xt(t,0)}function Nt(t,e,n){return e=qt(e),function(t,e){if(e&&("object"==_(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return St(t)}(t,Mt()?Reflect.construct(e,n||[],qt(t).constructor):e.apply(t,n))}function Ft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dt(t,e,n){if(Mt())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&Vt(i,n.prototype),i}function $t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Yt(r.key),r)}}function Ut(t,e,n){return e&&$t(t.prototype,e),n&&$t(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function zt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=te(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Bt(t,e,n){return(e=Yt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qt(t){return qt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},qt(t)}function It(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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Vt(t,e)}function Mt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Mt=function(){return!!t})()}function Ht(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Jt(){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 Wt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Kt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wt(Object(n),!0).forEach((function(e){Bt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Gt(){Gt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new P(r||[]);return i(a,"_invoke",{value:R(t,n,s)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f="suspendedStart",d="suspendedYield",v="executing",p="completed",g={};function y(){}function b(){}function m(){}var w={};c(w,a,(function(){return this}));var k=Object.getPrototypeOf,A=k&&k(k(L([])));A&&A!==n&&r.call(A,a)&&(w=A);var E=m.prototype=y.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){function n(i,o,a,s){var u=h(t[i],t,o);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==_(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(l).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function R(e,n,r){var i=f;return function(o,a){if(i===v)throw Error("Generator is already running");if(i===p){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var u=S(s,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=v;var c=h(e,n,r);if("normal"===c.type){if(i=r.done?p:d,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=p,r.method="throw",r.arg=c.arg)}}}function S(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,g;var a=o.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function j(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 T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function L(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(_(e)+" is not iterable")}return b.prototype=m,i(E,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:b,configurable:!0}),b.displayName=c(m,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,m):(t.__proto__=m,c(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},x(O.prototype),c(O.prototype,s,(function(){return this})),e.AsyncIterator=O,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new O(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=L,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:L(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Vt(t,e){return Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vt(t,e)}function Xt(t,e){return Rt(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){c=!0,i=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(t,e)||te(t,e)||Jt()}function Qt(t){return function(t){if(Array.isArray(t))return Ot(t)}(t)||Ht(t)||te(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yt(t){var e=function(t){if("object"!=_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_(e)?e:e+""}function Zt(t){return Zt="function"==typeof Symbol&&"symbol"==_(Symbol.iterator)?function(t){return _(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_(t)},Zt(t)}function te(t,e){if(t){if("string"==typeof t)return Ot(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ot(t,e):void 0}}function ee(t){return function(){return new ne(t.apply(this,arguments))}}function ne(t){var e,n;function r(e,n){try{var o=t[e](n),a=o.value,s=a instanceof xt;Promise.resolve(s?a.v:a).then((function(n){if(s){var u="return"===e?"return":"next";if(!a.k||n.done)return r(u,n);n=t[u](n).value}i(o.done?"return":"normal",n)}),(function(t){r("throw",t)}))}catch(t){i("throw",t)}}function i(t,i){switch(t){case"return":e.resolve({value:i,done:!0});break;case"throw":e.reject(i);break;default:e.resolve({value:i,done:!1})}(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(t,i){return new Promise((function(o,a){var s={key:t,arg:i,resolve:o,reject:a,next:null};n?n=n.next=s:(e=n=s,r(t,i))}))},"function"!=typeof t.return&&(this.return=void 0)}function re(t){var e="function"==typeof Map?new Map:void 0;return re=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return Dt(t,arguments,qt(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Vt(n,t)},re(t)}B("resource","TrackingStatus",Et),ne.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},ne.prototype.next=function(t){return this._invoke("next",t)},ne.prototype.throw=function(t){return this._invoke("throw",t)},ne.prototype.return=function(t){return this._invoke("return",t)};var ie=function(){function t(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Ft(this,t),Bt(this,"uncountableWords",["equipment","information","rice","money","species","series","fish","sheep","moose","deer","news"]),Bt(this,"pluralRules",[[new RegExp("(m)an$","gi"),"$1en"],[new RegExp("(pe)rson$","gi"),"$1ople"],[new RegExp("(child)$","gi"),"$1ren"],[new RegExp("^(ox)$","gi"),"$1en"],[new RegExp("(ax|test)is$","gi"),"$1es"],[new RegExp("(octop|vir)us$","gi"),"$1i"],[new RegExp("(alias|status)$","gi"),"$1es"],[new RegExp("(bu)s$","gi"),"$1ses"],[new RegExp("(buffal|tomat|potat)o$","gi"),"$1oes"],[new RegExp("([ti])um$","gi"),"$1a"],[new RegExp("sis$","gi"),"ses"],[new RegExp("(?:([^f])fe|([lr])f)$","gi"),"$1$2ves"],[new RegExp("(hive)$","gi"),"$1s"],[new RegExp("([^aeiouy]|qu)y$","gi"),"$1ies"],[new RegExp("(x|ch|ss|sh)$","gi"),"$1es"],[new RegExp("(matr|vert|ind)ix|ex$","gi"),"$1ices"],[new RegExp("([m|l])ouse$","gi"),"$1ice"],[new RegExp("(quiz)$","gi"),"$1zes"],[new RegExp("s$","gi"),"s"],[new RegExp("$","gi"),"s"]]),Bt(this,"singularRules",[[new RegExp("(m)en$","gi"),"$1an"],[new RegExp("(pe)ople$","gi"),"$1rson"],[new RegExp("(child)ren$","gi"),"$1"],[new RegExp("([ti])a$","gi"),"$1um"],[new RegExp("((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$","gi"),"$1$2sis"],[new RegExp("(hive)s$","gi"),"$1"],[new RegExp("(tive)s$","gi"),"$1"],[new RegExp("(curve)s$","gi"),"$1"],[new RegExp("([lr])ves$","gi"),"$1f"],[new RegExp("([^fo])ves$","gi"),"$1fe"],[new RegExp("([^aeiouy]|qu)ies$","gi"),"$1y"],[new RegExp("(s)eries$","gi"),"$1eries"],[new RegExp("(m)ovies$","gi"),"$1ovie"],[new RegExp("(x|ch|ss|sh)es$","gi"),"$1"],[new RegExp("([m|l])ice$","gi"),"$1ouse"],[new RegExp("(bus)es$","gi"),"$1"],[new RegExp("(o)es$","gi"),"$1"],[new RegExp("(shoe)s$","gi"),"$1"],[new RegExp("(cris|ax|test)es$","gi"),"$1is"],[new RegExp("(octop|vir)i$","gi"),"$1us"],[new RegExp("(alias|status)es$","gi"),"$1"],[new RegExp("^(ox)en","gi"),"$1"],[new RegExp("(vert|ind)ices$","gi"),"$1ex"],[new RegExp("(matr)ices$","gi"),"$1ix"],[new RegExp("(quiz)zes$","gi"),"$1"],[new RegExp("s$","gi"),""]]),Bt(this,"nonTitlecasedWords",["and","or","nor","a","an","the","so","but","to","of","at","by","from","into","on","onto","off","out","in","over","with","for"]),Bt(this,"idSuffix",new RegExp("(_ids|_id)$","g")),Bt(this,"underbar",new RegExp("_","g")),Bt(this,"spaceOrUnderbar",new RegExp("[ _]","g")),Bt(this,"uppercase",new RegExp("([A-Z])","g")),Bt(this,"underbarPrefix",new RegExp("^_")),this.str=e,this.chain=n}return Ut(t,[{key:"get",value:function(){return this.str}},{key:"applyRules",value:function(t,e,n,r){if(r)t=r;else if(!(n.indexOf(t.toLowerCase())>-1))for(var i=0;i<e.length;i++)if(t.match(e[i][0])){t=t.replace(e[i][0],e[i][1]);break}return this.str=t,!0===this.chain?this:t}},{key:"pluralize",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t=t||this.str,this.applyRules(t,this.pluralRules,this.uncountableWords,e)}},{key:"singularize",value:function(t,e){return t=t||this.str,this.applyRules(t,this.singularRules,this.uncountableWords,e)}},{key:"camelize",value:function(t,e){for(var n=(t=t||this.str).split("/"),r=0;r<n.length;r++){for(var i=n[r].split("_"),o=e&&r+1===n.length?1:0;o<i.length;o++)i[o]=i[o].charAt(0).toUpperCase()+i[o].substring(1);n[r]=i.join("")}if(t=n.join("::"),!0===e){var a=t.charAt(0).toLowerCase(),s=t.slice(1);t=a+s}return this.str=t,!0===this.chain?this:t}},{key:"underscore",value:function(t){for(var e=(t=t||this.str).split("::"),n=0;n<e.length;n++)e[n]=e[n].replace(this.uppercase,"_$1"),e[n]=e[n].replace(this.underbarPrefix,"");return t=e.join("/").toLowerCase(),this.str=t,!0===this.chain?this:t}},{key:"humanize",value:function(t,e){return t=(t=(t=(t=t||this.str).toLowerCase()).replace(this.idSuffix,"")).replace(this.underbar," "),e||(t=this.capitalize(t)),this.str=t,!0===this.chain?this:t}},{key:"capitalize",value:function(t){return t=(t=(t=t||this.str).toLowerCase()).substring(0,1).toUpperCase()+t.substring(1),this.str=t,!0===this.chain?this:t}},{key:"dasherize",value:function(t){return t=(t=(t=t||this.str).replace(this.spaceOrUnderbar,"-")).toLowerCase(),this.str=t,!0===this.chain?this:t}},{key:"normify",value:function(t,e){t=t||this.str,!0===e?(t=this.camelize(t),t=this.underscore(t)):t=t.toLowerCase();for(var n=(t=t.replace(this.underbar," ")).split(" "),r=0;r<n.length;r++){for(var i=n[r].split("-"),o=0;o<i.length;o++)this.nonTitlecasedWords.indexOf(i[o].toLowerCase())<0&&(i[o]=this.capitalize(i[o]));n[r]=i.join("-")}return t=(t=n.join(" ")).substring(0,1).toUpperCase()+t.substring(1),this.str=t,!0===this.chain?this:t}},{key:"demodulize",value:function(t){var e=(t=t||this.str).split("::");return t=e[e.length-1],this.str=t,!0===this.chain?this:t}},{key:"tableize",value:function(t){t=t||this.str;var e=this.chain;return this.chain=!1,t=this.pluralize(this.underscore(t)),this.chain=e,this.str=t,!0===this.chain?this:t}},{key:"classify",value:function(t){t=t||this.str,t=(t="".concat(t).trim()).replace(/[\s\-_]+/g,"_");var e=this.chain;return this.chain=!1,t=this.singularize(t),t=this.camelize(t,!1),this.chain=e,this.str=t,this.chain?this:t}},{key:"foreignKey",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=t||this.str,t=this.underscore(this.demodulize(t))+(e?"":"_")+"id",this.str=t,!0===this.chain?this:t}},{key:"ordinalize",value:function(t){for(var e=(t=t||this.str).split(" "),n=0;n<e.length;n++){var r=parseInt(e[n]);if(isNaN(r)){var i=e[n].substring(e[n].length-2),o=e[n].substring(e[n].length-1),a="th";"11"!=i&&"12"!=i&&"13"!=i&&("1"===o?a="st":"2"===o?a="nd":"3"===o&&(a="rd")),e[n]+=a}}return t=e.join(" "),this.str=t,!0===this.chain?this:t}}],[{key:"invoke",value:function(){var e=Object.values(arguments),n=new t(null,!1),r=arguments[0];return e.shift(),"function"==typeof n[r]?n[r].apply(n,e):null}}])}(),oe=function(){var t=["pluralize"].concat(Array.prototype.slice.call(arguments));return ie.invoke.apply(ie,Qt(t))},ae=function(){var t=["singularize"].concat(Array.prototype.slice.call(arguments));return ie.invoke.apply(ie,Qt(t))},se=function(){var t=["classify"].concat(Array.prototype.slice.call(arguments));return ie.invoke.apply(ie,Qt(t))},ue={resources:{},adapters:{},storse:{},actions:{}};function ce(t,e,n){var r=oe(t);ue[r]||(ue[r]={}),ue[r][e]=n}function le(t,e){var n=oe(t);if(!ue[n])throw new Error("Unknown type: ".concat(ae(t)));if(!ue[n][e])throw new Error("No ".concat(ae(t)," named '").concat(e,"' registered."));for(var r=ue[n][e],i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];return Dt(r,o)}function he(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return le.apply(void 0,[t,se(e)].concat(r))}function fe(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return he.apply(void 0,["resource",se(t)].concat(n))}Ut((function t(){return Ft(this,t),this.lookup.apply(this,arguments)}),[{key:"lookup",value:function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return le.apply(void 0,[t,e].concat(r))}}]);var de=Array.isArray,ve=6e4;function pe(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(de(t))if(r.length<=ve)t.splice.apply(t,[e,n].concat(Qt(r)));else{t.splice(e,n);for(var i=0;i<r.length;i+=ve){var o=r.slice(i,i+ve);t.splice.apply(t,[e+i,0].concat(Qt(o)))}}else ye(t)&&t.replace(e,n,r)}function ge(t){return t}function ye(t){return t instanceof xe}function be(t,e){return de(t)?t[e]:ye(t)?t.objectAt(e):null}function me(t,e){return 2===arguments.length?function(n){return e===n[t]}:function(e){return Boolean(e[t])}}function we(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.length,i=n;i<r;i++)if(e(be(t,i),i,t))return i;return-1}function ke(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=t.length;return n<0&&(n+=i),we(t,r&&e!=e?function(t){return t!=t}:function(t){return t===e},n)}function Ae(t,e,n){return pe(t,e,0,[n]),n}function Ee(){return Dt(xe,Array.prototype.slice.call(arguments))}var xe=function(){function t(){return Ft(this,t),St(de(arguments[0])?Nt(this,t,Qt(arguments[0])):Nt(this,t,arguments))}return It(t,re(Array)),Ut(t,[{key:"notEmpty",get:function(){return this.length>0}},{key:"empty",get:function(){return 0===this.length}},{key:"first",get:function(){return be(this,0)}},{key:"last",get:function(){return be(this,this.length-1)}},{key:"replace",value:function(t,e){return pe(this,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[]),this}},{key:"objectsAt",value:function(t){var e=this;return t.map((function(t){return be(e,t)}))}},{key:"objectAt",value:function(t){return be(this,t)}},{key:"indexOf",value:function(t,e){return ke(this,t,e,!1)}},{key:"lastIndexOf",value:function(t,e){var n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(var r=e;r>=0;r--)if(be(this,r)===t)return r;return-1}},{key:"includes",value:function(t,e){return-1!==ke(this,t,e,!0)}},{key:"findBy",value:function(){return-1===(t=we(this,me.apply(void 0,arguments).bind(undefined),0))?void 0:be(this,t);var t}},{key:"findIndexBy",value:function(){return we(this,me.apply(void 0,arguments))}},{key:"isEvery",value:function(){return t=me.apply(void 0,arguments),e=t.bind(undefined),-1===we(this,(function(t,n,r){return!e(t,n,r)}),0);var t,e}},{key:"isAny",value:function(){return-1!==we(this,me.apply(void 0,arguments).bind(undefined),0)}},{key:"invoke",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=[];return this.forEach((function(e){var r;return i.push(null===(r=e[t])||void 0===r?void 0:r.call.apply(r,[e].concat(n)))})),i}},{key:"toArray",value:function(){return this.map((function(t){return t}))}},{key:"compact",value:function(){return this.filter((function(t){return null!=t}))}},{key:"sortBy",value:function(){var t=arguments;return this.sort((function(e,n){var r,i=zt(t);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=e[o],s=n[o],u=compare(a,s);if(u)return u}}catch(t){i.e(t)}finally{i.f()}return 0}))}},{key:"uniqBy",value:function(t){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ge,n=[],r=new Set,i="function"==typeof e?e:function(t){return get(t,e)};return t.forEach((function(t){var e=i(t);r.has(e)||(r.add(e),n.push(t))})),n}(this,t)}},{key:"without",value:function(t){if(!this.includes(t))return this;var e=t==t?function(e){return e!==t}:function(t){return t==t};return this.filter(e)}},{key:"clear",value:function(){var t=this.length;return 0===t||this.replace(0,t,[]),this}},{key:"insertAt",value:function(t,e){return Ae(this,t,e),this}},{key:"replaceAt",value:function(t,e){return this.replace(t,1,[e])}},{key:"removeAt",value:function(t,e){return function(t,e){return pe(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,[]),t}(this,t,e)}},{key:"pushObject",value:function(t){return this.insertAt(this.length,t)}},{key:"pushObjects",value:function(t){return this.replace(this.length,0,t),this}},{key:"popObject",value:function(){var t=this.length;if(0===t)return null;var e=be(this,t-1);return this.removeAt(t-1,1),e}},{key:"shiftObject",value:function(){if(0===this.length)return null;var t=be(this,0);return this.removeAt(0),t}},{key:"unshiftObject",value:function(t){return Ae(this,0,t)}},{key:"unshiftObjects",value:function(t){return this.replace(0,0,t),this}},{key:"reverseObjects",value:function(){var t=this.length;if(0===t)return this;var e=this.toArray().reverse();return this.replace(0,t,e),this}},{key:"setObjects",value:function(t){if(0===t.length)return this.clear();var e=this.length;return this.replace(0,e,t),this}},{key:"removeObject",value:function(t){for(var e=this.length||0;--e>=0;)be(this,e)===t&&this.removeAt(e);return this}},{key:"removeObjects",value:function(t){for(var e=t.length-1;e>=0;e--)this.removeObject(t[e]);return this}},{key:"addObject",value:function(t){return this.includes(t)||this.pushObject(t),this}},{key:"addObjects",value:function(t){var e=this;return t.forEach((function(t){return e.addObject(t)})),this}}])}();function Oe(t){var e=null==t;if(e)return e;if("number"==typeof t.size)return!t.size;var n=Zt(t);if("object"===n){var r=t.size;if("number"==typeof r)return!r}if("number"==typeof t.length&&"function"!==n)return!t.length;if("object"===n){var i=t.length;if("number"==typeof i)return!i}return!1}function Re(){var t,e,n;return!("undefined"==typeof process||"object"!==Zt(null===(t=process)||void 0===t?void 0:t.env)&&-1===(null===(e=process.release)||void 0===e||null===(e=e.name)||void 0===e?void 0:e.search(/node|io.js/))||"undefined"!=typeof window&&"ReactNative"!==(null===(n=window)||void 0===n||null===(n=n.navigator)||void 0===n?void 0:n.product))}function Se(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Re()?he("adapter","NodeAdapter",t):he("adapter","BrowserAdapter",t)}Ut((function t(e){Ft(this,t),this.place=e,this.geometry=null==e?void 0:e.geometry,this.components=this.parseComponents(),this.attributes=this.parseProperties()}),[{key:"parse",value:function(){this.parseComponents(),this.parseProperties()}},{key:"parseComponents",value:function(){var t;return((null===(t=this.place)||void 0===t?void 0:t.address_components)||[]).reduce((function(t,e){return e.types.forEach((function(n){t[n]=e})),t}),{})}},{key:"parseProperties",value:function(){var t,e={streetNumber:this.get("street_number"),streetName:this.get("route"),coordinates:null!==(t=this.geometry)&&void 0!==t&&t.location?Object.values(this.geometry.location):[0,0],city:this.or(["locality","sublocality","sublocality_level_1","neighborhood","administrative_area_level_3","administrative_area_level_2"]),county:this.get("administrative_area_level_2"),stateShort:this.get("administrative_area_level_1",!0),stateLong:this.get("administrative_area_level_1"),countryShort:this.get("country",!0),country:this.get("country",!0),countryLong:this.get("country"),postalCode:this.get("postal_code")};return e.address=[e.streetNumber,e.streetName].filter(Boolean).join(" "),e}},{key:"all",value:function(){return this.attributes}},{key:"or",value:function(){var t,e=zt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]);try{for(e.s();!(t=e.n()).done;){var n=t.value;if(de(n)){var r=n[0],i=n[1];if(this.has(r))return this.get(r,i)}else if(this.has(n))return this.get(n)}}catch(t){e.e(t)}finally{e.f()}return null}},{key:"has",value:function(t){return t in this.components}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t in this.components?e?this.components[t].short_name:this.components[t].long_name:null}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.attributes=Kt(Kt({},this.attributes),t),this}},{key:"setAttribute",value:function(t,e){return this.attributes[t]=e,this}},{key:"getAttribute",value:function(t){return this.attributes[t]||null}}]);var je=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Ft(this,t),this.type="Point",this.coordinates=[n,e]}return Ut(t,[{key:"latitude",get:function(){return this.coordinates[1]}},{key:"longitude",get:function(){return this.coordinates[0]}},{key:"lat",value:function(){return this.latitude}},{key:"lng",value:function(){return this.longitude}},{key:"serialize",value:function(){return{type:"Point",coorindates:[this.lat(),this.lng()]}}},{key:"toJson",value:function(){return this.serialize()}},{key:"toString",value:function(){return"(".concat(this.latitude,", ").concat(this.longitude,")")}}],[{key:"fromGeoJson",value:function(e){var n=Xt(e.coordinates,2),r=n[0];return new t(n[1],r)}}])}();function Te(t,e){var n=t();return Array.isArray(n)||"object"===Zt(n)?_e(n,e):null}function _e(t,e){var n,r=t,i=Zt(t),o="object"===i,a="function"===i,s=Array.isArray(t),u="string"===Zt(e)&&e.includes(".")?e.split("."):[e];if(s||o){for(var c=0;c<u.length;c++){if(r&&void 0===r[u[c]])return null;if(r){if("object"===Zt(n=r=r[u[c]])&&!Oe(null==n?void 0:n.attributes)&&"object"===Zt(null==n?void 0:n.attributes)&&void 0!==u[c+1]){var l=u.slice(c+1).join(".");return _e(r.attributes,l)}if("function"==typeof r)return Te(r,u.slice(c+1).join("."))}}return r}if(a)return Te(t,e)}function Pe(t,e,n){var r=t,i="object"===Zt(t),o=Array.isArray(t),a="string"===Zt(e)&&e.includes(".")?e.split("."):[e],s=a.length;if(o||i){for(var u=0;u<s-1;u++)r[a[u]]||(r[a[u]]={}),r=r[a[u]];r[a[s-1]]=n}return n}var Le=Ut((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Ft(this,t),this.actions=e,this.bind=n}),[{key:"extend",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||this.bind;if(!t)return this;if(null!=this&&this.actions&&"object"===Zt(this.actions))for(var e in this.actions){var n=this.actions[e];Pe(t,e,"function"==typeof n?n.bind(t):n)}return this}}]);function Ce(t){return t instanceof Ne}var Ne=Ut((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Ft(this,t),this.attributes=e,this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isDestroying=!1,this.isReloading=!1,this.resource=r,this.options=i,this.version=i.version||"v1",this.setAdapter(n)}),[{key:"setAdapter",value:function(t){var e;return this.adapter=t,this.store=function(){return le.apply(void 0,["store","Store"].concat(Array.prototype.slice.call(arguments)))}(this.resource,t,{onAfterFetch:this.syncAttributes.bind(this),actions:null===(e=this.options)||void 0===e?void 0:e.actions}),this}},{key:"id",get:function(){return this.getAttribute("id")}},{key:"create",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.mergeAttributes(e);return this.setFlags(["isLoading","isSaving"]),this.store.create(n).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setFlags(["isLoading","isSaving"]),this.store.update(this.attributes.id,e).then((function(e){return t.setFlags(["isLoading","isSaving"],!1),e}))}},{key:"destroy",value:function(){var t=this;return this.setFlags(["isLoading","isDestroying"]),this.store.destroy(this.attributes.id).then((function(e){return t.setFlags(["isLoading","isDestroying"],!1),e}))}},{key:"reload",value:function(){var t=this;return this.setFlags(["isLoading","isReloading"]),this.store.findRecord(this.attributes.id).then((function(e){return t.reset(),e}))}},{key:"setFlags",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=["isLoading","isSaving","isReloading","isDestroying"],r=0;r<t.length;r++){var i=t[r];if("string"!=typeof i||!n.includes(i))throw new Error("".concat(i," is not a valid flag!"));this[i]=e}return this}},{key:"reset",value:function(){return this.dirtyAttributes={},this.changes={},this.isLoading=!1,this.isSaving=!1,this.isReloading=!1,this}},{key:"empty",value:function(){return this.reset(),this.attribues={},this}},{key:"save",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.getAttributes();return Oe(this.id)?this.create(e):!0===t.onlyDirty?this.savedirty():this.update(e)}},{key:"saveDirty",value:function(){for(var t=Object.keys(this.dirtyAttributes),e={},n=0;n<t.length;n++){var r=t[n];e[r]=this.getAttribute(r)}return this.update(e)}},{key:"meta",get:function(){return this.getAttribute("meta",{})}},{key:"createdAt",get:function(){return this.isAttributeFilled("created_at")?new Date(this.getAttribute("created_at")):null}},{key:"updatedAt",get:function(){return this.isAttributeFilled("updated_at")?new Date(this.getAttribute("updated_at")):null}},{key:"isLoaded",get:function(){return this.hasAttributes(["created_at","id"])}},{key:"isEmpty",get:function(){return 0===Object.values(null==this?void 0:this.attributes).length}},{key:"isNew",get:function(){return!this.id}},{key:"isSaved",get:function(){return!this.isNew&&this.isLoaded}},{key:"isDeleted",get:function(){return this.hasAttributes(["deleted","time"])}},{key:"eachAttribute",value:function(t){var e,n=this;return"function"!=typeof t||Object.keys(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{}).forEach((function(e){var r=n.getAttribute(e);t.call(n,r,e)})),this}},{key:"changes",value:function(){return this.changes}},{key:"getDirtyAttributes",value:function(){return this.dirtyAttributes}},{key:"isDirty",value:function(t){return t in this.dirtyAttributes}},{key:"hasDirtyAttributes",value:function(){var t;return Object.keys(null!==(t=null==this?void 0:this.dirtyAttributes)&&void 0!==t?t:{}).length>0}},{key:"mutate",value:function(t,e){this.attributes[t]=e}},{key:"setAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(null===n&&"object"===Zt(t))return this.setAttributes(t);var r=null!==(e=null==this?void 0:this.attributes[t])&&void 0!==e?e:null;return Pe(this.attributes,t,n),Pe(this.dirtyAttributes,t,r),de(null==this?void 0:this.changes[t])||(this.changes[t]=[]),this.changes[t].push({property:t,previousValue:r,value:n,changedAt:new Date}),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in t)this.setAttribute(e,t[e]);return this}},{key:"getAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=_e(null!==(e=null==this?void 0:this.attributes)&&void 0!==e?e:{},t);return void 0===r?n:r}},{key:"hasAttribute",value:function(t){if(de(t)){var e,n=t,r=Object.keys(null!==(e=this.attributes)&&void 0!==e?e:{});return n.every((function(t){return r.includes(t)}))}return!(null==this||!this.attributes)&&t in this.attributes}},{key:"hasAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.hasAttribute(t)}},{key:"isAttributeFilled",value:function(t){var e=this;return de(t)?this.hasAttribute(t)&&t.every((function(t){return!Oe(e.getAttribute(t))})):this.hasAttribute(t)&&!Oe(this.getAttribute(t))}},{key:"getAttributes",value:function(t){var e={};if(null==t)return this.getAttributes(Object.keys(this.attributes));if("string"==typeof t)return this.getAttribute(Array.prototype.slice.call(arguments));if(!de(t))throw new Error("No attribute properties provided!");var n,r=zt(t);try{for(r.s();!(n=r.n()).done;){var i,o,a=n.value;if("string"==typeof a){var s=this.getAttribute(a);"object"!==Zt(null===(i=s)||void 0===i?void 0:i.attributes)||de(null===(o=s)||void 0===o?void 0:o.attributes)||(s=s.attributes),e[a]=s}}}catch(t){r.e(t)}finally{r.f()}return e}},{key:"serialize",value:function(){return this.getAttributes()}},{key:"mergeAttributes",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(t=null==this?void 0:this.attributes)&&void 0!==t?t:{};return this.attributes=Kt(Kt({},n),e),this.attributes}},{key:"syncAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attributes=t}}]);ce("resource","Resource",Ne);var Fe=function(){return Ut((function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Ft(this,t),this.resource=e,this.adapter=n||Se(),this.namespace=oe(e),this.storage=Ee(),this.options=r,this.extendActions(r.actions)}),[{key:"extendActions",value:function(){return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(t.actions=de(e)?e:[e],!de(e))return e instanceof Le&&e.extend(t),t;var n,r=zt(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;t.extendActions(i)}}catch(t){r.e(t)}finally{r.f()}}(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:[])}},{key:"deposit",value:function(t){return t}},{key:"serialize",value:function(t){return he("resource",se(this.resource),t,this.adapter)}},{key:"afterFetch",value:function(t){return function(t,e){if("function"==typeof t.options.onAfterFetch&&t.options.onAfterFetch(e),de(e)){var n,r=[],i=zt(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;r.push(t.afterFetch(o))}}catch(t){i.e(t)}finally{i.f()}return Ee.apply(void 0,r)}var a=t.serialize(e);return t.deposit(a)}(this,t)}},{key:"create",value:(a=Lt(Gt().mark((function t(){var e,n,r,i=arguments;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=4,this.adapter.post("".concat(this.namespace),e,n);case 4:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 6:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"update",value:(o=Lt(Gt().mark((function t(e){var n,r,i,o=arguments;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=o.length>2&&void 0!==o[2]?o[2]:{},t.next=4,this.adapter.put("".concat(this.namespace,"/").concat(e),n,r);case 4:return i=t.sent,t.abrupt("return",this.afterFetch(i));case 6:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"findRecord",value:(i=Lt(Gt().mark((function t(e){var n,r,i=arguments;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=3,this.adapter.get("".concat(this.namespace,"/").concat(e),{},n);case 3:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 5:case"end":return t.stop()}}),t,this)}))),function(t){return i.apply(this,arguments)})},{key:"findAll",value:(r=Lt(Gt().mark((function t(){var e,n,r=arguments;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.adapter.get("".concat(this.namespace),{},e);case 3:return n=t.sent,t.abrupt("return",this.afterFetch(n));case 5:case"end":return t.stop()}}),t,this)}))),function(){return r.apply(this,arguments)})},{key:"query",value:(n=Lt(Gt().mark((function t(){var e,n,r,i=arguments;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},n=i.length>1&&void 0!==i[1]?i[1]:{},t.next=4,this.adapter.get("".concat(this.namespace),e,n);case 4:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"queryRecord",value:(e=Lt(Gt().mark((function t(){var e,n,r,i=arguments;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},(e=i.length>0&&void 0!==i[0]?i[0]:{}).single=!0,t.next=5,this.adapter.get("".concat(this.namespace),e,n);case 5:return r=t.sent,t.abrupt("return",this.afterFetch(r));case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"destroy",value:(t=Lt(Gt().mark((function t(e){var n,r,i,o=arguments;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},r=Ce(e)?e.getAttribute("id"):e,t.next=4,this.adapter.delete("".concat(this.namespace,"/").concat(r),{},n);case 4:return i=t.sent,t.abrupt("return",this.afterFetch(i));case 6:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})}]);var t,e,n,r,i,o,a}();ce("store","Store",Fe);var De=new Le({getDistanceAndTime:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/distance-and-time"),e,n)},getNextActivity:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("".concat(this.namespace,"/").concat(t,"/next-activity"),e,n)},dispatch:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/dispatch"),e,n).then(this.afterFetch.bind(this))},start:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/start"),e,n).then(this.afterFetch.bind(this))},updateActivity:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/update-activity"),e,n).then(this.afterFetch.bind(this))},setDestination:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Ce(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/set-destination/").concat(e),n,r).then(this.afterFetch.bind(this))},captureQrCode:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Ce(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/capture-qr").concat(e?"/"+e:""),n,r)},captureSignature:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Ce(e)&&(e=e.id),this.adapter.post("".concat(this.namespace,"/").concat(t,"/capture-signature").concat(e?"/"+e:""),n,r)},complete:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("".concat(this.namespace,"/").concat(t,"/complete"),e,n).then(this.afterFetch.bind(this))},cancel:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.delete("".concat(this.namespace,"/").concat(t,"/cancel"),e,n).then(this.afterFetch.bind(this))}}),$e=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"order",Kt({actions:De},r)])}return It(t,Ne),Ut(t,[{key:"getDistanceAndTime",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.getDistanceAndTime(this.id,t,e)}},{key:"dispatch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.dispatch(this.id,t,e)}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.start(this.id,t,e)}},{key:"setDestination",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.setDestination(this.id,t,e,n)}},{key:"captureQrCode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.captureQrCode(this.id,t,e,n)}},{key:"captureSignature",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.store.captureSignature(this.id,t,e,n)}},{key:"getNextActivity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.getNextActivity(this.id,t,e)}},{key:"updateActivity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.updateActivity(this.id,t,e)}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.cancel(this.id,t,e)}},{key:"complete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.complete(this.id,t,e)}},{key:"isDispatched",get:function(){return null!==this.getAttribute("dispatched_at")}},{key:"isNotDispatched",get:function(){return null==this.getAttribute("dispatched_at")}},{key:"isStarted",get:function(){return null!==this.getAttribute("started_at")}},{key:"isNotStarted",get:function(){return null==this.getAttribute("started_at")}},{key:"isCompleted",get:function(){return"completed"==this.getAttribute("status")}},{key:"isCanceled",get:function(){return"canceled"==this.getAttribute("status")}},{key:"isEnroute",get:function(){return"driver_enroute"==this.getAttribute("status")||"enroute"===this.getAttribute("status")}},{key:"isInProgress",get:function(){return this.isStarted&&!this.isCanceled&&!this.isCompleted}},{key:"scheduledAt",get:function(){return this.isAttributeFilled("scheduled_at")?new Date(this.getAttribute("scheduled_at")):null}},{key:"startedAt",get:function(){return this.isAttributeFilled("started_at")?new Date(this.getAttribute("started_at")):null}},{key:"dispatchedAt",get:function(){return this.isAttributeFilled("dispatched_at")?new Date(this.getAttribute("dispatched_at")):null}},{key:"status",get:function(){return this.getAttribute("status")}}])}();ce("resource","Order",$e);var Ue=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"payload",r])}return It(t,Ne),Ut(t,[{key:"attach",value:function(t){}},{key:"entities",get:function(){var t=this;return Ee(this.entities.map((function(e){return fe("Entity",e,t.adapter)})))}},{key:"dropoff",get:function(){return this.dropoff?fe("Place",this.dropoff,this.adapter):null}},{key:"pickup",get:function(){return this.pickup?fe("Place",this.pickup,this.adapter):null}},{key:"waypoints",get:function(){var t=this;return Ee(this.waypoints.map((function(e){return fe("Waypoint",e,t.adapter)})))}}])}();ce("resource","Payload",Ue);var ze=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"entity",r])}return It(t,Ne),Ut(t)}();ce("resource","Entity",ze);var Be=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"place",r])}return It(t,Ne),Ut(t,[{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new je))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new je))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"setOwner",value:function(t){return Ce(t)&&this.setAttribute("owner",t.id),"string"==typeof t&&this.setAttribute("owner",t),this}}],[{key:"fromGoogleAddress",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Xt(e.getAttribute("coordinates"),2),o=i[0],a=i[1];return new t({name:null,address:e.getAttribute("address"),location:new je(o,a),street1:e.getAttribute("address"),street2:null,city:e.getAttribute("city"),province:e.getAttribute("stateLong"),postal_code:e.getAttribute("postalCode"),neighborhood:e.get("neighborhood"),district:e.getAttribute("county"),building:e.get("building"),country:e.getAttribute("countryShort"),phone:null,security_access_code:null},n,r)}}])}();ce("resource","Place",Be);var qe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"waypoint",r])}return It(t,Be),Ut(t)}();ce("resource","Waypoint",qe);var Ie=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"tracking-status",r])}return It(t,Ne),Ut(t)}();ce("resource","TrackingStatus",Ie);var Me=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"vehicle",r])}return It(t,Ne),Ut(t)}();ce("resource","Vehicle",Me);var He=new Le({current:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("".concat(this.namespace,"/current"),t,e)}}),Je=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"organization",Kt({actions:He},r)])}return It(t,Ne),Ut(t)}();ce("resource","Organization",Je);var We=function(t,e){return de(t)?t.map((function(t){return new Je(t,e)})):new Je(t,e)},Ke=new Le({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("drivers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("drivers/login",Kt({identity:t,password:e},n)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/verify-code",Kt({identity:t,code:e},n)).then(this.afterFetch.bind(this))},track:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/track"),e,n).then(this.afterFetch.bind(this))},listOrganizations:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("drivers/".concat(t,"/organizations"),n,r).then((function(t){return We(t,e.adapter)}))},switchOrganization:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/switch-organization"),n,r).then((function(t){return We(t,e.adapter)}))},currentOrganization:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("drivers/".concat(t,"/current-organization"),n,r).then((function(t){return We(t,e.adapter)}))},retrieve:function(t){return this.findRecord(t)},syncDevice:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/register-device"),e,n)}}),Ge=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"driver",Kt({actions:Ke},r)])}return It(t,Ne),Ut(t,[{key:"token",get:function(){return this.getAttribute("token")}},{key:"isOnline",get:function(){return!0===this.getAttribute("online")}},{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new je))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new je))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"track",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.track(this.id,t,e)}},{key:"syncDevice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.syncDevice(this.id,t,e)}},{key:"listOrganizations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.listOrganizations(this.id,t,e)}},{key:"switchOrganization",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.switchOrganization(this.id,{next:t},e)}},{key:"currentOrganization",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.currentOrganization(this.id,t,e)}}])}();ce("resource","Driver",Ge);var Ve=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"vendor",r])}return It(t,Ne),Ut(t)}();ce("resource","Vendor",Ve);var Xe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"contact",r])}return It(t,Ne),Ut(t)}();ce("resource","Contact",Xe);var Qe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"zone",r])}return It(t,Ne),Ut(t)}();ce("resource","Zone",Qe);var Ye=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"service-area",r])}return It(t,Ne),Ut(t)}();ce("resource","ServiceArea",Ye);var Ze=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"service-rate",r])}return It(t,Ne),Ut(t)}();ce("resource","ServiceRate",Ze);var tn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"service-quote",r])}return It(t,Ne),Ut(t,[{key:"fromPreliminary",value:function(){}},{key:"fromPayload",value:function(){}}])}();ce("resource","ServiceQuote",tn);var en=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Ft(this,t),Nt(this,t,[e,n,"fleet",r])}return It(t,Ne),Ut(t)}();ce("resource","Fleet",en);var nn=Ut((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ft(this,t),this.version=e.version||"v1",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}}));ce("adapter","Adapter",nn);var rn=function(){function t(e){var n;return Ft(this,t),(n=Nt(this,t,[e])).setHeaders({Authorization:"Bearer ".concat(e.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;browser"}),n}return It(t,nn),Ut(t,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=Kt(Kt({},this.headers),t),this}},{key:"parseJSON",value:function(t){return new Promise((function(e,n){t.json().then((function(n){e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error("Oops! Something went wrong when handling your request."))}))}))}},{key:"request",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(o,a){fetch(i.url||"".concat(e.host,"/").concat(e.namespace,"/").concat(t),Kt({method:n,mode:i.mode||"cors",headers:new Headers(Kt(Kt({},e.headers||{}),i.headers||{}))},r)).then(e.parseJSON).then((function(t){if(t.ok)return o(t.json);a(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){a(t)}))}))}},{key:"get",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Oe(e=n)||"string"==typeof e&&!1===/\S/.test(e)?"":new URLSearchParams(n).toString();return this.request("".concat(t).concat(i?"?".concat(i):""),"GET",{},r)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"POST",{body:JSON.stringify(e)},n)}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PUT",{body:JSON.stringify(e)},n)}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,"DELETE",{},e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PATCH",{body:JSON.stringify(e)},n)}}])}();function on(t,e){return function(){return t.apply(e,arguments)}}ce("adapter","BrowserAdapter",rn);var an,sn=Object.prototype.toString,un=Object.getPrototypeOf,cn=(an=Object.create(null),function(t){var e=sn.call(t);return an[e]||(an[e]=e.slice(8,-1).toLowerCase())}),ln=function(t){return t=t.toLowerCase(),function(e){return cn(e)===t}},hn=function(t){return function(e){return Zt(e)===t}},fn=Array.isArray,dn=hn("undefined"),vn=ln("ArrayBuffer"),pn=hn("string"),gn=hn("function"),yn=hn("number"),bn=function(t){return null!==t&&"object"===Zt(t)},mn=function(t){if("object"!==cn(t))return!1;var e=un(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},wn=ln("Date"),kn=ln("File"),An=ln("Blob"),En=ln("FileList"),xn=ln("URLSearchParams"),On=Xt(["ReadableStream","Request","Response","Headers"].map(ln),4),Rn=On[0],Sn=On[1],jn=On[2],Tn=On[3];function _n(t,e){var n,r,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,o=void 0!==i&&i;if(null!=t)if("object"!==Zt(t)&&(t=[t]),fn(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{var a,s=o?Object.getOwnPropertyNames(t):Object.keys(t),u=s.length;for(n=0;n<u;n++)a=s[n],e.call(null,t[a],a,t)}}function Pn(t,e){e=e.toLowerCase();for(var n,r=Object.keys(t),i=r.length;i-- >0;)if(e===(n=r[i]).toLowerCase())return n;return null}var Ln,Cn,Nn,Fn,Dn,$n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Un=function(t){return!dn(t)&&t!==$n},zn=(Ln="undefined"!=typeof Uint8Array&&un(Uint8Array),function(t){return Ln&&t instanceof Ln}),Bn=ln("HTMLFormElement"),qn=function(){var t=Object.prototype.hasOwnProperty;return function(e,n){return t.call(e,n)}}(),In=ln("RegExp"),Mn=function(t,e){var n=Object.getOwnPropertyDescriptors(t),r={};_n(n,(function(n,i){var o;!1!==(o=e(n,i,t))&&(r[i]=o||n)})),Object.defineProperties(t,r)},Hn="abcdefghijklmnopqrstuvwxyz",Jn="0123456789",Wn={DIGIT:Jn,ALPHA:Hn,ALPHA_DIGIT:Hn+Hn.toUpperCase()+Jn},Kn=ln("AsyncFunction"),Gn=(Cn="function"==typeof setImmediate,Nn=gn($n.postMessage),Cn?setImmediate:Nn?(Fn="axios@".concat(Math.random()),Dn=[],$n.addEventListener("message",(function(t){var e=t.source,n=t.data;e===$n&&n===Fn&&Dn.length&&Dn.shift()()}),!1),function(t){Dn.push(t),$n.postMessage(Fn,"*")}):function(t){return setTimeout(t)}),Vn="undefined"!=typeof queueMicrotask?queueMicrotask.bind($n):"undefined"!=typeof process&&process.nextTick||Gn,Xn={isArray:fn,isArrayBuffer:vn,isBuffer:function(t){return null!==t&&!dn(t)&&null!==t.constructor&&!dn(t.constructor)&&gn(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:function(t){var e;return t&&("function"==typeof FormData&&t instanceof FormData||gn(t.append)&&("formdata"===(e=cn(t))||"object"===e&&gn(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&vn(t.buffer)},isString:pn,isNumber:yn,isBoolean:function(t){return!0===t||!1===t},isObject:bn,isPlainObject:mn,isReadableStream:Rn,isRequest:Sn,isResponse:jn,isHeaders:Tn,isUndefined:dn,isDate:wn,isFile:kn,isBlob:An,isRegExp:In,isFunction:gn,isStream:function(t){return bn(t)&&gn(t.pipe)},isURLSearchParams:xn,isTypedArray:zn,isFileList:En,forEach:_n,merge:function t(){for(var e=(Un(this)&&this||{}).caseless,n={},r=function(r,i){var o=e&&Pn(n,i)||i;mn(n[o])&&mn(r)?n[o]=t(n[o],r):mn(r)?n[o]=t({},r):fn(r)?n[o]=r.slice():n[o]=r},i=0,o=arguments.length;i<o;i++)arguments[i]&&_n(arguments[i],r);return n},extend:function(t,e,n){return _n(e,(function(e,r){n&&gn(e)?t[r]=on(e,n):t[r]=e}),{allOwnKeys:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),t},trim:function(t){return t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,e,n,r){t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:function(t,e,n,r){var i,o,a,s={};if(e=e||{},null==t)return e;do{for(o=(i=Object.getOwnPropertyNames(t)).length;o-- >0;)a=i[o],r&&!r(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==n&&un(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:cn,kindOfTest:ln,endsWith:function(t,e,n){t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;var r=t.indexOf(e,n);return-1!==r&&r===n},toArray:function(t){if(!t)return null;if(fn(t))return t;var e=t.length;if(!yn(e))return null;for(var n=new Array(e);e-- >0;)n[e]=t[e];return n},forEachEntry:function(t,e){for(var n,r=(t&&t[Symbol.iterator]).call(t);(n=r.next())&&!n.done;){var i=n.value;e.call(t,i[0],i[1])}},matchAll:function(t,e){for(var n,r=[];null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:Bn,hasOwnProperty:qn,hasOwnProp:qn,reduceDescriptors:Mn,freezeMethods:function(t){Mn(t,(function(e,n){if(gn(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;var r=t[n];gn(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(t,e){var n={},r=function(t){t.forEach((function(t){n[t]=!0}))};return fn(t)?r(t):r(String(t).split(e)),n},toCamelCase:function(t){return t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(t,e){return null!=t&&Number.isFinite(t=+t)?t:e},findKey:Pn,global:$n,isContextDefined:Un,ALPHABET:Wn,generateString:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wn.ALPHA_DIGIT,n="",r=e.length;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&gn(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:function(t){var e=new Array(10),n=function(t,r){if(bn(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;var i=fn(t)?[]:{};return _n(t,(function(t,e){var o=n(t,r+1);!dn(o)&&(i[e]=o)})),e[r]=void 0,i}}return t};return n(t,0)},isAsyncFn:Kn,isThenable:function(t){return t&&(bn(t)||gn(t))&&gn(t.then)&&gn(t.catch)},setImmediate:Gn,asap:Vn};function Qn(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Xn.inherits(Qn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Xn.toJSONObject(this.config),code:this.code,status:this.status}}});var Yn=Qn.prototype,Zn={};function tr(t){return Xn.isPlainObject(t)||Xn.isArray(t)}function er(t){return Xn.endsWith(t,"[]")?t.slice(0,-2):t}function nr(t,e,n){return t?t.concat(e).map((function(t,e){return t=er(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(t){Zn[t]={value:t}})),Object.defineProperties(Qn,Zn),Object.defineProperty(Yn,"isAxiosError",{value:!0}),Qn.from=function(t,e,n,r,i,o){var a=Object.create(Yn);return Xn.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(function(t){return"isAxiosError"!==t})),Qn.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,o&&Object.assign(a,o),a};var rr=Xn.toFlatObject(Xn,{},null,(function(t){return/^is[A-Z]/.test(t)}));function ir(t,e,n){if(!Xn.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;var r=(n=Xn.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Xn.isUndefined(e[t])}))).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Xn.isSpecCompliantForm(e);if(!Xn.isFunction(i))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(Xn.isDate(t))return t.toISOString();if(!s&&Xn.isBlob(t))throw new Qn("Blob is not supported. Use a Buffer instead.");return Xn.isArrayBuffer(t)||Xn.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,n,i){var s=t;if(t&&!i&&"object"===Zt(t))if(Xn.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(Xn.isArray(t)&&function(t){return Xn.isArray(t)&&!t.some(tr)}(t)||(Xn.isFileList(t)||Xn.endsWith(n,"[]"))&&(s=Xn.toArray(t)))return n=er(n),s.forEach((function(t,r){!Xn.isUndefined(t)&&null!==t&&e.append(!0===a?nr([n],r,o):null===a?n:n+"[]",u(t))})),!1;return!!tr(t)||(e.append(nr(i,n,o),u(t)),!1)}var l=[],h=Object.assign(rr,{defaultVisitor:c,convertValue:u,isVisitable:tr});if(!Xn.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!Xn.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Xn.forEach(n,(function(n,o){!0===(!(Xn.isUndefined(n)||null===n)&&i.call(e,n,Xn.isString(o)?o.trim():o,r,h))&&t(n,r?r.concat(o):[o])})),l.pop()}}(t),e}function or(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function ar(t,e){this._pairs=[],t&&ir(t,this,e)}var sr=ar.prototype;function ur(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function cr(t,e,n){if(!e)return t;var r=n&&n.encode||ur;Xn.isFunction(n)&&(n={serialize:n});var i,o=n&&n.serialize;if(i=o?o(e,n):Xn.isURLSearchParams(e)?e.toString():new ar(e,n).toString(r)){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}sr.append=function(t,e){this._pairs.push([t,e])},sr.toString=function(t){var e=t?function(e){return t.call(this,e,or)}:or;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var lr=Ut((function t(){Ft(this,t),this.handlers=[]}),[{key:"use",value:function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(t){this.handlers[t]&&(this.handlers[t]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(t){Xn.forEach(this.handlers,(function(e){null!==e&&t(e)}))}}]),hr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},fr={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ar,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},dr="undefined"!=typeof window&&"undefined"!=typeof document,vr="object"===("undefined"==typeof navigator?"undefined":Zt(navigator))&&navigator||void 0,pr=dr&&(!vr||["ReactNative","NativeScript","NS"].indexOf(vr.product)<0),gr="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,yr=dr&&window.location.href||"http://localhost",br=Kt(Kt({},Object.freeze({__proto__:null,hasBrowserEnv:dr,hasStandardBrowserEnv:pr,hasStandardBrowserWebWorkerEnv:gr,navigator:vr,origin:yr})),fr);function mr(t){function e(t,n,r,i){var o=t[i++];if("__proto__"===o)return!0;var a=Number.isFinite(+o),s=i>=t.length;return o=!o&&Xn.isArray(r)?r.length:o,s?(Xn.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&Xn.isObject(r[o])||(r[o]=[]),e(t,n,r[o],i)&&Xn.isArray(r[o])&&(r[o]=function(t){var e,n,r={},i=Object.keys(t),o=i.length;for(e=0;e<o;e++)r[n=i[e]]=t[n];return r}(r[o])),!a)}if(Xn.isFormData(t)&&Xn.isFunction(t.entries)){var n={};return Xn.forEachEntry(t,(function(t,r){e(function(t){return Xn.matchAll(/\w+|\[(\w*)]/g,t).map((function(t){return"[]"===t[0]?"":t[1]||t[0]}))}(t),r,n,0)})),n}return null}var wr={transitional:hr,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){var n,r=e.getContentType()||"",i=r.indexOf("application/json")>-1,o=Xn.isObject(t);if(o&&Xn.isHTMLForm(t)&&(t=new FormData(t)),Xn.isFormData(t))return i?JSON.stringify(mr(t)):t;if(Xn.isArrayBuffer(t)||Xn.isBuffer(t)||Xn.isStream(t)||Xn.isFile(t)||Xn.isBlob(t)||Xn.isReadableStream(t))return t;if(Xn.isArrayBufferView(t))return t.buffer;if(Xn.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return ir(t,new br.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return br.isNode&&Xn.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((n=Xn.isFileList(t))||r.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return ir(n?{"files[]":t}:t,a&&new a,this.formSerializer)}}return o||i?(e.setContentType("application/json",!1),function(t){if(Xn.isString(t))try{return(0,JSON.parse)(t),Xn.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||wr.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(Xn.isResponse(t)||Xn.isReadableStream(t))return t;if(t&&Xn.isString(t)&&(n&&!this.responseType||r)){var i=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw Qn.from(t,Qn.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:br.classes.FormData,Blob:br.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Xn.forEach(["delete","get","head","post","put","patch"],(function(t){wr.headers[t]={}}));var kr=Xn.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ar=Symbol("internals");function Er(t){return t&&String(t).trim().toLowerCase()}function xr(t){return!1===t||null==t?t:Xn.isArray(t)?t.map(xr):String(t)}function Or(t,e,n,r,i){return Xn.isFunction(r)?r.call(this,e,n):(i&&(e=n),Xn.isString(e)?Xn.isString(r)?-1!==e.indexOf(r):Xn.isRegExp(r)?r.test(e):void 0:void 0)}var Rr=Ut((function t(e){Ft(this,t),e&&this.set(e)}),[{key:"set",value:function(t,e,n){var r=this;function i(t,e,n){var i=Er(e);if(!i)throw new Error("header name must be a non-empty string");var o=Xn.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||e]=xr(t))}var o=function(t,e){return Xn.forEach(t,(function(t,n){return i(t,n,e)}))};if(Xn.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(Xn.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))o(function(t){var e,n,r,i={};return t&&t.split("\n").forEach((function(t){r=t.indexOf(":"),e=t.substring(0,r).trim().toLowerCase(),n=t.substring(r+1).trim(),!e||i[e]&&kr[e]||("set-cookie"===e?i[e]?i[e].push(n):i[e]=[n]:i[e]=i[e]?i[e]+", "+n:n)})),i}(t),e);else if(Xn.isHeaders(t)){var a,s=zt(t.entries());try{for(s.s();!(a=s.n()).done;){var u=Xt(a.value,2),c=u[0];i(u[1],c,n)}}catch(t){s.e(t)}finally{s.f()}}else null!=t&&i(e,t,n);return this}},{key:"get",value:function(t,e){if(t=Er(t)){var n=Xn.findKey(this,t);if(n){var r=this[n];if(!e)return r;if(!0===e)return function(t){for(var e,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;e=r.exec(t);)n[e[1]]=e[2];return n}(r);if(Xn.isFunction(e))return e.call(this,r,n);if(Xn.isRegExp(e))return e.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(t,e){if(t=Er(t)){var n=Xn.findKey(this,t);return!(!n||void 0===this[n]||e&&!Or(0,this[n],n,e))}return!1}},{key:"delete",value:function(t,e){var n=this,r=!1;function i(t){if(t=Er(t)){var i=Xn.findKey(n,t);!i||e&&!Or(0,n[i],i,e)||(delete n[i],r=!0)}}return Xn.isArray(t)?t.forEach(i):i(t),r}},{key:"clear",value:function(t){for(var e=Object.keys(this),n=e.length,r=!1;n--;){var i=e[n];t&&!Or(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}},{key:"normalize",value:function(t){var e=this,n={};return Xn.forEach(this,(function(r,i){var o=Xn.findKey(n,i);if(o)return e[o]=xr(r),void delete e[i];var a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n}))}(i):String(i).trim();a!==i&&delete e[i],e[a]=xr(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.constructor).concat.apply(t,[this].concat(n))}},{key:"toJSON",value:function(t){var e=Object.create(null);return Xn.forEach(this,(function(n,r){null!=n&&!1!==n&&(e[r]=t&&Xn.isArray(n)?n.join(", "):n)})),e}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(t){var e=Xt(t,2);return e[0]+": "+e[1]})).join("\n")}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(t){return t instanceof this?t:new this(t)}},{key:"concat",value:function(t){for(var e=new this(t),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach((function(t){return e.set(t)})),e}},{key:"accessor",value:function(t){var e=(this[Ar]=this[Ar]={accessors:{}}).accessors,n=this.prototype;function r(t){var r=Er(t);e[r]||(function(t,e){var n=Xn.toCamelCase(" "+e);["get","set","has"].forEach((function(r){Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[r]=!0)}return Xn.isArray(t)?t.forEach(r):r(t),this}}]);function Sr(t,e){var n=this||wr,r=e||n,i=Rr.from(r.headers),o=r.data;return Xn.forEach(t,(function(t){o=t.call(n,o,i.normalize(),e?e.status:void 0)})),i.normalize(),o}function jr(t){return!(!t||!t.__CANCEL__)}function Tr(t,e,n){Qn.call(this,null==t?"canceled":t,Qn.ERR_CANCELED,e,n),this.name="CanceledError"}function _r(t,e,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new Qn("Request failed with status code "+n.status,[Qn.ERR_BAD_REQUEST,Qn.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}Rr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Xn.reduceDescriptors(Rr.prototype,(function(t,e){var n=t.value,r=e[0].toUpperCase()+e.slice(1);return{get:function(){return n},set:function(t){this[r]=t}}})),Xn.freezeMethods(Rr),Xn.inherits(Tr,Qn,{__CANCEL__:!0});var Pr=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,i=function(t,e){t=t||10;var n,r=new Array(t),i=new Array(t),o=0,a=0;return e=void 0!==e?e:1e3,function(s){var u=Date.now(),c=i[a];n||(n=u),r[o]=s,i[o]=u;for(var l=a,h=0;l!==o;)h+=r[l++],l%=t;if((o=(o+1)%t)===a&&(a=(a+1)%t),!(u-n<e)){var f=c&&u-c;return f?Math.round(1e3*h/f):void 0}}}(50,250);return function(t,e){var n,r,i=0,o=1e3/e,a=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();i=o,n=null,r&&(clearTimeout(r),r=null),t.apply(null,e)};return[function(){for(var t=Date.now(),e=t-i,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];e>=o?a(u,t):(n=u,r||(r=setTimeout((function(){r=null,a(n)}),o-e)))},function(){return n&&a(n)}]}((function(n){var o=n.loaded,a=n.lengthComputable?n.total:void 0,s=o-r,u=i(s);r=o;var c=Bt({loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&o<=a?(a-o)/u:void 0,event:n,lengthComputable:null!=a},e?"download":"upload",!0);t(c)}),n)},Lr=function(t,e){var n=null!=t;return[function(r){return e[0]({lengthComputable:n,total:t,loaded:r})},e[1]]},Cr=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Xn.asap((function(){return t.apply(void 0,n)}))}},Nr=br.hasStandardBrowserEnv?function(t,e){return function(n){return n=new URL(n,br.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)}}(new URL(br.origin),br.navigator&&/(msie|trident)/i.test(br.navigator.userAgent)):function(){return!0},Fr=br.hasStandardBrowserEnv?{write:function(t,e,n,r,i,o){var a=[t+"="+encodeURIComponent(e)];Xn.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Xn.isString(r)&&a.push("path="+r),Xn.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.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 Dr(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}var $r=function(t){return t instanceof Rr?Kt({},t):t};function Ur(t,e){e=e||{};var n={};function r(t,e,n,r){return Xn.isPlainObject(t)&&Xn.isPlainObject(e)?Xn.merge.call({caseless:r},t,e):Xn.isPlainObject(e)?Xn.merge({},e):Xn.isArray(e)?e.slice():e}function i(t,e,n,i){return Xn.isUndefined(e)?Xn.isUndefined(t)?void 0:r(void 0,t,0,i):r(t,e,0,i)}function o(t,e){if(!Xn.isUndefined(e))return r(void 0,e)}function a(t,e){return Xn.isUndefined(e)?Xn.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function s(n,i,o){return o in e?r(n,i):o in t?r(void 0,n):void 0}var u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(t,e,n){return i($r(t),$r(e),0,!0)}};return Xn.forEach(Object.keys(Object.assign({},t,e)),(function(r){var o=u[r]||i,a=o(t[r],e[r],r);Xn.isUndefined(a)&&o!==s||(n[r]=a)})),n}var zr,Br,qr=function(t){var e,n,r=Ur({},t),i=r.data,o=r.withXSRFToken,a=r.xsrfHeaderName,s=r.xsrfCookieName,u=r.headers,c=r.auth;if(r.headers=u=Rr.from(u),r.url=cr(Dr(r.baseURL,r.url),t.params,t.paramsSerializer),c&&u.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Xn.isFormData(i))if(br.hasStandardBrowserEnv||br.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(!1!==(e=u.getContentType())){var l=e?e.split(";").map((function(t){return t.trim()})).filter(Boolean):[],h=Rt(n=l)||Ht(n)||te(n)||Jt(),f=h[0],d=h.slice(1);u.setContentType([f||"multipart/form-data"].concat(Qt(d)).join("; "))}if(br.hasStandardBrowserEnv&&(o&&Xn.isFunction(o)&&(o=o(r)),o||!1!==o&&Nr(r.url))){var v=a&&s&&Fr.read(s);v&&u.set(a,v)}return r},Ir="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){var r,i,o,a,s,u=qr(t),c=u.data,l=Rr.from(u.headers).normalize(),h=u.responseType,f=u.onUploadProgress,d=u.onDownloadProgress;function v(){a&&a(),s&&s(),u.cancelToken&&u.cancelToken.unsubscribe(r),u.signal&&u.signal.removeEventListener("abort",r)}var p=new XMLHttpRequest;function g(){if(p){var r=Rr.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());_r((function(t){e(t),v()}),(function(t){n(t),v()}),{data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:t,request:p}),p=null}}if(p.open(u.method.toUpperCase(),u.url,!0),p.timeout=u.timeout,"onloadend"in p?p.onloadend=g:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(g)},p.onabort=function(){p&&(n(new Qn("Request aborted",Qn.ECONNABORTED,t,p)),p=null)},p.onerror=function(){n(new Qn("Network Error",Qn.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",r=u.transitional||hr;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),n(new Qn(e,r.clarifyTimeoutError?Qn.ETIMEDOUT:Qn.ECONNABORTED,t,p)),p=null},void 0===c&&l.setContentType(null),"setRequestHeader"in p&&Xn.forEach(l.toJSON(),(function(t,e){p.setRequestHeader(e,t)})),Xn.isUndefined(u.withCredentials)||(p.withCredentials=!!u.withCredentials),h&&"json"!==h&&(p.responseType=u.responseType),d){var y=Xt(Pr(d,!0),2);o=y[0],s=y[1],p.addEventListener("progress",o)}if(f&&p.upload){var b=Xt(Pr(f),2);i=b[0],a=b[1],p.upload.addEventListener("progress",i),p.upload.addEventListener("loadend",a)}(u.cancelToken||u.signal)&&(r=function(e){p&&(n(!e||e.type?new Tr(null,t,p):e),p.abort(),p=null)},u.cancelToken&&u.cancelToken.subscribe(r),u.signal&&(u.signal.aborted?r():u.signal.addEventListener("abort",r)));var m,w,k=(m=u.url,(w=/^([-+\w]{1,25})(:?\/\/|:)/.exec(m))&&w[1]||"");k&&-1===br.protocols.indexOf(k)?n(new Qn("Unsupported protocol "+k+":",Qn.ERR_BAD_REQUEST,t)):p.send(c||null)}))},Mr=function(t,e){var n=(t=t?t.filter(Boolean):[]).length;if(e||n){var r,i=new AbortController,o=function(t){if(!r){r=!0,s();var e=t instanceof Error?t:this.reason;i.abort(e instanceof Qn?e:new Tr(e instanceof Error?e.message:e))}},a=e&&setTimeout((function(){a=null,o(new Qn("timeout ".concat(e," of ms exceeded"),Qn.ETIMEDOUT))}),e),s=function(){t&&(a&&clearTimeout(a),a=null,t.forEach((function(t){t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((function(t){return t.addEventListener("abort",o)}));var u=i.signal;return u.unsubscribe=function(){return Xn.asap(s)},u}},Hr=Gt().mark((function t(e,n){var r,i,o;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.byteLength,n&&!(r<n)){t.next=5;break}return t.next=4,e;case 4:return t.abrupt("return");case 5:i=0;case 6:if(!(i<r)){t.next=13;break}return o=i+n,t.next=10,e.slice(i,o);case 10:i=o,t.next=6;break;case 13:case"end":return t.stop()}}),t)})),Jr=function(){var t=ee(Gt().mark((function t(e,n){var r,i,o,a,s,u;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=!1,i=!1,t.prev=2,a=Tt(Wr(e));case 4:return t.next=6,Ct(a.next());case 6:if(!(r=!(s=t.sent).done)){t.next=12;break}return u=s.value,t.delegateYield(jt(Tt(Hr(u,n))),"t0",9);case 9:r=!1,t.next=4;break;case 12:t.next=18;break;case 14:t.prev=14,t.t1=t.catch(2),i=!0,o=t.t1;case 18:if(t.prev=18,t.prev=19,!r||null==a.return){t.next=23;break}return t.next=23,Ct(a.return());case 23:if(t.prev=23,!i){t.next=26;break}throw o;case 26:return t.finish(23);case 27:return t.finish(18);case 28:case"end":return t.stop()}}),t,null,[[2,14,18,28],[19,,23,27]])})));return function(e,n){return t.apply(this,arguments)}}(),Wr=function(){var t=ee(Gt().mark((function t(e){var n,r,i,o;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e[Symbol.asyncIterator]){t.next=3;break}return t.delegateYield(jt(Tt(e)),"t0",2);case 2:return t.abrupt("return");case 3:n=e.getReader(),t.prev=4;case 5:return t.next=7,Ct(n.read());case 7:if(r=t.sent,i=r.done,o=r.value,!i){t.next=12;break}return t.abrupt("break",16);case 12:return t.next=14,o;case 14:t.next=5;break;case 16:return t.prev=16,t.next=19,Ct(n.cancel());case 19:return t.finish(16);case 20:case"end":return t.stop()}}),t,null,[[4,,16,20]])})));return function(e){return t.apply(this,arguments)}}(),Kr=function(t,e,n,r){var i,o=Jr(t,e),a=0,s=function(t){i||(i=!0,r&&r(t))};return new ReadableStream({pull:function(t){return Lt(Gt().mark((function e(){var r,i,u,c,l;return Gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.next();case 3:if(r=e.sent,i=r.done,u=r.value,!i){e.next=10;break}return s(),t.close(),e.abrupt("return");case 10:c=u.byteLength,n&&(l=a+=c,n(l)),t.enqueue(new Uint8Array(u)),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),s(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,null,[[0,15]])})))()},cancel:function(t){return s(t),o.return()}},{highWaterMark:2})},Gr="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Vr=Gr&&"function"==typeof ReadableStream,Xr=Gr&&("function"==typeof TextEncoder?(zr=new TextEncoder,function(t){return zr.encode(t)}):function(){var t=Lt(Gt().mark((function t(e){return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,new Response(e).arrayBuffer();case 3:return t.t1=t.sent,t.abrupt("return",new t.t0(t.t1));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),Qr=function(t){try{for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!!t.apply(void 0,n)}catch(t){return!1}},Yr=Vr&&Qr((function(){var t=!1,e=new Request(br.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),Zr=Vr&&Qr((function(){return Xn.isReadableStream(new Response("").body)})),ti={stream:Zr&&function(t){return t.body}};Gr&&(Br=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((function(t){!ti[t]&&(ti[t]=Xn.isFunction(Br[t])?function(e){return e[t]()}:function(e,n){throw new Qn("Response type '".concat(t,"' is not supported"),Qn.ERR_NOT_SUPPORT,n)})})));var ei=function(){var t=Lt(Gt().mark((function t(e){var n;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",0);case 2:if(!Xn.isBlob(e)){t.next=4;break}return t.abrupt("return",e.size);case 4:if(!Xn.isSpecCompliantForm(e)){t.next=9;break}return n=new Request(br.origin,{method:"POST",body:e}),t.next=8,n.arrayBuffer();case 8:case 15:return t.abrupt("return",t.sent.byteLength);case 9:if(!Xn.isArrayBufferView(e)&&!Xn.isArrayBuffer(e)){t.next=11;break}return t.abrupt("return",e.byteLength);case 11:if(Xn.isURLSearchParams(e)&&(e+=""),!Xn.isString(e)){t.next=16;break}return t.next=15,Xr(e);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),ni=function(){var t=Lt(Gt().mark((function t(e,n){var r;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Xn.toFiniteNumber(e.getContentLength()),t.abrupt("return",null==r?ei(n):r);case 2:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),ri=Gr&&function(){var t=Lt(Gt().mark((function t(e){var n,r,i,o,a,s,u,c,l,h,f,d,v,p,g,y,b,m,w,k,A,E,x,O,R,S,j,T,_,P,L,C,N,F;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=qr(e),r=n.url,i=n.method,o=n.data,a=n.signal,s=n.cancelToken,u=n.timeout,c=n.onDownloadProgress,l=n.onUploadProgress,h=n.responseType,f=n.headers,d=n.withCredentials,v=void 0===d?"same-origin":d,p=n.fetchOptions,h=h?(h+"").toLowerCase():"text",g=Mr([a,s&&s.toAbortSignal()],u),b=g&&g.unsubscribe&&function(){g.unsubscribe()},t.prev=4,t.t0=l&&Yr&&"get"!==i&&"head"!==i,!t.t0){t.next=11;break}return t.next=9,ni(f,o);case 9:t.t1=m=t.sent,t.t0=0!==t.t1;case 11:if(!t.t0){t.next=15;break}w=new Request(r,{method:"POST",body:o,duplex:"half"}),Xn.isFormData(o)&&(k=w.headers.get("content-type"))&&f.setContentType(k),w.body&&(A=Lr(m,Pr(Cr(l))),E=Xt(A,2),x=E[0],O=E[1],o=Kr(w.body,65536,x,O));case 15:return Xn.isString(v)||(v=v?"include":"omit"),R="credentials"in Request.prototype,y=new Request(r,Kt(Kt({},p),{},{signal:g,method:i.toUpperCase(),headers:f.normalize().toJSON(),body:o,duplex:"half",credentials:R?v:void 0})),t.next=20,fetch(y);case 20:return S=t.sent,j=Zr&&("stream"===h||"response"===h),Zr&&(c||j&&b)&&(T={},["status","statusText","headers"].forEach((function(t){T[t]=S[t]})),_=Xn.toFiniteNumber(S.headers.get("content-length")),P=c&&Lr(_,Pr(Cr(c),!0))||[],L=Xt(P,2),C=L[0],N=L[1],S=new Response(Kr(S.body,65536,C,(function(){N&&N(),b&&b()})),T)),h=h||"text",t.next=26,ti[Xn.findKey(ti,h)||"text"](S,e);case 26:return F=t.sent,!j&&b&&b(),t.next=30,new Promise((function(t,n){_r(t,n,{data:F,headers:Rr.from(S.headers),status:S.status,statusText:S.statusText,config:e,request:y})}));case 30:return t.abrupt("return",t.sent);case 33:if(t.prev=33,t.t2=t.catch(4),b&&b(),!t.t2||"TypeError"!==t.t2.name||!/fetch/i.test(t.t2.message)){t.next=38;break}throw Object.assign(new Qn("Network Error",Qn.ERR_NETWORK,e,y),{cause:t.t2.cause||t.t2});case 38:throw Qn.from(t.t2,t.t2&&t.t2.code,e,y);case 39:case"end":return t.stop()}}),t,null,[[4,33]])})));return function(e){return t.apply(this,arguments)}}(),ii={http:null,xhr:Ir,fetch:ri};Xn.forEach(ii,(function(t,e){if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));var oi=function(t){return"- ".concat(t)},ai=function(t){return Xn.isFunction(t)||null===t||!1===t},si=function(t){for(var e,n,r=(t=Xn.isArray(t)?t:[t]).length,i={},o=0;o<r;o++){var a=void 0;if(n=e=t[o],!ai(e)&&void 0===(n=ii[(a=String(e)).toLowerCase()]))throw new Qn("Unknown adapter '".concat(a,"'"));if(n)break;i[a||"#"+o]=n}if(!n){var s=Object.entries(i).map((function(t){var e=Xt(t,2),n=e[0],r=e[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")}));throw new Qn("There is no suitable adapter to dispatch the request "+(r?s.length>1?"since :\n"+s.map(oi).join("\n"):" "+oi(s[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function ui(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Tr(null,t)}function ci(t){return ui(t),t.headers=Rr.from(t.headers),t.data=Sr.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),si(t.adapter||wr.adapter)(t).then((function(e){return ui(t),e.data=Sr.call(t,t.transformResponse,e),e.headers=Rr.from(e.headers),e}),(function(e){return jr(e)||(ui(t),e&&e.response&&(e.response.data=Sr.call(t,t.transformResponse,e.response),e.response.headers=Rr.from(e.response.headers))),Promise.reject(e)}))}var li={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){li[t]=function(n){return Zt(n)===t||"a"+(e<1?"n ":" ")+t}}));var hi={};li.transitional=function(t,e,n){function r(t,e){return"[Axios v1.7.9] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,i,o){if(!1===t)throw new Qn(r(i," has been removed"+(e?" in "+e:"")),Qn.ERR_DEPRECATED);return e&&!hi[i]&&(hi[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,o)}},li.spelling=function(t){return function(e,n){return console.warn("".concat(n," is likely a misspelling of ").concat(t)),!0}};var fi={assertOptions:function(t,e,n){if("object"!==Zt(t))throw new Qn("options must be an object",Qn.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),i=r.length;i-- >0;){var o=r[i],a=e[o];if(a){var s=t[o],u=void 0===s||a(s,o,t);if(!0!==u)throw new Qn("option "+o+" must be "+u,Qn.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Qn("Unknown option "+o,Qn.ERR_BAD_OPTION)}},validators:li},di=fi.validators,vi=function(){return Ut((function t(e){Ft(this,t),this.defaults=e,this.interceptors={request:new lr,response:new lr}}),[{key:"request",value:(t=Lt(Gt().mark((function t(e,n){var r,i;return Gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._request(e,n);case 3:return t.abrupt("return",t.sent);case 6:if(t.prev=6,t.t0=t.catch(0),t.t0 instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=r.stack?r.stack.replace(/^.+\n/,""):"";try{t.t0.stack?i&&!String(t.t0.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.t0.stack+="\n"+i):t.t0.stack=i}catch(t){}}throw t.t0;case 10:case"end":return t.stop()}}),t,this,[[0,6]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_request",value:function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{};var n=e=Ur(this.defaults,e),r=n.transitional,i=n.paramsSerializer,o=n.headers;void 0!==r&&fi.assertOptions(r,{silentJSONParsing:di.transitional(di.boolean),forcedJSONParsing:di.transitional(di.boolean),clarifyTimeoutError:di.transitional(di.boolean)},!1),null!=i&&(Xn.isFunction(i)?e.paramsSerializer={serialize:i}:fi.assertOptions(i,{encode:di.function,serialize:di.function},!0)),fi.assertOptions(e,{baseUrl:di.spelling("baseURL"),withXsrfToken:di.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();var a=o&&Xn.merge(o.common,o[e.method]);o&&Xn.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete o[t]})),e.headers=Rr.concat(a,o);var s=[],u=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(u=u&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));var c,l=[];this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)}));var h,f=0;if(!u){var d=[ci.bind(this),void 0];for(d.unshift.apply(d,s),d.push.apply(d,l),h=d.length,c=Promise.resolve(e);f<h;)c=c.then(d[f++],d[f++]);return c}h=s.length;var v=e;for(f=0;f<h;){var p=s[f++],g=s[f++];try{v=p(v)}catch(t){g.call(this,t);break}}try{c=ci.call(this,v)}catch(t){return Promise.reject(t)}for(f=0,h=l.length;f<h;)c=c.then(l[f++],l[f++]);return c}},{key:"getUri",value:function(t){return cr(Dr((t=Ur(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}]);var t}();Xn.forEach(["delete","get","head","options"],(function(t){vi.prototype[t]=function(e,n){return this.request(Ur(n||{},{method:t,url:e,data:(n||{}).data}))}})),Xn.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request(Ur(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}vi.prototype[t]=e(),vi.prototype[t+"Form"]=e(!0)}));var pi=function(){function t(e){if(Ft(this,t),"function"!=typeof e)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(t){n=t}));var r=this;this.promise.then((function(t){if(r._listeners){for(var e=r._listeners.length;e-- >0;)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},e((function(t,e,i){r.reason||(r.reason=new Tr(t,e,i),n(r.reason))}))}return Ut(t,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}},{key:"unsubscribe",value:function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}}},{key:"toAbortSignal",value:function(){var t=this,e=new AbortController,n=function(t){e.abort(t)};return this.subscribe(n),e.signal.unsubscribe=function(){return t.unsubscribe(n)},e.signal}}],[{key:"source",value:function(){var e;return{token:new t((function(t){e=t})),cancel:e}}}])}(),gi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(gi).forEach((function(t){var e=Xt(t,2),n=e[0],r=e[1];gi[r]=n}));var yi=function t(e){var n=new vi(e),r=on(vi.prototype.request,n);return Xn.extend(r,vi.prototype,n,{allOwnKeys:!0}),Xn.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(Ur(e,n))},r}(wr);yi.Axios=vi,yi.CanceledError=Tr,yi.CancelToken=pi,yi.isCancel=jr,yi.VERSION="1.7.9",yi.toFormData=ir,yi.AxiosError=Qn,yi.Cancel=yi.CanceledError,yi.all=function(t){return Promise.all(t)},yi.spread=function(t){return function(e){return t.apply(null,e)}},yi.isAxiosError=function(t){return Xn.isObject(t)&&!0===t.isAxiosError},yi.mergeConfig=Ur,yi.AxiosHeaders=Rr,yi.formToJSON=function(t){return mr(Xn.isHTMLForm(t)?new FormData(t):t)},yi.getAdapter=si,yi.HttpStatusCode=gi,yi.default=yi,yi.Axios,yi.AxiosError,yi.CanceledError,yi.isCancel,yi.CancelToken,yi.VERSION,yi.all,yi.Cancel,yi.isAxiosError,yi.spread,yi.toFormData,yi.AxiosHeaders,yi.HttpStatusCode,yi.formToJSON,yi.getAdapter,yi.mergeConfig;var bi=function(){function t(e){var n;return Ft(this,t),(n=Nt(this,t,[e])).axiosInstance=yi.create({baseURL:"".concat(n.host,"/").concat(n.namespace),headers:{Authorization:"Bearer ".concat(e.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;node"}}),n.axiosInstance.interceptors.response.use((function(t){return t.data}),(function(t){if(t.response){var e=t.response.data;if(de(e.errors)&&e.errors.length)throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t})),n}return It(t,nn),Ut(t,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.axiosInstance.defaults.headers.common=Kt(Kt({},this.axiosInstance.defaults.headers.common),t),this}},{key:"request",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axiosInstance.request(Kt({method:t,url:e},n))}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("GET",t,Kt({params:e},n))}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("POST",t,Kt({data:e},n))}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PUT",t,Kt({data:e},n))}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("DELETE",t,e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PATCH",t,Kt({data:e},n))}}])}();ce("adapter","NodeAdapter",bi);var mi=function(){function t(){return Ft(this,t),Nt(this,t,arguments)}return It(t,nn),Ut(t)}();ce("adapter","EmberJsAdapter",mi),function(){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Ft(this,t),this.version=null!==(n=o.version)&&void 0!==n?n:"v1",this.options={version:this.version,host:null!==(r=o.host)&&void 0!==r?r:"https://api.fleetbase.io",namespace:null!==(i=o.namespace)&&void 0!==i?i:this.version,debug:a,publicKey:e},"string"!=typeof e||0===e.length)throw new Error("⚠️ Invalid public key given to Fleetbase SDK");if(!Re()&&e.toLowerCase().startsWith("$"))throw new Error("Secret key provided. You must use a public key with Fleetbase Javascript SDK!");this.adapter=o.adapter||Se(this.options),this.orders=new Fe("order",this.adapter).extendActions(De),this.entities=new Fe("entity",this.adapter),this.places=new Fe("place",this.adapter),this.drivers=new Fe("driver",this.adapter).extendActions(Ke),this.vehicles=new Fe("vehicle",this.adapter),this.vendors=new Fe("vendor",this.adapter),this.contacts=new Fe("contact",this.adapter),this.serviceAreas=new Fe("service-area",this.adapter),this.zones=new Fe("zone",this.adapter),this.fleets=new Fe("fleet",this.adapter),this.organizations=new Fe("organization",this.adapter).extendActions(He)}Ut(t,[{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return Dt(t,Array.prototype.slice.call(arguments))}}])}();var wi=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"vehicle",r])}return m(e,t),p(e,[{key:"isOnline",get:function(){return!0===this.getAttribute("online")}},{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new je))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new je))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}}])}(pt);B("resource","Vehicle",wi);var ki=new dt({current:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.adapter.get("".concat(this.namespace,"/current"),t,e)}}),Ai=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"organization",x({actions:ki},r)])}return m(e,t),p(e)}(pt);B("resource","Organization",Ai);var Ei=function(t,e){return W(t)?t.map((function(t){return new Ai(t,e)})):new Ai(t,e)},xi=new dt({login:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(function(){return/^[+]?[\s./0-9]*[(]?[0-9]{1,4}[)]?[-\s./0-9]*$/g.test(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}(t))return this.adapter.post("drivers/login-with-sms",{phone:t});if(!e)throw new Error("Login requires password!");return this.adapter.post("drivers/login",x({identity:t,password:e},n)).then(this.afterFetch.bind(this))},verifyCode:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/verify-code",x({identity:t,code:e},n)).then(this.afterFetch.bind(this))},track:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/track"),e,n).then(this.afterFetch.bind(this))},listOrganizations:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("drivers/".concat(t,"/organizations"),n,r).then((function(t){return Ei(t,e.adapter)}))},switchOrganization:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/switch-organization"),n,r).then((function(t){return Ei(t,e.adapter)}))},currentOrganization:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.get("drivers/".concat(t,"/current-organization"),n,r).then((function(t){return Ei(t,e.adapter)}))},retrieve:function(t){return this.findRecord(t)},syncDevice:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.adapter.post("drivers/".concat(t,"/register-device"),e,n)}}),Oi=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"driver",x({actions:xi},r)])}return m(e,t),p(e,[{key:"token",get:function(){return this.getAttribute("token")}},{key:"isOnline",get:function(){return!0===this.getAttribute("online")}},{key:"latitude",get:function(){var t;return null===(t=this.getAttribute("location",new ut))||void 0===t?void 0:t.coordinates[1]}},{key:"longitude",get:function(){var t;return null===(t=this.getAttribute("location",new ut))||void 0===t?void 0:t.coordinates[0]}},{key:"coordinates",get:function(){return[this.latitude,this.longitude]}},{key:"track",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.track(this.id,t,e)}},{key:"syncDevice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.syncDevice(this.id,t,e)}},{key:"listOrganizations",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.listOrganizations(this.id,t,e)}},{key:"switchOrganization",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.switchOrganization(this.id,{next:t},e)}},{key:"currentOrganization",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.currentOrganization(this.id,t,e)}}])}(pt);B("resource","Driver",Oi);var Ri=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"vendor",r])}return m(e,t),p(e)}(pt);B("resource","Vendor",Ri);var Si=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"contact",r])}return m(e,t),p(e)}(pt);B("resource","Contact",Si);var ji=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"zone",r])}return m(e,t),p(e)}(pt);B("resource","Zone",ji);var Ti=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"service-area",r])}return m(e,t),p(e)}(pt);B("resource","ServiceArea",Ti);var _i=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"service-rate",r])}return m(e,t),p(e)}(pt);B("resource","ServiceRate",_i),new dt({fromPayload:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return vt(t)&&(t=t.id),this.adapter.get("".concat(this.namespace),x({payload:t},e)).then(this.afterFetch.bind(this))},fromPreliminary:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.adapter.get("".concat(this.namespace,"/preliminary"),x({},t)).then(this.afterFetch.bind(this))}});var Pi=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"service-quote",r])}return m(e,t),p(e,[{key:"fromPreliminary",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.store.fromPreliminary(t)}},{key:"fromPayload",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.store.fromPayload(t,e)}}])}(pt);B("resource","ServiceQuote",Pi);var Li=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f(this,e),h(this,e,[t,n,"fleet",r])}return m(e,t),p(e)}(pt);B("resource","Fleet",Li);var Ci=p((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};f(this,t),this.version=e.version||"v1",this.host=e.host||null,this.namespace=e.namespace||null,this.headers=e.headers||{}}));B("adapter","Adapter",Ci);var Ni=function(t){function e(t){var n;return f(this,e),(n=h(this,e,[t])).setHeaders({Authorization:"Bearer ".concat(t.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;browser"}),n}return m(e,t),p(e,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.headers=x(x({},this.headers),t),this}},{key:"parseJSON",value:function(t){return new Promise((function(e,n){t.json().then((function(n){e({statusText:t.statusText,status:t.status,ok:t.ok,json:n})})).catch((function(){n(new Error("Oops! Something went wrong when handling your request."))}))}))}},{key:"request",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return new Promise((function(o,a){fetch(i.url||"".concat(e.host,"/").concat(e.namespace,"/").concat(t),x({method:n,mode:i.mode||"cors",headers:new Headers(x(x({},e.headers||{}),i.headers||{}))},r)).then(e.parseJSON).then((function(t){if(t.ok)return o(t.json);a(new Error(t.json.errors?t.json.errors[0]:t.statusText))})).catch((function(t){a(t)}))}))}},{key:"get",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=it(e=n)||"string"==typeof e&&!1===/\S/.test(e)?"":new URLSearchParams(n).toString();return this.request("".concat(t).concat(i?"?".concat(i):""),"GET",{},r)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"POST",{body:JSON.stringify(e)},n)}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PUT",{body:JSON.stringify(e)},n)}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(t,"DELETE",{},e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(t,"PATCH",{body:JSON.stringify(e)},n)}}])}(Ci);function Fi(t,e){return function(){return t.apply(e,arguments)}}B("adapter","BrowserAdapter",Ni);var Di,$i=Object.prototype.toString,Ui=Object.getPrototypeOf,zi=(Di=Object.create(null),function(t){var e=$i.call(t);return Di[e]||(Di[e]=e.slice(8,-1).toLowerCase())}),Bi=function(t){return t=t.toLowerCase(),function(e){return zi(e)===t}},qi=function(t){return function(e){return _(e)===t}},Ii=Array.isArray,Mi=qi("undefined");var Hi=Bi("ArrayBuffer");var Ji=qi("string"),Wi=qi("function"),Ki=qi("number"),Gi=function(t){return null!==t&&"object"===_(t)},Vi=function(t){if("object"!==zi(t))return!1;var e=Ui(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},Xi=Bi("Date"),Qi=Bi("File"),Yi=Bi("Blob"),Zi=Bi("FileList"),to=Bi("URLSearchParams"),eo=S(["ReadableStream","Request","Response","Headers"].map(Bi),4),no=eo[0],ro=eo[1],io=eo[2],oo=eo[3];function ao(t,e){var n,r,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).allOwnKeys,o=void 0!==i&&i;if(null!=t)if("object"!==_(t)&&(t=[t]),Ii(t))for(n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else{var a,s=o?Object.getOwnPropertyNames(t):Object.keys(t),u=s.length;for(n=0;n<u;n++)a=s[n],e.call(null,t[a],a,t)}}function so(t,e){e=e.toLowerCase();for(var n,r=Object.keys(t),i=r.length;i-- >0;)if(e===(n=r[i]).toLowerCase())return n;return null}var uo="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,co=function(t){return!Mi(t)&&t!==uo};var lo,ho=(lo="undefined"!=typeof Uint8Array&&Ui(Uint8Array),function(t){return lo&&t instanceof lo}),fo=Bi("HTMLFormElement"),vo=function(){var t=Object.prototype.hasOwnProperty;return function(e,n){return t.call(e,n)}}(),po=Bi("RegExp"),go=function(t,e){var n=Object.getOwnPropertyDescriptors(t),r={};ao(n,(function(n,i){var o;!1!==(o=e(n,i,t))&&(r[i]=o||n)})),Object.defineProperties(t,r)},yo="abcdefghijklmnopqrstuvwxyz",bo="0123456789",mo={DIGIT:bo,ALPHA:yo,ALPHA_DIGIT:yo+yo.toUpperCase()+bo};var wo,ko,Ao,Eo,xo=Bi("AsyncFunction"),Oo=(wo="function"==typeof setImmediate,ko=Wi(uo.postMessage),wo?setImmediate:ko?(Ao="axios@".concat(Math.random()),Eo=[],uo.addEventListener("message",(function(t){var e=t.source,n=t.data;e===uo&&n===Ao&&Eo.length&&Eo.shift()()}),!1),function(t){Eo.push(t),uo.postMessage(Ao,"*")}):function(t){return setTimeout(t)}),Ro="undefined"!=typeof queueMicrotask?queueMicrotask.bind(uo):"undefined"!=typeof process&&process.nextTick||Oo,So={isArray:Ii,isArrayBuffer:Hi,isBuffer:function(t){return null!==t&&!Mi(t)&&null!==t.constructor&&!Mi(t.constructor)&&Wi(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:function(t){var e;return t&&("function"==typeof FormData&&t instanceof FormData||Wi(t.append)&&("formdata"===(e=zi(t))||"object"===e&&Wi(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&Hi(t.buffer)},isString:Ji,isNumber:Ki,isBoolean:function(t){return!0===t||!1===t},isObject:Gi,isPlainObject:Vi,isReadableStream:no,isRequest:ro,isResponse:io,isHeaders:oo,isUndefined:Mi,isDate:Xi,isFile:Qi,isBlob:Yi,isRegExp:po,isFunction:Wi,isStream:function(t){return Gi(t)&&Wi(t.pipe)},isURLSearchParams:to,isTypedArray:ho,isFileList:Zi,forEach:ao,merge:function t(){for(var e=(co(this)&&this||{}).caseless,n={},r=function(r,i){var o=e&&so(n,i)||i;Vi(n[o])&&Vi(r)?n[o]=t(n[o],r):Vi(r)?n[o]=t({},r):Ii(r)?n[o]=r.slice():n[o]=r},i=0,o=arguments.length;i<o;i++)arguments[i]&&ao(arguments[i],r);return n},extend:function(t,e,n){return ao(e,(function(e,r){n&&Wi(e)?t[r]=Fi(e,n):t[r]=e}),{allOwnKeys:(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).allOwnKeys}),t},trim:function(t){return t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t},inherits:function(t,e,n,r){t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:function(t,e,n,r){var i,o,a,s={};if(e=e||{},null==t)return e;do{for(o=(i=Object.getOwnPropertyNames(t)).length;o-- >0;)a=i[o],r&&!r(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==n&&Ui(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:zi,kindOfTest:Bi,endsWith:function(t,e,n){t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;var r=t.indexOf(e,n);return-1!==r&&r===n},toArray:function(t){if(!t)return null;if(Ii(t))return t;var e=t.length;if(!Ki(e))return null;for(var n=new Array(e);e-- >0;)n[e]=t[e];return n},forEachEntry:function(t,e){for(var n,r=(t&&t[Symbol.iterator]).call(t);(n=r.next())&&!n.done;){var i=n.value;e.call(t,i[0],i[1])}},matchAll:function(t,e){for(var n,r=[];null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:fo,hasOwnProperty:vo,hasOwnProp:vo,reduceDescriptors:go,freezeMethods:function(t){go(t,(function(e,n){if(Wi(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;var r=t[n];Wi(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(t,e){var n={},r=function(t){t.forEach((function(t){n[t]=!0}))};return Ii(t)?r(t):r(String(t).split(e)),n},toCamelCase:function(t){return t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(t,e){return null!=t&&Number.isFinite(t=+t)?t:e},findKey:so,global:uo,isContextDefined:co,ALPHABET:mo,generateString:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mo.ALPHA_DIGIT,n="",r=e.length;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&Wi(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:function(t){var e=new Array(10),n=function(t,r){if(Gi(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;var i=Ii(t)?[]:{};return ao(t,(function(t,e){var o=n(t,r+1);!Mi(o)&&(i[e]=o)})),e[r]=void 0,i}}return t};return n(t,0)},isAsyncFn:xo,isThenable:function(t){return t&&(Gi(t)||Wi(t))&&Wi(t.then)&&Wi(t.catch)},setImmediate:Oo,asap:Ro};function jo(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}So.inherits(jo,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:So.toJSONObject(this.config),code:this.code,status:this.status}}});var To=jo.prototype,_o={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(t){_o[t]={value:t}})),Object.defineProperties(jo,_o),Object.defineProperty(To,"isAxiosError",{value:!0}),jo.from=function(t,e,n,r,i,o){var a=Object.create(To);return So.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(function(t){return"isAxiosError"!==t})),jo.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,o&&Object.assign(a,o),a};function Po(t){return So.isPlainObject(t)||So.isArray(t)}function Lo(t){return So.endsWith(t,"[]")?t.slice(0,-2):t}function Co(t,e,n){return t?t.concat(e).map((function(t,e){return t=Lo(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}var No=So.toFlatObject(So,{},null,(function(t){return/^is[A-Z]/.test(t)}));function Fo(t,e,n){if(!So.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;var r=(n=So.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!So.isUndefined(e[t])}))).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&So.isSpecCompliantForm(e);if(!So.isFunction(i))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(So.isDate(t))return t.toISOString();if(!s&&So.isBlob(t))throw new jo("Blob is not supported. Use a Buffer instead.");return So.isArrayBuffer(t)||So.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,n,i){var s=t;if(t&&!i&&"object"===_(t))if(So.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(So.isArray(t)&&function(t){return So.isArray(t)&&!t.some(Po)}(t)||(So.isFileList(t)||So.endsWith(n,"[]"))&&(s=So.toArray(t)))return n=Lo(n),s.forEach((function(t,r){!So.isUndefined(t)&&null!==t&&e.append(!0===a?Co([n],r,o):null===a?n:n+"[]",u(t))})),!1;return!!Po(t)||(e.append(Co(i,n,o),u(t)),!1)}var l=[],h=Object.assign(No,{defaultVisitor:c,convertValue:u,isVisitable:Po});if(!So.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!So.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),So.forEach(n,(function(n,o){!0===(!(So.isUndefined(n)||null===n)&&i.call(e,n,So.isString(o)?o.trim():o,r,h))&&t(n,r?r.concat(o):[o])})),l.pop()}}(t),e}function Do(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function $o(t,e){this._pairs=[],t&&Fo(t,this,e)}var Uo=$o.prototype;function zo(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Bo(t,e,n){if(!e)return t;var r=n&&n.encode||zo;So.isFunction(n)&&(n={serialize:n});var i,o=n&&n.serialize;if(i=o?o(e,n):So.isURLSearchParams(e)?e.toString():new $o(e,n).toString(r)){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}Uo.append=function(t,e){this._pairs.push([t,e])},Uo.toString=function(t){var e=t?function(e){return t.call(this,e,Do)}:Do;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};var qo=function(){return p((function t(){f(this,t),this.handlers=[]}),[{key:"use",value:function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(t){this.handlers[t]&&(this.handlers[t]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(t){So.forEach(this.handlers,(function(e){null!==e&&t(e)}))}}])}(),Io={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Mo={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:$o,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Ho="undefined"!=typeof window&&"undefined"!=typeof document,Jo="object"===("undefined"==typeof navigator?"undefined":_(navigator))&&navigator||void 0,Wo=Ho&&(!Jo||["ReactNative","NativeScript","NS"].indexOf(Jo.product)<0),Ko="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Go=Ho&&window.location.href||"http://localhost",Vo=x(x({},Object.freeze({__proto__:null,hasBrowserEnv:Ho,hasStandardBrowserEnv:Wo,hasStandardBrowserWebWorkerEnv:Ko,navigator:Jo,origin:Go})),Mo);function Xo(t){function e(t,n,r,i){var o=t[i++];if("__proto__"===o)return!0;var a=Number.isFinite(+o),s=i>=t.length;return o=!o&&So.isArray(r)?r.length:o,s?(So.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&So.isObject(r[o])||(r[o]=[]),e(t,n,r[o],i)&&So.isArray(r[o])&&(r[o]=function(t){var e,n,r={},i=Object.keys(t),o=i.length;for(e=0;e<o;e++)r[n=i[e]]=t[n];return r}(r[o])),!a)}if(So.isFormData(t)&&So.isFunction(t.entries)){var n={};return So.forEachEntry(t,(function(t,r){e(function(t){return So.matchAll(/\w+|\[(\w*)]/g,t).map((function(t){return"[]"===t[0]?"":t[1]||t[0]}))}(t),r,n,0)})),n}return null}var Qo={transitional:Io,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){var n,r=e.getContentType()||"",i=r.indexOf("application/json")>-1,o=So.isObject(t);if(o&&So.isHTMLForm(t)&&(t=new FormData(t)),So.isFormData(t))return i?JSON.stringify(Xo(t)):t;if(So.isArrayBuffer(t)||So.isBuffer(t)||So.isStream(t)||So.isFile(t)||So.isBlob(t)||So.isReadableStream(t))return t;if(So.isArrayBufferView(t))return t.buffer;if(So.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Fo(t,new Vo.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return Vo.isNode&&So.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((n=So.isFileList(t))||r.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return Fo(n?{"files[]":t}:t,a&&new a,this.formSerializer)}}return o||i?(e.setContentType("application/json",!1),function(t,e){if(So.isString(t))try{return(e||JSON.parse)(t),So.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional||Qo.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(So.isResponse(t)||So.isReadableStream(t))return t;if(t&&So.isString(t)&&(n&&!this.responseType||r)){var i=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(i){if("SyntaxError"===t.name)throw jo.from(t,jo.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Vo.classes.FormData,Blob:Vo.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};So.forEach(["delete","get","head","post","put","patch"],(function(t){Qo.headers[t]={}}));var Yo=So.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Zo=Symbol("internals");function ta(t){return t&&String(t).trim().toLowerCase()}function ea(t){return!1===t||null==t?t:So.isArray(t)?t.map(ea):String(t)}function na(t,e,n,r,i){return So.isFunction(r)?r.call(this,e,n):(i&&(e=n),So.isString(e)?So.isString(r)?-1!==e.indexOf(r):So.isRegExp(r)?r.test(e):void 0:void 0)}var ra=function(){return p((function t(e){f(this,t),e&&this.set(e)}),[{key:"set",value:function(t,e,n){var r=this;function i(t,e,n){var i=ta(e);if(!i)throw new Error("header name must be a non-empty string");var o=So.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||e]=ea(t))}var o=function(t,e){return So.forEach(t,(function(t,n){return i(t,n,e)}))};if(So.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(So.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))o(function(t){var e,n,r,i={};return t&&t.split("\n").forEach((function(t){r=t.indexOf(":"),e=t.substring(0,r).trim().toLowerCase(),n=t.substring(r+1).trim(),!e||i[e]&&Yo[e]||("set-cookie"===e?i[e]?i[e].push(n):i[e]=[n]:i[e]=i[e]?i[e]+", "+n:n)})),i}(t),e);else if(So.isHeaders(t)){var a,s=g(t.entries());try{for(s.s();!(a=s.n()).done;){var u=S(a.value,2),c=u[0];i(u[1],c,n)}}catch(t){s.e(t)}finally{s.f()}}else null!=t&&i(e,t,n);return this}},{key:"get",value:function(t,e){if(t=ta(t)){var n=So.findKey(this,t);if(n){var r=this[n];if(!e)return r;if(!0===e)return function(t){for(var e,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;e=r.exec(t);)n[e[1]]=e[2];return n}(r);if(So.isFunction(e))return e.call(this,r,n);if(So.isRegExp(e))return e.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(t,e){if(t=ta(t)){var n=So.findKey(this,t);return!(!n||void 0===this[n]||e&&!na(0,this[n],n,e))}return!1}},{key:"delete",value:function(t,e){var n=this,r=!1;function i(t){if(t=ta(t)){var i=So.findKey(n,t);!i||e&&!na(0,n[i],i,e)||(delete n[i],r=!0)}}return So.isArray(t)?t.forEach(i):i(t),r}},{key:"clear",value:function(t){for(var e=Object.keys(this),n=e.length,r=!1;n--;){var i=e[n];t&&!na(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}},{key:"normalize",value:function(t){var e=this,n={};return So.forEach(this,(function(r,i){var o=So.findKey(n,i);if(o)return e[o]=ea(r),void delete e[i];var a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n}))}(i):String(i).trim();a!==i&&delete e[i],e[a]=ea(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.constructor).concat.apply(t,[this].concat(n))}},{key:"toJSON",value:function(t){var e=Object.create(null);return So.forEach(this,(function(n,r){null!=n&&!1!==n&&(e[r]=t&&So.isArray(n)?n.join(", "):n)})),e}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(t){var e=S(t,2);return e[0]+": "+e[1]})).join("\n")}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(t){return t instanceof this?t:new this(t)}},{key:"concat",value:function(t){for(var e=new this(t),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.forEach((function(t){return e.set(t)})),e}},{key:"accessor",value:function(t){var e=(this[Zo]=this[Zo]={accessors:{}}).accessors,n=this.prototype;function r(t){var r=ta(t);e[r]||(!function(t,e){var n=So.toCamelCase(" "+e);["get","set","has"].forEach((function(r){Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[r]=!0)}return So.isArray(t)?t.forEach(r):r(t),this}}])}();function ia(t,e){var n=this||Qo,r=e||n,i=ra.from(r.headers),o=r.data;return So.forEach(t,(function(t){o=t.call(n,o,i.normalize(),e?e.status:void 0)})),i.normalize(),o}function oa(t){return!(!t||!t.__CANCEL__)}function aa(t,e,n){jo.call(this,null==t?"canceled":t,jo.ERR_CANCELED,e,n),this.name="CanceledError"}function sa(t,e,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new jo("Request failed with status code "+n.status,[jo.ERR_BAD_REQUEST,jo.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}ra.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),So.reduceDescriptors(ra.prototype,(function(t,e){var n=t.value,r=e[0].toUpperCase()+e.slice(1);return{get:function(){return n},set:function(t){this[r]=t}}})),So.freezeMethods(ra),So.inherits(aa,jo,{__CANCEL__:!0});var ua=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,i=function(t,e){t=t||10;var n,r=new Array(t),i=new Array(t),o=0,a=0;return e=void 0!==e?e:1e3,function(s){var u=Date.now(),c=i[a];n||(n=u),r[o]=s,i[o]=u;for(var l=a,h=0;l!==o;)h+=r[l++],l%=t;if((o=(o+1)%t)===a&&(a=(a+1)%t),!(u-n<e)){var f=c&&u-c;return f?Math.round(1e3*h/f):void 0}}}(50,250);return function(t,e){var n,r,i=0,o=1e3/e,a=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();i=o,n=null,r&&(clearTimeout(r),r=null),t.apply(null,e)};return[function(){for(var t=Date.now(),e=t-i,s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];e>=o?a(u,t):(n=u,r||(r=setTimeout((function(){r=null,a(n)}),o-e)))},function(){return n&&a(n)}]}((function(n){var o=n.loaded,a=n.lengthComputable?n.total:void 0,s=o-r,u=i(s);r=o;var c=y({loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&o<=a?(a-o)/u:void 0,event:n,lengthComputable:null!=a},e?"download":"upload",!0);t(c)}),n)},ca=function(t,e){var n=null!=t;return[function(r){return e[0]({lengthComputable:n,total:t,loaded:r})},e[1]]},la=function(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return So.asap((function(){return t.apply(void 0,n)}))}},ha=Vo.hasStandardBrowserEnv?function(t,e){return function(n){return n=new URL(n,Vo.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)}}(new URL(Vo.origin),Vo.navigator&&/(msie|trident)/i.test(Vo.navigator.userAgent)):function(){return!0},fa=Vo.hasStandardBrowserEnv?{write:function(t,e,n,r,i,o){var a=[t+"="+encodeURIComponent(e)];So.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),So.isString(r)&&a.push("path="+r),So.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.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 da(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}var va=function(t){return t instanceof ra?x({},t):t};function pa(t,e){e=e||{};var n={};function r(t,e,n,r){return So.isPlainObject(t)&&So.isPlainObject(e)?So.merge.call({caseless:r},t,e):So.isPlainObject(e)?So.merge({},e):So.isArray(e)?e.slice():e}function i(t,e,n,i){return So.isUndefined(e)?So.isUndefined(t)?void 0:r(void 0,t,0,i):r(t,e,0,i)}function o(t,e){if(!So.isUndefined(e))return r(void 0,e)}function a(t,e){return So.isUndefined(e)?So.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function s(n,i,o){return o in e?r(n,i):o in t?r(void 0,n):void 0}var u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(t,e,n){return i(va(t),va(e),0,!0)}};return So.forEach(Object.keys(Object.assign({},t,e)),(function(r){var o=u[r]||i,a=o(t[r],e[r],r);So.isUndefined(a)&&o!==s||(n[r]=a)})),n}var ga,ya,ba=function(t){var e,n=pa({},t),i=n.data,o=n.withXSRFToken,a=n.xsrfHeaderName,s=n.xsrfCookieName,u=n.headers,c=n.auth;if(n.headers=u=ra.from(u),n.url=Bo(da(n.baseURL,n.url),t.params,t.paramsSerializer),c&&u.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),So.isFormData(i))if(Vo.hasStandardBrowserEnv||Vo.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(!1!==(e=u.getContentType())){var l=e?e.split(";").map((function(t){return t.trim()})).filter(Boolean):[],h=function(t){return r(t)||k(t)||P(t)||A()}(l),f=h[0],d=h.slice(1);u.setContentType([f||"multipart/form-data"].concat(j(d)).join("; "))}if(Vo.hasStandardBrowserEnv&&(o&&So.isFunction(o)&&(o=o(n)),o||!1!==o&&ha(n.url))){var v=a&&s&&fa.read(s);v&&u.set(a,v)}return n},ma="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){var r,i,o,a,s,u=ba(t),c=u.data,l=ra.from(u.headers).normalize(),h=u.responseType,f=u.onUploadProgress,d=u.onDownloadProgress;function v(){a&&a(),s&&s(),u.cancelToken&&u.cancelToken.unsubscribe(r),u.signal&&u.signal.removeEventListener("abort",r)}var p=new XMLHttpRequest;function g(){if(p){var r=ra.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders());sa((function(t){e(t),v()}),(function(t){n(t),v()}),{data:h&&"text"!==h&&"json"!==h?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:t,request:p}),p=null}}if(p.open(u.method.toUpperCase(),u.url,!0),p.timeout=u.timeout,"onloadend"in p?p.onloadend=g:p.onreadystatechange=function(){p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))&&setTimeout(g)},p.onabort=function(){p&&(n(new jo("Request aborted",jo.ECONNABORTED,t,p)),p=null)},p.onerror=function(){n(new jo("Network Error",jo.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){var e=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",r=u.transitional||Io;u.timeoutErrorMessage&&(e=u.timeoutErrorMessage),n(new jo(e,r.clarifyTimeoutError?jo.ETIMEDOUT:jo.ECONNABORTED,t,p)),p=null},void 0===c&&l.setContentType(null),"setRequestHeader"in p&&So.forEach(l.toJSON(),(function(t,e){p.setRequestHeader(e,t)})),So.isUndefined(u.withCredentials)||(p.withCredentials=!!u.withCredentials),h&&"json"!==h&&(p.responseType=u.responseType),d){var y=S(ua(d,!0),2);o=y[0],s=y[1],p.addEventListener("progress",o)}if(f&&p.upload){var b=S(ua(f),2);i=b[0],a=b[1],p.upload.addEventListener("progress",i),p.upload.addEventListener("loadend",a)}(u.cancelToken||u.signal)&&(r=function(e){p&&(n(!e||e.type?new aa(null,t,p):e),p.abort(),p=null)},u.cancelToken&&u.cancelToken.subscribe(r),u.signal&&(u.signal.aborted?r():u.signal.addEventListener("abort",r)));var m,w,k=(m=u.url,(w=/^([-+\w]{1,25})(:?\/\/|:)/.exec(m))&&w[1]||"");k&&-1===Vo.protocols.indexOf(k)?n(new jo("Unsupported protocol "+k+":",jo.ERR_BAD_REQUEST,t)):p.send(c||null)}))},wa=function(t,e){var n=(t=t?t.filter(Boolean):[]).length;if(e||n){var r,i=new AbortController,o=function(t){if(!r){r=!0,s();var e=t instanceof Error?t:this.reason;i.abort(e instanceof jo?e:new aa(e instanceof Error?e.message:e))}},a=e&&setTimeout((function(){a=null,o(new jo("timeout ".concat(e," of ms exceeded"),jo.ETIMEDOUT))}),e),s=function(){t&&(a&&clearTimeout(a),a=null,t.forEach((function(t){t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((function(t){return t.addEventListener("abort",o)}));var u=i.signal;return u.unsubscribe=function(){return So.asap(s)},u}},ka=O().mark((function t(e,n){var r,i,o;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.byteLength,n&&!(r<n)){t.next=5;break}return t.next=4,e;case 4:return t.abrupt("return");case 5:i=0;case 6:if(!(i<r)){t.next=13;break}return o=i+n,t.next=10,e.slice(i,o);case 10:i=o,t.next=6;break;case 13:case"end":return t.stop()}}),t)})),Aa=function(){var t=L(O().mark((function t(e,n){var r,i,s,u,c,h;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=!1,i=!1,t.prev=2,u=a(Ea(e));case 4:return t.next=6,l(u.next());case 6:if(!(r=!(c=t.sent).done)){t.next=12;break}return h=c.value,t.delegateYield(o(a(ka(h,n))),"t0",9);case 9:r=!1,t.next=4;break;case 12:t.next=18;break;case 14:t.prev=14,t.t1=t.catch(2),i=!0,s=t.t1;case 18:if(t.prev=18,t.prev=19,!r||null==u.return){t.next=23;break}return t.next=23,l(u.return());case 23:if(t.prev=23,!i){t.next=26;break}throw s;case 26:return t.finish(23);case 27:return t.finish(18);case 28:case"end":return t.stop()}}),t,null,[[2,14,18,28],[19,,23,27]])})));return function(e,n){return t.apply(this,arguments)}}(),Ea=function(){var t=L(O().mark((function t(e){var n,r,i,s;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e[Symbol.asyncIterator]){t.next=3;break}return t.delegateYield(o(a(e)),"t0",2);case 2:return t.abrupt("return");case 3:n=e.getReader(),t.prev=4;case 5:return t.next=7,l(n.read());case 7:if(r=t.sent,i=r.done,s=r.value,!i){t.next=12;break}return t.abrupt("break",16);case 12:return t.next=14,s;case 14:t.next=5;break;case 16:return t.prev=16,t.next=19,l(n.cancel());case 19:return t.finish(16);case 20:case"end":return t.stop()}}),t,null,[[4,,16,20]])})));return function(e){return t.apply(this,arguments)}}(),xa=function(t,e,n,r){var i,o=Aa(t,e),a=0,s=function(t){i||(i=!0,r&&r(t))};return new ReadableStream({pull:function(t){return c(O().mark((function e(){var r,i,u,c,l;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.next();case 3:if(r=e.sent,i=r.done,u=r.value,!i){e.next=10;break}return s(),t.close(),e.abrupt("return");case 10:c=u.byteLength,n&&(l=a+=c,n(l)),t.enqueue(new Uint8Array(u)),e.next=19;break;case 15:throw e.prev=15,e.t0=e.catch(0),s(e.t0),e.t0;case 19:case"end":return e.stop()}}),e,null,[[0,15]])})))()},cancel:function(t){return s(t),o.return()}},{highWaterMark:2})},Oa="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Ra=Oa&&"function"==typeof ReadableStream,Sa=Oa&&("function"==typeof TextEncoder?(ga=new TextEncoder,function(t){return ga.encode(t)}):function(){var t=c(O().mark((function t(e){return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,new Response(e).arrayBuffer();case 3:return t.t1=t.sent,t.abrupt("return",new t.t0(t.t1));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),ja=function(t){try{for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!!t.apply(void 0,n)}catch(t){return!1}},Ta=Ra&&ja((function(){var t=!1,e=new Request(Vo.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),_a=Ra&&ja((function(){return So.isReadableStream(new Response("").body)})),Pa={stream:_a&&function(t){return t.body}};Oa&&(ya=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((function(t){!Pa[t]&&(Pa[t]=So.isFunction(ya[t])?function(e){return e[t]()}:function(e,n){throw new jo("Response type '".concat(t,"' is not supported"),jo.ERR_NOT_SUPPORT,n)})})));var La=function(){var t=c(O().mark((function t(e){var n;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",0);case 2:if(!So.isBlob(e)){t.next=4;break}return t.abrupt("return",e.size);case 4:if(!So.isSpecCompliantForm(e)){t.next=9;break}return n=new Request(Vo.origin,{method:"POST",body:e}),t.next=8,n.arrayBuffer();case 8:case 15:return t.abrupt("return",t.sent.byteLength);case 9:if(!So.isArrayBufferView(e)&&!So.isArrayBuffer(e)){t.next=11;break}return t.abrupt("return",e.byteLength);case 11:if(So.isURLSearchParams(e)&&(e+=""),!So.isString(e)){t.next=16;break}return t.next=15,Sa(e);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),Ca=function(){var t=c(O().mark((function t(e,n){var r;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=So.toFiniteNumber(e.getContentLength()),t.abrupt("return",null==r?La(n):r);case 2:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),Na=Oa&&function(){var t=c(O().mark((function t(e){var n,r,i,o,a,s,u,c,l,h,f,d,v,p,g,y,b,m,w,k,A,E,R,j,T,_,P,L,C,N,F,D,$,U;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=ba(e),r=n.url,i=n.method,o=n.data,a=n.signal,s=n.cancelToken,u=n.timeout,c=n.onDownloadProgress,l=n.onUploadProgress,h=n.responseType,f=n.headers,d=n.withCredentials,v=void 0===d?"same-origin":d,p=n.fetchOptions,h=h?(h+"").toLowerCase():"text",g=wa([a,s&&s.toAbortSignal()],u),b=g&&g.unsubscribe&&function(){g.unsubscribe()},t.prev=4,t.t0=l&&Ta&&"get"!==i&&"head"!==i,!t.t0){t.next=11;break}return t.next=9,Ca(f,o);case 9:t.t1=m=t.sent,t.t0=0!==t.t1;case 11:if(!t.t0){t.next=15;break}w=new Request(r,{method:"POST",body:o,duplex:"half"}),So.isFormData(o)&&(k=w.headers.get("content-type"))&&f.setContentType(k),w.body&&(A=ca(m,ua(la(l))),E=S(A,2),R=E[0],j=E[1],o=xa(w.body,65536,R,j));case 15:return So.isString(v)||(v=v?"include":"omit"),T="credentials"in Request.prototype,y=new Request(r,x(x({},p),{},{signal:g,method:i.toUpperCase(),headers:f.normalize().toJSON(),body:o,duplex:"half",credentials:T?v:void 0})),t.next=20,fetch(y);case 20:return _=t.sent,P=_a&&("stream"===h||"response"===h),_a&&(c||P&&b)&&(L={},["status","statusText","headers"].forEach((function(t){L[t]=_[t]})),C=So.toFiniteNumber(_.headers.get("content-length")),N=c&&ca(C,ua(la(c),!0))||[],F=S(N,2),D=F[0],$=F[1],_=new Response(xa(_.body,65536,D,(function(){$&&$(),b&&b()})),L)),h=h||"text",t.next=26,Pa[So.findKey(Pa,h)||"text"](_,e);case 26:return U=t.sent,!P&&b&&b(),t.next=30,new Promise((function(t,n){sa(t,n,{data:U,headers:ra.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:y})}));case 30:return t.abrupt("return",t.sent);case 33:if(t.prev=33,t.t2=t.catch(4),b&&b(),!t.t2||"TypeError"!==t.t2.name||!/fetch/i.test(t.t2.message)){t.next=38;break}throw Object.assign(new jo("Network Error",jo.ERR_NETWORK,e,y),{cause:t.t2.cause||t.t2});case 38:throw jo.from(t.t2,t.t2&&t.t2.code,e,y);case 39:case"end":return t.stop()}}),t,null,[[4,33]])})));return function(e){return t.apply(this,arguments)}}(),Fa={http:null,xhr:ma,fetch:Na};So.forEach(Fa,(function(t,e){if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));var Da=function(t){return"- ".concat(t)},$a=function(t){return So.isFunction(t)||null===t||!1===t},Ua=function(t){for(var e,n,r=(t=So.isArray(t)?t:[t]).length,i={},o=0;o<r;o++){var a=void 0;if(n=e=t[o],!$a(e)&&void 0===(n=Fa[(a=String(e)).toLowerCase()]))throw new jo("Unknown adapter '".concat(a,"'"));if(n)break;i[a||"#"+o]=n}if(!n){var s=Object.entries(i).map((function(t){var e=S(t,2),n=e[0],r=e[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")}));throw new jo("There is no suitable adapter to dispatch the request "+(r?s.length>1?"since :\n"+s.map(Da).join("\n"):" "+Da(s[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function za(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new aa(null,t)}function Ba(t){return za(t),t.headers=ra.from(t.headers),t.data=ia.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ua(t.adapter||Qo.adapter)(t).then((function(e){return za(t),e.data=ia.call(t,t.transformResponse,e),e.headers=ra.from(e.headers),e}),(function(e){return oa(e)||(za(t),e&&e.response&&(e.response.data=ia.call(t,t.transformResponse,e.response),e.response.headers=ra.from(e.response.headers))),Promise.reject(e)}))}var qa="1.7.9",Ia={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){Ia[t]=function(n){return _(n)===t||"a"+(e<1?"n ":" ")+t}}));var Ma={};Ia.transitional=function(t,e,n){function r(t,e){return"[Axios v1.7.9] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,i,o){if(!1===t)throw new jo(r(i," has been removed"+(e?" in "+e:"")),jo.ERR_DEPRECATED);return e&&!Ma[i]&&(Ma[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,o)}},Ia.spelling=function(t){return function(e,n){return console.warn("".concat(n," is likely a misspelling of ").concat(t)),!0}};var Ha={assertOptions:function(t,e,n){if("object"!==_(t))throw new jo("options must be an object",jo.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(t),i=r.length;i-- >0;){var o=r[i],a=e[o];if(a){var s=t[o],u=void 0===s||a(s,o,t);if(!0!==u)throw new jo("option "+o+" must be "+u,jo.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new jo("Unknown option "+o,jo.ERR_BAD_OPTION)}},validators:Ia},Ja=Ha.validators,Wa=function(){return p((function t(e){f(this,t),this.defaults=e,this.interceptors={request:new qo,response:new qo}}),[{key:"request",value:(t=c(O().mark((function t(e,n){var r,i;return O().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this._request(e,n);case 3:return t.abrupt("return",t.sent);case 6:if(t.prev=6,t.t0=t.catch(0),t.t0 instanceof Error){r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=r.stack?r.stack.replace(/^.+\n/,""):"";try{t.t0.stack?i&&!String(t.t0.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.t0.stack+="\n"+i):t.t0.stack=i}catch(t){}}throw t.t0;case 10:case"end":return t.stop()}}),t,this,[[0,6]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_request",value:function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{};var n=e=pa(this.defaults,e),r=n.transitional,i=n.paramsSerializer,o=n.headers;void 0!==r&&Ha.assertOptions(r,{silentJSONParsing:Ja.transitional(Ja.boolean),forcedJSONParsing:Ja.transitional(Ja.boolean),clarifyTimeoutError:Ja.transitional(Ja.boolean)},!1),null!=i&&(So.isFunction(i)?e.paramsSerializer={serialize:i}:Ha.assertOptions(i,{encode:Ja.function,serialize:Ja.function},!0)),Ha.assertOptions(e,{baseUrl:Ja.spelling("baseURL"),withXsrfToken:Ja.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();var a=o&&So.merge(o.common,o[e.method]);o&&So.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete o[t]})),e.headers=ra.concat(a,o);var s=[],u=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(u=u&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));var c,l=[];this.interceptors.response.forEach((function(t){l.push(t.fulfilled,t.rejected)}));var h,f=0;if(!u){var d=[Ba.bind(this),void 0];for(d.unshift.apply(d,s),d.push.apply(d,l),h=d.length,c=Promise.resolve(e);f<h;)c=c.then(d[f++],d[f++]);return c}h=s.length;var v=e;for(f=0;f<h;){var p=s[f++],g=s[f++];try{v=p(v)}catch(t){g.call(this,t);break}}try{c=Ba.call(this,v)}catch(t){return Promise.reject(t)}for(f=0,h=l.length;f<h;)c=c.then(l[f++],l[f++]);return c}},{key:"getUri",value:function(t){return Bo(da((t=pa(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}]);var t}();So.forEach(["delete","get","head","options"],(function(t){Wa.prototype[t]=function(e,n){return this.request(pa(n||{},{method:t,url:e,data:(n||{}).data}))}})),So.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request(pa(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Wa.prototype[t]=e(),Wa.prototype[t+"Form"]=e(!0)}));var Ka=function(){function t(e){if(f(this,t),"function"!=typeof e)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(t){n=t}));var r=this;this.promise.then((function(t){if(r._listeners){for(var e=r._listeners.length;e-- >0;)r._listeners[e](t);r._listeners=null}})),this.promise.then=function(t){var e,n=new Promise((function(t){r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},e((function(t,e,i){r.reason||(r.reason=new aa(t,e,i),n(r.reason))}))}return p(t,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}},{key:"unsubscribe",value:function(t){if(this._listeners){var e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}}},{key:"toAbortSignal",value:function(){var t=this,e=new AbortController,n=function(t){e.abort(t)};return this.subscribe(n),e.signal.unsubscribe=function(){return t.unsubscribe(n)},e.signal}}],[{key:"source",value:function(){var e,n=new t((function(t){e=t}));return{token:n,cancel:e}}}])}();var Ga={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ga).forEach((function(t){var e=S(t,2),n=e[0],r=e[1];Ga[r]=n}));var Va=function t(e){var n=new Wa(e),r=Fi(Wa.prototype.request,n);return So.extend(r,Wa.prototype,n,{allOwnKeys:!0}),So.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(pa(e,n))},r}(Qo);Va.Axios=Wa,Va.CanceledError=aa,Va.CancelToken=Ka,Va.isCancel=oa,Va.VERSION=qa,Va.toFormData=Fo,Va.AxiosError=jo,Va.Cancel=Va.CanceledError,Va.all=function(t){return Promise.all(t)},Va.spread=function(t){return function(e){return t.apply(null,e)}},Va.isAxiosError=function(t){return So.isObject(t)&&!0===t.isAxiosError},Va.mergeConfig=pa,Va.AxiosHeaders=ra,Va.formToJSON=function(t){return Xo(So.isHTMLForm(t)?new FormData(t):t)},Va.getAdapter=Ua,Va.HttpStatusCode=Ga,Va.default=Va,Va.Axios,Va.AxiosError,Va.CanceledError,Va.isCancel,Va.CancelToken,Va.VERSION,Va.all,Va.Cancel,Va.isAxiosError,Va.spread,Va.toFormData,Va.AxiosHeaders,Va.HttpStatusCode,Va.formToJSON,Va.getAdapter,Va.mergeConfig;var Xa=function(t){function e(t){var n;return f(this,e),(n=h(this,e,[t])).axiosInstance=Va.create({baseURL:"".concat(n.host,"/").concat(n.namespace),headers:{Authorization:"Bearer ".concat(t.publicKey),"Content-Type":"application/json","User-Agent":"@fleetbase/sdk;node"}}),n.axiosInstance.interceptors.response.use((function(t){return t.data}),(function(t){if(t.response){var e=t.response.data;if(W(e.errors)&&e.errors.length)throw new Error(e.errors[0]);if(e.error)throw new Error(e.error)}throw t})),n}return m(e,t),p(e,[{key:"setHeaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.axiosInstance.defaults.headers.common=x(x({},this.axiosInstance.defaults.headers.common),t),this}},{key:"request",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.axiosInstance.request(x({method:t,url:e},n))}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("GET",t,x({params:e},n))}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("POST",t,x({data:e},n))}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PUT",t,x({data:e},n))}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request("DELETE",t,e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request("PATCH",t,x({data:e},n))}}])}(Ci);B("adapter","NodeAdapter",Xa);var Qa=function(t){function e(){return f(this,e),h(this,e,arguments)}return m(e,t),p(e)}(Ci);B("adapter","EmberJsAdapter",Qa);var Ya=function(){function t(e){var n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(f(this,t),this.version=null!==(n=o.version)&&void 0!==n?n:"v1",this.options={version:this.version,host:null!==(r=o.host)&&void 0!==r?r:"https://api.fleetbase.io",namespace:null!==(i=o.namespace)&&void 0!==i?i:this.version,debug:a,publicKey:e},"string"!=typeof e||0===e.length)throw new Error("⚠️ Invalid public key given to Fleetbase SDK");if(!ot()&&e.toLowerCase().startsWith("$"))throw new Error("Secret key provided. You must use a public key with Fleetbase Javascript SDK!");this.adapter=o.adapter||at(this.options),this.orders=new gt("order",this.adapter).extendActions(yt),this.entities=new gt("entity",this.adapter),this.places=new gt("place",this.adapter),this.drivers=new gt("driver",this.adapter).extendActions(xi),this.vehicles=new gt("vehicle",this.adapter),this.vendors=new gt("vendor",this.adapter),this.contacts=new gt("contact",this.adapter),this.serviceAreas=new gt("service-area",this.adapter),this.serviceQuotes=new gt("service-quote",this.adapter),this.zones=new gt("zone",this.adapter),this.fleets=new gt("fleet",this.adapter),this.organizations=new gt("organization",this.adapter).extendActions(ki)}return p(t,[{key:"setAdapter",value:function(t){this.adapter=t}},{key:"getAdapter",value:function(){return this.adapter}}],[{key:"newInstance",value:function(){return d(t,Array.prototype.slice.call(arguments))}}])}();t.Adapter=Ci,t.BrowserAdapter=Ni,t.Collection=rt,t.Contact=Si,t.Driver=Oi,t.EmberJsAdapter=Qa,t.Entity=wt,t.Fleet=Li,t.GoogleAddress=st,t.NodeAdapter=Xa,t.Order=bt,t.Organization=Ai,t.Payload=mt,t.Place=kt,t.Point=ut,t.Resolver=M,t.Resource=pt,t.ServiceArea=Ti,t.ServiceQuote=Pi,t.ServiceRate=_i,t.Store=gt,t.StoreActions=dt,t.TrackingStatus=Et,t.Vehicle=wi,t.Vendor=Ri,t.Waypoint=At,t.Zone=ji,t.camelize=function(){var t=["camelize"].concat(Array.prototype.slice.call(arguments));return F.invoke.apply(F,j(t))},t.classify=U,t.createCollection=nt,t.createResource=function(){return q.apply(void 0,["resource","Resource"].concat(Array.prototype.slice.call(arguments)))},t.createStore=I,t.createStoreActions=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=d(dt,n);return B("action",t,i),i},t.dasherize=function(){var t=["dasherize"].concat(Array.prototype.slice.call(arguments));return F.invoke.apply(F,j(t))},t.default=Ya,t.detectAdapter=at,t.extendStoreActions=ft,t.isLatitude=function(t){return isFinite(t)&&Math.abs(t)<=90},t.isLongitude=function(t){return isFinite(t)&&Math.abs(t)<=180&&Math.abs(t)>=90},t.isNodeEnvironment=ot,t.isResource=vt,t.lookup=H,t.pluralize=D,t.register=B,t.resolve=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return q.apply(void 0,[t,U(e)].concat(r))},t.resolveResource=J,t.singularize=$}));
//# sourceMappingURL=fleetbase.min.js.map