mapbox-gl
Version:
A WebGL interactive maps library
2 lines • 72 kB
JavaScript
!function e(t,n,r){function i(u,s){if(!n[u]){if(!t[u]){var c="function"==typeof require&&require;if(!s&&c)return c(u,!0);if(o)return o(u,!0);var a=new Error("Cannot find module '"+u+"'");throw a.code="MODULE_NOT_FOUND",a}var f=n[u]={exports:{}};t[u][0].call(f.exports,function(e){var n=t[u][1][e];return i(n?n:e)},f,f.exports,e,t,n,r)}return n[u].exports}for(var o="function"==typeof require&&require,u=0;u<r.length;u++)i(r[u]);return i}({1:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=e("./src/geocoder"),o=r(i);window.mapboxgl?mapboxgl.Geocoder=o["default"]:"undefined"!=typeof t&&(t.exports=o["default"])},{"./src/geocoder":65}],2:[function(e,t,n){function r(e,t){return d.isUndefined(t)?""+t:d.isNumber(t)&&!isFinite(t)?t.toString():d.isFunction(t)||d.isRegExp(t)?t.toString():t}function i(e,t){return d.isString(e)?e.length<t?e:e.slice(0,t):e}function o(e){return i(JSON.stringify(e.actual,r),128)+" "+e.operator+" "+i(JSON.stringify(e.expected,r),128)}function u(e,t,n,r,i){throw new y.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function s(e,t){e||u(e,!0,t,"==",y.ok)}function c(e,t){if(e===t)return!0;if(d.isBuffer(e)&&d.isBuffer(t)){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return d.isDate(e)&&d.isDate(t)?e.getTime()===t.getTime():d.isRegExp(e)&&d.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:d.isObject(e)||d.isObject(t)?f(e,t):e==t}function a(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function f(e,t){if(d.isNullOrUndefined(e)||d.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(d.isPrimitive(e)||d.isPrimitive(t))return e===t;var n=a(e),r=a(t);if(n&&!r||!n&&r)return!1;if(n)return e=h.call(e),t=h.call(t),c(e,t);var i,o,u=v(e),s=v(t);if(u.length!=s.length)return!1;for(u.sort(),s.sort(),o=u.length-1;o>=0;o--)if(u[o]!=s[o])return!1;for(o=u.length-1;o>=0;o--)if(i=u[o],!c(e[i],t[i]))return!1;return!0}function l(e,t){return e&&t?"[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t?!0:t.call({},e)===!0?!0:!1:!1}function p(e,t,n,r){var i;d.isString(n)&&(r=n,n=null);try{t()}catch(o){i=o}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&u(i,n,"Missing expected exception"+r),!e&&l(i,n)&&u(i,n,"Got unwanted exception"+r),e&&i&&n&&!l(i,n)||!e&&i)throw i}var d=e("util/"),h=Array.prototype.slice,m=Object.prototype.hasOwnProperty,y=t.exports=s;y.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=o(this),this.generatedMessage=!0);var t=e.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=t.name,s=r.indexOf("\n"+i);if(s>=0){var c=r.indexOf("\n",s+1);r=r.substring(c+1)}this.stack=r}}},d.inherits(y.AssertionError,Error),y.fail=u,y.ok=s,y.equal=function(e,t,n){e!=t&&u(e,t,n,"==",y.equal)},y.notEqual=function(e,t,n){e==t&&u(e,t,n,"!=",y.notEqual)},y.deepEqual=function(e,t,n){c(e,t)||u(e,t,n,"deepEqual",y.deepEqual)},y.notDeepEqual=function(e,t,n){c(e,t)&&u(e,t,n,"notDeepEqual",y.notDeepEqual)},y.strictEqual=function(e,t,n){e!==t&&u(e,t,n,"===",y.strictEqual)},y.notStrictEqual=function(e,t,n){e===t&&u(e,t,n,"!==",y.notStrictEqual)},y["throws"]=function(e,t,n){p.apply(this,[!0].concat(h.call(arguments)))},y.doesNotThrow=function(e,t){p.apply(this,[!1].concat(h.call(arguments)))},y.ifError=function(e){if(e)throw e};var v=Object.keys||function(e){var t=[];for(var n in e)m.call(e,n)&&t.push(n);return t}},{"util/":7}],3:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function o(e){return"number"==typeof e}function u(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!o(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,o,c,a;if(this._events||(this._events={}),"error"===e&&(!this._events.error||u(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],s(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,o=new Array(r-1),c=1;r>c;c++)o[c-1]=arguments[c];n.apply(this,o)}else if(u(n)){for(r=arguments.length,o=new Array(r-1),c=1;r>c;c++)o[c-1]=arguments[c];for(a=n.slice(),r=a.length,c=0;r>c;c++)a[c].apply(this,o)}return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?u(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,u(this._events[e])&&!this._events[e].warned){var n;n=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,o,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(u(n)){for(s=o;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){r=s;break}if(0>r)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?i(e._events[t])?1:e._events[t].length:0}},{}],4:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],5:[function(e,t,n){function r(){f=!1,s.length?a=s.concat(a):l=-1,a.length&&i()}function i(){if(!f){var e=setTimeout(r);f=!0;for(var t=a.length;t;){for(s=a,a=[];++l<t;)s&&s[l].run();l=-1,t=a.length}s=null,f=!1,clearTimeout(e)}}function o(e,t){this.fun=e,this.array=t}function u(){}var s,c=t.exports={},a=[],f=!1,l=-1;c.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new o(e,t)),1!==a.length||f||setTimeout(i,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},c.title="browser",c.browser=!0,c.env={},c.argv=[],c.version="",c.versions={},c.on=u,c.addListener=u,c.once=u,c.off=u,c.removeListener=u,c.removeAllListeners=u,c.emit=u,c.binding=function(e){throw new Error("process.binding is not supported")},c.cwd=function(){return"/"},c.chdir=function(e){throw new Error("process.chdir is not supported")},c.umask=function(){return 0}},{}],6:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],7:[function(e,t,n){(function(t,r){function i(e,t){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(t)?r.showHidden=t:t&&n._extend(r,t),x(r.showHidden)&&(r.showHidden=!1),x(r.depth)&&(r.depth=2),x(r.colors)&&(r.colors=!1),x(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),c(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function u(e,t){return e}function s(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function c(e,t,r){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return w(i)||(i=c(e,i,r)),i}var o=a(e,t);if(o)return o;var u=Object.keys(t),m=s(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(t)),T(t)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return f(t);if(0===u.length){if(O(t)){var y=t.name?": "+t.name:"";return e.stylize("[Function"+y+"]","special")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(j(t))return e.stylize(Date.prototype.toString.call(t),"date");if(T(t))return f(t)}var v="",g=!1,b=["{","}"];if(h(t)&&(g=!0,b=["[","]"]),O(t)){var x=t.name?": "+t.name:"";v=" [Function"+x+"]"}if(_(t)&&(v=" "+RegExp.prototype.toString.call(t)),j(t)&&(v=" "+Date.prototype.toUTCString.call(t)),T(t)&&(v=" "+f(t)),0===u.length&&(!g||0==t.length))return b[0]+v+b[1];if(0>r)return _(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var E;return E=g?l(e,t,r,m,u):u.map(function(n){return p(e,t,r,m,n,g)}),e.seen.pop(),d(E,v,b)}function a(e,t){if(x(t))return e.stylize("undefined","undefined");if(w(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return g(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,n,r,i){for(var o=[],u=0,s=t.length;s>u;++u)C(t,String(u))?o.push(p(e,t,n,r,String(u),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(p(e,t,n,r,i,!0))}),o}function p(e,t,n,r,i,o){var u,s,a;if(a=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},a.get?s=a.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):a.set&&(s=e.stylize("[Setter]","special")),C(r,i)||(u="["+i+"]"),s||(e.seen.indexOf(a.value)<0?(s=y(n)?c(e,a.value,null):c(e,a.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),x(u)){if(o&&i.match(/^\d+$/))return s;u=JSON.stringify(""+i),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+s}function d(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function h(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function y(e){return null===e}function v(e){return null==e}function g(e){return"number"==typeof e}function w(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function x(e){return void 0===e}function _(e){return E(e)&&"[object RegExp]"===S(e)}function E(e){return"object"==typeof e&&null!==e}function j(e){return E(e)&&"[object Date]"===S(e)}function T(e){return E(e)&&("[object Error]"===S(e)||e instanceof Error)}function O(e){return"function"==typeof e}function A(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function S(e){return Object.prototype.toString.call(e)}function L(e){return 10>e?"0"+e.toString(10):e.toString(10)}function k(){var e=new Date,t=[L(e.getHours()),L(e.getMinutes()),L(e.getSeconds())].join(":");return[e.getDate(),D[e.getMonth()],t].join(" ")}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var R=/%[sdj%]/g;n.format=function(e){if(!w(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,u=String(e).replace(R,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),s=r[n];o>n;s=r[++n])u+=y(s)||!E(s)?" "+s:" "+i(s);return u},n.deprecate=function(e,i){function o(){if(!u){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),u=!0}return e.apply(this,arguments)}if(x(r.process))return function(){return n.deprecate(e,i).apply(this,arguments)};if(t.noDeprecation===!0)return e;var u=!1;return o};var P,q={};n.debuglog=function(e){if(x(P)&&(P=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!q[e])if(new RegExp("\\b"+e+"\\b","i").test(P)){var r=t.pid;q[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else q[e]=function(){};return q[e]},n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=m,n.isNull=y,n.isNullOrUndefined=v,n.isNumber=g,n.isString=w,n.isSymbol=b,n.isUndefined=x,n.isRegExp=_,n.isObject=E,n.isDate=j,n.isError=T,n.isFunction=O,n.isPrimitive=A,n.isBuffer=e("./support/isBuffer");var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",k(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!E(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":6,_process:5,inherits:4}],8:[function(e,t,n){function r(e,t,n){function r(){v&&clearTimeout(v),d&&clearTimeout(d),w=0,d=v=g=void 0}function o(t,n){n&&clearTimeout(n),d=v=g=void 0,t&&(w=a(),h=e.apply(y,p),v||d||(p=y=void 0))}function c(){var e=t-(a()-m);0>=e||e>t?o(g,d):v=setTimeout(c,e)}function f(){o(x,v)}function l(){if(p=arguments,m=a(),y=this,g=x&&(v||!_),b===!1)var n=_&&!v;else{d||_||(w=m);var r=b-(m-w),i=0>=r||r>b;i?(d&&(d=clearTimeout(d)),w=m,h=e.apply(y,p)):d||(d=setTimeout(f,r))}return i&&v?v=clearTimeout(v):v||t===b||(v=setTimeout(c,t)),n&&(i=!0,h=e.apply(y,p)),!i||v||d||(p=y=void 0),h}var p,d,h,m,y,v,g,w=0,b=!1,x=!0;if("function"!=typeof e)throw new TypeError(u);if(t=0>t?0:+t||0,n===!0){var _=!0;x=!1}else i(n)&&(_=!!n.leading,b="maxWait"in n&&s(+n.maxWait||0,t),x="trailing"in n?!!n.trailing:x);return l.cancel=r,l}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var o=e("lodash._getnative"),u="Expected a function",s=Math.max,c=o(Date,"now"),a=c||function(){return(new Date).getTime()};t.exports=r},{"lodash._getnative":9}],9:[function(e,t,n){function r(e){return!!e&&"object"==typeof e}function i(e,t){var n=null==e?void 0:e[t];return s(n)?n:void 0}function o(e){return u(e)&&d.call(e)==c}function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function s(e){return null==e?!1:o(e)?h.test(l.call(e)):r(e)&&a.test(e)}var c="[object Function]",a=/^\[object .+?Constructor\]$/,f=Object.prototype,l=Function.prototype.toString,p=f.hasOwnProperty,d=f.toString,h=RegExp("^"+l.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=i},{}],10:[function(e,t,n){"use strict";t.exports=function(e){return window.atob(e)}},{}],11:[function(e,t,n){"use strict";var r=e("rest/interceptor"),i=r({success:function(e){var t=e&&e.request,n=t&&t.callback;return"function"==typeof n&&n(null,e.entity),e},error:function(e){var t=e&&e.request,n=t&&t.callback;if("function"==typeof n){var r=e.error||e.entity;"object"!=typeof r&&(r=new Error(r)),n(r)}return e}});t.exports=i},{"rest/interceptor":22}],12:[function(e,t,n){"use strict";var r=e("rest"),i=e("./callbackify");t.exports=function(t){return r.wrap(e("rest/interceptor/errorCode")).wrap(e("rest/interceptor/pathPrefix"),{prefix:t.endpoint}).wrap(e("rest/interceptor/mime"),{mime:"application/json"}).wrap(e("rest/interceptor/defaultRequest"),{params:{access_token:t.accessToken}}).wrap(e("rest/interceptor/template")).wrap(i)}},{"./callbackify":11,rest:18,"rest/interceptor/defaultRequest":23,"rest/interceptor/errorCode":24,"rest/interceptor/mime":25,"rest/interceptor/pathPrefix":26,"rest/interceptor/template":27}],13:[function(e,t,n){t.exports.DEFAULT_ENDPOINT="https://api.mapbox.com",t.exports.API_GEOCODER_FORWARD="/geocoding/v5/{dataset}/{query}.json{?proximity}",t.exports.API_GEOCODER_REVERSE="/geocoding/v5/{dataset}/{longitude},{latitude}.json",t.exports.API_DIRECTIONS="/v4/directions/{profile}/{encodedWaypoints}.json{?alternatives,instructions,geometry,steps}",t.exports.API_DISTANCE="/distances/v1/mapbox/{profile}",t.exports.API_SURFACE="/v4/surface/{mapid}.json{?layer,fields,points,geojson,interpolate,encoded_polyline}",t.exports.API_UPLOADS="/uploads/v1/{owner}",t.exports.API_UPLOAD="/uploads/v1/{owner}/{upload}",t.exports.API_UPLOAD_CREDENTIALS="/uploads/v1/{owner}/credentials",t.exports.API_MATCHING="/matching/v4/{profile}.json",t.exports.API_DATASET_DATASETS="/datasets/v1/{owner}",t.exports.API_DATASET_DATASET="/datasets/v1/{owner}/{dataset}",t.exports.API_DATASET_FEATURES="/datasets/v1/{owner}/{dataset}/features{?reverse,limit,start}",t.exports.API_DATASET_FEATURE="/datasets/v1/{owner}/{dataset}/features/{id}",t.exports.API_TILESTATS_STATISTICS="/tilestats/v1/{owner}/{tileset}",t.exports.API_TILESTATS_LAYER="/tilestats/v1/{owner}/{tileset}/{layer}",t.exports.API_TILESTATS_ATTRIBUTE="/tilestats/v1/{owner}/{tileset}/{layer}/{attribute}",t.exports.API_STATIC="/v4/{mapid}{+overlay}/{+xyz}/{width}x{height}{+retina}{.format}"},{}],14:[function(e,t,n){(function(n){"use strict";function r(e){var t=e.split(".")[1];if(!t)return null;if(t=t.replace(/-/g,"+").replace(/_/g,"/"),n.browser)t=t.replace(/=/g,"");else{var r=t.length%4;if(2===r&&(t+="=="),3===r&&(t+="="),1===r||r>3)return null}try{return JSON.parse(i(t)).u}catch(o){return null}}var i=e("atob");t.exports=r}).call(this,e("_process"))},{_process:5,atob:10}],15:[function(e,t,n){"use strict";function r(e){function t(t,n){this.name=e,i("string"==typeof t,"accessToken required to instantiate Mapbox client");var r=o.DEFAULT_ENDPOINT;void 0!==n&&(i("object"==typeof n,"options must be an object"),n.endpoint&&(i("string"==typeof n.endpoint,"endpoint must be a string"),r=n.endpoint),n.account&&(i("string"==typeof n.account,"account must be a string"),this.owner=n.account)),this.client=u({endpoint:r,accessToken:t}),this.accessToken=t,this.endpoint=r,this.owner=this.owner||s(t),i(!!this.owner,"could not determine account from provided accessToken")}return t}var i=e("assert"),o=e("./constants"),u=e("./client"),s=e("./get_user");t.exports=r},{"./client":12,"./constants":13,"./get_user":14,assert:2}],16:[function(e,t,n){"use strict";function r(e,t){var n=Math.pow(10,t);return Math.round(e*n)/n}var i=e("assert"),o=e("../make_service"),u=e("../constants"),s=o("MapboxGeocoder"),c=5,a=3;s.prototype.geocodeForward=function(e,t,n){void 0===n&&"function"==typeof t&&(n=t,t={}),i("string"==typeof e,"query must be a string"),i("object"==typeof t,"options must be an object"),i("function"==typeof n,"callback must be a function");var o={query:e,dataset:"mapbox.places"},s=a;t.precision&&(i("number"==typeof t.precision,"precision option must be number"),s=t.precision),t.proximity&&(i("number"==typeof t.proximity.latitude&&"number"==typeof t.proximity.longitude,"proximity must be an object with numeric latitude & longitude properties"),o.proximity=r(t.proximity.longitude,s)+","+r(t.proximity.latitude,s)),t.dataset&&(i("string"==typeof t.dataset,"dataset option must be string"),o.dataset=t.dataset),this.client({path:u.API_GEOCODER_FORWARD,params:o,callback:n})},s.prototype.geocodeReverse=function(e,t,n){void 0===n&&"function"==typeof t&&(n=t,t={}),i("object"==typeof e,"location must be an object"),i("object"==typeof t,"options must be an object"),i("function"==typeof n,"callback must be a function"),i("number"==typeof e.latitude&&"number"==typeof e.longitude,"location must be an object with numeric latitude & longitude properties");var o="mapbox.places";t.dataset&&(i("string"==typeof t.dataset,"dataset option must be string"),o=t.dataset);var s=c;t.precision&&(i("number"==typeof t.precision,"precision option must be number"),s=t.precision),this.client({path:u.API_GEOCODER_REVERSE,params:{longitude:r(e.longitude,s),latitude:r(e.latitude,s),dataset:o},callback:n})},t.exports=s},{"../constants":13,"../make_service":15,assert:2}],17:[function(e,t,n){!function(e,t){"use strict";var n;e(function(e){function r(e,t){var n,r,i,o;if(n=e,i={},t){for(r in t)o=new RegExp("\\{"+r+"\\}"),o.test(n)?n=n.replace(o,encodeURIComponent(t[r]),"g"):i[r]=t[r];for(r in i)n+=-1===n.indexOf("?")?"?":"&",n+=encodeURIComponent(r),null!==i[r]&&void 0!==i[r]&&(n+="=",n+=encodeURIComponent(i[r]))}return n}function i(e,t){return 0===e.indexOf(t)}function o(e,t){return this instanceof o?void(e instanceof o?(this._template=e.template,this._params=u({},this._params,t)):(this._template=(e||"").toString(),this._params=t||{})):new o(e,t)}var u,s,c,a,f;return u=e("./util/mixin"),c=/([a-z][a-z0-9\+\-\.]*:)\/\/([^@]+@)?(([^:\/]+)(:([0-9]+))?)?(\/[^?#]*)?(\?[^#]*)?(#\S*)?/i,a=/^([a-z][a-z0-9\-\+\.]*:\/\/|\/)/i,f=/([a-z][a-z0-9\+\-\.]*:)\/\/([^@]+@)?(([^:\/]+)(:([0-9]+))?)?\//i,o.prototype={append:function(e,t){return new o(this._template+e,u({},this._params,t))},fullyQualify:function(){if(!t)return this;if(this.isFullyQualified())return this;var e=this._template;return i(e,"//")?e=s.protocol+e:i(e,"/")?e=s.origin+e:this.isAbsolute()||(e=s.origin+s.pathname.substring(0,s.pathname.lastIndexOf("/")+1)),-1===e.indexOf("/",8)&&(e+="/"),new o(e,this._params)},isAbsolute:function(){return a.test(this.build())},isFullyQualified:function(){return f.test(this.build())},isCrossOrigin:function(){if(!s)return!0;var e=this.parts();return e.protocol!==s.protocol||e.hostname!==s.hostname||e.port!==s.port},parts:function(){var e,t;return e=this.fullyQualify().build().match(c),t={href:e[0],protocol:e[1],host:e[3]||"",hostname:e[4]||"",port:e[6],pathname:e[7]||"",search:e[8]||"",hash:e[9]||""},t.origin=t.protocol+"//"+t.host,t.port=t.port||("https:"===t.protocol?"443":"http:"===t.protocol?"80":""),t},build:function(e){return r(this._template,u({},this._params,e))},toString:function(){return this.build()}},s=t?new o(t.href).parts():n,o})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)},"undefined"!=typeof window?window.location:void 0)},{"./util/mixin":55}],18:[function(e,t,n){!function(e){"use strict";e(function(e){var t=e("./client/default"),n=e("./client/xhr");return t.setPlatformDefaultClient(n),t})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"./client/default":20,"./client/xhr":21}],19:[function(e,t,n){!function(e){"use strict";e(function(){return function(e,t){return t&&(e.skip=function(){return t}),e.wrap=function(t,n){return t(e,n)},e.chain=function(){return"undefined"!=typeof console&&console.log("rest.js: client.chain() is deprecated, use client.wrap() instead"),e.wrap.apply(this,arguments)},e}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],20:[function(e,t,n){!function(e){"use strict";var t;e(function(e){function n(){return i.apply(t,arguments)}var r,i,o;return r=e("../client"),n.setDefaultClient=function(e){i=e},n.getDefaultClient=function(){return i},n.resetDefaultClient=function(){i=o},n.setPlatformDefaultClient=function(e){if(o)throw new Error("Unable to redefine platformDefaultClient");i=o=e},r(n)})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../client":19}],21:[function(e,t,n){!function(e,t){"use strict";e(function(e){function n(e){var t={};return e?(e.trim().split(a).forEach(function(e){var n,r,i;n=e.indexOf(":"),r=u(e.substring(0,n).trim()),i=e.substring(n+1).trim(),t[r]?Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i}),t):t}function r(e,t){return Object.keys(t||{}).forEach(function(n){if(t.hasOwnProperty(n)&&n in e)try{e[n]=t[n]}catch(r){}}),e}var i,o,u,s,c,a;return i=e("when"),o=e("../UrlBuilder"),u=e("../util/normalizeHeaderName"),s=e("../util/responsePromise"),c=e("../client"),a=/[\r|\n]+/,c(function(e){return s.promise(function(i,u){var s,c,a,f,l,p,d,h;if(e="string"==typeof e?{path:e}:e||{},d={request:e},e.canceled)return d.error="precanceled",void u(d);if(h=e.engine||t.XMLHttpRequest,!h)return void u({request:e,error:"xhr-not-available"});l=e.entity,e.method=e.method||(l?"POST":"GET"),c=e.method,a=new o(e.path||"",e.params).build();try{s=d.raw=new h,r(s,e.mixin),s.open(c,a,!0),r(s,e.mixin),f=e.headers;for(p in f)("Content-Type"!==p||"multipart/form-data"!==f[p])&&s.setRequestHeader(p,f[p]);e.canceled=!1,e.cancel=function(){e.canceled=!0,s.abort(),u(d)},s.onreadystatechange=function(){e.canceled||s.readyState===(h.DONE||4)&&(d.status={code:s.status,text:s.statusText},d.headers=n(s.getAllResponseHeaders()),d.entity=s.responseText,d.status.code>0?i(d):setTimeout(function(){i(d)},0))};try{s.onerror=function(){d.error="loaderror",u(d)}}catch(m){}s.send(l)}catch(m){d.error="loaderror",u(d)}})})})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)},"undefined"!=typeof window?window:void 0)},{"../UrlBuilder":17,"../client":19,"../util/normalizeHeaderName":56,"../util/responsePromise":57,when:52}],22:[function(e,t,n){!function(e){"use strict";e(function(e){function t(e){return e}function n(e){return e}function r(e){return e}function i(e){return l.promise(function(t,n){e.forEach(function(e){l(e,t,n)})})}function o(e){return this instanceof o?void c(this,e):new o(e)}function u(e){var u,c,p,d;return e=e||{},u=e.init||t,c=e.request||n,p=e.success||e.response||r,d=e.error||function(){return l((e.response||r).apply(this,arguments),l.reject,l.reject)},function(t,n){function r(e){var u,s;return u={},s={arguments:Array.prototype.slice.call(arguments),client:r},e="string"==typeof e?{path:e}:e||{},e.originator=e.originator||r,a(c.call(u,e,n,s),function(e){var r,c,a;return a=t,e instanceof o&&(c=e.abort,a=e.client||a,r=e.response,e=e.request),r=r||l(e,function(e){return l(a(e),function(e){return p.call(u,e,n,s)},function(e){return d.call(u,e,n,s)})}),c?i([r,c]):r},function(t){return l.reject({request:e,error:t})})}return"object"==typeof t&&(n=t),"function"!=typeof t&&(t=e.client||s),n=u(n||{}),f(r,t)}}var s,c,a,f,l;return s=e("./client/default"),c=e("./util/mixin"),a=e("./util/responsePromise"),f=e("./client"),l=e("when"),u.ComplexRequest=o,u})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"./client":19,"./client/default":20,"./util/mixin":55,"./util/responsePromise":57,when:52}],23:[function(e,t,n){!function(e){"use strict";e(function(e){var t,n,r;return t=e("../interceptor"),n=e("../util/mixin"),r=function(){function e(e,t,r){(e in t||e in r)&&(t[e]=n({},r[e],t[e]))}function t(e,t,n){e in n&&!(e in t)&&(t[e]=n[e])}var r={method:t,path:t,params:e,headers:e,entity:t,mixin:e};return function(e,t){for(var n in r)r[n](n,e,t);return e}}(),t({request:function(e,t){return r(e,t)}})})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../interceptor":22,"../util/mixin":55}],24:[function(e,t,n){!function(e){"use strict";e(function(e){var t,n;return t=e("../interceptor"),n=e("when"),t({init:function(e){return e.code=e.code||400,e},response:function(e,t){return e.status&&e.status.code>=t.code?n.reject(e):e}})})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../interceptor":22,when:52}],25:[function(e,t,n){!function(e){"use strict";e(function(e){var t,n,r,i,o;return t=e("../interceptor"),n=e("../mime"),r=e("../mime/registry"),o=e("when"),i={read:function(e){return e},write:function(e){return e}},t({init:function(e){return e.registry=e.registry||r,e},request:function(e,t){var r,u;return u=e.headers||(e.headers={}),r=n.parse(u["Content-Type"]=u["Content-Type"]||t.mime||"text/plain"),u.Accept=u.Accept||t.accept||r.raw+", application/json;q=0.8, text/plain;q=0.5, */*;q=0.2","entity"in e?t.registry.lookup(r).otherwise(function(){if(t.permissive)return i;throw"mime-unknown"}).then(function(n){var i=t.client||e.originator;return o.attempt(n.write,e.entity,{client:i,request:e,mime:r,registry:t.registry}).otherwise(function(){throw"mime-serialization"}).then(function(t){return e.entity=t,e})}):e},response:function(e,t){if(!(e.headers&&e.headers["Content-Type"]&&e.entity))return e;var r=n.parse(e.headers["Content-Type"]);return t.registry.lookup(r).otherwise(function(){return i}).then(function(n){var i=t.client||e.request&&e.request.originator;return o.attempt(n.read,e.entity,{client:i,response:e,mime:r,registry:t.registry}).otherwise(function(t){throw e.error="mime-deserialization",e.cause=t,e}).then(function(t){return e.entity=t,e})})}})})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../interceptor":22,"../mime":28,"../mime/registry":29,when:52}],26:[function(e,t,n){!function(e){"use strict";e(function(e){function t(e,t){return 0===e.indexOf(t)}function n(e,t){return e.lastIndexOf(t)+t.length===e.length}var r,i;return r=e("../interceptor"),i=e("../UrlBuilder"),r({request:function(e,r){var o;return r.prefix&&!new i(e.path).isFullyQualified()&&(o=r.prefix,e.path&&(n(o,"/")||t(e.path,"/")||(o+="/"),o+=e.path),e.path=o),e}})})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../UrlBuilder":17,"../interceptor":22}],27:[function(e,t,n){!function(e){"use strict";e(function(e){var t,n,r;return t=e("../interceptor"),n=e("../util/uriTemplate"),r=e("../util/mixin"),t({init:function(e){return e.params=e.params||{},e.template=e.template||"",e},request:function(e,t){var i,o;return i=e.path||t.template,o=r({},e.params,t.params),e.path=n.expand(i,o),delete e.params,e}})})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../interceptor":22,"../util/mixin":55,"../util/uriTemplate":59}],28:[function(e,t,n){!function(e){"use strict";var t;e(function(){function e(e){var n,r;return n=e.split(";"),r=n[0].trim().split("+"),{raw:e,type:r[0],suffix:r[1]?"+"+r[1]:"",params:n.slice(1).reduce(function(e,n){return n=n.split("="),e[n[0].trim()]=n[1]?n[1].trim():t,e},{})}}return{parse:e}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],29:[function(e,t,n){!function(e){"use strict";e(function(e){function t(e){this.lookup=function(t){var i;return i="string"==typeof t?n.parse(t):t,e[i.raw]?e[i.raw]:e[i.type+i.suffix]?e[i.type+i.suffix]:e[i.type]?e[i.type]:e[i.suffix]?e[i.suffix]:r.reject(new Error('Unable to locate converter for mime "'+i.raw+'"'));
},this.delegate=function(e){return{read:function(){var t=arguments;return this.lookup(e).then(function(e){return e.read.apply(this,t)}.bind(this))}.bind(this),write:function(){var t=arguments;return this.lookup(e).then(function(e){return e.write.apply(this,t)}.bind(this))}.bind(this)}},this.register=function(t,n){return e[t]=r(n),e[t]},this.child=function(){return new t(Object.create(e))}}var n,r,i;return n=e("../mime"),r=e("when"),i=new t({}),i.register("application/hal",e("./type/application/hal")),i.register("application/json",e("./type/application/json")),i.register("application/x-www-form-urlencoded",e("./type/application/x-www-form-urlencoded")),i.register("multipart/form-data",e("./type/multipart/form-data")),i.register("text/plain",e("./type/text/plain")),i.register("+json",i.delegate("application/json")),i})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../mime":28,"./type/application/hal":30,"./type/application/json":31,"./type/application/x-www-form-urlencoded":32,"./type/multipart/form-data":33,"./type/text/plain":34,when:52}],30:[function(e,t,n){!function(e){"use strict";e(function(e){function t(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!1,writeable:!0})}var n,r,i,o,u,s;return n=e("../../../interceptor/pathPrefix"),r=e("../../../interceptor/template"),i=e("../../../util/find"),o=e("../../../util/lazyPromise"),u=e("../../../util/responsePromise"),s=e("when"),{read:function(e,c){function a(e,t){(t&&l&&l.warn||l.log)&&(l.warn||l.log).call(l,"Relationship '"+e+"' is deprecated, see "+t)}var f,l;return c=c||{},f=c.client,l=c.console||l,c.registry.lookup(c.mime.suffix).then(function(l){return s(l.read(e,c)).then(function(e){return i.findProperties(e,"_embedded",function(e,n,r){Object.keys(e).forEach(function(r){if(!(r in n)){var i=u({entity:e[r]});t(n,r,i)}}),t(n,r,e)}),i.findProperties(e,"_links",function(e,i,s){Object.keys(e).forEach(function(n){var s=e[n];n in i||t(i,n,u.make(o(function(){return s.deprecation&&a(n,s.deprecation),s.templated===!0?r(f)({path:s.href}):f({path:s.href})})))}),t(i,s,e),t(i,"clientFor",function(t,i){var o=e[t];if(!o)throw new Error("Unknown relationship: "+t);return o.deprecation&&a(t,o.deprecation),o.templated===!0?r(i||f,{template:o.href}):n(i||f,{prefix:o.href})}),t(i,"requestFor",function(e,t,n){var r=this.clientFor(e,n);return r(t)})}),e})})},write:function(e,t){return t.registry.lookup(t.mime.suffix).then(function(n){return n.write(e,t)})}}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../../../interceptor/pathPrefix":26,"../../../interceptor/template":27,"../../../util/find":53,"../../../util/lazyPromise":54,"../../../util/responsePromise":57,when:52}],31:[function(e,t,n){!function(e){"use strict";e(function(){function e(t,n){return{read:function(e){return JSON.parse(e,t)},write:function(e){return JSON.stringify(e,n)},extend:e}}return e()})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],32:[function(e,t,n){!function(e){"use strict";e(function(){function e(e){return e=encodeURIComponent(e),e.replace(r,"+")}function t(e){return e=e.replace(i," "),decodeURIComponent(e)}function n(t,r,i){return Array.isArray(i)?i.forEach(function(e){t=n(t,r,e)}):(t.length>0&&(t+="&"),t+=e(r),void 0!==i&&null!==i&&(t+="="+e(i))),t}var r,i;return r=/%20/g,i=/\+/g,{read:function(e){var n={};return e.split("&").forEach(function(e){var r,i,o;r=e.split("="),i=t(r[0]),o=2===r.length?t(r[1]):null,i in n?(Array.isArray(n[i])||(n[i]=[n[i]]),n[i].push(o)):n[i]=o}),n},write:function(e){var t="";return Object.keys(e).forEach(function(r){t=n(t,r,e[r])}),t}}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],33:[function(e,t,n){!function(e){"use strict";e(function(){function e(e){return e&&1===e.nodeType&&"FORM"===e.tagName}function t(e){var t,n=new FormData;for(var r in e)e.hasOwnProperty(r)&&(t=e[r],t instanceof File?n.append(r,t,t.name):t instanceof Blob?n.append(r,t):n.append(r,String(t)));return n}return{write:function(n){if("undefined"==typeof FormData)throw new Error("The multipart/form-data mime serializer requires FormData support");if(n instanceof FormData)return n;if(e(n))return new FormData(n);if("object"==typeof n&&null!==n)return t(n);throw new Error("Unable to create FormData from object "+n)}}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],34:[function(e,t,n){!function(e){"use strict";e(function(){return{read:function(e){return e},write:function(e){return e.toString()}}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{}],35:[function(e,t,n){!function(e){"use strict";e(function(e){var t=e("./makePromise"),n=e("./Scheduler"),r=e("./env").asap;return t({scheduler:new n(r)})})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"./Scheduler":36,"./env":48,"./makePromise":50}],36:[function(e,t,n){!function(e){"use strict";e(function(){function e(e){this._async=e,this._running=!1,this._queue=this,this._queueLen=0,this._afterQueue={},this._afterQueueLen=0;var t=this;this.drain=function(){t._drain()}}return e.prototype.enqueue=function(e){this._queue[this._queueLen++]=e,this.run()},e.prototype.afterQueue=function(e){this._afterQueue[this._afterQueueLen++]=e,this.run()},e.prototype.run=function(){this._running||(this._running=!0,this._async(this.drain))},e.prototype._drain=function(){for(var e=0;e<this._queueLen;++e)this._queue[e].run(),this._queue[e]=void 0;for(this._queueLen=0,this._running=!1,e=0;e<this._afterQueueLen;++e)this._afterQueue[e].run(),this._afterQueue[e]=void 0;this._afterQueueLen=0},e})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],37:[function(e,t,n){!function(e){"use strict";e(function(){function e(t){Error.call(this),this.message=t,this.name=e.name,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],38:[function(e,t,n){!function(e){"use strict";e(function(){function e(e,n){function r(t,r,o){var u=e._defer(),s=o.length,c=new Array(s);return i({f:t,thisArg:r,args:o,params:c,i:s-1,call:n},u._handler),u}function i(t,r){if(t.i<0)return n(t.f,t.thisArg,t.params,r);var i=e._handler(t.args[t.i]);i.fold(o,t,void 0,r)}function o(e,t,n){e.params[e.i]=t,e.i-=1,i(e,n)}return arguments.length<2&&(n=t),r}function t(e,t,n,r){try{r.resolve(e.apply(t,n))}catch(i){r.reject(i)}}return e.tryCatchResolve=t,e})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],39:[function(e,t,n){!function(e){"use strict";e(function(e){var t=e("../state"),n=e("../apply");return function(e){function r(t){function n(e){f=null,this.resolve(e)}function r(e){this.resolved||(f.push(e),0===--a&&this.reject(f))}for(var i,o,u=e._defer(),s=u._handler,c=t.length>>>0,a=c,f=[],l=0;c>l;++l)if(o=t[l],void 0!==o||l in t){if(i=e._handler(o),i.state()>0){s.become(i),e._visitRemaining(t,l,i);break}i.visit(s,n,r)}else--a;return 0===a&&s.reject(new RangeError("any(): array must not be empty")),u}function i(t,n){function r(e){this.resolved||(f.push(e),0===--d&&(l=null,this.resolve(f)))}function i(e){this.resolved||(l.push(e),0===--o&&(f=null,this.reject(l)))}var o,u,s,c=e._defer(),a=c._handler,f=[],l=[],p=t.length>>>0,d=0;for(s=0;p>s;++s)u=t[s],(void 0!==u||s in t)&&++d;for(n=Math.max(n,0),o=d-n+1,d=Math.min(n,d),n>d?a.reject(new RangeError("some(): array must contain at least "+n+" item(s), but had "+d)):0===d&&a.resolve(f),s=0;p>s;++s)u=t[s],(void 0!==u||s in t)&&e._handler(u).visit(a,r,i,a.notify);return c}function o(t,n){return e._traverse(n,t)}function u(t,n){var r=g.call(t);return e._traverse(n,r).then(function(e){return s(r,e)})}function s(t,n){for(var r=n.length,i=new Array(r),o=0,u=0;r>o;++o)n[o]&&(i[u++]=e._handler(t[o]).value);return i.length=u,i}function c(e){return m(e.map(a))}function a(n){var r=e._handler(n);return 0===r.state()?h(n).then(t.fulfilled,t.rejected):(r._unreport(),t.inspect(r))}function f(e,t){return arguments.length>2?y.call(e,p(t),arguments[2]):y.call(e,p(t))}function l(e,t){return arguments.length>2?v.call(e,p(t),arguments[2]):v.call(e,p(t))}function p(e){return function(t,n,r){return d(e,void 0,[t,n,r])}}var d=n(e),h=e.resolve,m=e.all,y=Array.prototype.reduce,v=Array.prototype.reduceRight,g=Array.prototype.slice;return e.any=r,e.some=i,e.settle=c,e.map=o,e.filter=u,e.reduce=f,e.reduceRight=l,e.prototype.spread=function(e){return this.then(m).then(function(t){return e.apply(this,t)})},e}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../apply":38,"../state":51}],40:[function(e,t,n){!function(e){"use strict";e(function(){function e(){throw new TypeError("catch predicate must be a function")}function t(e,t){return n(t)?e instanceof t:t(e)}function n(e){return e===Error||null!=e&&e.prototype instanceof Error}function r(e){return("object"==typeof e||"function"==typeof e)&&null!==e}function i(e){return e}return function(n){function o(e,n){return function(r){return t(r,n)?e.call(this,r):a(r)}}function u(e,t,n,i){var o=e.call(t);return r(o)?s(o,n,i):n(i)}function s(e,t,n){return c(e).then(function(){return t(n)})}var c=n.resolve,a=n.reject,f=n.prototype["catch"];return n.prototype.done=function(e,t){this._handler.visit(this._handler.receiver,e,t)},n.prototype["catch"]=n.prototype.otherwise=function(t){return arguments.length<2?f.call(this,t):"function"!=typeof t?this.ensure(e):f.call(this,o(arguments[1],t))},n.prototype["finally"]=n.prototype.ensure=function(e){return"function"!=typeof e?this:this.then(function(t){return u(e,this,i,t)},function(t){return u(e,this,a,t)})},n.prototype["else"]=n.prototype.orElse=function(e){return this.then(void 0,function(){return e})},n.prototype["yield"]=function(e){return this.then(function(){return e})},n.prototype.tap=function(e){return this.then(e)["yield"](this)},n}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],41:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){return e.prototype.fold=function(t,n){var r=this._beget();return this._handler.fold(function(n,r,i){e._handler(n).fold(function(e,n,r){r.resolve(t.call(this,n,e))},r,this,i)},n,r._handler.receiver,r._handler),r},e}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],42:[function(e,t,n){!function(e){"use strict";e(function(e){var t=e("../state").inspect;return function(e){return e.prototype.inspect=function(){return t(e._handler(this))},e}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../state":51}],43:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){function t(e,t,r,i){return n(function(t){return[t,e(t)]},t,r,i)}function n(e,t,i,o){function u(o,u){return r(i(o)).then(function(){return n(e,t,i,u)})}return r(o).then(function(n){return r(t(n)).then(function(t){return t?n:r(e(n)).spread(u)})})}var r=e.resolve;return e.iterate=t,e.unfold=n,e}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],44:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){return e.prototype.progress=function(e){return this.then(void 0,void 0,e)},e}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],45:[function(e,t,n){!function(e){"use strict";e(function(e){function t(e,t,r,i){return n.setTimer(function(){e(r,i,t)},t)}var n=e("../env"),r=e("../TimeoutError");return function(e){function i(e,n,r){t(o,e,n,r)}function o(e,t){t.resolve(e)}function u(e,t,n){var i="undefined"==typeof e?new r("timed out after "+n+"ms"):e;t.reject(i)}return e.prototype.delay=function(e){var t=this._beget();return this._handler.fold(i,e,void 0,t._handler),t},e.prototype.timeout=function(e,r){var i=this._beget(),o=i._handler,s=t(u,e,r,i._handler);return this._handler.visit(o,function(e){n.clearTimer(s),this.resolve(e)},function(e){n.clearTimer(s),this.reject(e)},o.notify),i},e}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../TimeoutError":37,"../env":48}],46:[function(e,t,n){!function(e){"use strict";e(function(e){function t(e){throw e}function n(){}var r=e("../env").setTimer,i=e("../format");return function(e){function o(e){e.handled||(d.push(e),f("Potentially unhandled rejection ["+e.id+"] "+i.formatError(e.value)))}function u(e){var t=d.indexOf(e);t>=0&&(d.splice(t,1),l("Handled previous rejection ["+e.id+"] "+i.formatObject(e.value)))}function s(e,t){p.push(e,t),null===h&&(h=r(c,0))}function c(){for(h=null;p.length>0;)p.shift()(p.shift())}var a,f=n,l=n;"undefined"!=typeof console&&(a=console,f="undefined"!=typeof a.error?function(e){a.error(e)}:function(e){a.log(e)},l="undefined"!=typeof a.info?function(e){a.info(e)}:function(e){a.log(e)}),e.onPotentiallyUnhandledRejection=function(e){s(o,e)},e.onPotentiallyUnhandledRejectionHandled=function(e){s(u,e)},e.onFatalRejection=function(e){s(t,e.value)};var p=[],d=[],h=null;return e}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})},{"../env":48,"../format":49}],47:[function(e,t,n){!function(e){"use strict";e(function(){return function(e){return e.prototype["with"]=e.prototype.withThis=function(e){var t=this._beget(),n=t._handler;return n.receiver=e,this._handler.chain(n,e),t},e}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],48:[function(e,t,n){(function(n){!function(e){"use strict";e(function(e){function t(){return"undefined"!=typeof n&&"[object process]"===Object.prototype.toString.call(n)}function r(){return"function"==typeof MutationObserver&&MutationObserver||"function"==typeof WebKitMutationObserver&&WebKitMutationObserver}function i(e){function t(){var e=n;n=void 0,e()}var n,r=document.createTextNode(""),i=new e(t);i.observe(r,{characterData:!0});var o=0;return function(e){n=e,r.data=o^=1}}var o,u="undefined"!=typeof setTimeout&&setTimeout,s=function(e,t){return setTimeout(e,t)},c=function(e){return clearTimeout(e)},a=function(e){return u(e,0)};if(t())a=function(e){return n.nextTick(e)};else if(o=r())a=i(o);else if(!u){var f=e,l=f("vertx");s=function(e,t){return l.setTimer(t,e)},c=l.cancelTimer,a=l.runOnLoop||l.runOnContext}return{setTimer:s,clearTimer:c,asap:a}})}("function"==typeof define&&define.amd?define:function(n){t.exports=n(e)})}).call(this,e("_process"))},{_process:5}],49:[function(e,t,n){!function(e){"use strict";e(function(){function e(e){var n="object"==typeof e&&null!==e&&(e.stack||e.message)?e.stack||e.message:t(e);return e instanceof Error?n:n+" (WARNING: non-Error used)"}function t(e){var t=String(e);return"[object Object]"===t&&"undefined"!=typeof JSON&&(t=n(e,t)),t}function n(e,t){try{return JSON.stringify(e)}catch(n){return t}}return{formatError:e,formatObject:t,tryStringify:n}})}("function"==typeof define&&define.amd?define:function(e){t.exports=e()})},{}],50:[function(e,t,n){(function(e){!function(t){"use strict";t(function(){return function(t){function n(e,t){this._handler=e===b?t:r(e)}function r(e){function t(e){i.resolve(e)}function n(e){i.reject(e)}function r(e){i.notify(e)}var i=new _;try{e(t,n,r)}catch(o){n(o)}return i}function i(e){return D(e)?e:new n(b,new E(v(e)))}function o(e){return new n(b,new E(new O(e)))}function u(){return ee}function s(){return new n(b,new _)}function c(e,t){var n=new _(e.receiver,e.join().context);return new t(b,n)}function a(e){return l(G,null,e)}function f(e,t){return l(F,e,t)}function l(e,t,r){function i(n,i,u){u.resolved||p(r,o,n,e(t,i,n),u)}function o(e,t,n){f[e]=t,0===--a&&n.become(new T(f))}for(var u,s="function"==typeof t?i:o,c=new _,a=r.length>>>0,f=new Array(a),l=0;l<r.length&&!c.resolved;++l)u=r[l],void 0!==u||l in r?p(r,s,l,u,c):--a;return 0===a&&c.become(new T(f)),new n(b,c)}function p(e,t,n,r,i){if(I(r)){var o=g(r),u=o.state();0===u?o.fold(t,n,void 0,i):u>0?t(n,o.value,i):(i.become(o),d(e,n+1,o))}else t(n,r,i)}function d(e,t,n){for(var r=t;r<e.length;++r)h(v(e[r]),n)}function h(e,t){if(e!==t){var n=e.state();0===n?e.visit(e,void 0,e._unreport):0>n&&e._unreport()}}function m(e){return"object"!=typeof e||null===e?o(new TypeError("non-iterable passed to race()")):0===e.length?u():1===e.length?i(e[0]):y(e)}function y(e){var t,r,i,o=new _;for(t=0;t<e.length;++t)if(r=e[t],void 0!==r||t in e){if(i=v(r),0!==i.state()){o.become(i),d(e,t+1,i);break}i.visit(o,o.resolve,o.reject)}return new n(b,o)}function v(e){return D(e)?e._handler.join():I(e)?w(e):new T(e)}function g(e){return D(e)?e._handler.join():w(e)}function w(e){try{var t=e.then;return"function"==typeof t?new j(t,e):new T(e)}catch(n){return new O(n)}}function b(){}function x(){}function _(e,t){n.createContext(this,t),this.consumers=void 0,this.receiver=e,this.handler=void 0,this.resolved=!1}function E(e){this.handler=e}function j(e,t){_.call(this),W.enqueue(new R(e,t,this))}function T(e){n.createContext(this),this.value=e}function O(e){n.createContext(this),this.id=++X,this.value=e,this.handled=!1,this.reported=!1,this._report()}function A(e,t){this.rejection=e,this.context=t}function S(e){this.rejection=e}function L(){return new O(new TypeError("Promise cycle"))}function k(e,t){this.continuation=e,this.handler=t}function C(e,t){this.handler=t,this.value=e}function R(e,t,n){this._then=e,this.thenable=t,this.resolver=n}function P(e,t,n,r,i){try{e.call(t,n,r,i)}catch(o){r(o)}}function q(e,t,n,r){this.f=e,this.z=t,this.c=n,this.to=r,this.resolver=Z,this.receiver=this}function D(e){return e instanceof n}function I(e){return("object"==typeof e||"function"==typeof e)&&null!==e}function U(e,t,r,i){return"function"!=typeof e?i.become(t):(n.enterContext(t),M(e,t.value,r,i),void n.exitContext())}function z(e,t,r,i,o){return"function"!=typeof e?o.become(r):(n.enterContext(r),H(e,t,r.value,i,o),void n.exitContext())}function N(e,t,r,i,o){ret