/
graphhopper-client.js
142 lines (97 loc) · 68.7 KB
/
graphhopper-client.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){
module.exports=_dereq_("./lib/axios");
},{"./lib/axios":3}],2:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("./../utils"),settle=_dereq_("./../core/settle"),cookies=_dereq_("./../helpers/cookies"),buildURL=_dereq_("./../helpers/buildURL"),buildFullPath=_dereq_("../core/buildFullPath"),parseHeaders=_dereq_("./../helpers/parseHeaders"),isURLSameOrigin=_dereq_("./../helpers/isURLSameOrigin"),transitionalDefaults=_dereq_("../defaults/transitional"),AxiosError=_dereq_("../core/AxiosError"),CanceledError=_dereq_("../cancel/CanceledError"),parseProtocol=_dereq_("../helpers/parseProtocol");module.exports=function(e){return new Promise(function(r,o){var s,t=e.data,n=e.headers,i=e.responseType;function a(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}utils.isFormData(t)&&utils.isStandardBrowserEnv()&&delete n["Content-Type"];var l=new XMLHttpRequest;if(e.auth){var u=e.auth.username||"",d=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";n.Authorization="Basic "+btoa(u+":"+d)}var c=buildFullPath(e.baseURL,e.url);function p(){if(l){var s="getAllResponseHeaders"in l?parseHeaders(l.getAllResponseHeaders()):null,t={data:i&&"text"!==i&&"json"!==i?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:s,config:e,request:l};settle(function(e){r(e),a()},function(e){o(e),a()},t),l=null}}if(l.open(e.method.toUpperCase(),buildURL(c,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=p:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(p)},l.onabort=function(){l&&(o(new AxiosError("Request aborted",AxiosError.ECONNABORTED,e,l)),l=null)},l.onerror=function(){o(new AxiosError("Network Error",AxiosError.ERR_NETWORK,e,l,l)),l=null},l.ontimeout=function(){var r=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",s=e.transitional||transitionalDefaults;e.timeoutErrorMessage&&(r=e.timeoutErrorMessage),o(new AxiosError(r,s.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,e,l)),l=null},utils.isStandardBrowserEnv()){var E=(e.withCredentials||isURLSameOrigin(c))&&e.xsrfCookieName?cookies.read(e.xsrfCookieName):void 0;E&&(n[e.xsrfHeaderName]=E)}"setRequestHeader"in l&&utils.forEach(n,function(e,r){void 0===t&&"content-type"===r.toLowerCase()?delete n[r]:l.setRequestHeader(r,e)}),utils.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),i&&"json"!==i&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(s=function(e){l&&(o(!e||e&&e.type?new CanceledError:e),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s))),t||(t=null);var f=parseProtocol(c);f&&-1===["http","https","file"].indexOf(f)?o(new AxiosError("Unsupported protocol "+f+":",AxiosError.ERR_BAD_REQUEST,e)):l.send(t)})};
},{"../cancel/CanceledError":5,"../core/AxiosError":8,"../core/buildFullPath":10,"../defaults/transitional":16,"../helpers/parseProtocol":28,"./../core/settle":13,"./../helpers/buildURL":19,"./../helpers/cookies":21,"./../helpers/isURLSameOrigin":24,"./../helpers/parseHeaders":27,"./../utils":32}],3:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("./utils"),bind=_dereq_("./helpers/bind"),Axios=_dereq_("./core/Axios"),mergeConfig=_dereq_("./core/mergeConfig"),defaults=_dereq_("./defaults");function createInstance(e){var r=new Axios(e),i=bind(Axios.prototype.request,r);return utils.extend(i,Axios.prototype,r),utils.extend(i,r),i.create=function(r){return createInstance(mergeConfig(e,r))},i}var axios=createInstance(defaults);axios.Axios=Axios,axios.CanceledError=_dereq_("./cancel/CanceledError"),axios.CancelToken=_dereq_("./cancel/CancelToken"),axios.isCancel=_dereq_("./cancel/isCancel"),axios.VERSION=_dereq_("./env/data").version,axios.toFormData=_dereq_("./helpers/toFormData"),axios.AxiosError=_dereq_("../lib/core/AxiosError"),axios.Cancel=axios.CanceledError,axios.all=function(e){return Promise.all(e)},axios.spread=_dereq_("./helpers/spread"),axios.isAxiosError=_dereq_("./helpers/isAxiosError"),module.exports=axios,module.exports.default=axios;
},{"../lib/core/AxiosError":8,"./cancel/CancelToken":4,"./cancel/CanceledError":5,"./cancel/isCancel":6,"./core/Axios":7,"./core/mergeConfig":12,"./defaults":15,"./env/data":17,"./helpers/bind":18,"./helpers/isAxiosError":23,"./helpers/spread":29,"./helpers/toFormData":30,"./utils":32}],4:[function(_dereq_,module,exports){
"use strict";var CanceledError=_dereq_("./CanceledError");function CancelToken(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var n;this.promise=new Promise(function(e){n=e});var r=this;this.promise.then(function(e){if(r._listeners){var n,s=r._listeners.length;for(n=0;n<s;n++)r._listeners[n](e);r._listeners=null}}),this.promise.then=function(e){var n,s=new Promise(function(e){r.subscribe(e),n=e}).then(e);return s.cancel=function(){r.unsubscribe(n)},s},e(function(e){r.reason||(r.reason=new CanceledError(e),n(r.reason))})}CancelToken.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},CancelToken.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},CancelToken.prototype.unsubscribe=function(e){if(this._listeners){var n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}},CancelToken.source=function(){var e;return{token:new CancelToken(function(n){e=n}),cancel:e}},module.exports=CancelToken;
},{"./CanceledError":5}],5:[function(_dereq_,module,exports){
"use strict";var AxiosError=_dereq_("../core/AxiosError"),utils=_dereq_("../utils");function CanceledError(r){AxiosError.call(this,null==r?"canceled":r,AxiosError.ERR_CANCELED),this.name="CanceledError"}utils.inherits(CanceledError,AxiosError,{__CANCEL__:!0}),module.exports=CanceledError;
},{"../core/AxiosError":8,"../utils":32}],6:[function(_dereq_,module,exports){
"use strict";module.exports=function(t){return!(!t||!t.__CANCEL__)};
},{}],7:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("./../utils"),buildURL=_dereq_("../helpers/buildURL"),InterceptorManager=_dereq_("./InterceptorManager"),dispatchRequest=_dereq_("./dispatchRequest"),mergeConfig=_dereq_("./mergeConfig"),buildFullPath=_dereq_("./buildFullPath"),validator=_dereq_("../helpers/validator"),validators=validator.validators;function Axios(t){this.defaults=t,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=mergeConfig(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;void 0!==r&&validator.assertOptions(r,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1);var o=[],i=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(i=i&&t.synchronous,o.unshift(t.fulfilled,t.rejected))});var a,s=[];if(this.interceptors.response.forEach(function(t){s.push(t.fulfilled,t.rejected)}),!i){var n=[dispatchRequest,void 0];for(Array.prototype.unshift.apply(n,o),n=n.concat(s),a=Promise.resolve(e);n.length;)a=a.then(n.shift(),n.shift());return a}for(var u=e;o.length;){var l=o.shift(),h=o.shift();try{u=l(u)}catch(t){h(t);break}}try{a=dispatchRequest(u)}catch(t){return Promise.reject(t)}for(;s.length;)a=a.then(s.shift(),s.shift());return a},Axios.prototype.getUri=function(t){t=mergeConfig(this.defaults,t);var e=buildFullPath(t.baseURL,t.url);return buildURL(e,t.params,t.paramsSerializer)},utils.forEach(["delete","get","head","options"],function(t){Axios.prototype[t]=function(e,r){return this.request(mergeConfig(r||{},{method:t,url:e,data:(r||{}).data}))}}),utils.forEach(["post","put","patch"],function(t){function e(e){return function(r,o,i){return this.request(mergeConfig(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Axios.prototype[t]=e(),Axios.prototype[t+"Form"]=e(!0)}),module.exports=Axios;
},{"../helpers/buildURL":19,"../helpers/validator":31,"./../utils":32,"./InterceptorManager":9,"./buildFullPath":10,"./dispatchRequest":11,"./mergeConfig":12}],8:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("../utils");function AxiosError(r,s,e,t,i){Error.call(this),this.message=r,this.name="AxiosError",s&&(this.code=s),e&&(this.config=e),t&&(this.request=t),i&&(this.response=i)}utils.inherits(AxiosError,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:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var prototype=AxiosError.prototype,descriptors={};["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"].forEach(function(r){descriptors[r]={value:r}}),Object.defineProperties(AxiosError,descriptors),Object.defineProperty(prototype,"isAxiosError",{value:!0}),AxiosError.from=function(r,s,e,t,i,o){var n=Object.create(prototype);return utils.toFlatObject(r,n,function(r){return r!==Error.prototype}),AxiosError.call(n,r.message,s,e,t,i),n.name=r.name,o&&Object.assign(n,o),n},module.exports=AxiosError;
},{"../utils":32}],9:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("./../utils");function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},InterceptorManager.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},InterceptorManager.prototype.forEach=function(e){utils.forEach(this.handlers,function(n){null!==n&&e(n)})},module.exports=InterceptorManager;
},{"./../utils":32}],10:[function(_dereq_,module,exports){
"use strict";var isAbsoluteURL=_dereq_("../helpers/isAbsoluteURL"),combineURLs=_dereq_("../helpers/combineURLs");module.exports=function(e,s){return e&&!isAbsoluteURL(s)?combineURLs(e,s):s};
},{"../helpers/combineURLs":20,"../helpers/isAbsoluteURL":22}],11:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("./../utils"),transformData=_dereq_("./transformData"),isCancel=_dereq_("../cancel/isCancel"),defaults=_dereq_("../defaults"),CanceledError=_dereq_("../cancel/CanceledError");function throwIfCancellationRequested(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new CanceledError}module.exports=function(e){return throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=transformData.call(e,e.data,e.headers,e.transformRequest),e.headers=utils.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),utils.forEach(["delete","get","head","post","put","patch","common"],function(a){delete e.headers[a]}),(e.adapter||defaults.adapter)(e).then(function(a){return throwIfCancellationRequested(e),a.data=transformData.call(e,a.data,a.headers,e.transformResponse),a},function(a){return isCancel(a)||(throwIfCancellationRequested(e),a&&a.response&&(a.response.data=transformData.call(e,a.response.data,a.response.headers,e.transformResponse))),Promise.reject(a)})};
},{"../cancel/CanceledError":5,"../cancel/isCancel":6,"../defaults":15,"./../utils":32,"./transformData":14}],12:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("../utils");module.exports=function(e,t){t=t||{};var i={};function n(e,t){return utils.isPlainObject(e)&&utils.isPlainObject(t)?utils.merge(e,t):utils.isPlainObject(t)?utils.merge({},t):utils.isArray(t)?t.slice():t}function s(i){return utils.isUndefined(t[i])?utils.isUndefined(e[i])?void 0:n(void 0,e[i]):n(e[i],t[i])}function r(e){if(!utils.isUndefined(t[e]))return n(void 0,t[e])}function o(i){return utils.isUndefined(t[i])?utils.isUndefined(e[i])?void 0:n(void 0,e[i]):n(void 0,t[i])}function u(i){return i in t?n(e[i],t[i]):i in e?n(void 0,e[i]):void 0}var a={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u};return utils.forEach(Object.keys(e).concat(Object.keys(t)),function(e){var t=a[e]||s,n=t(e);utils.isUndefined(n)&&t!==u||(i[e]=n)}),i};
},{"../utils":32}],13:[function(_dereq_,module,exports){
"use strict";var AxiosError=_dereq_("./AxiosError");module.exports=function(r,s,t){var o=t.config.validateStatus;t.status&&o&&!o(t.status)?s(new AxiosError("Request failed with status code "+t.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t)):r(t)};
},{"./AxiosError":8}],14:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("./../utils"),defaults=_dereq_("../defaults");module.exports=function(t,u,e){var r=this||defaults;return utils.forEach(e,function(e){t=e.call(r,t,u)}),t};
},{"../defaults":15,"./../utils":32}],15:[function(_dereq_,module,exports){
(function (process){(function (){
"use strict";var utils=_dereq_("../utils"),normalizeHeaderName=_dereq_("../helpers/normalizeHeaderName"),AxiosError=_dereq_("../core/AxiosError"),transitionalDefaults=_dereq_("./transitional"),toFormData=_dereq_("../helpers/toFormData"),DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(t,e){!utils.isUndefined(t)&&utils.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function getDefaultAdapter(){var t;return"undefined"!=typeof XMLHttpRequest?t=_dereq_("../adapters/xhr"):"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)&&(t=_dereq_("../adapters/http")),t}function stringifySafely(t,e,r){if(utils.isString(t))try{return(e||JSON.parse)(t),utils.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(r||JSON.stringify)(t)}var defaults={transitional:transitionalDefaults,adapter:getDefaultAdapter(),transformRequest:[function(t,e){if(normalizeHeaderName(e,"Accept"),normalizeHeaderName(e,"Content-Type"),utils.isFormData(t)||utils.isArrayBuffer(t)||utils.isBuffer(t)||utils.isStream(t)||utils.isFile(t)||utils.isBlob(t))return t;if(utils.isArrayBufferView(t))return t.buffer;if(utils.isURLSearchParams(t))return setContentTypeIfUnset(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var r,i=utils.isObject(t),n=e&&e["Content-Type"];if((r=utils.isFileList(t))||i&&"multipart/form-data"===n){var a=this.env&&this.env.FormData;return toFormData(r?{"files[]":t}:t,a&&new a)}return i||"application/json"===n?(setContentTypeIfUnset(e,"application/json"),stringifySafely(t)):t}],transformResponse:[function(t){var e=this.transitional||defaults.transitional,r=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,n=!r&&"json"===this.responseType;if(n||i&&utils.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw AxiosError.from(t,AxiosError.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:_dereq_("./env/FormData")},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils.forEach(["delete","get","head"],function(t){defaults.headers[t]={}}),utils.forEach(["post","put","patch"],function(t){defaults.headers[t]=utils.merge(DEFAULT_CONTENT_TYPE)}),module.exports=defaults;
}).call(this)}).call(this,_dereq_('_process'))
},{"../adapters/http":2,"../adapters/xhr":2,"../core/AxiosError":8,"../helpers/normalizeHeaderName":25,"../helpers/toFormData":30,"../utils":32,"./env/FormData":26,"./transitional":16,"_process":36}],16:[function(_dereq_,module,exports){
"use strict";module.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};
},{}],17:[function(_dereq_,module,exports){
module.exports={version:"0.27.2"};
},{}],18:[function(_dereq_,module,exports){
"use strict";module.exports=function(r,n){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];return r.apply(n,t)}};
},{}],19:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("./../utils");function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}module.exports=function(e,i,r){if(!i)return e;var t;if(r)t=r(i);else if(utils.isURLSearchParams(i))t=i.toString();else{var n=[];utils.forEach(i,function(e,i){null!==e&&void 0!==e&&(utils.isArray(e)?i+="[]":e=[e],utils.forEach(e,function(e){utils.isDate(e)?e=e.toISOString():utils.isObject(e)&&(e=JSON.stringify(e)),n.push(encode(i)+"="+encode(e))}))}),t=n.join("&")}if(t){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+t}return e};
},{"./../utils":32}],20:[function(_dereq_,module,exports){
"use strict";module.exports=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e};
},{}],21:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("./../utils");module.exports=utils.isStandardBrowserEnv()?{write:function(e,t,n,i,u,o){var r=[];r.push(e+"="+encodeURIComponent(t)),utils.isNumber(n)&&r.push("expires="+new Date(n).toGMTString()),utils.isString(i)&&r.push("path="+i),utils.isString(u)&&r.push("domain="+u),!0===o&&r.push("secure"),document.cookie=r.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};
},{"./../utils":32}],22:[function(_dereq_,module,exports){
"use strict";module.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)};
},{}],23:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("./../utils");module.exports=function(r){return utils.isObject(r)&&!0===r.isAxiosError};
},{"./../utils":32}],24:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("./../utils");module.exports=utils.isStandardBrowserEnv()?function(){var t,r=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");function o(t){var o=t;return r&&(e.setAttribute("href",o),o=e.href),e.setAttribute("href",o),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return t=o(window.location.href),function(r){var e=utils.isString(r)?o(r):r;return e.protocol===t.protocol&&e.host===t.host}}():function(){return!0};
},{"./../utils":32}],25:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("../utils");module.exports=function(e,t){utils.forEach(e,function(r,s){s!==t&&s.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[s])})};
},{"../utils":32}],26:[function(_dereq_,module,exports){
module.exports=null;
},{}],27:[function(_dereq_,module,exports){
"use strict";var utils=_dereq_("./../utils"),ignoreDuplicateOf=["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"];module.exports=function(t){var e,i,r,o={};return t?(utils.forEach(t.split("\n"),function(t){if(r=t.indexOf(":"),e=utils.trim(t.substr(0,r)).toLowerCase(),i=utils.trim(t.substr(r+1)),e){if(o[e]&&ignoreDuplicateOf.indexOf(e)>=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([i]):o[e]?o[e]+", "+i:i}}),o):o};
},{"./../utils":32}],28:[function(_dereq_,module,exports){
"use strict";module.exports=function(e){var r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""};
},{}],29:[function(_dereq_,module,exports){
"use strict";module.exports=function(n){return function(t){return n.apply(null,t)}};
},{}],30:[function(_dereq_,module,exports){
(function (Buffer){(function (){
"use strict";var utils=_dereq_("../utils");function toFormData(i,t){t=t||new FormData;var r=[];function e(i){return null===i?"":utils.isDate(i)?i.toISOString():utils.isArrayBuffer(i)||utils.isTypedArray(i)?"function"==typeof Blob?new Blob([i]):Buffer.from(i):i}return function i(n,u){if(utils.isPlainObject(n)||utils.isArray(n)){if(-1!==r.indexOf(n))throw Error("Circular reference detected in "+u);r.push(n),utils.forEach(n,function(r,n){if(!utils.isUndefined(r)){var s,o=u?u+"."+n:n;if(r&&!u&&"object"==typeof r)if(utils.endsWith(n,"{}"))r=JSON.stringify(r);else if(utils.endsWith(n,"[]")&&(s=utils.toArray(r)))return void s.forEach(function(i){!utils.isUndefined(i)&&t.append(o,e(i))});i(r,o)}}),r.pop()}else t.append(u,e(n))}(i),t}module.exports=toFormData;
}).call(this)}).call(this,_dereq_("buffer").Buffer)
},{"../utils":32,"buffer":34}],31:[function(_dereq_,module,exports){
"use strict";var VERSION=_dereq_("../env/data").version,AxiosError=_dereq_("../core/AxiosError"),validators={};["object","boolean","number","function","string","symbol"].forEach(function(r,o){validators[r]=function(e){return typeof e===r||"a"+(o<1?"n ":" ")+r}});var deprecatedWarnings={};function assertOptions(r,o,e){if("object"!=typeof r)throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(r),t=n.length;t-- >0;){var i=n[t],s=o[i];if(s){var a=r[i],E=void 0===a||s(a,i,r);if(!0!==E)throw new AxiosError("option "+i+" must be "+E,AxiosError.ERR_BAD_OPTION_VALUE)}else if(!0!==e)throw new AxiosError("Unknown option "+i,AxiosError.ERR_BAD_OPTION)}}validators.transitional=function(r,o,e){function n(r,o){return"[Axios v"+VERSION+"] Transitional option '"+r+"'"+o+(e?". "+e:"")}return function(e,t,i){if(!1===r)throw new AxiosError(n(t," has been removed"+(o?" in "+o:"")),AxiosError.ERR_DEPRECATED);return o&&!deprecatedWarnings[t]&&(deprecatedWarnings[t]=!0,console.warn(n(t," has been deprecated since v"+o+" and will be removed in the near future"))),!r||r(e,t,i)}},module.exports={assertOptions:assertOptions,validators:validators};
},{"../core/AxiosError":8,"../env/data":17}],32:[function(_dereq_,module,exports){
"use strict";var bind=_dereq_("./helpers/bind"),toString=Object.prototype.toString,kindOf=function(r){return function(t){var e=toString.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())}}(Object.create(null));function kindOfTest(r){return r=r.toLowerCase(),function(t){return kindOf(t)===r}}function isArray(r){return Array.isArray(r)}function isUndefined(r){return void 0===r}function isBuffer(r){return null!==r&&!isUndefined(r)&&null!==r.constructor&&!isUndefined(r.constructor)&&"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r)}var isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(r){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(r):r&&r.buffer&&isArrayBuffer(r.buffer)}function isString(r){return"string"==typeof r}function isNumber(r){return"number"==typeof r}function isObject(r){return null!==r&&"object"==typeof r}function isPlainObject(r){if("object"!==kindOf(r))return!1;var t=Object.getPrototypeOf(r);return null===t||t===Object.prototype}var isDate=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList");function isFunction(r){return"[object Function]"===toString.call(r)}function isStream(r){return isObject(r)&&isFunction(r.pipe)}function isFormData(r){return r&&("function"==typeof FormData&&r instanceof FormData||"[object FormData]"===toString.call(r)||isFunction(r.toString)&&"[object FormData]"===r.toString())}var isURLSearchParams=kindOfTest("URLSearchParams");function trim(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function isStandardBrowserEnv(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function forEach(r,t){if(null!==r&&void 0!==r)if("object"!=typeof r&&(r=[r]),isArray(r))for(var e=0,i=r.length;e<i;e++)t.call(null,r[e],e,r);else for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&t.call(null,r[n],n,r)}function merge(){var r={};function t(t,e){isPlainObject(r[e])&&isPlainObject(t)?r[e]=merge(r[e],t):isPlainObject(t)?r[e]=merge({},t):isArray(t)?r[e]=t.slice():r[e]=t}for(var e=0,i=arguments.length;e<i;e++)forEach(arguments[e],t);return r}function extend(r,t,e){return forEach(t,function(t,i){r[i]=e&&"function"==typeof t?bind(t,e):t}),r}function stripBOM(r){return 65279===r.charCodeAt(0)&&(r=r.slice(1)),r}function inherits(r,t,e,i){r.prototype=Object.create(t.prototype,i),r.prototype.constructor=r,e&&Object.assign(r.prototype,e)}function toFlatObject(r,t,e){var i,n,o,s={};t=t||{};do{for(n=(i=Object.getOwnPropertyNames(r)).length;n-- >0;)s[o=i[n]]||(t[o]=r[o],s[o]=!0);r=Object.getPrototypeOf(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t}function endsWith(r,t,e){r=String(r),(void 0===e||e>r.length)&&(e=r.length),e-=t.length;var i=r.indexOf(t,e);return-1!==i&&i===e}function toArray(r){if(!r)return null;var t=r.length;if(isUndefined(t))return null;for(var e=new Array(t);t-- >0;)e[t]=r[t];return e}var isTypedArray=function(r){return function(t){return r&&t instanceof r}}("undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array));module.exports={isArray:isArray,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString,isNumber:isNumber,isObject:isObject,isPlainObject:isPlainObject,isUndefined:isUndefined,isDate:isDate,isFile:isFile,isBlob:isBlob,isFunction:isFunction,isStream:isStream,isURLSearchParams:isURLSearchParams,isStandardBrowserEnv:isStandardBrowserEnv,forEach:forEach,merge:merge,extend:extend,trim:trim,stripBOM:stripBOM,inherits:inherits,toFlatObject:toFlatObject,kindOf:kindOf,kindOfTest:kindOfTest,endsWith:endsWith,toArray:toArray,isTypedArray:isTypedArray,isFileList:isFileList};
},{"./helpers/bind":18}],33:[function(_dereq_,module,exports){
"use strict";exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;function getLens(o){var r=o.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=o.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function byteLength(o){var r=getLens(o),e=r[0],t=r[1];return 3*(e+t)/4-t}function _byteLength(o,r,e){return 3*(r+e)/4-e}function toByteArray(o){var r,e,t=getLens(o),n=t[0],u=t[1],p=new Arr(_byteLength(o,n,u)),a=0,h=u>0?n-4:n;for(e=0;e<h;e+=4)r=revLookup[o.charCodeAt(e)]<<18|revLookup[o.charCodeAt(e+1)]<<12|revLookup[o.charCodeAt(e+2)]<<6|revLookup[o.charCodeAt(e+3)],p[a++]=r>>16&255,p[a++]=r>>8&255,p[a++]=255&r;return 2===u&&(r=revLookup[o.charCodeAt(e)]<<2|revLookup[o.charCodeAt(e+1)]>>4,p[a++]=255&r),1===u&&(r=revLookup[o.charCodeAt(e)]<<10|revLookup[o.charCodeAt(e+1)]<<4|revLookup[o.charCodeAt(e+2)]>>2,p[a++]=r>>8&255,p[a++]=255&r),p}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]}function encodeChunk(o,r,e){for(var t,n=[],u=r;u<e;u+=3)t=(o[u]<<16&16711680)+(o[u+1]<<8&65280)+(255&o[u+2]),n.push(tripletToBase64(t));return n.join("")}function fromByteArray(o){for(var r,e=o.length,t=e%3,n=[],u=0,p=e-t;u<p;u+=16383)n.push(encodeChunk(o,u,u+16383>p?p:u+16383));return 1===t?(r=o[e-1],n.push(lookup[r>>2]+lookup[r<<4&63]+"==")):2===t&&(r=(o[e-2]<<8)+o[e-1],n.push(lookup[r>>10]+lookup[r>>4&63]+lookup[r<<2&63]+"=")),n.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63;
},{}],34:[function(_dereq_,module,exports){
(function (Buffer){(function (){
"use strict";var base64=_dereq_("base64-js"),ieee754=_dereq_("ieee754");exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;function typedArraySupport(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}function createBuffer(e){if(e>K_MAX_LENGTH)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=Buffer.prototype,t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if("string"==typeof e)return fromString(e,t);if(ArrayBuffer.isView(e))return fromArrayLike(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);var f=fromObject(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function alloc(e,t,r){return assertSize(e),e<=0?createBuffer(e):void 0!==t?"string"==typeof r?createBuffer(e).fill(t,r):createBuffer(e).fill(t):createBuffer(e)}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromString(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|byteLength(e,t),n=createBuffer(r),f=n.write(e,t);return f!==r&&(n=n.slice(0,f)),n}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),r=createBuffer(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function fromArrayBuffer(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r)).__proto__=Buffer.prototype,n}function fromObject(e){if(Buffer.isBuffer(e)){var t=0|checked(e.length),r=createBuffer(t);return 0===r.length?r:(e.copy(r,0,0,t),r)}return void 0!==e.length?"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e):"Buffer"===e.type&&Array.isArray(e.data)?fromArrayLike(e.data):void 0}function checked(e){if(e>=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|e}function SlowBuffer(e){return+e!=e&&(e=0),Buffer.alloc(+e)}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var f=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(f)return n?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),f=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,f){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),numberIsNaN(r=+r)&&(r=f?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(f)return-1;r=e.length-1}else if(r<0){if(!f)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,f);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,f){var i,o=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,u/=2,s/=2,r/=2}function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(f){var h=-1;for(i=r;i<u;i++)if(a(e,i)===a(t,-1===h?0:i-h)){if(-1===h&&(h=i),i-h+1===s)return h*o}else-1!==h&&(i-=i-h),h=-1}else for(r+s>u&&(r=u-s),i=r;i>=0;i--){for(var c=!0,l=0;l<s;l++)if(a(e,i+l)!==a(t,l)){c=!1;break}if(c)return i}return-1}function hexWrite(e,t,r,n){r=Number(r)||0;var f=e.length-r;n?(n=Number(n))>f&&(n=f):n=f;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var u=parseInt(t.substr(2*o,2),16);if(numberIsNaN(u))return o;e[r+o]=u}return o}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(asciiToBytes(t),e,r,n)}function latin1Write(e,t,r,n){return asciiWrite(e,t,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(utf16leToBytes(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?base64.fromByteArray(e):base64.fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);for(var n=[],f=t;f<r;){var i,o,u,s,a=e[f],h=null,c=a>239?4:a>223?3:a>191?2:1;if(f+c<=r)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(i=e[f+1]))&&(s=(31&a)<<6|63&i)>127&&(h=s);break;case 3:i=e[f+1],o=e[f+2],128==(192&i)&&128==(192&o)&&(s=(15&a)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:i=e[f+1],o=e[f+2],u=e[f+3],128==(192&i)&&128==(192&o)&&128==(192&u)&&(s=(15&a)<<18|(63&i)<<12|(63&o)<<6|63&u)>65535&&s<1114112&&(h=s)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),f+=c}return decodeCodePointsArray(n)}exports.kMaxLength=K_MAX_LENGTH,Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(e,t,r){return from(e,t,r)},Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,Buffer.alloc=function(e,t,r){return alloc(e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(e)},Buffer.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype},Buffer.compare=function(e,t){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,f=0,i=Math.min(r,n);f<i;++f)if(e[f]!==t[f]){r=e[f],n=t[f];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Buffer.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Buffer.allocUnsafe(t),f=0;for(r=0;r<e.length;++r){var i=e[r];if(isInstance(i,Uint8Array)&&(i=Buffer.from(i)),!Buffer.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,f),f+=i.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)swap(this,t,t+1);return this},Buffer.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)swap(this,t,t+3),swap(this,t+1,t+2);return this},Buffer.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)swap(this,t,t+7),swap(this,t+1,t+6),swap(this,t+2,t+5),swap(this,t+3,t+4);return this},Buffer.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function(e){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function(){var e="",t=exports.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},Buffer.prototype.compare=function(e,t,r,n,f){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),t<0||r>e.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&t>=r)return 0;if(n>=f)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,f>>>=0,this===e)return 0;for(var i=f-n,o=r-t,u=Math.min(i,o),s=this.slice(n,f),a=e.slice(t,r),h=0;h<u;++h)if(s[h]!==a[h]){i=s[h],o=a[h];break}return i<o?-1:o<i?1:0},Buffer.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},Buffer.prototype.indexOf=function(e,t,r){return bidirectionalIndexOf(this,e,t,r,!0)},Buffer.prototype.lastIndexOf=function(e,t,r){return bidirectionalIndexOf(this,e,t,r,!1)},Buffer.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=MAX_ARGUMENTS_LENGTH));return r}function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var f=t;f<r;++f)n+=String.fromCharCode(127&e[f]);return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(var f=t;f<r;++f)n+=String.fromCharCode(e[f]);return n}function hexSlice(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var f="",i=t;i<r;++i)f+=toHex(e[i]);return f}function utf16leSlice(e,t,r){for(var n=e.slice(t,r),f="",i=0;i<n.length;i+=2)f+=String.fromCharCode(n[i]+256*n[i+1]);return f}function checkOffset(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,f,i){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>f||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function checkIEEE754(e,t,r,n,f,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=Buffer.prototype,n},Buffer.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i<t&&(f*=256);)n+=this[e+i]*f;return n},Buffer.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],f=1;t>0&&(f*=256);)n+=this[e+--t]*f;return n},Buffer.prototype.readUInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i<t&&(f*=256);)n+=this[e+i]*f;return n>=(f*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=t,f=1,i=this[e+--n];n>0&&(f*=256);)i+=this[e+--n]*f;return i>=(f*=128)&&(i-=Math.pow(2,8*t)),i},Buffer.prototype.readInt8=function(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=1,i=0;for(this[t]=255&e;++i<r&&(f*=256);)this[t+i]=e/f&255;return t+r},Buffer.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=r-1,i=1;for(this[t+f]=255&e;--f>=0&&(i*=256);)this[t+f]=e/i&255;return t+r},Buffer.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=0,o=1,u=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===u&&0!==this[t+i-1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=r-1,o=1,u=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeFloatLE=function(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var f=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var i=f-1;i>=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return f},Buffer.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var f=e.charCodeAt(0);("utf8"===n&&f<128||"latin1"===n)&&(e=f)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var o=Buffer.isBuffer(e)?e:Buffer.from(e,n),u=o.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%u]}return this};var INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(e){if((e=(e=e.split("=")[0]).trim().replace(INVALID_BASE64_RE,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function toHex(e){return e<16?"0"+e.toString(16):e.toString(16)}function utf8ToBytes(e,t){var r;t=t||1/0;for(var n=e.length,f=null,i=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!f){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),f=r;continue}r=65536+(f-55296<<10|r-56320)}else f&&(t-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function asciiToBytes(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function utf16leToBytes(e,t){for(var r,n,f,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(e){return base64.toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var f=0;f<n&&!(f+r>=t.length||f>=e.length);++f)t[f+r]=e[f];return f}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}
}).call(this)}).call(this,_dereq_("buffer").Buffer)
},{"base64-js":33,"buffer":34,"ieee754":35}],35:[function(_dereq_,module,exports){
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
},{}],36:[function(_dereq_,module,exports){
var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};
},{}],37:[function(_dereq_,module,exports){
GHInput=function(t,n){this.set(t,n)},GHInput.prototype.round=function(t,n){return void 0===n&&(n=1e6),Math.round(t*n)/n},GHInput.prototype.setCoord=function(t,n){this.lat=this.round(t),this.lng=this.round(n),this.input=this.toString()},GHInput.isObject=function(t){return"[object object]"===Object.prototype.toString.call(t).toLowerCase()},GHInput.isString=function(t){return"[object string]"===Object.prototype.toString.call(t).toLowerCase()},GHInput.prototype.set=function(t,n){if(n)this.setCoord(t,n);else if(this.input=t,GHInput.isObject(t))this.setCoord(t.lat,t.lng);else if(GHInput.isString(t)){var o=t.indexOf(",");o>=0&&(this.lat=this.round(parseFloat(t.substr(0,o))),this.lng=this.round(parseFloat(t.substr(o+1))))}},GHInput.prototype.toString=function(){if(void 0!==this.lat&&void 0!==this.lng)return this.lat+","+this.lng},module.exports=GHInput;
},{}],38:[function(_dereq_,module,exports){
let GHUtil=function(){};GHUtil.prototype.clone=function(t){let e={};for(let o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e},GHUtil.prototype.decodePath=function(t,e){let o=t.length,r=0,n=[],i=0,l=0,s=0;for(;r<o;){let o,a=0,c=0;do{c|=(31&(o=t.charCodeAt(r++)-63))<<a,a+=5}while(o>=32);i+=1&c?~(c>>1):c>>1,a=0,c=0;do{c|=(31&(o=t.charCodeAt(r++)-63))<<a,a+=5}while(o>=32);if(l+=1&c?~(c>>1):c>>1,e){a=0,c=0;do{c|=(31&(o=t.charCodeAt(r++)-63))<<a,a+=5}while(o>=32);s+=1&c?~(c>>1):c>>1,n.push([1e-5*l,1e-5*i,s/100])}else n.push([1e-5*l,1e-5*i])}return n},GHUtil.prototype.extractError=function(t,e){let o;return t&&t.data?(o=t.data).hints&&o.hints[0]&&o.hints[0].message?o=o.hints[0].message:o.message&&(o=o.message):o=t,new Error(o+" - for url "+e)},GHUtil.prototype.isArray=function(t){return"[object array]"===Object.prototype.toString.call(t).toLowerCase()},GHUtil.prototype.isObject=function(t){return"[object object]"===Object.prototype.toString.call(t).toLowerCase()},GHUtil.prototype.isString=function(t){return"string"==typeof t},module.exports=GHUtil;
},{}],39:[function(_dereq_,module,exports){
let request=_dereq_("axios"),GHUtil=_dereq_("./GHUtil"),ghUtil=new GHUtil;GraphHopperGeocoding=function(t,e){this.defaults={debug:!1,locale:"en"},e&&Object.keys(e).forEach(t=>{this.defaults[t]=e[t]}),this.key=t.key,this.host=t.host?t.host:"https://graphhopper.com/api/1",this.endpoint=t.endpoint?t.endpoint:"/geocode",this.timeout=t.timeout?t.timeout:1e4},GraphHopperGeocoding.prototype.getParametersAsQueryString=function(t){let e="locale="+t.locale;return t.query?(e+="&q="+encodeURIComponent(t.query),t.location_bias?e+="&point="+encodeURIComponent(t.location_bias.toString()):t.point&&(e+="&point="+encodeURIComponent(t.point.toString()))):(e+="&reverse=true",t.point&&(e+="&point="+encodeURIComponent(t.point.toString()))),t.debug&&(e+="&debug=true"),t.limit&&(e+="&limit="+t.limit),e},GraphHopperGeocoding.prototype.doRequest=function(t){t||(t={}),Object.keys(this.defaults).forEach(e=>{t[e]||(t[e]=this.defaults[e])});let e=this.host+this.endpoint+"?"+this.getParametersAsQueryString(t)+"&key="+this.key,o=this;return new Promise(function(t,i){request.get(e,{timeout:o.timeout}).then(o=>{200!==o.status?i(ghUtil.extractError(o,e)):o&&t(o.data)}).catch(t=>{i(ghUtil.extractError(t.response,e))})})},module.exports=GraphHopperGeocoding;
},{"./GHUtil":38,"axios":1}],40:[function(_dereq_,module,exports){
let request=_dereq_("axios"),GHUtil=_dereq_("./GHUtil"),ghUtil=new GHUtil;GraphHopperIsochrone=function(t,e){this.defaults={time_limit:600,distance_limit:0,buckets:3,profile:"car",debug:!1,reverse_flow:!1},e&&Object.keys(e).forEach(t=>{this.defaults[t]=e[t]}),this.key=t.key,this.host=t.host?t.host:"https://graphhopper.com/api/1",this.endpoint=t.endpoint?t.endpoint:"/isochrone",this.timeout=t.timeout?t.timeout:3e4},GraphHopperIsochrone.prototype.getParametersAsQueryString=function(t){let e="point="+t.point;return e+="&time_limit="+t.time_limit,e+="&distance_limit="+t.distance_limit,e+="&buckets="+t.buckets,e+="&profile="+t.profile,e+="&reverse_flow="+t.reverse_flow,t.debug&&(e+="&debug=true"),e},GraphHopperIsochrone.prototype.doRequest=function(t){Object.keys(this.defaults).forEach(e=>{t[e]||(t[e]=this.defaults[e])});let e=this.host+this.endpoint+"?"+this.getParametersAsQueryString(t)+"&key="+this.key,i=this;return new Promise(function(t,r){request.get(e,{timeout:i.timeout}).then(i=>{200!==i.status?r(ghUtil.extractError(i,e)):i&&t(i.data)}).catch(t=>{r(ghUtil.extractError(t.response,e))})})},module.exports=GraphHopperIsochrone;
},{"./GHUtil":38,"axios":1}],41:[function(_dereq_,module,exports){
let request=_dereq_("axios"),GHUtil=_dereq_("./GHUtil"),ghUtil=new GHUtil;GraphHopperMapMatching=function(t,e){this.defaults={profile:"car",gps_accuracy:20,debug:!1,max_visited_nodes:3e3,locale:"en",points_encoded:!0,instructions:!0,elevation:!0,data_type:"json"},e&&Object.keys(e).forEach(t=>{this.defaults[t]=e[t]}),this.key=t.key,this.host=t.host?t.host:"https://graphhopper.com/api/1",this.endpoint=t.endpoint?t.endpoint:"/match",this.timeout=t.timeout?t.timeout:1e5},GraphHopperMapMatching.prototype.getParametersAsQueryString=function(t){let e="locale="+t.locale;return e+="&vehicle="+t.profile,e+="&gps_accuracy="+t.gps_accuracy,e+="&max_visited_nodes="+t.max_visited_nodes,e+="&type="+t.data_type,e+="&instructions="+t.instructions,e+="&points_encoded="+t.points_encoded,e+="&elevation="+t.elevation,t.debug&&(e+="&debug=true"),e},GraphHopperMapMatching.prototype.doRequest=function(t,e){e||(e={}),Object.keys(this.defaults).forEach(t=>{e[t]||(e[t]=this.defaults[t])});let i=this.host+this.endpoint+"?"+this.getParametersAsQueryString(e)+"&key="+this.key,o=this.timeout;return new Promise(function(a,s){request.post(i,t,{timeout:o,headers:{"Content-Type":"application/xml"}}).then(t=>{if(200!==t.status)s(ghUtil.extractError(t,i));else if(t){if(t.data.paths)for(let i=0;i<t.data.paths.length;i++){let o=t.data.paths[i];if(o.points_encoded){let t=ghUtil.decodePath(o.points,e.elevation);o.points={type:"LineString",coordinates:t},delete o.snapped_waypoints}}a(t.data)}}).catch(t=>{s(ghUtil.extractError(t.response,i))})})},module.exports=GraphHopperMapMatching;
},{"./GHUtil":38,"axios":1}],42:[function(_dereq_,module,exports){
let request=_dereq_("axios"),GHUtil=_dereq_("./GHUtil"),ghUtil=new GHUtil;GraphHopperMatrix=function(t,e){this.defaults={profile:"car",debug:!1,out_arrays:["times"]},e&&Object.keys(e).forEach(t=>{this.defaults[t]=e[t]}),this.key=t.key,this.host=t.host?t.host:"https://graphhopper.com/api/1",this.endpoint=t.endpoint?t.endpoint:"/matrix",this.timeout=t.timeout?t.timeout:3e4},GraphHopperMatrix.prototype.doRequest=function(t){Object.keys(this.defaults).forEach(e=>{t[e]||(t[e]=this.defaults[e])}),t.from_points||t.to_points||(t.from_points=t.points,t.to_points=t.points,delete t.points);let e=this.host+this.endpoint+"?key="+this.key,o=this;return new Promise(function(r,i){request.post(e,t,{timeout:o.timeout,headers:{"Content-Type":"application/json"}}).then(t=>{200!==t.status?i(ghUtil.extractError(t,e)):t&&r(t.data)}).catch(t=>{i(ghUtil.extractError(t.response,e))})})},GraphHopperMatrix.prototype.toHtmlTable=function(t,e){let o=t.to_points,r=t.from_points,i="<table border='1' cellpadding='10'>";i+="<tr>",i+="<td>↓ from \ to →</td>";for(let t in o)i+="<td><b>"+o[t][1]+","+o[t][0]+"</b></td>";i+="</tr>";for(let p in e){i+="<tr>",i+="<td><b>"+r[p][1]+","+r[p][0]+"</b></td>";let s=e[p];for(let e in s){i+="<td> <a href='"+("https://graphhopper.com/maps?point="+encodeURIComponent(r[p][1]+","+r[p][0])+"&point="+encodeURIComponent(o[e][1]+","+o[e][0])+"&profile="+t.profile)+"'>"+s[e]+"</a> </td>"}i+="</tr>\n"}return i+="</table>"},module.exports=GraphHopperMatrix;
},{"./GHUtil":38,"axios":1}],43:[function(_dereq_,module,exports){
let request=_dereq_("axios"),GHUtil=_dereq_("./GHUtil"),ghUtil=new GHUtil;GraphHopperOptimization=function(e){this.key=e.key,this.host=e.host?e.host:"https://graphhopper.com/api/1",this.endpoint=e.endpoint?e.endpoint:"/vrp",this.timeout=e.timeout?e.timeout:1e4,this.waitInMillis=e.waitInMillis?e.waitInMillis:1e3,this.postTimeout=e.postTimeout?e.postTimeout:1e4},GraphHopperOptimization.prototype.doVRPRequest=function(e,t){let i=e[0],s=[];for(let t in e){if(t<1)continue;let i=e[t],o={id:"_"+t,type:"pickup",name:"maintenance "+t,address:{location_id:"_location_"+t,lon:i[0],lat:i[1]}};s.push(o)}let o=[];for(let e=0;e<t;e++)o.push({vehicle_id:"_vehicle_"+e,start_address:{location_id:"_start_location",lon:i[0],lat:i[1]},type_id:"_vtype_1"});let n={algorithm:{problem_type:"min-max"},vehicles:o,vehicle_types:[{type_id:"_vtype_1",profile:"car"}],services:s};return this.doRequest(n)},GraphHopperOptimization.prototype.doRawRequest=function(e){let t=this;return new Promise(function(i,s){let o=t.host+t.endpoint+"/optimize?key="+t.key;request.post(o,e,{timeout:t.postTimeout,headers:{"Content-Type":"application/json"}}).then(e=>{if(200!==e.status)s(ghUtil.extractError(e,o));else if(e){let o,n=t.host+t.endpoint+"/solution/"+e.data.job_id+"?key="+t.key,l=function(){request.get(n,{timeout:t.timeout}).then(e=>{200!==e.status||void 0===e.data?(clearInterval(o),s(ghUtil.extractError(e,n))):e&&("finished"===e.data.status?(clearInterval(o),i(e.data)):e.data.message&&(clearInterval(o),i(e.data)))})};t.waitInMillis>0?o=setInterval(l,t.waitInMillis):l()}}).catch(e=>{s(ghUtil.extractError(e.response,o))})})},GraphHopperOptimization.prototype.doRequest=function(e){let t={},i={},s={},o={},n={},l={},r=!1,a=!1;if(e.cost_matrices&&e.cost_matrices.length>0&&(a=!0),e.configuration&&!a&&!0===e.configuration.routing.calc_points&&(r=!0),r||e.configuration||a||(e.configuration={routing:{calc_points:!0}}),e.vehicle_types)for(let s=0;s<e.vehicle_types.length;s++){let o=e.vehicle_types[s];t[o.type_id]=o.profile,i[o.type_id]=o}if(e.services)for(let t=0;t<e.services.length;t++){let i=e.services[t];l[i.address.location_id]=i.address,o[i.id]=i}if(e.shipments)for(let t=0;t<e.shipments.length;t++){let i=e.shipments[t];l[i.pickup.address.location_id]=i.pickup.address,l[i.delivery.address.location_id]=i.delivery.address,n[i.id]=i}let d={},p={};if(e.vehicles)for(let i=0;i<e.vehicles.length;i++){let o=e.vehicles[i];p[o.vehicle_id]=o;let n=null;if(null!==o.type_id?(n=t[o.type_id],s[o.vehicle_id]=null!==n?n:"car"):s[o.vehicle_id]="car",o.start_address&&(l[o.start_address.location_id]=o.start_address),o.end_address&&(l[o.end_address.location_id]=o.end_address),o.break){let e=o.vehicle_id+"_break";d[e]=o.break}}let c=this.doRawRequest(e);return c.then(function(e){if(e.solution){let t=e.solution;e.raw_solution=JSON.parse(JSON.stringify(t)),t.calc_points=r;for(let e=0;e<t.routes.length;e++){let r=t.routes[e],a=r.vehicle_id,c=s[a];r.profile=c;for(let e=0;e<r.activities.length;e++){let t=r.activities[e];if(t.address=l[t.location_id],t.id){d[t.id]?t.break=d[t.id]:o[t.id]?t.service=o[t.id]:n[t.id]&&(t.shipment=n[t.id])}else{let e=p[a];t.vehicle=e,t.vehicle_type=i[e.type_id]}}}let a=new Array;for(let e=0;e<t.unassigned.services.length;e++){let i=t.unassigned.services[e];a.push(o[i]),a.push(o[i])}t.unassigned_services=a;let c=new Array;for(let e=0;e<t.unassigned.shipments.length;e++){let i=t.unassigned.shipments[e];c.push(n[i])}t.unassigned_shipments=c}return e}),c},module.exports=GraphHopperOptimization;
},{"./GHUtil":38,"axios":1}],44:[function(_dereq_,module,exports){
let request=_dereq_("axios");var GHUtil=_dereq_("./GHUtil");let ghUtil=new GHUtil;GraphHopperRouting=function(t,e){this.defaults={profile:"car",debug:!1,locale:"en",points_encoded:!0,instructions:!0,elevation:!0,optimize:"false"},e&&Object.keys(e).forEach(t=>{this.defaults[t]=e[t]}),this.key=t.key,this.host=t.host?t.host:"https://graphhopper.com/api/1",this.endpoint=t.endpoint?t.endpoint:"/route",this.timeout=t.timeout?t.timeout:1e4,this.turn_sign_map=t.turn_sign_map?t.turn_sign_map:{"-6":"leave roundabout","-3":"turn sharp left","-2":"turn left","-1":"turn slight left",0:"continue",1:"turn slight right",2:"turn right",3:"turn sharp right",4:"finish",5:"reached via point",6:"enter roundabout"}},GraphHopperRouting.prototype.doRequest=function(t){Object.keys(this.defaults).forEach(e=>{t[e]||(t[e]=this.defaults[e])});let e=this.host+this.endpoint+"?key="+this.key,i=this;return new Promise((o,n)=>{request.post(e,t,{timeout:i.timeout,headers:{"Content-Type":"application/json"}}).then(i=>{if(200===i.status){if(i.data.paths)for(let e=0;e<i.data.paths.length;e++){let o=i.data.paths[e];if(o.points_encoded){let e=ghUtil.decodePath(o.points,t.elevation);o.points={type:"LineString",coordinates:e};let i=ghUtil.decodePath(o.snapped_waypoints,t.elevation);o.snapped_waypoints={type:"LineString",coordinates:i}}if(o.instructions)for(let t=0;t<o.instructions.length;t++){let e=o.instructions[t].interval;o.instructions[t].points=o.points.coordinates.slice([e[0],e[1]+1])}}o(i.data)}else n(ghUtil.extractError(i,e))}).catch(t=>{n(ghUtil.extractError(t.response,e))})})},GraphHopperRouting.prototype.info=function(){let t=this;return new Promise((e,i)=>{let o=t.host+"/info?key="+t.key;request.get(o,{timeout:t.timeout,headers:{"Content-Type":"application/json"}}).then(t=>{200===t.status?e(t.data):i(ghUtil.extractError(t,o))}).catch(t=>{console.log(t),i(ghUtil.extractError(t.response,o))})})},GraphHopperRouting.prototype.i18n=function(t){let e=t&&t.locale?t.locale:this.defaults.locale,i=this;return new Promise((t,o)=>{let n=i.host+"/i18n/"+e+"?key="+i.key;request.get(n,{timeout:i.timeout,headers:{"Content-Type":"application/json"}}).then(e=>{200===e.status?t(e.data):o(ghUtil.extractError(e,n))}).catch(t=>{o(ghUtil.extractError(t.response,n))})})},GraphHopperRouting.prototype.getTurnText=function(t){return this.turn_sign_map[t]},module.exports=GraphHopperRouting;
},{"./GHUtil":38,"axios":1}],45:[function(_dereq_,module,exports){
var GHUtil=_dereq_("./GHUtil.js"),GHInput=_dereq_("./GHInput.js"),GraphHopperGeocoding=_dereq_("./GraphHopperGeocoding.js"),GraphHopperIsochrone=_dereq_("./GraphHopperIsochrone.js"),GraphHopperMapMatching=_dereq_("./GraphHopperMapMatching.js"),GraphHopperMatrix=_dereq_("./GraphHopperMatrix.js"),GraphHopperOptimization=_dereq_("./GraphHopperOptimization.js"),GraphHopperRouting=_dereq_("./GraphHopperRouting.js"),GraphHopper={Util:GHUtil,Input:GHInput,Geocoding:GraphHopperGeocoding,Isochrone:GraphHopperIsochrone,MapMatching:GraphHopperMapMatching,Optimization:GraphHopperOptimization,Routing:GraphHopperRouting,Matrix:GraphHopperMatrix};"object"==typeof module&&"object"==typeof module.exports?module.exports.GraphHopper=GraphHopper:"function"==typeof define&&define.amd&&define(GraphHopper),"undefined"!=typeof window&&(window.GraphHopper=GraphHopper);
},{"./GHInput.js":37,"./GHUtil.js":38,"./GraphHopperGeocoding.js":39,"./GraphHopperIsochrone.js":40,"./GraphHopperMapMatching.js":41,"./GraphHopperMatrix.js":42,"./GraphHopperOptimization.js":43,"./GraphHopperRouting.js":44}]},{},[45]);